public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Yan Zhao <yan.y.zhao@intel.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	Sean Christopherson <seanjc@google.com>
Subject: [PATCH v2 2/2] x86/bug: Put HAVE_ARCH_BUG_FORMAT_ARGS WARN definitions inside __ASSEMBLER__
Date: Thu, 23 Apr 2026 07:54:18 -0700	[thread overview]
Message-ID: <20260423145419.459988-3-seanjc@google.com> (raw)
In-Reply-To: <20260423145419.459988-1-seanjc@google.com>

Extend the !assembly #ifdef guarding x86's custom WARN helpers to cover the
WARN macros themselves, as they aren't assembly friendly.  This helps make
it clear that things like __WARN_validate_printf() don't need a dummy
definition for assembly code.

No functional change intended.

Suggested-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index bf3c802654d1..23ab05438269 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -154,7 +154,6 @@ struct arch_va_list {
 };
 extern void *__warn_args(struct arch_va_list *args, struct pt_regs *regs);
 static __always_inline __printf(1, 2) void __WARN_validate_printf(const char *fmt, ...) { }
-#endif /* __ASSEMBLER__ */
 
 #define __WARN_bug_entry(flags, format) ({				\
 	struct bug_entry *bug;						\
@@ -189,6 +188,7 @@ do {									\
 	}								\
 	__ret_warn_on;							\
 })
+#endif /* __ASSEMBLER__ */
 
 #endif /* HAVE_ARCH_BUG_FORMAT_ARGS */
 
-- 
2.54.0.545.g6539524ca2-goog


  parent reply	other threads:[~2026-04-23 14:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 14:54 [PATCH v2 0/2] x86/bug: Add printf() validation to x86's custom WARNs Sean Christopherson
2026-04-23 14:54 ` [PATCH v2 1/2] x86/bug: Add printf() validation to HAVE_ARCH_BUG_FORMAT_ARGS WARNs Sean Christopherson
2026-04-23 15:12   ` Dave Hansen
2026-04-23 15:47     ` Sean Christopherson
2026-04-23 16:58       ` Dave Hansen
2026-04-27 19:05   ` [tip: x86/misc] " tip-bot2 for Sean Christopherson
2026-04-27 19:55     ` Sean Christopherson
2026-04-23 14:54 ` Sean Christopherson [this message]
2026-04-27 19:05   ` [tip: x86/misc] x86/bug: Put HAVE_ARCH_BUG_FORMAT_ARGS WARN definitions inside __ASSEMBLER__ tip-bot2 for Sean Christopherson

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=20260423145419.459988-3-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yan.y.zhao@intel.com \
    /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