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 2F4CD606A31A for ; Tue, 1 Dec 2026 17:28:07 +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=sT06Yq/d; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QI4NeyTS 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=JDNLuXnvlns8TFH5wMTOW/kIllI/+vKV9vhY8ZmUY80=; b=sT06Yq/dMN9MB4ncAIqD8nwICc dZxa1os7KlaQ6TI5ObcGbJcchHyVuMmt82SA3FyGODVvuWwtFnlXkJeBr9mZZZ7OiPQJdaz0y7oxE kkKKzsPWIm1zP2J9U2RtqYWjM6iA+8c67kNkE2Aep+xwWC+mntW+Hx42W8DqLfSokNXzEKneZU/Nj Fvx5MhSV0O1ka1RfCHspKeTh/wWUrLE77bAypneMXR5kYTeUtbBMQ84sHYqZkPrZTFb9k5sqmvRgI AoJAaDVwlIK2LQGqrJYcYKKrS0hldzGYijVrljqFinK+s/BVMCGCj+YFnQmJup/hS/QPe/IxFY2KT UR2W6Atw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYReA-00000008vcX-3CFS; Tue, 01 Dec 2026 17:28:06 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYRe9-00000008vcL-3dnx for kexec@lists.infradead.org; Tue, 01 Dec 2026 17:28:05 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 1C01F61EFF; Tue, 1 Dec 2026 17:28:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1377B1F000C1; Tue, 1 Dec 2026 17:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796146084; bh=JDNLuXnvlns8TFH5wMTOW/kIllI/+vKV9vhY8ZmUY80=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=QI4NeyTSRfgnmvUlkAUOGigoKriXvlWL8qqhgG5MEyp8y18+MDF/rZIb8/TFgysnU FR+d/kX6Ylvq4a0zpBzoDCtWYDbXHV3RwrGIiQ5PhagR6OYT7bFimgCbNa67dX+c4Q yJSKcFqxr+wKkGKMP6HN+xdoBxYzwCy3xHZ5/CevkDZhmPyUulahgII0lFPwHwjDMO KSDeQhbo2R67TQufIsS4vW7m/8B0RJ82kYJd90GgBXmPw2YdaDXSVamQgvNPfpoHqL UW4m5yKo19RTQWdDMclbUcE8Py2lVgFJzf76RXqHSy8cNrnaEHFmS5yHV5MadA/gmh lpkklnwpWKJnw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] x86/crash: Include Elf64_Ehdr and RAM ranges in elfcorehdr size To: "Suseendran Bhaskaran" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org Cc: "H . Peter Anvin" , "Andrew Morton" , "Baoquan He" , "Mike Rapoport" , "Eric DeVolder" , "Sourabh Jain" , "Jinjie Ruan" , "Ionut Nechita" , "Greg Thelen" , kexec@lists.infradead.org In-Reply-To: <20261201172159.2671514-1-suseendranb@google.com> References: <20261201172159.2671514-1-suseendranb@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 17:28:03 +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: > arch_crash_get_elfcorehdr_size() computes the size exported via > /sys/kernel/kexec/crash_elfcorehdr_size for kexec_load() with crash > hotplug support. Unlike crash_load_segments(), it omits both > sizeof(Elf64_Ehdr) and the existing System RAM ranges when > CONFIG_MEMORY_HOTPLUG is disabled. >=20 > With --hotplug, kexec-tools overrides the elfcorehdr segment memsz with > this sysfs value and truncates bufsz if bufsz > memsz, so the loaded > elfcorehdr can be silently truncated on CONFIG_MEMORY_HOTPLUG=3Dn systems, > and subsequent hotplug updates fail. For example, on a default > CONFIG_NR_CPUS=3D64 kernel with CONFIG_MEMORY_HOTPLUG=3Dn, 64 possible CP= Us, > and 10 System RAM ranges, crash_elfcorehdr_size reports 3696 bytes > (memsz 4096) and CPU offline fails with: >=20 > crash hp: update elfcorehdr elfsz 8192 > memsz 4096 >=20 > Add arch_get_system_nr_ranges() when !IS_ENABLED(CONFIG_MEMORY_HOTPLUG) > and include sizeof(Elf64_Ehdr) so arch_crash_get_elfcorehdr_size() > matches crash_load_segments(). Tested with kexec-tools 2.0.32 in QEMU > under the configuration above: crash_elfcorehdr_size reports 4488 bytes > (memsz 8192) and CPU offline updates elfcorehdr cleanly. >=20 > Gemini assisted with code analysis and the QEMU reproducer. All changes > and test results were reviewed by the author. >=20 > Fixes: a72bbec70da2 ("crash: hotplug support for kexec_load()") > Signed-off-by: Suseendran Bhaskaran Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201172159.2671= 514-1-suseendranb@google.com?part=3D1