Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 09:07:38AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:27:46PM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > > > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > > In iommufd_hwpt_paging_allo

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:27:46PM -0300, Jason Gunthorpe wrote: > On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > In iommufd_hwpt_paging_alloc(), we reject IOMMU_HWPT_FAULT_ID_VALID: > > const u32 valid_flag

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Jason Gunthorpe
On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 28, 2024 at 11:24:10AM +0800, Zhangfei Gao wrote: > > > > > > +/** > > > > + * iommufd_viommu_alloc_hwpt_nested() - Get a hwpt_nested for a vIOMMU > > >

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-28 Thread Nicolin Chen
On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 28, 2024 at 11:24:10AM +0800, Zhangfei Gao wrote: > > > > > > +/** > > > > + * iommufd_viommu_alloc_hwpt_nested() - Get a hwpt_nested for a vIOMMU > > > >

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-28 Thread Nicolin Chen
On Mon, Oct 28, 2024 at 10:53:38PM +0800, Zhangfei Gao wrote: > On Mon, 28 Oct 2024 at 11:24, Zhangfei Gao wrote: > > > By the way, has qemu changed compared with v3? > > I still got a hardware error in this version, in check > > Found iommufd_viommu_p2-v5 misses some patches, > Simply tested ok

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-28 Thread Nicolin Chen
On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > On Mon, Oct 28, 2024 at 11:24:10AM +0800, Zhangfei Gao wrote: > > > > +/** > > > + * iommufd_viommu_alloc_hwpt_nested() - Get a hwpt_nested for a vIOMMU > > > + * @viommu: vIOMMU ojbect to associate the hwpt_nested/domain with > >

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-28 Thread Zhangfei Gao
On Mon, 28 Oct 2024 at 11:24, Zhangfei Gao wrote: > By the way, has qemu changed compared with v3? > I still got a hardware error in this version, in check Found iommufd_viommu_p2-v5 misses some patches, Simply tested ok with iommufd_viommu_p2-v5-with-rmr, (with some hacks) Thanks

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-28 Thread Jason Gunthorpe
On Mon, Oct 28, 2024 at 11:24:10AM +0800, Zhangfei Gao wrote: > > +/** > > + * iommufd_viommu_alloc_hwpt_nested() - Get a hwpt_nested for a vIOMMU > > + * @viommu: vIOMMU ojbect to associate the hwpt_nested/domain with > > + * @user_data: user_data pointer. Must be valid > > + * > > + * Allocate a

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-27 Thread Zhangfei Gao
On Sat, 26 Oct 2024 at 07:50, Nicolin Chen wrote: > > Now a vIOMMU holds a shareable nesting parent HWPT. So, it can act like > that nesting parent HWPT to allocate a nested HWPT. > > Support that in the IOMMU_HWPT_ALLOC ioctl handler, and update its kdoc. > > Also, add an iommufd_hwpt_nested_allo

RE: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-27 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 26, 2024 7:50 AM > > Now a vIOMMU holds a shareable nesting parent HWPT. So, it can act like > that nesting parent HWPT to allocate a nested HWPT. > > Support that in the IOMMU_HWPT_ALLOC ioctl handler, and update its kdoc. > > Also, add an iommufd

[PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-25 Thread Nicolin Chen
Now a vIOMMU holds a shareable nesting parent HWPT. So, it can act like that nesting parent HWPT to allocate a nested HWPT. Support that in the IOMMU_HWPT_ALLOC ioctl handler, and update its kdoc. Also, add an iommufd_hwpt_nested_alloc_for_viommu helper to allocate a nested HWPT for a vIOMMU obje