From 3889c3fab10b63e170ab5193d2ce6be99a704e93 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 26 Jul 2012 15:35:12 +0100 Subject: kvm: Rename kvm_irqchip_set_irq() to kvm_set_irq() Rename the function kvm_irqchip_set_irq() to kvm_set_irq(), since it can be used for sending (asynchronous) interrupts whether there is a full irqchip model in the kernel or not. (We don't include 'async' in the function name since asynchronous is the normal case.) Signed-off-by: Peter Maydell Signed-off-by: Avi Kivity --- hw/kvm/i8259.c | 2 +- hw/kvm/ioapic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/kvm/i8259.c b/hw/kvm/i8259.c index 94d1b9aa95..1e24cd4f36 100644 --- a/hw/kvm/i8259.c +++ b/hw/kvm/i8259.c @@ -94,7 +94,7 @@ static void kvm_pic_set_irq(void *opaque, int irq, int level) { int delivered; - delivered = kvm_irqchip_set_irq(kvm_state, irq, level); + delivered = kvm_set_irq(kvm_state, irq, level); apic_report_irq_delivered(delivered); } diff --git a/hw/kvm/ioapic.c b/hw/kvm/ioapic.c index 3ae3175403..6c3b8fe39a 100644 --- a/hw/kvm/ioapic.c +++ b/hw/kvm/ioapic.c @@ -82,7 +82,7 @@ static void kvm_ioapic_set_irq(void *opaque, int irq, int level) KVMIOAPICState *s = opaque; int delivered; - delivered = kvm_irqchip_set_irq(kvm_state, s->kvm_gsi_base + irq, level); + delivered = kvm_set_irq(kvm_state, s->kvm_gsi_base + irq, level); apic_report_irq_delivered(delivered); } -- cgit v1.2.3 From 1d31f66bbc886af56d2def349012a358dc3ada06 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 26 Jul 2012 15:35:13 +0100 Subject: kvm: Move kvm_allows_irq0_override() to target-i386, fix return type kvm_allows_irq0_override() is a totally x86 specific concept: move it to the target-specific source file where it belongs. This means we need a new header file for the prototype: kvm_i386.h, in line with the existing kvm_ppc.h. While we are moving it, fix the return type to be 'bool' rather than 'int'. Signed-off-by: Peter Maydell Signed-off-by: Avi Kivity --- hw/pc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/pc.c b/hw/pc.c index 81c391cd6a..e8bcfc0b4b 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -42,6 +42,7 @@ #include "sysbus.h" #include "sysemu.h" #include "kvm.h" +#include "kvm_i386.h" #include "xen.h" #include "blockdev.h" #include "hw/block-common.h" -- cgit v1.2.3 From 614e41bc26dda751321da47acb1f9cb287b52085 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 26 Jul 2012 15:35:15 +0100 Subject: kvm: Decouple 'MSI routing via irqfds' from 'kernel irqchip' Decouple another x86-specific assumption about what irqchips imply. Signed-off-by: Peter Maydell Signed-off-by: Avi Kivity --- hw/virtio-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 125eded9ca..5e6e09efb7 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -627,7 +627,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign) int r, n; /* Must unset vector notifier while guest notifier is still assigned */ - if (kvm_irqchip_in_kernel() && !assign) { + if (kvm_msi_via_irqfd_enabled() && !assign) { msix_unset_vector_notifiers(&proxy->pci_dev); g_free(proxy->vector_irqfd); proxy->vector_irqfd = NULL; @@ -645,7 +645,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign) } /* Must set vector notifier after guest notifier has been assigned */ - if (kvm_irqchip_in_kernel() && assign) { + if (kvm_msi_via_irqfd_enabled() && assign) { proxy->vector_irqfd = g_malloc0(sizeof(*proxy->vector_irqfd) * msix_nr_vectors_allocated(&proxy->pci_dev)); -- cgit v1.2.3