Re: [PATCH] vfio/type1: Empty batch for pfnmap pages

2021-03-25 Thread Alex Williamson
On Wed, 24 Mar 2021 21:05:52 -0400 Daniel Jordan wrote: > When vfio_pin_pages_remote() returns with a partial batch consisting of > a single VM_PFNMAP pfn, a subsequent call will unfortunately try > restoring it from batch->pages, resulting in vfio mapping the wrong page > and unbalancing the

[PATCH] vfio/type1: Empty batch for pfnmap pages

2021-03-24 Thread Daniel Jordan
When vfio_pin_pages_remote() returns with a partial batch consisting of a single VM_PFNMAP pfn, a subsequent call will unfortunately try restoring it from batch->pages, resulting in vfio mapping the wrong page and unbalancing the page refcount. Prevent the function from returning with this kind