From: "Petr Tesařík" <petr@tesarici.cz>
To: Dexuan Cui <decui@microsoft.com>
Cc: Dexuan-Linux Cui <dexuan.linux@gmail.com>,
Petr Tesarik <petrtesarik@huaweicloud.com>,
Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Jianxiong Gao <jxgao@google.com>,
David Stevens <stevensd@chromium.org>,
Joerg Roedel <jroedel@suse.de>,
"open list:DMA MAPPING HELPERS" <iommu@lists.linux.dev>,
open list <linux-kernel@vger.kernel.org>,
Roberto Sassu <roberto.sassu@huawei.com>,
"Michael Kelley (LINUX)" <mikelley@microsoft.com>,
Tianyu Lan <Tianyu.Lan@microsoft.com>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Subject: Re: [PATCH v1 2/2] swiotlb: Fix slot alignment checks
Date: Wed, 5 Apr 2023 08:07:03 +0200 [thread overview]
Message-ID: <20230405080703.61c6d60a@meshulam.tesarici.cz> (raw)
In-Reply-To: <SA1PR21MB1335CF4B7E9B1EC61B84AA03BF909@SA1PR21MB1335.namprd21.prod.outlook.com>
On Wed, 5 Apr 2023 06:00:13 +0000
Dexuan Cui <decui@microsoft.com> wrote:
> > From: Petr Tesařík <petr@tesarici.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
next prev parent reply other threads:[~2023-04-05 6:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1679382779.git.petr.tesarik.ext@huawei.com>
[not found] ` <c90887e4d75344abe219cc5e12f7c6dab980cfce.1679382779.git.petr.tesarik.ext@huawei.com>
2023-04-04 19:55 ` [PATCH v1 2/2] swiotlb: Fix slot alignment checks Dexuan-Linux Cui
2023-04-04 20:11 ` Dexuan Cui
2023-04-05 4:40 ` Petr Tesařík
2023-04-05 5:11 ` Dexuan Cui
2023-04-05 5:32 ` Petr Tesařík
2023-04-05 5:50 ` Petr Tesařík
2023-04-05 6:00 ` Dexuan Cui
2023-04-05 6:07 ` Petr Tesařík [this message]
2023-04-05 6:34 ` Dexuan Cui
2023-04-06 4:52 ` Kelsey Steele
2023-04-06 14:42 ` Petr Tesarik
2023-04-07 4:13 ` Kelsey Steele
2023-04-11 15:46 ` Petr Tesarik
2023-04-05 12:24 ` Linux regression tracking #adding (Thorsten Leemhuis)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230405080703.61c6d60a@meshulam.tesarici.cz \
--to=petr@tesarici.cz \
--cc=Tianyu.Lan@microsoft.com \
--cc=decui@microsoft.com \
--cc=dexuan.linux@gmail.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=jroedel@suse.de \
--cc=jxgao@google.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mikelley@microsoft.com \
--cc=petrtesarik@huaweicloud.com \
--cc=roberto.sassu@huawei.com \
--cc=robin.murphy@arm.com \
--cc=stevensd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox