ARM: hyp-stub: Zero r0 on successful stub handling
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 3 Apr 2017 18:38:06 +0000 (19:38 +0100)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:49:36 +0000 (07:49 -0700)
We now return HVC_STUB_ERR when a stub hypercall fails, but we
leave whatever was in r0 on success. Zeroing it on return seems
like a good idea.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm/kernel/hyp-stub.S
arch/arm/kvm/init.S

index 918c64f171282c0796f1cdc6d4cc9006d68a9446..d8523cc47a54633996d8e9caec5a34c3c33782ff 100644 (file)
@@ -215,8 +215,10 @@ __hyp_stub_do_trap:
        beq     __hyp_stub_exit
 
        ldr     r0, =HVC_STUB_ERR
+       __ERET
 
 __hyp_stub_exit:
+       mov     r0, #0
        __ERET
 ENDPROC(__hyp_stub_do_trap)
 
index 87bcd7ae4552b4047c81dce4fdada644c0a58300..570ed4a9c2618ba7810f96af0b106c8cfbdfd2cc 100644 (file)
@@ -155,8 +155,10 @@ reset:
        b       exit
 
 1:     ldr     r0, =HVC_STUB_ERR
+       eret
 
 exit:
+       mov     r0, #0
        eret
 ENDPROC(__kvm_handle_stub_hvc)