From: Chao Gao <chao.gao@intel.com>
To: Dongli Zhang <dongli.zhang@oracle.com>
Cc: <linux-kernel@vger.kernel.org>, <iommu@lists.linux.dev>,
<hch@infradead.org>, <m.szyprowski@samsung.com>,
<robin.murphy@arm.com>, <jxgao@google.com>,
<konrad.wilk@oracle.com>
Subject: Re: [PATCH v2] swiotlb: avoid potential left shift overflow
Date: Sat, 20 Aug 2022 09:42:38 +0800 [thread overview]
Message-ID: <YwA8DttmM7wgYuHv@gao-cwp> (raw)
In-Reply-To: <38c58aa0-11c7-f553-95fd-292fd4944a75@oracle.com>
On Fri, Aug 19, 2022 at 06:44:05AM -0700, Dongli Zhang wrote:
>I also encountered this when sending out another version of the 64-bit swiotlb.
>
>https://lore.kernel.org/all/20220609005553.30954-8-dongli.zhang@oracle.com/
>
>Unfortunately, I could not find an environment (e.g., powerpc) to allocate more
>than 4G until swiotlb supports 64-bit.
>
>Although xen supports 64-bit, but the hypervisor side limits the max to < 4G.
Sorry. I didn't notice your series before. I agree that the overflow
isn't an issue if swiotlb size cannot be larger than 4GB. That's why
I said the overflow is a potential issue.
In an internal effort to measure the impact of swiotlb size to IO
performance of confidential VM (e.g., TDX VM), we simply added
SWIOTLB_ANY to the default io_tlb_mem to lift the restriction on swiotlb
size. Then we hit this issue and worked out this fix. I posted this
fix because I think the fix by itself is helpful because it removes the
implicit dependency of the left-shift in slot_addr() on swiotlb size and
then someone trying to lift the size limitation won't hit the same issue.
next prev parent reply other threads:[~2022-08-20 1:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 8:45 Chao Gao
2022-08-19 13:44 ` Dongli Zhang
2022-08-20 1:42 ` Chao Gao [this message]
2022-08-20 2:50 ` Dongli Zhang
2022-08-22 11:17 ` Christoph Hellwig
2022-09-07 8:39 ` Christoph Hellwig
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=YwA8DttmM7wgYuHv@gao-cwp \
--to=chao.gao@intel.com \
--cc=dongli.zhang@oracle.com \
--cc=hch@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=jxgao@google.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
/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
all inboxes | Powered by JetHome®