diff options
author | 2020-03-25 11:09:23 +0800 | |
---|---|---|
committer | 2020-03-27 11:43:29 +0100 | |
commit | dbaba47085b0c2aa793ce849750164bd3765e163 (patch) | |
tree | a398007467f441d2f871fba4c150e8a04fa016ca /scripts/bpf_helpers_doc.py | |
parent | x86/split_lock: Enable split lock detection by kernel (diff) | |
download | wireguard-linux-dbaba47085b0c2aa793ce849750164bd3765e163.tar.xz wireguard-linux-dbaba47085b0c2aa793ce849750164bd3765e163.zip |
x86/split_lock: Rework the initialization flow of split lock detection
Current initialization flow of split lock detection has following issues:
1. It assumes the initial value of MSR_TEST_CTRL.SPLIT_LOCK_DETECT to be
zero. However, it's possible that BIOS/firmware has set it.
2. X86_FEATURE_SPLIT_LOCK_DETECT flag is unconditionally set even if
there is a virtualization flaw that FMS indicates the existence while
it's actually not supported.
Rework the initialization flow to solve above issues. In detail, explicitly
clear and set split_lock_detect bit to verify MSR_TEST_CTRL can be
accessed, and rdmsr after wrmsr to ensure bit is cleared/set successfully.
X86_FEATURE_SPLIT_LOCK_DETECT flag is set only when the feature does exist
and the feature is not disabled with kernel param "split_lock_detect=off"
On each processor, explicitly updating the SPLIT_LOCK_DETECT bit based on
sld_sate in split_lock_init() since BIOS/firmware may touch it.
Originally-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200325030924.132881-2-xiaoyao.li@intel.com
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
0 files changed, 0 insertions, 0 deletions