diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2010-07-29 09:37:48 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-07-29 14:11:33 -0400 |
commit | ca65f9fc0c447da5b270b05c41c21b19c88617c3 (patch) | |
tree | 7a8813233d867635d01cc2c8397099df4468751d | |
parent | b98a409b80ac510c95b4f1bafdef28edaeabd3e7 (diff) |
Introduce CONFIG_XEN_PVHVM compile option
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>
-rw-r--r-- | arch/x86/kernel/cpu/hypervisor.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/Kconfig | 5 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/platform-pci-unplug.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/time.c | 3 | ||||
-rw-r--r-- | drivers/xen/Kconfig | 2 | ||||
-rw-r--r-- | drivers/xen/events.c | 4 |
8 files changed, 19 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index 5bccedcb9121..8095f8611f8a 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c | |||
@@ -34,7 +34,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] = | |||
34 | { | 34 | { |
35 | &x86_hyper_vmware, | 35 | &x86_hyper_vmware, |
36 | &x86_hyper_ms_hyperv, | 36 | &x86_hyper_ms_hyperv, |
37 | #ifdef CONFIG_XEN | 37 | #ifdef CONFIG_XEN_PVHVM |
38 | &x86_hyper_xen_hvm, | 38 | &x86_hyper_xen_hvm, |
39 | #endif | 39 | #endif |
40 | }; | 40 | }; |
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig index b83e119fbeb0..68128a1b401a 100644 --- a/arch/x86/xen/Kconfig +++ b/arch/x86/xen/Kconfig | |||
@@ -13,6 +13,11 @@ config XEN | |||
13 | kernel to boot in a paravirtualized environment under the | 13 | kernel to boot in a paravirtualized environment under the |
14 | Xen hypervisor. | 14 | Xen hypervisor. |
15 | 15 | ||
16 | config XEN_PVHVM | ||
17 | def_bool y | ||
18 | depends on XEN | ||
19 | depends on X86_LOCAL_APIC | ||
20 | |||
16 | config XEN_MAX_DOMAIN_MEMORY | 21 | config XEN_MAX_DOMAIN_MEMORY |
17 | int "Maximum allowed size of a domain in gigabytes" | 22 | int "Maximum allowed size of a domain in gigabytes" |
18 | default 8 if X86_32 | 23 | default 8 if X86_32 |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 75b479a684fd..6f5345378abc 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1282,6 +1282,7 @@ void xen_hvm_init_shared_info(void) | |||
1282 | } | 1282 | } |
1283 | } | 1283 | } |
1284 | 1284 | ||
1285 | #ifdef CONFIG_XEN_PVHVM | ||
1285 | static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, | 1286 | static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, |
1286 | unsigned long action, void *hcpu) | 1287 | unsigned long action, void *hcpu) |
1287 | { | 1288 | { |
@@ -1338,3 +1339,4 @@ const __refconst struct hypervisor_x86 x86_hyper_xen_hvm = { | |||
1338 | .init_platform = xen_hvm_guest_init, | 1339 | .init_platform = xen_hvm_guest_init, |
1339 | }; | 1340 | }; |
1340 | EXPORT_SYMBOL(x86_hyper_xen_hvm); | 1341 | EXPORT_SYMBOL(x86_hyper_xen_hvm); |
1342 | #endif | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 84648c1bf138..413b19b3d0fe 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1942,6 +1942,7 @@ void __init xen_init_mmu_ops(void) | |||
1942 | pv_mmu_ops = xen_mmu_ops; | 1942 | pv_mmu_ops = xen_mmu_ops; |
1943 | } | 1943 | } |
1944 | 1944 | ||
1945 | #ifdef CONFIG_XEN_PVHVM | ||
1945 | static void xen_hvm_exit_mmap(struct mm_struct *mm) | 1946 | static void xen_hvm_exit_mmap(struct mm_struct *mm) |
1946 | { | 1947 | { |
1947 | struct xen_hvm_pagetable_dying a; | 1948 | struct xen_hvm_pagetable_dying a; |
@@ -1973,6 +1974,7 @@ void __init xen_hvm_init_mmu_ops(void) | |||
1973 | if (is_pagetable_dying_supported()) | 1974 | if (is_pagetable_dying_supported()) |
1974 | pv_mmu_ops.exit_mmap = xen_hvm_exit_mmap; | 1975 | pv_mmu_ops.exit_mmap = xen_hvm_exit_mmap; |
1975 | } | 1976 | } |
1977 | #endif | ||
1976 | 1978 | ||
1977 | #ifdef CONFIG_XEN_DEBUG_FS | 1979 | #ifdef CONFIG_XEN_DEBUG_FS |
1978 | 1980 | ||
diff --git a/arch/x86/xen/platform-pci-unplug.c b/arch/x86/xen/platform-pci-unplug.c index 2f7f3fb34777..554c002a1e1a 100644 --- a/arch/x86/xen/platform-pci-unplug.c +++ b/arch/x86/xen/platform-pci-unplug.c | |||
@@ -32,6 +32,7 @@ | |||
32 | /* store the value of xen_emul_unplug after the unplug is done */ | 32 | /* store the value of xen_emul_unplug after the unplug is done */ |
33 | int xen_platform_pci_unplug; | 33 | int xen_platform_pci_unplug; |
34 | EXPORT_SYMBOL_GPL(xen_platform_pci_unplug); | 34 | EXPORT_SYMBOL_GPL(xen_platform_pci_unplug); |
35 | #ifdef CONFIG_XEN_PVHVM | ||
35 | static int xen_emul_unplug; | 36 | static int xen_emul_unplug; |
36 | 37 | ||
37 | static int __init check_platform_magic(void) | 38 | static int __init check_platform_magic(void) |
@@ -133,3 +134,4 @@ static int __init parse_xen_emul_unplug(char *arg) | |||
133 | return 0; | 134 | return 0; |
134 | } | 135 | } |
135 | early_param("xen_emul_unplug", parse_xen_emul_unplug); | 136 | early_param("xen_emul_unplug", parse_xen_emul_unplug); |
137 | #endif | ||
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 4780e55886a5..2aab4a2b9100 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -516,6 +516,7 @@ __init void xen_init_time_ops(void) | |||
516 | x86_platform.set_wallclock = xen_set_wallclock; | 516 | x86_platform.set_wallclock = xen_set_wallclock; |
517 | } | 517 | } |
518 | 518 | ||
519 | #ifdef CONFIG_XEN_PVHVM | ||
519 | static void xen_hvm_setup_cpu_clockevents(void) | 520 | static void xen_hvm_setup_cpu_clockevents(void) |
520 | { | 521 | { |
521 | int cpu = smp_processor_id(); | 522 | int cpu = smp_processor_id(); |
@@ -544,4 +545,4 @@ __init void xen_hvm_init_time_ops(void) | |||
544 | x86_platform.get_wallclock = xen_get_wallclock; | 545 | x86_platform.get_wallclock = xen_get_wallclock; |
545 | x86_platform.set_wallclock = xen_set_wallclock; | 546 | x86_platform.set_wallclock = xen_set_wallclock; |
546 | } | 547 | } |
547 | 548 | #endif | |
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 8f84b108b491..0a8826936639 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig | |||
@@ -64,7 +64,7 @@ config XEN_SYS_HYPERVISOR | |||
64 | 64 | ||
65 | config XEN_PLATFORM_PCI | 65 | config XEN_PLATFORM_PCI |
66 | tristate "xen platform pci device driver" | 66 | tristate "xen platform pci device driver" |
67 | depends on XEN | 67 | depends on XEN_PVHVM |
68 | default m | 68 | default m |
69 | help | 69 | help |
70 | Driver for the Xen PCI Platform device: it is responsible for | 70 | Driver for the Xen PCI Platform device: it is responsible for |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index b5a254e9aebe..5e1f34892dcc 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -973,6 +973,7 @@ int xen_set_callback_via(uint64_t via) | |||
973 | } | 973 | } |
974 | EXPORT_SYMBOL_GPL(xen_set_callback_via); | 974 | EXPORT_SYMBOL_GPL(xen_set_callback_via); |
975 | 975 | ||
976 | #ifdef CONFIG_XEN_PVHVM | ||
976 | /* Vector callbacks are better than PCI interrupts to receive event | 977 | /* Vector callbacks are better than PCI interrupts to receive event |
977 | * channel notifications because we can receive vector callbacks on any | 978 | * channel notifications because we can receive vector callbacks on any |
978 | * vcpu and we don't need PCI support or APIC interactions. */ | 979 | * vcpu and we don't need PCI support or APIC interactions. */ |
@@ -996,6 +997,9 @@ void xen_callback_vector(void) | |||
996 | alloc_intr_gate(XEN_HVM_EVTCHN_CALLBACK, xen_hvm_callback_vector); | 997 | alloc_intr_gate(XEN_HVM_EVTCHN_CALLBACK, xen_hvm_callback_vector); |
997 | } | 998 | } |
998 | } | 999 | } |
1000 | #else | ||
1001 | void xen_callback_vector(void) {} | ||
1002 | #endif | ||
999 | 1003 | ||
1000 | void __init xen_init_IRQ(void) | 1004 | void __init xen_init_IRQ(void) |
1001 | { | 1005 | { |