[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e22ae13a-aafc-49da-8092-1a17f60ae420@rowland.harvard.edu>
Date: Tue, 5 Dec 2023 13:28:23 -0500
From: Alan Stern <stern@...land.harvard.edu>
To: Catalin Marinas <catalin.marinas@....com>
Cc: Ferry Toth <ferry.toth@...inga.info>,
Ferry Toth <fntoth@...il.com>, Christoph Hellwig <hch@....de>,
Hamza Mahfooz <someguy@...ective-light.com>,
Dan Williams <dan.j.williams@...el.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Andrew <travneff@...il.com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Thorsten Leemhuis <regressions@...mhuis.info>,
iommu@...ts.linux.dev,
Kernel development list <linux-kernel@...r.kernel.org>,
USB mailing list <linux-usb@...r.kernel.org>,
Robin Murphy <robin.murphy@....com>,
Will Deacon <will@...nel.org>
Subject: Re: Bug in add_dma_entry()'s debugging code
On Fri, Dec 01, 2023 at 05:42:52PM +0000, Catalin Marinas wrote:
> Indeed, so to be sure we don't trip over other false alarms, we'd also
> need to force ARCH_DMA_MINALIGN to be at least a cache-line size. That's
> used in some structures to force a static alignment of various members
> that take DMA transfers. After that, anything reported might actually be
> a potential issue, not a false alarm.
>
> However, I wonder whether we'd actually hide some genuine problems.
> Let's say x86 gets some DMA corruption when it tries to DMA 8 bytes
> into two adjacent buffers because of some DMA buffer overflow, nothing
> to do with cache lines. You enable the DMA API debugging to see if it
> reports anything and it suddenly starts working because of the forced
> minimum alignment.
In the long run, it may turn out that trying to detect memory usage
patterns that could cause problems for architectures other than the one
currently running is not workable. Certainly it is a bad idea to have a
debugging infrastructure that changes the behavior of other parts of the
system -- particularly when those other parts may be the ones you're
trying to debug.
You may end up needing to make a choice here. Which evil is lesser?
Alan Stern
Powered by blists - more mailing lists