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=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,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 A0CE3C43381 for ; Wed, 13 Mar 2019 11:47:40 +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 6F484214AE for ; Wed, 13 Mar 2019 11:47:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="M0Jy5gIX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="r/wrjvRE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F484214AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ab.jp.nec.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gr51Qc6iJJ65keqlJPc0LMaZbvwaTcmJp6QLqzEdz1c=; b=M0Jy5gIXAR0uwT Ixvomq3Qa966IKBfo481CCMbm+Ecaa+8txjoQ9v2v3nulK0cYSt/FHqsyE0eCD27zFs83T+evzI07 9MO10oOBG04Zu3zgkWR+gLvNVSShoL885lBklg7AorFZulzEw44p/QCyYQFYH2ZUQCYZI7WnyIp+z 25GfvVmFxuBY6LPWfOH66FqZvQgiOPwjcaDnNixX5gQaOzYBuQboUb51EyGlK/x23w4+utcVQIkOx FkBJOucKzNZ4ae4Czqf228ZQkrn431tNxrjUrT7EoOnLZqkEPDOuBPr+XBEskqS1wa7tCB56W/n5B 6mCshjE2PJwZh8S6+5qQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h42MF-00037f-4j; Wed, 13 Mar 2019 11:47:39 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h426i-0008SO-7p; Wed, 13 Mar 2019 11:31:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+9FcEfxcbBS8j9xKyODyxz1IBCPcIN9yho/0Bnezfzk=; b=r/wrjvRESybeuUmq3ge97Bl8Yy 0iGIlVBYoxOqqjP5jDBfY5cuJu/k9Eeftg1E4KWvGP2tH4C8E77KECq3+VY1A0cBEaYhQFhdoGGpl a4sghLWNxUqUT9WPaPQVH7v9TxxEXJZjHSKnskqVLpyC/XNAMs1AkBJDDqgn3ZUStkm4nFWjFqh9D bJfqapzpIWj0P/t1/wWoZStuI8WaCy1RRrvctMdnzEVfGeYbhMmw5texVI5400dQSE4iovZM3yU4S MyzFVBJE08HrE7nKKMREGMmCCIaJ3Zf+fNiO3Xp8H/6OQwpy6vY+nK364RgRsw9KUVM5PRtOQEL0I a8mgvk5w==; Received: from tyo161.gate.nec.co.jp ([114.179.232.161]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3nWD-0005Lt-Gn; Tue, 12 Mar 2019 19:56:59 +0000 Received: from mailgate01.nec.co.jp ([114.179.233.122]) by tyo161.gate.nec.co.jp (8.15.1/8.15.1) with ESMTPS id x2CJpSbo027851 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 Mar 2019 04:51:28 +0900 Received: from mailsv02.nec.co.jp (mailgate-v.nec.co.jp [10.204.236.94]) by mailgate01.nec.co.jp (8.15.1/8.15.1) with ESMTP id x2CJpSeK016858; Wed, 13 Mar 2019 04:51:28 +0900 Received: from mail01b.kamome.nec.co.jp (mail01b.kamome.nec.co.jp [10.25.43.2]) by mailsv02.nec.co.jp (8.15.1/8.15.1) with ESMTP id x2CJpSQX006898; Wed, 13 Mar 2019 04:51:28 +0900 Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.136] [10.38.151.136]) by mail03.kamome.nec.co.jp with ESMTP id BT-MMP-3278575; Wed, 13 Mar 2019 04:47:38 +0900 Received: from BPXM09GP.gisp.nec.co.jp ([10.38.151.201]) by BPXC08GP.gisp.nec.co.jp ([10.38.151.136]) with mapi id 14.03.0319.002; Wed, 13 Mar 2019 04:47:38 +0900 From: Kazuhito Hagio To: Bhupesh Sharma Subject: RE: [PATCH v2 2/2] crash_core, vmcoreinfo: Append 'MAX_PHYSMEM_BITS' to vmcoreinfo Thread-Topic: [PATCH v2 2/2] crash_core, vmcoreinfo: Append 'MAX_PHYSMEM_BITS' to vmcoreinfo Thread-Index: AQHU1yi7KXHpUX+rcU2iQwrK9lGXaKYIEatw Date: Tue, 12 Mar 2019 19:47:37 +0000 Message-ID: <4AE2DC15AC0B8543882A74EA0D43DBEC03569E6D@BPXM09GP.gisp.nec.co.jp> References: <1552212242-9479-1-git-send-email-bhsharma@redhat.com> <1552212242-9479-3-git-send-email-bhsharma@redhat.com> In-Reply-To: <1552212242-9479-3-git-send-email-bhsharma@redhat.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [143.101.134.92] MIME-Version: 1.0 X-TM-AS-MML: disable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190312_155657_918502_13DD6684 X-CRM114-Status: GOOD ( 22.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linuxppc-dev@lists.ozlabs.org" , Michael Ellerman , "x86@kernel.org" , Will Deacon , "linux-kernel@vger.kernel.org" , "kexec@lists.infradead.org" , James Morse , "linux-arm-kernel@lists.infradead.org" , Benjamin Herrenschmidt , Boris Petkov , Thomas Gleixner , Dave Anderson , Ingo Molnar , Paul Mackerras Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Bhupesh, -----Original Message----- > Right now user-space tools like 'makedumpfile' and 'crash' need to rely > on a best-guess method of determining value of 'MAX_PHYSMEM_BITS' > supported by underlying kernel. > > This value is used in user-space code to calculate the bit-space > required to store a section for SPARESMEM (similar to the existing > calculation method used in the kernel implementation): > > #define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) > > Now, regressions have been reported in user-space utilities > like 'makedumpfile' and 'crash' on arm64, with the recently added > kernel support for 52-bit physical address space, as there is > no clear method of determining this value in user-space > (other than reading kernel CONFIG flags). > > As per suggestion from makedumpfile maintainer (Kazu), it makes more > sense to append 'MAX_PHYSMEM_BITS' to vmcoreinfo in the core code itself > rather than in arch-specific code, so that the user-space code for other > archs can also benefit from this addition to the vmcoreinfo and use it > as a standard way of determining 'SECTIONS_SHIFT' value in user-land. > > A reference 'makedumpfile' implementation which reads the > 'MAX_PHYSMEM_BITS' value from vmcoreinfo in a arch-independent fashion > is available here: > > [0]. https://github.com/bhupesh-sharma/makedumpfile/blob/remove-max-phys-mem-bit-v1/arch/ppc64.c#L471 > > Cc: Boris Petkov > Cc: Ingo Molnar > Cc: Thomas Gleixner > Cc: James Morse > Cc: Will Deacon > Cc: Michael Ellerman > Cc: Paul Mackerras > Cc: Benjamin Herrenschmidt > Cc: Dave Anderson > Cc: Kazuhito Hagio > Cc: x86@kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: kexec@lists.infradead.org > Signed-off-by: Bhupesh Sharma > --- > kernel/crash_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 093c9f917ed0..44b90368e183 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -467,6 +467,7 @@ static int __init crash_save_vmcoreinfo_init(void) > #define PAGE_OFFLINE_MAPCOUNT_VALUE (~PG_offline) > VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE); > #endif > + VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS); Some architectures define MAX_PHYSMEM_BITS only with CONFIG_SPARSEMEM, so we need to move this to the #ifdef section that exports some mem_section things. Thanks! Kazu > > arch_crash_save_vmcoreinfo(); > update_vmcoreinfo_note(); > -- > 2.7.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel