Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h

From: Uros Bizjak
Date: Mon Mar 17 2025 - 07:07:32 EST


On Mon, Mar 17, 2025 at 11:46 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Mon, Mar 17, 2025 at 11:28:58AM +0100, Uros Bizjak wrote:
> > > > @@ -114,10 +113,10 @@ static inline int update_pkru_in_sigframe(struct xregs_state __user *buf, u64 ma
> > > > #define XSTATE_OP(op, st, lmask, hmask, err) \
> > > > asm volatile("1:" op "\n\t" \
> > > > "xor %[err], %[err]\n" \
> > > > - "2:\n\t" \
> > > > + "2:\n" \
> > > > _ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_FAULT_MCE_SAFE) \
> > > > : [err] "=a" (err) \
> > > > - : "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \
> > > > + : [xa] "m" (*(st)), "a" (lmask), "d" (hmask) \
> > >
> > > This [xa] needs documenting in the comment above this.
> > >
> > > What does "xa" even mean?
> >
> > xsave area.
>
> That's struct xregs_state in kernel nomenclature.
>
> And the macro's argument is called "st".
>
> And when it says [xa] there, one wonders where that "xa" comes from. So please
> add a comment above the macro explaining that.

This is an internal label for a named argument. The name shouldn't
bother anybody, it could be anything, [xa], [ptr], [arg] or whatnot,
so I see no reason why a comment should explain the choice. It's like
arguing about the name of a variable.

Uros.