summaryrefslogtreecommitdiffstats
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
authorAndrea Parri (Microsoft) <parri.andrea@gmail.com>2020-05-22 19:19:00 +0200
committerWei Liu <wei.liu@kernel.org>2020-05-23 09:06:42 +0000
commita949e86c0d7802c05b2ae726a84fae89ddb5be7d (patch)
treed28c24b643fe5722737a2c56b08a2774ff3e9def /include/linux/hyperv.h
parentdb5871e85533f06ffe1795c1cb9b9153860d1e4f (diff)
downloadlinux-a949e86c0d7802c05b2ae726a84fae89ddb5be7d.tar.gz
linux-a949e86c0d7802c05b2ae726a84fae89ddb5be7d.tar.bz2
linux-a949e86c0d7802c05b2ae726a84fae89ddb5be7d.zip
Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug
vmbus_process_offer() does two things (among others): 1) first, it sets the channel's target CPU with cpu_hotplug_lock; 2) it then adds the channel to the channel list(s) with channel_mutex. Since cpu_hotplug_lock is released before (2), the channel's target CPU (as designated in (1)) can be deemed "free" by hv_synic_cleanup() and go offline before the channel is added to the list. Fix the race condition by "extending" the cpu_hotplug_lock critical section to include (2) (and (1)), nesting the channel_mutex critical section within the cpu_hotplug_lock critical section as done elsewhere (hv_synic_cleanup(), target_cpu_store()) in the hyperv drivers code. Move even further by extending the channel_mutex critical section to include (1) (and (2)): this change allows to remove (the now redundant) bind_channel_to_cpu_lock, and generally simplifies the handling of the target CPUs (that are now always modified with channel_mutex held). Fixes: d570aec0f2154e ("Drivers: hv: vmbus: Synchronize init_vp_index() vs. CPU hotplug") Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Link: https://lore.kernel.org/r/20200522171901.204127-2-parri.andrea@gmail.com Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'include/linux/hyperv.h')
0 files changed, 0 insertions, 0 deletions