Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3472493rwb; Fri, 30 Sep 2022 04:14:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6lWbRmWQmTrMeHzoCcLM6aDRe+Cy5wPV3+dfLgldwbyUR/O+1bCgUBzXTTWVUQRMJeEZCE X-Received: by 2002:a05:6402:34d0:b0:458:a4a:6dd0 with SMTP id w16-20020a05640234d000b004580a4a6dd0mr7414773edc.297.1664536439914; Fri, 30 Sep 2022 04:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664536439; cv=none; d=google.com; s=arc-20160816; b=MXjWQYvZoW40Eof9no/2tJa+g5HeXsjiDSNwx7Lkuw09om0R+XdZx6QMgyefInJzsY NrGnsupeReeq5VCmS8c8OJ8hKGbGEt8Fm90MfXcACQfKCHxTF+EqsRJGIA80zMIFDNoq KawGhG5w1DTJu/QyEbPa66R7zDVNP/n5jmucOxCzpvJOBXEf/t0cDEgeeLIGf1qvzquH N9dconQgbBYOzQ7bkx6J0EkwqHFc+1qUN5uITSv38mjsiHnd8SZ0O36ygAMiR2/Y/ThM 6kKLKDh9a1x3Q++pI1EPzTb02u+fdFMKf87PRL443SFrolVy3V+p6WcyIvn4JXn6q+Bb eAJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=slbVP+LJAzcM9BGCmsovMiK5OGqZ5aJ4MITaqG3lmsM=; b=inSZClXyQbxP1am4lYt29eqjK+MKwmvN3ljx7tiq/J7zufFAXPgMExGjKVgTAbE5xO +F54o4DnYAg0nSahsPh8NO1UmZ1apf55GcRN0zGfQb6sti7oFjOlr0kRgFgyI8VC+dL0 bArhDo0TobAgSQg21GlCT1Cil8dD5SmVB/LjuztytFiVqJb55se+icwl+VErkzxHkl7r YhFXL7osCDLQvJ1ndqiqqsnRwFNetcQMZEpQUKkBklQq1MJUtTBG4n61R8JxyWHRO394 BgaQCUZB80jvoZz4Kz17aS8Aw5STlzDdzK2d3dW+AJlqbpHji/vEt5ts3ACIZNT8N+1k dwVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qq17-20020a17090720d100b006ff49b183e9si1122951ejb.971.2022.09.30.04.13.34; Fri, 30 Sep 2022 04:13:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230471AbiI3Jub (ORCPT + 99 others); Fri, 30 Sep 2022 05:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbiI3Ju2 (ORCPT ); Fri, 30 Sep 2022 05:50:28 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2FBF8B2E1 for ; Fri, 30 Sep 2022 02:50:25 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mf52j1164zlXS5; Fri, 30 Sep 2022 17:46:05 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 17:50:06 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 17:50:05 +0800 From: Kefeng Wang To: Russell King CC: , , Catalin Marinas , Will Deacon , Kefeng Wang Subject: [PATCH v2] efi/arm: dump UEFI runtime page tables for ARM Date: Fri, 30 Sep 2022 18:10:24 +0800 Message-ID: <20220930101024.118394-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 UEFI runtime page tables dump only for ARM64 at present, but ARM support EFI and ARM_PTDUMP_DEBUGFS now. Since ARM could potentially execute with a 1G/3G user/kernel split, choosing 1G as the upper limit for UEFI runtime end, with this, we could enable UEFI runtime page tables. Signed-off-by: Kefeng Wang --- v2: update upper limit for ARM, only build test due to my qemu without UEFI boot support. arch/arm/include/asm/ptdump.h | 1 + arch/arm64/include/asm/ptdump.h | 1 + drivers/firmware/efi/arm-runtime.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/ptdump.h b/arch/arm/include/asm/ptdump.h index 0c2d3d0d4cc6..aad1d034136c 100644 --- a/arch/arm/include/asm/ptdump.h +++ b/arch/arm/include/asm/ptdump.h @@ -21,6 +21,7 @@ struct ptdump_info { void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info); #ifdef CONFIG_ARM_PTDUMP_DEBUGFS +#define EFI_RUNTIME_MAP_END SZ_1G void ptdump_debugfs_register(struct ptdump_info *info, const char *name); #else static inline void ptdump_debugfs_register(struct ptdump_info *info, diff --git a/arch/arm64/include/asm/ptdump.h b/arch/arm64/include/asm/ptdump.h index b1dd7ecff7ef..581caac525b0 100644 --- a/arch/arm64/include/asm/ptdump.h +++ b/arch/arm64/include/asm/ptdump.h @@ -23,6 +23,7 @@ struct ptdump_info { void ptdump_walk(struct seq_file *s, struct ptdump_info *info); #ifdef CONFIG_PTDUMP_DEBUGFS +#define EFI_RUNTIME_MAP_END DEFAULT_MAP_WINDOW_64 void __init ptdump_debugfs_register(struct ptdump_info *info, const char *name); #else static inline void ptdump_debugfs_register(struct ptdump_info *info, diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 3359ae2adf24..8f8ae479061b 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -25,14 +25,14 @@ #include #include -#if defined(CONFIG_PTDUMP_DEBUGFS) && defined(CONFIG_ARM64) +#if defined(CONFIG_PTDUMP_DEBUGFS) || defined(CONFIG_ARM_PTDUMP_DEBUGFS) #include static struct ptdump_info efi_ptdump_info = { .mm = &efi_mm, .markers = (struct addr_marker[]){ { 0, "UEFI runtime start" }, - { DEFAULT_MAP_WINDOW_64, "UEFI runtime end" }, + { EFI_RUNTIME_MAP_END, "UEFI runtime end" }, { -1, NULL } }, .base_addr = 0, -- 2.35.3