]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/ucode/intel: Remove one CPUID from collect_cpu_info()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Apr 2020 14:52:43 +0000 (15:52 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 3 Apr 2020 19:11:46 +0000 (20:11 +0100)
The CPUID instruction is expensive.  No point executing it twice when once
will do fine.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/microcode/intel.c

index 72bd1ad0bce940f0cb0d4fa062471b3e44b5218b..f1e64e188ba3c87bb513156c88f7a4fd4773c4d0 100644 (file)
@@ -121,14 +121,12 @@ static int collect_cpu_info(struct cpu_signature *csig)
 
     memset(csig, 0, sizeof(*csig));
 
-    csig->sig = cpuid_eax(0x00000001);
-
     rdmsrl(MSR_IA32_PLATFORM_ID, msr_content);
     csig->pf = 1 << ((msr_content >> 50) & 7);
 
     wrmsrl(MSR_IA32_UCODE_REV, 0x0ULL);
     /* As documented in the SDM: Do a CPUID 1 here */
-    cpuid_eax(1);
+    csig->sig = cpuid_eax(1);
 
     /* get the current revision from MSR 0x8B */
     rdmsrl(MSR_IA32_UCODE_REV, msr_content);