Index | Thread | Search

From:
Vitaliy Makkoveev <mvs@openbsd.org>
Subject:
Re: iwx 64-bit dma
To:
Theo de Raadt <deraadt@openbsd.org>
Cc:
Chris Cappuccio <chris@nmedia.net>, Brad Smith <brad@comstyle.com>, tech@openbsd.org, stsp@openbsd.org
Date:
Fri, 31 Jul 2026 22:52:55 +0000

Download raw body.

Thread
  • Theo de Raadt:

    iwx 64-bit dma

    • Vitaliy Makkoveev:

      iwx 64-bit dma

  • On Fri, Jul 31, 2026 at 07:44:21AM -0600, Theo de Raadt wrote:
    > Well I am glad I asked the question....
    > 
    
    So, iwx(4) should follow em(4)/re(4) way and enable 64 bits DMA only for
    capable chipsets.
    
    
            if (sc->hw.bus_type == em_bus_type_pci_express)
                    sc->sc_dmaflags |= BUS_DMA_64BIT;
    	/* ... */
    	r = bus_dmamap_create(sc->sc_dmat, ..., sc->sc_dmaflags, ...);
    	/* ... */
            if (ISSET(sc->sc_dmaflags, BUS_DMA_64BIT))
                    ifp->if_xflags |= IFXF_MBUF_64BIT;
    
    
    
    
    > > Theo de Raadt [deraadt@openbsd.org] wrote:
    > > > 
    > > > The diff in question which adds BUS_DMA_64BIT is a declaration to
    > > > the higher-level code that _all_ chipsets supported by this driver can
    > > > work with 64 bit-addressable memory if the higher levels provide it.
    > > > 
    > > 
    > > Linux iwlwifi has a 36-bit dma limit for older hardware. For the
    > > AX200/201 and the AX210/211 it's 64-bit all the way. So iwx is
    > > doing the right thing.
    > > 
    > > However, there is a bug with the AX200/201 dma engine crossing 32-bit
    > > boundaries:
    > > 
    > > https://code.opensuse.org/kernel/kernel-source/blob/5377a688dcc5c526f0a5df6d91df22d8b4f2dce6/f/patches.suse/iwlwifi-pcie-extend-hardware-workaround-to-context-i.patch
    > > 
    > > To avoid triggering it, we'd need to do something like this with
    > > any post-IOMMU addresses:
    > > 
    > > iwx_crosses_4g_boundary(struct iwx_softc *sc, bus_addr_t addr, bus_size_t len) {
    > > 	if (sc->sc_device_family != IWX_DEVICE_FAMILY_22000)
    > > 		return 0;
    > > 
    > > 	return (addr >> 32) != ((addr + len) >> 32);
    > > }
    > > ...
    > > 	for (i = 0; i < map->dm_nsegs; i++) {
    > > 		if (iwx_crosses_4g_boundary(sc, map->dm_segs[i].ds_addr,
    > > 		    map->dm_segs[i].ds_len)) {
    > > 			/* remap */
    > > 		}
    > > 	}
    > 
    
    
  • Theo de Raadt:

    iwx 64-bit dma