| From: |
| Jim Mattson <jmattson-AT-google.com> |
| To: |
| seanjc-AT-google.com, pbonzini-AT-redhat.com, tglx-AT-kernel.org, mingo-AT-redhat.com, bp-AT-alien8.de, dave.hansen-AT-linux.intel.com, x86-AT-kernel.org, hpa-AT-zytor.com, shuah-AT-kernel.org, kvm-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-kselftest-AT-vger.kernel.org, ctpence-AT-google.com, David.Kaplan-AT-amd.com, binbin.wu-AT-linux.intel.com |
| Subject: |
| [PATCH v4 0/5] KVM: x86: Virtualize AMD's "disable CPUID in usermode" |
| Date: |
| Wed, 27 May 2026 10:43:42 -0700 |
| Message-ID: |
| <20260527174347.2356165-1-jmattson@google.com> |
| Cc: |
| Jim Mattson <jmattson-AT-google.com> |
| Archive-link: |
| Article |
AMD's "disable CPUID in usermode" feature is analogous to Intel's "CPUID
faulting" feature, but it is advertised and activated differently. The AMD
feature is advertised via CPUID.80000021H:EAX.CpuidUserDis[bit 17] and
activated by setting HWCR.CpuidUserDis[bit 35].
Add virtualization support for the AMD feature.
v3 -> v4:
* Fix typo in commit message for patch 1 [Binbin]
* Fix #GP/CPUID VM-exit precedence in nested VMX [Sashiko]
* Add EXPORT_STATIC_CALL_GPL(kvm_x86_get_cpl)
v1: https://lore.kernel.org/kvm/20260402223108.650572-1-jmatt...
v2: https://lore.kernel.org/kvm/20260508170714.489136-1-jmatt...
v3: https://lore.kernel.org/kvm/20260513224608.1859737-1-jmat...
Jim Mattson (4):
KVM: x86: Prioritize CPUID faulting over CPUID VM-exits in nested VMX
KVM: x86: Remove supports_cpuid_fault() helper
KVM: x86: Virtualize AMD CPUID faulting
KVM: selftests: Update hwcr_msr_test for CPUID faulting bit
Sean Christopherson (1):
KVM: x86: Consolidate CPUID fault handling for emulator and
interception logic
arch/x86/include/asm/kvm_host.h | 1 -
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/kvm/cpuid.c | 7 ++--
arch/x86/kvm/cpuid.h | 14 ++++---
arch/x86/kvm/emulate.c | 6 +--
arch/x86/kvm/kvm_emulate.h | 1 +
arch/x86/kvm/vmx/nested.c | 2 +
arch/x86/kvm/x86.c | 39 ++++++++++---------
.../selftests/kvm/include/x86/processor.h | 1 +
.../testing/selftests/kvm/x86/hwcr_msr_test.c | 9 ++++-
10 files changed, 46 insertions(+), 35 deletions(-)
--
2.54.0.794.g4f17f83d09-goog