mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sparc64: Fix missing SYSRQ_ENABLE_DUMP mask on 'y' and 'x' sysrq keys
@ 2026-12-03 17:18 Ian Rogers
  0 siblings, 0 replies; only message in thread
From: Ian Rogers @ 2026-12-03 17:18 UTC (permalink / raw)
  To: David S . Miller, Andreas Larsson
  Cc: Nathan Chancellor, sparclinux, llvm, linux-kernel, Ian Rogers

Both sparc_globalreg_op ('y', global-regs) and sparc_globalpmu_op ('x',
global-pmu) dump diagnostic CPU/PMU register state, similar to MIPS and
LoongArch sysrq_tlbdump_op ('x', SYSRQ_ENABLE_DUMP).

Because .enable_mask was omitted in both struct sysrq_key_op
definitions, it defaulted to 0, preventing 'y' and 'x' from being
enabled via the SYSRQ_ENABLE_DUMP (0x8) bitmask in
/proc/sys/kernel/sysrq.

Found with Clang's require_explicit_initialization attribute on
struct sysrq_key_op.

Fixes: 93dae5b70e7c ("sparc64: Add global register dumping facility.")
Fixes: 916ca14aaf12 ("sparc64: Add global PMU register dumping via sysrq.")
Signed-off-by: Ian Rogers <irogers@google.com>
---
Note: Found using Clang's require_explicit_initialization attribute;
an AI coding assistant helped audit call sites, verify Fixes commits,
and draft the changelog.

 arch/sparc/kernel/process_64.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index e889da8e4835..295f3d067b94 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -304,6 +304,7 @@ static const struct sysrq_key_op sparc_globalreg_op = {
 	.handler	= sysrq_handle_globreg,
 	.help_msg	= "global-regs(y)",
 	.action_msg	= "Show Global CPU Regs",
+	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
 
 static void __global_pmu_self(int this_cpu)
@@ -379,6 +380,7 @@ static const struct sysrq_key_op sparc_globalpmu_op = {
 	.handler	= sysrq_handle_globpmu,
 	.help_msg	= "global-pmu(x)",
 	.action_msg	= "Show Global PMU Regs",
+	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
 
 static int __init sparc_sysrq_init(void)

base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-03 17:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-03 17:18 [PATCH] sparc64: Fix missing SYSRQ_ENABLE_DUMP mask on 'y' and 'x' sysrq keys Ian Rogers

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®