Skip to content

x86/split_lock: Fix and cleanup of cpu_model_supports_sld

Xiaoyao Li lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/split_lock: Fix handling in split_lock_init()arch/x86/kernel/cpu/bus_lock.c+4 -20 replies
2/2x86/split_lock: Drop cpu_model_supports_sldarch/x86/kernel/cpu/bus_lock.c+1 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] x86/split_lock: Fix and cleanup of cpu_model_supports_sld

While considering Kiryl's suggestion[1], I'm wondering why we have cpu_model_supports_sld defined, which seems like it could be replaced by X86_FEATURE_SPLIT_LOCK_DETECT.

Tracing through the history, I find that X86_FEATURE_SPLIT_LOCK_DETECT originally indicated whether the kernel enabled the split lock detection feature, rather than enumerating hardware support for the feature, at the time when cpu_model_supports_sld was introduced.

Now, the semantics of X86_FEATURE_SPLIT_LOCK_DETECT have changed and it enuemrates the hardware support for the feature. Therefore, patch 2 replaces cpu_model_supports_sld with X86_FEATURE_SPLIT_LOCK_DETECT.

Patch 1 fixes a potential issue where MSR_TEST_CTRL can be written when the split lock detection feature is not available, which can cause bizarre behavior.

[1] https://lore.kernel.org/all/lvobu4gpfsjg63syubgy2jwcja72folflrst7bu2eqv6rhaqre@ttbkykphu32f/

Xiaoyao Li (2):
x86/split_lock: Fix handling in split_lock_init() x86/split_lock: Drop cpu_model_supports_sld

 arch/x86/kernel/cpu/bus_lock.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
Signature · 1 line
2.43.0