mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
x86/Intel: drop another 32-bit leftover
None of the models MISC_ENABLE MSR access is excluded for support 64-bit mode - drop the conditional from early_init_intel(). Also convert pointless rdmsr_safe() elsewhere to rdmsrl(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
971d299c04
commit
4fdc932b3c
2 files changed
+18
-22
No files matched your search
+16
-18
@@ -283,31 +283,29 @@ static void __init noinline intel_init_levelling(void)
|
||||
|
||||
static void early_init_intel(struct cpuinfo_x86 *c)
|
||||
{
|
||||
u64 misc_enable, disable;
|
||||
|
||||
/* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
|
||||
if (c->x86 == 15 && c->x86_cache_alignment == 64)
|
||||
c->x86_cache_alignment = 128;
|
||||
|
||||
/* Unmask CPUID levels and NX if masked: */
|
||||
if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
|
||||
u64 misc_enable, disable;
|
||||
rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
|
||||
|
||||
rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
|
||||
disable = misc_enable & (MSR_IA32_MISC_ENABLE_LIMIT_CPUID |
|
||||
MSR_IA32_MISC_ENABLE_XD_DISABLE);
|
||||
if (disable) {
|
||||
wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable & ~disable);
|
||||
bootsym(trampoline_misc_enable_off) |= disable;
|
||||
}
|
||||
|
||||
disable = misc_enable & (MSR_IA32_MISC_ENABLE_LIMIT_CPUID |
|
||||
MSR_IA32_MISC_ENABLE_XD_DISABLE);
|
||||
if (disable) {
|
||||
wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable & ~disable);
|
||||
bootsym(trampoline_misc_enable_off) |= disable;
|
||||
}
|
||||
|
||||
if (disable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID)
|
||||
printk(KERN_INFO "revised cpuid level: %d\n",
|
||||
cpuid_eax(0));
|
||||
if (disable & MSR_IA32_MISC_ENABLE_XD_DISABLE) {
|
||||
write_efer(read_efer() | EFER_NX);
|
||||
printk(KERN_INFO
|
||||
"re-enabled NX (Execute Disable) protection\n");
|
||||
}
|
||||
if (disable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID)
|
||||
printk(KERN_INFO "revised cpuid level: %d\n",
|
||||
cpuid_eax(0));
|
||||
if (disable & MSR_IA32_MISC_ENABLE_XD_DISABLE) {
|
||||
write_efer(read_efer() | EFER_NX);
|
||||
printk(KERN_INFO
|
||||
"re-enabled NX (Execute Disable) protection\n");
|
||||
}
|
||||
|
||||
/* CPUID workaround for Intel 0F33/0F34 CPU */
|
||||
|
||||
@@ -928,8 +928,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
|
||||
goto normal;
|
||||
|
||||
case MSR_IA32_MISC_ENABLE:
|
||||
if ( rdmsr_safe(reg, *val) )
|
||||
break;
|
||||
rdmsrl(reg, *val);
|
||||
*val = guest_misc_enable(*val);
|
||||
return X86EMUL_OKAY;
|
||||
|
||||
@@ -1098,8 +1097,7 @@ static int write_msr(unsigned int reg, uint64_t val,
|
||||
return X86EMUL_OKAY;
|
||||
|
||||
case MSR_IA32_MISC_ENABLE:
|
||||
if ( rdmsr_safe(reg, temp) )
|
||||
break;
|
||||
rdmsrl(reg, temp);
|
||||
if ( val != guest_misc_enable(temp) )
|
||||
goto invalid;
|
||||
return X86EMUL_OKAY;
|
||||
|
||||