Introduce CONFIG_XEN_PVHVM compile option
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 29 Jul 2010 13:37:48 +0000 (14:37 +0100)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Thu, 29 Jul 2010 18:11:33 +0000 (11:11 -0700)
This patch introduce a CONFIG_XEN_PVHVM compile time option to
enable/disable Xen PV on HVM support.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
arch/x86/kernel/cpu/hypervisor.c
arch/x86/xen/Kconfig
arch/x86/xen/enlighten.c
arch/x86/xen/mmu.c
arch/x86/xen/platform-pci-unplug.c
arch/x86/xen/time.c
drivers/xen/Kconfig
drivers/xen/events.c

index 5bccedcb91219c9bcaa3762e57d2a92c2223f872..8095f8611f8ab1d2c51efcb45d0929842065bc47 100644 (file)
@@ -34,7 +34,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
 {
        &x86_hyper_vmware,
        &x86_hyper_ms_hyperv,
-#ifdef CONFIG_XEN
+#ifdef CONFIG_XEN_PVHVM
        &x86_hyper_xen_hvm,
 #endif
 };
index b83e119fbeb0d29a832d68d67409ae72bb3a7400..68128a1b401a30a9316b0a9cfa35369c88f9e81a 100644 (file)
@@ -13,6 +13,11 @@ config XEN
          kernel to boot in a paravirtualized environment under the
          Xen hypervisor.
 
+config XEN_PVHVM
+       def_bool y
+       depends on XEN
+       depends on X86_LOCAL_APIC
+
 config XEN_MAX_DOMAIN_MEMORY
        int "Maximum allowed size of a domain in gigabytes"
        default 8 if X86_32
index 75b479a684fd695f7cd055303822363153be4b3a..6f5345378abc897277d490233365dea2c07a1f20 100644 (file)
@@ -1282,6 +1282,7 @@ void xen_hvm_init_shared_info(void)
        }
 }
 
+#ifdef CONFIG_XEN_PVHVM
 static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
                                    unsigned long action, void *hcpu)
 {
@@ -1338,3 +1339,4 @@ const __refconst struct hypervisor_x86 x86_hyper_xen_hvm = {
        .init_platform          = xen_hvm_guest_init,
 };
 EXPORT_SYMBOL(x86_hyper_xen_hvm);
+#endif
index 84648c1bf138e2871e7bf69f85aab08f70c86f52..413b19b3d0fe5322ebe5a492d432eb132304aadf 100644 (file)
@@ -1942,6 +1942,7 @@ void __init xen_init_mmu_ops(void)
        pv_mmu_ops = xen_mmu_ops;
 }
 
+#ifdef CONFIG_XEN_PVHVM
 static void xen_hvm_exit_mmap(struct mm_struct *mm)
 {
        struct xen_hvm_pagetable_dying a;
@@ -1973,6 +1974,7 @@ void __init xen_hvm_init_mmu_ops(void)
        if (is_pagetable_dying_supported())
                pv_mmu_ops.exit_mmap = xen_hvm_exit_mmap;
 }
+#endif
 
 #ifdef CONFIG_XEN_DEBUG_FS
 
index 2f7f3fb34777d3eb792b45fa1da4cfcb852c349b..554c002a1e1afcd13a71c90a25eff86057e56832 100644 (file)
@@ -32,6 +32,7 @@
 /* store the value of xen_emul_unplug after the unplug is done */
 int xen_platform_pci_unplug;
 EXPORT_SYMBOL_GPL(xen_platform_pci_unplug);
+#ifdef CONFIG_XEN_PVHVM
 static int xen_emul_unplug;
 
 static int __init check_platform_magic(void)
@@ -133,3 +134,4 @@ static int __init parse_xen_emul_unplug(char *arg)
        return 0;
 }
 early_param("xen_emul_unplug", parse_xen_emul_unplug);
+#endif
index 4780e55886a5a1c1bdb5410863a2067bb29d96eb..2aab4a2b9100c49189cbb44eac47106d11772e1b 100644 (file)
@@ -516,6 +516,7 @@ __init void xen_init_time_ops(void)
        x86_platform.set_wallclock = xen_set_wallclock;
 }
 
+#ifdef CONFIG_XEN_PVHVM
 static void xen_hvm_setup_cpu_clockevents(void)
 {
        int cpu = smp_processor_id();
@@ -544,4 +545,4 @@ __init void xen_hvm_init_time_ops(void)
        x86_platform.get_wallclock = xen_get_wallclock;
        x86_platform.set_wallclock = xen_set_wallclock;
 }
-
+#endif
index 8f84b108b491573fe11d7ea6bcec449d98c6cf6a..0a882693663997634a553f76271f9cb287ea8fb2 100644 (file)
@@ -64,7 +64,7 @@ config XEN_SYS_HYPERVISOR
 
 config XEN_PLATFORM_PCI
        tristate "xen platform pci device driver"
-       depends on XEN
+       depends on XEN_PVHVM
        default m
        help
          Driver for the Xen PCI Platform device: it is responsible for
index b5a254e9aebe093e2492582328dfbcba7cf6ac88..5e1f34892dcc62537d0d8d077208eed2706112c7 100644 (file)
@@ -973,6 +973,7 @@ int xen_set_callback_via(uint64_t via)
 }
 EXPORT_SYMBOL_GPL(xen_set_callback_via);
 
+#ifdef CONFIG_XEN_PVHVM
 /* Vector callbacks are better than PCI interrupts to receive event
  * channel notifications because we can receive vector callbacks on any
  * vcpu and we don't need PCI support or APIC interactions. */
@@ -996,6 +997,9 @@ void xen_callback_vector(void)
                        alloc_intr_gate(XEN_HVM_EVTCHN_CALLBACK, xen_hvm_callback_vector);
        }
 }
+#else
+void xen_callback_vector(void) {}
+#endif
 
 void __init xen_init_IRQ(void)
 {