kvm: cpuid: Expose leaves 0x80000005 and 0x80000006 to the guest
PATCH 1/1 kvm: cpuid: Expose leaves 0x80000005 and 0x80000006 to the guest
Leaf 0x80000005 is "L1 Cache and TLB Information." Leaf 0x80000006 is "L2 Cache and TLB and L3 Cache Information." Include these leaves in the array returned by KVM_GET_SUPPORTED_CPUID.
--- arch/x86/kvm/cpuid.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/cpuid.c +3 -0
@@ -730,6 +730,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, entry->ecx &= kvm_cpuid_8000_0001_ecx_x86_features;cpuid_mask (&entry->ecx,CPUID_8000_0001_ECX );break ; +case 0x80000005 : +case 0x80000006 : +break ;case 0x80000007 :/* Advanced power management */ /* invariant TSC is CPUID.80000007H:EDX[8] */ entry->edx &= (1 <<8 );
Signature · 1 line
2.23.0.866.gb869b98d4c-goog
Quoted 25 lines · Jim Mattson
Leaf
0x80000005is "L1 Cache and TLB Information." Leaf0x80000006is "L2 Cache and TLB and L3 Cache Information." Include these leaves in the array returned byKVM_GET_SUPPORTED_CPUID.Signed-off-by Jim Mattson <[email protected]>--- arch/x86/kvm/cpuid.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/cpuid.c +3
-1@@ -730,6 +730,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, entry->ecx &= kvm_cpuid_8000_0001_ecx_x86_features;cpuid_mask (&entry->ecx,CPUID_8000_0001_ECX );break ; +case 0x80000005 : +case 0x80000006 : +break ;case 0x80000007 :/* Advanced power management */ /* invariant TSC is CPUID.80000007H:EDX[8] */ entry->edx &= (1 <<8 ); --
Quoted 2 lines
2.23.0.866.gb869b98d4c-goog
Ping.
Quoted 20 lines · Jim Mattson
Quoted 19 lines · Jim Mattson
Leaf
0x80000005is "L1 Cache and TLB Information." Leaf0x80000006is "L2 Cache and TLB and L3 Cache Information." Include these leaves in the array returned byKVM_GET_SUPPORTED_CPUID.Signed-off-by Jim Mattson <[email protected]>--- arch/x86/kvm/cpuid.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/cpuid.c +2
-0@@ -730,6 +730,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, entry->ecx &= kvm_cpuid_8000_0001_ecx_x86_features;cpuid_mask (&entry->ecx,CPUID_8000_0001_ECX );break ; +case 0x80000005 : +case 0x80000006 :
Quoted 8 lines
Quoted 7 lines
arch/x86/kvm/cpuid.c +1
-1+break ;case 0x80000007 :/* Advanced power management */ /* invariant TSC is CPUID.80000007H:EDX[8] */ entry->edx &= (1 <<8 ); --2.23.0.866.gb869b98d4c-goog
Ping.
Just curious about where we are actually setting the information for these two leaves. I don't see it either in __do_cpuid_func() or in kvm_x86_ops->set_supported_cpuid().
Paolo Bonzini
maintainerQuoted 10 lines · Krish Sadhukhan
Quoted 10 lines
Quoted 10 lines
+ case
0x80000005:
+ case0x80000006:
+ break;
case0x80000007: /* Advanced power management */ /* invariant TSC is CPUID.80000007H:EDX[8] */entry->edx&= (1 << 8);Signature · 1 line
2.23.0.866.gb869b98d4c-goog
Quoted 5 lines
Quoted 1 line
Ping.
Just curious about where we are actually setting the information for these two leaves. I don't see it either in
__do_cpuid_func()or inkvm_x86_ops->set_supported_cpuid().
do_cpuid_1_ent simply passes down the host information.
Patch queued, thanks.
Paolo