lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 27 Mar 2022 15:24:48 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Linus Torvalds' <>,
        Halil Pasic <>
CC:     Toke Høiland-Jørgensen <>,
        Robin Murphy <>,
        Christoph Hellwig <>,
        Maxime Bizon <>,
        Oleksandr Natalenko <>,
        "Marek Szyprowski" <>,
        Kalle Valo <>,
        "David S. Miller" <>,
        Jakub Kicinski <>,
        "Paolo Abeni" <>,
        Olha Cherevyk <>,
        iommu <>,
        linux-wireless <>,
        Netdev <>,
        "Linux Kernel Mailing List" <>,
        Greg Kroah-Hartman <>,
        stable <>
Subject: RE: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break
 ath9k-based AP

From: Linus Torvalds
> Sent: 27 March 2022 06:21
> On Sat, Mar 26, 2022 at 10:06 PM Linus Torvalds
> <> wrote:
> >
> > On Sat, Mar 26, 2022 at 8:49 PM Halil Pasic <> wrote:
> > >
> > > I agree it CPU modified buffers *concurrently* with DMA can never work,
> > > and I believe the ownership model was conceived to prevent this
> > > situation.
> >
> > But that just means that the "ownership" model is garbage, and cannot
> > handle this REAL LIFE situation.
> Just to clarify: I obviously agree that the "both sides modify
> concurrently" obviously cannot work with bounce buffers.

Aren't bounce buffers just a more extreme case on non-coherent
memory accesses?
They just need explicit memory copies rather than just cache
writeback and invalidate operations.

So 'both sides modify concurrently' just has the same issue
as it does with non-coherent memory in that the locations
need to be in separate (dma) cache lines.
Indeed, if the bounce buffers are actually coherent then
arbitrary concurrent updates are possible.

One issue is that the driver needs to indicate which parts
of any buffer are dirty.
Whereas the any 'cache writeback' request will only write
dirty data.

Get everything right and you can even support hardware where
the 'bounce buffers' are actually on the card and the copies
are MMIO (or better, especially on PCIe, synchronous host
initiated dma transfers).


Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists