mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yan Zhao <yan.y.zhao@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
	<seanjc@google.com>
Subject: Re: [PATCH v2 0/4] KVM: x86: Introduce quirk KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT
Date: Mon, 3 Mar 2025 09:47:24 +0800	[thread overview]
Message-ID: <Z8UKLApAd/J0sWX1@yzhao56-desk.sh.intel.com> (raw)
In-Reply-To: <20250301073428.2435768-1-pbonzini@redhat.com>

On Sat, Mar 01, 2025 at 02:34:24AM -0500, Paolo Bonzini wrote:
> This series is my evolution of Yan's patches at
> https://patchew.org/linux/20250224070716.31360-1-yan.y.zhao@intel.com/.
Hi Paolo,
Thanks for helping refining the patches!

Here's a summary of my comments:
1. This is confusing for KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT to be present
   on AMD's platforms while not present on Intel's non-self-snoop platforms.
   (patch 2)

2. Could we make KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT and
   KVM_X86_QUIRK_SLOT_ZAP_ALL always-disabled for TDs? (patch 4)

3. kvm_caps.inapplicable_quirks may not be necessary. (patches 1/3)

Thanks
Yan
> 
> The implementation of the quirk is unchanged, but the concepts in kvm_caps
> are a bit different.  In particular:
> 
> - if a quirk is not applicable to some hardware, it is still included
>   in KVM_CAP_DISABLE_QUIRKS2.  This way userspace knows that KVM is
>   *aware* of a particular issue - even if disabling it has no effect
>   because the quirk is not a problem on a specific hardware, userspace
>   may want to know that it can rely on the problematic behavior not
>   being present.  Therefore, KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT is
>   simply auto-disabled on TDX machines.
>
> - if instead a quirk cannot be disabled due to limitations, for example
>   KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT if self-snoop is not present on
>   the CPU, the quirk is removed completely from kvm_caps.supported_quirks
>   and therefore from KVM_CAP_DISABLE_QUIRKS2.
> 
> This series does not introduce a way to query always-disabled quirks,
> which could be for example KVM_CAP_DISABLED_QUIRKS.  This could be
> added if we wanted for example to get rid of hypercall patching; it's
> a trivial addition.

> 
> Paolo Bonzini (1):
>   KVM: x86: Allow vendor code to disable quirks
> 
> Yan Zhao (3):
>   KVM: x86: Introduce supported_quirks to block disabling quirks
>   KVM: x86: Introduce Intel specific quirk
>     KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT
>   KVM: TDX: Always honor guest PAT on TDX enabled platforms
> 
>  Documentation/virt/kvm/api.rst  | 22 ++++++++++++++++++
>  arch/x86/include/uapi/asm/kvm.h |  1 +
>  arch/x86/kvm/mmu.h              |  2 +-
>  arch/x86/kvm/mmu/mmu.c          | 11 +++++----
>  arch/x86/kvm/svm/svm.c          |  1 +
>  arch/x86/kvm/vmx/tdx.c          |  6 +++++
>  arch/x86/kvm/vmx/vmx.c          | 40 +++++++++++++++++++++++++++------
>  arch/x86/kvm/x86.c              | 10 +++++----
>  arch/x86/kvm/x86.h              | 14 +++++++-----
>  9 files changed, 86 insertions(+), 21 deletions(-)
> 
> -- 
> 2.43.5
> 

      parent reply	other threads:[~2025-03-03  1:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01  7:34 Paolo Bonzini
2025-03-01  7:34 ` [PATCH 1/4] KVM: x86: Allow vendor code to disable quirks Paolo Bonzini
2025-03-02 17:11   ` Xiaoyao Li
2025-03-03  1:15   ` Yan Zhao
2025-03-03 16:04     ` Paolo Bonzini
2025-03-04  6:46       ` Yan Zhao
2025-03-01  7:34 ` [PATCH 2/4] KVM: x86: Introduce supported_quirks to block disabling quirks Paolo Bonzini
2025-03-02 17:13   ` Xiaoyao Li
2025-03-03  1:23   ` Yan Zhao
2025-03-03 16:11     ` Paolo Bonzini
2025-03-04  4:21       ` Yan Zhao
2025-03-01  7:34 ` [PATCH 3/4] KVM: x86: Introduce Intel specific quirk KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT Paolo Bonzini
2025-03-02 17:30   ` Xiaoyao Li
2025-03-03  1:25   ` Yan Zhao
2025-03-01  7:34 ` [PATCH 4/4] KVM: TDX: Always honor guest PAT on TDX enabled platforms Paolo Bonzini
2025-03-02 17:03   ` Xiaoyao Li
2025-03-03  1:30   ` Yan Zhao
2025-03-03 16:14     ` Paolo Bonzini
2025-03-04  6:20       ` Yan Zhao
2025-03-03  1:47 ` Yan Zhao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z8UKLApAd/J0sWX1@yzhao56-desk.sh.intel.com \
    --to=yan.y.zhao@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®