lkml.org 
[lkml]   [2018]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/alternatives: Fix optimize_nops() checking
On Wed, Jan 10, 2018 at 08:55:40PM +0100, Thomas Gleixner wrote:
> On Wed, 10 Jan 2018, Linus Torvalds wrote:
>
> > On Wed, Jan 10, 2018 at 3:28 AM, Borislav Petkov <bp@alien8.de> wrote:
> > >
> > > Make sure we scan all bytes before we decide to optimize the NOPs in
> > > there.
> >
> > Can we also add compile-time checking (presumably in objtool, but who
> > knows) that there are no relocations in the alternative section?
>
> Cc'ing the overlor^Haded objtool wizard
>
> > Because that was the other "oops, this really doesn't work with
> > altinstructions" issue, wasn't it?

I think .altinstruction relocations *do* work if they're for the first
instruction, and it's a jump or a call. There's some alternatives code
which adjusts the jump/call offset in that case, and there are some
users of alternatives who rely on that.

I think Boris had a patch floating around to add an instruction decoder
to alternatives, so you can do a call/jmp anywhere.

--
Josh

\
 
 \ /
  Last update: 2018-01-14 23:22    [W:0.176 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site