Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3931846pxj; Mon, 21 Jun 2021 09:38:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxLOXe8eEeIZ+D2deVGAoIIEmVzSJC8rjfLpN1QwFE4hB8CXIuHiIQzdDTcXupscCqstvy X-Received: by 2002:a05:6402:31b4:: with SMTP id dj20mr2674547edb.186.1624293493871; Mon, 21 Jun 2021 09:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293493; cv=none; d=google.com; s=arc-20160816; b=hjjZWOO1mjO5ZpgQDLXI2Y3VWT7UuNXy1Z/Z8X/jMa/K+zvHsHSpE9QcY7Phog4+GH iv+RBwvF2OhFShHaJC7Gzr7lm01XJoAT36vNfNYrbUHUumeXWwN+XY1d75j6eJkKrOzm YMRgqva5eNSpiJ5hpzSFAx63F3rVO4Ojt3ur3obhSoTO6m6vNYoIBOtHaaMDO/AMbAhs wOqkkaxhcjB0PMiBx3i1HBC1SSLYgIunYty6+Rjs35LOUsWlHges+NZynpTjZNZf5GKk r6w/ItlH96/PkGv6IcaTUCzt3dmU0BMQCpy2m1PTogNOYIrNepjf3Qc1bGtP+sgEAfxv zVIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t/dX6gGGUQ6yWU7jr1XW8Wm+eWiobqW1TJArrlwK+7U=; b=eTczYoaDbIFxCDQ8lWEqbHjgNxIhcJmTeV6Msjef6TEKTpUybkzIa1oxTk0xxmaxSA UP5I0AtzkOl7UfRTJQteUVPqP2awdQT4i3ILn9bQv93JY8OguvFAanKNDoLMo2H7iu8/ uJik9VOBvPlILN27UiuW27jvag+Fm04qxm/ZVxBDLPwZd08Mabb4A3x3BjyA0GCaSteU fXSSZUMYEnsCJDHIj1OAOyfYxgQORLLpLmJMsVA30tKkZRhR9MBUmmntBTfURPiH6Lfa May7xDwqIJGrC/u0RjpDBWwBh83ZtmmgrF4zQi0S4pRJUBjdELgleUGdG+Ht4G31OJdM FDNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k+q4I0KF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id en21si5001269ejc.309.2021.06.21.09.37.49; Mon, 21 Jun 2021 09:38:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k+q4I0KF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbhFUQgo (ORCPT + 99 others); Mon, 21 Jun 2021 12:36:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:55954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232112AbhFUQdI (ORCPT ); Mon, 21 Jun 2021 12:33:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A9B16128E; Mon, 21 Jun 2021 16:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292773; bh=VUvpdwKNNvGE0HsWxu9oXu4dlx1Jhlt+vjypaAzSoWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k+q4I0KFFnVn8eO0ZIAGBLWnz7X004CllBGse79IF3ace2atcngk3UMIdUyotQz1v MQWTX73aO8IPeNAGXziycDKVMXN6IvJcR3CZPQN4LZ4IBxQizp2UWTlufL+85nxbST SUm/w8FikcpU2olB5mNNB88OkDIFXS9j+3toHQCQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pingfan Liu , Baoquan He , Bhupesh Sharma , Kazuhito Hagio , Dave Young , Boris Petkov , Ingo Molnar , Thomas Gleixner , James Morse , Mark Rutland , Will Deacon , Catalin Marinas , Michael Ellerman , Paul Mackerras , Benjamin Herrenschmidt , Dave Anderson , Andrew Morton , Linus Torvalds Subject: [PATCH 5.10 125/146] crash_core, vmcoreinfo: append SECTION_SIZE_BITS to vmcoreinfo Date: Mon, 21 Jun 2021 18:15:55 +0200 Message-Id: <20210621154919.359292901@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pingfan Liu commit 4f5aecdff25f59fb5ea456d5152a913906ecf287 upstream. As mentioned in kernel commit 1d50e5d0c505 ("crash_core, vmcoreinfo: Append 'MAX_PHYSMEM_BITS' to vmcoreinfo"), SECTION_SIZE_BITS in the formula: #define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) Besides SECTIONS_SHIFT, SECTION_SIZE_BITS is also used to calculate PAGES_PER_SECTION in makedumpfile just like kernel. Unfortunately, this arch-dependent macro SECTION_SIZE_BITS changes, e.g. recently in kernel commit f0b13ee23241 ("arm64/sparsemem: reduce SECTION_SIZE_BITS"). But user space wants a stable interface to get this info. Such info is impossible to be deduced from a crashdump vmcore. Hence append SECTION_SIZE_BITS to vmcoreinfo. Link: https://lkml.kernel.org/r/20210608103359.84907-1-kernelfans@gmail.com Link: http://lists.infradead.org/pipermail/kexec/2021-June/022676.html Signed-off-by: Pingfan Liu Acked-by: Baoquan He Cc: Bhupesh Sharma Cc: Kazuhito Hagio Cc: Dave Young Cc: Boris Petkov Cc: Ingo Molnar Cc: Thomas Gleixner Cc: James Morse Cc: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Cc: Michael Ellerman Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Dave Anderson Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- kernel/crash_core.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -463,6 +463,7 @@ static int __init crash_save_vmcoreinfo_ VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS); VMCOREINFO_STRUCT_SIZE(mem_section); VMCOREINFO_OFFSET(mem_section, section_mem_map); + VMCOREINFO_NUMBER(SECTION_SIZE_BITS); VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS); #endif VMCOREINFO_STRUCT_SIZE(page);