File tree Expand file tree Collapse file tree 4 files changed +3
-19
lines changed Expand file tree Collapse file tree 4 files changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -254,20 +254,6 @@ void kvm_pmu_vcpu_init(struct kvm_vcpu *vcpu)
254254 pmu -> pmc [i ].idx = i ;
255255}
256256
257- /**
258- * kvm_pmu_vcpu_reset - reset pmu state for cpu
259- * @vcpu: The vcpu pointer
260- *
261- */
262- void kvm_pmu_vcpu_reset (struct kvm_vcpu * vcpu )
263- {
264- unsigned long mask = kvm_pmu_implemented_counter_mask (vcpu );
265- int i ;
266-
267- for_each_set_bit (i , & mask , 32 )
268- kvm_pmu_stop_counter (kvm_vcpu_idx_to_pmc (vcpu , i ));
269- }
270-
271257/**
272258 * kvm_pmu_vcpu_destroy - free perf event of PMU for cpu
273259 * @vcpu: The vcpu pointer
Original file line number Diff line number Diff line change @@ -196,9 +196,6 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
196196 vcpu -> arch .reset_state .reset = false;
197197 spin_unlock (& vcpu -> arch .mp_state_lock );
198198
199- /* Reset PMU outside of the non-preemptible section */
200- kvm_pmu_vcpu_reset (vcpu );
201-
202199 preempt_disable ();
203200 loaded = (vcpu -> cpu != -1 );
204201 if (loaded )
Original file line number Diff line number Diff line change @@ -4480,6 +4480,9 @@ void kvm_reset_sys_regs(struct kvm_vcpu *vcpu)
44804480 }
44814481
44824482 set_bit (KVM_ARCH_FLAG_ID_REGS_INITIALIZED , & kvm -> arch .flags );
4483+
4484+ if (kvm_vcpu_has_pmu (vcpu ))
4485+ kvm_make_request (KVM_REQ_RELOAD_PMU , vcpu );
44834486}
44844487
44854488/**
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ u64 kvm_pmu_implemented_counter_mask(struct kvm_vcpu *vcpu);
5252u64 kvm_pmu_accessible_counter_mask (struct kvm_vcpu * vcpu );
5353u64 kvm_pmu_get_pmceid (struct kvm_vcpu * vcpu , bool pmceid1 );
5454void kvm_pmu_vcpu_init (struct kvm_vcpu * vcpu );
55- void kvm_pmu_vcpu_reset (struct kvm_vcpu * vcpu );
5655void kvm_pmu_vcpu_destroy (struct kvm_vcpu * vcpu );
5756void kvm_pmu_reprogram_counter_mask (struct kvm_vcpu * vcpu , u64 val );
5857void kvm_pmu_flush_hwstate (struct kvm_vcpu * vcpu );
@@ -127,7 +126,6 @@ static inline u64 kvm_pmu_accessible_counter_mask(struct kvm_vcpu *vcpu)
127126 return 0 ;
128127}
129128static inline void kvm_pmu_vcpu_init (struct kvm_vcpu * vcpu ) {}
130- static inline void kvm_pmu_vcpu_reset (struct kvm_vcpu * vcpu ) {}
131129static inline void kvm_pmu_vcpu_destroy (struct kvm_vcpu * vcpu ) {}
132130static inline void kvm_pmu_reprogram_counter_mask (struct kvm_vcpu * vcpu , u64 val ) {}
133131static inline void kvm_pmu_flush_hwstate (struct kvm_vcpu * vcpu ) {}
You can’t perform that action at this time.
0 commit comments