[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230405080703.61c6d60a@meshulam.tesarici.cz>
Date: Wed, 5 Apr 2023 08:07:03 +0200
From: Petr Tesařík <petr@...arici.cz>
To: Dexuan Cui <decui@...rosoft.com>
Cc: Dexuan-Linux Cui <dexuan.linux@...il.com>,
Petr Tesarik <petrtesarik@...weicloud.com>,
Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Jianxiong Gao <jxgao@...gle.com>,
David Stevens <stevensd@...omium.org>,
Joerg Roedel <jroedel@...e.de>,
"open list:DMA MAPPING HELPERS" <iommu@...ts.linux.dev>,
open list <linux-kernel@...r.kernel.org>,
Roberto Sassu <roberto.sassu@...wei.com>,
"Michael Kelley (LINUX)" <mikelley@...rosoft.com>,
Tianyu Lan <Tianyu.Lan@...rosoft.com>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>
Subject: Re: [PATCH v1 2/2] swiotlb: Fix slot alignment checks
On Wed, 5 Apr 2023 06:00:13 +0000
Dexuan Cui <decui@...rosoft.com> wrote:
> > From: Petr Tesařík <petr@...arici.cz>
> > Sent: Tuesday, April 4, 2023 10:51 PM
> > > ...
> > > Argh, you're right. This is a braino. The alignment mask is in fact an
> > > INVERTED mask, i.e. it masks off bits that are not relevant for the
> > > alignment. The more strict alignment needed the more bits must be set,
> > > so the individual alignment constraints must be combined with an OR
> > > instead of an AND.
> > >
> > > Can you apply the following change and check if it fixes the issue?
> >
> > Actually, this will not work either. The mask is used to mask off both
> It works for me.
Yes, as long as the original (non-bounced) address is aligned at least
to a 2K boundary, it appears to work. ;-)
> > high address bits and low address bits (below swiotlb slot granularity).
> >
> > What should help is this:
> > ...
> This also works for me.
>
> Thanks, *either* version can resolve the issue for me :-)
Thank you for testing! I will write a proper commit message and submit
a fix. Embarassing... *sigh*
Can I add your Tested-by?
Petr T
Powered by blists - more mailing lists