This series is my evolution of Yan's patches at https://patchew.org/linux/20250224070716.31360-1-yan.y.zhao@xxxxxxxxx/. 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