From: Marc Zyngier Date: Wed, 1 Dec 2021 12:13:44 +0000 (+0000) Subject: Merge branch kvm-arm64/fpsimd-tracking into kvmarm-master/next X-Git-Tag: v5.17-rc1~69^2~50^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d761dbf7ff48b7eca4486658c5995b9669bcbbc;p=thirdparty%2Fkernel%2Flinux.git Merge branch kvm-arm64/fpsimd-tracking into kvmarm-master/next * 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 --- 2d761dbf7ff48b7eca4486658c5995b9669bcbbc diff --cc arch/arm64/kvm/fpsimd.c index 62c0d78da7bee,b5b59b9f2eff6..5526d79c7b479 --- a/arch/arm64/kvm/fpsimd.c +++ b/arch/arm64/kvm/fpsimd.c @@@ -28,24 -27,26 +27,13 @@@ int kvm_arch_vcpu_run_map_fp(struct kvm { int ret; - struct thread_info *ti = ¤t->thread_info; struct user_fpsimd_state *fpsimd = ¤t->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; }