[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v13 01/12] swiotlb: Refactor swiotlb init functions
 
- To: Tom Lendacky <thomas.lendacky@xxxxxxx>
 
- From: Christoph Hellwig <hch@xxxxxx>
 
- Date: Fri, 18 Jun 2021 16:32:12 +0200
 
- Cc: Claire Chang <tientzu@xxxxxxxxxxxx>,	Stefano Stabellini <sstabellini@xxxxxxxxxx>,	Rob Herring <robh+dt@xxxxxxxxxx>, mpe@xxxxxxxxxxxxxx,	Joerg Roedel <joro@xxxxxxxxxx>, Will Deacon <will@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>,	Robin Murphy <robin.murphy@xxxxxxx>, 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
 
- Delivery-date: Fri, 18 Jun 2021 14:32:24 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On Fri, Jun 18, 2021 at 09:09:17AM -0500, Tom Lendacky wrote:
> > swiotlb_init_with_tbl uses memblock_alloc to allocate the io_tlb_mem
> > and memblock_alloc[1] will do memset in memblock_alloc_try_nid[2], so
> > swiotlb_init_with_tbl is also good.
> > I'm happy to add the memset in swiotlb_init_io_tlb_mem if you think
> > it's clearer and safer.
> 
> On x86, if the memset is done before set_memory_decrypted() and memory
> encryption is active, then the memory will look like ciphertext afterwards
> and not be zeroes. If zeroed memory is required, then a memset must be
> done after the set_memory_decrypted() calls.
Which should be fine - we don't care that the memory is cleared to 0,
just that it doesn't leak other data.  Maybe a comment would be useful,
though,
 
 
    
     |