KVM: pass through CPUID 0x80000005
PATCH 1/1 KVM: pass through CPUID 0x80000005
Pass CPUID 0x80000005 (L1 cache and TLB info).
CPUID 0x80000006 (L2 cache and TLB and L3 cache info) has been returned since commit 43d05de2bee7 ("KVM: pass through CPUID(0x80000006)"). Enumerating both 0x80000005 and 0x80000006 with KVM_GET_SUPPORTED_CPUID would be better than reporting either, and 0x80000005 could be helpful for VMM to pass it to KVM_SET_CPUID{,2} for the same reason with 0x80000006..
---
Discussion was made a bit on
https://lore.kernel.org/all/[email protected]/.
If there is any reason that leaf 0x80000005 should not be enumerated or dropping leaf 0x80000006 is preferred, please feel free to share your thoughts.
--- arch/x86/kvm/cpuid.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/cpuid.c +3 -0
@@ -1152,6 +1152,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)cpuid_entry_override (entry,CPUID_8000_0001_EDX );cpuid_entry_override (entry,CPUID_8000_0001_ECX );break ; +case 0x80000005 : +/* Pass host L1 cache and TLB info. */ +break ;case 0x80000006 :/* Drop reserved bits, pass host L2 cache and TLB info. */ entry->edx &= ~GENMASK (17 ,16 );
Signature · 1 line
2.38.0
Quoted 10 lines · Takahiro Itazuri
Pass CPUID
0x80000005(L1 cache and TLB info).CPUID
0x80000006(L2 cache and TLB and L3 cache info) has been returned since commit43d05de2bee7("KVM: pass through CPUID(0x80000006)"). Enumerating both0x80000005and0x80000006withKVM_GET_SUPPORTED_CPUIDwould be better than reporting either, and0x80000005could be helpful for VMM to pass it to KVM_SET_CPUID{,2} for the same reason with0x80000006..[...]
Applied to kvm-x86 misc, thanks!
[1/1] KVM: pass through CPUID 0x80000005
https://github.com/kvm-x86/linux/commit/af8e2ccfa6f1
--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes