Re: [RFC PATCH 2/2] dma-direct: Fix dma_direct_{alloc,free}() for Hyperv-V IVMs

2022-07-07 Thread Andrea Parri
> > @@ -305,6 +306,21 @@ void *dma_direct_alloc(struct device *dev, size_t size, > > ret = page_address(page); > > if (dma_set_decrypted(dev, ret, size)) > > goto out_free_pages; > > +#ifdef CONFIG_HAS_IOMEM > > + /* > > +* Remap

[RFC PATCH 0/2] dma_direct_{alloc,free}() for Hyper-V IVMs

2022-07-06 Thread Andrea Parri (Microsoft)
Through swiotlb_unencrypted_base. P.S. I'm on vacation for the next couple of weeks starting next Monday; Dexuan/Michael should be able to address review feedback in that period. Andrea Parri (Microsoft) (2): swiotlb,dma-direct: Move swiotlb_unencrypted_base to direct.c dma-direct: Fix

[RFC PATCH 2/2] dma-direct: Fix dma_direct_{alloc, free}() for Hyperv-V IVMs

2022-07-06 Thread Andrea Parri (Microsoft)
the (unmodified) DMA address to derive the original virtual address and re-encrypt the pages. Suggested-by: Michael Kelley Co-developed-by: Dexuan Cui Signed-off-by: Dexuan Cui Signed-off-by: Andrea Parri (Microsoft) --- kernel/dma/direct.c | 30 +- 1 file changed, 29

[RFC PATCH 1/2] swiotlb, dma-direct: Move swiotlb_unencrypted_base to direct.c

2022-07-06 Thread Andrea Parri (Microsoft)
The variable will come in handy to enable dma_direct_{alloc,free}() for Hyper-V AMD SEV-SNP Isolated VMs. Rename swiotlb_unencrypted_base to dma_unencrypted_base to indicate that the notion is not restricted to SWIOTLB. No functional change. Suggested-by: Michael Kelley Signed-off-by: Andrea