]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commit
spec: add l1tf-barrier
authorNorbert Manthey <nmanthey@amazon.de>
Thu, 14 Mar 2019 12:55:00 +0000 (13:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Apr 2019 10:12:38 +0000 (12:12 +0200)
commit3860d5534df401204ccf67cc5bbd2f7368b9bfaf
tree420257fd6f6321a0e7070cf543a05ed8d719f113
parent013896cb8b2f070dc452bd1b91fc5b842a538367
spec: add l1tf-barrier

To control the runtime behavior on L1TF vulnerable platforms better, the
command line option l1tf-barrier is introduced. This option controls
whether on vulnerable x86 platforms the lfence instruction is used to
prevent speculative execution from bypassing the evaluation of
conditionals that are protected with the evaluate_nospec macro.

By now, Xen is capable of identifying L1TF vulnerable hardware. However,
this information cannot be used for alternative patching, as a CPU feature
is required. To control alternative patching with the command line option,
a new x86 feature "X86_FEATURE_SC_L1TF_VULN" is introduced. This feature
is used to patch the lfence instruction into the arch_barrier_nospec_true
function. The feature is enabled only if L1TF vulnerable hardware is
detected and the command line option does not prevent using this feature.

The status of hyperthreading is considered when automatically enabling
adding the lfence instruction. Since platforms without hyperthreading can
still be vulnerable to L1TF in case the L1 cache is not flushed properly,
the additional lfence instructions are patched in if either hyperthreading
is enabled, or L1 cache flushing is missing.

This is part of the speculative hardening effort.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
docs/misc/xen-command-line.pandoc
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/cpufeatures.h
xen/include/asm-x86/spec_ctrl.h