Commit 3159d36a authored by Radim Krčmář's avatar Radim Krčmář Committed by Paolo Bonzini

KVM: x86: use generic function for MSI parsing

Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0ca52e7b
...@@ -388,21 +388,16 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, ...@@ -388,21 +388,16 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu,
kvm->arch.nr_reserved_ioapic_pins); kvm->arch.nr_reserved_ioapic_pins);
for (i = 0; i < nr_ioapic_pins; ++i) { for (i = 0; i < nr_ioapic_pins; ++i) {
hlist_for_each_entry(entry, &table->map[i], link) { hlist_for_each_entry(entry, &table->map[i], link) {
u32 dest_id, dest_mode; struct kvm_lapic_irq irq;
bool level;
if (entry->type != KVM_IRQ_ROUTING_MSI) if (entry->type != KVM_IRQ_ROUTING_MSI)
continue; continue;
dest_id = (entry->msi.address_lo >> 12) & 0xff;
dest_mode = (entry->msi.address_lo >> 2) & 0x1; kvm_set_msi_irq(entry, &irq);
level = entry->msi.data & MSI_DATA_TRIGGER_LEVEL;
if (level && kvm_apic_match_dest(vcpu, NULL, 0, if (irq.level && kvm_apic_match_dest(vcpu, NULL, 0,
dest_id, dest_mode)) { irq.dest_id, irq.dest_mode))
u32 vector = entry->msi.data & 0xff; __set_bit(irq.vector, ioapic_handled_vectors);
__set_bit(vector,
ioapic_handled_vectors);
}
} }
} }
srcu_read_unlock(&kvm->irq_srcu, idx); srcu_read_unlock(&kvm->irq_srcu, idx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment