Merge branch kvm-arm64/fpsimd-tracking into kvmarm-master/next
authorMarc Zyngier <maz@kernel.org>
Wed, 1 Dec 2021 12:13:44 +0000 (12:13 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 1 Dec 2021 12:13:44 +0000 (12:13 +0000)
* kvm-arm64/fpsimd-tracking:
  : .
  : Simplify the handling of both the FP/SIMD and SVE state by
  : removing the need for mapping the thread at EL2, and by
  : dropping the tracking of the host's SVE state which is
  : always invalid by construction.
  : .
  arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM
  KVM: arm64: Stop mapping current thread_info at EL2
  KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE
  KVM: arm64: Remove unused __sve_save_state
  KVM: arm64: Get rid of host SVE tracking/saving
  KVM: arm64: Reorder vcpu flag definitions

Signed-off-by: Marc Zyngier <maz@kernel.org>
1  2 
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/fpsimd.c

Simple merge
Simple merge
@@@ -28,24 -27,26 +27,13 @@@ int kvm_arch_vcpu_run_map_fp(struct kvm
  {
        int ret;
  
-       struct thread_info *ti = &current->thread_info;
        struct user_fpsimd_state *fpsimd = &current->thread.uw.fpsimd_state;
  
-       /*
-        * Make sure the host task thread flags and fpsimd state are
-        * visible to hyp:
-        */
-       ret = create_hyp_mappings(ti, ti + 1, PAGE_HYP);
-       if (ret)
-               goto error;
+       /* Make sure the host task fpsimd state is visible to hyp: */
        ret = create_hyp_mappings(fpsimd, fpsimd + 1, PAGE_HYP);
--      if (ret)
--              goto error;
++      if (!ret)
++              vcpu->arch.host_fpsimd_state = kern_hyp_va(fpsimd);
  
-       vcpu->arch.host_thread_info = kern_hyp_va(ti);
 -      if (vcpu->arch.sve_state) {
 -              void *sve_end;
 -
 -              sve_end = vcpu->arch.sve_state + vcpu_sve_state_size(vcpu);
 -
 -              ret = create_hyp_mappings(vcpu->arch.sve_state, sve_end,
 -                                        PAGE_HYP);
 -              if (ret)
 -                      goto error;
 -      }
 -
--      vcpu->arch.host_fpsimd_state = kern_hyp_va(fpsimd);
--error:
        return ret;
  }