Skip to content

Commit 82e9c84

Browse files
vsrinivassean-jc
authored andcommitted
KVM: Remove kvm_make_all_cpus_request_except()
Remove kvm_make_all_cpus_request_except() as it effectively has no users, and arguably should never have been added in the first place. Commit 54163a3 ("KVM: Introduce kvm_make_all_cpus_request_except()") added the "except" variation for use in SVM's AVIC update path, which used it to skip sending a request to the current vCPU (commit 7d61123 ("KVM: SVM: Disable AVIC before setting V_IRQ")). But the AVIC usage of kvm_make_all_cpus_request_except() was essentially a hack-a-fix that simply squashed the most likely scenario of a racy WARN without addressing the underlying problem(s). Commit f1577ab ("KVM: SVM: svm_set_vintr don't warn if AVIC is active but is about to be deactivated") eventually fixed the WARN itself, and the "except" usage was subsequently dropped by df63202 ("KVM: x86: APICv: drop immediate APICv disablement on current vCPU"). That kvm_make_all_cpus_request_except() hasn't gained any users in the last ~3 years isn't a coincidence. If a VM-wide broadcast *needs* to skip the current vCPU, then odds are very good that there is underlying bug that could be better fixed elsewhere. Signed-off-by: Venkatesh Srinivas <[email protected]> Link: https://lore.kernel.org/r/[email protected] [sean: rewrite changelog with --verbose] Signed-off-by: Sean Christopherson <[email protected]>
1 parent f588557 commit 82e9c84

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

include/linux/kvm_host.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ static inline bool is_error_page(struct page *page)
193193
bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req,
194194
unsigned long *vcpu_bitmap);
195195
bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req);
196-
bool kvm_make_all_cpus_request_except(struct kvm *kvm, unsigned int req,
197-
struct kvm_vcpu *except);
198196

199197
#define KVM_USERSPACE_IRQ_SOURCE_ID 0
200198
#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1

virt/kvm/kvm_main.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,7 @@ bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req,
311311
return called;
312312
}
313313

314-
bool kvm_make_all_cpus_request_except(struct kvm *kvm, unsigned int req,
315-
struct kvm_vcpu *except)
314+
bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req)
316315
{
317316
struct kvm_vcpu *vcpu;
318317
struct cpumask *cpus;
@@ -325,22 +324,14 @@ bool kvm_make_all_cpus_request_except(struct kvm *kvm, unsigned int req,
325324
cpus = this_cpu_cpumask_var_ptr(cpu_kick_mask);
326325
cpumask_clear(cpus);
327326

328-
kvm_for_each_vcpu(i, vcpu, kvm) {
329-
if (vcpu == except)
330-
continue;
327+
kvm_for_each_vcpu(i, vcpu, kvm)
331328
kvm_make_vcpu_request(vcpu, req, cpus, me);
332-
}
333329

334330
called = kvm_kick_many_cpus(cpus, !!(req & KVM_REQUEST_WAIT));
335331
put_cpu();
336332

337333
return called;
338334
}
339-
340-
bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req)
341-
{
342-
return kvm_make_all_cpus_request_except(kvm, req, NULL);
343-
}
344335
EXPORT_SYMBOL_GPL(kvm_make_all_cpus_request);
345336

346337
void kvm_flush_remote_tlbs(struct kvm *kvm)

0 commit comments

Comments
 (0)