]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
compiler: remove __ADDRESSABLE_ASM{_STR,}() again
authorJan Beulich <jbeulich@suse.com>
Mon, 14 Apr 2025 14:41:07 +0000 (16:41 +0200)
committerJuergen Gross <jgross@suse.com>
Mon, 18 Aug 2025 12:48:16 +0000 (14:48 +0200)
__ADDRESSABLE_ASM_STR() is where the necessary stringification happens.
As long as "sym" doesn't contain any odd characters, no quoting is
required for its use with .quad / .long. In fact the quotation gets in
the way with gas 2.25; it's only from 2.26 onwards that quoted symbols
are half-way properly supported.

However, assembly being different from C anyway, drop
__ADDRESSABLE_ASM_STR() and its helper macro altogether. A simple
.global directive will suffice to get the symbol "declared", i.e. into
the symbol table. While there also stop open-coding STATIC_CALL_TRAMP()
and STATIC_CALL_KEY().

Fixes: 0ef8047b737d ("x86/static-call: provide a way to do very early static-call updates")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <609d2c74-de13-4fae-ab1a-1ec44afb948d@suse.com>

arch/x86/include/asm/xen/hypercall.h
include/linux/compiler.h

index 59a62c3780a2f2c6884393936f261ccd22b9c9d5..a16d4631547ce1c70f96acc9e31be7121be32a81 100644 (file)
@@ -94,12 +94,13 @@ DECLARE_STATIC_CALL(xen_hypercall, xen_hypercall_func);
 #ifdef MODULE
 #define __ADDRESSABLE_xen_hypercall
 #else
-#define __ADDRESSABLE_xen_hypercall __ADDRESSABLE_ASM_STR(__SCK__xen_hypercall)
+#define __ADDRESSABLE_xen_hypercall \
+       __stringify(.global STATIC_CALL_KEY(xen_hypercall);)
 #endif
 
 #define __HYPERCALL                                    \
        __ADDRESSABLE_xen_hypercall                     \
-       "call __SCT__xen_hypercall"
+       __stringify(call STATIC_CALL_TRAMP(xen_hypercall))
 
 #define __HYPERCALL_ENTRY(x)   "a" (x)
 
index 6f04a1d8c72094015e513e9ba293bf705ace9d9a..64ff73c533e54e0794c666e79ad2f996c7c2060c 100644 (file)
@@ -288,14 +288,6 @@ static inline void *offset_to_ptr(const int *off)
 #define __ADDRESSABLE(sym) \
        ___ADDRESSABLE(sym, __section(".discard.addressable"))
 
-#define __ADDRESSABLE_ASM(sym)                                         \
-       .pushsection .discard.addressable,"aw";                         \
-       .align ARCH_SEL(8,4);                                           \
-       ARCH_SEL(.quad, .long) __stringify(sym);                        \
-       .popsection;
-
-#define __ADDRESSABLE_ASM_STR(sym) __stringify(__ADDRESSABLE_ASM(sym))
-
 /*
  * This returns a constant expression while determining if an argument is
  * a constant expression, most importantly without evaluating the argument.