[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201012202934.GB818459@rani.riverdale.lan>
Date: Mon, 12 Oct 2020 16:29:34 -0400
From: Arvind Sankar <nivedita@...m.mit.edu>
To: Borislav Petkov <bp@...en8.de>
Cc: Uros Bizjak <ubizjak@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
x86-ml <x86@...nel.org>, lkml <linux-kernel@...r.kernel.org>
Subject: Re: [GIT PULL] x86/asm updates for v5.10
On Mon, Oct 12, 2020 at 08:55:47PM +0200, Borislav Petkov wrote:
> On Mon, Oct 12, 2020 at 08:41:32PM +0200, Uros Bizjak wrote:
> > On Mon, Oct 12, 2020 at 8:11 PM Linus Torvalds <
> > torvalds@...ux-foundation.org> wrote:
> >
> > > On Mon, Oct 12, 2020 at 4:06 AM Borislav Petkov <bp@...e.de> wrote:
> > > >
> > > > * Use XORL instead of XORQ to avoid a REX prefix and save some bytes in
> > > > the .fixup section, by Uros Bizjak.
> > >
> > > I think this one is actually buggy.
> > >
> > > For the 1-byte case, it does this:
> > >
> > > __get_user_asm(x_u8__, ptr, retval, "b", "=q");
> > >
> > > and ends up doing "xorl" on a register that we told the compiler is a
> > > byte register (with that "=q")
> > >
> > > Yes, it uses "%k[output]" to turn that byte register into the word
> > > version of the register, but there's no fundamental reason why the
> > > register might not be something like "%ah".
> > >
> >
> > GCC does not distinguish between %ah and %al and it is not possible to pass
> > "%ah" to the assembly. To access the high part of the %ax register, %h
> > modifier has to be used in the assembly template.
>
> Btw, did those get documented in the meantime? I can find them only in
> gcc sources:
>
> k -- likewise, print the SImode name of the register.
> h -- print the QImode name for a "high" register, either ah, bh, ch or dh.
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#x86Operandmodifiers
Powered by blists - more mailing lists