> > @@ -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
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
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
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