[PATCH v7 105/120] KVM: x86: Use parsed CPUID(0x80000007)
"Ahmed S. Darwish" <[email protected]> Thu, 28 May 2026 17:39:07 +0200
| Newsgroups | dev.linux.lists.x86-cpuid,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
For KVM cpuid, use parsed CPUID(0x80000007) instead of poking at x86_power. The latter is backed by a direct CPUID query and will be removed later. Signed-off-by: Ahmed S. Darwish <[email protected]> --- arch/x86/kvm/cpuid.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 040e15ff87c5..ad0a5410899d 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -1764,13 +1764,18 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) /* Drop reserved bits, pass host L2 cache and TLB info. */ entry->edx &= ~GENMASK(17, 16); break; - case 0x80000007: /* Advanced power management */ + case 0x80000007: { /* Advanced power management */ + const struct cpuid_regs *el7 = cpuid_leaf_raw(&boot_cpu_data, 0x80000007); + cpuid_entry_override(entry, CPUID_8000_0007_EDX); - /* mask against host */ - entry->edx &= boot_cpu_data.x86_power; + /* Mask against host */ + if (el7) + entry->edx &= el7->edx; + entry->eax = entry->ebx = entry->ecx = 0; break; + } case 0x80000008: { /* * GuestPhysAddrSize (EAX[23:16]) is intended for software -- 2.54.0