mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
a949e86c0d
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:
|
||
---|---|---|
.. | ||
channel_mgmt.c | ||
channel.c | ||
connection.c | ||
hv_balloon.c | ||
hv_debugfs.c | ||
hv_fcopy.c | ||
hv_kvp.c | ||
hv_snapshot.c | ||
hv_trace_balloon.h | ||
hv_trace.c | ||
hv_trace.h | ||
hv_util.c | ||
hv_utils_transport.c | ||
hv_utils_transport.h | ||
hv.c | ||
hyperv_vmbus.h | ||
Kconfig | ||
Makefile | ||
ring_buffer.c | ||
vmbus_drv.c |