]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: arm64: Invoke FPSIMD context switch trap from C
authorDave Martin <Dave.Martin@arm.com>
Wed, 2 May 2018 13:18:02 +0000 (14:18 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 25 May 2018 11:28:31 +0000 (12:28 +0100)
commitcf412b0070221032c02c4564cd11dc83238b2ad2
tree7f5f01f1ab575c0bae10eaddee73e93447413850
parent7846b3119e24fe8d726535d6aa7489253797700c
KVM: arm64: Invoke FPSIMD context switch trap from C

The conversion of the FPSIMD context switch trap code to C has added
some overhead to calling it, due to the need to save registers that
the procedure call standard defines as caller-saved.

So, perhaps it is no longer worth invoking this trap handler quite
so early.

Instead, we can invoke it from fixup_guest_exit(), with little
likelihood of increasing the overhead much further.

As a convenience, this patch gives __hyp_switch_fpsimd() the same
return semantics fixup_guest_exit().  For now there is no
possibility of a spurious FPSIMD trap, so the function always
returns true, but this allows it to be tail-called with a single
return statement.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/hyp/entry.S
arch/arm64/kvm/hyp/hyp-entry.S
arch/arm64/kvm/hyp/switch.c