Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1572345pxb; Tue, 8 Feb 2022 22:42:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQG9sG/3KvyI0sYWKzXT+kwiIprvnGpJFh6fBqJd+blBzHbIzyu8cRweL4IvvUNR+V5XKn X-Received: by 2002:a17:903:1ca:: with SMTP id e10mr726368plh.65.1644388957058; Tue, 08 Feb 2022 22:42:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644388957; cv=pass; d=google.com; s=arc-20160816; b=S7otDMpSlYvBXFRhW3lHrqsMhdNT6EYVcrTVIxfn6W1yQsuJi+JcqNgB8B1Eq2ZR1K RwjkNSYfGXWZCgEuskRr2RtFjSNMxEqdJLQ9zAYJ3XukIce0Z4LzqTFeCt6m61YjNH/Y gjjmefYrzm9dCYNM7TXrJpMIFvA31wNyS2CyBG/i4Txn2wOe1zLEMJ1UGAZRGE+EClFl dXZmPoik7CNS01CtyNLJuzJaRKsWBIa59iCMqHgpIGFLkf2Qg4kxqYPVbvEEZEOnjT5E 5XOI6wy2lUL3ixDONaxgtj8+5XoNp3O1XTGOAxqcdnWU5A/pF/VfqVn1/rpjmU9qoS7o 1vdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=+S2PwYrRuMaXTiJUB3yBLpeZXUg6x+SPbLQ/32kiiiQ=; b=NK9U/I0draiwvz2yYV3WEFmuUHQI7U7S4reyGlHbIU3DZhWNmFKp80zpyauBrufLqT uWK2FaRWjSiEU1ndU/FAPwg4kApP4ngXigazzC9BcQCdUQ94DeCVONC2mfpbLcSDyLkw DY3l/9TMnjiKwobdYhRqFUILk+DdpwsQZlSwzwRBOYEHzn/b8Ob7shG6kBbWEJeuJqpN 5nMaUcA2NayyHWnpL9IzVGTu3/SmCa8qiw/N+ytemxsr4LlnwB74oxk1niY6MvwpQW5Q sibFzX2qsHn9f45FA1kImldSY4J+FvzCm16p9OpW6e7Um57m5tmB+eGoJBAur/cI7UuS zthQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=ItbC0sg6; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r130si14351040pgr.725.2022.02.08.22.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 22:42:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=ItbC0sg6; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 27FD5E05F6F5; Tue, 8 Feb 2022 22:32:32 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244093AbiBICjt (ORCPT + 99 others); Tue, 8 Feb 2022 21:39:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243065AbiBIBaE (ORCPT ); Tue, 8 Feb 2022 20:30:04 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2137.outbound.protection.outlook.com [40.107.244.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DDAC061576; Tue, 8 Feb 2022 17:30:01 -0800 (PST) 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?n/TsRYOfT3VPvL3gXd5ggIgh1gfUW9rBIE2afRdHSpj+zz49HcR41wE11m4p?= =?us-ascii?Q?2cWEehe779AH29hA2pO8l0ZfOY45vOeCBsrTWH55Oy2mb9ouENUYGYsYCZqu?= =?us-ascii?Q?v7Rp3LQAIKuRhQcpKR6peGPVv0JJ7RLl1soyiyhBnsnHCE4+mA/8thKjBztB?= =?us-ascii?Q?AUP+kQtUAHG3uNaUh4oniP8rPG9OLoudEqa4t4AMud6EgnsrG6RQuvfDYPR2?= =?us-ascii?Q?r29AGV9mYSIcfuVUB+vy2lsHkuAbLiIS25FFWJmY2YXpIkg/SNROiuyo2M+d?= =?us-ascii?Q?x/dbzjT9nTFTYmnT0DEaj5og51xr1xpGZkFy6yJ6b39eocYP8+YLKmzqmcrk?= =?us-ascii?Q?oN4b1v117V6o+Prce7Sb27UaJT8Ue5+FBqq0xCstB+DHyAdVoahqrXrSGQu7?= =?us-ascii?Q?ba68xG2IKY8L0q+lYxtZ1890+zIacfQn8dwj2w8/1bsAkSvjyTyL2Qk+O1mI?= =?us-ascii?Q?G62qdfkG9FoBCtdb44hg53UKZk6srDZ914WbrmrG+GBLEMrE+cpGgV2I4Dmb?= =?us-ascii?Q?SLO2w99Ir+uQTj25VN/uMmEhSgJZtOZrfI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2/mMNsPTZ22xBBmyXmXehXMZaIM290ykRR9AcPyDMTbOnBCvd?= =?us-ascii?Q?7mRNvcgfc8uzvlb3v5zGexLpuuFlcvyeKCJkDN2sQgj8PtJwBTVzKxvS+AWZ?= =?us-ascii?Q?RDrS13kbXQfkPP6t5/L0JSb5r5xXTOrul0gPxjMSG0t3roCQWfHLajJmiTnj?= =?us-ascii?Q?PUMiwN3nzxA72jxEYT//NxSJLkzBNnx1CYBA+8FLggJtz13bNPjonqSFzp4e?= =?us-ascii?Q?xP02j1hZrW1Ou0sZL4aUccLtTtxUCV4DDobdPMjG2tyhY5++K/hE8G+McOyw?= =?us-ascii?Q?xwoL9uTZeQ=3D=3D?= X-OriginatorOrg: 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-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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", -- 2.30.2