Skip to content

Commit f6aa37c

Browse files
ldu4mpe
authored andcommitted
powerpc/pseries: unregister VPA when hot unplugging a CPU
The VPA should unregister when offlining a CPU. Otherwise there could be a short window where 2 CPUs could share the same VPA. This happens because the hypervisor is still keeping the VPA attached to the vCPU even if it became offline. Here is a potential situation: 1. remove proc A, 2. add proc B. If proc B gets proc A's place in cpu_present_mask, then it registers proc A's VPAs. 3. If proc B is then re-added to the LP, its threads are sharing VPAs with proc A briefly as they come online. As the hypervisor may check for the VPA's yield_count field oddity, it may detect an unexpected value and kill the LPAR. Suggested-by: Nathan Lynch <[email protected]> Signed-off-by: Laurent Dufour <[email protected]> Reviewed-by: Nathan Lynch <[email protected]> [mpe: s/cpu_present_map/cpu_present_mask/ in change log] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9b574cf commit f6aa37c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/powerpc/platforms/pseries/hotplug-cpu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static void pseries_cpu_offline_self(void)
7070
xics_teardown_cpu();
7171

7272
unregister_slb_shadow(hwcpu);
73+
unregister_vpa(hwcpu);
7374
rtas_stop_self();
7475

7576
/* Should never get here... */

0 commit comments

Comments
 (0)