From patchwork Wed Feb 9 09:26:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 12739511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6BE16C433EF for ; Wed, 9 Feb 2022 01:32:24 +0000 (UTC) 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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=grbQMb5QRekvXxyxK0lK7ran+fJoIC49zDPl+nBH6VM=; b=LX1Zc22sk3+kR3 HecIIg3rt9k/CWA47xdnYRoS+zZZ2MNZbxzftE1JRPqIAbMOxaTa50+rwQaf+9dDrfWPdeI+/f7nS ZMpWTJTw+tSChUj/k/1ygLpSUiaDaP7nyRuhOyeO+60WL0JDNeiUfQqsY1TQqeNjRw2MJ7fL6X0cF Fu7NKLqRCOPGQ9HmaUYKhywXXwROT/QwqwJwp0fE/PdGwQ8+IXUuKWRgsdIjw6Hd07Zxv712VcwIu CFVOFEi/ig5kgJQJXDEKEOiAxbulOsvbpXqSDf8m3PVck6m0OZPimDR3Xz3fboklovsjx16yr8GOT 7qlZb2PNPweMLfrjq31w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHboI-00Fu9g-Hl; Wed, 09 Feb 2022 01:30:18 +0000 Received: from mail-mw2nam12on2098.outbound.protection.outlook.com ([40.107.244.98] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHbo3-00Fu8r-Ch; Wed, 09 Feb 2022 01:30:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G8iV+mGN4dr+zdWnlvBDxJks55XQp+X8lWmaZYrqWJhtL5QU3ykLRURCr8PtNRdenj71V068sGlO9ufiqP567WrEVWllMYEtUF5zdS194UrrZZ9rNalzlWP3h/fgo7ESGpZceL7ksPoC+LzBz/RCESpxQw0KcrGKqrAbakVZilg0DFkBXmllFmXo3EcnoHVW8yP7XnT23S+Lz+SyHG7lN0LUaWhnOrvpqKm+GiKmVXH6mjA8h8cpfBOLERSzlBYbXq0h7uVz2D0hSyUHhCEpqdAPtBepuf0mj+azIOBWrGzqhYXMtUOVqEQNqXMOSgMykJkfoMeFeZzYlVgu6pfBAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+S2PwYrRuMaXTiJUB3yBLpeZXUg6x+SPbLQ/32kiiiQ=; b=RMPSi/BayQ8tnB8LBF8dkg5yZoYef6Osud9ovndwg/0fEM0pCe13YsyW4ULjGE0kKpUX6E8Zb+YqJYJ6AFmcS51YHUadbIMIm5m+Vm/F/uakV2GxHT6qmsGOZEIpLGarCt6R4Ri7bpXLcP1LnqNgVgut7CC1fjyuInogydFbdevISGZQ7r4LomZYrNlUrrUCPV/tYR0fjIdxzJuKpmPhm5qnumuU0AEUfKONgu+K+CTB5mmF79i3HUxqLLiFWVLqS8eZOHHmE9bIwMmDgZ8sndvBUNP0U7CffPWdgl/WemSSMDulIpZjtPbxJrF+gS5W8BHghY/+CS1GX6Oaoh6p9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+S2PwYrRuMaXTiJUB3yBLpeZXUg6x+SPbLQ/32kiiiQ=; b=ItbC0sg6ZitqflY+voAUM5QcZixschMFOAqpyD14YpTwQzz+UVt+3Z4z+UrRKZupqLceDEQRT2onkUzuUjSI8fdAqZ1b+r61klqobUfOBzZ6NPNi2z2H0xOaS/3VHEPSORn0EFdfoO2kPWfR3NehaZStLIs1hHcQ/9mFHhEtXOE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM8PR01MB6824.prod.exchangelabs.com (2603:10b6:8:23::24) by CO1PR01MB7355.prod.exchangelabs.com (2603:10b6:303:15a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Wed, 9 Feb 2022 01:29:56 +0000 Received: from DM8PR01MB6824.prod.exchangelabs.com ([fe80::bd40:379f:5b93:f800]) by DM8PR01MB6824.prod.exchangelabs.com ([fe80::bd40:379f:5b93:f800%6]) with mapi id 15.20.4951.019; Wed, 9 Feb 2022 01:29:56 +0000 From: Huang Shijie To: catalin.marinas@arm.com Cc: will@kernel.org, bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com, corbet@lwn.net, kexec@lists.infradead.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, zwang@amperecomputing.com, patches@amperecomputing.com, darren@os.amperecomputing.com, Huang Shijie Subject: [PATCH] arm64: crash_core: Export MODULES, VMALLOC, and VMEMMAP ranges Date: Wed, 9 Feb 2022 09:26:42 +0000 Message-Id: <20220209092642.9181-1-shijie@os.amperecomputing.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: CH2PR04CA0014.namprd04.prod.outlook.com (2603:10b6:610:52::24) To DM8PR01MB6824.prod.exchangelabs.com (2603:10b6:8:23::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a13b40ca-effa-400f-ddab-08d9eb6bad80 X-MS-TrafficTypeDiagnostic: CO1PR01MB7355:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 28MMteceLBr/2enHFhII2g/VMQZ/K2SjKomDJKd4UtReAZa05PmrP6dpX5T7SuQHB4IGcIAPwRNaj2VrK5sSPFZfzqJwJDUCHbrT9QKDR1Ah/Ysw5/kfZHKW0EADZaYfl2NqBEU+CAXQvytPCty692DlWWKQvtBXSykOkeqvyGeXK6iuO0DuxSUlpzoslsOzF8qtY6ldU/iBUVjLv3UqBzRVR15jERu3wv4ijNioGmcIXtgtAqCLt6YuLwyv94RAMUEtjlmHgzALeg8Wmj2Vo/PacmaiHEBYMoHrSHQMjiN7XX/VZr4Z8v2BXaa0QmN2WXWMONBTQvjDGJoA4lNhaQbjaCUe3jzPjW7ZGYJq+zSLLFbzHZe7BjAXeKZClV042vH6SHneHtoHsdd7OFIV/++rSA3ekZJ85wS3O74l48MA7OPkaLanE2rtZzp9wiyRms5Z/++BNmih6LU2K8vRaz84y9riStN/V7LLAuDOwEijVopsCicHyvlvAh/gkWzGfjR0uB9GwMQelUywzXwOjwPhqdHVfKBpfz1tSdMKNxdSL3EQAdxOZ8pS48ZvSqLymFcyMzM7GpinE/9Vy5WnY0IdmCpxRYQQU7dS2JNrsJRpkdUUP0rbuXiyFX23UQp8JoUfqmPjU/Vi4wnSChgtXRx9bHw+R3fnVtp28GzNARK5wRsanMRI9EIReNNVcPhXRgHrFSaH9XFGKsj5nMz9sg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR01MB6824.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(316002)(7416002)(38350700002)(38100700002)(107886003)(86362001)(5660300002)(2906002)(6506007)(66556008)(6486002)(26005)(186003)(1076003)(2616005)(8676002)(4326008)(6916009)(83380400001)(8936002)(66946007)(66476007)(52116002)(6512007)(6666004)(508600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n/TsRYOfT3VPvL3gXd5ggIgh1gfUW9rBIE2afRdHSpj+zz49HcR41wE11m4p2cWEehe779AH29hA2pO8l0ZfOY45vOeCBsrTWH55Oy2mb9ouENUYGYsYCZquv7Rp3LQAIKuRhQcpKR6peGPVv0JJ7RLl1soyiyhBnsnHCE4+mA/8thKjBztBAUP+kQtUAHG3uNaUh4oniP8rPG9OLoudEqa4t4AMud6EgnsrG6RQuvfDYPR2r29AGV9mYSIcfuVUB+vy2lsHkuAbLiIS25FFWJmY2YXpIkg/SNROiuyo2M+dx/dbzjT9nTFTYmnT0DEaj5og51xr1xpGZkFy6yJ6b39eocYP8+YLKmzqmcrkoN4b1v117V6o+Prce7Sb27UaJT8Ue5+FBqq0xCstB+DHyAdVoahqrXrSGQu7ba68xG2IKY8L0q+lYxtZ1890+zIacfQn8dwj2w8/1bsAkSvjyTyL2Qk+O1mIG62qdfkG9FoBCtdb44hg53UKZk6srDZ914WbrmrG+GBLEMrE+cpGgV2I4DmbSLO2w99Ir+uQTj25VN/uMmEhSgJZtOZrfIyFRTs5o+ai26Po72ChyKII3fmN8Ke7FiY2IiqPhjEfttsgvrNjy97ngrl9NVSghouJUUFQBaLXPPMkok2nOzbETal1BGdbrHli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ginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: a13b40ca-effa-400f-ddab-08d9eb6bad80 X-MS-Exchange-CrossTenant-AuthSource: DM8PR01MB6824.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2022 01:29:56.2378 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xnZezGtEH7ybg9z0LwQRXNmZE9AIskkiQBJAex5krRy4ud+zHkOBXbJIvscua3jTzfZNUeCRUXwRxIUGjxv0t2/Bme01x1mQ0g68WgjkcGOYYgC5FWEvNnnG2X/o3bbw X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB7355 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220208_173003_572374_07CCD08D X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The following interrelated ranges are needed by the kdump crash tool: MODULES_VADDR ~ MODULES_END, VMALLOC_START ~ VMALLOC_END, VMEMMAP_START ~ VMEMMAP_END Since these values change from time to time, it is preferable to export them via vmcoreinfo than to change the crash's code frequently. Signed-off-by: Huang Shijie --- Documentation/admin-guide/kdump/vmcoreinfo.rst | 8 ++++++++ arch/arm64/kernel/crash_core.c | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst index 3861a25faae1..a339af45a22e 100644 --- a/Documentation/admin-guide/kdump/vmcoreinfo.rst +++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst @@ -494,6 +494,14 @@ architecture which is used to lookup the page-tables for the Virtual addresses in the higher VA range (refer to ARMv8 ARM document for more details). +MODULES_VADDR|MODULES_END|VMALLOC_START|VMALLOC_END|VMEMMAP_START|VMEMMAP_END +------------- + +Used to get the correct ranges: + MODULES_VADDR ~ MODULES_END-1 : Kernel module space. + VMALLOC_START ~ VMALLOC_END-1 : vmalloc() / ioremap() space. + VMEMMAP_START ~ VMEMMAP_END-1 : vmemmap region, used for struct page array. + arm === diff --git a/arch/arm64/kernel/crash_core.c b/arch/arm64/kernel/crash_core.c index 314391a156ee..2b65aae332ce 100644 --- a/arch/arm64/kernel/crash_core.c +++ b/arch/arm64/kernel/crash_core.c @@ -20,6 +20,12 @@ void arch_crash_save_vmcoreinfo(void) { VMCOREINFO_NUMBER(VA_BITS); /* Please note VMCOREINFO_NUMBER() uses "%d", not "%x" */ + vmcoreinfo_append_str("NUMBER(MODULES_VADDR)=0x%lx\n", MODULES_VADDR); + vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END); + vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START); + vmcoreinfo_append_str("NUMBER(VMALLOC_END)=0x%lx\n", VMALLOC_END); + vmcoreinfo_append_str("NUMBER(VMEMMAP_START)=0x%lx\n", VMEMMAP_START); + vmcoreinfo_append_str("NUMBER(VMEMMAP_END)=0x%lx\n", VMEMMAP_END); vmcoreinfo_append_str("NUMBER(kimage_voffset)=0x%llx\n", kimage_voffset); vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n",