Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- From: "H. Peter Anvin" <hpa@xxxxxxxxx>
- Date: Mon, 17 Mar 2025 11:38:12 -0700
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-tip-commits@xxxxxxxxxxxxxxx, Ingo Molnar <mingo@xxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Brian Gerst <brgerst@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>, x86@xxxxxxxxxx
- In-reply-to: <CAFULd4b_a=3xs2b_88WaDR9hLuhMqNZiMu+kNAbrgJf2MoVNnQ@mail.gmail.com>
- References: <20250313130251.383204-1-ubizjak@gmail.com> <174188823430.14745.17591986001259957573.tip-bot2@tip-bot2> <20250317101415.GBZ9f198PAh90nMWDf@fat_crate.local> <CAFULd4b-sZucEtvx19==5wcOfOCzj5fuZ2SHS7ZMboZQXdVycg@mail.gmail.com> <20250317104616.GCZ9f9eF-0n0qPbWwk@fat_crate.local> <CAFULd4b_a=3xs2b_88WaDR9hLuhMqNZiMu+kNAbrgJf2MoVNnQ@mail.gmail.com>
- User-agent: K-9 Mail for Android
On March 17, 2025 4:06:11 AM PDT, Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
>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.
>
Ok, I'm going to argue, but only because the argument is called "st" and the assembly parameter "xa". That's needlessly different and means having to look extra hard
We can obviously not use the same token, but IMO it would make a lot more sense to call one of them _st or perhaps st_p (being a pointer).
- References:
- [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- From: tip-bot2 for Uros Bizjak
- Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- Prev by Date:
Re: [tip: perf/urgent] perf/x86: Check data address for IBS software filter
- Next by Date:
Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- Previous by thread:
Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- Next by thread:
Re: [tip: x86/fpu] x86/fpu: Use XSAVE{,OPT,C,S} and XRSTOR{,S} mnemonics in xstate.h
- Index(es):
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]