lkml.org 
[lkml]   [2018]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/4] x86/speculation: Use IBRS if available before calling into firmware
From
Date
On Wed, 2018-02-14 at 16:46 -0800, Jim Mattson wrote:
> On Wed, Feb 14, 2018 at 3:29 PM, David Woodhouse <dwmw@amazon.co.uk> wrote:
>
> > +#define alternative_msr_write(_msr, _val, _feature)            \
> > +       asm volatile(ALTERNATIVE("",                            \
> > +                                "movl %[msr], %%ecx\n\t"       \
> > +                                "movl %[val], %%eax\n\t"       \
> > +                                "movl $0, %%edx\n\t"           \
> > +                                "wrmsr",                       \
> > +                                _feature)                      \
> > +                    : : [msr] "i" (_msr), [val] "i" (_val)     \
> > +                    : "eax", "ecx", "edx", "memory")
> > +
>
> It's not needed now, but this would be more generally useful if the
> high 32 bits of the MSR value could also be specified.

Yeah, if we ever do want to make it completely generic then we could
move it from nospec-branch.h to alternative.h and make it possible to
set the high word. But for now I'm inclined not to overengineer it.

The idea *was* that Boris was going to bikeshed it away into some other
form, but having just reverted two of those patches I am less inclined
to accept any more of that kind of change that doesn't actually fix a
real bug.
[unhandled content-type:application/x-pkcs7-signature]
\
 
 \ /
  Last update: 2018-02-15 10:22    [W:0.067 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site