Re: [PATCH] vfio: Support P2P access in confidential VM

2025-01-21 Thread David Hildenbrand
On 21.01.25 09:50, Wencheng Yang wrote: hi, David, Hi, > I'm wondering: isn't this something the kernel should be able to figure > out? Is this encrypted RAM (SMA) or not, and set the flag accordingly? > What are the challenges? VFIO driver and IOMMU driver don't know the device(memory o

Re: [PATCH] vfio: Support P2P access in confidential VM

2025-01-21 Thread Wencheng Yang
hi, David, > I'm wondering: isn't this something the kernel should be able to figure > out? Is this encrypted RAM (SMA) or not, and set the flag accordingly? > What are the challenges? VFIO driver and IOMMU driver don't know the device(memory or device mmio) behind vaddr, only device driver knows

Re: [PATCH] vfio: Support P2P access in confidential VM

2025-01-17 Thread Yang Dongshan
> Yes. This patch should also be divided in 4 parts : > > - kernel header changes with links to the threads modifying the kernel. > - common part, > - vpda part, > - and vfio, ok, I will divide it into 4 patches. thanks Cédric On Fri, Jan 17, 2025 at 2:15 AM Cédric Le Goater wrote: > >>

Re: [PATCH] vfio: Support P2P access in confidential VM

2025-01-17 Thread Yang Dongshan
hi, Alex > Where's the kernel patch that implements the MMIO map flag. That needs > to come first. The kernel patch is on the way, I have submitted patch to linux kernel, waiting for review. Patch link: https://lore.kernel.org/all/20250117071423.469880-1-east.moutain.y...@gmail.com/ > I al

Re: [PATCH] vfio: Support P2P access in confidential VM

2025-01-16 Thread Cédric Le Goater
--- a/linux-headers/linux/vfio.h +++ b/linux-headers/linux/vfio.h @@ -1560,6 +1560,7 @@ struct vfio_iommu_type1_dma_map { #define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */ #define VFIO_DMA_MAP_FLAG_WRITE (1 << 1)/* writable from device */ #define VFIO_DMA_MAP

Re: [PATCH] vfio: Support P2P access in confidential VM

2025-01-16 Thread Alex Williamson
On Thu, 16 Jan 2025 17:53:55 +0800 Wencheng Yang wrote: > On confidential VM platform, for example, AMD-SEV, P2P doesn't work. > The underlying reason is that IOMMU driver set encryption bit on > IOMMU page table pte entry, it's reasonalbe if the pte maps iova > to system memory. However, if the

[PATCH] vfio: Support P2P access in confidential VM

2025-01-16 Thread Wencheng Yang
On confidential VM platform, for example, AMD-SEV, P2P doesn't work. The underlying reason is that IOMMU driver set encryption bit on IOMMU page table pte entry, it's reasonalbe if the pte maps iova to system memory. However, if the pte maps iova to device's mmio bar space, setting encryption bit o