aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2009-02-11 03:03:40 -0500
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:22 -0400
commitbfd349d073b2838a6a031f057d25e266619b7093 (patch)
treeb2b2f2f3f99a7e860fb7bb7c54ce322700055ebd /arch/x86/kvm/lapic.c
parent110c2faeba1f1994bcb1de55b9c31f4147dbfdb6 (diff)
KVM: bit ops for deliver_bitmap
It's also convenient when we extend KVM supported vcpu number in the future. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 6aa8d20f9eeb..afc59b2e7e02 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -483,9 +483,10 @@ static void apic_send_ipi(struct kvm_lapic *apic)
483 483
484 struct kvm_vcpu *target; 484 struct kvm_vcpu *target;
485 struct kvm_vcpu *vcpu; 485 struct kvm_vcpu *vcpu;
486 unsigned long lpr_map = 0; 486 DECLARE_BITMAP(lpr_map, KVM_MAX_VCPUS);
487 int i; 487 int i;
488 488
489 bitmap_zero(lpr_map, KVM_MAX_VCPUS);
489 apic_debug("icr_high 0x%x, icr_low 0x%x, " 490 apic_debug("icr_high 0x%x, icr_low 0x%x, "
490 "short_hand 0x%x, dest 0x%x, trig_mode 0x%x, level 0x%x, " 491 "short_hand 0x%x, dest 0x%x, trig_mode 0x%x, level 0x%x, "
491 "dest_mode 0x%x, delivery_mode 0x%x, vector 0x%x\n", 492 "dest_mode 0x%x, delivery_mode 0x%x, vector 0x%x\n",
@@ -500,7 +501,7 @@ static void apic_send_ipi(struct kvm_lapic *apic)
500 if (vcpu->arch.apic && 501 if (vcpu->arch.apic &&
501 apic_match_dest(vcpu, apic, short_hand, dest, dest_mode)) { 502 apic_match_dest(vcpu, apic, short_hand, dest, dest_mode)) {
502 if (delivery_mode == APIC_DM_LOWEST) 503 if (delivery_mode == APIC_DM_LOWEST)
503 set_bit(vcpu->vcpu_id, &lpr_map); 504 __set_bit(vcpu->vcpu_id, lpr_map);
504 else 505 else
505 __apic_accept_irq(vcpu->arch.apic, delivery_mode, 506 __apic_accept_irq(vcpu->arch.apic, delivery_mode,
506 vector, level, trig_mode); 507 vector, level, trig_mode);
@@ -508,7 +509,7 @@ static void apic_send_ipi(struct kvm_lapic *apic)
508 } 509 }
509 510
510 if (delivery_mode == APIC_DM_LOWEST) { 511 if (delivery_mode == APIC_DM_LOWEST) {
511 target = kvm_get_lowest_prio_vcpu(vcpu->kvm, vector, &lpr_map); 512 target = kvm_get_lowest_prio_vcpu(vcpu->kvm, vector, lpr_map);
512 if (target != NULL) 513 if (target != NULL)
513 __apic_accept_irq(target->arch.apic, delivery_mode, 514 __apic_accept_irq(target->arch.apic, delivery_mode,
514 vector, level, trig_mode); 515 vector, level, trig_mode);