diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2015-10-27 12:18:48 +0000 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2017-06-05 14:27:02 +0530 |
commit | 100b59d5882c800ca149480251ea7aa0b64099b8 (patch) | |
tree | 19b007889de9fc41858f14642b0677d45529ddec | |
parent | ff1aa4b91e8a51d16cd57630442e4b75ac0f1eb8 (diff) | |
download | linaro-android-100b59d5882c800ca149480251ea7aa0b64099b8.tar.gz |
UPSTREAM: 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>
(cherry picked from commit 910917bb7db070cc67557a6b3c8fcceaa5c398a7)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r-- | arch/arm/kvm/arm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index c17cb14f368b..38cd0ce89fb8 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"); @@ -1066,6 +1067,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 */ |