From: Christian Brauner <brauner@kernel.org>
To: linux-fsdevel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Breno Leitao <leitao@debian.org>, Chris Mason <mason@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
x86@kernel.org, kexec@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org, loongarch@lists.linux.dev,
linux-mips@vger.kernel.org, linux-sh@vger.kernel.org,
linux-kernel@vger.kernel.org,
David Hildenbrand <david@kernel.org>,
"Christian Brauner (Amutable)" <brauner@kernel.org>
Subject: [PATCH RFC 4/4] crash_dump: use copy_oldmem_to_iter() everywhere
Date: Thu, 12 Nov 2026 17:37:10 +0100 [thread overview]
Message-ID: <20261112-work-procfs-oldmem-v1-4-ecdcafd99265@kernel.org> (raw)
In-Reply-To: <20261112-work-procfs-oldmem-v1-0-ecdcafd99265@kernel.org>
Make the remaining copy_oldmem_page() implementations copy the page of
the crashed kernel with copy_oldmem_to_iter() like x86_64 and powerpc
do. None of these architectures has a machine check safe copy today, so
for them this is copy_to_iter() under another name. But the copy of a
page of the old kernel is in one place now, and an architecture that
gains ARCH_HAS_COPY_MC later gets the recovery without touching its
crash dump code.
s390 stays as it is. It copies the old kernel's memory through its real
address mode window in memcpy_real_iter(), and an uncorrected storage
error is fatal on s390 anyway (cf. s390_handle_damage()).
No functional changes.
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
arch/arm/kernel/crash_dump.c | 2 +-
arch/arm64/kernel/crash_dump.c | 2 +-
arch/loongarch/kernel/crash_dump.c | 2 +-
arch/mips/kernel/crash_dump.c | 2 +-
arch/riscv/kernel/crash_dump.c | 2 +-
arch/sh/kernel/crash_dump.c | 2 +-
arch/x86/kernel/crash_dump_32.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/kernel/crash_dump.c b/arch/arm/kernel/crash_dump.c
index 938bd932df9a0..0f2628872b00c 100644
--- a/arch/arm/kernel/crash_dump.c
+++ b/arch/arm/kernel/crash_dump.c
@@ -28,7 +28,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
if (!vaddr)
return -ENOMEM;
- csize = copy_to_iter(vaddr + offset, csize, iter);
+ csize = copy_oldmem_to_iter(vaddr + offset, csize, iter);
iounmap(vaddr);
return csize;
diff --git a/arch/arm64/kernel/crash_dump.c b/arch/arm64/kernel/crash_dump.c
index 670e4ce818223..c774b3aba107d 100644
--- a/arch/arm64/kernel/crash_dump.c
+++ b/arch/arm64/kernel/crash_dump.c
@@ -24,7 +24,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
if (!vaddr)
return -ENOMEM;
- csize = copy_to_iter(vaddr + offset, csize, iter);
+ csize = copy_oldmem_to_iter(vaddr + offset, csize, iter);
memunmap(vaddr);
diff --git a/arch/loongarch/kernel/crash_dump.c b/arch/loongarch/kernel/crash_dump.c
index e559307c10929..03a136b8be8da 100644
--- a/arch/loongarch/kernel/crash_dump.c
+++ b/arch/loongarch/kernel/crash_dump.c
@@ -15,7 +15,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
if (!vaddr)
return -ENOMEM;
- csize = copy_to_iter(vaddr + offset, csize, iter);
+ csize = copy_oldmem_to_iter(vaddr + offset, csize, iter);
memunmap(vaddr);
diff --git a/arch/mips/kernel/crash_dump.c b/arch/mips/kernel/crash_dump.c
index 6e50f49024094..078c0d1e8df46 100644
--- a/arch/mips/kernel/crash_dump.c
+++ b/arch/mips/kernel/crash_dump.c
@@ -12,7 +12,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
return 0;
vaddr = kmap_local_pfn(pfn);
- csize = copy_to_iter(vaddr + offset, csize, iter);
+ csize = copy_oldmem_to_iter(vaddr + offset, csize, iter);
kunmap_local(vaddr);
return csize;
diff --git a/arch/riscv/kernel/crash_dump.c b/arch/riscv/kernel/crash_dump.c
index ea2158cee97b3..0820e3db12603 100644
--- a/arch/riscv/kernel/crash_dump.c
+++ b/arch/riscv/kernel/crash_dump.c
@@ -21,7 +21,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
if (!vaddr)
return -ENOMEM;
- csize = copy_to_iter(vaddr + offset, csize, iter);
+ csize = copy_oldmem_to_iter(vaddr + offset, csize, iter);
memunmap(vaddr);
return csize;
diff --git a/arch/sh/kernel/crash_dump.c b/arch/sh/kernel/crash_dump.c
index 85c0e58f1a59f..2a5988b6e9d7a 100644
--- a/arch/sh/kernel/crash_dump.c
+++ b/arch/sh/kernel/crash_dump.c
@@ -23,7 +23,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
if (!vaddr)
return -ENOMEM;
- csize = copy_to_iter(vaddr + offset, csize, iter);
+ csize = copy_oldmem_to_iter(vaddr + offset, csize, iter);
iounmap(vaddr);
return csize;
diff --git a/arch/x86/kernel/crash_dump_32.c b/arch/x86/kernel/crash_dump_32.c
index 5f4ae5476e193..cb202d4e1f703 100644
--- a/arch/x86/kernel/crash_dump_32.c
+++ b/arch/x86/kernel/crash_dump_32.c
@@ -40,7 +40,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn, size_t csize,
return -EFAULT;
vaddr = kmap_local_pfn(pfn);
- csize = copy_to_iter(vaddr + offset, csize, iter);
+ csize = copy_oldmem_to_iter(vaddr + offset, csize, iter);
kunmap_local(vaddr);
return csize;
--
2.53.0
next prev parent reply other threads:[~2026-11-12 16:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 16:37 [PATCH RFC 0/4] crash_dump: recover from machine checks in copy_oldmem_page() Christian Brauner
2026-11-12 16:37 ` [PATCH RFC 1/4] powerpc/crash_dump: check ioremap_cache() " Christian Brauner
2026-11-12 19:10 ` Geert Uytterhoeven
2026-11-12 16:37 ` [PATCH RFC 2/4] sh/crash_dump: check ioremap() " Christian Brauner
2026-11-12 19:07 ` Geert Uytterhoeven
2026-11-12 16:37 ` [PATCH RFC 3/4] crash_dump: recover from a machine check " Christian Brauner
2026-11-12 16:37 ` Christian Brauner [this message]
2026-11-12 16:40 ` [PATCH RFC 0/4] crash_dump: recover from machine checks " Christian Brauner
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=20261112-work-procfs-oldmem-v1-4-ecdcafd99265@kernel.org \
--to=brauner@kernel.org \
--cc=david@kernel.org \
--cc=kexec@lists.infradead.org \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sh@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=mason@kernel.org \
--cc=tglx@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@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