svn commit: r302726 - in head/sys/dev/hyperv: include vmbus

Sepherosa Ziehau sephe at FreeBSD.org
Wed Jul 13 09:19:35 UTC 2016


Author: sephe
Date: Wed Jul 13 09:19:33 2016
New Revision: 302726
URL: https://svnweb.freebsd.org/changeset/base/302726

Log:
  hyperv: Signal event input parameter is shared w/ MNF
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D7087

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/hv_channel.c
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/hyperv.c
  head/sys/dev/hyperv/vmbus/hyperv_reg.h
  head/sys/dev/hyperv/vmbus/hyperv_var.h

Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h	Wed Jul 13 09:15:12 2016	(r302725)
+++ head/sys/dev/hyperv/include/hyperv.h	Wed Jul 13 09:19:33 2016	(r302726)
@@ -551,8 +551,8 @@ typedef struct hv_vmbus_channel {
 	hv_vmbus_pfn_channel_callback	on_channel_callback;
 	void*				channel_callback_context;
 
-	struct hypercall_sigevt_in	*ch_sigevt;
-	struct hyperv_dma		ch_sigevt_dma;
+	struct hyperv_mon_param		*ch_monprm;
+	struct hyperv_dma		ch_monprm_dma;
 
 	/*
 	 * From Win8, this field specifies the target virtual process

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel.c	Wed Jul 13 09:15:12 2016	(r302725)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c	Wed Jul 13 09:19:33 2016	(r302726)
@@ -76,7 +76,7 @@ vmbus_channel_set_event(hv_vmbus_channel
 			(uint32_t *)&monitor_page->
 				trigger_group[channel->monitor_group].u.pending);
 	} else {
-		hypercall_signal_event(channel->ch_sigevt_dma.hv_paddr);
+		hypercall_signal_event(channel->ch_monprm_dma.hv_paddr);
 	}
 
 }

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c	Wed Jul 13 09:15:12 2016	(r302725)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c	Wed Jul 13 09:19:33 2016	(r302726)
@@ -296,20 +296,20 @@ vmbus_channel_on_offer_internal(struct v
 	if (offer->monitor_allocated)
 		new_channel->ch_flags |= VMBUS_CHAN_FLAG_HASMNF;
 
-	new_channel->ch_sigevt = hyperv_dmamem_alloc(
+	new_channel->ch_monprm = hyperv_dmamem_alloc(
 	    bus_get_dma_tag(sc->vmbus_dev),
-	    HYPERCALL_PARAM_ALIGN, 0, sizeof(struct hypercall_sigevt_in),
-	    &new_channel->ch_sigevt_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO);
-	if (new_channel->ch_sigevt == NULL) {
-		device_printf(sc->vmbus_dev, "sigevt alloc failed\n");
+	    HYPERCALL_PARAM_ALIGN, 0, sizeof(struct hyperv_mon_param),
+	    &new_channel->ch_monprm_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO);
+	if (new_channel->ch_monprm == NULL) {
+		device_printf(sc->vmbus_dev, "monprm alloc failed\n");
 		/* XXX */
 		mtx_destroy(&new_channel->sc_lock);
 		free(new_channel, M_DEVBUF);
 		return;
 	}
-	new_channel->ch_sigevt->hc_connid = VMBUS_CONNID_EVENT;
+	new_channel->ch_monprm->mp_connid = VMBUS_CONNID_EVENT;
 	if (sc->vmbus_version != VMBUS_VERSION_WS2008)
-		new_channel->ch_sigevt->hc_connid = offer->connection_id;
+		new_channel->ch_monprm->mp_connid = offer->connection_id;
 
 	new_channel->monitor_group = (uint8_t) offer->monitor_id / 32;
 	new_channel->monitor_bit = (uint8_t) offer->monitor_id % 32;

Modified: head/sys/dev/hyperv/vmbus/hyperv.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv.c	Wed Jul 13 09:15:12 2016	(r302725)
+++ head/sys/dev/hyperv/vmbus/hyperv.c	Wed Jul 13 09:19:33 2016	(r302726)
@@ -109,10 +109,10 @@ hypercall_post_message(bus_addr_t msg_pa
 }
 
 uint64_t
-hypercall_signal_event(bus_addr_t sigevt_paddr)
+hypercall_signal_event(bus_addr_t monprm_paddr)
 {
 	return hypercall_md(hypercall_context.hc_addr,
-	    HYPERCALL_SIGNAL_EVENT, sigevt_paddr, 0);
+	    HYPERCALL_SIGNAL_EVENT, monprm_paddr, 0);
 }
 
 int

Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv_reg.h	Wed Jul 13 09:15:12 2016	(r302725)
+++ head/sys/dev/hyperv/vmbus/hyperv_reg.h	Wed Jul 13 09:19:33 2016	(r302726)
@@ -133,6 +133,15 @@
 #define CPUID_LEAF_HV_HWFEATURES	0x40000006
 
 /*
+ * Hyper-V Monitor Notification Facility
+ */
+struct hyperv_mon_param {
+	uint32_t	mp_connid;
+	uint16_t	mp_evtflag_ofs;
+	uint16_t	mp_rsvd;
+} __packed;
+
+/*
  * Hyper-V message types
  */
 #define HYPERV_MSGTYPE_NONE		0
@@ -181,11 +190,8 @@ CTASSERT(sizeof(struct hypercall_postmsg
 
 /*
  * HYPERCALL_SIGNAL_EVENT
+ *
+ * struct hyperv_mon_param.
  */
-struct hypercall_sigevt_in {
-	uint32_t	hc_connid;
-	uint16_t	hc_evtflag_ofs;
-	uint16_t	hc_rsvd;
-} __packed;
 
 #endif	/* !_HYPERV_REG_H_ */

Modified: head/sys/dev/hyperv/vmbus/hyperv_var.h
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv_var.h	Wed Jul 13 09:15:12 2016	(r302725)
+++ head/sys/dev/hyperv/vmbus/hyperv_var.h	Wed Jul 13 09:19:33 2016	(r302726)
@@ -39,6 +39,6 @@ extern u_int	hyperv_features;
 extern u_int	hyperv_recommends;
 
 uint64_t	hypercall_post_message(bus_addr_t msg_paddr);
-uint64_t	hypercall_signal_event(bus_addr_t sigevt_paddr);
+uint64_t	hypercall_signal_event(bus_addr_t monprm_paddr);
 
 #endif	/* !_HYPERV_VAR_H_ */


More information about the svn-src-head mailing list