On 02.04.2020 12:18, Andrew Cooper wrote:
> The CPUID instruction is expensive.  No point executing it twice when once
> will do fine.
> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

Reviewed-by: Jan Beulich <jbeul...@suse.com>
albeit ...

> --- a/xen/arch/x86/cpu/microcode/intel.c
> +++ b/xen/arch/x86/cpu/microcode/intel.c
> @@ -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);

... with this, perhaps make the title say "remove one CPUID ..."
or some such?

Jan

Reply via email to