summaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorWill Deacon2015-03-23 12:30:32 +0100
committerWill Deacon2015-03-23 12:30:32 +0100
commit6232cfd0fa01fe392df0b18a3a06628f130b83b2 (patch)
tree468aeeedd2aed27b2d721a72b7da071ef29ace1e /arch/arm64
parentarm64: proc: remove unused cpu_get_pgd macro (diff)
parentARM: kvm: implement replacement for ld's LOG2CEIL() (diff)
downloadkernel-qcow2-linux-6232cfd0fa01fe392df0b18a3a06628f130b83b2.tar.gz
kernel-qcow2-linux-6232cfd0fa01fe392df0b18a3a06628f130b83b2.tar.xz
kernel-qcow2-linux-6232cfd0fa01fe392df0b18a3a06628f130b83b2.zip
Merge branch 'aarch64/kvm-bounce-page' into aarch64/for-next/core
Rework of the KVM HYP bounce page from Ard Biesheuvel. Subsequent arm64 idmap rework depends on this, so merge it here with Marc Zyngier's blessing (kvm-arm co-maintainer).
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kernel/vmlinux.lds.S17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 5d9d2dca530d..a2c29865c3fe 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -23,10 +23,14 @@ jiffies = jiffies_64;
#define HYPERVISOR_TEXT \
/* \
- * Force the alignment to be compatible with \
- * the vectors requirements \
+ * Align to 4 KB so that \
+ * a) the HYP vector table is at its minimum \
+ * alignment of 2048 bytes \
+ * b) the HYP init code will not cross a page \
+ * boundary if its size does not exceed \
+ * 4 KB (see related ASSERT() below) \
*/ \
- . = ALIGN(2048); \
+ . = ALIGN(SZ_4K); \
VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
*(.hyp.idmap.text) \
VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \
@@ -163,10 +167,11 @@ SECTIONS
}
/*
- * 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.
*/
-ASSERT(((__hyp_idmap_text_start + PAGE_SIZE) > __hyp_idmap_text_end),
- "HYP init code too big")
+ASSERT(__hyp_idmap_text_end - (__hyp_idmap_text_start & ~(SZ_4K - 1)) <= SZ_4K,
+ "HYP init code too big or misaligned")
/*
* If padding is applied before .head.text, virt<->phys conversions will fail.