]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/xen/hvm: Get rid of DEAD_FROZEN handling
authorThomas Gleixner <tglx@linutronix.de>
Wed, 29 Mar 2023 16:47:55 +0000 (18:47 +0200)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 30 Mar 2023 12:27:06 +0000 (14:27 +0200)
No point in this conditional voodoo. Un-initializing the lock mechanism is
safe to be called unconditionally even if it was already invoked when the
CPU died.

Remove the invocation of xen_smp_intr_free() as that has been already
cleaned up in xen_cpu_dead_hvm().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/xen/enlighten_hvm.c

index c1cd28e915a3a9a853d8e572cf516e10affdd8db..a6820ca940bf072930a604e2cdaee12c74ef9895 100644 (file)
@@ -161,13 +161,12 @@ static int xen_cpu_up_prepare_hvm(unsigned int cpu)
        int rc = 0;
 
        /*
-        * This can happen if CPU was offlined earlier and
-        * offlining timed out in common_cpu_die().
+        * If a CPU was offlined earlier and offlining timed out then the
+        * lock mechanism is still initialized. Uninit it unconditionally
+        * as it's safe to call even if already uninited. Interrupts and
+        * timer have already been handled in xen_cpu_dead_hvm().
         */
-       if (cpu_report_state(cpu) == CPU_DEAD_FROZEN) {
-               xen_smp_intr_free(cpu);
-               xen_uninit_lock_cpu(cpu);
-       }
+       xen_uninit_lock_cpu(cpu);
 
        if (cpu_acpi_id(cpu) != U32_MAX)
                per_cpu(xen_vcpu_id, cpu) = cpu_acpi_id(cpu);