mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen: provide pse36 cpuid bit
Provide pse36 cpuid bit if guest runs in 32bit PAE or in long mode. Hyper-V refuses to start as the "cpu does not provide required hw features" if it does not find the pse36 cpuid bits. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
This commit is contained in:
1 parent
b07e31c4ab
commit
bbff299b86
2 files changed
+14
-3
No files matched your search
@@ -98,7 +98,6 @@ static void amd_xc_cpuid_policy(
|
||||
|
||||
if ( !is_pae )
|
||||
clear_bit(X86_FEATURE_PAE, regs[3]);
|
||||
clear_bit(X86_FEATURE_PSE36, regs[3]);
|
||||
|
||||
/* Filter all other features according to a whitelist. */
|
||||
regs[2] &= ((is_64bit ? bitmaskof(X86_FEATURE_LAHF_LM) : 0) |
|
||||
@@ -340,6 +339,7 @@ static void xc_cpuid_hvm_policy(
|
||||
bitmaskof(X86_FEATURE_CMOV) |
|
||||
bitmaskof(X86_FEATURE_PAT) |
|
||||
bitmaskof(X86_FEATURE_CLFLSH) |
|
||||
bitmaskof(X86_FEATURE_PSE36) |
|
||||
bitmaskof(X86_FEATURE_MMX) |
|
||||
bitmaskof(X86_FEATURE_FXSR) |
|
||||
bitmaskof(X86_FEATURE_XMM) |
|
||||
@@ -349,8 +349,10 @@ static void xc_cpuid_hvm_policy(
|
||||
/* We always support MTRR MSRs. */
|
||||
regs[3] |= bitmaskof(X86_FEATURE_MTRR);
|
||||
|
||||
if ( !is_pae )
|
||||
if ( !is_pae ) {
|
||||
clear_bit(X86_FEATURE_PAE, regs[3]);
|
||||
clear_bit(X86_FEATURE_PSE36, regs[3]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x00000007: /* Intel-defined CPU features */
|
||||
@@ -372,8 +374,10 @@ static void xc_cpuid_hvm_policy(
|
||||
break;
|
||||
|
||||
case 0x80000001:
|
||||
if ( !is_pae )
|
||||
if ( !is_pae ) {
|
||||
clear_bit(X86_FEATURE_NX, regs[3]);
|
||||
clear_bit(X86_FEATURE_PSE36, regs[3]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x80000007:
|
||||
|
||||
@@ -2409,6 +2409,10 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
|
||||
if ( xsave_enabled(v) )
|
||||
*ecx |= (v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_OSXSAVE) ?
|
||||
cpufeat_mask(X86_FEATURE_OSXSAVE) : 0;
|
||||
|
||||
/* Only provide PSE36 when guest runs in 32bit PAE or in long mode */
|
||||
if ( !(hvm_pae_enabled(v) || hvm_long_mode_enabled(v)) )
|
||||
*edx &= ~cpufeat_mask(X86_FEATURE_PSE36);
|
||||
break;
|
||||
case 0x7:
|
||||
if ( (count == 0) && !cpu_has_smep )
|
||||
@@ -2447,6 +2451,9 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
|
||||
/* Hide 1GB-superpage feature if we can't emulate it. */
|
||||
if (!hvm_pse1gb_supported(d))
|
||||
*edx &= ~cpufeat_mask(X86_FEATURE_PAGE1GB);
|
||||
/* Only provide PSE36 when guest runs in 32bit PAE or in long mode */
|
||||
if ( !(hvm_pae_enabled(v) || hvm_long_mode_enabled(v)) )
|
||||
*edx &= ~cpufeat_mask(X86_FEATURE_PSE36);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||