summaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/arm.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-10-27 12:18:48 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2015-12-14 11:30:43 +0000
commit910917bb7db070cc67557a6b3c8fcceaa5c398a7 (patch)
tree86716f40661c3a9a503a0a47b398169d6eb77e46 /arch/arm/kvm/arm.c
parent044ac37d1281fc7b59d5dce4fe979a99369e95f2 (diff)
downloadlinux-910917bb7db070cc67557a6b3c8fcceaa5c398a7.tar.gz
linux-910917bb7db070cc67557a6b3c8fcceaa5c398a7.tar.bz2
linux-910917bb7db070cc67557a6b3c8fcceaa5c398a7.zip
arm64: KVM: Map the kernel RO section into HYP
In order to run C code in HYP, we must make sure that the kernel's RO section is mapped into HYP (otherwise things break badly). Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm/arm.c')
-rw-r--r--arch/arm/kvm/arm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 8a79a5729487..6e35d1d7893e 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -44,6 +44,7 @@
#include <asm/kvm_emulate.h>
#include <asm/kvm_coproc.h>
#include <asm/kvm_psci.h>
+#include <asm/sections.h>
#ifdef REQUIRES_VIRT
__asm__(".arch_extension virt");
@@ -1068,6 +1069,12 @@ static int init_hyp_mode(void)
goto out_free_mappings;
}
+ err = create_hyp_mappings(__start_rodata, __end_rodata);
+ if (err) {
+ kvm_err("Cannot map rodata section\n");
+ goto out_free_mappings;
+ }
+
/*
* Map the Hyp stack pages
*/