x86/microcode: Replace sync_core() with cpuid_eax()
PATCH 1/1 x86/microcode: Replace sync_core() with cpuid_eax()
From: Andy Lutomirski <[email protected]>
The Intel microcode driver is using sync_core() to mean "do CPUID with EAX=1".
Signed-off-by Andy Lutomirski <[email protected]>
Acked-by Borislav Petkov <[email protected]>
[Linux commit 484d0e5c7943644cc46e7308a8f9d83be598f2b9]
[Ported to Xen]
Signed-off-by Andrew Cooper <[email protected]>
---
CC: Jan Beulich <[email protected]>
--- xen/arch/x86/microcode_intel.c | 9 +++++---- xen/arch/x86/traps.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-)
xen/arch/x86/microcode_intel.c +5 -4
@@ -115,8 +115,9 @@ static int collect_cpu_info(unsigned int cpu_num, struct cpu_signature *csig) }wrmsrl (MSR_IA32_UCODE_REV ,0x0ULL ); -/* see notes above for revision 1.07. Apparent chip bug */ -sync_core (); +/* As documented in the SDM: Do a CPUID 1 here */ +cpuid_eax (1 ); +/* get the current revision from MSR 0x8B */ rdmsrl (MSR_IA32_UCODE_REV , msr_content); csig->rev = (uint32_t )(msr_content >>32 );
@@ -297,8 +298,8 @@ static int apply_microcode(unsigned int cpu)wrmsrl (MSR_IA32_UCODE_WRITE , (unsigned long )uci->mc.mc_intel->bits);wrmsrl (MSR_IA32_UCODE_REV ,0x0ULL ); -/* see notes above for revision 1.07. Apparent chip bug */ -sync_core (); +/* As documented in the SDM: Do a CPUID 1 here */ +cpuid_eax (1 );/* get the current revision from MSR 0x8B */ rdmsrl (MSR_IA32_UCODE_REV , msr_content);
xen/arch/x86/traps.c +2 -1
@@ -2572,7 +2572,8 @@ static int priv_op_read_msr(unsigned int reg, uint64_t *val, {if (wrmsr_safe (MSR_IA32_UCODE_REV ,0 ) )break ; -sync_core (); +/* As documented in the SDM: Do a CPUID 1 here */ +cpuid_eax (1 ); } goto normal;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 02.03.17 at 16:39, <[email protected]> wrote:
From: Andy Lutomirski <[email protected]>
The Intel microcode driver is using
sync_core()to mean "do CPUID with EAX=1".Signed-off-by Andy Lutomirski <[email protected]>Acked-by Borislav Petkov <[email protected]>[Linux commit 484d0e5c7943644cc46e7308a8f9d83be598f2b9][Ported to Xen]Signed-off-by Andrew Cooper <[email protected]>
Acked-by Jan Beulich <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel