From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796417949; b=lB2xS+sPpFI+CoewjJTdf7NAPchUdVctUK9Iq6hcuL174QXpXA68F4FM8OgCCUw+2E+W 3Y8I6U2Zh6DYLs7pwfHPjxa6ZNzcXN6KQAncLFUNv6uelWE5F86WyMIV++8Kxy49XwoaU zNI9s4V8UT5+vaC71/qchvNspaRCyv3lQ1MCkm+atSi/ooMCu3dPg3RNk5SvQxy4cmXxj dmo7/m+Xa0AAdhxcdl4D4LnpKdwbu/30jjtYg5YUb/W3ih5qdXx0qliBOqQZEGUToX7he RRrf6479RoJ5AkIQqxdZNNWIvaUOCUFraphMGGMYggJPfvU+LNUowf68IHsKPIo4y2A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796417949; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:Message-ID:In-Reply-To:References:From:Subject:To:Cc: MIME-Version:Content-Type:Content-Disposition:User-Agent; bh=UELp4OLKJodXFwfGN3TSJdqrrp+fG0bikEhA0CgztaA=; b=gP0ZGGfhpowwW3s1At4AhrnHRTEwUkSaFwULBAqx/oV02z0sCiptJNt7Ecnm9StnUaJ6 vThkKbWyFaF8J/+7xvg9W3utu/mrTFSouTRJ6+p64Ctrzxr1yHNVZeIEAPIL07SpWMIAg AQMw7Aa9kuLskpyt5/sDfHNPabH+9LCHSlWJHacBL5HLhKYJrku1lw3x4GS2B3+XLBsu1 mjhb554ACQ02+gle5nyeZXOp861g8Hv2PCWk6PolvQE8x3UmJpRuhx21W7XQJeNevG3bN xhmGyf+vUHOasix0NNZOnbd/tytmXCQ7SgNfotKqiF92yyIjYQuBfJ/dDNmBNDyeItQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chrisdown.name; spf=pass smtp.mailfrom=chrisdown.name; dkim=pass header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=XD58AC7x; arc=none smtp.remote-ip=74.125.224.44 Received: from mail-yx1-f44.google.com (mail-yx1-f44.google.com [74.125.224.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D4F2606A693 for ; Fri, 4 Dec 2026 20:59:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D4F2606A693 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=XD58AC7x Received: by mail-yx1-f44.google.com with SMTP id 956f58d0204a3-67db763cec7so1137289d50.1 for ; Fri, 04 Dec 2026 12:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1796417948; x=1797022748; darn=vger.kernel.org; h=user-agent:content-disposition:content-type:mime-version:cc:to :subject:from:references:in-reply-to:message-id:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=UELp4OLKJodXFwfGN3TSJdqrrp+fG0bikEhA0CgztaA=; b=XD58AC7xXul63hNujIEFGDuMa2Ft+7Zriky1jleHMA1e03m/qJMQWKXaYcbtewj3na uzG57WY+VBOvCkBxOx7wbh/TLc6DBjm54PDyHtpz0dwcncBx1gdfcmsRR8xjUGmjPxG6 zBNTcm7YDf71m/Dt745XOInYz5yZGh9v2wpx8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796417948; x=1797022748; h=user-agent:content-disposition:content-type:mime-version:cc:to :subject:from:references:in-reply-to:message-id:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UELp4OLKJodXFwfGN3TSJdqrrp+fG0bikEhA0CgztaA=; b=Qjxb5fLVgQ7XdDh2SUFwzCWeyCC6ZG0aU0/vXoT1bSo/jC8h09Gfg1WjD+EPSa3wlF 3wu2TWdY5tvmxuFiE6/cuoAsjXm88GrVPWymHXnw8agzuz33I7ygHkJALpjFS4Rp0b4G fH07uK+x+bgXePhmV1axWklUBMdYM/4uBlpiGtMCAe44lqM1rJYwqGedwd38dgNf87w5 z+aI0RnAWuvwIYwXKC+gyoLTChhtBw9Edd6Wrk3V7wdSReuxW9P/ddqusOyQ5chSdDWh 95qigSlJEy9yIlmbjUCQoVyRzSs9Z4wHH8xy6tKGTwJINd7l3oNBip7DfgggL0d2Aydx 6+Sw== X-Forwarded-Encrypted: i=1; AL+hErH4GGZYkjxm9cYpunzgie+Ua3T0g/IYmSmdbwilF4nTvSctxTXU++xlmdC17Ijd/ExKSQNZKCM3EeXzjV0=@vger.kernel.org X-Gm-Message-State: AB4q+uEF27MsNECgHNeTA3n54lRK/PQ0EAfT1coOrx5MzGpdDnqGpf8a PdyLaeINuddHX1OMOth9SVuNHiCoQJTy/Z6n8tF0QBngh3HqCbyG+67y46g4R8ETjLA= X-Gm-Gg: AZFdTZcCJZjrDP69uK8cSqjK4PevfcYy5NBjezhTEQy+bo8sfUCiyAhPJfuEZaAl7BH 9R9rcF7pDomvy/2VjZUloV0YxoSpY1GcZCFMlsikV7ZyJGxbQ4Xan8pwBoViZ1IKXHGckP1hq+W Vu+jNpLddJzymzsdgW2z/5rVlTIq1o/X26accnJpsg2ipl4iVLMJ1R+mCly9SD6xgQ7ix1MKT3O IAPJB7+vEc+2fhm7l+ApZHBs2WwtBnrxWKGzKVZUMyBXgOEHnjx+bhYijaGocL8YCtQhDSU0syy k3+C5g3+/9VdKC1qQ/LspyADWiQ38d/8XUIMtGqIuoY515UQNKGVuj0YdAIHrPUfWpSptDzZVKR WVhqKHztyS4DJG5w3G2wZ8t0ykQ9IWDUmcyQd+Y+mJQHYUrY3kgy8xJI8hpY5FS1GK0BSGKbhiq FPrIo+eUzCJ2z+uvuHoZGPZO8kH1DcjQfiRK0QHQHpN0TYg0poPwkk026KIM5k5XWqCIA7sdHTd ngBm2HOJ0dI3JQam7soydHhBL4TBKWmRICUtsi2HOnrtv7rsG8cwXt9sSPZcO2o/O/eUhq/ZPU5 Ho9zWAPl0RHdndJUTOYpFQZD5602+hCQarbbnUPKaF267Y16FzTs98vNjGeqjaXQYWbT5cZ8bk1 YUweJT+n6sTwZK/tlB+lzhXP5PoFCZo2ArIz0PZi8XsWh2KPqwZtJ+WVBEh0hQ15pgAMze+VTC5 P7MtXV7K3Wat3sKp2i2UMgfZ5RQuveji+Tc74u8Tzd/0SXbKf87+5idCQvrUQWcLFGbCx6xDl3w 74uGsqKO2LKqJ6HlpZub3w= X-Received: by 2002:a05:690e:11cb:b0:67c:1218:f0d9 with SMTP id 956f58d0204a3-67f72437852mr1299226d50.35.1796417948400; Fri, 04 Dec 2026 12:59:08 -0800 (PST) Received: from [172.18.0.2] (c-73-207-185-9.hsd1.ga.comcast.net. [73.207.185.9]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b660d9a917sm14950757b3.29.2026.12.04.12.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 12:59:07 -0800 (PST) Date: Fri, 04 Dec 2026 12:59:06 -0800 Message-ID: <6416d6f5dfad381bcef751482a4cbecece14ee3e.1796416344.git.chris@chrisdown.name> In-Reply-To: References: From: Chris Down Subject: [PATCH 2/3] crash: Don't report a misaligned crashkernel offset as memory in use To: Andrew Morton , Baoquan He , Mike Rapoport Cc: Jonathan Corbet , Shuah Khan , Randy Dunlap , Pasha Tatashin , Pratyush Yadav , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-doc@vger.kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@meta.com X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/2.4.3 (cc9e3943) (2026-10-09) 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 --- 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