Skip to contentSkip to conversation

x86/microcode: Replace sync_core() with cpuid_eax()

PATCH In review Andrew Cooper 2 participants 2 messages Mar 2, 2017

lore
Share & tools
lore
#0 lore raw

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".

[Linux commit 484d0e5c7943644cc46e7308a8f9d83be598f2b9]
[Ported to Xen]

---
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
index 62c2932..ba3971a 100644
@@ -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
index 8ba7ed0..13a609b 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
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".

[Linux commit 484d0e5c7943644cc46e7308a8f9d83be598f2b9]
[Ported to Xen]

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel