From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C29AC47082 for ; Tue, 8 Jun 2021 14:29:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3977361003 for ; Tue, 8 Jun 2021 14:29:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3977361003 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2hw0HkC7R2rl5w0SoqefxeQ2iaPmJiHCubVpxbFunG4=; b=WcfShmpdj4uzk6 /iwcLL9G37qO1etVa4UK96Axj3F+Q1doMKTjgSu4cS1w/EqUGNAbbARrqNU4LuSWDHvCBrPKa+wn2 fFqkvkA1q1mIeXhj4g6kTlvlkXFcJ9Rpc9wCFEV8QQPKkLKLGyol8QTHHMswedDHBBAq4Nw78VDAV SO1v8XFecKc9nW76NpVUHISszyzdj5c8yX43WY+CBcDCEVZTyCbedyOeHyQB9c4W4m26h/vF8tr8N kEhEZ10kFF2ddefUCf3EZ9f/B1wQntActrgDRdxmBYrW5+c7LU4/BNvAFUo3NkIGv904XyeOxj9gM yJK7ORRmC671ZcNgKtRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqchN-008uCI-OV; Tue, 08 Jun 2021 14:27:24 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqcez-008tRR-FS for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 14:24:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623162289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tEi3Rd6QEWk4RIuQqPyKGWZpdRlhfTcltszbR5N5ITU=; b=Bt10VUzTt0d6wyTm0XjppoNvjzup2ivj40LKStfjODzYyPkcZYk6+ilt69KRbF4hQiDTcx IEHBCDE9SLilgno0VBk7WncD/s4Mp6+wWwIiAW70ZR6vzQm5DT2fyEzbWUMeY9/7qmB6p7 Vy6lE8E4inDkNqwnCv0/JpfrrcRFip0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-99-d84TgJEiNruct7uiXptoiA-1; Tue, 08 Jun 2021 10:24:47 -0400 X-MC-Unique: d84TgJEiNruct7uiXptoiA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5A5208049CB; Tue, 8 Jun 2021 14:24:44 +0000 (UTC) Received: from localhost (ovpn-12-148.pek2.redhat.com [10.72.12.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4704F19C45; Tue, 8 Jun 2021 14:24:35 +0000 (UTC) Date: Tue, 8 Jun 2021 22:24:32 +0800 From: Baoquan He To: Pingfan Liu Cc: Bhupesh Sharma , akpm@linux-foundation.org, 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 , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] crash_core, vmcoreinfo: Append 'SECTION_SIZE_BITS' to vmcoreinfo Message-ID: <20210608142432.GA587883@MiWiFi-R3L-srv> References: <20210608103359.84907-1-kernelfans@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210608103359.84907-1-kernelfans@gmail.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210608_072453_641080_066359C5 X-CRM114-Status: GOOD ( 21.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 06/08/21 at 06:33am, Pingfan Liu wrote: > 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. > > Signed-off-by: Pingfan Liu > Cc: Bhupesh Sharma > Cc: Kazuhito Hagio > Cc: Dave Young > Cc: Baoquan He > 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: linuxppc-dev@lists.ozlabs.org > Cc: linux-kernel@vger.kernel.org > Cc: kexec@lists.infradead.org > Cc: x86@kernel.org > Cc: linux-arm-kernel@lists.infradead.org Add the discussion of the original thread in kexec ML for reference: http://lists.infradead.org/pipermail/kexec/2021-June/022676.html This looks good to me. Acked-by: Baoquan He > --- > kernel/crash_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 825284baaf46..684a6061a13a 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -464,6 +464,7 @@ static int __init crash_save_vmcoreinfo_init(void) > 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); > -- > 2.29.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel