diff --git a/sys/dev/hyperv/vmbus/hv_channel_mgmt.c b/sys/dev/hyperv/vmbus/hv_channel_mgmt.c index ed1f0690cbd3..574ef3834743 100644 --- a/sys/dev/hyperv/vmbus/hv_channel_mgmt.c +++ b/sys/dev/hyperv/vmbus/hv_channel_mgmt.c @@ -298,7 +298,7 @@ vmbus_channel_on_offer_internal(struct vmbus_softc *sc, new_channel->ch_sigevt = hyperv_dmamem_alloc( bus_get_dma_tag(sc->vmbus_dev), - HYPERCALL_SIGEVTIN_ALIGN, 0, sizeof(struct hypercall_sigevt_in), + 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"); diff --git a/sys/dev/hyperv/vmbus/hyperv_reg.h b/sys/dev/hyperv/vmbus/hyperv_reg.h index 20f48106062d..6cb5e9dbfad6 100644 --- a/sys/dev/hyperv/vmbus/hyperv_reg.h +++ b/sys/dev/hyperv/vmbus/hyperv_reg.h @@ -153,13 +153,22 @@ /* * Hypercall input parameters */ +#define HYPERCALL_PARAM_ALIGN 8 +#if 0 +/* + * XXX + * <> requires + * input parameters size to be multiple of 8, however, many post + * message input parameters do _not_ meet this requirement. + */ +#define HYPERCALL_PARAM_SIZE_ALIGN 8 +#endif /* * HYPERCALL_POST_MESSAGE */ #define HYPERCALL_POSTMSGIN_DSIZE_MAX 240 #define HYPERCALL_POSTMSGIN_SIZE 256 -#define HYPERCALL_POSTMSGIN_ALIGN 8 struct hypercall_postmsg_in { uint32_t hc_connid; @@ -173,8 +182,6 @@ CTASSERT(sizeof(struct hypercall_postmsg_in) == HYPERCALL_POSTMSGIN_SIZE); /* * HYPERCALL_SIGNAL_EVENT */ -#define HYPERCALL_SIGEVTIN_ALIGN 8 - struct hypercall_sigevt_in { uint32_t hc_connid; uint16_t hc_evtflag_ofs; diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index 14f3fef028bd..36bb036d4dc4 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -130,7 +130,7 @@ vmbus_msghc_alloc(bus_dma_tag_t parent_dtag) mh = malloc(sizeof(*mh), M_DEVBUF, M_WAITOK | M_ZERO); mh->mh_inprm = hyperv_dmamem_alloc(parent_dtag, - HYPERCALL_POSTMSGIN_ALIGN, 0, HYPERCALL_POSTMSGIN_SIZE, + HYPERCALL_PARAM_ALIGN, 0, HYPERCALL_POSTMSGIN_SIZE, &mh->mh_inprm_dma, BUS_DMA_WAITOK); if (mh->mh_inprm == NULL) { free(mh, M_DEVBUF);