All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: simplify BUILTIN_DTB processing
@ 2021-01-11 21:20 ` Vitaly Wool
  0 siblings, 0 replies; 10+ messages in thread
From: Vitaly Wool @ 2021-01-11 21:20 UTC (permalink / raw)
  To: linux-riscv
  Cc: linux-kernel, Anup Patel, Palmer Dabbelt, damien.lemoal,
	devicetree, Vitaly Wool

Provide __dtb_start as a parameter to setup_vm() in case
CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
versions of setup_vm().

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
---
 arch/riscv/kernel/head.S | 4 ++++
 arch/riscv/mm/init.c     | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 16e9941900c4..f5a9bad86e58 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -260,7 +260,11 @@ clear_bss_done:
 
 	/* Initialize page tables and relocate to virtual addresses */
 	la sp, init_thread_union + THREAD_SIZE
+#ifdef CONFIG_BUILTIN_DTB
+	la a0, __dtb_start
+#else
 	mv a0, s1
+#endif /* CONFIG_BUILTIN_DTB */
 	call setup_vm
 #ifdef CONFIG_MMU
 	la a0, early_pg_dir
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 5b17f8d22f91..45faad7c4291 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
 #else
 asmlinkage void __init setup_vm(uintptr_t dtb_pa)
 {
-#ifdef CONFIG_BUILTIN_DTB
-	dtb_early_va = (void *) __dtb_start;
-#else
 	dtb_early_va = (void *)dtb_pa;
-#endif
 	dtb_early_pa = dtb_pa;
 }
 
-- 
2.20.1


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

* [PATCH] RISC-V: simplify BUILTIN_DTB processing
@ 2021-01-11 21:20 ` Vitaly Wool
  0 siblings, 0 replies; 10+ messages in thread
From: Vitaly Wool @ 2021-01-11 21:20 UTC (permalink / raw)
  To: linux-riscv
  Cc: devicetree, damien.lemoal, Anup Patel, Palmer Dabbelt,
	linux-kernel, Vitaly Wool

Provide __dtb_start as a parameter to setup_vm() in case
CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
versions of setup_vm().

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
---
 arch/riscv/kernel/head.S | 4 ++++
 arch/riscv/mm/init.c     | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 16e9941900c4..f5a9bad86e58 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -260,7 +260,11 @@ clear_bss_done:
 
 	/* Initialize page tables and relocate to virtual addresses */
 	la sp, init_thread_union + THREAD_SIZE
+#ifdef CONFIG_BUILTIN_DTB
+	la a0, __dtb_start
+#else
 	mv a0, s1
+#endif /* CONFIG_BUILTIN_DTB */
 	call setup_vm
 #ifdef CONFIG_MMU
 	la a0, early_pg_dir
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 5b17f8d22f91..45faad7c4291 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
 #else
 asmlinkage void __init setup_vm(uintptr_t dtb_pa)
 {
-#ifdef CONFIG_BUILTIN_DTB
-	dtb_early_va = (void *) __dtb_start;
-#else
 	dtb_early_va = (void *)dtb_pa;
-#endif
 	dtb_early_pa = dtb_pa;
 }
 
-- 
2.20.1


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

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
  2021-01-11 21:20 ` Vitaly Wool
@ 2021-01-12  4:56   ` Damien Le Moal
  -1 siblings, 0 replies; 10+ messages in thread
From: Damien Le Moal @ 2021-01-12  4:56 UTC (permalink / raw)
  To: Vitaly Wool, linux-riscv
  Cc: linux-kernel, Anup Patel, Palmer Dabbelt, devicetree

