Merge tag 'hyperv-next-signed-20240320' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / x86 / kernel / cpu / mshyperv.c
index faf438dce9db468edf3c1e5a5b195b0096a2c00a..e0fd57a8ba840431e1f48dd61c1bc0ffc9fc0d82 100644 (file)
@@ -209,7 +209,9 @@ static void hv_machine_shutdown(void)
        if (kexec_in_progress)
                hyperv_cleanup();
 }
+#endif /* CONFIG_KEXEC_CORE */
 
+#ifdef CONFIG_CRASH_DUMP
 static void hv_machine_crash_shutdown(struct pt_regs *regs)
 {
        if (hv_crash_handler)
@@ -221,7 +223,7 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
        /* Disable the hypercall page when there is only 1 active CPU. */
        hyperv_cleanup();
 }
-#endif /* CONFIG_KEXEC_CORE */
+#endif /* CONFIG_CRASH_DUMP */
 #endif /* CONFIG_HYPERV */
 
 static uint32_t  __init ms_hyperv_platform(void)
@@ -491,9 +493,13 @@ static void __init ms_hyperv_init_platform(void)
        no_timer_check = 1;
 #endif
 
-#if IS_ENABLED(CONFIG_HYPERV) && defined(CONFIG_KEXEC_CORE)
+#if IS_ENABLED(CONFIG_HYPERV)
+#if defined(CONFIG_KEXEC_CORE)
        machine_ops.shutdown = hv_machine_shutdown;
+#endif
+#if defined(CONFIG_CRASH_DUMP)
        machine_ops.crash_shutdown = hv_machine_crash_shutdown;
+#endif
 #endif
        if (ms_hyperv.features & HV_ACCESS_TSC_INVARIANT) {
                /*
@@ -535,19 +541,18 @@ static void __init ms_hyperv_init_platform(void)
         */
        x86_platform.apic_post_init = hyperv_init;
        hyperv_setup_mmu_ops();
-       /* Setup the IDT for hypervisor callback */
-       alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_hyperv_callback);
 
-       /* Setup the IDT for reenlightenment notifications */
+       /* Install system interrupt handler for hypervisor callback */
+       sysvec_install(HYPERVISOR_CALLBACK_VECTOR, sysvec_hyperv_callback);
+
+       /* Install system interrupt handler for reenlightenment notifications */
        if (ms_hyperv.features & HV_ACCESS_REENLIGHTENMENT) {
-               alloc_intr_gate(HYPERV_REENLIGHTENMENT_VECTOR,
-                               asm_sysvec_hyperv_reenlightenment);
+               sysvec_install(HYPERV_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment);
        }
 
-       /* Setup the IDT for stimer0 */
+       /* Install system interrupt handler for stimer0 */
        if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE) {
-               alloc_intr_gate(HYPERV_STIMER0_VECTOR,
-                               asm_sysvec_hyperv_stimer0);
+               sysvec_install(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0);
        }
 
 # ifdef CONFIG_SMP