From owner-svn-src-head@freebsd.org Wed Jul 13 09:11:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC35FB97C38; Wed, 13 Jul 2016 09:11:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE3571869; Wed, 13 Jul 2016 09:11:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6D9B3Gm080548; Wed, 13 Jul 2016 09:11:03 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6D9B3pP080545; Wed, 13 Jul 2016 09:11:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607130911.u6D9B3pP080545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 13 Jul 2016 09:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302723 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2016 09:11:05 -0000 Author: sephe Date: Wed Jul 13 09:11:03 2016 New Revision: 302723 URL: https://svnweb.freebsd.org/changeset/base/302723 Log: hyperv: All Hypercall parameters have same alignment requirement. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7086 Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/hyperv_reg.h head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:09:34 2016 (r302722) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jul 13 09:11:03 2016 (r302723) @@ -298,7 +298,7 @@ vmbus_channel_on_offer_internal(struct v 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"); Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Wed Jul 13 09:09:34 2016 (r302722) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Wed Jul 13 09:11:03 2016 (r302723) @@ -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 /* * HYPERCALL_SIGNAL_EVENT */ -#define HYPERCALL_SIGEVTIN_ALIGN 8 - struct hypercall_sigevt_in { uint32_t hc_connid; uint16_t hc_evtflag_ofs; Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Wed Jul 13 09:09:34 2016 (r302722) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Jul 13 09:11:03 2016 (r302723) @@ -130,7 +130,7 @@ vmbus_msghc_alloc(bus_dma_tag_t parent_d 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);