aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xenbus
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-05-17 12:08:21 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-07-22 19:46:09 -0400
commit183d03cc4ff39e0f0d952c09aa96d0abfd6e0c3c (patch)
tree75947fc4a9ac69e902663c9cb618993b7c656cff /drivers/xen/xenbus
parent38e20b07efd541a959de367dc90a17f92ce2e8a6 (diff)
xen: Xen PCI platform device driver.
Add the xen pci platform device driver that is responsible for initializing the grant table and xenbus in PV on HVM mode. Few changes to xenbus and grant table are necessary to allow the delayed initialization in HVM mode. Grant table needs few additional modifications to work in HVM mode. The Xen PCI platform device raises an irq every time an event has been delivered to us. However these interrupts are only delivered to vcpu 0. The Xen PCI platform interrupt handler calls xen_hvm_evtchn_do_upcall that is a little wrapper around __xen_evtchn_do_upcall, the traditional Xen upcall handler, the very same used with traditional PV guests. When running on HVM the event channel upcall is never called while in progress because it is a normal Linux irq handler (and we cannot switch the irq chip wholesale to the Xen PV ones as we are running QEMU and might have passed in PCI devices), therefore we cannot be sure that evtchn_upcall_pending is 0 when returning. For this reason if evtchn_upcall_pending is set by Xen we need to loop again on the event channels set pending otherwise we might loose some event channel deliveries. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen/xenbus')
-rw-r--r--drivers/xen/xenbus/xenbus_probe.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index d96fa75b45ec..a9e83c438cbb 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -781,8 +781,23 @@ void xenbus_probe(struct work_struct *unused)
781 /* Notify others that xenstore is up */ 781 /* Notify others that xenstore is up */
782 blocking_notifier_call_chain(&xenstore_chain, 0, NULL); 782 blocking_notifier_call_chain(&xenstore_chain, 0, NULL);
783} 783}
784EXPORT_SYMBOL_GPL(xenbus_probe);
784 785
785static int __init xenbus_probe_init(void) 786static int __init xenbus_probe_initcall(void)
787{
788 if (!xen_domain())
789 return -ENODEV;
790
791 if (xen_initial_domain() || xen_hvm_domain())
792 return 0;
793
794 xenbus_probe(NULL);
795 return 0;
796}
797
798device_initcall(xenbus_probe_initcall);
799
800static int __init xenbus_init(void)
786{ 801{
787 int err = 0; 802 int err = 0;
788 803
@@ -834,9 +849,6 @@ static int __init xenbus_probe_init(void)
834 goto out_unreg_back; 849 goto out_unreg_back;
835 } 850 }
836 851
837 if (!xen_initial_domain())
838 xenbus_probe(NULL);
839
840#ifdef CONFIG_XEN_COMPAT_XENFS 852#ifdef CONFIG_XEN_COMPAT_XENFS
841 /* 853 /*
842 * Create xenfs mountpoint in /proc for compatibility with 854 * Create xenfs mountpoint in /proc for compatibility with
@@ -857,7 +869,7 @@ static int __init xenbus_probe_init(void)
857 return err; 869 return err;
858} 870}
859 871
860postcore_initcall(xenbus_probe_init); 872postcore_initcall(xenbus_init);
861 873
862MODULE_LICENSE("GPL"); 874MODULE_LICENSE("GPL");
863 875