x86/spec-ctrl: Fix the parsing of xpti= on fixed Intel hardware
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 30 Jul 2018 09:30:09 +0000 (11:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 30 Jul 2018 09:30:09 +0000 (11:30 +0200)
commit33ced725e11af4eabd3334d12f53ed807e9e2586
tree873fb1ab90c8b03f180def9045361c7bea60abd8
parent7de21555730367497eb01edf6e9e9530224105e7
x86/spec-ctrl: Fix the parsing of xpti= on fixed Intel hardware

The calls to xpti_init_default() in parse_xpti() are buggy.  The CPUID data
hasn't been fetched that early, and boot_cpu_has(X86_FEATURE_ARCH_CAPS) will
always evaluate false.

As a result, the default case won't disable XPTI on Intel hardware which
advertises ARCH_CAPABILITIES_RDCL_NO.

Simplify parse_xpti() to solely the setting of opt_xpti according to the
passed string, and have init_speculation_mitigations() call
xpti_init_default() if appropiate.  Drop the force parameter, and pass caps
instead, to avoid redundant re-reading of MSR_ARCH_CAPS.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
master commit: be5e2ff6f54e0245331ed360b8786760f82fd673
master date: 2018-07-24 11:25:54 +0100
xen/arch/x86/spec_ctrl.c