mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR
Add X86_FEATURE_PAE and use it to guesstimate the MAXPHYADDR when the MAXPHYADDR CPUID entry isn't supported. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20221006005125.680782-2-seanjc@google.com
This commit is contained in:
@@ -1012,12 +1012,10 @@ bool is_amd_cpu(void)
|
||||
void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
|
||||
{
|
||||
const struct kvm_cpuid_entry2 *entry;
|
||||
bool pae;
|
||||
|
||||
/* SDM 4.1.4 */
|
||||
if (kvm_get_cpuid_max_extended() < 0x80000008) {
|
||||
pae = kvm_get_supported_cpuid_entry(1)->edx & (1 << 6);
|
||||
*pa_bits = pae ? 36 : 32;
|
||||
*pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
|
||||
*va_bits = 32;
|
||||
} else {
|
||||
entry = kvm_get_supported_cpuid_entry(0x80000008);
|
||||
|
||||
Reference in New Issue
Block a user