RE: [PATCH 09/11] Drivers: hv: vmbus: Synchronize init_vp_index() vs. CPU hotplug
From: Michael Kelley
Date: Fri Apr 10 2020 - 15:33:53 EST
From: Andrea Parri (Microsoft) <parri.andrea@xxxxxxxxx> Sent: Sunday, April 5, 2020 5:15 PM
>
> init_vp_index() may access the cpu_online_mask mask via its calls of
> cpumask_of_node(). Make sure to protect these accesses with a
> cpus_read_lock() critical section.
>
> Also, remove some (hardcoded) instances of CPU(0) from init_vp_index()
> and replace them with VMBUS_CONNECT_CPU. The connect CPU can not go
> offline, since Hyper-V does not provide a way to change it.
>
> Finally, order the accesses of target_cpu from init_vp_index() and
> hv_synic_cleanup() by relying on the channel_mutex; this is achieved
> by moving the call of init_vp_index() into vmbus_process_offer().
>
> Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@xxxxxxxxx>
> ---
> drivers/hv/channel_mgmt.c | 47 ++++++++++++++++++++++++++++-----------
> drivers/hv/hv.c | 7 +++---
> 2 files changed, 38 insertions(+), 16 deletions(-)
>
Reviewed-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>