All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/prom: move the device tree if not in declared memory.
@ 2018-12-17 14:18 ` Christophe Leroy
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe Leroy @ 2018-12-17 14:18 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linux-kernel, linuxppc-dev

If the device tree doesn't reside in the memory which is declared
inside it, it has to be moved as well as this memory will not be
mapped by the kernel.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/prom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 87a68e2dc531..4181ec715f88 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -124,8 +124,8 @@ static void __init move_device_tree(void)
 	size = fdt_totalsize(initial_boot_params);
 
 	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
-			overlaps_crashkernel(start, size) ||
-			overlaps_initrd(start, size)) {
+	    !memblock_is_memory(start + size - 1) ||
+	    overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
 		p = __va(memblock_phys_alloc(size, PAGE_SIZE));
 		memcpy(p, initial_boot_params, size);
 		initial_boot_params = p;
-- 
2.13.3


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

* [PATCH] powerpc/prom: move the device tree if not in declared memory.
@ 2018-12-17 14:18 ` Christophe Leroy
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe Leroy @ 2018-12-17 14:18 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linuxppc-dev, linux-kernel

If the device tree doesn't reside in the memory which is declared
inside it, it has to be moved as well as this memory will not be
mapped by the kernel.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/prom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 87a68e2dc531..4181ec715f88 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -124,8 +124,8 @@ static void __init move_device_tree(void)
 	size = fdt_totalsize(initial_boot_params);
 
 	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
-			overlaps_crashkernel(start, size) ||
-			overlaps_initrd(start, size)) {
+	    !memblock_is_memory(start + size - 1) ||
+	    overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
 		p = __va(memblock_phys_alloc(size, PAGE_SIZE));
 		memcpy(p, initial_boot_params, size);
 		initial_boot_params = p;
-- 
2.13.3


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

* Re: [PATCH] powerpc/prom: move the device tree if not in declared memory.
  2018-12-17 14:18 ` Christophe Leroy
@ 2018-12-19  4:42   ` Michael Ellerman
  -1 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2018-12-19  4:42 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linux-kernel, linuxppc-dev

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> If the device tree doesn't reside in the memory which is declared
> inside it, it has to be moved as well as this memory will not be
> mapped by the kernel.

I worry this will break some obscure platform, but I'll merge it anyway
and we'll see :)

cheers

> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 87a68e2dc531..4181ec715f88 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -124,8 +124,8 @@ static void __init move_device_tree(void)
>  	size = fdt_totalsize(initial_boot_params);
>  
>  	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
> -			overlaps_crashkernel(start, size) ||
> -			overlaps_initrd(start, size)) {
> +	    !memblock_is_memory(start + size - 1) ||
> +	    overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
>  		p = __va(memblock_phys_alloc(size, PAGE_SIZE));
>  		memcpy(p, initial_boot_params, size);
>  		initial_boot_params = p;
> -- 
> 2.13.3

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

* Re: [PATCH] powerpc/prom: move the device tree if not in declared memory.
@ 2018-12-19  4:42   ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2018-12-19  4:42 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> If the device tree doesn't reside in the memory which is declared
> inside it, it has to be moved as well as this memory will not be
> mapped by the kernel.

I worry this will break some obscure platform, but I'll merge it anyway
and we'll see :)

cheers

> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 87a68e2dc531..4181ec715f88 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -124,8 +124,8 @@ static void __init move_device_tree(void)
>  	size = fdt_totalsize(initial_boot_params);
>  
>  	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
> -			overlaps_crashkernel(start, size) ||
> -			overlaps_initrd(start, size)) {
> +	    !memblock_is_memory(start + size - 1) ||
> +	    overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
>  		p = __va(memblock_phys_alloc(size, PAGE_SIZE));
>  		memcpy(p, initial_boot_params, size);
>  		initial_boot_params = p;
> -- 
> 2.13.3

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

* Re: powerpc/prom: move the device tree if not in declared memory.
  2018-12-17 14:18 ` Christophe Leroy
  (?)
  (?)
@ 2018-12-22  9:54 ` Michael Ellerman
  -1 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2018-12-22  9:54 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel

On Mon, 2018-12-17 at 14:18:27 UTC, Christophe Leroy wrote:
> If the device tree doesn't reside in the memory which is declared
> inside it, it has to be moved as well as this memory will not be
> mapped by the kernel.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f242e0ac95cadb27527d0b06c95772

cheers

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

end of thread, other threads:[~2018-12-22 17:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17 14:18 [PATCH] powerpc/prom: move the device tree if not in declared memory Christophe Leroy
2018-12-17 14:18 ` Christophe Leroy
2018-12-19  4:42 ` Michael Ellerman
2018-12-19  4:42   ` Michael Ellerman
2018-12-22  9:54 ` Michael Ellerman

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.