On 2021/01/12 6:21, Vitaly Wool wrote:
> Provide __dtb_start as a parameter to setup_vm() in case
> CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
> BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
> versions of setup_vm().
> 
> Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
> ---
>  arch/riscv/kernel/head.S | 4 ++++
>  arch/riscv/mm/init.c     | 4 ----
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 16e9941900c4..f5a9bad86e58 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -260,7 +260,11 @@ clear_bss_done:
>  
>  	/* Initialize page tables and relocate to virtual addresses */
>  	la sp, init_thread_union + THREAD_SIZE
> +#ifdef CONFIG_BUILTIN_DTB
> +	la a0, __dtb_start
> +#else
>  	mv a0, s1
> +#endif /* CONFIG_BUILTIN_DTB */
>  	call setup_vm
>  #ifdef CONFIG_MMU
>  	la a0, early_pg_dir
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 5b17f8d22f91..45faad7c4291 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
>  #else
>  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>  {
> -#ifdef CONFIG_BUILTIN_DTB
> -	dtb_early_va = (void *) __dtb_start;
> -#else
>  	dtb_early_va = (void *)dtb_pa;
> -#endif
>  	dtb_early_pa = dtb_pa;
>  }
>  
> 

Tested this with a nommu kernel on a MAIX bit board (K210 SoC). No problems
detected.

Tested-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
@ 2021-01-12  4:56   ` Damien Le Moal
  0 siblings, 0 replies; 10+ messages in thread
From: Damien Le Moal @ 2021-01-12  4:56 UTC (permalink / raw)
  To: Vitaly Wool, linux-riscv
  Cc: Anup Patel, Palmer Dabbelt, linux-kernel, devicetree

On 2021/01/12 6:21, Vitaly Wool wrote:
> Provide __dtb_start as a parameter to setup_vm() in case
> CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
> BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
> versions of setup_vm().
> 
> Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
> ---
>  arch/riscv/kernel/head.S | 4 ++++
>  arch/riscv/mm/init.c     | 4 ----
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 16e9941900c4..f5a9bad86e58 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -260,7 +260,11 @@ clear_bss_done:
>  
>  	/* Initialize page tables and relocate to virtual addresses */
>  	la sp, init_thread_union + THREAD_SIZE
> +#ifdef CONFIG_BUILTIN_DTB
> +	la a0, __dtb_start
> +#else
>  	mv a0, s1
> +#endif /* CONFIG_BUILTIN_DTB */
>  	call setup_vm
>  #ifdef CONFIG_MMU
>  	la a0, early_pg_dir
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 5b17f8d22f91..45faad7c4291 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
>  #else
>  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>  {
> -#ifdef CONFIG_BUILTIN_DTB
> -	dtb_early_va = (void *) __dtb_start;
> -#else
>  	dtb_early_va = (void *)dtb_pa;
> -#endif
>  	dtb_early_pa = dtb_pa;
>  }
>  
> 

Tested this with a nommu kernel on a MAIX bit board (K210 SoC). No problems
detected.

Tested-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
  2021-01-11 21:20 ` Vitaly Wool
@ 2021-01-15  9:39   ` Anup Patel
  -1 siblings, 0 replies; 10+ messages in thread
From: Anup Patel @ 2021-01-15  9:39 UTC (permalink / raw)
  To: Vitaly Wool
  Cc: linux-riscv, linux-kernel@vger.kernel.org List, Palmer Dabbelt,
	Damien Le Moal, devicetree

On Tue, Jan 12, 2021 at 2:51 AM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
>
> Provide __dtb_start as a parameter to setup_vm() in case
> CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
> BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
> versions of setup_vm().
>
> Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
> ---
>  arch/riscv/kernel/head.S | 4 ++++
>  arch/riscv/mm/init.c     | 4 ----
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 16e9941900c4..f5a9bad86e58 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -260,7 +260,11 @@ clear_bss_done:
>
>         /* Initialize page tables and relocate to virtual addresses */
>         la sp, init_thread_union + THREAD_SIZE
> +#ifdef CONFIG_BUILTIN_DTB
> +       la a0, __dtb_start
> +#else
>         mv a0, s1
> +#endif /* CONFIG_BUILTIN_DTB */
>         call setup_vm
>  #ifdef CONFIG_MMU
>         la a0, early_pg_dir
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 5b17f8d22f91..45faad7c4291 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
>  #else
>  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>  {
> -#ifdef CONFIG_BUILTIN_DTB
> -       dtb_early_va = (void *) __dtb_start;
> -#else
>         dtb_early_va = (void *)dtb_pa;
> -#endif
>         dtb_early_pa = dtb_pa;
>  }
>
> --
> 2.20.1
>

We can avoid the early DTB mapping for MMU-enabled case when
BUILTIN_DTB is enabled (same as previous discussion). Otherwise
looks good to me.

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

Regards,
Anup

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
@ 2021-01-15  9:39   ` Anup Patel
  0 siblings, 0 replies; 10+ messages in thread
