[PATCH 2/2] virtio_ring: Use DMA API if memory is encrypted

David Gibson david at gibson.dropbear.id.au
Mon Oct 14 15:52:35 AEDT 2019


On Fri, Oct 11, 2019 at 06:25:19PM -0700, Ram Pai wrote:
> From: Thiago Jung Bauermann <bauerman at linux.ibm.com>
> 
> Normally, virtio enables DMA API with VIRTIO_F_IOMMU_PLATFORM, which must
> be set by both device and guest driver. However, as a hack, when DMA API
> returns physical addresses, guest driver can use the DMA API; even though
> device does not set VIRTIO_F_IOMMU_PLATFORM and just uses physical
> addresses.
> 
> Doing this works-around POWER secure guests for which only the bounce
> buffer is accessible to the device, but which don't set
> VIRTIO_F_IOMMU_PLATFORM due to a set of hypervisor and architectural bugs.
> To guard against platform changes, breaking any of these assumptions down
> the road, we check at probe time and fail if that's not the case.
> 
> cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> cc: David Gibson <david at gibson.dropbear.id.au>
> cc: Michael Ellerman <mpe at ellerman.id.au>
> cc: Paul Mackerras <paulus at ozlabs.org>
> cc: Michael Roth <mdroth at linux.vnet.ibm.com>
> cc: Alexey Kardashevskiy <aik at linux.ibm.com>
> cc: Jason Wang <jasowang at redhat.com>
> cc: Christoph Hellwig <hch at lst.de>
> Suggested-by: Michael S. Tsirkin <mst at redhat.com>
> Signed-off-by: Ram Pai <linuxram at us.ibm.com>
> Signed-off-by: Thiago Jung Bauermann <bauerman at linux.ibm.com>

Reviewed-by: David Gibson <david at gibson.dropbear.id.au>

I don't know that this is the most elegant solution possible.  But
it's simple, gets the job done and pretty unlikely to cause mysterious
breakage down the road.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20191014/49303e65/attachment.sig>


More information about the Linuxppc-dev mailing list