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

Re: [Xen-devel] Linux 3.11.1 HVM guest kernel crash when started with xl (get_free_entries)



On Mon, Sep 30, 2013 at 05:02:25PM +0300, Pasi Kärkkäinen wrote:
> On Mon, Sep 30, 2013 at 09:39:49AM -0400, Konrad Rzeszutek Wilk wrote:
> > On Sat, Sep 28, 2013 at 11:52:06PM +0300, Pasi Kärkkäinen wrote:
> > > Hello,
> > > 
> > > Fedora 19, Xen 4.2.3 rpms from the distro.
> > > 
> > > Starting F19 HVM guest with xl causes the guest to crash during boot.
> > > Starting the same guest with xm/xend works OK.. 
> > > 
> > > Kernels tested in the guest: 3.11.1 and 3.9.5, both show the same 
> > > crash/traceback:
> > > 
> > > [    0.692736] input: Xen Virtual Keyboard as 
> > > /devices/virtual/input/input3
> > > [    0.698030] input: Xen Virtual Pointer as /devices/virtual/input/input4
> > > [    0.701254] ------------[ cut here ]------------
> > > [    0.702238] kernel BUG at drivers/xen/grant-table.c:1180!
> > 
> > Which is:
> > 
> > 1180         BUG_ON(grefs_per_grant_frame == 0);                            
> >          
> > 
> > 
> > Hmm, was there anything in the dmesg output having:
> > 
> > Grant tables using version <something>
> > 
> > ?
> >
> 
> Hmm.. I'm not sure. I'm not able to access the host in question until next 
> weekend,
> so I'll check then and provide more information.

This should fix it. Please try:
From f7d3581aa19a35ea3ff10b965b2b08843e923635 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Tue, 26 Nov 2013 15:05:40 -0500
Subject: [PATCH] xen/pvhvm: If xen_platform_pci=0 is set don't blow up.

*TODO*

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/block/xen-blkfront.c               |  2 +-
 drivers/input/misc/xen-kbdfront.c          |  4 ++++
 drivers/net/xen-netfront.c                 |  2 +-
 drivers/xen/xenbus/xenbus_probe_frontend.c |  2 +-
 include/xen/platform_pci.h                 | 13 +++++++++++++
 5 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 432db1b..bcbaf0b 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2074,7 +2074,7 @@ static int __init xlblk_init(void)
        if (!xen_domain())
                return -ENODEV;
 
-       if (xen_hvm_domain() && !xen_platform_pci_unplug)
+       if (xen_err_out())
                return -ENODEV;
 
        if (register_blkdev(XENVBD_MAJOR, DEV_NAME)) {
diff --git a/drivers/input/misc/xen-kbdfront.c 
b/drivers/input/misc/xen-kbdfront.c
index e21c181..9d250cf 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -29,6 +29,7 @@
 #include <xen/interface/io/fbif.h>
 #include <xen/interface/io/kbdif.h>
 #include <xen/xenbus.h>
+#include <xen/platform_pci.h>
 
 struct xenkbd_info {
        struct input_dev *kbd;
@@ -380,6 +381,9 @@ static int __init xenkbd_init(void)
        if (xen_initial_domain())
                return -ENODEV;
 
+       if (xen_err_out())
+               return -ENODEV;
+
        return xenbus_register_frontend(&xenkbd_driver);
 }
 
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index e59acb1..be2744b 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -2115,7 +2115,7 @@ static int __init netif_init(void)
        if (!xen_domain())
                return -ENODEV;
 
-       if (xen_hvm_domain() && !xen_platform_pci_unplug)
+       if (xen_err_out())
                return -ENODEV;
 
        pr_info("Initialising Xen virtual ethernet driver\n");
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c 
b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 129bf84..b1c0f2a 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -496,7 +496,7 @@ subsys_initcall(xenbus_probe_frontend_init);
 #ifndef MODULE
 static int __init boot_wait_for_devices(void)
 {
-       if (xen_hvm_domain() && !xen_platform_pci_unplug)
+       if (xen_err_out())
                return -ENODEV;
 
        ready_to_wait_for_devices = 1;
diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h
index 438c256..a5bbd0b 100644
--- a/include/xen/platform_pci.h
+++ b/include/xen/platform_pci.h
@@ -47,5 +47,18 @@ static inline int xen_must_unplug_disks(void) {
 }
 
 extern int xen_platform_pci_unplug;
+static  bool xen_err_out(void)
+{
 
+       if (!xen_domain())
+               return true;
+
+       if (xen_hvm_domain()) {
+               if (xen_platform_pci_unplug & (XEN_UNPLUG_UNNECESSARY | 
XEN_UNPLUG_NEVER))
+                       return true;
+               if (xen_platform_pci_unplug == 0)
+                       return true;
+       }
+       return false;
+}
 #endif /* _XEN_PLATFORM_PCI_H */
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.