public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: tglx@linutronix.de
Cc: x86@kernel.org, elver@google.com, paulmck@kernel.org,
	kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, will@kernel.org, dvyukov@google.com,
	glider@google.com, andreyknvl@google.com
Subject: [PATCH 8/8] x86/entry, bug: Comment the instrumentation_begin() usage for WARN()
Date: Thu, 04 Jun 2020 12:22:49 +0200	[thread overview]
Message-ID: <20200604102428.364746275@infradead.org> (raw)
In-Reply-To: 20200604102241.466509982@infradead.org

Explain the rationale for annotating WARN(), even though, strictly
speaking printk() and friends are very much not safe in many of the
places we put them.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/x86/include/asm/bug.h |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -76,6 +76,12 @@ do {								\
 	unreachable();						\
 } while (0)
 
+/*
+ * This instrumentation_begin() is strictly speaking incorrect; but it
+ * suppresses the complaints from WARN()s in noinstr code. If such a WARN()
+ * were to trigger, we'd rather wreck the machine in an attempt to get the
+ * message out than not know about it.
+ */
 #define __WARN_FLAGS(flags)					\
 do {								\
 	instrumentation_begin();				\



  parent reply	other threads:[~2020-06-04 10:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 10:22 [PATCH 0/8] x86/entry: KCSAN/KASAN/UBSAN vs noinstr Peter Zijlstra
2020-06-04 10:22 ` [PATCH 1/8] x86, kcsan: Remove __no_kcsan_or_inline usage Peter Zijlstra
2020-06-04 10:22 ` [PATCH 2/8] kcsan: Remove __no_kcsan_or_inline Peter Zijlstra
2020-06-04 10:22 ` [PATCH 3/8] x86, kcsan: Add __no_kcsan to noinstr Peter Zijlstra
2020-06-04 10:22 ` [PATCH 4/8] kasan: Bump required compiler version Peter Zijlstra
2020-06-04 10:22 ` [PATCH 5/8] compiler_types.h: Add __no_sanitize_{address,undefined} to noinstr Peter Zijlstra
2020-06-04 10:22 ` [PATCH 6/8] x86/entry, cpumask: Provide non-instrumented variant of cpu_is_offline() Peter Zijlstra
2020-06-04 10:22 ` [PATCH 7/8] x86/entry, ubsan, objtool: Whitelist __ubsan_handle_*() Peter Zijlstra
2020-06-04 10:22 ` Peter Zijlstra [this message]
2020-06-04 11:01 ` [PATCH 0/8] x86/entry: KCSAN/KASAN/UBSAN vs noinstr Marco Elver
2020-06-15 10:07   ` Marco Elver
2020-06-15 14:57     ` Qian Cai
2020-06-15 15:06       ` Peter Zijlstra

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=20200604102428.364746275@infradead.org \
    --to=peterz@infradead.org \
    --cc=andreyknvl@google.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --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