git: 07c5a2486cc6 - stable/14 - hyperv/storvsc: Fix busdma constraints
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 15 Apr 2025 02:25:34 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=07c5a2486cc6f8e64715b5d7c31ccfa02f9f3745
commit 07c5a2486cc6f8e64715b5d7c31ccfa02f9f3745
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-03-31 10:45:14 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-04-15 02:25:24 +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
(cherry picked from commit a319ba694538a38429115aaaf1d4b3946ea3a8b5)
---
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 d7e7bd85ae29..076b436a2191 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);