diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-03-05 09:34:54 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:27 -0400 |
commit | 343f94fe4d16ec898da77720c03da9e09f8523d2 (patch) | |
tree | fa0180a8446a90000086593b9fa8d4d81708ddd8 /arch/ia64 | |
parent | a53c17d21c46a752f5ac6695376481bc27865b04 (diff) |
KVM: consolidate ioapic/ipi interrupt delivery logic
Use kvm_apic_match_dest() in kvm_get_intr_delivery_bitmask() instead
of duplicating the same code. Use kvm_get_intr_delivery_bitmask() in
apic_send_ipi() to figure out ipi destination instead of reimplementing
the logic.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 8 | ||||
-rw-r--r-- | arch/ia64/kvm/lapic.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 99d6d174d932..8eea9cba7b7c 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1852,6 +1852,14 @@ struct kvm_vcpu *kvm_get_lowest_prio_vcpu(struct kvm *kvm, u8 vector, | |||
1852 | return lvcpu; | 1852 | return lvcpu; |
1853 | } | 1853 | } |
1854 | 1854 | ||
1855 | int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source, | ||
1856 | int short_hand, int dest, int dest_mode) | ||
1857 | { | ||
1858 | return (dest_mode == 0) ? | ||
1859 | kvm_apic_match_physical_addr(target, dest) : | ||
1860 | kvm_apic_match_logical_addr(target, dest); | ||
1861 | } | ||
1862 | |||
1855 | static int find_highest_bits(int *dat) | 1863 | static int find_highest_bits(int *dat) |
1856 | { | 1864 | { |
1857 | u32 bits, bitnum; | 1865 | u32 bits, bitnum; |
diff --git a/arch/ia64/kvm/lapic.h b/arch/ia64/kvm/lapic.h index cbcfaa6195c7..31602e7338d7 100644 --- a/arch/ia64/kvm/lapic.h +++ b/arch/ia64/kvm/lapic.h | |||
@@ -20,6 +20,9 @@ void kvm_free_lapic(struct kvm_vcpu *vcpu); | |||
20 | 20 | ||
21 | int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest); | 21 | int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest); |
22 | int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda); | 22 | int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda); |
23 | int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source, | ||
24 | int short_hand, int dest, int dest_mode); | ||
25 | bool kvm_apic_present(struct kvm_vcpu *vcpu); | ||
23 | int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 dmode, u8 trig); | 26 | int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 dmode, u8 trig); |
24 | 27 | ||
25 | #endif | 28 | #endif |