Re: Memory corruption with CONFIG_SWIOTLB_DYNAMIC=y

From: Petr Tesařík
Date: Tue Nov 28 2023 - 02:16:21 EST


On Mon, 27 Nov 2023 16:59:13 +0100
Christoph Hellwig <hch@xxxxxx> wrote:

> On Thu, Nov 23, 2023 at 11:16:08AM +0100, Petr Tesařík wrote:
> > > To sum it up, there are two types of alignment:
> > >
> > > 1. specified by a device's min_align_mask; this says how many low
> > > bits of a buffer's physical address must be preserved,
> > >
> > > 2. specified by allocation size and/or the alignment parameter;
> > > this says how many low bits in the first IO TLB slot's physical
> > > address must be zero.
>
> Both are correct.

Great! Thank you for confirmation. Unfortunately, that's not quite how
the code works now.

I'm on it to fix things.

Petr T