x86/xen: Allow to retry if cpu_initialize_context() failed.
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 9 Feb 2022 08:02:13 +0000 (09:02 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 12 Apr 2022 12:13:01 +0000 (14:13 +0200)
commite8a69f12f01f487c6a0e704eb14ccf2dd015277d
tree3419591d9a14133613d3fecaf007728fc58944e3
parentce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
x86/xen: Allow to retry if cpu_initialize_context() failed.

If memory allocation in cpu_initialize_context() fails then it will
bring up the VCPU and leave with the corresponding CPU bit set in
xen_cpu_initialized_map.

The following (presumably successful) CPU bring up will BUG in
xen_pv_cpu_up() because nothing for that VCPU would be initialized.

Clear the CPU bits, that were set in cpu_initialize_context() in case
the memory allocation fails.

[ bigeasy: Creating a patch from Boris' email. ]

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220209080214.1439408-2-bigeasy@linutronix.de
arch/x86/xen/smp_pv.c