Skip to contentSkip to conversation

qemu-kvm: virtio: Do not register mask notifiers without in-kernel irqchip support

PATCH In review Jan Kiszka 2 participants 2 messages Jul 2, 2012 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 qemu-kvm: virtio: Do not register mask notifiers without in-kernel irqchip support

We crash if we registers mask notifiers without backing in-kernel irqchip. This corresponds to the check in QEMU upstream after 1.1 now.

---

Not needed for master as we have upstream logic there already.

 hw/virtio-pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/virtio-pci.c +2 -2
index a0c2ca7..5b64356 100644
@@ -629,7 +629,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign)
 
     /* Must unset mask notifier while guest notifier
      * is still assigned */
-    if (!assign) {
+    if (kvm_irqchip_in_kernel() && !assign) {
 	    r = msix_unset_mask_notifier(&proxy->pci_dev);
             assert(r >= 0);
     }
@@ -647,7 +647,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign)
 
     /* Must set mask notifier after guest notifier
      * has been assigned */
-    if (assign) {
+    if (kvm_irqchip_in_kernel() && assign) {
         r = msix_set_mask_notifier(&proxy->pci_dev,
                                    virtio_pci_mask_notifier);
         if (r < 0) {
Signature · 1 line
1.7.3.4
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jan Kiszka

We crash if we registers mask notifiers without backing in-kernel irqchip. This corresponds to the check in QEMU upstream after 1.1 now.

Quoted 31 lines

---

Not needed for master as we have upstream logic there already.

 hw/virtio-pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/virtio-pci.c +2 -2
index a0c2ca7..5b64356 100644
@@ -629,7 +629,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign)
 
     /* Must unset mask notifier while guest notifier
      * is still assigned */
-    if (!assign) {
+    if (kvm_irqchip_in_kernel() && !assign) {
 	    r = msix_unset_mask_notifier(&proxy->pci_dev);
             assert(r >= 0);
     }
@@ -647,7 +647,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign)
 
     /* Must set mask notifier after guest notifier
      * has been assigned */
-    if (assign) {
+    if (kvm_irqchip_in_kernel() && assign) {
         r = msix_set_mask_notifier(&proxy->pci_dev,
                                    virtio_pci_mask_notifier);
         if (r < 0) {
Signature · 1 line
1.7.3.4