[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v14 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing
- To: Qian Cai <quic_qiancai@xxxxxxxxxxx>
- From: Will Deacon <will@xxxxxxxxxx>
- Date: Wed, 23 Jun 2021 19:37:37 +0100
- Cc: Claire Chang <tientzu@xxxxxxxxxxxx>, Rob Herring <robh+dt@xxxxxxxxxx>, mpe@xxxxxxxxxxxxxx, Joerg Roedel <joro@xxxxxxxxxx>, Frank Rowand <frowand.list@xxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, boris.ostrovsky@xxxxxxxxxx, jgross@xxxxxxxx, Christoph Hellwig <hch@xxxxxx>, Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>, heikki.krogerus@xxxxxxxxxxxxxxx, thomas.hellstrom@xxxxxxxxxxxxxxx, peterz@xxxxxxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, joonas.lahtinen@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, chris@xxxxxxxxxxxxxxxxxx, grant.likely@xxxxxxx, paulus@xxxxxxxxx, mingo@xxxxxxxxxx, jxgao@xxxxxxxxxx, sstabellini@xxxxxxxxxx, Saravana Kannan <saravanak@xxxxxxxxxx>, xypron.glpk@xxxxxx, "Rafael J . Wysocki" <rafael.j.wysocki@xxxxxxxxx>, Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx>, bskeggs@xxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Thierry Reding <treding@xxxxxxxxxx>, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, matthew.auld@xxxxxxxxx, linux-devicetree <devicetree@xxxxxxxxxxxxxxx>, daniel@xxxxxxxx, airlied@xxxxxxxx, maarten.lankhorst@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, jani.nikula@xxxxxxxxxxxxxxx, Nicolas Boichat <drinkcat@xxxxxxxxxxxx>, rodrigo.vivi@xxxxxxxxx, bhelgaas@xxxxxxxxxx, Dan Williams <dan.j.williams@xxxxxxxxx>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, "list@xxxxxxx:IOMMU DRIVERS" <iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx>, Jim Quinlan <james.quinlan@xxxxxxxxxxxx>, thomas.lendacky@xxxxxxx, Robin Murphy <robin.murphy@xxxxxxx>, bauerman@xxxxxxxxxxxxx
- Delivery-date: Wed, 23 Jun 2021 18:38:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Jun 23, 2021 at 12:39:29PM -0400, Qian Cai wrote:
>
>
> On 6/18/2021 11:40 PM, Claire Chang wrote:
> > Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and
> > use it to determine whether to bounce the data or not. This will be
> > useful later to allow for different pools.
> >
> > Signed-off-by: Claire Chang <tientzu@xxxxxxxxxxxx>
> > Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> > Tested-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> > Tested-by: Will Deacon <will@xxxxxxxxxx>
> > Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>
> Reverting the rest of the series up to this patch fixed a boot crash with
> NVMe on today's linux-next.
Hmm, so that makes patch 7 the suspicious one, right?
Looking at that one more closely, it looks like swiotlb_find_slots() takes
'alloc_size + offset' as its 'alloc_size' parameter from
swiotlb_tbl_map_single() and initialises 'mem->slots[i].alloc_size' based
on 'alloc_size + offset', which looks like a change in behaviour from the
old code, which didn't include the offset there.
swiotlb_release_slots() then adds the offset back on afaict, so we end up
accounting for it twice and possibly unmap more than we're supposed to?
Will
|