]> xenbits.xensource.com Git - people/sstabellini/linux-pvhvm-deprecated.git/commitdiff
xen/arm: compile and run xenbus
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 25 May 2012 12:38:10 +0000 (12:38 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 25 May 2012 12:38:10 +0000 (12:38 +0000)
bind_evtchn_to_irqhandler can legitimately return 0 (irq 0), it is not
an error.

If Linux is running as an HVM domain and is running as Dom0, use
xenstored_local_init to initialize the xenstore page and event channel,
and do not call xs_reset_watches at boot.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
drivers/xen/xenbus/xenbus_comms.c
drivers/xen/xenbus/xenbus_probe.c
drivers/xen/xenbus/xenbus_probe_backend.c
drivers/xen/xenbus/xenbus_xs.c

index 2eff7a6aaa20a8e920ed4f0e7b024a941e791580..57b8230c6b2d6029a63e3796cee679ee3346b20c 100644 (file)
@@ -224,7 +224,7 @@ int xb_init_comms(void)
                int err;
                err = bind_evtchn_to_irqhandler(xen_store_evtchn, wake_waiting,
                                                0, "xenbus", &xb_waitq);
-               if (err <= 0) {
+               if (err < 0) {
                        printk(KERN_ERR "XENBUS request irq failed %i\n", err);
                        return err;
                }
index 1b178c6e893796c2807d8a5a1992c9cc27a7b97a..f3d5105cc523b06c660ce57a96e48913faa16359 100644 (file)
@@ -731,16 +731,22 @@ static int __init xenbus_init(void)
                return -ENODEV;
 
        if (xen_hvm_domain()) {
-               uint64_t v = 0;
-               err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
-               if (err)
-                       goto out_error;
-               xen_store_evtchn = (int)v;
-               err = hvm_get_parameter(HVM_PARAM_STORE_PFN, &v);
-               if (err)
-                       goto out_error;
-               xen_store_mfn = (unsigned long)v;
-               xen_store_interface = ioremap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE);
+               if (xen_initial_domain()) {
+                       err = xenstored_local_init();
+                       xen_store_interface = phys_to_virt(xen_store_mfn << PAGE_SHIFT);
+               } else {
+                       uint64_t v = 0;
+                       err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
+                       if (err)
+                               goto out_error;
+                       xen_store_evtchn = (int)v;
+                       err = hvm_get_parameter(HVM_PARAM_STORE_PFN, &v);
+                       if (err)
+                               goto out_error;
+                       xen_store_mfn = (unsigned long)v;
+                       xen_store_interface = ioremap(xen_store_mfn << PAGE_SHIFT,
+                                       PAGE_SIZE);
+               }
        } else {
                xen_store_evtchn = xen_start_info->store_evtchn;
                xen_store_mfn = xen_start_info->store_mfn;
index c3c7cd195c115026e3c4c495f8f7d88a3526d1e9..8d2c95401799085692931bbdee880e0c00e1fa5d 100644 (file)
@@ -47,7 +47,6 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/xen/hypervisor.h>
-#include <asm/hypervisor.h>
 #include <xen/xenbus.h>
 #include <xen/features.h>
 
index b3b8f2f3ad106aea4b4f33c9f61bf7eb01919563..edcef19432ddcf07f6aa3d30c0eb159cb3ca9374 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/rwsem.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
+#include <asm/xen/hypervisor.h>
 #include <xen/xenbus.h>
 #include <xen/xen.h>
 #include "xenbus_comms.h"
@@ -907,7 +908,7 @@ int xs_init(void)
                return PTR_ERR(task);
 
        /* shutdown watches for kexec boot */
-       if (xen_hvm_domain())
+       if (xen_hvm_domain() && !xen_initial_domain())
                xs_reset_watches();
 
        return 0;