File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -663,8 +663,6 @@ struct kvm_vcpu_arch {
663663 struct kvm_guest_debug_arch vcpu_debug_state ;
664664 struct kvm_guest_debug_arch external_debug_state ;
665665
666- struct task_struct * parent_task ;
667-
668666 /* VGIC state */
669667 struct vgic_cpu vgic_cpu ;
670668 struct arch_timer_cpu timer_cpu ;
@@ -1262,7 +1260,6 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu);
12621260void kvm_arch_vcpu_ctxflush_fp (struct kvm_vcpu * vcpu );
12631261void kvm_arch_vcpu_ctxsync_fp (struct kvm_vcpu * vcpu );
12641262void kvm_arch_vcpu_put_fp (struct kvm_vcpu * vcpu );
1265- void kvm_vcpu_unshare_task_fp (struct kvm_vcpu * vcpu );
12661263
12671264static inline bool kvm_pmu_counter_deferred (struct perf_event_attr * attr )
12681265{
Original file line number Diff line number Diff line change 1414#include <asm/kvm_mmu.h>
1515#include <asm/sysreg.h>
1616
17- void kvm_vcpu_unshare_task_fp (struct kvm_vcpu * vcpu )
18- {
19- struct task_struct * p = vcpu -> arch .parent_task ;
20- struct user_fpsimd_state * fpsimd ;
21-
22- if (!is_protected_kvm_enabled () || !p )
23- return ;
24-
25- fpsimd = & p -> thread .uw .fpsimd_state ;
26- kvm_unshare_hyp (fpsimd , fpsimd + 1 );
27- put_task_struct (p );
28- }
29-
3017/*
3118 * Called on entry to KVM_RUN unless this vcpu previously ran at least
3219 * once and the most recent prior KVM_RUN for this vcpu was called from
@@ -38,28 +25,18 @@ void kvm_vcpu_unshare_task_fp(struct kvm_vcpu *vcpu)
3825 */
3926int kvm_arch_vcpu_run_map_fp (struct kvm_vcpu * vcpu )
4027{
41- int ret ;
42-
4328 struct user_fpsimd_state * fpsimd = & current -> thread .uw .fpsimd_state ;
29+ int ret ;
4430
45- kvm_vcpu_unshare_task_fp (vcpu );
31+ /* pKVM has its own tracking of the host fpsimd state. */
32+ if (is_protected_kvm_enabled ())
33+ return 0 ;
4634
4735 /* Make sure the host task fpsimd state is visible to hyp: */
4836 ret = kvm_share_hyp (fpsimd , fpsimd + 1 );
4937 if (ret )
5038 return ret ;
5139
52- /*
53- * We need to keep current's task_struct pinned until its data has been
54- * unshared with the hypervisor to make sure it is not re-used by the
55- * kernel and donated to someone else while already shared -- see
56- * kvm_vcpu_unshare_task_fp() for the matching put_task_struct().
57- */
58- if (is_protected_kvm_enabled ()) {
59- get_task_struct (current );
60- vcpu -> arch .parent_task = current ;
61- }
62-
6340 return 0 ;
6441}
6542
Original file line number Diff line number Diff line change @@ -151,7 +151,6 @@ void kvm_arm_vcpu_destroy(struct kvm_vcpu *vcpu)
151151{
152152 void * sve_state = vcpu -> arch .sve_state ;
153153
154- kvm_vcpu_unshare_task_fp (vcpu );
155154 kvm_unshare_hyp (vcpu , vcpu + 1 );
156155 if (sve_state )
157156 kvm_unshare_hyp (sve_state , sve_state + vcpu_sve_state_size (vcpu ));
You can’t perform that action at this time.
0 commit comments