mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Juergen Gross <jgross@suse.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] compiler: remove stringification from __ADDRESSABLE_ASM()
Date: Wed, 12 Feb 2025 16:11:51 +0100	[thread overview]
Message-ID: <561c52d6-9728-4dfc-a629-353dc2488c8b@suse.com> (raw)

__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.

Fixes: 0ef8047b737d ("x86/static-call: provide a way to do very early static-call updates")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
---
I think that __ADDRESSABLE_ASM{,_STR}() better would have a separate
comment, as that presently kind of shared with {_,}__ADDRESSABLE() isn't
really applicable to assembly code.

Is data allocation actually necessary in __ADDRESSABLE_ASM()? Aiui the
sole goal is to have sym in the symbol table. That could be achieved by
a simple .global (or e.g. .hidden) directive.

Shouldn't Xen's __ADDRESSABLE_xen_hypercall use STATIC_CALL_KEY() rather
than open-coding it?

--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -245,7 +245,7 @@ static inline void *offset_to_ptr(const
 #define __ADDRESSABLE_ASM(sym)						\
 	.pushsection .discard.addressable,"aw";				\
 	.align ARCH_SEL(8,4);						\
-	ARCH_SEL(.quad, .long) __stringify(sym);			\
+	ARCH_SEL(.quad, .long) sym;					\
 	.popsection;
 
 #define __ADDRESSABLE_ASM_STR(sym) __stringify(__ADDRESSABLE_ASM(sym))

             reply	other threads:[~2025-02-12 15:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 15:11 Jan Beulich [this message]
2025-02-12 23:32 ` Josh Poimboeuf
2025-02-12 23:41   ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561c52d6-9728-4dfc-a629-353dc2488c8b@suse.com \
    --to=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®