|
@@ -11,7 +11,27 @@
|
|
#ifdef CONFIG_ARM_KERNMEM_PERMS
|
|
#ifdef CONFIG_ARM_KERNMEM_PERMS
|
|
#include <asm/pgtable.h>
|
|
#include <asm/pgtable.h>
|
|
#endif
|
|
#endif
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * Poor man's version of LOG2CEIL(), which is
|
|
|
|
+ * not available in binutils before v2.24.
|
|
|
|
+ */
|
|
|
|
+#define LOG2_ROUNDUP(size) ( \
|
|
|
|
+ __LOG2_ROUNDUP(size, 2) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 3) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 4) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 5) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 6) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 7) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 8) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 9) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 10) \
|
|
|
|
+ __LOG2_ROUNDUP(size, 11) \
|
|
|
|
+ 12)
|
|
|
|
+
|
|
|
|
+#define __LOG2_ROUNDUP(size, order) \
|
|
|
|
+ (size) <= (1 << order) ? order :
|
|
|
|
+
|
|
#define PROC_INFO \
|
|
#define PROC_INFO \
|
|
. = ALIGN(4); \
|
|
. = ALIGN(4); \
|
|
VMLINUX_SYMBOL(__proc_info_begin) = .; \
|
|
VMLINUX_SYMBOL(__proc_info_begin) = .; \
|
|
@@ -23,11 +43,20 @@
|
|
VMLINUX_SYMBOL(__idmap_text_start) = .; \
|
|
VMLINUX_SYMBOL(__idmap_text_start) = .; \
|
|
*(.idmap.text) \
|
|
*(.idmap.text) \
|
|
VMLINUX_SYMBOL(__idmap_text_end) = .; \
|
|
VMLINUX_SYMBOL(__idmap_text_end) = .; \
|
|
- . = ALIGN(32); \
|
|
|
|
|
|
+ . = ALIGN(1 << LOG2_ROUNDUP(__hyp_idmap_size)); \
|
|
VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
|
|
VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
|
|
*(.hyp.idmap.text) \
|
|
*(.hyp.idmap.text) \
|
|
VMLINUX_SYMBOL(__hyp_idmap_text_end) = .;
|
|
VMLINUX_SYMBOL(__hyp_idmap_text_end) = .;
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * If the HYP idmap .text section is populated, it needs to be positioned
|
|
|
|
+ * such that it will not cross a page boundary in the final output image.
|
|
|
|
+ * So align it to the section size rounded up to the next power of 2.
|
|
|
|
+ * If __hyp_idmap_size is undefined, the section will be empty so define
|
|
|
|
+ * it as 0 in that case.
|
|
|
|
+ */
|
|
|
|
+PROVIDE(__hyp_idmap_size = 0);
|
|
|
|
+
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
#define ARM_CPU_DISCARD(x)
|
|
#define ARM_CPU_DISCARD(x)
|
|
#define ARM_CPU_KEEP(x) x
|
|
#define ARM_CPU_KEEP(x) x
|
|
@@ -346,8 +375,11 @@ SECTIONS
|
|
*/
|
|
*/
|
|
ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
|
|
ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
|
|
ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")
|
|
ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")
|
|
|
|
+
|
|
/*
|
|
/*
|
|
- * The HYP init code can't be more than a page long.
|
|
|
|
|
|
+ * The HYP init code can't be more than a page long,
|
|
|
|
+ * and should not cross a page boundary.
|
|
* The above comment applies as well.
|
|
* The above comment applies as well.
|
|
*/
|
|
*/
|
|
-ASSERT(((__hyp_idmap_text_end - __hyp_idmap_text_start) <= PAGE_SIZE), "HYP init code too big")
|
|
|
|
|
|
+ASSERT((__hyp_idmap_text_start & ~PAGE_MASK) + __hyp_idmap_size <= PAGE_SIZE,
|
|
|
|
+ "HYP init code too big or misaligned")
|