mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] x86: speedup local_irq_save() for clang
@ 2025-12-19 11:20 Eric Dumazet
  2025-12-19 11:20 ` [PATCH 1/2] clang: work around asm output constraint problems Eric Dumazet
  2025-12-19 11:20 ` [PATCH 2/2] x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl() Eric Dumazet
  0 siblings, 2 replies; 12+ messages in thread
From: Eric Dumazet @ 2025-12-19 11:20 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	Uros Bizjak, Linus Torvalds, x86, H . Peter Anvin
  Cc: linux-kernel, Eric Dumazet, Eric Dumazet

clang generates poor code for local_irq_save() callers,
because of asm "=rm" output constraint being mishandled.

Frst patch adds ASM_OUTPUT_RM macro, extending ASM_INPUT_RM
that Linus added in linux-6.10. Suggested by Uros Bizjak.

Second patch uses it in local_irq_save(), to not penalize gcc
while forcing clang to generate better code especially
when CONFIG_STACKPROTECTOR_STRONG=y.

smap_save() could also use it, but is not in any fast path.

Eric Dumazet (2):
  clang: work around asm output constraint problems
  x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl()

 arch/x86/include/asm/irqflags.h | 2 +-
 include/linux/compiler-clang.h  | 7 +++++++
 include/linux/compiler_types.h  | 6 +++++-
 3 files changed, 13 insertions(+), 2 deletions(-)

-- 
2.52.0.322.g1dd061c0dc-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-12-22 16:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-19 11:20 [PATCH 0/2] x86: speedup local_irq_save() for clang Eric Dumazet
2025-12-19 11:20 ` [PATCH 1/2] clang: work around asm output constraint problems Eric Dumazet
2025-12-20 22:32   ` Linus Torvalds
2025-12-21  3:46     ` Eric Dumazet
2025-12-19 11:20 ` [PATCH 2/2] x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl() Eric Dumazet
2025-12-21 21:39   ` H. Peter Anvin
2025-12-21 21:47     ` Eric Dumazet
2025-12-21 23:20       ` Linus Torvalds
2025-12-21 23:44         ` H. Peter Anvin
2025-12-22  1:38           ` Linus Torvalds
2025-12-22  4:25             ` H. Peter Anvin
2025-12-22 16:51               ` Andrew Cooper

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®