From: Anup Patel @ 2021-01-15  9:39 UTC (permalink / raw)
  To: Vitaly Wool
  Cc: Damien Le Moal, linux-riscv, Palmer Dabbelt,
	linux-kernel@vger.kernel.org List, devicetree

On Tue, Jan 12, 2021 at 2:51 AM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
>
> Provide __dtb_start as a parameter to setup_vm() in case
> CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
> BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
> versions of setup_vm().
>
> Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
> ---
>  arch/riscv/kernel/head.S | 4 ++++
>  arch/riscv/mm/init.c     | 4 ----
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 16e9941900c4..f5a9bad86e58 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -260,7 +260,11 @@ clear_bss_done:
>
>         /* Initialize page tables and relocate to virtual addresses */
>         la sp, init_thread_union + THREAD_SIZE
> +#ifdef CONFIG_BUILTIN_DTB
> +       la a0, __dtb_start
> +#else
>         mv a0, s1
> +#endif /* CONFIG_BUILTIN_DTB */
>         call setup_vm
>  #ifdef CONFIG_MMU
>         la a0, early_pg_dir
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 5b17f8d22f91..45faad7c4291 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
>  #else
>  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>  {
> -#ifdef CONFIG_BUILTIN_DTB
> -       dtb_early_va = (void *) __dtb_start;
> -#else
>         dtb_early_va = (void *)dtb_pa;
> -#endif
>         dtb_early_pa = dtb_pa;
>  }
>
> --
> 2.20.1
>

We can avoid the early DTB mapping for MMU-enabled case when
BUILTIN_DTB is enabled (same as previous discussion). Otherwise
looks good to me.

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

Regards,
Anup

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

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
       [not found]   ` <CAM4kBBKsYxaMe_R=JU=FxWdxS3vsgvpcMY3PCKBW080-9uSOrA@mail.gmail.com>
@ 2021-01-15 10:43       ` Anup Patel
  0 siblings, 0 replies; 10+ messages in thread
From: Anup Patel @ 2021-01-15 10:43 UTC (permalink / raw)
  To: Vitaly Wool
  Cc: linux-riscv, linux-kernel@vger.kernel.org List, Palmer Dabbelt,
	Damien Le Moal, devicetree

