Commit 910917bb authored by Marc Zyngier's avatar Marc Zyngier

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: default avatarMarc Zyngier <marc.zyngier@arm.com>
Acked-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
parent 044ac37d
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <asm/kvm_emulate.h> #include <asm/kvm_emulate.h>
#include <asm/kvm_coproc.h> #include <asm/kvm_coproc.h>
#include <asm/kvm_psci.h> #include <asm/kvm_psci.h>
#include <asm/sections.h>
#ifdef REQUIRES_VIRT #ifdef REQUIRES_VIRT
__asm__(".arch_extension virt"); __asm__(".arch_extension virt");
...@@ -1068,6 +1069,12 @@ static int init_hyp_mode(void) ...@@ -1068,6 +1069,12 @@ static int init_hyp_mode(void)
goto out_free_mappings; 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 * Map the Hyp stack pages
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment