git: a319ba694538 - main - hyperv/storvsc: Fix busdma constraints
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 31 Mar 2025 11:16:14 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a319ba694538a38429115aaaf1d4b3946ea3a8b5 commit a319ba694538a38429115aaaf1d4b3946ea3a8b5 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2025-03-31 10:45:14 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2025-03-31 11:14:42 +0000 hyperv/storvsc: Fix busdma constraints - The BUS_DMA_KEEP_PG_OFFSET flag is needed, since storvsc_xferbuf_prepare() assumes that only the first segment may have a non-zero offset, and that all following segments are page-sized and -aligned. - storvsc_xferbuf_prepare() handles 64-bit bus addresses, so avoid unneeded bouncing on i386. PR: 285681 Reported by: dim Tested by: dim, whu MFC after: 2 weeks --- sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c index eeec169baac5..cc3e7262e8d7 100644 --- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c +++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c @@ -954,13 +954,18 @@ storvsc_init_requests(device_t dev) bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ PAGE_SIZE, /* boundary */ +#if defined(__i386__) && defined(PAE) + BUS_SPACE_MAXADDR_48BIT, /* lowaddr */ + BUS_SPACE_MAXADDR_48BIT, /* highaddr */ +#else BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ +#endif NULL, NULL, /* filter, filterarg */ STORVSC_DATA_SIZE_MAX, /* maxsize */ STORVSC_DATA_SEGCNT_MAX, /* nsegments */ STORVSC_DATA_SEGSZ_MAX, /* maxsegsize */ - 0, /* flags */ + BUS_DMA_KEEP_PG_OFFSET, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ &sc->storvsc_req_dtag);