Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151327952
D8906.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D8906.diff
View Options
Index: head/sys/dev/hyperv/vmbus/vmbus.c
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus.c
+++ head/sys/dev/hyperv/vmbus/vmbus.c
@@ -1393,7 +1393,7 @@
vmbus_xact_ctx_destroy(sc->vmbus_xc);
sc->vmbus_xc = NULL;
}
- free(sc->vmbus_chmap, M_DEVBUF);
+ free(__DEVOLATILE(void *, sc->vmbus_chmap), M_DEVBUF);
mtx_destroy(&sc->vmbus_prichan_lock);
mtx_destroy(&sc->vmbus_chan_lock);
@@ -1480,7 +1480,7 @@
sc->vmbus_xc = NULL;
}
- free(sc->vmbus_chmap, M_DEVBUF);
+ free(__DEVOLATILE(void *, sc->vmbus_chmap), M_DEVBUF);
mtx_destroy(&sc->vmbus_prichan_lock);
mtx_destroy(&sc->vmbus_chan_lock);
Index: head/sys/dev/hyperv/vmbus/vmbus_chan.c
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c
@@ -775,9 +775,7 @@
{
struct vmbus_channel *chan = xchan;
- critical_enter();
chan->ch_vmbus->vmbus_chmap[chan->ch_id] = NULL;
- critical_exit();
}
static void
@@ -1308,15 +1306,17 @@
chan->ch_poll_flags = poll_flags;
/*
- * Disable interrupt from the RX bufring (TX bufring does not
- * generate interrupt to VM), and disconnect this channel from
- * the channel map to make sure that ISR can not enqueue this
- * channel task anymore.
+ * Disconnect this channel from the channel map to make sure that
+ * the RX bufring interrupt enabling bit can not be touched, and
+ * ISR can not enqueue this channel task anymore. THEN, disable
+ * interrupt from the RX bufring (TX bufring does not generate
+ * interrupt to VM).
+ *
+ * NOTE: order is critical.
*/
- critical_enter();
- vmbus_rxbr_intr_mask(&chan->ch_rxbr);
chan->ch_vmbus->vmbus_chmap[chan->ch_id] = NULL;
- critical_exit();
+ __compiler_membar();
+ vmbus_rxbr_intr_mask(&chan->ch_rxbr);
/*
* NOTE:
@@ -1380,11 +1380,9 @@
* Plug this channel back to the channel map and unmask
* the RX bufring interrupt.
*/
- critical_enter();
chan->ch_vmbus->vmbus_chmap[chan->ch_id] = chan;
__compiler_membar();
vmbus_rxbr_intr_unmask(&chan->ch_rxbr);
- critical_exit();
/*
* Kick start the interrupt task, just in case unmasking
Index: head/sys/dev/hyperv/vmbus/vmbus_var.h
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_var.h
+++ head/sys/dev/hyperv/vmbus/vmbus_var.h
@@ -93,7 +93,7 @@
u_long *vmbus_rx_evtflags;
/* compat evtflgs from host */
- struct vmbus_channel **vmbus_chmap;
+ struct vmbus_channel *volatile *vmbus_chmap;
struct vmbus_xact_ctx *vmbus_xc;
struct vmbus_pcpu_data vmbus_pcpu[MAXCPU];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 3:27 PM (6 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31040133
Default Alt Text
D8906.diff (2 KB)
Attached To
Mode
D8906: hyperv/vmbus: Nuke unnecessary critical sections.
Attached
Detach File
Event Timeline
Log In to Comment