Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1988523rwb; Fri, 7 Oct 2022 23:44:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TAqtMl4Kbuq5AYEl8lc8+A8M8IYzMBCtx6/HaTsBisnE3v/xlblCoIbgJvBPQ7/kv28bJ X-Received: by 2002:a05:6402:1393:b0:457:ea9e:ba20 with SMTP id b19-20020a056402139300b00457ea9eba20mr7856769edv.109.1665211466366; Fri, 07 Oct 2022 23:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665211466; cv=none; d=google.com; s=arc-20160816; b=yCSRdfY7M+5lhqg5ge1r1L0MwYmM/qz0vEjRJuc2Tg1vAFItUJGKTn4qQ0qwaSbt31 Uxdou7pM4Fk00HoGTZvbPSdYVYGU36vhfStb4XZKZciFwgQxNVL18u/PQmHeCpVNjxb1 Mu48eyY20GjA/UpaFgiOEV0mtPxiWIAKTjO9XVRRSDP6hsC8oTf3vcIxQbUgjIMINAIh a7zASoMhbFP3ERSgScNNHRAQkigM6AGxXCY1nGKQVCCHpikPOMDNMNOdo0ROr0Lx7nCk jKYu3V/ZxAnuHqo9aUMLbhKqCwz2MaXG/MwWkygBWBROsBuAT7LkZBggpPIhKidsWJAf ogRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=zd8ACKJ9d56/dFhRKneqdUx2feoUDYndG3xzSiXTe5k=; b=HNQA4QKyXTgNjjAUF2rO6T65OvFWn5v3qhqrPfBpE8tjteP+oxQgdELzWfG1clqW1h LvklFz8Y5Sitik5nFxQqGnGN/af76TbyB4utrc+Mln9HDzx/nb3UqByWVxkxCafsp3Dx S2NM2xlZATX+aGYkPney6ECG4KhrV0uqNMVjsjDzWaF06IBoeiGVdcDcfpkBLJmoJ4LL KMRfEWXCGYuJLtUVezkGh8MnoqI2t2txUsqzVbHAK8nVYWLNcHeKK2c4xroXlTQ0gIW0 osbppYGejZaJEnKm6XokIZAV5sqsYvn4cjceEA5kKzyWa3u3fBChzweRrVpF9Z2Gz9OT ZeIA== 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 m17-20020a056402511100b00458a22ec887si5039314edd.276.2022.10.07.23.43.30; Fri, 07 Oct 2022 23:44:26 -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 S229593AbiJHGhn (ORCPT + 99 others); Sat, 8 Oct 2022 02:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbiJHGhg (ORCPT ); Sat, 8 Oct 2022 02:37:36 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567C786F8D; Fri, 7 Oct 2022 23:37:34 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MkwQd0X1gzkXvX; Sat, 8 Oct 2022 14:35:05 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 8 Oct 2022 14:37:32 +0800 Received: from [10.174.177.243] (10.174.177.243) 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; Sat, 8 Oct 2022 14:37:32 +0800 Message-ID: <28b5713f-6379-ef36-5139-6c3f0cbf27e8@huawei.com> Date: Sat, 8 Oct 2022 14:37:31 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2] efi/arm: dump UEFI runtime page tables for ARM Content-Language: en-US To: Russell King , Ard Biesheuvel CC: , , Catalin Marinas , Will Deacon , linux-efi References: <20220930101024.118394-1-wangkefeng.wang@huawei.com> From: Kefeng Wang In-Reply-To: <20220930101024.118394-1-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Sorry, forget to Cc Ard and efi maillist, do it now. On 2022/9/30 18:10, Kefeng Wang wrote: > 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,