]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
arm64: KVM: Move lr save/restore to do_el2_call
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 3 Apr 2017 18:37:35 +0000 (19:37 +0100)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:49:18 +0000 (07:49 -0700)
At the moment, we only save/restore lr if on VHE, as we rely only
the EL1 code to have preserved it in the non-VHE case.

As we're about to get rid of the latter, let's move the save/restore
code to the do_el2_call macro, unifying both code paths.

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>
arch/arm64/kvm/hyp.S
arch/arm64/kvm/hyp/hyp-entry.S

index 2726635dceba83e306428057ae0b066f37c63877..f6f20b58d65a5873a2a1be3598cd0ad31d7a450b 100644 (file)
  * A function pointer with a value less than 0xfff has a special meaning,
  * and is used to implement __hyp_get_vectors in the same way as in
  * arch/arm64/kernel/hyp_stub.S.
- * HVC behaves as a 'bl' call and will clobber lr.
  */
 ENTRY(__kvm_call_hyp)
 alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
-       str     lr, [sp, #-16]!
        hvc     #0
-       ldr     lr, [sp], #16
        ret
 alternative_else_nop_endif
        b       __vhe_hyp_call
index 5e9052f087f289851108daf8c5521a9f2fe9c617..d8ef788646c605766d2bfd64b17b98bd790f9803 100644 (file)
         * Shuffle the parameters before calling the function
         * pointed to in x0. Assumes parameters in x[1,2,3].
         */
+       str     lr, [sp, #-16]!
        mov     lr, x0
        mov     x0, x1
        mov     x1, x2
        mov     x2, x3
        blr     lr
+       ldr     lr, [sp], #16
 .endm
 
 ENTRY(__vhe_hyp_call)
-       str     lr, [sp, #-16]!
        do_el2_call
-       ldr     lr, [sp], #16
        /*
         * We used to rely on having an exception return to get
         * an implicit isb. In the E2H case, we don't have it anymore.