Skip to content

Commit

Permalink
KVM: x86: fix APIC physical destination wrapping
Browse files Browse the repository at this point in the history
x2apic allows destinations > 0xff and we don't want them delivered to
lower APICs.  They are correctly handled by doing nothing.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Radim Krčmář authored and Paolo Bonzini committed Dec 4, 2014
1 parent 085563f commit fa834e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/x86/kvm/lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
ret = true;

if (irq->dest_mode == 0) { /* physical mode */
dst = &map->phys_map[irq->dest_id & 0xff];
if (irq->dest_id >= ARRAY_SIZE(map->phys_map))
goto out;

dst = &map->phys_map[irq->dest_id];
} else {
u32 mda = irq->dest_id << (32 - map->ldr_bits);

Expand Down

0 comments on commit fa834e9

Please sign in to comment.