Skip to contentSkip to conversation

kvm: cpuid: Expose leaves 0x80000005 and 0x80000006 to the guest

PATCH In review Jim Mattson 3 participants 4 messages Oct 22, 2019 – Nov 5, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 9c5029cf6f3f..1b40d8277b84 100644
@@ -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
#1 lore raw
Quoted 25 lines · Jim Mattson

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 -1
index 9c5029cf6f3f..1b40d8277b84 100644
@@ -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.

#2 lore raw
Quoted 20 lines · Jim Mattson
Quoted 19 lines · Jim Mattson

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 +2 -0
index 9c5029cf6f3f..1b40d8277b84 100644
@@ -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().

maintainer
#3 lore raw
Quoted 10 lines · Krish Sadhukhan
Quoted 10 lines
Quoted 10 lines

+       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 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 in kvm_x86_ops->set_supported_cpuid().

do_cpuid_1_ent simply passes down the host information.

Patch queued, thanks.

Paolo