Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153260741
D6745.id17398.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D6745.id17398.diff
View Options
Index: head/sys/dev/hyperv/vmbus/hv_channel.c
===================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel.c
+++ head/sys/dev/hyperv/vmbus/hv_channel.c
@@ -37,12 +37,16 @@
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
+
+#include <machine/atomic.h>
#include <machine/bus.h>
+
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <dev/hyperv/vmbus/hv_vmbus_priv.h>
+#include <dev/hyperv/vmbus/vmbus_reg.h>
#include <dev/hyperv/vmbus/vmbus_var.h>
static int vmbus_channel_create_gpadl_header(
@@ -65,11 +69,11 @@
if (channel->offer_msg.monitor_allocated) {
struct vmbus_softc *sc = vmbus_get_softc();
hv_vmbus_monitor_page *monitor_page;
+ uint32_t chanid = channel->offer_msg.child_rel_id;
- /* Each uint32_t represents 32 channels */
- synch_set_bit((channel->offer_msg.child_rel_id & 31),
- ((uint32_t *)sc->vmbus_tx_evtflags
- + ((channel->offer_msg.child_rel_id >> 5))));
+ atomic_set_long(
+ &sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT],
+ 1UL << (chanid & VMBUS_EVTFLAG_MASK));
monitor_page = sc->vmbus_mnf2;
synch_set_bit(channel->monitor_bit,
Index: head/sys/dev/hyperv/vmbus/hv_connection.c
===================================================================
--- head/sys/dev/hyperv/vmbus/hv_connection.c
+++ head/sys/dev/hyperv/vmbus/hv_connection.c
@@ -353,12 +353,10 @@
{
struct vmbus_softc *sc = vmbus_get_softc();
int ret = 0;
- uint32_t child_rel_id = channel->offer_msg.child_rel_id;
+ uint32_t chanid = channel->offer_msg.child_rel_id;
- /* Each uint32_t represents 32 channels */
-
- synch_set_bit(child_rel_id & 31,
- (((uint32_t *)sc->vmbus_tx_evtflags + (child_rel_id >> 5))));
+ atomic_set_long(&sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT],
+ 1UL << (chanid & VMBUS_EVTFLAG_MASK));
ret = hv_vmbus_signal_event(channel->signal_event_param);
return (ret);
Index: head/sys/dev/hyperv/vmbus/vmbus.c
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus.c
+++ head/sys/dev/hyperv/vmbus/vmbus.c
@@ -340,7 +340,7 @@
if (evtflags == NULL)
return ENOMEM;
sc->vmbus_rx_evtflags = (u_long *)evtflags;
- sc->vmbus_tx_evtflags = evtflags + (PAGE_SIZE / 2);
+ sc->vmbus_tx_evtflags = (u_long *)(evtflags + (PAGE_SIZE / 2));
sc->vmbus_evtflags = evtflags;
sc->vmbus_mnf1 = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0,
Index: head/sys/dev/hyperv/vmbus/vmbus_reg.h
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_reg.h
+++ head/sys/dev/hyperv/vmbus/vmbus_reg.h
@@ -66,6 +66,7 @@
#define VMBUS_EVTFLAG_SHIFT 5
#endif
#define VMBUS_EVTFLAG_LEN (1 << VMBUS_EVTFLAG_SHIFT)
+#define VMBUS_EVTFLAG_MASK (VMBUS_EVTFLAG_LEN - 1)
#define VMBUS_EVTFLAGS_SIZE 256
struct vmbus_evtflags {
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
@@ -63,7 +63,7 @@
struct vmbus_softc {
void (*vmbus_event_proc)(struct vmbus_softc *, int);
- void *vmbus_tx_evtflags;
+ u_long *vmbus_tx_evtflags;
/* event flags to host */
void *vmbus_mnf2; /* monitored by host */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 3:04 AM (10 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31883326
Default Alt Text
D6745.id17398.diff (3 KB)
Attached To
Mode
D6745: hyperv/vmbus: Change tx_evtflags type to u_long to match vmbus_evtflags
Attached
Detach File
Event Timeline
Log In to Comment