aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-03-23 06:52:57 -0400
committerWill Deacon <will.deacon@arm.com>2015-03-23 07:16:50 -0400
commite60a1fec44a2fe2c85ac406a5c1161ca2957a4fa (patch)
tree9e26582a3000816875b3453c930f3895795065c0 /arch/arm/kernel
parent06f75a1f6200042aa36ad40afb44dd72107b25d6 (diff)
ARM: kvm: implement replacement for ld's LOG2CEIL()
Commit 06f75a1f6200 ("ARM, arm64: kvm: get rid of the bounce page") uses ld's builtin function LOG2CEIL() to align the KVM init code to a log2 upper bound of its size. However, this function turns out to be a fairly recent addition to binutils, which breaks the build for older toolchains. So instead, implement a replacement LOG2_ROUNDUP() using the C preprocessor. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/vmlinux.lds.S24
1 files changed, 22 insertions, 2 deletions
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index ba65f1217310..2d760df0d57d 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -11,7 +11,27 @@
11#ifdef CONFIG_ARM_KERNMEM_PERMS 11#ifdef CONFIG_ARM_KERNMEM_PERMS
12#include <asm/pgtable.h> 12#include <asm/pgtable.h>
13#endif 13#endif
14 14
15/*
16 * Poor man's version of LOG2CEIL(), which is
17 * not available in binutils before v2.24.
18 */
19#define LOG2_ROUNDUP(size) ( \
20 __LOG2_ROUNDUP(size, 2) \
21 __LOG2_ROUNDUP(size, 3) \
22 __LOG2_ROUNDUP(size, 4) \
23 __LOG2_ROUNDUP(size, 5) \
24 __LOG2_ROUNDUP(size, 6) \
25 __LOG2_ROUNDUP(size, 7) \
26 __LOG2_ROUNDUP(size, 8) \
27 __LOG2_ROUNDUP(size, 9) \
28 __LOG2_ROUNDUP(size, 10) \
29 __LOG2_ROUNDUP(size, 11) \
30 12)
31
32#define __LOG2_ROUNDUP(size, order) \
33 (size) <= (1 << order) ? order :
34
15#define PROC_INFO \ 35#define PROC_INFO \
16 . = ALIGN(4); \ 36 . = ALIGN(4); \
17 VMLINUX_SYMBOL(__proc_info_begin) = .; \ 37 VMLINUX_SYMBOL(__proc_info_begin) = .; \
@@ -23,7 +43,7 @@
23 VMLINUX_SYMBOL(__idmap_text_start) = .; \ 43 VMLINUX_SYMBOL(__idmap_text_start) = .; \
24 *(.idmap.text) \ 44 *(.idmap.text) \
25 VMLINUX_SYMBOL(__idmap_text_end) = .; \ 45 VMLINUX_SYMBOL(__idmap_text_end) = .; \
26 . = ALIGN(1 << LOG2CEIL(__hyp_idmap_size)); \ 46 . = ALIGN(1 << LOG2_ROUNDUP(__hyp_idmap_size)); \
27 VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ 47 VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
28 *(.hyp.idmap.text) \ 48 *(.hyp.idmap.text) \
29 VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; 49 VMLINUX_SYMBOL(__hyp_idmap_text_end) = .;