]> www.infradead.org Git - users/dwmw2/linux.git/commit
xen/cpuhotplug: Fix initial CPU offlining for PV(H) guests
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 8 May 2020 22:28:43 +0000 (18:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:53 +0000 (17:48 +0200)
commit96566670aab7a3590b5e7ab64fd04518aca31b4c
tree95f9c81940b706da22f5cfe5fa30151bd86c17c4
parent51086af6e31e97c533266ef00e2f0cf6cbb835c3
xen/cpuhotplug: Fix initial CPU offlining for PV(H) guests

[ Upstream commit c54b071c192dfe8061336f650ceaf358e6386e0b ]

Commit a926f81d2f6c ("xen/cpuhotplug: Replace cpu_up/down() with
device_online/offline()") replaced cpu_down() with device_offline()
call which requires that the CPU has been registered before. This
registration, however, happens later from topology_init() which
is called as subsys_initcall(). setup_vcpu_hotplug_event(), on the
other hand, is invoked earlier, during arch_initcall().

As result, booting a PV(H) guest with vcpus < maxvcpus causes a crash.

Move setup_vcpu_hotplug_event() (and therefore setup_cpu_watcher()) to
late_initcall(). In addition, instead of performing all offlining steps
in setup_cpu_watcher() simply call disable_hotplug_cpu().

Fixes: a926f81d2f6c (xen/cpuhotplug: Replace cpu_up/down() with device_online/offline()"
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/1588976923-3667-1-git-send-email-boris.ostrovsky@oracle.com
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/cpu_hotplug.c