kernel - Fix busdma allocation bug
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 16 Jan 2018 00:42:00 +0000 (16:42 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 16 Jan 2018 00:42:00 +0000 (16:42 -0800)
commit3124cc72c2e91c6faba65eee98ae1f37165654e0
treee2e22682b6efa04fc4da9a7c6f5764429860bec0
parent8084c22db6f29f23655463a995fbbe545bd6f88f
kernel - Fix busdma allocation bug

* Fix a bug where kmalloc() could be used to allocate DMA memory
  that the caller intends to be non-cacheable.

  If a non-cacheable tag is specified, bus_dma now uses contigmalloc.

* Use the bus_dmamap_t pointer to differentiate between kmalloc
  and contigmalloc allocated memory, instead of running tag tests.

  This is a bit of a hack, but its the easiest solution.
sys/platform/pc64/x86_64/busdma_machdep.c
sys/sys/bus_dma.h