From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: xiaoyao.li@intel.com, seanjc@google.com, yan.y.zhao@intel.com
Subject: [PATCH v3 0/4] KVM: x86: Introduce quirk KVM_X86_QUIRK_IGNORE_GUEST_PAT
Date: Tue, 4 Mar 2025 01:06:41 -0500 [thread overview]
Message-ID: <20250304060647.2903469-1-pbonzini@redhat.com> (raw)
This series is my evolution of Yan's patches at
https://patchew.org/linux/20250224070716.31360-1-yan.y.zhao@intel.com/.
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.
The main semantic change with respect to v2 is to prevent re-enabling
quirks that have been disabled with KVM_ENABLE_CAP. This in turn makes
it possible to just use kvm->arch.disabled_quirks for TDX-enabled
Paolo
Supersedes: <20250301073428.2435768-1-pbonzini@redhat.com>
Paolo Bonzini (3):
KVM: x86: do not allow re-enabling quirks
KVM: x86: Allow vendor code to disable quirks
KVM: x86: remove shadow_memtype_mask
Yan Zhao (3):
KVM: x86: Introduce supported_quirks to block disabling quirks
KVM: x86: Introduce Intel specific quirk
KVM_X86_QUIRK_IGNORE_GUEST_PAT
KVM: TDX: Always honor guest PAT on TDX enabled guests
Documentation/virt/kvm/api.rst | 22 +++++++++++++++++
arch/x86/include/asm/kvm_host.h | 7 +++++-
arch/x86/include/uapi/asm/kvm.h | 1 +
arch/x86/kvm/mmu.h | 2 +-
arch/x86/kvm/mmu/mmu.c | 13 ----------
arch/x86/kvm/mmu/spte.c | 19 ++-------------
arch/x86/kvm/mmu/spte.h | 1 -
arch/x86/kvm/svm/svm.c | 1 +
arch/x86/kvm/vmx/tdx.c | 6 +++++
arch/x86/kvm/vmx/vmx.c | 43 +++++++++++++++++++++++++++------
arch/x86/kvm/x86.c | 13 +++++++---
arch/x86/kvm/x86.h | 3 +++
12 files changed, 87 insertions(+), 44 deletions(-)
--
2.43.5
next reply other threads:[~2025-03-04 6:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 6:06 Paolo Bonzini [this message]
2025-03-04 6:06 ` [PATCH v3 1/6] KVM: x86: do not allow re-enabling quirks Paolo Bonzini
2025-03-05 3:20 ` Yan Zhao
2025-03-19 1:20 ` Binbin Wu
2025-03-04 6:06 ` [PATCH v3 2/6] KVM: x86: Allow vendor code to disable quirks Paolo Bonzini
2025-03-04 8:15 ` Yan Zhao
2025-03-04 6:06 ` [PATCH v3 3/6] KVM: x86: Introduce supported_quirks to block disabling quirks Paolo Bonzini
2025-03-05 3:23 ` Yan Zhao
2025-03-04 6:06 ` [PATCH v3 4/6] KVM: x86: Introduce Intel specific quirk KVM_X86_QUIRK_IGNORE_GUEST_PAT Paolo Bonzini
2025-03-05 3:19 ` Yan Zhao
2025-03-04 6:06 ` [PATCH v3 5/6] KVM: x86: remove shadow_memtype_mask Paolo Bonzini
2025-03-04 10:51 ` Yan Zhao
2025-03-04 6:06 ` [PATCH v3 6/6] KVM: TDX: Always honor guest PAT on TDX enabled guests Paolo Bonzini
2025-03-05 2:48 ` Yan Zhao
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=20250304060647.2903469-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=xiaoyao.li@intel.com \
--cc=yan.y.zhao@intel.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®