From: Ian Rogers <irogers@google.com>
To: "David S . Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
sparclinux@vger.kernel.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org, Ian Rogers <irogers@google.com>
Subject: [PATCH] sparc64: Fix missing SYSRQ_ENABLE_DUMP mask on 'y' and 'x' sysrq keys
Date: Thu, 3 Dec 2026 09:18:16 -0800 [thread overview]
Message-ID: <20261203171816.444053-1-irogers@google.com> (raw)
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
reply other threads:[~2026-12-03 17:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261203171816.444053-1-irogers@google.com \
--to=irogers@google.com \
--cc=andreas@gaisler.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=sparclinux@vger.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
all inboxes | Powered by JetHome®