All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: mm: ignore memory above supported physical address size
@ 2018-01-18 19:13 Kristina Martsenko
  2018-01-19 13:09 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Kristina Martsenko @ 2018-01-18 19:13 UTC (permalink / raw)
  To: linux-arm-kernel

When booting a kernel without 52-bit PA support (e.g. a kernel with 4k
pages) on a system with 52-bit memory, the kernel will currently try to
use the 52-bit memory and crash. Fix this by ignoring any memory higher
than what the kernel supports.

Fixes: f77d281713d4 ("arm64: enable 52-bit physical address support")
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
---
 arch/arm64/mm/init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 672094ed7e07..285745b2ca38 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -366,6 +366,9 @@ void __init arm64_memblock_init(void)
 	/* Handle linux,usable-memory-range property */
 	fdt_enforce_memory_region();
 
+	/* Remove memory above our supported physical address size */
+	memblock_remove(1ULL << PHYS_MASK_SHIFT, ULLONG_MAX);
+
 	/*
 	 * Ensure that the linear region takes up exactly half of the kernel
 	 * virtual address space. This way, we can distinguish a linear address
-- 
2.1.4

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

* [PATCH] arm64: mm: ignore memory above supported physical address size
  2018-01-18 19:13 [PATCH] arm64: mm: ignore memory above supported physical address size Kristina Martsenko
@ 2018-01-19 13:09 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2018-01-19 13:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 18, 2018 at 07:13:11PM +0000, Kristina Martsenko wrote:
> When booting a kernel without 52-bit PA support (e.g. a kernel with 4k
> pages) on a system with 52-bit memory, the kernel will currently try to
> use the 52-bit memory and crash. Fix this by ignoring any memory higher
> than what the kernel supports.
> 
> Fixes: f77d281713d4 ("arm64: enable 52-bit physical address support")
> Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
> ---
>  arch/arm64/mm/init.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 672094ed7e07..285745b2ca38 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -366,6 +366,9 @@ void __init arm64_memblock_init(void)
>  	/* Handle linux,usable-memory-range property */
>  	fdt_enforce_memory_region();
>  
> +	/* Remove memory above our supported physical address size */
> +	memblock_remove(1ULL << PHYS_MASK_SHIFT, ULLONG_MAX);
> +
>  	/*
>  	 * Ensure that the linear region takes up exactly half of the kernel
>  	 * virtual address space. This way, we can distinguish a linear address

It looks fine. I'll queue it for 4.16.

Thanks.

-- 
Catalin

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

end of thread, other threads:[~2018-01-19 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18 19:13 [PATCH] arm64: mm: ignore memory above supported physical address size Kristina Martsenko
2018-01-19 13:09 ` Catalin Marinas

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.