lkml.org 
[lkml]   [2022]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [patch 00/38] x86/retbleed: Call depth tracking mitigation
On Thu, Jul 21, 2022 at 10:56 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> this seems to work, let me go hack the kernel..

Am I missing something?

Isn't this generating

movl $~IMM,%r10d
negl %r10d
cmpl %r10d,-4(%calldest)

for the sequence?

That seems bogus for two reasons:

(a) 'neg' is not the opposite of '~'. Did you mean 'notl' or did you mean '-'?

Or am I missing something entirely?

(b) since you have that r10 use anyway, why can't you just generate the simpler

movl $-IMM,%r10d
addl -4(%calldest),%r10d

instead? You only need ZF anyway.

Maybe you need to add some "r10 is clobbered" thing, I don't know.

But again: I don't know llvm, so the above is basically me just doing
the "pattern matching monkey" thing.

Linus

\
 
 \ /
  Last update: 2022-07-21 20:08    [W:0.156 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site