mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	Uros Bizjak <ubizjak@gmail.com>,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	x86@kernel.org,  "H . Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	 Eric Dumazet <edumazet@google.com>
Subject: [PATCH 0/2] x86: speedup local_irq_save() for clang
Date: Fri, 19 Dec 2025 11:20:05 +0000	[thread overview]
Message-ID: <20251219112007.2827302-1-edumazet@google.com> (raw)

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


             reply	other threads:[~2025-12-19 11:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 11:20 Eric Dumazet [this message]
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

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=20251219112007.2827302-1-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=eric.dumazet@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.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®