[merged mm-stable] kmsan-expose-kmsan_warn_on.patch removed from -mm tree

0 views
Skip to first unread message

Andrew Morton

unread,
Jun 28, 2024, 10:30:57 PM (4 days ago) Jun 28
to mm-co...@vger.kernel.org, vba...@suse.cz, sv...@linux.ibm.com, ros...@goodmis.org, roman.g...@linux.dev, rien...@google.com, pen...@kernel.org, mhir...@kernel.org, mark.r...@arm.com, kasa...@googlegroups.com, iamjoon...@lge.com, h...@linux.ibm.com, g...@linux.ibm.com, gli...@google.com, el...@google.com, dvy...@google.com, c...@linux.com, bornt...@linux.ibm.com, agor...@linux.ibm.com, 42.h...@gmail.com, i...@linux.ibm.com, ak...@linux-foundation.org

The quilt patch titled
Subject: kmsan: expose KMSAN_WARN_ON()
has been removed from the -mm tree. Its filename was
kmsan-expose-kmsan_warn_on.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Ilya Leoshkevich <i...@linux.ibm.com>
Subject: kmsan: expose KMSAN_WARN_ON()
Date: Fri, 21 Jun 2024 13:35:00 +0200

KMSAN_WARN_ON() is required for implementing s390-specific KMSAN
functions, but right now it's available only to the KMSAN internal
functions. Expose it to subsystems through <linux/kmsan.h>.

Link: https://lkml.kernel.org/r/20240621113706...@linux.ibm.com
Signed-off-by: Ilya Leoshkevich <i...@linux.ibm.com>
Reviewed-by: Alexander Potapenko <gli...@google.com>
Cc: Alexander Gordeev <agor...@linux.ibm.com>
Cc: Christian Borntraeger <bornt...@linux.ibm.com>
Cc: Christoph Lameter <c...@linux.com>
Cc: David Rientjes <rien...@google.com>
Cc: Dmitry Vyukov <dvy...@google.com>
Cc: Heiko Carstens <h...@linux.ibm.com>
Cc: Hyeonggon Yoo <42.h...@gmail.com>
Cc: Joonsoo Kim <iamjoon...@lge.com>
Cc: <kasa...@googlegroups.com>
Cc: Marco Elver <el...@google.com>
Cc: Mark Rutland <mark.r...@arm.com>
Cc: Masami Hiramatsu (Google) <mhir...@kernel.org>
Cc: Pekka Enberg <pen...@kernel.org>
Cc: Roman Gushchin <roman.g...@linux.dev>
Cc: Steven Rostedt (Google) <ros...@goodmis.org>
Cc: Sven Schnelle <sv...@linux.ibm.com>
Cc: Vasily Gorbik <g...@linux.ibm.com>
Cc: Vlastimil Babka <vba...@suse.cz>
Signed-off-by: Andrew Morton <ak...@linux-foundation.org>
---

include/linux/kmsan.h | 25 +++++++++++++++++++++++++
mm/kmsan/kmsan.h | 24 +-----------------------
2 files changed, 26 insertions(+), 23 deletions(-)

--- a/include/linux/kmsan.h~kmsan-expose-kmsan_warn_on
+++ a/include/linux/kmsan.h
@@ -268,6 +268,29 @@ static inline void *memset_no_sanitize_m
return __memset(s, c, n);
}

+extern bool kmsan_enabled;
+extern int panic_on_kmsan;
+
+/*
+ * KMSAN performs a lot of consistency checks that are currently enabled by
+ * default. BUG_ON is normally discouraged in the kernel, unless used for
+ * debugging, but KMSAN itself is a debugging tool, so it makes little sense to
+ * recover if something goes wrong.
+ */
+#define KMSAN_WARN_ON(cond) \
+ ({ \
+ const bool __cond = WARN_ON(cond); \
+ if (unlikely(__cond)) { \
+ WRITE_ONCE(kmsan_enabled, false); \
+ if (panic_on_kmsan) { \
+ /* Can't call panic() here because */ \
+ /* of uaccess checks. */ \
+ BUG(); \
+ } \
+ } \
+ __cond; \
+ })
+
#else

static inline void kmsan_init_shadow(void)
@@ -380,6 +403,8 @@ static inline void *memset_no_sanitize_m
return memset(s, c, n);
}

+#define KMSAN_WARN_ON WARN_ON
+
#endif

#endif /* _LINUX_KMSAN_H */
--- a/mm/kmsan/kmsan.h~kmsan-expose-kmsan_warn_on
+++ a/mm/kmsan/kmsan.h
@@ -11,6 +11,7 @@
#define __MM_KMSAN_KMSAN_H

#include <linux/irqflags.h>
+#include <linux/kmsan.h>
#include <linux/mm.h>
#include <linux/nmi.h>
#include <linux/pgtable.h>
@@ -34,29 +35,6 @@
#define KMSAN_META_SHADOW (false)
#define KMSAN_META_ORIGIN (true)

-extern bool kmsan_enabled;
-extern int panic_on_kmsan;
-
-/*
- * KMSAN performs a lot of consistency checks that are currently enabled by
- * default. BUG_ON is normally discouraged in the kernel, unless used for
- * debugging, but KMSAN itself is a debugging tool, so it makes little sense to
- * recover if something goes wrong.
- */
-#define KMSAN_WARN_ON(cond) \
- ({ \
- const bool __cond = WARN_ON(cond); \
- if (unlikely(__cond)) { \
- WRITE_ONCE(kmsan_enabled, false); \
- if (panic_on_kmsan) { \
- /* Can't call panic() here because */ \
- /* of uaccess checks. */ \
- BUG(); \
- } \
- } \
- __cond; \
- })
-
/*
* A pair of metadata pointers to be returned by the instrumentation functions.
*/
_

Patches currently in -mm which might be from i...@linux.ibm.com are


Reply all
Reply to author
Forward
0 new messages