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 E6C7FC77B70 for ; Mon, 10 Apr 2023 23:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbjDJXb3 (ORCPT ); Mon, 10 Apr 2023 19:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbjDJXb1 (ORCPT ); Mon, 10 Apr 2023 19:31:27 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 340032100 for ; Mon, 10 Apr 2023 16:31:24 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id n11-20020a170902d2cb00b001a64cdd8210so1008451plc.4 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=pIvvPnMmKixPGhErkPDKqVo1zh2uNkgyArmt0Tig+dqrhwQySnQLi4P3JTELZsH272 ovQ7U0epukLEmQLfIBYqKJ/u9roUBmogORfTjswetLRBBsnzD9wLwj1iOg0xPwsxD5wf Coe/d40o767cSAdZ0k8xpuhEaVfrwS8/VpfQDctBYsdszThmh0e87+YWvdEUs+/tXCQH 6L7tRrL3bKkB/sYZz12w4z4a+DuMS74iegyXnmA/pfgsnxGX6sG/+RGK9OIZiPQtLtGN /aHErHp86o4lONaUJI1DT7vCv4geuB+k3YVBDJ3+4G+EM1oED/DEWuS7dWV1e2JTeLe6 /joQ== X-Gm-Message-State: AAQBX9esO8EzH8svJKd7dIyq4Fm0xoyFS5K2biahq7bpyfq/hUJOoqJY cPMg+RznhSDoiCWeGAvfHrxBuV/lOiI= 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: linux-kernel@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