Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-05 Thread Daniel Stone
On Thu, 5 Jun 2025 at 17:32, Tomeu Vizoso wrote: > On Thu, Jun 5, 2025 at 3:37 PM Robin Murphy wrote: > > It should only need a single IOMMU domain per DRM client, so no faffing > > about replicating mappings. iommu_paging_domain_alloc() does need *an* > > appropriate target device so it can iden

Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-05 Thread Tomeu Vizoso
On Thu, Jun 5, 2025 at 3:37 PM Robin Murphy wrote: > > On 05/06/2025 8:41 am, Tomeu Vizoso wrote: > [...] > >> In fact this is precisely the usage model I would suggest for this sort > >> of thing, and IIRC I had a similar conversation with the Ethos driver > >> folks a few years back. Running you

Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-05 Thread Robin Murphy
On 05/06/2025 8:41 am, Tomeu Vizoso wrote: [...] In fact this is precisely the usage model I would suggest for this sort of thing, and IIRC I had a similar conversation with the Ethos driver folks a few years back. Running your own IOMMU domain is no biggie, see several other DRM drivers (includi

Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-05 Thread Tomeu Vizoso
On Thu, Jun 5, 2025 at 2:29 PM Daniel Stone wrote: > > Hey, > > On Thu, 5 Jun 2025 at 08:41, Tomeu Vizoso wrote: > > > Indeed if you're using the IOMMU API directly then you need to do your > > > own address space management either way, so matching bits of process VA > > > space is pretty simple

Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-05 Thread Daniel Stone
Hey, On Thu, 5 Jun 2025 at 08:41, Tomeu Vizoso wrote: > > Indeed if you're using the IOMMU API directly then you need to do your > > own address space management either way, so matching bits of process VA > > space is pretty simple to put on the table. > > My impression was that the VM_BIND facil

Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-05 Thread Tomeu Vizoso
On Wed, Jun 4, 2025 at 7:03 PM Robin Murphy wrote: > > On 2025-06-04 5:18 pm, Daniel Stone wrote: > > Hi Tomeu, > > I have some bad news ... > > > > On Wed, 4 Jun 2025 at 08:57, Tomeu Vizoso wrote: > >> +int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct > >> drm_file *file) >

Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-04 Thread Robin Murphy
On 2025-06-04 5:18 pm, Daniel Stone wrote: Hi Tomeu, I have some bad news ... On Wed, 4 Jun 2025 at 08:57, Tomeu Vizoso wrote: +int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_file *file) +{ + [...] + + /* This will map the pages to the IOMMU linked to co

Re: [PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-04 Thread Daniel Stone
Hi Tomeu, I have some bad news ... On Wed, 4 Jun 2025 at 08:57, Tomeu Vizoso wrote: > +int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct > drm_file *file) > +{ > + [...] > + > + /* This will map the pages to the IOMMU linked to core 0 */ > + sgt = drm_gem_sh

[PATCH v6 06/10] accel/rocket: Add IOCTL for BO creation

2025-06-04 Thread Tomeu Vizoso
This uses the SHMEM DRM helpers and we map right away to the CPU and NPU sides, as all buffers are expected to be accessed from both. v2: - Sync the IOMMUs for the other cores when mapping and unmapping. v3: - Make use of GPL-2.0-only for the copyright notice (Jeff Hugo) v6: - Use mutexes guard