* [PATCH v4 1/2] tracing: Move non-trace_printk prototypes into trace_controls.h
From: Steven Rostedt @ 2026-06-25 10:40 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Andrew Morton,
Linus Torvalds, Sebastian Andrzej Siewior, John Ogness,
Thomas Gleixner, Peter Zijlstra, Julia Lawall, Yury Norov,
linux-doc, linux-kbuild, linuxppc-dev, dri-devel, linux-stm32,
linux-arm-kernel, linux-rdma, linux-usb, linux-ext4, linux-nfs,
kvm, intel-gfx
In-Reply-To: <20260625104007.041432666@kernel.org>
From: Steven Rostedt <rostedt@goodmis.org>
Remove the prototypes of the code that is not associated with
trace_printk() from trace_printk.h.
These control functions as well as ftrace_dump() and trace_dump_stack()
are used in cases where things go wrong. The main use case is to do a
trace_dump_stack(); tracing_off(); ftrace_dump(); in a place that detected
that something went wrong, whereas, trace_printk() is added to normal code
during debugging and removed before committing upstream. The dump code is
fine to keep in production.
Suggested-by: Yury Norov <yury.norov@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
Changes since v3: https://patch.msgid.link/20260624081948.147764194@kernel.org
- Move include out of #if statement in rcu.h
kernel test robot found other configs that could require the
control functions in rcu.h. Just always include it in that file.
arch/powerpc/xmon/xmon.c | 1 +
arch/s390/kernel/ipl.c | 1 +
arch/s390/kernel/machine_kexec.c | 1 +
drivers/gpu/drm/i915/i915_gem.h | 1 +
drivers/tty/sysrq.c | 1 +
include/linux/trace_controls.h | 54 ++++++++++++++++++++++++++++++++
include/linux/trace_printk.h | 51 ------------------------------
kernel/debug/debug_core.c | 1 +
kernel/panic.c | 1 +
kernel/rcu/rcu.h | 1 +
kernel/rcu/rcutorture.c | 1 +
kernel/trace/trace.h | 1 +
kernel/trace/trace_benchmark.c | 1 +
lib/sys_info.c | 1 +
14 files changed, 66 insertions(+), 51 deletions(-)
create mode 100644 include/linux/trace_controls.h
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index cb3a3244ae6f..2135f319e0dd 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -27,6 +27,7 @@
#include <linux/highmem.h>
#include <linux/security.h>
#include <linux/debugfs.h>
+#include <linux/trace_controls.h>
#include <asm/ptrace.h>
#include <asm/smp.h>
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 3c346b02ceb9..baac66cc4de4 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -22,6 +22,7 @@
#include <linux/debug_locks.h>
#include <linux/vmalloc.h>
#include <linux/secure_boot.h>
+#include <linux/trace_controls.h>
#include <asm/asm-extable.h>
#include <asm/machine.h>
#include <asm/diag.h>
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index baeb3dcfc1c8..33f9a89eb3ad 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -12,6 +12,7 @@
#include <linux/delay.h>
#include <linux/reboot.h>
#include <linux/ftrace.h>
+#include <linux/trace_controls.h>
#include <linux/debug_locks.h>
#include <linux/cpufeature.h>
#include <asm/guarded_storage.h>
diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index 20b3cb29cfff..1da8fb61c09e 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -116,6 +116,7 @@ int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file);
#endif
#if IS_ENABLED(CONFIG_DRM_I915_TRACE_GEM)
+#include <linux/trace_controls.h>
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
#define GEM_TRACE_ERR(...) do { \
pr_err(__VA_ARGS__); \
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index c2e4b31b699a..d3f72dc430b8 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -324,6 +324,7 @@ static const struct sysrq_key_op sysrq_showstate_blocked_op = {
};
#ifdef CONFIG_TRACING
+#include <linux/trace_controls.h>
#include <linux/ftrace.h>
static void sysrq_ftrace_dump(u8 key)
diff --git a/include/linux/trace_controls.h b/include/linux/trace_controls.h
new file mode 100644
index 000000000000..995b97e963b4
--- /dev/null
+++ b/include/linux/trace_controls.h
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_TRACE_CONTROLS_H
+#define _LINUX_TRACE_CONTROLS_H
+
+
+/*
+ * General tracing related utility functions - trace_printk(),
+ * tracing_on/tracing_off and tracing_start()/tracing_stop
+ *
+ * Use tracing_on/tracing_off when you want to quickly turn on or off
+ * tracing. It simply enables or disables the recording of the trace events.
+ * This also corresponds to the user space /sys/kernel/tracing/tracing_on
+ * file, which gives a means for the kernel and userspace to interact.
+ * Place a tracing_off() in the kernel where you want tracing to end.
+ * From user space, examine the trace, and then echo 1 > tracing_on
+ * to continue tracing.
+ *
+ * tracing_stop/tracing_start has slightly more overhead. It is used
+ * by things like suspend to ram where disabling the recording of the
+ * trace is not enough, but tracing must actually stop because things
+ * like calling smp_processor_id() may crash the system.
+ *
+ * Most likely, you want to use tracing_on/tracing_off.
+ */
+enum ftrace_dump_mode {
+ DUMP_NONE,
+ DUMP_ALL,
+ DUMP_ORIG,
+ DUMP_PARAM,
+};
+
+#ifdef CONFIG_TRACING
+void tracing_on(void);
+void tracing_off(void);
+int tracing_is_on(void);
+void tracing_snapshot(void);
+void tracing_snapshot_alloc(void);
+void tracing_start(void);
+void tracing_stop(void);
+void trace_dump_stack(int skip);
+void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
+#else
+static inline void tracing_start(void) { }
+static inline void tracing_stop(void) { }
+static inline void tracing_on(void) { }
+static inline void tracing_off(void) { }
+static inline int tracing_is_on(void) { return 0; }
+static inline void tracing_snapshot(void) { }
+static inline void tracing_snapshot_alloc(void) { }
+static inline void trace_dump_stack(int skip) { }
+static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
+#endif
+
+#endif /* _LINUX_TRACE_CONTROLS_H */
diff --git a/include/linux/trace_printk.h b/include/linux/trace_printk.h
index 3d54f440dccf..a488ea9e9f85 100644
--- a/include/linux/trace_printk.h
+++ b/include/linux/trace_printk.h
@@ -7,43 +7,7 @@
#include <linux/stddef.h>
#include <linux/stringify.h>
-/*
- * General tracing related utility functions - trace_printk(),
- * tracing_on/tracing_off and tracing_start()/tracing_stop
- *
- * Use tracing_on/tracing_off when you want to quickly turn on or off
- * tracing. It simply enables or disables the recording of the trace events.
- * This also corresponds to the user space /sys/kernel/tracing/tracing_on
- * file, which gives a means for the kernel and userspace to interact.
- * Place a tracing_off() in the kernel where you want tracing to end.
- * From user space, examine the trace, and then echo 1 > tracing_on
- * to continue tracing.
- *
- * tracing_stop/tracing_start has slightly more overhead. It is used
- * by things like suspend to ram where disabling the recording of the
- * trace is not enough, but tracing must actually stop because things
- * like calling smp_processor_id() may crash the system.
- *
- * Most likely, you want to use tracing_on/tracing_off.
- */
-
-enum ftrace_dump_mode {
- DUMP_NONE,
- DUMP_ALL,
- DUMP_ORIG,
- DUMP_PARAM,
-};
-
#ifdef CONFIG_TRACING
-void tracing_on(void);
-void tracing_off(void);
-int tracing_is_on(void);
-void tracing_snapshot(void);
-void tracing_snapshot_alloc(void);
-
-extern void tracing_start(void);
-extern void tracing_stop(void);
-
static inline __printf(1, 2)
void ____trace_printk_check_format(const char *fmt, ...)
{
@@ -149,8 +113,6 @@ int __trace_printk(unsigned long ip, const char *fmt, ...);
extern int __trace_bputs(unsigned long ip, const char *str);
extern int __trace_puts(unsigned long ip, const char *str);
-extern void trace_dump_stack(int skip);
-
/*
* The double __builtin_constant_p is because gcc will give us an error
* if we try to allocate the static variable to fmt if it is not a
@@ -173,19 +135,7 @@ __ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
extern __printf(2, 0) int
__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
-
-extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
#else
-static inline void tracing_start(void) { }
-static inline void tracing_stop(void) { }
-static inline void trace_dump_stack(int skip) { }
-
-static inline void tracing_on(void) { }
-static inline void tracing_off(void) { }
-static inline int tracing_is_on(void) { return 0; }
-static inline void tracing_snapshot(void) { }
-static inline void tracing_snapshot_alloc(void) { }
-
static inline __printf(1, 2)
int trace_printk(const char *fmt, ...)
{
@@ -196,7 +146,6 @@ ftrace_vprintk(const char *fmt, va_list ap)
{
return 0;
}
-static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
#endif /* CONFIG_TRACING */
#endif
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index b276504c1c6b..f9c83a470c98 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -27,6 +27,7 @@
#define pr_fmt(fmt) "KGDB: " fmt
+#include <linux/trace_controls.h>
#include <linux/pid_namespace.h>
#include <linux/clocksource.h>
#include <linux/serial_core.h>
diff --git a/kernel/panic.c b/kernel/panic.c
index 213725b612aa..1415e910371d 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -9,6 +9,7 @@
* This function is used through-out the kernel (including mm and fs)
* to indicate a major problem.
*/
+#include <linux/trace_controls.h>
#include <linux/debug_locks.h>
#include <linux/sched/debug.h>
#include <linux/interrupt.h>
diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index fa6d30ce73d1..735a80df0b30 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -12,6 +12,7 @@
#include <linux/slab.h>
#include <trace/events/rcu.h>
+#include <linux/trace_controls.h>
/*
* Grace-period counter management.
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 882a158ada7b..76bf0184b267 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -39,6 +39,7 @@
#include <linux/srcu.h>
#include <linux/slab.h>
#include <linux/trace_clock.h>
+#include <linux/trace_controls.h>
#include <asm/byteorder.h>
#include <linux/torture.h>
#include <linux/vmalloc.h>
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 80fe152af1dd..2537c33ddd49 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -22,6 +22,7 @@
#include <linux/ctype.h>
#include <linux/once_lite.h>
#include <linux/ftrace_regs.h>
+#include <linux/trace_controls.h>
#include <linux/llist.h>
#include "pid_list.h"
diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c
index e19c32f2a938..69cc39008c36 100644
--- a/kernel/trace/trace_benchmark.c
+++ b/kernel/trace/trace_benchmark.c
@@ -3,6 +3,7 @@
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/trace_clock.h>
+#include <linux/trace_controls.h>
#define CREATE_TRACE_POINTS
#include "trace_benchmark.h"
diff --git a/lib/sys_info.c b/lib/sys_info.c
index f32a06ec9ed4..e3c9ca05601b 100644
--- a/lib/sys_info.c
+++ b/lib/sys_info.c
@@ -8,6 +8,7 @@
#include <linux/ftrace.h>
#include <linux/nmi.h>
#include <linux/sched/debug.h>
+#include <linux/trace_controls.h>
#include <linux/string.h>
#include <linux/sysctl.h>
--
2.53.0
^ permalink raw reply related
* [PATCH v4 2/2] tracing: Remove trace_printk.h from kernel.h
From: Steven Rostedt @ 2026-06-25 10:40 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Andrew Morton,
Linus Torvalds, Sebastian Andrzej Siewior, John Ogness,
Thomas Gleixner, Peter Zijlstra, Julia Lawall, Yury Norov,
linux-doc, linux-kbuild, linuxppc-dev, dri-devel, linux-stm32,
linux-arm-kernel, linux-rdma, linux-usb, linux-ext4, linux-nfs,
kvm, intel-gfx
In-Reply-To: <20260625104007.041432666@kernel.org>
From: Steven Rostedt <rostedt@goodmis.org>
There have been complaints about trace_printk.h causing more build time
for being in kernel.h if it changes. There is also an effort to clean up
kernel.h to have it not include unneeded header files. Move trace_printk.h
out of kernel.h and place it in the headers and C files that use it.
Link: https://lore.kernel.org/all/CAHk-=wikCBeVFjVXiY4o-oepdbjAoir5+TcAgtL12c4u1TpZLQ@mail.gmail.com/
Suggested-by: Yury Norov <yury.norov@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
arch/powerpc/kvm/book3s_xics.c | 1 +
drivers/gpu/drm/i915/gt/intel_gtt.h | 1 +
drivers/gpu/drm/i915/i915_gem.h | 1 +
drivers/hwtracing/stm/dummy_stm.c | 1 +
drivers/infiniband/hw/hfi1/trace_dbg.h | 1 +
drivers/usb/early/xhci-dbc.c | 1 +
fs/ext4/inline.c | 1 +
include/linux/ftrace.h | 2 ++
include/linux/kernel.h | 1 -
include/linux/sunrpc/debug.h | 1 +
include/linux/trace_printk.h | 5 +++--
kernel/trace/ring_buffer_benchmark.c | 1 +
samples/fprobe/fprobe_example.c | 1 +
samples/ftrace/ftrace-direct-too.c | 1 -
samples/trace_printk/trace-printk.c | 1 +
15 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c
index 74a44fa702b0..ef5eb596a56e 100644
--- a/arch/powerpc/kvm/book3s_xics.c
+++ b/arch/powerpc/kvm/book3s_xics.c
@@ -26,6 +26,7 @@
#if 1
#define XICS_DBG(fmt...) do { } while (0)
#else
+#include <linux/trace_printk.h>
#define XICS_DBG(fmt...) trace_printk(fmt)
#endif
diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.h b/drivers/gpu/drm/i915/gt/intel_gtt.h
index b54ee4f25af1..f6f223090760 100644
--- a/drivers/gpu/drm/i915/gt/intel_gtt.h
+++ b/drivers/gpu/drm/i915/gt/intel_gtt.h
@@ -35,6 +35,7 @@
#define I915_GFP_ALLOW_FAIL (GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN)
#if IS_ENABLED(CONFIG_DRM_I915_TRACE_GTT)
+#include <linux/trace_printk.h>
#define GTT_TRACE(...) trace_printk(__VA_ARGS__)
#else
#define GTT_TRACE(...)
diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index 1da8fb61c09e..f490052e8964 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -117,6 +117,7 @@ int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file);
#if IS_ENABLED(CONFIG_DRM_I915_TRACE_GEM)
#include <linux/trace_controls.h>
+#include <linux/trace_printk.h>
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
#define GEM_TRACE_ERR(...) do { \
pr_err(__VA_ARGS__); \
diff --git a/drivers/hwtracing/stm/dummy_stm.c b/drivers/hwtracing/stm/dummy_stm.c
index 38528ffdc0b3..7c5e48ebfb9f 100644
--- a/drivers/hwtracing/stm/dummy_stm.c
+++ b/drivers/hwtracing/stm/dummy_stm.c
@@ -8,6 +8,7 @@
*/
#undef DEBUG
+#include <linux/trace_printk.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
diff --git a/drivers/infiniband/hw/hfi1/trace_dbg.h b/drivers/infiniband/hw/hfi1/trace_dbg.h
index 58304b91380f..30df5e246586 100644
--- a/drivers/infiniband/hw/hfi1/trace_dbg.h
+++ b/drivers/infiniband/hw/hfi1/trace_dbg.h
@@ -103,6 +103,7 @@ __hfi1_trace_def(IOCTL);
*/
#ifdef HFI1_EARLY_DBG
+#include <linux/trace_printk.h>
#define hfi1_dbg_early(fmt, ...) \
trace_printk(fmt, ##__VA_ARGS__)
#else
diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index 41118bba9197..955c73bd601f 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -30,6 +30,7 @@ static struct xdbc_state xdbc;
static bool early_console_keep;
#ifdef XDBC_TRACE
+#include <linux/trace_printk.h>
#define xdbc_trace trace_printk
#else
static inline void xdbc_trace(const char *fmt, ...) { }
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 8045e4ff270c..0eff4a0c6a6c 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -934,6 +934,7 @@ static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping,
}
#ifdef INLINE_DIR_DEBUG
+#include <linux/trace_printk.h>
void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh,
void *inline_start, int inline_size)
{
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 02bc5027523a..b5336a81e619 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -8,6 +8,8 @@
#define _LINUX_FTRACE_H
#include <linux/trace_recursion.h>
+#include <linux/trace_controls.h>
+#include <linux/trace_printk.h>
#include <linux/trace_clock.h>
#include <linux/jump_label.h>
#include <linux/kallsyms.h>
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e5570a16cbb1..e87a40fbd152 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -31,7 +31,6 @@
#include <linux/build_bug.h>
#include <linux/sprintf.h>
#include <linux/static_call_types.h>
-#include <linux/trace_printk.h>
#include <linux/util_macros.h>
#include <linux/wordpart.h>
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index ab61bed2f7af..7524f5d82fba 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -29,6 +29,7 @@ extern unsigned int nlm_debug;
# define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac))
# if IS_ENABLED(CONFIG_SUNRPC_DEBUG_TRACE)
+# include <linux/trace_printk.h>
# define __sunrpc_printk(fmt, ...) trace_printk(fmt, ##__VA_ARGS__)
# else
# define __sunrpc_printk(fmt, ...) printk(KERN_DEFAULT fmt, ##__VA_ARGS__)
diff --git a/include/linux/trace_printk.h b/include/linux/trace_printk.h
index a488ea9e9f85..74ce4f8995c4 100644
--- a/include/linux/trace_printk.h
+++ b/include/linux/trace_printk.h
@@ -1,11 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_TRACE_PRINTK_H
#define _LINUX_TRACE_PRINTK_H
+#if !defined(__ASSEMBLY__) && !defined(__GENKSYMS__) && !defined(BUILD_VDSO)
-#include <linux/compiler_attributes.h>
#include <linux/instruction_pointer.h>
#include <linux/stddef.h>
#include <linux/stringify.h>
+#include <linux/stdarg.h>
#ifdef CONFIG_TRACING
static inline __printf(1, 2)
@@ -147,5 +148,5 @@ ftrace_vprintk(const char *fmt, va_list ap)
return 0;
}
#endif /* CONFIG_TRACING */
-
+#endif /* !defined(__ASSEMBLY__) && !defined(__GENKSYMS__) && !defined(BUILD_VDSO) */
#endif
diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c
index 593e3b59e42e..2bb25caebb75 100644
--- a/kernel/trace/ring_buffer_benchmark.c
+++ b/kernel/trace/ring_buffer_benchmark.c
@@ -5,6 +5,7 @@
* Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
*/
#include <linux/ring_buffer.h>
+#include <linux/trace_printk.h>
#include <linux/completion.h>
#include <linux/kthread.h>
#include <uapi/linux/sched/types.h>
diff --git a/samples/fprobe/fprobe_example.c b/samples/fprobe/fprobe_example.c
index bfe98ce826f3..de81b9b4ca7d 100644
--- a/samples/fprobe/fprobe_example.c
+++ b/samples/fprobe/fprobe_example.c
@@ -12,6 +12,7 @@
#define pr_fmt(fmt) "%s: " fmt, __func__
+#include <linux/trace_printk.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/fprobe.h>
diff --git a/samples/ftrace/ftrace-direct-too.c b/samples/ftrace/ftrace-direct-too.c
index bf2411aa6fd7..159190f4103f 100644
--- a/samples/ftrace/ftrace-direct-too.c
+++ b/samples/ftrace/ftrace-direct-too.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/module.h>
-
#include <linux/mm.h> /* for handle_mm_fault() */
#include <linux/ftrace.h>
#if !defined(CONFIG_ARM64) && !defined(CONFIG_PPC32)
diff --git a/samples/trace_printk/trace-printk.c b/samples/trace_printk/trace-printk.c
index cfc159580263..ff37aeb8523e 100644
--- a/samples/trace_printk/trace-printk.c
+++ b/samples/trace_printk/trace-printk.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/trace_printk.h>
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/irq_work.h>
--
2.53.0
^ permalink raw reply related
* [PATCH v4 0/2] tracing: Move non-trace_printk prototypes into trace_controls.h
From: Steven Rostedt @ 2026-06-25 10:40 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Andrew Morton,
Linus Torvalds, Sebastian Andrzej Siewior, John Ogness,
Thomas Gleixner, Peter Zijlstra, Julia Lawall, Yury Norov,
linux-doc, linux-kbuild, linuxppc-dev, dri-devel, linux-stm32,
linux-arm-kernel, linux-rdma, linux-usb, linux-ext4, linux-nfs,
kvm, intel-gfx
Remove trace_printk.h by creating a trace_controls.h for those places that
need access to tracing prototypes like tracing_off() and for the places that
need trace_printk() directly, to have it included directly.
Changse since v3: https://lore.kernel.org/all/20260624081806.120105649@kernel.org/
- Always include trace_controls.h in rcu.h (kernel test robot)
There are other configs that may include tracing_off() in rcu.h besides
the one that had the include of trace_controls.h. Just always include
it in that header to be safe.
Steven Rostedt (2):
tracing: Move non-trace_printk prototypes into trace_controls.h
tracing: Remove trace_printk.h from kernel.h
----
arch/powerpc/kvm/book3s_xics.c | 1 +
arch/powerpc/xmon/xmon.c | 1 +
arch/s390/kernel/ipl.c | 1 +
arch/s390/kernel/machine_kexec.c | 1 +
drivers/gpu/drm/i915/gt/intel_gtt.h | 1 +
drivers/gpu/drm/i915/i915_gem.h | 2 ++
drivers/hwtracing/stm/dummy_stm.c | 1 +
drivers/infiniband/hw/hfi1/trace_dbg.h | 1 +
drivers/tty/sysrq.c | 1 +
drivers/usb/early/xhci-dbc.c | 1 +
fs/ext4/inline.c | 1 +
include/linux/ftrace.h | 2 ++
include/linux/kernel.h | 1 -
include/linux/sunrpc/debug.h | 1 +
include/linux/trace_controls.h | 54 ++++++++++++++++++++++++++++++++
include/linux/trace_printk.h | 56 ++--------------------------------
kernel/debug/debug_core.c | 1 +
kernel/panic.c | 1 +
kernel/rcu/rcu.h | 1 +
kernel/rcu/rcutorture.c | 1 +
kernel/trace/ring_buffer_benchmark.c | 1 +
kernel/trace/trace.h | 1 +
kernel/trace/trace_benchmark.c | 1 +
lib/sys_info.c | 1 +
samples/fprobe/fprobe_example.c | 1 +
samples/ftrace/ftrace-direct-too.c | 1 -
samples/trace_printk/trace-printk.c | 1 +
27 files changed, 82 insertions(+), 55 deletions(-)
create mode 100644 include/linux/trace_controls.h
^ permalink raw reply
* Re: [PATCH] nilfs2: prevent double insertion of b_assoc_buffers in dirty buffer lookup
From: Ryusuke Konishi @ 2026-06-25 10:43 UTC (permalink / raw)
To: wuyankun
Cc: slava, linux-nilfs, linux-kernel, syzkaller-bugs,
syzbot+c37bed40868932d790e9
In-Reply-To: <20260625052639.241024-1-wuyankun@uniontech.com>
On Thu, Jun 25, 2026 at 2:27 PM wuyankun wrote:
>
> syzbot reported list corruption caused by double list_add_tail() on
> bh->b_assoc_buffers in nilfs_lookup_dirty_data_buffers().
>
> A buffer_head can still be dirty and not under async write while already
> linked on another association list. Add list state checks before enqueueing
> in both data and node dirty buffer scanners to avoid re-adding already
> linked nodes.
>
> Reported-by: syzbot+c37bed40868932d790e9@syzkaller.appspotmail.com
> Link: https://syzkaller.appspot.com/bug?extid=c37bed40868932d790e9
> Signed-off-by: wuyankun <wuyankun@uniontech.com>
> ---
> fs/nilfs2/segment.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> index 1491a4d4b1e1..09202d155903 100644
> --- a/fs/nilfs2/segment.c
> +++ b/fs/nilfs2/segment.c
> @@ -741,6 +741,8 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode,
> do {
> if (!buffer_dirty(bh) || buffer_async_write(bh))
> continue;
> + if (!list_empty(&bh->b_assoc_buffers))
> + continue;
> get_bh(bh);
> list_add_tail(&bh->b_assoc_buffers, listp);
> ndirties++;
> @@ -779,7 +781,8 @@ static void nilfs_lookup_dirty_node_buffers(struct inode *inode,
> bh = head = folio_buffers(fbatch.folios[i]);
> do {
> if (buffer_dirty(bh) &&
> - !buffer_async_write(bh)) {
> + !buffer_async_write(bh) &&
> + list_empty(&bh->b_assoc_buffers)) {
> get_bh(bh);
> list_add_tail(&bh->b_assoc_buffers,
> listp);
> --
> 2.20.1
>
Thank you for the patch.
This patch adds a fix to forcibly avoid double registration of a
buffer head to the list at the list manipulation level.
However, we need to clarify why that happened in the first place, and
what caused the state inconsistency that led to this double
registration.
The search routine for dirty buffers performs a gang lookup for dirty
folios, registering them to the list in ascending order of their
offsets in the page cache.
Furthermore, the construction and destruction of this list take place
inside the log writer, which operates exclusively. Whether the write
succeeds or fails, the list is released by nilfs_release_buffers()
(called via nilfs_destroy_logs()). Therefore, double registration
normally does not occur, meaning there must be an oversight somewhere.
As this issue arises from calls made via the GC ioctl
(nilfs_ioctl_clean_segments()), the underlying implementation flaw
likely lies there.
Since it seems reproducible with the syzbot reproducer, I will also
trace what is happening to verify if this fix direction is
appropriate.
Thanks,
Ryusuke Konishi
^ permalink raw reply
* Re: [PATCH net v3 1/2] iov_iter: export iov_iter_restore
From: Christian Brauner @ 2026-06-25 10:43 UTC (permalink / raw)
To: Octavian Purdila
Cc: netdev, Alexander Viro, Andrew Morton, Arseniy Krasnov,
David S. Miller, Eric Dumazet, Eugenio Pérez, Jakub Kicinski,
Jason Wang, kvm, linux-block, linux-fsdevel, linux-kernel,
Michael S. Tsirkin, Paolo Abeni, Simon Horman, Stefan Hajnoczi,
Stefano Garzarella, virtualization, Xuan Zhuo, Jens Axboe
In-Reply-To: <20260622222757.2130402-2-tavip@google.com>
> Export iov_iter_restore so that it can be used by modules.
>
> This is needed by the virtio vsock transport (which can be built as a
> module) to restore the msg_iter state when transmission fails.
>
> Acked-by: Stefano Garzarella <sgarzare@redhat.com>
> Signed-off-by: Octavian Purdila <tavip@google.com>
>
> diff --git a/lib/iov_iter.c b/lib/iov_iter.c
> index 273919b16161..f5df63961fb2 100644
> --- a/lib/iov_iter.c
> +++ b/lib/iov_iter.c
> @@ -1491,6 +1491,7 @@ void iov_iter_restore(struct iov_iter *i, struct iov_iter_state *state)
> i->__iov -= state->nr_segs - i->nr_segs;
> i->nr_segs = state->nr_segs;
> }
> +EXPORT_SYMBOL_GPL(iov_iter_restore);
At least only export it for the module that really needs it. For
example, see:
EXPORT_SYMBOL_FOR_MODULES(__kernel_write, "autofs4");
--
Christian Brauner <brauner@kernel.org>
^ permalink raw reply
* Re: [PATCH] bluez5: set L2CAP IMTU for OBEX profile listeners
From: Yoann Congal @ 2026-06-25 10:42 UTC (permalink / raw)
To: Wei Deng; +Cc: openembedded-core
In-Reply-To: <20260625034712.3878106-1-wei.deng@oss.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]
Le jeu. 25 juin 2026 à 05:47, Wei Deng <wei.deng@oss.qualcomm.com> a écrit :
> Hi Yoann,
>
> This patch was merged to OE-core master on 2026-06-11 (commit 13cb97f).
> Could you please cherry-pick it to the wrynose branch as well? It fixes
> an OBEX Rx throughput regression caused by an incorrect L2CAP IMTU being
> advertised on listening sockets.
>
Hello,
I've noted to consider it. Looks good at a quick glance.
Ping back if you don't see it in the next wrynose review series.
Regards,
>
> Thanks,
>
> On Fri, 5 Jun 2026 08:13:08 +0530, Wei Deng <wei.deng@oss.qualcomm.com>
> wrote:
> > Backport upstream fix that adds an imtu field to default_settings for
> > OBEX profiles (OPP, FTP, PBAP, MAS, MNS) and applies it to the L2CAP
> > listening socket via bt_io_set(). Without this, the listening socket
> > advertises the L2CAP minimum of 672 bytes in L2CAP_CONFIGURATION_RSP,
> > limiting the peer's outgoing PDU size and degrading Rx throughput.
> >
> > Upstream-Status: Backport [bluez/bluez@646014a]
> > Signed-off-by: Wei Deng <wei.deng@oss.qualcomm.com>
> > ---
>
> --
> Best Regards,
> Wei Deng
>
--
Yoann Congal
Smile ECS
[-- Attachment #2: Type: text/html, Size: 2177 bytes --]
^ permalink raw reply
* Re: [PATCH 2/3] drm/amdgpu/mes11: set doorbell offset for suspending userq
From: Khatri, Sunil @ 2026-06-25 10:42 UTC (permalink / raw)
To: amd-gfx
In-Reply-To: <32c5afa2-f24e-4d8c-8872-72826e7d3d08@amd.com>
On 25-06-2026 04:10 pm, Christian König wrote:
>
> On 6/25/26 05:12, Prike Liang wrote:
>> Updating the union MESAPI__SUSPEND and union MESAPI__RESUME to
>> add the doorbell offset for suspending userq.
>>
>> Signed-off-by: Prike Liang <Prike.Liang@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 ++
>> drivers/gpu/drm/amd/include/mes_v11_api_def.h | 2 ++
>> 2 files changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
>> index 9e27d01cbfa3..ab0de6d04ff8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
>> @@ -783,6 +783,7 @@ static int mes_v11_0_suspend_gang(struct amdgpu_mes *mes,
>> mes_suspend_gang_pkt.gang_context_addr = input->gang_context_addr;
>> mes_suspend_gang_pkt.suspend_fence_addr = input->suspend_fence_addr;
>> mes_suspend_gang_pkt.suspend_fence_value = input->suspend_fence_value;
>> + mes_suspend_gang_pkt.doorbell_offset = input->doorbell_offset;
>>
>> return mes_v11_0_submit_pkt_and_poll_completion(mes,
>> &mes_suspend_gang_pkt, sizeof(mes_suspend_gang_pkt),
>> @@ -802,6 +803,7 @@ static int mes_v11_0_resume_gang(struct amdgpu_mes *mes,
>>
>> mes_resume_gang_pkt.resume_all_gangs = input->resume_all_gangs;
>> mes_resume_gang_pkt.gang_context_addr = input->gang_context_addr;
>> + mes_resume_gang_pkt.doorbell_offset = input->doorbell_offset;
>>
>> return mes_v11_0_submit_pkt_and_poll_completion(mes,
>> &mes_resume_gang_pkt, sizeof(mes_resume_gang_pkt),
>> diff --git a/drivers/gpu/drm/amd/include/mes_v11_api_def.h b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
>> index 6644fabeb0b7..b06412ac8583 100644
>> --- a/drivers/gpu/drm/amd/include/mes_v11_api_def.h
>> +++ b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
>> @@ -428,6 +428,7 @@ union MESAPI__SUSPEND {
>> uint32_t suspend_fence_value;
>>
>> struct MES_API_STATUS api_status;
>> + uint32_t doorbell_offset;
>> };
>>
>> uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
>> @@ -445,6 +446,7 @@ union MESAPI__RESUME {
>> uint64_t gang_context_addr;
>>
>> struct MES_API_STATUS api_status;
>> + uint32_t doorbell_offset;
If my understanding is correct only while adding a queue for the first
time doorbell offset is needed, not for anything else but you can check
with fw requirements.
Regards
Sunil khatri
> Is this backward compatible?
>
> Keep in mind that we can't break the FW interface.
>
> Regards,
> Christian.
>
>> };
>>
>> uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
^ permalink raw reply
* Re: [LTP] [PATCH v2] metadata: add linter for JSON file
From: Cyril Hrubis @ 2026-06-25 10:42 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: Linux Test Project
In-Reply-To: <20260625-metadata_linter-v2-1-1aac1def6150@suse.com>
Hi!
> diff --git a/metadata/Makefile b/metadata/Makefile
> index 6939b9f76ccc5612e9f6b56e88bc0a2f60a03234..641b02575d10d3af60975e14733a6085317758bc 100644
> --- a/metadata/Makefile
> +++ b/metadata/Makefile
> @@ -15,6 +15,10 @@ INSTALL_DIR = metadata
> ltp.json: metaparse metaparse-sh
> $(abs_srcdir)/parse.sh > ltp.json
>
> +.PHONY: lint
> +lint: ltp.json
> + $(abs_srcdir)/lint.py ltp.json
I wonder how to plug this into make check. If the linter could read
single test data from stdin we could do something as:
$(top_builddir)/metadata/metaparse foo.c | $(abs_scrdir)/lint.py
> test:
> $(MAKE) -C $(abs_srcdir)/tests/ test
>
> diff --git a/metadata/lint.py b/metadata/lint.py
> new file mode 100755
> index 0000000000000000000000000000000000000000..4511ee9bd408af4b10cd8b3331f5f0589684aba1
> --- /dev/null
> +++ b/metadata/lint.py
> @@ -0,0 +1,224 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2026 Linux Test Project
> +"""
> +Lint semantic consistency of generated metadata/ltp.json.
> +
> +This is not a schema validator; metaparse tests cover JSON shape. The linter
> +checks metadata rules that depend on the final generated test catalog:
> +
> + * Groups derived from the source path (the two nearest parent directories,
> + skipping 'kernel' and 'cve') must be present in test 'groups'.
> +
> + * A CVE tag requires the 'cve' group and a linux-git tag requires the
> + 'regression' group.
> +
> + * CVE tag values must use a valid bare YYYY-NNNN[...] identifier. With
> + --check-cve-exists, every CVE is verified against the official CVE
> + Services API (https://cveawg.mitre.org).
> +"""
> +
> +import argparse
> +import json
> +import os
> +import re
> +import sys
> +from typing import (
> + Any,
> + Dict,
> + List,
> + Pattern,
> + Tuple,
> +)
> +
> +CVE_RE: Pattern[str] = re.compile(r"^[0-9]{4}-[0-9]{4,}$")
^
We can be stricter here, all the CVEs start with 20 and are going to be
like that for the next 75 years.
> +CVE_API: str = "https://cveawg.mitre.org/api/cve/CVE-"
> +SKIP_PATH_GROUPS: Tuple[str, ...] = ("kernel", "cve")
> +
> +
> +def path_groups(fname: str) -> List[str]:
> + """
> + Return groups derived from the two nearest parent directories.
> + """
> + prefix = "testcases/"
> + if not fname.startswith(prefix):
> + return []
> +
> + dirs = fname[len(prefix) :].split("/")[:-1]
> + return [grp for grp in reversed(dirs[-2:]) if grp not in SKIP_PATH_GROUPS]
> +
> +
> +def tag_values(tags: List[List[str]], name: str) -> List[str]:
> + """
> + Return all values for metadata tags matching name.
> + """
> + return [tag[1] for tag in tags if len(tag) >= 2 and tag[0] == name]
> +
> +
> +def has_tag(tags: List[List[str]], name: str) -> bool:
> + """
> + Return whether a metadata tag exists.
> + """
> + return any(tag and tag[0] == name for tag in tags)
> +
> +
> +def expected_groups(conf: Dict[str, Any]) -> List[str]:
> + """
> + Return groups expected from test path and tags.
> + """
> + groups: List[str] = []
> + fname: str = conf.get("fname", "")
> + tags: List[List[str]] = conf.get("tags", [])
> +
> + for group in path_groups(fname):
> + if group not in groups:
> + groups.append(group)
> +
> + if has_tag(tags, "CVE") and "cve" not in groups:
> + groups.append("cve")
> +
> + if has_tag(tags, "linux-git") and "regression" not in groups:
> + groups.append("regression")
> +
> + return groups
> +
> +
> +def lint_groups(name: str, conf: Dict[str, Any]) -> List[str]:
> + """
> + Return group lint errors for a single test.
> + """
> + errors: List[str] = []
> + groups: List[str] = conf.get("groups", [])
> + expected: List[str] = expected_groups(conf)
> + missing: List[str] = [group for group in expected if group not in groups]
> +
> + if missing:
> + errors.append(f"{name}: missing groups: {', '.join(missing)}")
> +
> + return errors
Can we also error on invalid groups?
Invalid group would be anything that is not in the expected groups or in
a hand written list of groups (which will be added later and maintained
by hand as needed).
> +def lint_cve_format(name: str, conf: Dict[str, Any]) -> List[str]:
> + """
> + Return CVE format lint errors for a single test.
> + """
> + errors: List[str] = []
> + tags: List[List[str]] = conf.get("tags", [])
> +
> + for cve in tag_values(tags, "CVE"):
> + if cve.upper().startswith("CVE-"):
> + errors.append(
> + f"{name}: CVE tag '{cve}' must not start with 'CVE-' prefix, "
> + "use the bare 'YYYY-NNNN' identifier"
> + )
> + elif not CVE_RE.match(cve):
> + errors.append(f"{name}: malformed CVE identifier '{cve}'")
> +
> + return errors
> +
> +
> +def cve_exists(cve: str, cache: Dict[str, bool]) -> bool:
> + """
> + Query the CVE Services API and cache the answer per identifier.
> + """
> + import urllib.error
> + import urllib.request
> +
> + if cve in cache:
> + return cache[cve]
> +
> + req = urllib.request.Request(CVE_API + cve, method="GET")
> + try:
> + with urllib.request.urlopen(req, timeout=30) as resp:
> + ok = resp.status == 200
> + except urllib.error.HTTPError as err:
> + if err.code == 404:
> + ok = False
> + else:
> + raise
> + except urllib.error.URLError as err:
> + raise RuntimeError(f"cannot reach CVE API: {err}") from err
> +
> + cache[cve] = ok
> + return ok
Looking at the CVE JSON reply here there are even links to kernel
commits. If we wanted we could even parse the links and select these
that contain "torvalds" and end up with a hash and cross check the
linux-git hashes.
> +def lint_cve_existence(
> + name: str,
> + conf: Dict[str, Any],
> + cache: Dict[str, bool],
> +) -> List[str]:
> + """
> + Return CVE existence lint errors for a single test.
> + """
> + errors: List[str] = []
> + tags: List[List[str]] = conf.get("tags", [])
> +
> + for cve in tag_values(tags, "CVE"):
> + if CVE_RE.match(cve) and not cve_exists(cve, cache):
> + errors.append(f"{name}: CVE '{cve}' does not exist")
> +
> + return errors
> +
> +
> +def lint_tests(tests: Dict[str, Dict[str, Any]], check_cve_exists: bool) -> List[str]:
> + """
> + Return all lint errors for generated test metadata.
> + """
> + errors: List[str] = []
> + cache: Dict[str, bool] = {}
> +
> + for name, conf in sorted(tests.items()):
> + errors += lint_groups(name, conf)
We are missing a check that there are only know tag IDs present. At the
moment we support tags "cve", "linux-git", "glibc-git" and "musl-git".
Anything else is a garbage and should error out.
At the same time I do not see assert on the tag array lenght anywhere.
What happens when we have {"cve", "2022-289", "apple"} in the tags?
I guess that we need generic check_tag function that would assert that
there are only valid tags in the tags array and that the lenghts match.
> + errors += lint_cve_format(name, conf)
> + if check_cve_exists:
> + errors += lint_cve_existence(name, conf, cache)
> +
> + return errors
> +
> +
> +def main() -> int:
> + parser = argparse.ArgumentParser(
> + description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
> + )
> + default = os.path.join(os.path.dirname(__file__), "ltp.json")
> + parser.add_argument(
> + "metadata",
> + nargs="?",
> + default=default,
> + help="path to the ltp.json metadata file (default: %(default)s)",
> + )
> + parser.add_argument(
> + "--check-cve-online",
> + action="store_true",
> + help="verify CVE existence against the online CVE database",
> + )
> + args = parser.parse_args()
> +
> + try:
> + with open(args.metadata, encoding="utf-8") as data:
> + metadata: Dict[str, Any] = json.load(data)
> + except FileNotFoundError:
> + sys.exit(
> + f"error: metadata file '{args.metadata}' not found "
> + "(run 'make' in metadata/ first)"
> + )
> + except json.JSONDecodeError as err:
> + sys.exit(f"error: failed to parse '{args.metadata}': {err}")
^
We should print the error and the exit with failure
(return 1) here as well.
> + tests: Dict[str, Dict[str, Any]] = metadata.get("tests", {})
> + errors: List[str] = lint_tests(tests, args.check_cve_online)
> +
> + for err in errors:
> + print(err, file=sys.stderr)
> +
> + if errors:
> + print(f"\n{len(errors)} error(s) found in {len(tests)} tests", file=sys.stderr)
> + return 1
> +
> + print(f"metadata lint: {len(tests)} tests OK")
> + return 0
> +
> +
> +if __name__ == "__main__":
> + sys.exit(main())
>
> ---
> base-commit: 534222c4f3908e9642f913399e37a66fdd266bbe
> change-id: 20260624-metadata_linter-41c60691bcb2
>
> Best regards,
> --
> Andrea Cervesato <andrea.cervesato@suse.com>
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply
* [PATCH RESEND v2 1/1] hw/virtio-crypto: enforce max akcipher key length
From: helei @ 2026-06-25 10:38 UTC (permalink / raw)
To: qemu-devel; +Cc: arei.gonglei, zhenwei.pi, mst, helei
In-Reply-To: <20260625103836.3835-1-lhestz@163.com>
enforce the global max_size boundary for akcipher session creation
Signed-off-by: helei <lhestz@163.com>
---
hw/virtio/virtio-crypto.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index 6fceb39681..79e2acb56c 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -216,6 +216,12 @@ virtio_crypto_create_asym_session(VirtIOCrypto *vcrypto,
return -VIRTIO_CRYPTO_NOTSUPP;
}
+ if (unlikely(keylen > vcrypto->conf.max_size)) {
+ error_report("virtio-crypto length of akcipher key is too large: %u",
+ keylen);
+ return -VIRTIO_CRYPTO_ERR;
+ }
+
if (keylen) {
asym_info->key = g_malloc(keylen);
if (iov_to_buf(iov, out_num, 0, asym_info->key, keylen) != keylen) {
--
2.43.0
^ permalink raw reply related
* Re: [PATCH 6.12.y/6.18.y] ACPI: scan: Use async schedule function in acpi_scan_clear_dep_fn()
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, Rafael J. Wysocki, Len Brown, Paul Walmsley,
Palmer Dabbelt, Alexandre Ghiti, linux-acpi, linux-kernel,
linux-riscv, Yicong Yang, Rafael J. Wysocki, Vivian Wang
In-Reply-To: <20260624-acpi-dependency-thing-v1-1-ec0d99e5bf0f@iscas.ac.cn>
> [PATCH 6.12.y/6.18.y] ACPI: scan: Use async schedule function in
> acpi_scan_clear_dep_fn()
>
> [ Vivian: Adjust system_dfl_wq -> system_unbound_wq in removed lines ]
Queued for both 6.18 and 6.12, thanks.
--
Thanks,
Sasha
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply
* Re: [PATCH] staging: fbtft: fix unaligned access and buffer size when startbyte is used
From: sashiko-bot @ 2026-06-25 10:42 UTC (permalink / raw)
To: suryasaimadhu; +Cc: dri-devel
In-Reply-To: <20260625103041.281190-1-suryasaimadhu369@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The patch fixes unaligned pointer dereferences in `fbtft_write_reg` macros but misses identical unaligned accesses in `fbtft_write_vmem16_bus8()` and `write_vmem16_bus8()` (in `fb_ra8875.c`).
--
commit 41bf3a5882f6fd09bf60fb5460097488d5497b06
Author: suryasaimadhu <suryasaimadhu369@gmail.com>
staging: fbtft: fix unaligned access and buffer size when startbyte is used
This commit addresses an unaligned memory access in fbtft-bus.c macros
by replacing direct pointer dereferences with put_unaligned() when
par->startbyte is used. It also corrects a buffer size calculation.
> diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
> index 30e436ff19e4c..0314e450799de 100644
> --- a/drivers/staging/fbtft/fbtft-bus.c
> +++ b/drivers/staging/fbtft/fbtft-bus.c
[ ... ]
> @@ -39,7 +40,7 @@ void func(struct fbtft_par *par, int len, ...) \
> offset = 1; \
> } \
> \
> - *buf = modifier((data_type)va_arg(args, unsigned int)); \
> + put_unaligned(modifier((data_type)va_arg(args, unsigned int)), buf); \
> ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, \
> 0); \
[Severity: High]
This is a pre-existing issue, but does this same unaligned access pattern
exist in other functions that use startbyte?
Looking at fbtft_write_vmem16_bus8(), when par->startbyte is non-zero,
txbuf16 is offset by 1 byte and directly dereferenced:
drivers/staging/fbtft/fbtft-bus.c:fbtft_write_vmem16_bus8() {
...
txbuf16 = par->txbuf.buf + 1;
...
for (i = 0; i < to_copy; i++)
txbuf16[i] = cpu_to_be16(vmem16[i]);
...
}
Could this direct 16-bit store to an odd-aligned address still trigger
kernel panics on strict-alignment architectures during video memory updates?
A similar pattern also appears to exist in the ra8875 driver where
txbuf16 is unconditionally offset by 1 byte:
drivers/staging/fbtft/fb_ra8875.c:write_vmem16_bus8() {
...
txbuf16 = par->txbuf.buf + 1;
...
for (i = 0; i < to_copy; i++)
txbuf16[i] = cpu_to_be16(vmem16[i]);
...
}
Should these locations also be updated to use put_unaligned() to ensure
all unaligned accesses are caught by this fix?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260625103041.281190-1-suryasaimadhu369@gmail.com?part=1
^ permalink raw reply
* Re: Please backport bridge multicast exponential field encoding fix series to stable kernels
From: Sasha Levin @ 2026-06-25 10:42 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Nikolay Aleksandrov, Ido Schimmel, David Ahern,
Shuah Khan, Andy Roulin, Yong Wang, Petr Machata, stable, Greg KH,
Greg Kroah-Hartman
Cc: Sasha Levin, Ujjal Roy, bridge, Kernel, Kernel, linux-kselftest,
Ujjal Roy
In-Reply-To: <CAE2MWknz4X_gcNo6jkR87Lg8F0zfubkOc4Ujr57CS3aBMWrjEA@mail.gmail.com>
> Please backport the 5-patch bridge multicast exponential field
> encoding series (726fa7da2d8c, 12cfb4ecc471, 95bfd196f0dc,
> e51560f4220a, 529dbe762de0) to the stable kernels.
I tried, but it doesn't apply to 7.1. Could you provide a backport please?
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH 5.10.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, Bjoern Doebel, Steven Rostedt, Masami Hiramatsu,
linux-trace-kernel, linux-kernel, Mathieu Desnoyers,
David Howells
In-Reply-To: <20260624122413.2477871-1-doebel@amazon.de>
> [PATCH 5.10.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
Same as the 5.15 one - I had to drop this for 5.10. The
guard(raw_spinlock_irqsave) conversion triggers a new
-Wdeclaration-after-statement warning in ring_buffer_read_start() on this tree.
Please respin a warning-free version for 5.10/5.15. 6.6 and 6.1 are queued.
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH 5.15.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, Bjoern Doebel, Steven Rostedt, Masami Hiramatsu,
linux-trace-kernel, linux-kernel, Mathieu Desnoyers,
David Howells
In-Reply-To: <20260624122351.2477592-1-doebel@amazon.de>
> [PATCH 5.15.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
I had to drop this one for 5.15. The upstream guard(raw_spinlock_irqsave)
conversion in ring_buffer_read_start() introduces a new
-Wdeclaration-after-statement warning on 5.15 (the guard variable ends up after
a statement), which the build flags as an
error there.
Could you respin a warning-free version for 5.15 (and 5.10, which has the same
problem)? E.g. hoisting the declaration or keeping the explicit
raw_spin_lock/unlock instead of guard() on these older trees. 6.6 and 6.1 are
already queued.
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH 1/2] mm/mm_init: don't overlap NORMAL and MOVABLE zones with kernelcore=mirror
From: David Hildenbrand (Arm) @ 2026-06-25 10:42 UTC (permalink / raw)
To: Mike Rapoport, linux-mm
Cc: Andrew Morton, Taku Izumi, Wei Yang, Yuan Liu, linux-kernel
In-Reply-To: <20260625073941.145014-2-rppt@kernel.org>
On 6/25/26 09:39, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
>
> When kernelcore or movablecore kernel parameters define size of the
> NORMAL and MOVABLE zones as percents of the total memory or by absolute
> value, ZONE_NORMAL is clamped at the beginning of ZONE_MOVABLE.
>
> However, when kernelcore=mirror the ZONE_NORMAL span is not changed but
> rather pages from ZONE_MOVABLE counted as absent in ZONE_NORMAL.
>
> Make the behaviour of kernelcore= parameter uniform and treat mirror
> just as another way to size the zones.
That sounds just about right to me.
Hard to imagine that any code would have relied on the old behavior.
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply
* Re: [PATCH 6.1.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, Bjoern Doebel, Steven Rostedt, Masami Hiramatsu,
linux-trace-kernel, linux-kernel, Mathieu Desnoyers,
David Howells
In-Reply-To: <20260624122328.2477272-1-doebel@amazon.de>
> [PATCH 6.1.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
Queued for 6.1, thanks! (6.6 is queued too; 5.15/5.10 need a respin -
see those threads.)
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH 6.6.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, Bjoern Doebel, Steven Rostedt, Masami Hiramatsu,
linux-trace-kernel, linux-kernel, Mathieu Desnoyers,
David Howells
In-Reply-To: <20260624122258.2476991-1-doebel@amazon.de>
> [PATCH 6.6.y] ring-buffer: Remove ring_buffer_read_prepare_sync()
Queued for 6.6, thanks! 6.1 is queued too; the 5.15 and 5.10 versions
need a respin - see my replies on those threads.
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH 5.15/6.1/6.6] af_unix: Reject SIOCATMARK on non-stream sockets
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman
Cc: Sasha Levin, Alexander Martyniuk, David S. Miller, Jakub Kicinski,
Paolo Abeni, Kuniyuki Iwashima, Jann Horn, Lee Jones, Rao Shoaib,
netdev, linux-kernel, stable, Yuan Tan, Yifan Wu, Juefei Pu,
Xin Liu, Jiexun Wang, Ren Wei
In-Reply-To: <20260624151651.38894-1-alexevgmart@gmail.com>
> [PATCH 5.15/6.1/6.6] af_unix: Reject SIOCATMARK on non-stream sockets
>
> Backport fix for CVE-2026-52928. Reject SIOCATMARK in unix_ioctl()
> for non-stream sockets.
Queued for 6.6, 6.1 and 5.15, thanks!
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH v2] KVM: s390: pci: Fix GISC refcount leak on AIF enable failure
From: Christian Borntraeger @ 2026-06-25 10:42 UTC (permalink / raw)
To: Haoxiang Li, mjrosato, alifm, farman, frankja, imbrenda, david,
hca, gor, agordeev, svens, schnelle
Cc: linux-s390, kvm, linux-kernel, stable
In-Reply-To: <20260624061910.2794734-1-haoxiang_li2024@163.com>
Am 24.06.26 um 08:19 schrieb Haoxiang Li:
> kvm_s390_gisc_register() registers the guest ISC before pinning
> the guest interrupt forwarding pages and allocating the AISB bit.
> If any of the later setup steps fails, the function unwinds the
> pinned pages and other local state, but does not unregister the
> GISC reference. Add the missing kvm_s390_gisc_unregister() to the
> error unwind path.
>
> Fixes: 3c5a1b6f0a18 ("KVM: s390: pci: provide routines for enabling/disabling interrupt forwarding")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> ---
> Changes in v2:
> - Move unregister call after "out" label. Thanks, Matt!
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
applied.
^ permalink raw reply
* Re: [PATCH 6.12.y/6.18.y] ACPI: scan: Use async schedule function in acpi_scan_clear_dep_fn()
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, Rafael J. Wysocki, Len Brown, Paul Walmsley,
Palmer Dabbelt, Alexandre Ghiti, linux-acpi, linux-kernel,
linux-riscv, Yicong Yang, Rafael J. Wysocki, Vivian Wang
In-Reply-To: <20260624-acpi-dependency-thing-v1-1-ec0d99e5bf0f@iscas.ac.cn>
> [PATCH 6.12.y/6.18.y] ACPI: scan: Use async schedule function in
> acpi_scan_clear_dep_fn()
>
> [ Vivian: Adjust system_dfl_wq -> system_unbound_wq in removed lines ]
Queued for both 6.18 and 6.12, thanks.
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH 5.10] netfilter: nf_log: validate MAC header was set before dumping it
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman
Cc: Sasha Levin, Alexander Martyniuk, Pablo Neira Ayuso,
Jozsef Kadlecsik, Florian Westphal, David S. Miller,
Alexey Kuznetsov, Hideaki YOSHIFUJI, Jakub Kicinski,
Patrick McHardy, netfilter-devel, coreteam, netdev, linux-kernel,
Weiming Shi, Xiang Mei
In-Reply-To: <20260624140117.19799-1-alexevgmart@gmail.com>
> [PATCH 5.10] netfilter: nf_log: validate MAC header was set before
> dumping it
>
> --- a/net/ipv4/netfilter/nf_log_ipv4.c
> +++ b/net/ipv4/netfilter/nf_log_ipv4.c
Thanks for the backport - the retarget to nf_log_ipv4.c is right for 5.10.
One gap though: upstream fixed both loggers via the consolidated
nf_log_syslog.c, but in 5.10 the IPv6 logger (net/ipv6/netfilter/
nf_log_ipv6.c) still has the identical unguarded fallback and is left
vulnerable here - which is also Pablo's "why only 5.10?" point.
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH stable 5.15] xhci: fix memory leak regression when freeing xhci vdev devices depth first
From: Sasha Levin @ 2026-06-25 10:41 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, gregkh, WeitaoWang-oc, linux-usb, mathias.nyman,
bcm-kernel-feedback-list, Mathias Nyman, David Wang, Michal Pecio,
Justin Chen
In-Reply-To: <20260624034938.4126679-1-justin.chen@broadcom.com>
> xhci: fix memory leak regression when freeing xhci vdev devices depth first
>
> Pass xhci->devs[slot_id] instead of the reused vdev temporary to
> xhci_free_virt_device() in the leaf path of
> xhci_free_virt_devices_depth_first().
Queued for 5.15, thanks!
--
Thanks,
Sasha
^ permalink raw reply
* [PATCH v5 5/7] drm/verisilicon: add DC8000 (DCUltraLite) display controller support
From: Joey Lu @ 2026-06-25 9:44 UTC (permalink / raw)
To: zhengxingda, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, robh, krzk+dt, conor+dt
Cc: ychuang3, schung, yclu4, dri-devel, devicetree, linux-arm-kernel,
linux-kernel, Joey Lu
In-Reply-To: <20260625094449.708386-1-a0987203069@gmail.com>
The Nuvoton MA35D1 SoC integrates a Verisilicon DCUltraLite display
controller (DC8000 generation) whose register layout differs from
the DC8200 in several important ways:
1. No CONFIG_EX commit path: framebuffer updates use the enable (bit 0)
and reset (bit 4) bits in FB_CONFIG instead of the DC8200 staging
registers (FB_CONFIG_EX, FB_TOP_LEFT, FB_BOTTOM_RIGHT,
FB_BLEND_CONFIG, PANEL_CONFIG_EX).
2. No PANEL_START register: panel output starts when
PANEL_CONFIG.RUNNING is set; there is no multi-display sync start
register.
3. Different IRQ registers: DCUltraLite uses DISP_IRQ_STA (0x147C) /
DISP_IRQ_EN (0x1480) versus DC8200's TOP_IRQ_ACK (0x0010) /
TOP_IRQ_EN (0x0014).
4. Simpler clock topology: only 'core' (bus gate) and 'pix0' (pixel
divider) clocks; no axi or ahb clocks required.
Signed-off-by: Joey Lu <a0987203069@gmail.com>
---
drivers/gpu/drm/verisilicon/Makefile | 2 +-
drivers/gpu/drm/verisilicon/vs_dc.c | 5 +-
drivers/gpu/drm/verisilicon/vs_dc.h | 1 +
drivers/gpu/drm/verisilicon/vs_dc8000.c | 86 +++++++++++++++++++++++++
4 files changed, 92 insertions(+), 2 deletions(-)
create mode 100644 drivers/gpu/drm/verisilicon/vs_dc8000.c
diff --git a/drivers/gpu/drm/verisilicon/Makefile b/drivers/gpu/drm/verisilicon/Makefile
index 9d4cd16452fa..d2fd8e4dff24 100644
--- a/drivers/gpu/drm/verisilicon/Makefile
+++ b/drivers/gpu/drm/verisilicon/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
-verisilicon-dc-objs := vs_bridge.o vs_crtc.o vs_dc.o vs_dc8200.o vs_drm.o vs_hwdb.o \
+verisilicon-dc-objs := vs_bridge.o vs_crtc.o vs_dc.o vs_dc8200.o vs_dc8000.o vs_drm.o vs_hwdb.o \
vs_plane.o vs_primary_plane.o vs_cursor_plane.o
obj-$(CONFIG_DRM_VERISILICON_DC) += verisilicon-dc.o
diff --git a/drivers/gpu/drm/verisilicon/vs_dc.c b/drivers/gpu/drm/verisilicon/vs_dc.c
index fd1f5fe67a68..9499fffbca58 100644
--- a/drivers/gpu/drm/verisilicon/vs_dc.c
+++ b/drivers/gpu/drm/verisilicon/vs_dc.c
@@ -134,7 +134,10 @@ static int vs_dc_probe(struct platform_device *pdev)
dev_info(dev, "Found DC%x rev %x customer %x\n", dc->identity.model,
dc->identity.revision, dc->identity.customer_id);
- dc->funcs = &vs_dc8200_funcs;
+ if (dc->identity.generation == VSDC_GEN_DC8200)
+ dc->funcs = &vs_dc8200_funcs;
+ else
+ dc->funcs = &vs_dc8000_funcs;
if (port_count > dc->identity.display_count) {
dev_err(dev, "too many downstream ports than HW capability\n");
diff --git a/drivers/gpu/drm/verisilicon/vs_dc.h b/drivers/gpu/drm/verisilicon/vs_dc.h
index 825f5dd6bf17..ac96ad701199 100644
--- a/drivers/gpu/drm/verisilicon/vs_dc.h
+++ b/drivers/gpu/drm/verisilicon/vs_dc.h
@@ -66,5 +66,6 @@ struct vs_dc {
};
extern const struct vs_dc_funcs vs_dc8200_funcs;
+extern const struct vs_dc_funcs vs_dc8000_funcs;
#endif /* _VS_DC_H_ */
diff --git a/drivers/gpu/drm/verisilicon/vs_dc8000.c b/drivers/gpu/drm/verisilicon/vs_dc8000.c
new file mode 100644
index 000000000000..fbe0fa516cac
--- /dev/null
+++ b/drivers/gpu/drm/verisilicon/vs_dc8000.c
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2026 Joey Lu <yclu4@nuvoton.com>
+ */
+
+#include <linux/regmap.h>
+
+#include "vs_crtc_regs.h"
+#include "vs_dc.h"
+#include "vs_drm.h"
+#include "vs_primary_plane_regs.h"
+
+static void vs_dc8000_panel_enable_ex(struct vs_dc *dc, unsigned int output)
+{
+ regmap_set_bits(dc->regs, VSDC_FB_CONFIG(output),
+ VSDC_FB_CONFIG_RESET);
+}
+
+static void vs_dc8000_panel_disable_ex(struct vs_dc *dc, unsigned int output)
+{
+ regmap_clear_bits(dc->regs, VSDC_FB_CONFIG(output),
+ VSDC_FB_CONFIG_RESET);
+}
+
+static void vs_dc8000_crtc_begin(struct vs_dc *dc, unsigned int output)
+{
+ regmap_set_bits(dc->regs, VSDC_FB_CONFIG(output),
+ VSDC_FB_CONFIG_VALID);
+}
+
+static void vs_dc8000_crtc_flush(struct vs_dc *dc, unsigned int output)
+{
+ regmap_clear_bits(dc->regs, VSDC_FB_CONFIG(output),
+ VSDC_FB_CONFIG_VALID);
+}
+
+static void vs_dc8000_crtc_enable_ex(struct vs_dc *dc, unsigned int output)
+{
+ regmap_set_bits(dc->regs, VSDC_FB_CONFIG(output),
+ VSDC_FB_CONFIG_ENABLE);
+}
+
+static void vs_dc8000_crtc_disable_ex(struct vs_dc *dc, unsigned int output)
+{
+ regmap_clear_bits(dc->regs, VSDC_FB_CONFIG(output),
+ VSDC_FB_CONFIG_ENABLE);
+}
+
+static void vs_dc8000_enable_vblank(struct vs_dc *dc, unsigned int output)
+{
+ regmap_set_bits(dc->regs, VSDC_DISP_IRQ_EN,
+ VSDC_DISP_IRQ_VSYNC(output));
+}
+
+static void vs_dc8000_disable_vblank(struct vs_dc *dc, unsigned int output)
+{
+ regmap_clear_bits(dc->regs, VSDC_DISP_IRQ_EN,
+ VSDC_DISP_IRQ_VSYNC(output));
+}
+
+static u32 vs_dc8000_irq_ack(struct vs_dc *dc)
+{
+ u32 hw_irqs, unified = 0;
+ unsigned int i;
+
+ regmap_read(dc->regs, VSDC_DISP_IRQ_STA, &hw_irqs);
+
+ for (i = 0; i < VSDC_MAX_OUTPUTS; i++) {
+ if (hw_irqs & VSDC_DISP_IRQ_VSYNC(i))
+ unified |= VSDC_IRQ_VSYNC(i);
+ }
+
+ return unified;
+}
+
+const struct vs_dc_funcs vs_dc8000_funcs = {
+ .panel_enable_ex = vs_dc8000_panel_enable_ex,
+ .panel_disable_ex = vs_dc8000_panel_disable_ex,
+ .crtc_begin = vs_dc8000_crtc_begin,
+ .crtc_flush = vs_dc8000_crtc_flush,
+ .crtc_enable_ex = vs_dc8000_crtc_enable_ex,
+ .crtc_disable_ex = vs_dc8000_crtc_disable_ex,
+ .enable_vblank = vs_dc8000_enable_vblank,
+ .disable_vblank = vs_dc8000_disable_vblank,
+ .irq_ack = vs_dc8000_irq_ack,
+};
--
2.43.0
^ permalink raw reply related
* Re: [PATCH 2/3] drm/amdgpu/mes11: set doorbell offset for suspending userq
From: Christian König @ 2026-06-25 10:40 UTC (permalink / raw)
To: Prike Liang, amd-gfx; +Cc: Alexander.Deucher, Shaoyun.Liu
In-Reply-To: <20260625031252.298647-2-Prike.Liang@amd.com>
On 6/25/26 05:12, Prike Liang wrote:
> Updating the union MESAPI__SUSPEND and union MESAPI__RESUME to
> add the doorbell offset for suspending userq.
>
> Signed-off-by: Prike Liang <Prike.Liang@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 ++
> drivers/gpu/drm/amd/include/mes_v11_api_def.h | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> index 9e27d01cbfa3..ab0de6d04ff8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> @@ -783,6 +783,7 @@ static int mes_v11_0_suspend_gang(struct amdgpu_mes *mes,
> mes_suspend_gang_pkt.gang_context_addr = input->gang_context_addr;
> mes_suspend_gang_pkt.suspend_fence_addr = input->suspend_fence_addr;
> mes_suspend_gang_pkt.suspend_fence_value = input->suspend_fence_value;
> + mes_suspend_gang_pkt.doorbell_offset = input->doorbell_offset;
>
> return mes_v11_0_submit_pkt_and_poll_completion(mes,
> &mes_suspend_gang_pkt, sizeof(mes_suspend_gang_pkt),
> @@ -802,6 +803,7 @@ static int mes_v11_0_resume_gang(struct amdgpu_mes *mes,
>
> mes_resume_gang_pkt.resume_all_gangs = input->resume_all_gangs;
> mes_resume_gang_pkt.gang_context_addr = input->gang_context_addr;
> + mes_resume_gang_pkt.doorbell_offset = input->doorbell_offset;
>
> return mes_v11_0_submit_pkt_and_poll_completion(mes,
> &mes_resume_gang_pkt, sizeof(mes_resume_gang_pkt),
> diff --git a/drivers/gpu/drm/amd/include/mes_v11_api_def.h b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
> index 6644fabeb0b7..b06412ac8583 100644
> --- a/drivers/gpu/drm/amd/include/mes_v11_api_def.h
> +++ b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
> @@ -428,6 +428,7 @@ union MESAPI__SUSPEND {
> uint32_t suspend_fence_value;
>
> struct MES_API_STATUS api_status;
> + uint32_t doorbell_offset;
> };
>
> uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
> @@ -445,6 +446,7 @@ union MESAPI__RESUME {
> uint64_t gang_context_addr;
>
> struct MES_API_STATUS api_status;
> + uint32_t doorbell_offset;
Is this backward compatible?
Keep in mind that we can't break the FW interface.
Regards,
Christian.
> };
>
> uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
^ permalink raw reply
* [PATCH v3] rust_binder: reject context manager self-transaction
From: Keshav Verma @ 2026-06-25 10:39 UTC (permalink / raw)
To: Alice Ryhl
Cc: Carlos Llamas, Greg Kroah-Hartman, Arve Hjønnevåg,
Todd Kjos, Christian Brauner, Miguel Ojeda, Boqun Feng, Gary Guo,
linux-kernel, rust-for-linux, Keshav Verma, stable
In-Reply-To: <20260621210134.441-1-iganschel@gmail.com>
Rust binder resolved handle 0 to the context manager node, but it does not
reject the case where the caller owns the same node.
The C binder driver rejects transactions from the context-manager process
to handle 0 after resolving the target node. Match that behavior in Rust
Binder by rejecting handle 0 transactions when the resolved context-manager
node is owned by the calling process.
This applies to both synchronous and oneway transactions because both paths
resolve the target through Process::get_transaction_node().
Cc: stable@kernel.org
Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
Signed-off-by: Keshav Verma <iganschel@gmail.com>
---
Changes in v3:
- Keep the check scoped to the Binder Process object, allowing transactions
between different binder fds owned by the same OS process.
Changes in v2:
- Compare the underlying OS process task instead of Rust Binder Process object.
drivers/android/binder/process.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs
index d09facebddf6..5befff9cf5b9 100644
--- a/drivers/android/binder/process.rs
+++ b/drivers/android/binder/process.rs
@@ -901,7 +901,11 @@ pub(crate) fn insert_or_update_handle(
pub(crate) fn get_transaction_node(&self, handle: u32) -> BinderResult<NodeRef> {
// When handle is zero, try to get the context manager.
if handle == 0 {
- Ok(self.ctx.get_manager_node(true)?)
+ let node_ref = self.ctx.get_manager_node(true)?;
+ if core::ptr::eq(self, &*node_ref.node.owner) {
+ return Err(EINVAL.into());
+ }
+ Ok(node_ref)
} else {
Ok(self.get_node_from_handle(handle, true)?)
}
--
2.39.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.