lkml.org 
[lkml]   [2022]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: x86, possible bug in __memmove() alternatives patching
On 3/26/22 01:27, Borislav Petkov wrote:
> So, more to the point, it is about this chunk:
>
> /*
> * If fast string is not enabled in IA32_MISC_ENABLE for any reason,
> * clear the fast string and enhanced fast string CPU capabilities.
> */
> if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
> rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
> if (!(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)) {
> pr_info("Disabled fast string operations\n");
> setup_clear_cpu_cap(X86_FEATURE_REP_GOOD);
> setup_clear_cpu_cap(X86_FEATURE_ERMS);
> }
> }
>
> we already check whether fast strings was disabled, regardless of HV or
> not. Question is, should we clear X86_FEATURE_FSRM there too. I wanna
> say yes.

I don't think it would hurt to clear it.

> Or is it that, *if* MSR_IA32_MISC_ENABLE_FAST_STRING is clear, the FSRM
> CPUID bit was not set either so nothing to clear...

I don't think there's really any direct connection between the CPUID bit
and MSR_IA32_MISC_ENABLE_FAST_STRING. The CPUID bit definitely doesn't
appear to be cleared by the CPU if MSR_IA32_MISC_ENABLE_FAST_STRING is
clear.

\
 
 \ /
  Last update: 2022-03-30 00:37    [W:0.074 / U:1.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site