]> xenbits.xensource.com Git - xen.git/commit
x86/spec-ctrl: Fix the parsing of xpti= on fixed Intel hardware
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 30 Jul 2018 09:44:02 +0000 (11:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 30 Jul 2018 09:44:02 +0000 (11:44 +0200)
commit87c83af333e0248ada2e6560965aca6096ec7f2b
treec1a3a80864c8daa6c4a3933c57af1dad82597aa5
parentb07c76fece00c9c4c4872575f17e23f860192418
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