Re: [PATCH] KVM: x86: use CPUID to locate host page table reserved bits

From: Paolo Bonzini
Date: Wed Dec 04 2019 - 10:36:24 EST


On 04/12/19 16:29, Sean Christopherson wrote:
>
> The extra bit of paranoia doesn't cost much, so play it safe? E.g.:
>
> if (unlikely(boot_cpu_data.extended_cpuid_level < 0x80000008)) {
> WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_TME) || SME?);
> return boot_cpu_data.x86_phys_bits;
> }
>
> return cpuid_eax(0x80000008) & 0xff;

Sounds good. I wouldn't bother with the WARN even.

Paolo