[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <313e0c9d-9733-4216-980a-cb473fbb5475@citrix.com>
Date: Fri, 14 Mar 2025 22:51:36 +0000
From: Andrew Cooper <andrew.cooper3@...rix.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, Uros Bizjak <ubizjak@...il.com>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 17/20] x86/smap: Use named asm operands in
smap_{save,restore}()
On 14/03/2025 9:41 pm, Josh Poimboeuf wrote:
> @@ -50,9 +50,9 @@ static __always_inline unsigned long smap_save(void)
> static __always_inline void smap_restore(unsigned long flags)
> {
> asm volatile ("# smap_restore\n\t"
> - ALTERNATIVE("", "push %0; popf\n\t",
> - X86_FEATURE_SMAP)
> - : : "g" (flags) : "memory", "cc");
> + ALTERNATIVE("",
> + "push %[flags]; popf\n\t", X86_FEATURE_SMAP)
> + : : [flags] "g" (flags) : "memory", "cc");
> }
>
> /* These macros can be used in asm() statements */
The problem with ASM_CALL_CONSTRAINT and asm_call() is that it's not
just call instructions. It's any transient stack adjustment.
Peeking forwards the other half of the series, you convert IRET to
asm_call(), but leave these alone.
These need converting, and hopefully someone can think of a better name
than "call" to be used for the wrapper.
~Andrew
Powered by blists - more mailing lists