Message ID | 20240111041015.47920-1-yi.l.liu@intel.com (mailing list archive) |
---|---|
Headers | show |
Series | Add iommufd nesting (part 2/2) | expand |
> From: Yi Liu <yi.l.liu@intel.com> > Sent: Thursday, January 11, 2024 12:10 PM > > v11: > - Drop hw_error field in vtd cache invalidation uapi. devTLB invalidation > error is a serious security emergency requiring the host kernel to handle. > No need to expose it to userspace (especially given existing VMs doesn't > issue devTLB invalidation at all). > - The vtd qi_submit_sync() and related callers are reverted back to the > original state due to above drop. > - Align with the vtd path, drop the hw_error reporting in mock driver and > selftest as well since selftest is a demo of the real driver. > - Drop iommu_respond_struct_to_user_array() since no more driver want to > respond single entry in the user_array. > - Two typos from Wubinbin > this looks good to me. so my r-b still holds.
On Wed, Jan 10, 2024 at 08:10:07PM -0800, Yi Liu wrote: > v11: > - Drop hw_error field in vtd cache invalidation uapi. devTLB invalidation > error is a serious security emergency requiring the host kernel to handle. > No need to expose it to userspace (especially given existing VMs doesn't > issue devTLB invalidation at all). > - The vtd qi_submit_sync() and related callers are reverted back to the > original state due to above drop. > - Align with the vtd path, drop the hw_error reporting in mock driver and > selftest as well since selftest is a demo of the real driver. > - Drop iommu_respond_struct_to_user_array() since no more driver want to > respond single entry in the user_array. > - Two typos from Wubinbin Okay, this is very last minute but I updated the series. Jason
>-----Original Message----- >From: Liu, Yi L <yi.l.liu@intel.com> >Subject: [PATCH v11 0/8] Add iommufd nesting (part 2/2) > >Nested translation is a hardware feature that is supported by many modern >IOMMU hardwares. It has two stages (stage-1, stage-2) address translation >to get access to the physical address. stage-1 translation table is owned >by userspace (e.g. by a guest OS), while stage-2 is owned by kernel. Changes >to stage-1 translation table should be followed by an IOTLB invalidation. > >Take Intel VT-d as an example, the stage-1 translation table is I/O page >table. As the below diagram shows, guest I/O page table pointer in GPA >(guest physical address) is passed to host and be used to perform the stage- >1 >address translation. Along with it, modifications to present mappings in the >guest I/O page table should be followed with an IOTLB invalidation. > > .-------------. .---------------------------. > | vIOMMU | | Guest I/O page table | > | | '---------------------------' > .----------------/ > | PASID Entry |--- PASID cache flush --+ > '-------------' | > | | V > | | I/O page table pointer in GPA > '-------------' >Guest >------| Shadow |---------------------------|-------- > v v v >Host > .-------------. .------------------------. > | pIOMMU | | FS for GIOVA->GPA | > | | '------------------------' > .----------------/ | > | PASID Entry | V (Nested xlate) > '----------------\.----------------------------------. > | | | SS for GPA->HPA, unmanaged domain| > | | '----------------------------------' > '-------------' >Where: > - FS = First stage page tables > - SS = Second stage page tables ><Intel VT-d Nested translation> > >This series is based on the first part which was merged [1], this series is to >add the cache invalidation interface or the userspace to invalidate cache >after >modifying the stage-1 page table. This includes both the iommufd changes >and the >VT-d driver changes. > >Complete code can be found in [2], QEMU could can be found in [3]. > >At last, this is a team work together with Nicolin Chen, Lu Baolu. Thanks >them for the help. ^_^. Look forward to your feedbacks. > >[1] https://lore.kernel.org/linux-iommu/20231026044216.64964-1- >yi.l.liu@intel.com/ - merged >[2] https://github.com/yiliu1765/iommufd/tree/iommufd_nesting >[3] >https://github.com/yiliu1765/qemu/tree/zhenzhong/wip/iommufd_nesting >_rfcv1 This series is tested with a real implementation of QEMU at https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg02740.html May be late, but still Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Thanks Zhenzhong