Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-09 Thread Jason Gunthorpe
On Fri, Feb 07, 2025 at 10:59:48AM -0800, Nicolin Chen wrote: > On Fri, Feb 07, 2025 at 11:28:01AM -0400, Jason Gunthorpe wrote: > > On Fri, Feb 07, 2025 at 10:30:20AM -0400, Jason Gunthorpe wrote: > > > On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > > > > Yea, I found iopt_reserve

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-07 Thread Nicolin Chen
On Fri, Feb 07, 2025 at 11:28:01AM -0400, Jason Gunthorpe wrote: > On Fri, Feb 07, 2025 at 10:30:20AM -0400, Jason Gunthorpe wrote: > > On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > > > Yea, I found iopt_reserve_iova() is actually missed entirely... > > > > > > While fixing this,

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-07 Thread Jason Gunthorpe
On Fri, Feb 07, 2025 at 10:30:20AM -0400, Jason Gunthorpe wrote: > On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > > Yea, I found iopt_reserve_iova() is actually missed entirely... > > > > While fixing this, I see a way to turn the OPTIONs back to per- > > idev, if you still prefer

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-07 Thread Jason Gunthorpe
On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > Yea, I found iopt_reserve_iova() is actually missed entirely... > > While fixing this, I see a way to turn the OPTIONs back to per- > idev, if you still prefer them to be per-idev(?). Then, we can > check a given input in the set_opti

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-06 Thread Nicolin Chen
On Wed, Jan 29, 2025 at 10:58:00AM -0400, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 02:44:12PM +0100, Eric Auger wrote: > > On 1/11/25 4:32 AM, Nicolin Chen wrote: > > > For systems that require MSI pages to be mapped into the IOMMU translation > > > the IOMMU driver provides an IOMMU_RESV_S

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-03 Thread Nicolin Chen
On Thu, Jan 23, 2025 at 10:07:13AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Saturday, January 11, 2025 11:32 AM > > > > @@ -294,7 +294,9 @@ struct iommu_ioas_unmap { > > > > /** > > * enum iommufd_option - ioctl(IOMMU_OPTION_RLIMIT_MODE) and > > - * ioc

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 06:49:22PM +0100, Eric Auger wrote: > > If it was overriden inside iommufd then the user told the kernel what > > range to use to override it. I don't need to go back and report back > > to userspace information that it already gave to the kernel.. > > Looks strange to me b

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Eric Auger
On 1/29/25 6:39 PM, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 06:23:33PM +0100, Eric Auger wrote: IIUC the MSI window will then be different when using legacy VFIO assignment and iommufd backend. >>> ? They use the same, iommufd can have userspace override it. Then it >>> will

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 06:23:33PM +0100, Eric Auger wrote: > >> IIUC the MSI window will then be different when using legacy VFIO > >> assignment and iommufd backend. > > ? They use the same, iommufd can have userspace override it. Then it > > will ignore the reserved region. > In current arm-smmu

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Eric Auger
On 1/29/25 3:58 PM, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 02:44:12PM +0100, Eric Auger wrote: >> Hi, >> >> >> On 1/11/25 4:32 AM, Nicolin Chen wrote: >>> For systems that require MSI pages to be mapped into the IOMMU translation >>> the IOMMU driver provides an IOMMU_RESV_SW_MSI rang

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 02:44:12PM +0100, Eric Auger wrote: > Hi, > > > On 1/11/25 4:32 AM, Nicolin Chen wrote: > > For systems that require MSI pages to be mapped into the IOMMU translation > > the IOMMU driver provides an IOMMU_RESV_SW_MSI range, which is the default > > recommended IOVA window

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Eric Auger
Hi, On 1/11/25 4:32 AM, Nicolin Chen wrote: > For systems that require MSI pages to be mapped into the IOMMU translation > the IOMMU driver provides an IOMMU_RESV_SW_MSI range, which is the default > recommended IOVA window to place these mappings. However, there is nothing > special about this a

RE: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-23 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, January 11, 2025 11:32 AM > > @@ -294,7 +294,9 @@ struct iommu_ioas_unmap { > > /** > * enum iommufd_option - ioctl(IOMMU_OPTION_RLIMIT_MODE) and > - * ioctl(IOMMU_OPTION_HUGE_PAGES) > + * ioctl(IOMMU_OPTION_HU