lkml.org 
[lkml]   [2020]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v12] x86/split_lock: Enable split lock detection by kernel
Date
>> +static enum split_lock_detect_state sld_state = sld_warn;
>> +
>
> This sets sld_state to sld_warn even on CPUs that don't support
> split-lock detection. split_lock_init will then try to read/write the
> MSR to turn it on. Would it be better to initialize it to sld_off and
> set it to sld_warn in split_lock_setup instead, which is only called if
> the CPU supports the feature?

I've lost some bits of this patch series somewhere along the way :-( There
was once code to decide whether the feature was supported (either with
x86_match_cpu() for a couple of models, or using the architectural test
based on some MSR bits. I need to dig that out and put it back in. Then
stuff can check X86_FEATURE_SPLIT_LOCK before wandering into code
that messes with MSRs

>> + if (!split_lock_detect_enabled())
>> + return;
>
> This misses one comment from Sean [1] that this check should be dropped,
> otherwise user-space alignment check via EFLAGS.AC will get ignored when
> split lock detection is disabled.

Ah yes. Good catch. Will fix.

Thanks for the review.

-Tony
\
 
 \ /
  Last update: 2020-01-23 00:25    [W:0.211 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site