On Fri, Jan 15, 2021 at 3:18 PM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
>
>
>
> On Fri, 15 Jan 2021, 10:39 Anup Patel, <anup@brainfault.org> wrote:
>>
>> On Tue, Jan 12, 2021 at 2:51 AM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
>> >
>> > Provide __dtb_start as a parameter to setup_vm() in case
>> > CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
>> > BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
>> > versions of setup_vm().
>> >
>> > Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
>> > ---
>> >  arch/riscv/kernel/head.S | 4 ++++
>> >  arch/riscv/mm/init.c     | 4 ----
>> >  2 files changed, 4 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
>> > index 16e9941900c4..f5a9bad86e58 100644
>> > --- a/arch/riscv/kernel/head.S
>> > +++ b/arch/riscv/kernel/head.S
>> > @@ -260,7 +260,11 @@ clear_bss_done:
>> >
>> >         /* Initialize page tables and relocate to virtual addresses */
>> >         la sp, init_thread_union + THREAD_SIZE
>> > +#ifdef CONFIG_BUILTIN_DTB
>> > +       la a0, __dtb_start
>> > +#else
>> >         mv a0, s1
>> > +#endif /* CONFIG_BUILTIN_DTB */
>> >         call setup_vm
>> >  #ifdef CONFIG_MMU
>> >         la a0, early_pg_dir
>> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
>> > index 5b17f8d22f91..45faad7c4291 100644
>> > --- a/arch/riscv/mm/init.c
>> > +++ b/arch/riscv/mm/init.c
>> > @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
>> >  #else
>> >  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>> >  {
>> > -#ifdef CONFIG_BUILTIN_DTB
>> > -       dtb_early_va = (void *) __dtb_start;
>> > -#else
>> >         dtb_early_va = (void *)dtb_pa;
>> > -#endif
>> >         dtb_early_pa = dtb_pa;
>> >  }
>> >
>> > --
>> > 2.20.1
>> >
>>
>> We can avoid the early DTB mapping for MMU-enabled case when
>> BUILTIN_DTB is enabled (same as previous discussion). Otherwise
>> looks good to me.
>
>
> Right, but I had already submitted the patch which takes care of that, and you have reviewed it too IIRC :)

Ahh, I assumed this patch is based on latest stable Linux-5.11-rcX.

Either you can create a series with two patches OR you can squash this patch
into your previous patch.

Regards,
Anup

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
@ 2021-01-15 10:43       ` Anup Patel
  0 siblings, 0 replies; 10+ messages in thread
From: Anup Patel @ 2021-01-15 10:43 UTC (permalink / raw)
  To: Vitaly Wool
  Cc: Damien Le Moal, linux-riscv, Palmer Dabbelt,
	linux-kernel@vger.kernel.org List, devicetree

On Fri, Jan 15, 2021 at 3:18 PM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
>
>
>
> On Fri, 15 Jan 2021, 10:39 Anup Patel, <anup@brainfault.org> wrote:
>>
>> On Tue, Jan 12, 2021 at 2:51 AM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
>> >
>> > Provide __dtb_start as a parameter to setup_vm() in case
>> > CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
>> > BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
>> > versions of setup_vm().
>> >
>> > Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
>> > ---
>> >  arch/riscv/kernel/head.S | 4 ++++
>> >  arch/riscv/mm/init.c     | 4 ----
>> >  2 files changed, 4 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
>> > index 16e9941900c4..f5a9bad86e58 100644
>> > --- a/arch/riscv/kernel/head.S
>> > +++ b/arch/riscv/kernel/head.S
>> > @@ -260,7 +260,11 @@ clear_bss_done:
>> >
>> >         /* Initialize page tables and relocate to virtual addresses */
>> >         la sp, init_thread_union + THREAD_SIZE
>> > +#ifdef CONFIG_BUILTIN_DTB
>> > +       la a0, __dtb_start
>> > +#else
>> >         mv a0, s1
>> > +#endif /* CONFIG_BUILTIN_DTB */
>> >         call setup_vm
>> >  #ifdef CONFIG_MMU
>> >         la a0, early_pg_dir
>> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
>> > index 5b17f8d22f91..45faad7c4291 100644
>> > --- a/arch/riscv/mm/init.c
>> > +++ b/arch/riscv/mm/init.c
>> > @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
>> >  #else
>> >  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>> >  {
>> > -#ifdef CONFIG_BUILTIN_DTB
>> > -       dtb_early_va = (void *) __dtb_start;
>> > -#else
>> >         dtb_early_va = (void *)dtb_pa;
>> > -#endif
>> >         dtb_early_pa = dtb_pa;
>> >  }
>> >
>> > --
>> > 2.20.1
>> >
>>
>> We can avoid the early DTB mapping for MMU-enabled case when
>> BUILTIN_DTB is enabled (same as previous discussion). Otherwise
>> looks good to me.
>
>
> Right, but I had already submitted the patch which takes care of that, and you have reviewed it too IIRC :)

Ahh, I assumed this patch is based on latest stable Linux-5.11-rcX.

Either you can create a series with two patches OR you can squash this patch
into your previous patch.

Regards,
Anup

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

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
  2021-01-15 10:43       ` Anup Patel
