diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-08-04 17:49:16 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-08-04 17:49:16 -0400 |
commit | ca50a5f39041497253c6362f2ba4da1b56d3e6cb (patch) | |
tree | 482f1607d12b60f6ef482bb4af2c9c58d7814d5f /drivers/xen/xenbus | |
parent | a70ce4b6064b64477ed12ef1878980f842819094 (diff) | |
parent | ca65f9fc0c447da5b270b05c41c21b19c88617c3 (diff) |
Merge branch 'upstream/pvhvm' into upstream/xen
* upstream/pvhvm:
Introduce CONFIG_XEN_PVHVM compile option
blkfront: do not create a PV cdrom device if xen_hvm_guest
support multiple .discard.* sections to avoid section type conflicts
xen/pvhvm: fix build problem when !CONFIG_XEN
xenfs: enable for HVM domains too
x86: Call HVMOP_pagetable_dying on exit_mmap.
x86: Unplug emulated disks and nics.
x86: Use xen_vcpuop_clockevent, xen_clocksource and xen wallclock.
xen: Fix find_unbound_irq in presence of ioapic irqs.
xen: Add suspend/resume support for PV on HVM guests.
xen: Xen PCI platform device driver.
x86/xen: event channels delivery on HVM.
x86: early PV on HVM features initialization.
xen: Add support for HVM hypercalls.
Conflicts:
arch/x86/xen/enlighten.c
arch/x86/xen/time.c
Diffstat (limited to 'drivers/xen/xenbus')
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe.c | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index abc12426ef0a..29bac5118877 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
@@ -56,6 +56,9 @@ | |||
56 | #include <xen/events.h> | 56 | #include <xen/events.h> |
57 | #include <xen/page.h> | 57 | #include <xen/page.h> |
58 | 58 | ||
59 | #include <xen/platform_pci.h> | ||
60 | #include <xen/hvm.h> | ||
61 | |||
59 | #include "xenbus_comms.h" | 62 | #include "xenbus_comms.h" |
60 | #include "xenbus_probe.h" | 63 | #include "xenbus_probe.h" |
61 | 64 | ||
@@ -776,8 +779,23 @@ void xenbus_probe(struct work_struct *unused) | |||
776 | /* Notify others that xenstore is up */ | 779 | /* Notify others that xenstore is up */ |
777 | blocking_notifier_call_chain(&xenstore_chain, 0, NULL); | 780 | blocking_notifier_call_chain(&xenstore_chain, 0, NULL); |
778 | } | 781 | } |
782 | EXPORT_SYMBOL_GPL(xenbus_probe); | ||
779 | 783 | ||
780 | static int __init xenbus_probe_init(void) | 784 | static int __init xenbus_probe_initcall(void) |
785 | { | ||
786 | if (!xen_domain()) | ||
787 | return -ENODEV; | ||
788 | |||
789 | if (xen_initial_domain() || xen_hvm_domain()) | ||
790 | return 0; | ||
791 | |||
792 | xenbus_probe(NULL); | ||
793 | return 0; | ||
794 | } | ||
795 | |||
796 | device_initcall(xenbus_probe_initcall); | ||
797 | |||
798 | static int __init xenbus_init(void) | ||
781 | { | 799 | { |
782 | int err = 0; | 800 | int err = 0; |
783 | 801 | ||
@@ -802,11 +820,24 @@ static int __init xenbus_probe_init(void) | |||
802 | if (xen_initial_domain()) { | 820 | if (xen_initial_domain()) { |
803 | /* dom0 not yet supported */ | 821 | /* dom0 not yet supported */ |
804 | } else { | 822 | } else { |
823 | if (xen_hvm_domain()) { | ||
824 | uint64_t v = 0; | ||
825 | err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v); | ||
826 | if (err) | ||
827 | goto out_error; | ||
828 | xen_store_evtchn = (int)v; | ||
829 | err = hvm_get_parameter(HVM_PARAM_STORE_PFN, &v); | ||
830 | if (err) | ||
831 | goto out_error; | ||
832 | xen_store_mfn = (unsigned long)v; | ||
833 | xen_store_interface = ioremap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE); | ||
834 | } else { | ||
835 | xen_store_evtchn = xen_start_info->store_evtchn; | ||
836 | xen_store_mfn = xen_start_info->store_mfn; | ||
837 | xen_store_interface = mfn_to_virt(xen_store_mfn); | ||
838 | } | ||
805 | xenstored_ready = 1; | 839 | xenstored_ready = 1; |
806 | xen_store_evtchn = xen_start_info->store_evtchn; | ||
807 | xen_store_mfn = xen_start_info->store_mfn; | ||
808 | } | 840 | } |
809 | xen_store_interface = mfn_to_virt(xen_store_mfn); | ||
810 | 841 | ||
811 | /* Initialize the interface to xenstore. */ | 842 | /* Initialize the interface to xenstore. */ |
812 | err = xs_init(); | 843 | err = xs_init(); |
@@ -816,9 +847,6 @@ static int __init xenbus_probe_init(void) | |||
816 | goto out_unreg_back; | 847 | goto out_unreg_back; |
817 | } | 848 | } |
818 | 849 | ||
819 | if (!xen_initial_domain()) | ||
820 | xenbus_probe(NULL); | ||
821 | |||
822 | #ifdef CONFIG_XEN_COMPAT_XENFS | 850 | #ifdef CONFIG_XEN_COMPAT_XENFS |
823 | /* | 851 | /* |
824 | * Create xenfs mountpoint in /proc for compatibility with | 852 | * Create xenfs mountpoint in /proc for compatibility with |
@@ -839,7 +867,7 @@ static int __init xenbus_probe_init(void) | |||
839 | return err; | 867 | return err; |
840 | } | 868 | } |
841 | 869 | ||
842 | postcore_initcall(xenbus_probe_init); | 870 | postcore_initcall(xenbus_init); |
843 | 871 | ||
844 | MODULE_LICENSE("GPL"); | 872 | MODULE_LICENSE("GPL"); |
845 | 873 | ||
@@ -947,6 +975,9 @@ static void wait_for_devices(struct xenbus_driver *xendrv) | |||
947 | #ifndef MODULE | 975 | #ifndef MODULE |
948 | static int __init boot_wait_for_devices(void) | 976 | static int __init boot_wait_for_devices(void) |
949 | { | 977 | { |
978 | if (xen_hvm_domain() && !xen_platform_pci_unplug) | ||
979 | return -ENODEV; | ||
980 | |||
950 | ready_to_wait_for_devices = 1; | 981 | ready_to_wait_for_devices = 1; |
951 | wait_for_devices(NULL); | 982 | wait_for_devices(NULL); |
952 | return 0; | 983 | return 0; |