lkml.org 
[lkml]   [2018]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v6 2/3] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
    On Wed, 12 Sep 2018, Jiri Kosina wrote:
    > case X86_BUG_SPECTRE_V2:
    > - return sprintf(buf, "%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
    > + mutex_lock(&spec_ctrl_mutex);
    > + ret = sprintf(buf, "%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
    > boot_cpu_has(X86_FEATURE_USE_IBPB) ? ", IBPB" : "",
    > boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "",
    > + (x86_spec_ctrl_base & SPEC_CTRL_STIBP) ? ", STIBP" : "",
    > spectre_v2_module_string());
    > + mutex_unlock(&spec_ctrl_mutex);

    The mutex for this printing is overkill. It's a read after all and if there
    is a concurrent SMT control fiddling going on then you have a chance of
    getting the wrong information as well. I'll zap it.

    Thanks,

    tglx

    \
     
     \ /
      Last update: 2018-09-12 21:16    [W:4.041 / U:0.376 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site