RE: qemu-kvm-0.14.0 msix_mask_notifier failed.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I simply defined the syscall myself - but this only works if your kernel supports the eventfd syscall.
Note: You need to adjust the the syscall NR for your architecture.

-------------------------------------------------------------------------------------
  glibc < 2.8 does not have eventfd support. So we define the 
  syscall manually. That is required for vhost=on.

Index: new/hw/event_notifier.c
===================================================================
--- new.orig/hw/event_notifier.c        2011-03-01 12:16:30.000000000 +0100
+++ new/hw/event_notifier.c     2011-03-01 12:36:02.000000000 +0100
@@ -14,6 +14,13 @@
 #include "event_notifier.h"
 #ifdef CONFIG_EVENTFD
 #include <sys/eventfd.h>
+#else
+#include <sys/syscall.h>
+#include <unistd.h>
+/* this is for AMD64 */ 
+#define __NR_eventfd2                          290
+#define EFD_NONBLOCK  04000
+#define EFD_CLOEXEC 02000000
 #endif
 
 int event_notifier_init(EventNotifier *e, int active)
@@ -25,7 +32,11 @@
     e->fd = fd;
     return 0;
 #else
-    return -ENOSYS;
+    int fd = syscall(__NR_eventfd2, !!active, EFD_NONBLOCK | EFD_CLOEXEC);
+    if (fd < 0)
+        return -errno;
+    e->fd = fd;
+    return 0;
 #endif
 }

> -----Original Message-----
> From: Nikola Ciprich [mailto:extmaillist@xxxxxxxxxxx]
> Sent: Montag, 21. März 2011 21:48
> To: Dietmar Maurer
> Cc: kvm@xxxxxxxxxxxxxxx; nikola.ciprich@xxxxxxxxxxx
> Subject: Re: qemu-kvm-0.14.0 msix_mask_notifier failed.
> 
> Hello Dietmar,
> did You somehow fixed this problem?
> BR
> nik
> 
> On Tue, Mar 01, 2011 at 11:43:39AM +0000, Dietmar Maurer wrote:
> > Seems the bug is related to EVENTFD support.
> >
> > int event_notifier_init(EventNotifier *e, int active)
> >
> > That simply return -ENOSYS on older glibc (< 2.8)
> >
> > I can define the syscall manually, but I wonder if there is a better way?
> >
> > - Dietmar
> >
> >
> > > I get this error when I run new kvm 0.14.0 on kernel 2.6.35 (vhost=on):
> > >
> > > # kvm -netdev type=tap,id=n0,vhost=on -device
> > > virtio-net-pci,netdev=n0 -cdrom ubuntu-10.10-desktop-amd64.iso
> > >
> > > kvm: /home/code/qemu-kvm/hw/msix.c:639: msix_unset_mask_notifier:
> > > Assertion `dev->msix_mask_notifier' failed.
> > >
> > > Any ideas?

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux