]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Drop FP_FOREIGN_STATE from the hypervisor code
authorMarc Zyngier <maz@kernel.org>
Sat, 28 May 2022 11:38:13 +0000 (12:38 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 9 Jun 2022 11:01:51 +0000 (12:01 +0100)
commit4bf1377f510cc98dcda300ec78799e35fe593647
treee2f62c62cd25be94baf99f4cc23e5752bd9c0344
parentabc31d76ad1f30c29e534797aaba7de63546e516
KVM: arm64: Drop FP_FOREIGN_STATE from the hypervisor code

The vcpu KVM_ARM64_FP_FOREIGN_FPSTATE flag tracks the thread's own
TIF_FOREIGN_FPSTATE so that we can evaluate just before running
the vcpu whether it the FP regs contain something that is owned
by the vcpu or not by updating the rest of the FP flags.

We do this in the hypervisor code in order to make sure we're
in a context where we are not interruptible. But we already
have a hook in the run loop to generate this flag. We may as
well update the FP flags directly and save the pointless flag
tracking.

Whilst we're at it, rename update_fp_enabled() to guest_owns_fp_regs()
to indicate what the leftover of this helper actually do.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Reiji Watanabe <reijiw@google.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/fpsimd.c
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/hyp/nvhe/switch.c
arch/arm64/kvm/hyp/vhe/switch.c