Re: [PATCH] x86/speculation: Simplify and make CALL_NOSPEC consistent
From: Pawan Gupta
Date: Thu Feb 27 2025 - 20:06:18 EST
On Fri, Feb 28, 2025 at 12:36:40AM +0000, Andrew Cooper wrote:
> > Getting rid of one layer of macro makes it less magical:
> >
> > #define __CS_PREFIX(reg) \
> > ".irp rs,r8,r9,r10,r11,r12,r13,r14,r15\n" \
> > ".ifc \\rs," reg "\n" \
> > ".byte 0x2e\n" \
> > ".endif\n" \
> > ".endr\n"
> >
> > #define CALL_NOSPEC __CS_PREFIX("%V[thunk_target]") \
> > "call __x86_indirect_thunk_%V[thunk_target]\n"
> > #else
> > #define CALL_NOSPEC "call *%[thunk_target]\n"
> > #endif
[...]
> Yeah, I think that's a lot better.
Ok, I will go with this approach for now.