[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <497a3694-cb0d-4678-9622-d9443bf8a40d@citrix.com>
Date: Thu, 27 Feb 2025 00:49:48 +0000
From: Andrew Cooper <andrew.cooper3@...rix.com>
To: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>, x86@...nel.org,
Josh Poimboeuf <jpoimboe@...nel.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/speculation: Simplify and make CALL_NOSPEC consistent
On 26/02/2025 9:03 pm, Pawan Gupta wrote:
> @@ -420,20 +420,28 @@ static inline void call_depth_return_thunk(void) {}
>
> #ifdef CONFIG_X86_64
>
> +/*
> + * Equivalent to -mindirect-branch-cs-prefix; emit the 5 byte jmp/call
> + * to the retpoline thunk with a CS prefix when the register requires
> + * a REX prefix byte to encode. Also see apply_retpolines().
> + */
Technically, both comments aren't quite accurate. __CS_PREFIX() emits a
conditional CS prefix in a manner compatible with
-mindirect-branch-cs-prefix, not the full 5/6 byte jmp/call.
> +#define __CS_PREFIX(reg) \
> + .irp rs,r8,r9,r10,r11,r12,r13,r14,r15; \
> + .ifc \\rs, \reg; \
Why are these escaped differently? Given they're all \r of some form or
another, I guess something is going wonky with __stringify(), but its
still weird for them to be different.
Do you have a fully pre-processed source to hand to see how CALL_NOSPEC
ends up?
~Andrew
Powered by blists - more mailing lists