Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-12 Thread Jason Gunthorpe
On Tue, Jul 09, 2024 at 10:33:42AM -0700, Nicolin Chen wrote: > > We are potentially talking about 5-10 physical smmus and 2-3 FDs per > > physical? Does that scare anyone? > > I think we can share the same FD by adding a viommu_id somewhere > to indicate what the data/event belongs to. Yet, it s

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-09 Thread Nicolin Chen
On Tue, Jul 09, 2024 at 02:00:38PM -0300, Jason Gunthorpe wrote: > On Mon, Jul 08, 2024 at 11:36:57AM -0700, Nicolin Chen wrote: > > Maybe something like this? > > > > struct iommu_viommu_event_arm_smmuv3 { > > u64 evt[4]; > > }; > > > > struct iommu_viommu_event_tegra241_cmdqv { > > u6

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-09 Thread Jason Gunthorpe
On Mon, Jul 08, 2024 at 11:36:57AM -0700, Nicolin Chen wrote: > Maybe something like this? > > struct iommu_viommu_event_arm_smmuv3 { > u64 evt[4]; > }; > > struct iommu_viommu_event_tegra241_cmdqv { > u64 vcmdq_err_map[2]; > }; > > enum iommu_event_type { > IOMMM_HWPT_EVENT_TY

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-08 Thread Nicolin Chen
On Mon, Jul 08, 2024 at 01:29:57PM -0300, Jason Gunthorpe wrote: > On Wed, Jul 03, 2024 at 04:06:15PM -0700, Nicolin Chen wrote: > > > I learned that this hwpt->fault is exclusively for IOPF/PRI. And > > Jason suggested me to add a different one for VIOMMU. Yet, after > > taking a closer look, I f

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-08 Thread Jason Gunthorpe
On Wed, Jul 03, 2024 at 04:06:15PM -0700, Nicolin Chen wrote: > I learned that this hwpt->fault is exclusively for IOPF/PRI. And > Jason suggested me to add a different one for VIOMMU. Yet, after > taking a closer look, I found the fault object in this series is > seemingly quite generic at the uA

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-08 Thread Jason Gunthorpe
On Fri, Jul 05, 2024 at 12:49:10AM +, Tian, Kevin wrote: > > > > > > > +enum iommu_fault_type { > > > > > > > + IOMMU_FAULT_TYPE_HWPT_IOPF, > > > > > > > + IOMMU_FAULT_TYPE_VIOMMU_IRQ, > > > > > > > +}; > > > > > > > > > > > > > >struct iommu_fault_alloc { > > > > > > >__u3

RE: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-04 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Friday, July 5, 2024 7:19 AM > > On Thu, Jul 04, 2024 at 03:32:32PM +0800, Baolu Lu wrote: > > On 2024/7/4 14:37, Tian, Kevin wrote: > > > > From: Nicolin Chen > > > > Sent: Thursday, July 4, 2024 1:36 PM > > > > > > > > On Thu, Jul 04, 2024 at 10:59:45AM +0800, Baolu

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-04 Thread Nicolin Chen
On Thu, Jul 04, 2024 at 03:32:32PM +0800, Baolu Lu wrote: > On 2024/7/4 14:37, Tian, Kevin wrote: > > > From: Nicolin Chen > > > Sent: Thursday, July 4, 2024 1:36 PM > > > > > > On Thu, Jul 04, 2024 at 10:59:45AM +0800, Baolu Lu wrote: > > > > > On Tue, Jul 02, 2024 at 02:34:40PM +0800, Lu Baolu w

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-04 Thread Baolu Lu
On 2024/7/4 14:37, Tian, Kevin wrote: From: Nicolin Chen Sent: Thursday, July 4, 2024 1:36 PM On Thu, Jul 04, 2024 at 10:59:45AM +0800, Baolu Lu wrote: On Tue, Jul 02, 2024 at 02:34:40PM +0800, Lu Baolu wrote: +enum iommu_fault_type { + IOMMU_FAULT_TYPE_HWPT_IOPF, + IOMMU_FAULT_TYPE_VI

RE: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-03 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, July 4, 2024 1:36 PM > > On Thu, Jul 04, 2024 at 10:59:45AM +0800, Baolu Lu wrote: > > > On Tue, Jul 02, 2024 at 02:34:40PM +0800, Lu Baolu wrote: > > > > > > +enum iommu_fault_type { > > > + IOMMU_FAULT_TYPE_HWPT_IOPF, > > > + IOMMU_FAULT_TYPE_VIOMM

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-03 Thread Nicolin Chen
On Thu, Jul 04, 2024 at 10:59:45AM +0800, Baolu Lu wrote: > > On Tue, Jul 02, 2024 at 02:34:40PM +0800, Lu Baolu wrote: > > > > > An iommufd fault object provides an interface for delivering I/O page > > > faults to user space. These objects are created and destroyed by user > > > space, and they

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-03 Thread Baolu Lu
On 7/4/24 7:06 AM, Nicolin Chen wrote: Hi Baolu, Hi Nicolin, On Tue, Jul 02, 2024 at 02:34:40PM +0800, Lu Baolu wrote: An iommufd fault object provides an interface for delivering I/O page faults to user space. These objects are created and destroyed by user space, and they can be associate

Re: [PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-03 Thread Nicolin Chen
Hi Baolu, On Tue, Jul 02, 2024 at 02:34:40PM +0800, Lu Baolu wrote: > An iommufd fault object provides an interface for delivering I/O page > faults to user space. These objects are created and destroyed by user > space, and they can be associated with or dissociated from hardware page > table ob

[PATCH v8 06/10] iommufd: Add iommufd fault object

2024-07-01 Thread Lu Baolu
An iommufd fault object provides an interface for delivering I/O page faults to user space. These objects are created and destroyed by user space, and they can be associated with or dissociated from hardware page table objects during page table allocation or destruction. User space interacts with