diff options
author | Paul Mackerras <paulus@samba.org> | 2014-06-30 06:51:10 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-05 08:26:16 -0400 |
commit | 8ba918d488caded2c4368b0b922eb905fe3bb101 (patch) | |
tree | 6b14bc6c9b763e5dd7b641c902db3fd04b4d4b89 /include/linux/kvm_host.h | |
parent | 56f89f3629ffd1a21d38c3d0bea23deac0e284ce (diff) |
KVM: irqchip: Provide and use accessors for irq routing table
This provides accessor functions for the KVM interrupt mappings, in
order to reduce the amount of code that accesses the fields of the
kvm_irq_routing_table struct, and restrict that code to one file,
virt/kvm/irqchip.c. The new functions are kvm_irq_map_gsi(), which
maps from a global interrupt number to a set of IRQ routing entries,
and kvm_irq_map_chip_pin, which maps from IRQ chip and pin numbers to
a global interrupt number.
This also moves the update of kvm_irq_routing_table::chip[][]
into irqchip.c, out of the various kvm_set_routing_entry
implementations. That means that none of the kvm_set_routing_entry
implementations need the kvm_irq_routing_table argument anymore,
so this removes it.
This does not change any locking or data lifetime rules.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Tested-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 5065b953e6e8..4956149e962a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -752,6 +752,11 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, | |||
752 | void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, | 752 | void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, |
753 | bool mask); | 753 | bool mask); |
754 | 754 | ||
755 | int kvm_irq_map_gsi(struct kvm_kernel_irq_routing_entry *entries, | ||
756 | struct kvm_irq_routing_table *irq_rt, int gsi); | ||
757 | int kvm_irq_map_chip_pin(struct kvm_irq_routing_table *irq_rt, | ||
758 | unsigned irqchip, unsigned pin); | ||
759 | |||
755 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, | 760 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, |
756 | bool line_status); | 761 | bool line_status); |
757 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 762 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); |
@@ -942,8 +947,7 @@ int kvm_set_irq_routing(struct kvm *kvm, | |||
942 | const struct kvm_irq_routing_entry *entries, | 947 | const struct kvm_irq_routing_entry *entries, |
943 | unsigned nr, | 948 | unsigned nr, |
944 | unsigned flags); | 949 | unsigned flags); |
945 | int kvm_set_routing_entry(struct kvm_irq_routing_table *rt, | 950 | int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e, |
946 | struct kvm_kernel_irq_routing_entry *e, | ||
947 | const struct kvm_irq_routing_entry *ue); | 951 | const struct kvm_irq_routing_entry *ue); |
948 | void kvm_free_irq_routing(struct kvm *kvm); | 952 | void kvm_free_irq_routing(struct kvm *kvm); |
949 | 953 | ||