summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorSteve Rutherford <srutherford@google.com>2015-07-30 02:32:35 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2015-10-01 09:06:28 -0400
commitb053b2aef25d00773fa6762dcd4b7f5c9c42d171 (patch)
tree49455d15fd99d802135fed0d197989c3e7a2b62b /virt
parent7543a635aa09eb138b2cbf60ac3ff19503ae6954 (diff)
KVM: x86: Add EOI exit bitmap inference
In order to support a userspace IOAPIC interacting with an in kernel APIC, the EOI exit bitmaps need to be configurable. If the IOAPIC is in userspace (i.e. the irqchip has been split), the EOI exit bitmaps will be set whenever the GSI Routes are configured. In particular, for the low MSI routes are reservable for userspace IOAPICs. For these MSI routes, the EOI Exit bit corresponding to the destination vector of the route will be set for the destination VCPU. The intention is for the userspace IOAPICs to use the reservable MSI routes to inject interrupts into the guest. This is a slight abuse of the notion of an MSI Route, given that MSIs classically bypass the IOAPIC. It might be worthwhile to add an additional route type to improve clarity. Compile tested for Intel x86. Signed-off-by: Steve Rutherford <srutherford@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/irqchip.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c
index d7ea8e20dae4..716a1c4db528 100644
--- a/virt/kvm/irqchip.c
+++ b/virt/kvm/irqchip.c
@@ -31,16 +31,6 @@
31#include <trace/events/kvm.h> 31#include <trace/events/kvm.h>
32#include "irq.h" 32#include "irq.h"
33 33
34struct kvm_irq_routing_table {
35 int chip[KVM_NR_IRQCHIPS][KVM_IRQCHIP_NUM_PINS];
36 u32 nr_rt_entries;
37 /*
38 * Array indexed by gsi. Each entry contains list of irq chips
39 * the gsi is connected to.
40 */
41 struct hlist_head map[0];
42};
43
44int kvm_irq_map_gsi(struct kvm *kvm, 34int kvm_irq_map_gsi(struct kvm *kvm,
45 struct kvm_kernel_irq_routing_entry *entries, int gsi) 35 struct kvm_kernel_irq_routing_entry *entries, int gsi)
46{ 36{
@@ -231,6 +221,8 @@ int kvm_set_irq_routing(struct kvm *kvm,
231 kvm_irq_routing_update(kvm); 221 kvm_irq_routing_update(kvm);
232 mutex_unlock(&kvm->irq_lock); 222 mutex_unlock(&kvm->irq_lock);
233 223
224 kvm_arch_irq_routing_update(kvm);
225
234 synchronize_srcu_expedited(&kvm->irq_srcu); 226 synchronize_srcu_expedited(&kvm->irq_srcu);
235 227
236 new = old; 228 new = old;