[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1516881500.30244.83.camel@infradead.org>
Date: Thu, 25 Jan 2018 11:58:20 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Borislav Petkov <bp@...en8.de>
Cc: arjan@...ux.intel.com, tglx@...utronix.de, karahmed@...zon.de,
x86@...nel.org, linux-kernel@...r.kernel.org,
tim.c.chen@...ux.intel.com, peterz@...radead.org,
pbonzini@...hat.com, ak@...ux.intel.com,
torvalds@...ux-foundation.org, gregkh@...ux-foundation.org,
dave.hansen@...el.com, gnomes@...rguk.ukuu.org.uk,
ashok.raj@...el.com, mingo@...nel.org
Subject: Re: [PATCH v4 7/7] x86/speculation: Add basic IBPB (Indirect
Branch Prediction Barrier) support
On Thu, 2018-01-25 at 12:50 +0100, Borislav Petkov wrote:
> On Thu, Jan 25, 2018 at 11:47:35AM +0000, David Woodhouse wrote:
> > I did already do the explicit clobbers now you reminded me how to do
> > them, but I elected not to use ASM_NO_INPUT_CLOBBER() because on
> > balance, losing the MSR_IA32_PRED_CMD / PRED_CMD_IBPB definitions and
> > having to hard-code the numbers was not so much of a win.
>
> and I'm thinking exactly the opposite: if an alternative can lose a
> bunch of inputs which don't change, then that's a good thing.
They're immediates, not registers. So it's like the first example in...
void foo(void)
{
asm volatile ("alternative me away; my numbers are %0 and %1\n"
:: "i" (3456), "i" (1234));
asm volatile ("alternative me away; GCC already loaded regs %0 and %1\n"
:: "c" (3456), "a" (1234));
}
... which gives you...
foo:
.LFB0:
.cfi_startproc
#APP
# 4 "foo.c" 1
alternative me away; my numbers are $3456 and $1234
# 0 "" 2
#NO_APP
movl $1234, %eax
movl $3456, %ecx
#APP
# 7 "foo.c" 1
alternative me away; GCC already loaded regs %ecx and %eax
# 0 "" 2
#NO_APP
ret
.cfi_endproc
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5213 bytes)
Powered by blists - more mailing lists