Re: [PATCH v2 3/3] vfio/type1: Batch page pinning

2021-03-23 Thread Alex Williamson
On Tue, 23 Mar 2021 18:25:45 -0400 Daniel Jordan wrote: > Hi Alex, > > Alex Williamson writes: > > I've found a bug in this patch that we need to fix. The diff is a > > little difficult to follow, > > It was an awful diff, I remember... > > > so I'll discuss it in the resulting function

Re: [PATCH v2 3/3] vfio/type1: Batch page pinning

2021-03-23 Thread Daniel Jordan
Hi Alex, Alex Williamson writes: > I've found a bug in this patch that we need to fix. The diff is a > little difficult to follow, It was an awful diff, I remember... > so I'll discuss it in the resulting function below... > > (1) Imagine the user has passed a vaddr range that alternates

Re: [PATCH v2 3/3] vfio/type1: Batch page pinning

2021-03-23 Thread Alex Williamson
Hi Daniel, I've found a bug in this patch that we need to fix. The diff is a little difficult to follow, so I'll discuss it in the resulting function below... (1) Imagine the user has passed a vaddr range that alternates pfnmaps and pinned memory per page. static long

[PATCH v2 3/3] vfio/type1: Batch page pinning

2021-02-19 Thread Daniel Jordan
Pinning one 4K page at a time is inefficient, so do it in batches of 512 instead. This is just an optimization with no functional change intended, and in particular the driver still calls iommu_map() with the largest physically contiguous range possible. Add two fields in vfio_batch to remember