hyperv: Signal event input parameter is shared w/ MNF

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7087
This commit is contained in:
Sepherosa Ziehau 2016-07-13 09:19:33 +00:00
parent a570251d00
commit 562d480b7d
6 changed files with 24 additions and 18 deletions

View File

@ -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

View File

@ -76,7 +76,7 @@ vmbus_channel_set_event(hv_vmbus_channel *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);
}
}

View File

@ -296,20 +296,20 @@ vmbus_channel_on_offer_internal(struct vmbus_softc *sc,
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;

View File

@ -109,10 +109,10 @@ hypercall_post_message(bus_addr_t msg_paddr)
}
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

View File

@ -132,6 +132,15 @@
#define CPUID_LEAF_HV_LIMITS 0x40000005
#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
*/
@ -181,11 +190,8 @@ CTASSERT(sizeof(struct hypercall_postmsg_in) == HYPERCALL_POSTMSGIN_SIZE);
/*
* 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_ */

View File

@ -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_ */