Re: AVIC related warning in enable_irq_window

From: Suravee Suthikulpanit
Date: Tue May 05 2020 - 20:43:11 EST




On 5/5/20 7:12 PM, Paolo Bonzini wrote:
On 05/05/20 09:55, Suravee Suthikulpanit wrote:
On the other hand, would be it useful to implement
kvm_make_all_cpus_request_but_self(),
which sends request to all other vcpus excluding itself?

Yes, that's also a possibility. It's not too much extra complication if
we add a new argument to kvm_make_vcpus_request_mask, like this:

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 74bdb7bf3295..8f9dadb1ef42 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -258,7 +258,7 @@ static inline bool kvm_kick_many_cpus(const struct cpumask *cpus, bool wait)
return true;
}
-bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req,
+bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req, struct kvm_vcpu *except,
unsigned long *vcpu_bitmap, cpumask_var_t tmp)
{
int i, cpu, me;
@@ -270,6 +270,8 @@ bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req,
kvm_for_each_vcpu(i, vcpu, kvm) {
if (vcpu_bitmap && !test_bit(i, vcpu_bitmap))
continue;
+ if (vcpu == except)
+ continue;
kvm_make_request(req, vcpu);
cpu = vcpu->cpu;


Paolo


Sounds good. I'll take care of this today.

Suravee