Skip to contentSkip to conversation

Patch "arm64: set MAX_MEMBLOCK_ADDR according to linear region size" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Sep 23, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

arm64: set MAX_MEMBLOCK_ADDR according to linear region size

to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
arm64-set-max_memblock_addr-according-to-linear-region-size.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 34ba2c4247e5c4b1542b1106e156af324660c4f0 Mon Sep 17 00:00:00 2001

From: Ard Biesheuvel <[email protected]>
Date: Tue, 18 Aug 2015 10:34:42 +0100
Subject: arm64: set MAX_MEMBLOCK_ADDR according to linear region size

From: Ard Biesheuvel <[email protected]>

commit 34ba2c4247e5c4b1542b1106e156af324660c4f0 upstream.

The linear region size of a 39-bit VA kernel is only 256 GB, which may be insufficient to cover all of system RAM, even on platforms that have much less than 256 GB of memory but which is laid out very sparsely.

So make sure we clip the memory we will not be able to map before installing it into the memblock memory table, by setting MAX_MEMBLOCK_ADDR accordingly.

---
 arch/arm64/include/asm/memory.h |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/include/asm/memory.h +8 -0
@@ -114,6 +114,14 @@ extern phys_addr_t		memstart_addr;
 #define PHYS_OFFSET		({ memstart_addr; })
 
 /*
+ * The maximum physical address that the linear direct mapping
+ * of system RAM can cover. (PAGE_OFFSET can be interpreted as
+ * a 2's complement signed quantity and negated to derive the
+ * maximum size of the linear mapping.)
+ */
+#define MAX_MEMBLOCK_ADDR	({ memstart_addr - PAGE_OFFSET - 1; })
+
+/*
  * PFNs are used to describe any physical page; this means
  * PFN 0 == physical address 0.
  *

Patches currently in stable-queue which might be from [email protected] are

queue-4.1/arm64-set-max_memblock_addr-according-to-linear-region-size.patch queue-4.1/arm64-flush-fp-simd-state-correctly-after-execve.patch queue-4.1/of-fdt-make-memblock-maximum-physical-address-arch-configurable.patch