Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] RISC-V: Make sure memblock reserves the memory containing DT
@ 2020-10-01 19:04 Atish Patra
  2020-10-02 10:11 ` Anup Patel
  2020-10-04 23:20 ` Palmer Dabbelt
  0 siblings, 2 replies; 3+ messages in thread
From: Atish Patra @ 2020-10-01 19:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: Damien Le Moal, Albert Ou, Anup Patel, Atish Patra,
	Palmer Dabbelt, Zong Li, Paul Walmsley, Alistair Francis,
	linux-riscv, Christoph Hellwig

Currently, the memory containing DT is not reserved. Thus, that region
of memory can be reallocated or reused for other purposes. This may result
in  corrupted DT for nommu virt board in Qemu. We may not face any issue
in kendryte as DT is embedded in the kernel image for that.

Fixes: 6bd33e1ece52 ("riscv: add nommu support")
Signed-off-by: Atish Patra <atish.patra@wdc.com>

---
@Palmer This patch is applicable for v5.9 & before. This fix is already
part of the "RISC-V: Move DT mapping outof fixmap" patch from UEFI support
series. That's why, this patch doesn't need to go into for-next.
---
 arch/riscv/mm/init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 564e0be677b7..cabf1697e748 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -510,6 +510,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
 #else
 	dtb_early_va = (void *)dtb_pa;
 #endif
+	dtb_early_pa = dtb_pa;
 }
 
 static inline void setup_vm_final(void)
-- 
2.25.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] RISC-V: Make sure memblock reserves the memory containing DT
  2020-10-01 19:04 [PATCH] RISC-V: Make sure memblock reserves the memory containing DT Atish Patra
@ 2020-10-02 10:11 ` Anup Patel
  2020-10-04 23:20 ` Palmer Dabbelt
  1 sibling, 0 replies; 3+ messages in thread
From: Anup Patel @ 2020-10-02 10:11 UTC (permalink / raw)
  To: Atish Patra
  Cc: Damien Le Moal, Albert Ou, Anup Patel,
	linux-kernel@vger.kernel.org List, Palmer Dabbelt, Zong Li,
	Paul Walmsley, Alistair Francis, linux-riscv, Christoph Hellwig

On Fri, Oct 2, 2020 at 12:35 AM Atish Patra <atish.patra@wdc.com> wrote:
>
> Currently, the memory containing DT is not reserved. Thus, that region
> of memory can be reallocated or reused for other purposes. This may result
> in  corrupted DT for nommu virt board in Qemu. We may not face any issue
> in kendryte as DT is embedded in the kernel image for that.
>
> Fixes: 6bd33e1ece52 ("riscv: add nommu support")
> Signed-off-by: Atish Patra <atish.patra@wdc.com>
>
> ---
> @Palmer This patch is applicable for v5.9 & before. This fix is already
> part of the "RISC-V: Move DT mapping outof fixmap" patch from UEFI support
> series. That's why, this patch doesn't need to go into for-next.
> ---
>  arch/riscv/mm/init.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 564e0be677b7..cabf1697e748 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -510,6 +510,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>  #else
>         dtb_early_va = (void *)dtb_pa;
>  #endif
> +       dtb_early_pa = dtb_pa;
>  }
>
>  static inline void setup_vm_final(void)
> --
> 2.25.1
>

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] 3+ messages in thread

* Re: [PATCH] RISC-V: Make sure memblock reserves the memory containing DT
  2020-10-01 19:04 [PATCH] RISC-V: Make sure memblock reserves the memory containing DT Atish Patra
  2020-10-02 10:11 ` Anup Patel
@ 2020-10-04 23:20 ` Palmer Dabbelt
  1 sibling, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2020-10-04 23:20 UTC (permalink / raw)
  To: Atish Patra
  Cc: Damien Le Moal, aou, Anup Patel, linux-kernel, Atish Patra,
	Alistair Francis, zong.li, Paul Walmsley, linux-riscv,
	Christoph Hellwig

On Thu, 01 Oct 2020 12:04:56 PDT (-0700), Atish Patra wrote:
> Currently, the memory containing DT is not reserved. Thus, that region
> of memory can be reallocated or reused for other purposes. This may result
> in  corrupted DT for nommu virt board in Qemu. We may not face any issue
> in kendryte as DT is embedded in the kernel image for that.
>
> Fixes: 6bd33e1ece52 ("riscv: add nommu support")
> Signed-off-by: Atish Patra <atish.patra@wdc.com>
>
> ---
> @Palmer This patch is applicable for v5.9 & before. This fix is already
> part of the "RISC-V: Move DT mapping outof fixmap" patch from UEFI support
> series. That's why, this patch doesn't need to go into for-next.
> ---
>  arch/riscv/mm/init.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 564e0be677b7..cabf1697e748 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -510,6 +510,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>  #else
>  	dtb_early_va = (void *)dtb_pa;
>  #endif
> +	dtb_early_pa = dtb_pa;
>  }
>
>  static inline void setup_vm_final(void)

Thanks, this is on fixes.

_______________________________________________
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 --
2020-10-01 19:04 [PATCH] RISC-V: Make sure memblock reserves the memory containing DT Atish Patra
2020-10-02 10:11 ` Anup Patel
2020-10-04 23:20 ` Palmer Dabbelt

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