Re: [RFC v7 09/26] vfio: Force nested if iommu requires it

2020-12-01 Thread Auger Eric
Hi Kunkun, On 11/28/20 10:01 AM, Kunkun Jiang wrote: > Hi Eric, >> @@ -1668,6 +1679,14 @@ static int vfio_connect_container(VFIOGroup *group, >> AddressSpace *as, >> VFIOContainer *container; >> int ret, fd; >> VFIOAddressSpace *space; >> +IOMMUMemoryRegion *iommu_mr; >> +b

Re: [RFC v7 09/26] vfio: Force nested if iommu requires it

2020-11-28 Thread Kunkun Jiang
Hi Eric, @@ -1668,6 +1679,14 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as, VFIOContainer *container; int ret, fd; VFIOAddressSpace *space; +IOMMUMemoryRegion *iommu_mr; +bool nested = false; + +if (as != &address_space_memory && memory_regi

[RFC v7 09/26] vfio: Force nested if iommu requires it

2020-11-16 Thread Eric Auger
In case we detect the address space is translated by a virtual IOMMU which requires HW nested paging to integrate with VFIO, let's set up the container with the VFIO_TYPE1_NESTING_IOMMU iommu_type. Signed-off-by: Eric Auger --- v4 -> v5: - fail immediatly if nested is wanted but not supported