From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C05BE606A31C for ; Sun, 29 Nov 2026 10:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lEPiTqn6; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EJr3USS6 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Cc:To:Subject: From:Message-ID:MIME-Version:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=f/HgNdFT3KGA6MNGwide0KD7IBgWAITddKsauoBeiZQ=; b=lEPiTqn6vFy2Z9XrI2vRyLWJaO cKy1E0Di1TTMtHZtqeMBdkkUTpu1jyDIZgN/X/Lkw2NHoFVSPdxprHLfZ9iRyigOK0MiN7iwqEc23 zYiU61Ed29W6UQIaZK89iKgKUtsF5OBGNfBtQPuywdHBImhvQSiBhVemKXO2cQTdwZ99Wl0kHDz7k pLiv4JGhNSq3XJ0WZfildFcP+j2eeu2lkQOfv8QLlVn3R6aaBr3MUypevZqhvZjmBqsWt9EIMvNpP RokWzACP4E10btxk7evNfeI3T4Sh7hSCRcfRQuntzUWD39bkMjZtKsxnxxq/j/WETAv8jzsa5Qslb waZcIrAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXcKL-00000001qjg-1eXo; Sun, 29 Nov 2026 10:40:13 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXcKK-00000001qja-11ZJ for kexec@lists.infradead.org; Sun, 29 Nov 2026 10:40:12 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id AB268419E9; Sun, 29 Nov 2026 10:40:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF5141F00896; Sun, 29 Nov 2026 10:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795948811; bh=f/HgNdFT3KGA6MNGwide0KD7IBgWAITddKsauoBeiZQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=EJr3USS6MzDoKF2J5DW8xIUS02/pkM1whQEkerx9jlJ6mqUZKvkcCKHAc/XEB9XJt R4ebdYnaLscgXmPJ0AV6o4JGPPkcUB5rMORBN9Gj5RgMqKqitj2/bqpEZCbqgTYh/a cC3YLivKCHHyiuks1UDkJ4ULQMc6bumEZmk4ncFtJ8plwMSLSno7mjcV1MRwjW0B7T 0dD/TZzhOY3vRZ7bW+Csbqo2NH5uwPAKAWVZ4sYSzmuksozbW47Y7i4ohkiz9YtHpR AK/4jVucwXOOLG3UFNgJ1Tu6hs0h9yXnFENCIn3Ue3a+aTbDkjL+rQsMK8SFFRlFN/ Dfa14CE7ppMmg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] kexec: use phys_addr_t in generic crash_free_reserved_phys_range() To: "Jingyi Sun" <1045704958@qq.com>, "Andrew Morton" , "Baoquan He" , "Mike Rapoport" Cc: "Pasha Tatashin" , "Pratyush Yadav" , "Shradha Gupta" , "Thomas Huth" , "Sourabh Jain" , "Pingfan Liu" , "Benjamin Herrenschmidt" , "Anton Blanchard" , "Russell King" , kexec@lists.infradead.org In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 10:40:10 +0000 X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "kexec" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: > The generic crash_free_reserved_phys_range() in takes > the range as unsigned long, but its only caller, __crash_shrink_memory(), > passes resource_size_t values from crashk_res / crashk_low_res. >=20 > arm64, powerpc and s390 provide their own crash_free_reserved_phys_range(= ); > all other architectures use the generic one. On 32-bit architectures > with a 64-bit phys_addr_t among them (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. >=20 > This was observed on QEMU (virt, cortex-a15, ARM_LPAE, 6G) with > "mem=3D1G@0x40000000 mem=3D512M@0x140000000 crashkernel=3D64M@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. >=20 > Use phys_addr_t for the range and the loop variable, and PHYS_PFN() to > derive the PFN. >=20 > Fixes: c0bb9e45f3a7 ("kdump: Allow shrinking of kdump region to be overri= dden") > Signed-off-by: Jingyi Sun <1045704958@qq.com> Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/tencent_6C2575CF2AB= 88444E0E9D05E5A2C4FD9DC09@qq.com?part=3D1