Re: [PATCH v13 06/10] iommu: Add a page fault handler

2021-03-23 Thread Jean-Philippe Brucker
On Tue, Mar 02, 2021 at 09:57:27PM -0800, Raj, Ashok wrote: > > + ret = handle_mm_fault(vma, prm->addr, fault_flags, NULL); > > Should we add a trace similar to trace_page_fault_user() or kernel in > arch/x86/kernel/mm/fault.c Yes that would definitely be useful for debugging hardware and deve

Re: [PATCH v13 06/10] iommu: Add a page fault handler

2021-03-23 Thread Jean-Philippe Brucker
On Wed, Mar 03, 2021 at 01:27:34PM +0800, Lu Baolu wrote: > I have tested this framework with the Intel VT-d implementation. It > works as expected. Hence, > > Reviewed-by: Lu Baolu > Tested-by: Lu Baolu Thanks! > One possible future optimization is that we could allow the system > administrat

Re: [PATCH v13 06/10] iommu: Add a page fault handler

2021-03-23 Thread Jean-Philippe Brucker
On Tue, Mar 02, 2021 at 03:59:57PM -0800, Jacob Pan wrote: > Hi Jean-Philippe, > > A few comments from the p.o.v of converting VT-d to this framework. Mostly > about potential optimization. I think VT-d SVA code will be able to use this > work. > +Ashok provided many insight. > > FWIW, > Reviewed

Re: [PATCH v13 06/10] iommu: Add a page fault handler

2021-03-02 Thread Raj, Ashok
On Tue, Mar 02, 2021 at 10:26:42AM +0100, Jean-Philippe Brucker wrote: [snip] > + > +static enum iommu_page_response_code > +iopf_handle_single(struct iopf_fault *iopf) > +{ > + vm_fault_t ret; > + struct mm_struct *mm; > + struct vm_area_struct *vma; > + unsigned int access_flags

Re: [PATCH v13 06/10] iommu: Add a page fault handler

2021-03-02 Thread Lu Baolu
Hi Jean, On 3/2/21 5:26 PM, Jean-Philippe Brucker wrote: Some systems allow devices to handle I/O Page Faults in the core mm. For example systems implementing the PCIe PRI extension or Arm SMMU stall model. Infrastructure for reporting these recoverable page faults was added to the IOMMU core by

Re: [PATCH v13 06/10] iommu: Add a page fault handler

2021-03-02 Thread Jacob Pan
Hi Jean-Philippe, A few comments from the p.o.v of converting VT-d to this framework. Mostly about potential optimization. I think VT-d SVA code will be able to use this work. +Ashok provided many insight. FWIW, Reviewed-by:Jacob Pan On Tue, 2 Mar 2021 10:26:42 +0100, Jean-Philippe Brucker wr

[PATCH v13 06/10] iommu: Add a page fault handler

2021-03-02 Thread Jean-Philippe Brucker
Some systems allow devices to handle I/O Page Faults in the core mm. For example systems implementing the PCIe PRI extension or Arm SMMU stall model. Infrastructure for reporting these recoverable page faults was added to the IOMMU core by commit 0c830e6b3282 ("iommu: Introduce device fault report