@ 2021-01-15 20:18         ` Vitaly Wool
  -1 siblings, 0 replies; 10+ messages in thread
From: Vitaly Wool @ 2021-01-15 20:18 UTC (permalink / raw)
  To: Anup Patel
  Cc: linux-riscv, linux-kernel@vger.kernel.org List, Palmer Dabbelt,
	Damien Le Moal, devicetree

On Fri, Jan 15, 2021 at 11:43 AM Anup Patel <anup@brainfault.org> wrote:
>
> On Fri, Jan 15, 2021 at 3:18 PM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
> >
> >
> >
> > On Fri, 15 Jan 2021, 10:39 Anup Patel, <anup@brainfault.org> wrote:
> >>
> >> On Tue, Jan 12, 2021 at 2:51 AM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
> >> >
> >> > Provide __dtb_start as a parameter to setup_vm() in case
> >> > CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
> >> > BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
> >> > versions of setup_vm().
> >> >
> >> > Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
> >> > ---
> >> >  arch/riscv/kernel/head.S | 4 ++++
> >> >  arch/riscv/mm/init.c     | 4 ----
> >> >  2 files changed, 4 insertions(+), 4 deletions(-)
> >> >
> >> > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> >> > index 16e9941900c4..f5a9bad86e58 100644
> >> > --- a/arch/riscv/kernel/head.S
> >> > +++ b/arch/riscv/kernel/head.S
> >> > @@ -260,7 +260,11 @@ clear_bss_done:
> >> >
> >> >         /* Initialize page tables and relocate to virtual addresses */
> >> >         la sp, init_thread_union + THREAD_SIZE
> >> > +#ifdef CONFIG_BUILTIN_DTB
> >> > +       la a0, __dtb_start
> >> > +#else
> >> >         mv a0, s1
> >> > +#endif /* CONFIG_BUILTIN_DTB */
> >> >         call setup_vm
> >> >  #ifdef CONFIG_MMU
> >> >         la a0, early_pg_dir
> >> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> >> > index 5b17f8d22f91..45faad7c4291 100644
> >> > --- a/arch/riscv/mm/init.c
> >> > +++ b/arch/riscv/mm/init.c
> >> > @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
> >> >  #else
> >> >  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
> >> >  {
> >> > -#ifdef CONFIG_BUILTIN_DTB
> >> > -       dtb_early_va = (void *) __dtb_start;
> >> > -#else
> >> >         dtb_early_va = (void *)dtb_pa;
> >> > -#endif
> >> >         dtb_early_pa = dtb_pa;
> >> >  }
> >> >
> >> > --
> >> > 2.20.1
> >> >
> >>
> >> We can avoid the early DTB mapping for MMU-enabled case when
> >> BUILTIN_DTB is enabled (same as previous discussion). Otherwise
> >> looks good to me.
> >
> >
> > Right, but I had already submitted the patch which takes care of that, and you have reviewed it too IIRC :)
>
> Ahh, I assumed this patch is based on latest stable Linux-5.11-rcX.
>
> Either you can create a series with two patches OR you can squash this patch
> into your previous patch.

Fair enough, I'll come up with a new (aggregate) one.

Best regards,
   Vitaly

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

* Re: [PATCH] RISC-V: simplify BUILTIN_DTB processing
@ 2021-01-15 20:18         ` Vitaly Wool
  0 siblings, 0 replies; 10+ messages in thread
From: Vitaly Wool @ 2021-01-15 20:18 UTC (permalink / raw)
  To: Anup Patel
  Cc: Damien Le Moal, linux-riscv, Palmer Dabbelt,
	linux-kernel@vger.kernel.org List, devicetree

