Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] riscv: Remove 32b kernel mapping from page table dump
@ 2021-04-18 11:28 Alexandre Ghiti
  2021-04-20  4:19 ` Anup Patel
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Ghiti @ 2021-04-18 11:28 UTC (permalink / raw)
  To: Jonathan Corbet, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Arnd Bergmann, Andrey Ryabinin, Alexander Potapenko,
	Dmitry Vyukov, linux-doc, linux-riscv, linux-kernel, kasan-dev,
	linux-arch, linux-mm
  Cc: Alexandre Ghiti

The 32b kernel mapping lies in the linear mapping, there is no point in
printing its address in page table dump, so remove this leftover that
comes from moving the kernel mapping outside the linear mapping for 64b
kernel.

Fixes: e9efb21fe352 ("riscv: Prepare ptdump for vm layout dynamic addresses")
Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
---
 arch/riscv/mm/ptdump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/riscv/mm/ptdump.c b/arch/riscv/mm/ptdump.c
index 0aba4421115c..a4ed4bdbbfde 100644
--- a/arch/riscv/mm/ptdump.c
+++ b/arch/riscv/mm/ptdump.c
@@ -76,8 +76,8 @@ enum address_markers_idx {
 	PAGE_OFFSET_NR,
 #ifdef CONFIG_64BIT
 	MODULES_MAPPING_NR,
-#endif
 	KERNEL_MAPPING_NR,
+#endif
 	END_OF_SPACE_NR
 };
 
@@ -99,8 +99,8 @@ static struct addr_marker address_markers[] = {
 	{0, "Linear mapping"},
 #ifdef CONFIG_64BIT
 	{0, "Modules mapping"},
-#endif
 	{0, "Kernel mapping (kernel, BPF)"},
+#endif
 	{-1, NULL},
 };
 
@@ -379,8 +379,8 @@ static int ptdump_init(void)
 	address_markers[PAGE_OFFSET_NR].start_address = PAGE_OFFSET;
 #ifdef CONFIG_64BIT
 	address_markers[MODULES_MAPPING_NR].start_address = MODULES_VADDR;
-#endif
 	address_markers[KERNEL_MAPPING_NR].start_address = kernel_virt_addr;
+#endif
 
 	kernel_ptd_info.base_addr = KERN_VIRT_START;
 
-- 
2.20.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] riscv: Remove 32b kernel mapping from page table dump
  2021-04-18 11:28 [PATCH] riscv: Remove 32b kernel mapping from page table dump Alexandre Ghiti
@ 2021-04-20  4:19 ` Anup Patel
  2021-04-28  7:26   ` Alex Ghiti
  0 siblings, 1 reply; 3+ messages in thread
From: Anup Patel @ 2021-04-20  4:19 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: Jonathan Corbet, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Arnd Bergmann, Andrey Ryabinin, Alexander Potapenko,
	Dmitry Vyukov, linux-doc, linux-riscv,
	linux-kernel@vger.kernel.org List, kasan-dev, linux-arch,
	Linux Memory Management List

On Sun, Apr 18, 2021 at 4:59 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>
> The 32b kernel mapping lies in the linear mapping, there is no point in
> printing its address in page table dump, so remove this leftover that
> comes from moving the kernel mapping outside the linear mapping for 64b
> kernel.
>
> Fixes: e9efb21fe352 ("riscv: Prepare ptdump for vm layout dynamic addresses")
> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>

Looks good to me.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup

> ---
>  arch/riscv/mm/ptdump.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/riscv/mm/ptdump.c b/arch/riscv/mm/ptdump.c
> index 0aba4421115c..a4ed4bdbbfde 100644
> --- a/arch/riscv/mm/ptdump.c
> +++ b/arch/riscv/mm/ptdump.c
> @@ -76,8 +76,8 @@ enum address_markers_idx {
>         PAGE_OFFSET_NR,
>  #ifdef CONFIG_64BIT
>         MODULES_MAPPING_NR,
> -#endif
>         KERNEL_MAPPING_NR,
> +#endif
>         END_OF_SPACE_NR
>  };
>
> @@ -99,8 +99,8 @@ static struct addr_marker address_markers[] = {
>         {0, "Linear mapping"},
>  #ifdef CONFIG_64BIT
>         {0, "Modules mapping"},
> -#endif
>         {0, "Kernel mapping (kernel, BPF)"},
> +#endif
>         {-1, NULL},
>  };
>
> @@ -379,8 +379,8 @@ static int ptdump_init(void)
>         address_markers[PAGE_OFFSET_NR].start_address = PAGE_OFFSET;
>  #ifdef CONFIG_64BIT
>         address_markers[MODULES_MAPPING_NR].start_address = MODULES_VADDR;
> -#endif
>         address_markers[KERNEL_MAPPING_NR].start_address = kernel_virt_addr;
> +#endif
>
>         kernel_ptd_info.base_addr = KERN_VIRT_START;
>
> --
> 2.20.1
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] riscv: Remove 32b kernel mapping from page table dump
  2021-04-20  4:19 ` Anup Patel
