All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anil Altinay <aaltinay@google.com>
To: stable@vger.kernel.org
Cc: Jim Mattson <jmattson@google.com>,
	Sean Christopherson <seanjc@google.com>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org,  Anil Altinay <aaltinay@google.com>
Subject: [PATCH 6.18.y v2 4/6] KVM: x86: Remove supports_cpuid_fault() helper
Date: Thu, 15 Oct 2026 16:03:44 +0000	[thread overview]
Message-ID: <20261015160346.181835-5-aaltinay@google.com> (raw)
In-Reply-To: <20261015160346.181835-1-aaltinay@google.com>

From: Jim Mattson <jmattson@google.com>

commit d1bc99885a59d89e408f52f4c147b07bca9a686f upstream.

The function, supports_cpuid_fault(), tests specifically for guest support
of Intel's CPUID faulting feature. It does not test for guest support of
AMD's CPUID faulting feature.

To avoid confusion, remove the helper.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Link: https://patch.msgid.link/20260527174347.2356165-4-jmattson@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Anil Altinay <aaltinay@google.com>
---
 arch/x86/kvm/cpuid.h | 5 -----
 arch/x86/kvm/x86.c   | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
index c5399ab7e5ae..872bc99c55ed 100644
--- a/arch/x86/kvm/cpuid.h
+++ b/arch/x86/kvm/cpuid.h
@@ -175,11 +175,6 @@ static inline int guest_cpuid_stepping(struct kvm_vcpu *vcpu)
 	return x86_stepping(best->eax);
 }
 
-static inline bool supports_cpuid_fault(struct kvm_vcpu *vcpu)
-{
-	return vcpu->arch.msr_platform_info & MSR_PLATFORM_INFO_CPUID_FAULT;
-}
-
 static inline bool cpuid_fault_enabled(struct kvm_vcpu *vcpu)
 {
 	return vcpu->arch.msr_misc_features_enables &
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6f76290e79c9..a91599e5d8db 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3913,7 +3913,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 	case MSR_MISC_FEATURES_ENABLES:
 		if (data & ~MSR_MISC_FEATURES_ENABLES_CPUID_FAULT ||
 		    (data & MSR_MISC_FEATURES_ENABLES_CPUID_FAULT &&
-		     !supports_cpuid_fault(vcpu)))
+		     !(vcpu->arch.msr_platform_info & MSR_PLATFORM_INFO_CPUID_FAULT)))
 			return 1;
 		vcpu->arch.msr_misc_features_enables = data;
 		break;
-- 
2.56.0.385.gd3acb90ef8-goog


  parent reply	other threads:[~2026-10-15 16:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 16:03 [PATCH 6.18.y v2 0/6] KVM: x86: CPUID faulting fixes and AMD CPUID faulting virtualization Anil Altinay
2026-10-15 16:03 ` [PATCH 6.18.y v2 1/6] KVM: x86: Ignore cpuid faulting in SMM Anil Altinay
2026-10-15 16:03 ` [PATCH 6.18.y v2 2/6] KVM: x86: Consolidate CPUID fault handling for emulator and interception logic Anil Altinay
2026-10-15 16:03 ` [PATCH 6.18.y v2 3/6] KVM: x86: Prioritize CPUID faulting over CPUID VM-exits in nested VMX Anil Altinay
2026-10-15 16:03 ` Anil Altinay [this message]
2026-10-15 16:03 ` [PATCH 6.18.y v2 5/6] KVM: x86: Virtualize AMD CPUID faulting Anil Altinay
2026-10-15 16:03 ` [PATCH 6.18.y v2 6/6] KVM: selftests: Update hwcr_msr_test for CPUID faulting bit Anil Altinay
2026-10-16  1:09 ` [PATCH 6.18.y v2 0/6] KVM: x86: CPUID faulting fixes and AMD CPUID faulting virtualization Sean Christopherson

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=20261015160346.181835-5-aaltinay@google.com \
    --to=aaltinay@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.