On Wed, 24 Apr 2019 at 00:55, Kees Cook <keesc...@chromium.org> wrote: > > On Mon, Apr 15, 2019 at 7:38 AM Kees Cook <keesc...@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.