Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2024-01-15 Thread Jason Gunthorpe
On Mon, Jan 15, 2024 at 05:44:13PM +, Shameerali Kolothum Thodi wrote: > > If it is valid when userspace does read() then it should be valid when > > userspace does write() too. > > > > It is the only way the kernel can actually match request and response > > here. > > The kernel currently c

RE: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2024-01-15 Thread Shameerali Kolothum Thodi
Liu > ; Jacob Pan ; > io...@lists.linux.dev; linux-kselftest@vger.kernel.org; > virtualizat...@lists.linux-foundation.org; linux-ker...@vger.kernel.org > Subject: Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space > > On Fri, Jan 12, 2024 at 05:46:1

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2024-01-15 Thread Jason Gunthorpe
On Fri, Jan 12, 2024 at 05:46:13PM +, Shameerali Kolothum Thodi wrote: > > > > -Original Message- > > From: Lu Baolu > > Sent: Thursday, October 26, 2023 3:49 AM > > To: Jason Gunthorpe ; Kevin Tian ; > > Joerg > > Roedel ; Will Deacon ; Robin Murphy > > ; Jean-Philippe Brucker ; >

RE: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2024-01-12 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Lu Baolu > Sent: Thursday, October 26, 2023 3:49 AM > To: Jason Gunthorpe ; Kevin Tian ; Joerg > Roedel ; Will Deacon ; Robin Murphy > ; Jean-Philippe Brucker ; > Nicolin Chen ; Yi Liu ; Jacob Pan > > Cc: io...@lists.linux.dev; linux-kselftest@vger.kernel.o

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-08 Thread Jason Gunthorpe
On Fri, Dec 08, 2023 at 01:47:35PM +0800, Baolu Lu wrote: > On 12/8/23 1:17 AM, Jason Gunthorpe wrote: > > On Thu, Dec 07, 2023 at 05:34:10PM +0100, Joel Granados wrote: > > > > @@ -58,6 +255,8 @@ static void hw_pagetable_fault_free(struct > > > > hw_pgtable_fault *fault) > > > > WARN_ON(!

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-08 Thread Baolu Lu
On 2023/12/1 23:24, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:28AM +0800, Lu Baolu wrote: +static ssize_t hwpt_fault_fops_write(struct file *filep, +const char __user *buf, +size_t count, loff_t *ppos) +{ +

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-07 Thread Baolu Lu
On 12/8/23 1:17 AM, Jason Gunthorpe wrote: On Thu, Dec 07, 2023 at 05:34:10PM +0100, Joel Granados wrote: @@ -58,6 +255,8 @@ static void hw_pagetable_fault_free(struct hw_pgtable_fault *fault) WARN_ON(!list_empty(&fault->deliver)); WARN_ON(!list_empty(&fault->response)); + fp

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-07 Thread Jason Gunthorpe
On Thu, Dec 07, 2023 at 05:34:10PM +0100, Joel Granados wrote: > > @@ -58,6 +255,8 @@ static void hw_pagetable_fault_free(struct > > hw_pgtable_fault *fault) > > WARN_ON(!list_empty(&fault->deliver)); > > WARN_ON(!list_empty(&fault->response)); > > > > + fput(fault->fault_file); > > +

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-07 Thread Joel Granados
On Thu, Oct 26, 2023 at 10:49:28AM +0800, Lu Baolu wrote: > Add the file interface that provides a simple and efficient way for > userspace to handle page faults. The file interface allows userspace > to read fault messages sequentially, and to respond to the handling > result by writing to the sam

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-01 Thread Jason Gunthorpe
On Thu, Oct 26, 2023 at 10:49:28AM +0800, Lu Baolu wrote: > +static ssize_t hwpt_fault_fops_write(struct file *filep, > + const char __user *buf, > + size_t count, loff_t *ppos) > +{ > + size_t response_size = sizeof(struct iomm