From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E995C77B61 for ; Mon, 10 Apr 2023 23:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229743AbjDJXb2 (ORCPT ); Mon, 10 Apr 2023 19:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbjDJXb1 (ORCPT ); Mon, 10 Apr 2023 19:31:27 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E821FD7 for ; Mon, 10 Apr 2023 16:31:24 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id p5-20020a17090a428500b002400d8a8d1dso3550139pjg.7 for ; Mon, 10 Apr 2023 16:31:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681169483; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=rr1CIFtVTdjqLI7dwqPzvS7cU0W17pkXfsKjFMd7v0k=; b=n2uZem2EWeXRVBaq9BmZVKAbxgj92XeXqw0FPrD7wqb9ZhQV2Rqyb/c/gRBpbmDN5P DfgvFer+5dE6yvaRTw7NdShhLqC27wDTIbsceGUDGFSBTCWuYm/G654Mq09LjV/EzIZT XVjDQqUJ29kb5vufr+Bn/nurajsLo5RwEJ1AuA9l/Gqb4zfOEd61rJ1WINL69sYdVfHa sEzhq7MFL/TNyxOwAN+L+kazRTThaxn3XyUXTZ1SkOHRUCyDVRiKAP2S0HNuJOdRN59q 3kGIazWVRFEZkNPE6PjCL2Dlp44mfvhkWIsiZNKpCMb4JOzRDgyxA3ayTL2kMK3fQ2Jo EAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681169483; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rr1CIFtVTdjqLI7dwqPzvS7cU0W17pkXfsKjFMd7v0k=; b=nOjlHRaLN9Su9opgiFnJ6wkW1IZ9tCZq1pXyByiSDkC2SLfP+JiGMjmOFxCJuoo2NH IqjxyhwYW/P4VTiF5yUpMuBbXOb2OI45SnFzK+isKjL1kTZY4e9KyeaFHmlah+nVy+jy ZyoV/O44mY6Uw5JMxPmeXlONcpNqHRyYQWJW3ZjYvTDbkTFkdtgfudekTpk9mNoyIkeb A/7EUXYNAqwxY68/ygFc0ZjbcdiEA30IGjw0s3IqNZLIdsB+/XumNsrCKrxJYmZttwz1 JVS467yFBr9T4vNFqI2UsLaxE7BHWTUoPeKTgbwVLpZcW0+3xwpoXSZG8obCxf3PMm0c kmvg== X-Gm-Message-State: AAQBX9e6voqGcjxUGoViEZQIcB+qpbTAxc6YSWv38o5ce4xYrzsGuzCJ gM+NPHrBp2PG6B1+NZ9exGMmVxxEd0g= X-Google-Smtp-Source: AKy350bdb0W1qwW783P0cLVSX3bBBaS+dWUsv+q2/D31Nq7LesVUBlQvOVteNoKHAR40lbgtWYbznUs7JmU= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:445:b0:1a0:5402:b17b with SMTP id iw5-20020a170903044500b001a05402b17bmr2823543plb.0.1681169483722; Mon, 10 Apr 2023 16:31:23 -0700 (PDT) Date: Mon, 10 Apr 2023 16:31:05 -0700 In-Reply-To: <20230405002359.418138-1-seanjc@google.com> Mime-Version: 1.0 References: <20230405002359.418138-1-seanjc@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Message-ID: <168116572088.1038076.7789958735569045426.b4-ty@google.com> Subject: Re: [PATCH] KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Mathias Krause Content-Type: text/plain; charset="utf-8" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 04 Apr 2023 17:23:59 -0700, Sean Christopherson wrote: > Extend VMX's nested intercept logic for emulated instructions to handle > "pause" interception, in quotes because KVM's emulator doesn't filter out > NOPs when checking for nested intercepts. Failure to allow emulation of > NOPs results in KVM injecting a #UD into L2 on any NOP that collides with > the emulator's definition of PAUSE, i.e. on all single-byte NOPs. > > For PAUSE itself, honor L1's PAUSE-exiting control, but ignore PLE to > avoid unnecessarily injecting a #UD into L2. Per the SDM, the first > execution of PAUSE after VM-Entry is treated as the beginning of a new > loop, i.e. will never trigger a PLE VM-Exit, and so L1 can't expect any > given execution of PAUSE to deterministically exit. > > [...] Applied to kvm-x86 vmx. I haven't gotten any reviews, but the FEP changes in KUT will cause the nVMX test to fail, so I want to get kvm-x86/next fixed sooner than later. I'm not expecting anything else for "vmx", so unwinding should be easy if it turns out this is busted/flawed. [1/1] KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted https://github.com/kvm-x86/linux/commit/84f481315b10 -- https://github.com/kvm-x86/linux/tree/next https://github.com/kvm-x86/linux/tree/fixes