diff options
author | Marc Zyngier <maz@kernel.org> | 2021-10-21 14:10:35 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2021-11-22 16:01:39 +0000 |
commit | af9a0e21d817f40595aa629de32d3bd96582abef (patch) | |
tree | fab798e1543e59ab9275a9b6e3916c6a8dca643b /arch/arm64/kvm/fpsimd.c | |
parent | e66425fc9ba33e9716d6e7c6bc78bb62f981d4df (diff) | |
download | linux-af9a0e21d817f40595aa629de32d3bd96582abef.tar.gz linux-af9a0e21d817f40595aa629de32d3bd96582abef.tar.bz2 linux-af9a0e21d817f40595aa629de32d3bd96582abef.zip |
KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE
We currently have to maintain a mapping the thread_info structure
at EL2 in order to be able to check the TIF_FOREIGN_FPSTATE flag.
In order to eventually get rid of this, start with a vcpu flag that
shadows the thread flag on each entry into the hypervisor.
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/fpsimd.c')
-rw-r--r-- | arch/arm64/kvm/fpsimd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/kvm/fpsimd.c b/arch/arm64/kvm/fpsimd.c index 2d15e1d6e214..a18b9c1744d5 100644 --- a/arch/arm64/kvm/fpsimd.c +++ b/arch/arm64/kvm/fpsimd.c @@ -79,6 +79,14 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu) vcpu->arch.flags |= KVM_ARM64_HOST_SVE_ENABLED; } +void kvm_arch_vcpu_ctxflush_fp(struct kvm_vcpu *vcpu) +{ + if (test_thread_flag(TIF_FOREIGN_FPSTATE)) + vcpu->arch.flags |= KVM_ARM64_FP_FOREIGN_FPSTATE; + else + vcpu->arch.flags &= ~KVM_ARM64_FP_FOREIGN_FPSTATE; +} + /* * If the guest FPSIMD state was loaded, update the host's context * tracking data mark the CPU FPSIMD regs as dirty and belonging to vcpu |