Commit a6a6074
x86/split_lock: Avoid runtime reads of the TEST_CTRL MSR
In a context switch from a task that is detecting split locks to one that
is not (or vice versa) we need to update the TEST_CTRL MSR. Currently this
is done with the common sequence:
read the MSR
flip the bit
write the MSR
in order to avoid changing the value of any reserved bits in the MSR.
Cache unused and reserved bits of TEST_CTRL MSR with SPLIT_LOCK_DETECT bit
cleared during initialization, so we can avoid an expensive RDMSR
instruction during context switch.
Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Originally-by: Tony Luck <tony.luck@intel.com>
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-3-xiaoyao.li@intel.com1 parent dbaba47 commit a6a6074
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
1034 | 1035 | | |
1035 | 1036 | | |
1036 | 1037 | | |
| 1038 | + | |
| 1039 | + | |
1037 | 1040 | | |
1038 | 1041 | | |
1039 | 1042 | | |
| |||
1050 | 1053 | | |
1051 | 1054 | | |
1052 | 1055 | | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
| 1056 | + | |
1056 | 1057 | | |
1057 | 1058 | | |
1058 | 1059 | | |
1059 | | - | |
1060 | | - | |
1061 | 1060 | | |
1062 | 1061 | | |
1063 | 1062 | | |
| |||
0 commit comments