@ 2021-04-28  7:26   ` Alex Ghiti
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Ghiti @ 2021-04-28  7:26 UTC (permalink / raw)
  To: Anup Patel, Palmer Dabbelt
  Cc: Jonathan Corbet, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Arnd Bergmann, Andrey Ryabinin, Alexander Potapenko,
	Dmitry Vyukov, linux-doc, linux-riscv,
	linux-kernel@vger.kernel.org List, kasan-dev, linux-arch,
	Linux Memory Management List

Hi Palmer,

Le 4/20/21 à 12:19 AM, Anup Patel a écrit :
> On Sun, Apr 18, 2021 at 4:59 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>>
>> The 32b kernel mapping lies in the linear mapping, there is no point in
>> printing its address in page table dump, so remove this leftover that
>> comes from moving the kernel mapping outside the linear mapping for 64b
>> kernel.
>>
>> Fixes: e9efb21fe352 ("riscv: Prepare ptdump for vm layout dynamic addresses")
>> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> 
> Looks good to me.
> 
> Reviewed-by: Anup Patel <anup@brainfault.org>
> 
> Regards,
> Anup
> 
>> ---
>>   arch/riscv/mm/ptdump.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/riscv/mm/ptdump.c b/arch/riscv/mm/ptdump.c
>> index 0aba4421115c..a4ed4bdbbfde 100644
>> --- a/arch/riscv/mm/ptdump.c
>> +++ b/arch/riscv/mm/ptdump.c
>> @@ -76,8 +76,8 @@ enum address_markers_idx {
>>          PAGE_OFFSET_NR,
>>   #ifdef CONFIG_64BIT
>>          MODULES_MAPPING_NR,
>> -#endif
>>          KERNEL_MAPPING_NR,
>> +#endif
>>          END_OF_SPACE_NR
>>   };
>>
>> @@ -99,8 +99,8 @@ static struct addr_marker address_markers[] = {
>>          {0, "Linear mapping"},
>>   #ifdef CONFIG_64BIT
>>          {0, "Modules mapping"},
>> -#endif
>>          {0, "Kernel mapping (kernel, BPF)"},
>> +#endif
>>          {-1, NULL},
>>   };
>>
>> @@ -379,8 +379,8 @@ static int ptdump_init(void)
>>          address_markers[PAGE_OFFSET_NR].start_address = PAGE_OFFSET;
>>   #ifdef CONFIG_64BIT
>>          address_markers[MODULES_MAPPING_NR].start_address = MODULES_VADDR;
>> -#endif
>>          address_markers[KERNEL_MAPPING_NR].start_address = kernel_virt_addr;
>> +#endif
>>
>>          kernel_ptd_info.base_addr = KERN_VIRT_START;
>>
>> --
>> 2.20.1
>>

Do you think you can take this patch too on for-next?

Thanks,

Alex

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18 11:28 [PATCH] riscv: Remove 32b kernel mapping from page table dump Alexandre Ghiti
2021-04-20  4:19 ` Anup Patel
2021-04-28  7:26   ` Alex Ghiti

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org
	public-inbox-index linux-riscv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git