arm64: KVM: Optimize __guest_enter/exit() to save a few instructions
authorShanker Donthineni <shankerd@codeaurora.org>
Wed, 31 Aug 2016 02:08:32 +0000 (21:08 -0500)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 8 Sep 2016 10:53:00 +0000 (12:53 +0200)
commit68381b2b00f728a6c910e777bd62986c951323a3
tree7cb8545925f173dc1968a519390237e11847fa01
parent1fe0009833892f950d6955b8c77c5b00e7700802
arm64: KVM: Optimize __guest_enter/exit() to save a few instructions

We are doing an unnecessary stack push/pop operation when restoring
the guest registers x0-x18 in __guest_enter(). This patch saves the
two instructions by using x18 as a base register. No need to store
the vcpu context pointer in stack because it is redundant, the same
information is available in tpidr_el2. The function __guest_exit()
calling convention is slightly modified, caller only pushes the regs
x0-x1 to stack instead of regs x0-x3.

Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/kvm/hyp/entry.S
arch/arm64/kvm/hyp/hyp-entry.S