diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2015-10-28 13:59:46 +0000 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-02-29 18:34:17 +0000 |
commit | d1526e5efc3978efe8c9c37a2396d91e4702251b (patch) | |
tree | f341231253ab3275da755caa2e4fafef6edc950c /arch/arm64/kvm/hyp | |
parent | 094f8233c0da602712e8a206984431026a1530aa (diff) |
arm64: KVM: VHE: Enable minimal sysreg save/restore
We're now in a position where we can introduce VHE's minimal
save/restore, which is limited to the handful of shared sysregs.
Add the required alternative function calls that result in a
"do nothing" call on VHE, and the normal save/restore for non-VHE.
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/kvm/hyp')
-rw-r--r-- | arch/arm64/kvm/hyp/sysreg-sr.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/arm64/kvm/hyp/sysreg-sr.c b/arch/arm64/kvm/hyp/sysreg-sr.c index 7d7d75732a62..74b5f81678c2 100644 --- a/arch/arm64/kvm/hyp/sysreg-sr.c +++ b/arch/arm64/kvm/hyp/sysreg-sr.c @@ -23,6 +23,9 @@ #include "hyp.h" +/* Yes, this does nothing, on purpose */ +static void __hyp_text __sysreg_do_nothing(struct kvm_cpu_context *ctxt) { } + /* * Non-VHE: Both host and guest must save everything. * @@ -67,9 +70,13 @@ static void __hyp_text __sysreg_save_state(struct kvm_cpu_context *ctxt) ctxt->gp_regs.spsr[KVM_SPSR_EL1]= read_sysreg_el1(spsr); } +static hyp_alternate_select(__sysreg_call_save_host_state, + __sysreg_save_state, __sysreg_do_nothing, + ARM64_HAS_VIRT_HOST_EXTN); + void __hyp_text __sysreg_save_host_state(struct kvm_cpu_context *ctxt) { - __sysreg_save_state(ctxt); + __sysreg_call_save_host_state()(ctxt); __sysreg_save_common_state(ctxt); } @@ -116,9 +123,13 @@ static void __hyp_text __sysreg_restore_state(struct kvm_cpu_context *ctxt) write_sysreg_el1(ctxt->gp_regs.spsr[KVM_SPSR_EL1],spsr); } +static hyp_alternate_select(__sysreg_call_restore_host_state, + __sysreg_restore_state, __sysreg_do_nothing, + ARM64_HAS_VIRT_HOST_EXTN); + void __hyp_text __sysreg_restore_host_state(struct kvm_cpu_context *ctxt) { - __sysreg_restore_state(ctxt); + __sysreg_call_restore_host_state()(ctxt); __sysreg_restore_common_state(ctxt); } |