On Fri, Jan 15, 2021 at 11:43 AM Anup Patel <anup@brainfault.org> wrote:
>
> On Fri, Jan 15, 2021 at 3:18 PM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
> >
> >
> >
> > On Fri, 15 Jan 2021, 10:39 Anup Patel, <anup@brainfault.org> wrote:
> >>
> >> On Tue, Jan 12, 2021 at 2:51 AM Vitaly Wool <vitaly.wool@konsulko.com> wrote:
> >> >
> >> > Provide __dtb_start as a parameter to setup_vm() in case
> >> > CONFIG_BUILTIN_DTB is true, so we don't have to duplicate
> >> > BUILTIN_DTB specific processing in MMU-enabled and MMU-disabled
> >> > versions of setup_vm().
> >> >
> >> > Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
> >> > ---
> >> >  arch/riscv/kernel/head.S | 4 ++++
> >> >  arch/riscv/mm/init.c     | 4 ----
> >> >  2 files changed, 4 insertions(+), 4 deletions(-)
> >> >
> >> > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> >> > index 16e9941900c4..f5a9bad86e58 100644
> >> > --- a/arch/riscv/kernel/head.S
> >> > +++ b/arch/riscv/kernel/head.S
> >> > @@ -260,7 +260,11 @@ clear_bss_done:
> >> >
> >> >         /* Initialize page tables and relocate to virtual addresses */
> >> >         la sp, init_thread_union + THREAD_SIZE
> >> > +#ifdef CONFIG_BUILTIN_DTB
> >> > +       la a0, __dtb_start
> >> > +#else
> >> >         mv a0, s1
> >> > +#endif /* CONFIG_BUILTIN_DTB */
> >> >         call setup_vm
> >> >  #ifdef CONFIG_MMU
> >> >         la a0, early_pg_dir
> >> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> >> > index 5b17f8d22f91..45faad7c4291 100644
> >> > --- a/arch/riscv/mm/init.c
> >> > +++ b/arch/riscv/mm/init.c
> >> > @@ -615,11 +615,7 @@ static void __init setup_vm_final(void)
> >> >  #else
> >> >  asmlinkage void __init setup_vm(uintptr_t dtb_pa)
> >> >  {
> >> > -#ifdef CONFIG_BUILTIN_DTB
> >> > -       dtb_early_va = (void *) __dtb_start;
> >> > -#else
> >> >         dtb_early_va = (void *)dtb_pa;
> >> > -#endif
> >> >         dtb_early_pa = dtb_pa;
> >> >  }
> >> >
> >> > --
> >> > 2.20.1
> >> >
> >>
> >> We can avoid the early DTB mapping for MMU-enabled case when
> >> BUILTIN_DTB is enabled (same as previous discussion). Otherwise
> >> looks good to me.
> >
> >
> > Right, but I had already submitted the patch which takes care of that, and you have reviewed it too IIRC :)
>
> Ahh, I assumed this patch is based on latest stable Linux-5.11-rcX.
>
> Either you can create a series with two patches OR you can squash this patch
> into your previous patch.

Fair enough, I'll come up with a new (aggregate) one.

Best regards,
   Vitaly

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

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

end of thread, other threads:[~2021-01-15 20:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 21:20 [PATCH] RISC-V: simplify BUILTIN_DTB processing Vitaly Wool
2021-01-11 21:20 ` Vitaly Wool
2021-01-12  4:56 ` Damien Le Moal
2021-01-12  4:56   ` Damien Le Moal
2021-01-15  9:39 ` Anup Patel
2021-01-15  9:39   ` Anup Patel
     [not found]   ` <CAM4kBBKsYxaMe_R=JU=FxWdxS3vsgvpcMY3PCKBW080-9uSOrA@mail.gmail.com>
2021-01-15 10:43     ` Anup Patel
2021-01-15 10:43       ` Anup Patel
2021-01-15 20:18       ` Vitaly Wool
2021-01-15 20:18         ` Vitaly Wool

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.