Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe bus_dmamem_unmap() before bus_dmamem_free(...



details:   https://anonhg.NetBSD.org/src/rev/a8f3564bf5b1
branches:  trunk
changeset: 366046:a8f3564bf5b1
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed May 11 17:22:20 2022 +0000

description:
bus_dmamem_unmap() before bus_dmamem_free(), otherwise we may give back meomry
which is still (and will stay) mapped.

Fixes one instance of "panic: HYPERVISOR_mmu_update failed" on Xen.
There may be others.

diffstat:

 sys/dev/pci/ixgbe/ix_txrx.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 689a7362252f -r a8f3564bf5b1 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c       Wed May 11 16:22:46 2022 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c       Wed May 11 17:22:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.97 2022/04/25 07:51:12 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.98 2022/05/11 17:22:20 bouyer Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.97 2022/04/25 07:51:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.98 2022/05/11 17:22:20 bouyer Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -2309,6 +2309,7 @@
        bus_dmamap_sync(dma->dma_tag->dt_dmat, dma->dma_map, 0, dma->dma_size,
            BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
        ixgbe_dmamap_unload(dma->dma_tag, dma->dma_map);
+       bus_dmamem_unmap(dma->dma_tag->dt_dmat, dma->dma_vaddr, dma->dma_size);
        bus_dmamem_free(dma->dma_tag->dt_dmat, &dma->dma_seg, 1);
        ixgbe_dma_tag_destroy(dma->dma_tag);
 } /* ixgbe_dma_free */



Home | Main Index | Thread Index | Old Index