All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jingyi Sun" <1045704958@qq.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Baoquan He" <baoquan.he@linux.dev>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Pasha Tatashin" <pasha.tatashin@soleen.com>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Shradha Gupta" <shradhagupta@linux.microsoft.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Sourabh Jain" <sourabhjain@linux.ibm.com>,
	"Pingfan Liu" <piliu@redhat.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Anton Blanchard" <anton@samba.org>
Cc: kexec@lists.infradead.org, "Russell King" <linux@armlinux.org.uk>
Subject: Re: [PATCH] kexec: use phys_addr_t in generic crash_free_reserved_phys_range()
Date: Sat, 28 Nov 2026 08:35:38 +0000	[thread overview]
Message-ID: <sashiko-outbox-238548@kernel.org> (raw)
In-Reply-To: <tencent_0EE98A1C2110785434DE9692533FF737DD07@qq.com>

> The generic crash_free_reserved_phys_range() takes the range as
> unsigned long, but its only caller, __crash_shrink_memory(), passes
> resource_size_t values from crashk_res / crashk_low_res. On 32-bit
> architectures with a 64-bit phys_addr_t that do not provide their own
> helper (e.g. ARM with LPAE), a crash kernel region above 4GiB is then
> truncated to its low 32 bits when /sys/kernel/kexec_crash_size is
> shrunk: free_reserved_page() is called on unrelated low-memory pages,
> while the pages that were actually released from the reservation stay
> reserved forever.
> 
> This was observed on QEMU (virt, cortex-a15, ARM_LPAE, 6G) with
> "mem=1G@0x40000000 mem=512M@0x140000000 crashkernel=64M@0x150000000":
> after "echo 0 > /sys/kernel/kexec_crash_size" the HighMem zone's
> managed page count stayed unchanged, while the low-memory zone grew by
> 16384 pages (64MiB), i.e. the pages at 0x50000000-0x53ffffff were
> "freed" instead of 0x150000000-0x153ffffff. x86_64 with the same layout
> behaves correctly.
> 
> Use phys_addr_t for the range and the loop variable, and PHYS_PFN() to
> derive the PFN.
> 
> Fixes: c0bb9e45f3a7 ("kdump: Allow shrinking of kdump region to be overridden")
> Signed-off-by: Jingyi Sun <1045704958@qq.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_0EE98A1C2110785434DE9692533FF737DD07@qq.com?part=1


  reply	other threads:[~2026-11-28  8:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  8:19 [PATCH] kexec: use phys_addr_t in generic crash_free_reserved_phys_range() Jingyi Sun
2026-11-28  8:35 ` sashiko-bot [this message]
2026-11-29  9:59 ` Mike Rapoport
2026-11-29 10:28   ` Jingyi Sun

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=sashiko-outbox-238548@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=1045704958@qq.com \
    --cc=akpm@linux-foundation.org \
    --cc=anton@samba.org \
    --cc=baoquan.he@linux.dev \
    --cc=benh@kernel.crashing.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=pasha.tatashin@soleen.com \
    --cc=piliu@redhat.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=thuth@redhat.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.