Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Lendacky, Thomas
On 7/24/19 1:40 PM, Kirill A. Shutemov wrote: > On Wed, Jul 24, 2019 at 06:30:21PM +, Lendacky, Thomas wrote: >> On 7/24/19 1:11 PM, Kirill A. Shutemov wrote: >>> On Wed, Jul 24, 2019 at 05:34:26PM +, Lendacky, Thomas wrote: On 7/24/19 12:06 PM, Robin Murphy wrote: > On 24/07/2019

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Kirill A. Shutemov
On Wed, Jul 24, 2019 at 06:30:21PM +, Lendacky, Thomas wrote: > On 7/24/19 1:11 PM, Kirill A. Shutemov wrote: > > On Wed, Jul 24, 2019 at 05:34:26PM +, Lendacky, Thomas wrote: > >> On 7/24/19 12:06 PM, Robin Murphy wrote: > >>> On 24/07/2019 17:42, Lendacky, Thomas wrote: > On 7/24/19

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Lendacky, Thomas
On 7/24/19 1:11 PM, Kirill A. Shutemov wrote: > On Wed, Jul 24, 2019 at 05:34:26PM +, Lendacky, Thomas wrote: >> On 7/24/19 12:06 PM, Robin Murphy wrote: >>> On 24/07/2019 17:42, Lendacky, Thomas wrote: On 7/24/19 10:55 AM, Kirill A. Shutemov wrote: > On Wed, Jul 10, 2019 at 07:01:19PM

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Kirill A. Shutemov
On Wed, Jul 24, 2019 at 05:34:26PM +, Lendacky, Thomas wrote: > On 7/24/19 12:06 PM, Robin Murphy wrote: > > On 24/07/2019 17:42, Lendacky, Thomas wrote: > >> On 7/24/19 10:55 AM, Kirill A. Shutemov wrote: > >>> On Wed, Jul 10, 2019 at 07:01:19PM +, Lendacky, Thomas wrote: > @@ -351,6

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Lendacky, Thomas
On 7/24/19 12:06 PM, Robin Murphy wrote: > On 24/07/2019 17:42, Lendacky, Thomas wrote: >> On 7/24/19 10:55 AM, Kirill A. Shutemov wrote: >>> On Wed, Jul 10, 2019 at 07:01:19PM +, Lendacky, Thomas wrote: @@ -351,6 +355,32 @@ bool sev_active(void)   }   EXPORT_SYMBOL(sev_active);

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Robin Murphy
On 24/07/2019 17:42, Lendacky, Thomas wrote: On 7/24/19 10:55 AM, Kirill A. Shutemov wrote: On Wed, Jul 10, 2019 at 07:01:19PM +, Lendacky, Thomas wrote: @@ -351,6 +355,32 @@ bool sev_active(void) } EXPORT_SYMBOL(sev_active); +/* Override for DMA direct allocation check - ARCH_HAS_FO

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Lendacky, Thomas
On 7/24/19 10:55 AM, Kirill A. Shutemov wrote: > On Wed, Jul 10, 2019 at 07:01:19PM +, Lendacky, Thomas wrote: >> @@ -351,6 +355,32 @@ bool sev_active(void) >> } >> EXPORT_SYMBOL(sev_active); >> >> +/* Override for DMA direct allocation check - >> ARCH_HAS_FORCE_DMA_UNENCRYPTED */ >> +bool

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-24 Thread Kirill A. Shutemov
On Wed, Jul 10, 2019 at 07:01:19PM +, Lendacky, Thomas wrote: > @@ -351,6 +355,32 @@ bool sev_active(void) > } > EXPORT_SYMBOL(sev_active); > > +/* Override for DMA direct allocation check - ARCH_HAS_FORCE_DMA_UNENCRYPTED > */ > +bool force_dma_unencrypted(struct device *dev) > +{ > +

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-11 Thread Thomas Gleixner
On Thu, 11 Jul 2019, Christoph Hellwig wrote: > Hi Tom, > > this looks good to me. I'll wait a bit for feedback from the x86 folks, > and if everything is fine I'll apply it to the dma-mapping tree. Go ahead.

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-11 Thread Thomas Gleixner
On Wed, 10 Jul 2019, Lendacky, Thomas wrote: > From: Tom Lendacky > > If a device doesn't support DMA to a physical address that includes the > encryption bit (currently bit 47, so 48-bit DMA), then the DMA must > occur to unencrypted memory. SWIOTLB is used to satisfy that requirement > if an I

Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-11 Thread Christoph Hellwig
Hi Tom, this looks good to me. I'll wait a bit for feedback from the x86 folks, and if everything is fine I'll apply it to the dma-mapping tree.

[PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks

2019-07-10 Thread Lendacky, Thomas
From: Tom Lendacky If a device doesn't support DMA to a physical address that includes the encryption bit (currently bit 47, so 48-bit DMA), then the DMA must occur to unencrypted memory. SWIOTLB is used to satisfy that requirement if an IOMMU is not active (enabled or configured in passthrough m