[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing
 
- To: Will Deacon <will@xxxxxxxxxx>
 
- From: Christoph Hellwig <hch@xxxxxx>
 
- Date: Tue, 6 Jul 2021 06:48:48 +0200
 
- Cc: Nathan Chancellor <nathan@xxxxxxxxxx>,	Robin Murphy <robin.murphy@xxxxxxx>,	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>,	benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx,	"list@xxxxxxx:IOMMU DRIVERS" <iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx>,	Stefano Stabellini <sstabellini@xxxxxxxxxx>, grant.likely@xxxxxxx,	xypron.glpk@xxxxxx, Thierry Reding <treding@xxxxxxxxxx>,	mingo@xxxxxxxxxx, bauerman@xxxxxxxxxxxxx, peterz@xxxxxxxxxxxxx,	Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>,	Saravana Kannan <saravanak@xxxxxxxxxx>,	"Rafael J . Wysocki" <rafael.j.wysocki@xxxxxxxxx>,	heikki.krogerus@xxxxxxxxxxxxxxx,	Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>,	Randy Dunlap <rdunlap@xxxxxxxxxxxxx>,	Dan Williams <dan.j.williams@xxxxxxxxx>,	Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx>,	linux-devicetree <devicetree@xxxxxxxxxxxxxxx>,	lkml <linux-kernel@xxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx,	xen-devel@xxxxxxxxxxxxxxxxxxxx,	Nicolas Boichat <drinkcat@xxxxxxxxxxxx>,	Jim Quinlan <james.quinlan@xxxxxxxxxxxx>,	Tomasz Figa <tfiga@xxxxxxxxxxxx>, bskeggs@xxxxxxxxxx,	Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, chris@xxxxxxxxxxxxxxxxxx,	Daniel Vetter <daniel@xxxxxxxx>, airlied@xxxxxxxx,	dri-devel@xxxxxxxxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx,	jani.nikula@xxxxxxxxxxxxxxx, Jianxiong Gao <jxgao@xxxxxxxxxx>,	joonas.lahtinen@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx,	maarten.lankhorst@xxxxxxxxxxxxxxx, matthew.auld@xxxxxxxxx,	rodrigo.vivi@xxxxxxxxx, thomas.hellstrom@xxxxxxxxxxxxxxx,	Tom Lendacky <thomas.lendacky@xxxxxxx>,	Qian Cai <quic_qiancai@xxxxxxxxxxx>
 
- Delivery-date: Tue, 06 Jul 2021 04:49:00 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On Mon, Jul 05, 2021 at 08:03:52PM +0100, Will Deacon wrote:
> So at this point, the AMD IOMMU driver does:
> 
>       swiotlb        = (iommu_default_passthrough() || sme_me_mask) ? 1 : 0;
> 
> where 'swiotlb' is a global variable indicating whether or not swiotlb
> is in use. It's picked up a bit later on by pci_swiotlb_late_init(), which
> will call swiotlb_exit() if 'swiotlb' is false.
> 
> Now, that used to work fine, because swiotlb_exit() clears
> 'io_tlb_default_mem' to NULL, but now with the restricted DMA changes, I
> think that all the devices which have successfully probed beforehand will
> have stale pointers to the freed structure in their 'dev->dma_io_tlb_mem'
> field.
Yeah.  I don't think we can do that anymore, and I also think it is
a bad idea to start with.
 
 
    
     |