kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] KVM: x86: Mask off reserved bits in CPUID.80000001H
@ 2022-09-29 22:51 Jim Mattson
  2022-09-29 22:51 ` [PATCH 2/6] KVM: x86: Mask off reserved bits in CPUID.80000006H Jim Mattson
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Jim Mattson @ 2022-09-29 22:51 UTC (permalink / raw)
  To: kvm, pbonzini, seanjc; +Cc: Jim Mattson

KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM
actually supports. CPUID.80000001:EBX[27:16] are reserved bits and
should be masked off.

Fixes: 0771671749b5 ("KVM: Enhance guest cpuid management")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/cpuid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 4c1c2c06e96b..ea4e213bcbfb 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1119,6 +1119,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
 			entry->eax = max(entry->eax, 0x80000021);
 		break;
 	case 0x80000001:
+		entry->ebx &= ~GENMASK(27, 16);
 		cpuid_entry_override(entry, CPUID_8000_0001_EDX);
 		cpuid_entry_override(entry, CPUID_8000_0001_ECX);
 		break;
-- 
2.38.0.rc1.362.ged0d419d3c-goog


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-10-22 10:27 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 22:51 [PATCH 1/6] KVM: x86: Mask off reserved bits in CPUID.80000001H Jim Mattson
2022-09-29 22:51 ` [PATCH 2/6] KVM: x86: Mask off reserved bits in CPUID.80000006H Jim Mattson
2022-09-30 21:20   ` Dong, Eddie
2022-09-30 23:12     ` Jim Mattson
2022-09-30 23:59       ` Dong, Eddie
2022-10-01  0:35         ` Jim Mattson
2022-10-03 19:35           ` Dong, Eddie
2022-10-03 20:18             ` Jim Mattson
2022-10-05  0:08               ` Dong, Eddie
2022-10-05  2:59                 ` Jim Mattson
2022-10-05 17:09                   ` Dong, Eddie
2022-10-19 22:42   ` Sean Christopherson
2022-09-29 22:52 ` [PATCH 3/6] KVM: x86: Mask off reserved bits in CPUID.80000008H Jim Mattson
2022-10-19 22:49   ` Sean Christopherson
2022-09-29 22:52 ` [PATCH 4/6] KVM: x86: Mask off reserved bits in CPUID.8000001AH Jim Mattson
2022-09-29 22:52 ` [PATCH 5/6] KVM: x86: Mask off reserved bits in CPUID.8000001EH Jim Mattson
2022-10-19 22:53   ` Sean Christopherson
2022-10-22  8:26     ` Paolo Bonzini
2022-09-29 22:52 ` [PATCH 6/6] KVM: x86: Mask off reserved bits in CPUID.8000001FH Jim Mattson
2022-10-22  8:34   ` Paolo Bonzini
2022-09-30 21:04 ` [PATCH 1/6] KVM: x86: Mask off reserved bits in CPUID.80000001H Dong, Eddie
2022-09-30 23:14   ` Jim Mattson
2022-10-19 22:58 ` Sean Christopherson
2022-10-22  8:36   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).