diff options
| author | Jim Mattson <[email protected]> | 2022-09-29 15:52:01 -0700 |
|---|---|---|
| committer | Paolo Bonzini <[email protected]> | 2022-10-22 07:54:36 -0400 |
| commit | 079f6889818dd07903fb36c252532ab47ebb6d48 (patch) | |
| tree | b522689a5f8b1c42a332fdeb26cd22633cd21a63 | |
| parent | 7030d8530e533844e2f4b0e7476498afcd324634 (diff) | |
KVM: x86: Mask off reserved bits in CPUID.8000001AH
KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM
actually supports. In the case of CPUID.8000001AH, only three bits are
currently defined. The 125 reserved bits should be masked off.
Fixes: 24c82e576b78 ("KVM: Sanitize cpuid")
Signed-off-by: Jim Mattson <[email protected]>
Message-Id: <[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
| -rw-r--r-- | arch/x86/kvm/cpuid.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 489c028859e1..a0292ba650df 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -1189,6 +1189,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) entry->ecx = entry->edx = 0; break; case 0x8000001a: + entry->eax &= GENMASK(2, 0); + entry->ebx = entry->ecx = entry->edx = 0; + break; case 0x8000001e: break; case 0x8000001F: |