summaryrefslogtreecommitdiff
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-04-03 21:37:57 +0300
committerChristoffer Dall <cdall@linaro.org>2017-04-09 17:49:30 +0300
commit4d5f9c14fb638cbe36795cb4b8a0b05ceba0a526 (patch)
treeaec1df94826f6ed1e72e58a8ac7055a78a7fdcb1 /arch/arm/kvm
parenta92ce8f6ab6cb16006f8d73cb0f522079276fd91 (diff)
downloadlinux-4d5f9c14fb638cbe36795cb4b8a0b05ceba0a526.tar.xz
ARM: KVM: Implement HVC_SOFT_RESTART in the init code
Another missing stub hypercall is HVC_SOFT_RESTART. It turns out that it is pretty easy to implement in terms of HVC_RESET_VECTORS (since it needs to turn the MMU off). Tested-by: Keerthy <j-keerthy@ti.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/init.S14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S
index fb336090ee9c..e53360dceb19 100644
--- a/arch/arm/kvm/init.S
+++ b/arch/arm/kvm/init.S
@@ -127,8 +127,22 @@ ENTRY(__kvm_handle_stub_hvc)
mrc p15, 4, r0, c12, c0, 0 @ get HVBAR
b exit
+1: cmp r0, #HVC_SOFT_RESTART
+ bne 1f
+
+ /* The target is expected in r1 */
+ msr ELR_hyp, r1
+ mrs r0, cpsr
+ bic r0, r0, #MODE_MASK
+ orr r0, r0, #HYP_MODE
+THUMB( orr r0, r0, #PSR_T_BIT )
+ msr spsr_cxsf, r0
+ b reset
+
1: cmp r0, #HVC_RESET_VECTORS
bne 1f
+
+reset:
/* We're now in idmap, disable MMU */
mrc p15, 4, r1, c1, c0, 0 @ HSCTLR
ldr r0, =(HSCTLR_M | HSCTLR_A | HSCTLR_C | HSCTLR_I)