diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-06-09 12:52:05 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-06-09 12:52:05 +0000 |
commit | 4278c0bb859e210815c1f8284759fc2f3e7bd1d0 (patch) | |
tree | dc75f61011ee02480e7acbe7fbd651e083f7e8b4 /sys/arch/amd64 | |
parent | 5eba82b3ea36ead9ef81367e1f0da7ddf3451104 (diff) |
Allow memory that isn't (32-bit) DMA reachable when loading a map that was
created with the BUS_DMA_64BIT flag.
ok jsg@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/bus_dma.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c index 60ffac293ca..19a366115f9 100644 --- a/sys/arch/amd64/amd64/bus_dma.c +++ b/sys/arch/amd64/amd64/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.50 2017/10/14 04:44:43 jsg Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.51 2019/06/09 12:52:04 kettenis Exp $ */ /* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -319,7 +319,8 @@ _bus_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map, bus_dma_segment_t *segs, if (plen < sgsize) sgsize = plen; - if (paddr > dma_constraint.ucr_high) + if (paddr > dma_constraint.ucr_high && + (map->_dm_flags & BUS_DMA_64BIT) == 0) panic("Non dma-reachable buffer at paddr %#lx(raw)", paddr); @@ -583,7 +584,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, */ pmap_extract(pmap, vaddr, (paddr_t *)&curaddr); - if (curaddr > dma_constraint.ucr_high) + if (curaddr > dma_constraint.ucr_high && + (map->_dm_flags & BUS_DMA_64BIT) == 0) panic("Non dma-reachable buffer at curaddr %#lx(raw)", curaddr); |