diff options
Diffstat (limited to 'arch/arm64/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/arm64/kernel/vmlinux.lds.S | 17 |
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; | |||
23 | 23 | ||
24 | #define HYPERVISOR_TEXT \ | 24 | #define HYPERVISOR_TEXT \ |
25 | /* \ | 25 | /* \ |
26 | * Force the alignment to be compatible with \ | 26 | * Align to 4 KB so that \ |
27 | * the vectors requirements \ | 27 | * a) the HYP vector table is at its minimum \ |
28 | * alignment of 2048 bytes \ | ||
29 | * b) the HYP init code will not cross a page \ | ||
30 | * boundary if its size does not exceed \ | ||
31 | * 4 KB (see related ASSERT() below) \ | ||
28 | */ \ | 32 | */ \ |
29 | . = ALIGN(2048); \ | 33 | . = ALIGN(SZ_4K); \ |
30 | VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ | 34 | VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ |
31 | *(.hyp.idmap.text) \ | 35 | *(.hyp.idmap.text) \ |
32 | VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \ | 36 | VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \ |
@@ -163,10 +167,11 @@ SECTIONS | |||
163 | } | 167 | } |
164 | 168 | ||
165 | /* | 169 | /* |
166 | * The HYP init code can't be more than a page long. | 170 | * The HYP init code can't be more than a page long, |
171 | * and should not cross a page boundary. | ||
167 | */ | 172 | */ |
168 | ASSERT(((__hyp_idmap_text_start + PAGE_SIZE) > __hyp_idmap_text_end), | 173 | ASSERT(__hyp_idmap_text_end - (__hyp_idmap_text_start & ~(SZ_4K - 1)) <= SZ_4K, |
169 | "HYP init code too big") | 174 | "HYP init code too big or misaligned") |
170 | 175 | ||
171 | /* | 176 | /* |
172 | * If padding is applied before .head.text, virt<->phys conversions will fail. | 177 | * If padding is applied before .head.text, virt<->phys conversions will fail. |