aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2015-09-23 06:02:57 -0400
committerIngo Molnar <mingo@kernel.org>2015-09-30 01:44:15 -0400
commit1e034743e918d195d339af340ae933727c072bce (patch)
tree9939c190e43cbe4ee066e1431831b5aba426d61b /arch
parenta7adb91b13c104e5ad950fbe1795aa2722f2ea0a (diff)
x86/hyperv: Fix the build in the !CONFIG_KEXEC_CORE case
Recent changes in the Hyper-V driver: b4370df2b1f5 ("Drivers: hv: vmbus: add special crash handler") broke the build when CONFIG_KEXEC_CORE is not set: arch/x86/built-in.o: In function `hv_machine_crash_shutdown': arch/x86/kernel/cpu/mshyperv.c:112: undefined reference to `native_machine_crash_shutdown' Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE. Reported-by: Jim Davis <jim.epost@gmail.com> Reported-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: devel@linuxdriverproject.org Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/1443002577-25370-1-git-send-email-vkuznets@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/mshyperv.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 381c8b9b3a33..20e242ea1bc4 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -34,11 +34,10 @@
34struct ms_hyperv_info ms_hyperv; 34struct ms_hyperv_info ms_hyperv;
35EXPORT_SYMBOL_GPL(ms_hyperv); 35EXPORT_SYMBOL_GPL(ms_hyperv);
36 36
37static void (*hv_kexec_handler)(void);
38static void (*hv_crash_handler)(struct pt_regs *regs);
39
40#if IS_ENABLED(CONFIG_HYPERV) 37#if IS_ENABLED(CONFIG_HYPERV)
41static void (*vmbus_handler)(void); 38static void (*vmbus_handler)(void);
39static void (*hv_kexec_handler)(void);
40static void (*hv_crash_handler)(struct pt_regs *regs);
42 41
43void hyperv_vector_handler(struct pt_regs *regs) 42void hyperv_vector_handler(struct pt_regs *regs)
44{ 43{
@@ -96,8 +95,8 @@ void hv_remove_crash_handler(void)
96 hv_crash_handler = NULL; 95 hv_crash_handler = NULL;
97} 96}
98EXPORT_SYMBOL_GPL(hv_remove_crash_handler); 97EXPORT_SYMBOL_GPL(hv_remove_crash_handler);
99#endif
100 98
99#ifdef CONFIG_KEXEC_CORE
101static void hv_machine_shutdown(void) 100static void hv_machine_shutdown(void)
102{ 101{
103 if (kexec_in_progress && hv_kexec_handler) 102 if (kexec_in_progress && hv_kexec_handler)
@@ -111,7 +110,8 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
111 hv_crash_handler(regs); 110 hv_crash_handler(regs);
112 native_machine_crash_shutdown(regs); 111 native_machine_crash_shutdown(regs);
113} 112}
114 113#endif /* CONFIG_KEXEC_CORE */
114#endif /* CONFIG_HYPERV */
115 115
116static uint32_t __init ms_hyperv_platform(void) 116static uint32_t __init ms_hyperv_platform(void)
117{ 117{
@@ -186,8 +186,10 @@ static void __init ms_hyperv_init_platform(void)
186 no_timer_check = 1; 186 no_timer_check = 1;
187#endif 187#endif
188 188
189#if IS_ENABLED(CONFIG_HYPERV) && defined(CONFIG_KEXEC_CORE)
189 machine_ops.shutdown = hv_machine_shutdown; 190 machine_ops.shutdown = hv_machine_shutdown;
190 machine_ops.crash_shutdown = hv_machine_crash_shutdown; 191 machine_ops.crash_shutdown = hv_machine_crash_shutdown;
192#endif
191 mark_tsc_unstable("running on Hyper-V"); 193 mark_tsc_unstable("running on Hyper-V");
192} 194}
193 195