[PATCH] x86/cpu: Enable cpuid instruction on Cyrix 6x86/6x86L processors
From: Matthew Whitehead
Date: Thu Sep 20 2018 - 16:45:10 EST
On power up, the cpuid instruction is disabled on Cyrix 6x86 and 6x86L
processors and it needs to be enabled. There is code to do this, but it
does not work because it uses the broken {set,get}Cx86_old() macros.
There are comments in processor-cyrix.h advising you to _not_ make calls
using the deprecated macros in this style:
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
This is because it expands the macro into a non-functioning calling
sequence. The new macros fix this problem, so we use them instead.
We also need to forcibly enable X86_FEATURE_CPUID. This is because
early_identify_cpu() does not know that the call to
identify_cpu_without_cpuid() actually enables the cpuid instruction in the
odd Cyrix case, and it turns X86_FEATURE_CPUID off after it has just been
enabled on the processor.
This was tested on actual Cyrix hardware.
Signed-off-by: Matthew Whitehead <tedheadster@xxxxxxxxx>
---
arch/x86/kernel/cpu/cyrix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 8949b7a..e603cc5 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -437,10 +437,11 @@ static void cyrix_identify(struct cpuinfo_x86 *c)
/* enable MAPEN */
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);
/* enable cpuid */
- setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
+ setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x80);
/* disable MAPEN */
setCx86(CX86_CCR3, ccr3);
local_irq_restore(flags);
+ setup_force_cpu_cap(X86_FEATURE_CPUID);
}
}
}
--
1.8.3.1