aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-03-05 09:34:54 -0500
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:27 -0400
commit343f94fe4d16ec898da77720c03da9e09f8523d2 (patch)
treefa0180a8446a90000086593b9fa8d4d81708ddd8 /arch/ia64
parenta53c17d21c46a752f5ac6695376481bc27865b04 (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.c8
-rw-r--r--arch/ia64/kvm/lapic.h3
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
1855int 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
1855static int find_highest_bits(int *dat) 1863static 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
21int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest); 21int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest);
22int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda); 22int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda);
23int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
24 int short_hand, int dest, int dest_mode);
25bool kvm_apic_present(struct kvm_vcpu *vcpu);
23int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 dmode, u8 trig); 26int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 dmode, u8 trig);
24 27
25#endif 28#endif