Re: [PATCH 2/2] KVM: x86: Explicitly set eax and ebx to 0 when X86_FEATURE_PERFMON_V2 cannot be exposed to guest

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

 



On Tue, Mar 04, 2025, Xiaoyao Li wrote:
> It wrongly exposes the host ebx value of leaf 0x80000022 to userspace
> when it's supposed to return 0.
> 
> Fixes: 94cdeebd8211 ("KVM: x86/cpuid: Add AMD CPUID ExtPerfMonAndDbg leaf 0x80000022")
> Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>
> ---
>  arch/x86/kvm/cpuid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index f9a9175e3fe8..5e4d4934c0d3 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -1767,7 +1767,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
>  
>  		entry->ecx = entry->edx = 0;
>  		if (!enable_pmu || !kvm_cpu_cap_has(X86_FEATURE_PERFMON_V2)) {
> -			entry->eax = entry->ebx;

Ugh, that typo came from me:

https://lore.kernel.org/all/Y1sIHXX3HEJEXJm+@xxxxxxxxxx

> +			entry->eax = entry->ebx = 0;
>  			break;
>  		}
>  
> -- 
> 2.34.1
> 




[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