linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-efi <linux-efi@vger.kernel.org>
Subject: Re: [PATCH v2] efi/arm: dump UEFI runtime page tables for ARM
Date: Mon, 10 Oct 2022 18:24:09 +0800	[thread overview]
Message-ID: <b703f99f-bf7b-d8ce-d92a-5c8b4c481d02@huawei.com> (raw)
In-Reply-To: <CAMj1kXEHQLxNR2ADR1A2CHHA3M8CWUnKrKWCMSBNnZOTvZasZg@mail.gmail.com>


On 2022/10/10 17:47, Ard Biesheuvel wrote:
> On Sat, 8 Oct 2022 at 08:37, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> 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 <wangkefeng.wang@huawei.com>
>>> ---
>>> v2: update upper limit for ARM, only build test due to
>>>       my qemu without UEFI boot support.
> Tested-by: Ard Biesheuvel <ardb@kernel.org>
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
>
Many thanks:)
>
>
> / # cat /sys/kernel/debug/efi_page_tables
> ---[ UEFI runtime start ]---
> 0x20005000-0x20112000        1076K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x20112000-0x20114000           8K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x20114000-0x20117000          12K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x20117000-0x20118000           4K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x20118000-0x2011b000          12K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x2011b000-0x2011c000           4K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x2011c000-0x2011f000          12K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x2011f000-0x2017c000         372K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x2017c000-0x20183000          28K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x20183000-0x20186000          12K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x20186000-0x20189000          12K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x20189000-0x2018a000           4K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x2018a000-0x2018d000          12K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x2018d000-0x2018e000           4K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x2018e000-0x20191000          12K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x20191000-0x20193000           8K PTE KERNEL      ro x  SHD MEM/CACHED/WBWA
> 0x20193000-0x20195000           8K PTE KERNEL      RW NX SHD MEM/CACHED/WBWA
> 0x201a5000-0x203fd000        2400K PTE KERNEL      RW x  SHD MEM/CACHED/WBWA
> 0x20400000-0x24400000          64M PGD IO          RW NX SHD
> 0x24400000-0x24401000           4K PTE IO          RW NX SHD DEV/SHARED
> ---[ UEFI runtime end ]---
>
>>>    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 <asm/mmu.h>
>>>    #include <asm/pgalloc.h>
>>>
>>> -#if defined(CONFIG_PTDUMP_DEBUGFS) && defined(CONFIG_ARM64)
>>> +#if defined(CONFIG_PTDUMP_DEBUGFS) || defined(CONFIG_ARM_PTDUMP_DEBUGFS)
>>>    #include <asm/ptdump.h>
>>>
>>>    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,
> .

  reply	other threads:[~2022-10-10 10:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 10:10 [PATCH v2] efi/arm: dump UEFI runtime page tables for ARM Kefeng Wang
2022-10-08  6:37 ` Kefeng Wang
2022-10-10  9:47   ` Ard Biesheuvel
2022-10-10 10:24     ` Kefeng Wang [this message]
2022-10-12  9:09 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b703f99f-bf7b-d8ce-d92a-5c8b4c481d02@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).