]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/ucode: Rationalise startup and family/model checks
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Mar 2020 13:54:19 +0000 (13:54 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 20 Mar 2020 18:42:24 +0000 (18:42 +0000)
commitdd5f07997f2970e024c44cd8845f67dfdc72c17a
tree467d2ef6684020636156085faba8c910bd4b4100
parent781b4a5639759e5ec948b4a27f583795fd15e421
x86/ucode: Rationalise startup and family/model checks

Drop microcode_init_{intel,amd}(), export {intel,amd}_ucode_ops, and use a
switch statement in early_microcode_init() rather than probing each vendor in
turn.  This allows the microcode_ops pointer to become local to core.c.

As there are no external users of microcode_ops, there is no need for
collect_cpu_info() to implement sanity checks.  Move applicable checks to
early_microcode_init() so they are performed once, rather than repeatedly.

The Intel logic guarding the read of MSR_PLATFORM_ID is contrary to the SDM,
which states that the MSR has been architectural since the Pentium Pro
(06-01-xx), and lists no family/model restrictions in the pseudo-code for
microcode loading.  Either way, Xen's 64bit-only nature already makes this
check redundant.

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