lkml.org 
[lkml]   [2022]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] swiotlb: avoid potential left shift overflow
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.

\
 
 \ /
  Last update: 2022-08-20 03:44    [W:0.097 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site