mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Andrew Morton <akpm@linux-foundation.org>,
	Baoquan He <baoquan.he@linux.dev>,
	Mike Rapoport <rppt@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-doc@vger.kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: [PATCH 2/3] crash: Don't report a misaligned crashkernel offset as memory in use
Date: Fri, 04 Dec 2026 12:59:06 -0800	[thread overview]
Message-ID: <6416d6f5dfad381bcef751482a4cbecece14ee3e.1796416344.git.chris@chrisdown.name> (raw)
In-Reply-To: <cover.1796416344.git.chris@chrisdown.name>

When the offset in crashkernel=size@offset isn't aligned the way the
architecture requires, reserve_crashkernel_generic() can't reserve
anything. Rather unhelpfully, it then prints the following:

    crashkernel reservation failed - memory is in use.

But that is codswallop, the problem is that it's not aligned, not that
the memory is in use.

To fix this, let's check the offset's alignment before trying to
reserve anything, and tell the user what it must be aligned to. With
this applied, crashkernel=256M@1000500K on x86 gives:

    crashkernel reservation failed - offset 0x3d10d000 is not aligned to 0x100000.

Signed-off-by: Chris Down <chris@chrisdown.name>
---
 kernel/crash_reserve.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/crash_reserve.c b/kernel/crash_reserve.c
index d3364242e3a9..817cfe6b7d93 100644
--- a/kernel/crash_reserve.c
+++ b/kernel/crash_reserve.c
@@ -400,6 +400,11 @@ void __init reserve_crashkernel_generic(unsigned long long crash_size,
 	if (crash_base) {
 		fixed_base = true;
 		align = CRASH_FIXED_BASE_ALIGN;
+		if (!IS_ALIGNED(crash_base, align)) {
+			pr_warn("crashkernel reservation failed - offset 0x%llx is not aligned to 0x%llx.\n",
+				crash_base, align);
+			return;
+		}
 		search_base = crash_base;
 		search_end = crash_base + crash_size;
 	} else if (high) {
-- 
2.56.1


  parent reply	other threads:[~2026-12-04 20:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 20:59 [PATCH 0/3] crash: Restore 1M crashkernel offsets on x86 and report misaligned ones Chris Down
2026-12-04 20:59 ` [PATCH 1/3] x86/crash: Reserve crashkernel=size@offset at 1M-aligned offsets again Chris Down
2026-12-04 20:59 ` Chris Down [this message]
2026-12-04 20:59 ` [PATCH 3/3] Documentation: kdump: Mention that the crashkernel offset must be aligned Chris Down

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=6416d6f5dfad381bcef751482a4cbecece14ee3e.1796416344.git.chris@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=akpm@linux-foundation.org \
    --cc=baoquan.he@linux.dev \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kernel-team@meta.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.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

all inboxes | Powered by JetHome®