34
34
struct ms_hyperv_info ms_hyperv ;
35
35
EXPORT_SYMBOL_GPL (ms_hyperv );
36
36
37
- static void (* hv_kexec_handler )(void );
38
- static void (* hv_crash_handler )(struct pt_regs * regs );
39
-
40
37
#if IS_ENABLED (CONFIG_HYPERV )
41
38
static void (* vmbus_handler )(void );
39
+ static void (* hv_kexec_handler )(void );
40
+ static void (* hv_crash_handler )(struct pt_regs * regs );
42
41
43
42
void hyperv_vector_handler (struct pt_regs * regs )
44
43
{
@@ -96,8 +95,8 @@ void hv_remove_crash_handler(void)
96
95
hv_crash_handler = NULL ;
97
96
}
98
97
EXPORT_SYMBOL_GPL (hv_remove_crash_handler );
99
- #endif
100
98
99
+ #ifdef CONFIG_KEXEC_CORE
101
100
static void hv_machine_shutdown (void )
102
101
{
103
102
if (kexec_in_progress && hv_kexec_handler )
@@ -111,7 +110,8 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
111
110
hv_crash_handler (regs );
112
111
native_machine_crash_shutdown (regs );
113
112
}
114
-
113
+ #endif /* CONFIG_KEXEC_CORE */
114
+ #endif /* CONFIG_HYPERV */
115
115
116
116
static uint32_t __init ms_hyperv_platform (void )
117
117
{
@@ -186,8 +186,10 @@ static void __init ms_hyperv_init_platform(void)
186
186
no_timer_check = 1 ;
187
187
#endif
188
188
189
+ #if IS_ENABLED (CONFIG_HYPERV ) && defined(CONFIG_KEXEC_CORE )
189
190
machine_ops .shutdown = hv_machine_shutdown ;
190
191
machine_ops .crash_shutdown = hv_machine_crash_shutdown ;
192
+ #endif
191
193
mark_tsc_unstable ("running on Hyper-V" );
192
194
}
193
195
0 commit comments