KVM: apic round robin cleanup
If no apic is enabled in the bitmap of an interrupt delivery with delivery mode of lowest priority, a warning should be reported rather than select a fallback vcpu Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Eddie (Yaozu) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
@@ -395,10 +395,9 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
|
|||||||
struct kvm_lapic *kvm_apic_round_robin(struct kvm *kvm, u8 vector,
|
struct kvm_lapic *kvm_apic_round_robin(struct kvm *kvm, u8 vector,
|
||||||
unsigned long bitmap)
|
unsigned long bitmap)
|
||||||
{
|
{
|
||||||
int vcpu_id;
|
|
||||||
int last;
|
int last;
|
||||||
int next;
|
int next;
|
||||||
struct kvm_lapic *apic;
|
struct kvm_lapic *apic = NULL;
|
||||||
|
|
||||||
last = kvm->round_robin_prev_vcpu;
|
last = kvm->round_robin_prev_vcpu;
|
||||||
next = last;
|
next = last;
|
||||||
@@ -415,14 +414,8 @@ struct kvm_lapic *kvm_apic_round_robin(struct kvm *kvm, u8 vector,
|
|||||||
} while (next != last);
|
} while (next != last);
|
||||||
kvm->round_robin_prev_vcpu = next;
|
kvm->round_robin_prev_vcpu = next;
|
||||||
|
|
||||||
if (!apic) {
|
if (!apic)
|
||||||
vcpu_id = ffs(bitmap) - 1;
|
|
||||||
if (vcpu_id < 0) {
|
|
||||||
vcpu_id = 0;
|
|
||||||
printk(KERN_DEBUG "vcpu not ready for apic_round_robin\n");
|
printk(KERN_DEBUG "vcpu not ready for apic_round_robin\n");
|
||||||
}
|
|
||||||
apic = kvm->vcpus[vcpu_id]->apic;
|
|
||||||
}
|
|
||||||
|
|
||||||
return apic;
|
return apic;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user