lkml.org 
[lkml]   [2019]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3] arm64: sysreg: make mrs_s and msr_s macros work with Clang and LTO
On Tue, Apr 23, 2019 at 3:57 PM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Wed, 24 Apr 2019 at 00:55, Kees Cook <keescook@chromium.org> wrote:
> >
> > On Mon, Apr 15, 2019 at 7:38 AM Kees Cook <keescook@chromium.org> wrote:
> > > +#define __msr_s(r, v) \
> > > + DEFINE_MSR_S \
> > > +" msr_s " __stringify(r) ", %x0\n" \
> > > + UNDEFINE_MSR_S : : "rZ" (v)
> >
> > BTW ... is "%x0" a typo here? Shouldn't this just be "%0"?
> >
>
> No, iirc, that is required to force clang to choose a x# encoding
> (which is the only one supported by msr/mrs instructions). Otherwise,
> it will infer from the operand size which encoding to use, and attempt
> to use w# for 32-bit system registers.

Yes: https://github.com/llvm/llvm-project/blob/80b578c7325352187d0aff7bd2bdb5a76b51cf37/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp#L466

--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2019-04-24 01:01    [W:0.044 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site