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=-14.8 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_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 067A9C43331 for ; Mon, 11 Nov 2019 08:04:13 +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 C5F322075C for ; Mon, 11 Nov 2019 08:04:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MISbR7bt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ae2bnJsv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5F322075C 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+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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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=XzYiSrSj95drSkyIVn/2gc7bePp28Ua00H9oYNFQH/I=; b=MISbR7btzK7/tBkpWn9hkEAqW5 nu61H0KGDwwqOgEKRcFzNkQPRAbPLuMHauf5Zi2AMrSO97QCfO/tP9Z5JWkB0iHRy5f3oqbfaOlKb uFy7LCh41zUKHIQ29Q6mDmgVXK5mwN1ksD2228OLQo6QGq9QZrpFP9aeiaRwPCpyWRc25dnCLFUx8 A1lGauKg12/JsClgG2TxDNiqLSFIQIQekBG5kzNIs/LH8aXZ/gNtTy5OrRn79IlP+qZRgPZbNDBF8 F8X5ArzT13Ae0nWf8K+ZBLHUvot16B8bK1IhtUTOFxsH+RGXfkXxQVILQcaoJ71zKMsgCwstgbkMi Iy9Bxjtg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4gF-0003eN-B2; Mon, 11 Nov 2019 08:04:11 +0000 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU4g7-0003bT-46 for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 08:04:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573459441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/y8p7TWJ4+9dx0qZYntYI0vqqca78jHSFlqFEn+6Y9I=; b=Ae2bnJsvuVP6avUPrVQ0dOl6YqAitaPPcAWAwEWRr3EfehY0J/D3Fz4OBVCEZ9BskGWArl wAE3ycLB0Z2vKndVaDrRRjUIer7HhfzRdueUueZNyRlM2fvyFWvcjhlp8G0zx6nNH752ky YOJBqZk7766T31j2divPgzXncdujEB8= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-GmCfQmb7OOOwKfl-hSwzFQ-1; Mon, 11 Nov 2019 03:01:45 -0500 Received: by mail-pl1-f198.google.com with SMTP id a5so10120879pln.13 for ; Mon, 11 Nov 2019 00:01:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D7Q1sNAJK7KGCeC1/osi4u/yd8LMbojW2DcAg7eyhwk=; b=JALCuT18H2jk6zohDzktYQDeI85h1nsXRq3sTkHnmo0cYIlVHxlVVxFxycSlpE6NkL CxyH7iWdIO591Twoj/MfwYXVu9LmehQ+RBALOJdvuA4kDxBVOrWM7cIpeGDOeh5I9tY7 EpECnOaCviIRmP0ptBHw9+7kL9YgXd4CrdHms7fULBWdxcIoHJyzTuVt/YMFCoLa3LOL YZC70RKfw21QyW505JUJKm5GkgQQLytjgxbOsXV2um1KRMTsfEz0H/wa/ATl3emJIj2p p4NX1nAmO+d7+GPo9ni8pwW/UWE6nC0Uf/5+cCAFJbap/kzPJYW9/yprM5QdlTvz/nn5 gnpA== X-Gm-Message-State: APjAAAXgmFL+J9WFjRlGgRHA1VVNx+muIj/xJSGY6X1u5CdHNePRvDZ3 nnb8KIAafUO/nol+4Dqa/od4qlHrsqO82fKvMMnJ4BvMzULU0XceWbVBUiTRoyj98pJ6UADcjfe 0sS8MBydv2UXpLEoF5voB6EHT++jX2ysw++M= X-Received: by 2002:a62:fcd2:: with SMTP id e201mr404507pfh.52.1573459301444; Mon, 11 Nov 2019 00:01:41 -0800 (PST) X-Google-Smtp-Source: APXvYqw/PM/uE1YEEDp1OQcYhDW64ur/c96jF9ficCBtta087Mx43bjXxmhjovhzV8sTDdZdS3kXpw== X-Received: by 2002:a62:fcd2:: with SMTP id e201mr404459pfh.52.1573459301055; Mon, 11 Nov 2019 00:01:41 -0800 (PST) Received: from localhost ([122.177.0.15]) by smtp.gmail.com with ESMTPSA id r33sm12736180pjb.5.2019.11.11.00.01.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Nov 2019 00:01:39 -0800 (PST) From: Bhupesh Sharma To: linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] crash_core, vmcoreinfo: Append 'MAX_PHYSMEM_BITS' to vmcoreinfo Date: Mon, 11 Nov 2019 13:31:20 +0530 Message-Id: <1573459282-26989-2-git-send-email-bhsharma@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573459282-26989-1-git-send-email-bhsharma@redhat.com> References: <1573459282-26989-1-git-send-email-bhsharma@redhat.com> X-MC-Unique: GmCfQmb7OOOwKfl-hSwzFQ-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191111_000403_235929_49AFB086 X-CRM114-Status: GOOD ( 16.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kazuhito Hagio , Benjamin Herrenschmidt , Steve Capper , Catalin Marinas , bhsharma@redhat.com, Ard Biesheuvel , kexec@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, James Morse , linux-arm-kernel@lists.infradead.org, Michael Ellerman , Boris Petkov , Thomas Gleixner , bhupesh.linux@gmail.com, Will Deacon , Ingo Molnar , Paul Mackerras , Dave Anderson MIME-Version: 1.0 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 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: Mark Rutland Cc: Will Deacon Cc: Steve Capper Cc: Catalin Marinas Cc: Ard Biesheuvel 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 9f1557b98468..18175687133a 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -413,6 +413,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(MAX_PHYSMEM_BITS); #endif VMCOREINFO_STRUCT_SIZE(page); VMCOREINFO_STRUCT_SIZE(pglist_data); -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel