RE: [PATCH 1/6] KVM: x86: Mask off reserved bits in CPUID.80000001H

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Jim Mattson <jmattson@xxxxxxxxxx>
> Sent: Thursday, September 29, 2022 3:52 PM
> To: kvm@xxxxxxxxxxxxxxx; pbonzini@xxxxxxxxxx; Christopherson,, Sean
> <seanjc@xxxxxxxxxx>
> Cc: Jim Mattson <jmattson@xxxxxxxxxx>
> Subject: [PATCH 1/6] KVM: x86: Mask off reserved bits in CPUID.80000001H
> 
> 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@xxxxxxxxxx>
> ---
>  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);

ebx of leaf 0x80000001 is reserved, at least from SDM of Intel processor. Do I miss something?

>  		cpuid_entry_override(entry, CPUID_8000_0001_EDX);
>  		cpuid_entry_override(entry, CPUID_8000_0001_ECX);
>  		break;
> --
> 2.38.0.rc1.362.ged0d419d3c-goog





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux