From: Shivang Upadhyay <shivangu@linux.ibm.com>
To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: mkchauras@gmail.com, adityag@linux.ibm.com,
adri.vero.dev@gmail.com, anushree.mathur@linux.vnet.ibm.com,
chleroy@kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au,
npiggin@gmail.com, shivangu@linux.ibm.com,
sourabhjain@linux.ibm.com,
Anushree Mathur <anushree.mathur@linux.ibm.com>
Subject: [PATCH v5] ppc/fadump: collect dump when CPU_STATE_DATA is less than reserved
Date: Mon, 28 Sep 2026 15:46:46 +0530 [thread overview]
Message-ID: <20260928101646.415278-1-shivangu@linux.ibm.com> (raw)
During Fadump in Qemu VM, when maxcpus value is set to more than current
cpus, following failure is observed.
[ 0.045806] [ T1] rtas fadump: Dump taken by platform is
incomplete (0)
This is because the CPU_STATE_DATA is allocated for maxcpus, while the
data is only filled for current cpus. As per current implementation
of Fadump, dumped_bytes and source_len for a region have to match,
Which is failing for qemu's case, Even tough the dumped bytes are
reported correctly for only the current cpus. After this /proc/vmcore
generatition also fails.
Allowing dumped_bytes to be lesser than or equal to allocated length, for
CPU_STATE_DATA Fadump region.
Reported-by: Anushree Mathur <anushree.mathur@linux.vnet.ibm.com>
Closes: https://lore.kernel.org/all/5e66daf4-3f55-4044-94a5-4f50bb040849@linux.ibm.com/T/#u
Tested-by: Anushree Mathur <anushree.mathur@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
---
Changelog:
v5:
- rebase to master
- fixed error message to incomplete/corrupted based on dumped size.
v4: https://lore.kernel.org/all/20260828094942.2439404-1-shivangu@linux.ibm.com/
removed extra blank line.
v3: https://lore.kernel.org/all/20260827075803.2240934-1-shivangu@linux.ibm.com/
removed extra variable.
v2: https://lore.kernel.org/all/20260826125626.2108771-1-shivangu@linux.ibm.com/
Only allowing lesser size for CPU_STATE_DATE Fadump region.
v1: https://lore.kernel.org/qemu-devel/20260429065127.366813-1-shivangu@linux.ibm.com/
---
arch/powerpc/platforms/pseries/rtas-fadump.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/rtas-fadump.c b/arch/powerpc/platforms/pseries/rtas-fadump.c
index 3bb4ac2ab6cc..9b9e09f3d900 100644
--- a/arch/powerpc/platforms/pseries/rtas-fadump.c
+++ b/arch/powerpc/platforms/pseries/rtas-fadump.c
@@ -459,6 +459,8 @@ static int __init rtas_fadump_process(struct fw_dump *fadump_conf)
/* Check if the dump data is valid. */
for (int i = 0; i < be16_to_cpu(fdm_active->header.dump_num_sections); i++) {
int type = be16_to_cpu(fdm_active->rgn[i].source_data_type);
+ uint64_t bytes_dumped = be64_to_cpu(fdm_active->rgn[i].bytes_dumped);
+ uint64_t source_len = be64_to_cpu(fdm_active->rgn[i].source_len);
int rc = 0;
switch (type) {
@@ -469,10 +471,20 @@ static int __init rtas_fadump_process(struct fw_dump *fadump_conf)
pr_err("Dump taken by platform is not valid (%d)\n", i);
rc = -EINVAL;
}
- if (fdm_active->rgn[i].bytes_dumped != fdm_active->rgn[i].source_len) {
- pr_err("Dump taken by platform is incomplete (%d)\n", i);
+
+ /*
+ * Make sure that dump is collected for entire region.
+ * CPU_STATE_DATA region is allowed to dump less than allocated space.
+ */
+ if (!(bytes_dumped == source_len ||
+ (type == RTAS_FADUMP_CPU_STATE_DATA && bytes_dumped <= source_len))) {
+ pr_err("Dump taken by platform is %s (%d)\n",
+ (bytes_dumped < source_len ? "incomplete" : "corrupted"), i);
+ pr_debug("type -> %d, bytes_dumped -> %llx, source_len -> %llx\n",
+ type, bytes_dumped, source_len);
rc = -EINVAL;
}
+
if (rc) {
pr_warn("Region type: %u src addr: 0x%llx dest addr: 0x%llx\n",
be16_to_cpu(fdm_active->rgn[i].source_data_type),
@@ -482,7 +494,7 @@ static int __init rtas_fadump_process(struct fw_dump *fadump_conf)
}
break;
case RTAS_FADUMP_PARAM_AREA:
- if (fdm_active->rgn[i].bytes_dumped != fdm_active->rgn[i].source_len ||
+ if (bytes_dumped != source_len ||
fdm_active->rgn[i].error_flags != 0) {
pr_warn("Failed to process additional parameters! Proceeding anyway..\n");
fadump_conf->param_area = 0;
--
2.54.0
next reply other threads:[~2026-09-28 10:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 10:16 Shivang Upadhyay [this message]
2026-10-14 9:14 ` [PATCH v5] ppc/fadump: collect dump when CPU_STATE_DATA is less than reserved Madhavan Srinivasan
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=20260928101646.415278-1-shivangu@linux.ibm.com \
--to=shivangu@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=adri.vero.dev@gmail.com \
--cc=anushree.mathur@linux.ibm.com \
--cc=anushree.mathur@linux.vnet.ibm.com \
--cc=chleroy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mkchauras@gmail.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=sourabhjain@linux.ibm.com \
/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 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.