Commit dbaba47
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.com1 parent 6650cdd commit dbaba47
1 file changed
+42
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
987 | 1003 | | |
988 | 1004 | | |
| 1005 | + | |
989 | 1006 | | |
990 | 1007 | | |
991 | 1008 | | |
992 | | - | |
993 | | - | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
994 | 1013 | | |
995 | 1014 | | |
996 | 1015 | | |
997 | 1016 | | |
998 | 1017 | | |
999 | 1018 | | |
1000 | | - | |
| 1019 | + | |
1001 | 1020 | | |
1002 | 1021 | | |
1003 | 1022 | | |
1004 | 1023 | | |
1005 | 1024 | | |
1006 | | - | |
| 1025 | + | |
1007 | 1026 | | |
1008 | 1027 | | |
1009 | | - | |
1010 | | - | |
| 1028 | + | |
1011 | 1029 | | |
1012 | 1030 | | |
1013 | 1031 | | |
1014 | | - | |
1015 | 1032 | | |
1016 | 1033 | | |
1017 | 1034 | | |
1018 | 1035 | | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1019 | 1044 | | |
1020 | 1045 | | |
1021 | 1046 | | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1029 | 1050 | | |
1030 | | - | |
| 1051 | + | |
1031 | 1052 | | |
1032 | 1053 | | |
1033 | 1054 | | |
1034 | | - | |
1035 | | - | |
| 1055 | + | |
1036 | 1056 | | |
1037 | 1057 | | |
1038 | 1058 | | |
1039 | 1059 | | |
1040 | 1060 | | |
1041 | 1061 | | |
1042 | | - | |
| 1062 | + | |
1043 | 1063 | | |
1044 | 1064 | | |
1045 | 1065 | | |
1046 | 1066 | | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
| 1067 | + | |
1059 | 1068 | | |
1060 | 1069 | | |
1061 | 1070 | | |
| |||
1071 | 1080 | | |
1072 | 1081 | | |
1073 | 1082 | | |
1074 | | - | |
| 1083 | + | |
1075 | 1084 | | |
1076 | 1085 | | |
1077 | 1086 | | |
| |||
1085 | 1094 | | |
1086 | 1095 | | |
1087 | 1096 | | |
1088 | | - | |
| 1097 | + | |
1089 | 1098 | | |
1090 | 1099 | | |
1091 | 1100 | | |
| |||
0 commit comments