aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/lapic.c
diff options
context:
space:
mode:
authorQing He <qing.he@intel.com>2007-09-24 05:39:41 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:52 -0500
commite4d47f404b59adf22f639fedc943db99f090f9ee (patch)
treef9a4912f78242055d7a40f18f0f4887db36619fe /drivers/kvm/lapic.c
parent313a3dc75da20630e549441932a7654223f8d72a (diff)
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>
Diffstat (limited to 'drivers/kvm/lapic.c')
-rw-r--r--drivers/kvm/lapic.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/kvm/lapic.c b/drivers/kvm/lapic.c
index e15b42e48862..8840f9dc0bca 100644
--- a/drivers/kvm/lapic.c
+++ b/drivers/kvm/lapic.c
@@ -395,10 +395,9 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
395struct kvm_lapic *kvm_apic_round_robin(struct kvm *kvm, u8 vector, 395struct kvm_lapic *kvm_apic_round_robin(struct kvm *kvm, u8 vector,
396 unsigned long bitmap) 396 unsigned long bitmap)
397{ 397{
398 int vcpu_id;
399 int last; 398 int last;
400 int next; 399 int next;
401 struct kvm_lapic *apic; 400 struct kvm_lapic *apic = NULL;
402 401
403 last = kvm->round_robin_prev_vcpu; 402 last = kvm->round_robin_prev_vcpu;
404 next = last; 403 next = last;
@@ -415,14 +414,8 @@ struct kvm_lapic *kvm_apic_round_robin(struct kvm *kvm, u8 vector,
415 } while (next != last); 414 } while (next != last);
416 kvm->round_robin_prev_vcpu = next; 415 kvm->round_robin_prev_vcpu = next;
417 416
418 if (!apic) { 417 if (!apic)
419 vcpu_id = ffs(bitmap) - 1; 418 printk(KERN_DEBUG "vcpu not ready for apic_round_robin\n");
420 if (vcpu_id < 0) {
421 vcpu_id = 0;
422 printk(KERN_DEBUG "vcpu not ready for apic_round_robin\n");
423 }
424 apic = kvm->vcpus[vcpu_id]->apic;
425 }
426 419
427 return apic; 420 return apic;
428} 421}