linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/10] Update vfio_pin/unpin_pages API
@ 2022-07-08 22:44 Nicolin Chen
  2022-07-08 22:44 ` [PATCH v3 01/10] vfio: Make vfio_unpin_pages() return void Nicolin Chen
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Nicolin Chen @ 2022-07-08 22:44 UTC (permalink / raw)
  To: kwankhede, corbet, hca, gor, agordeev, borntraeger, svens,
	zhenyuw, zhi.a.wang, jani.nikula, joonas.lahtinen, rodrigo.vivi,
	tvrtko.ursulin, airlied, daniel, farman, mjrosato, pasic, vneethv,
	oberpar, freude, akrowiak, jjherne, alex.williamson, cohuck, jgg,
	kevin.tian, hch
  Cc: jchrist, kvm, linux-doc, linux-kernel, linux-s390, intel-gvt-dev,
	intel-gfx, dri-devel, terrence.xu

This is a preparatory series for IOMMUFD v2 patches. It prepares for
replacing vfio_iommu_type1 implementations of vfio_pin/unpin_pages()
with IOMMUFD version.

There's a gap between these two versions: the vfio_iommu_type1 version
inputs a non-contiguous PFN list and outputs another PFN list for the
pinned physical page list, while the IOMMUFD version only supports a
contiguous address input by accepting the starting IO virtual address
of a set of pages to pin and by outputting to a physical page list.

The nature of existing callers mostly aligns with the IOMMUFD version,
except s390's vfio_ccw_cp code where some additional change is needed
along with this series. Overall, updating to "iova" and "phys_page"
does improve the caller side to some extent.

Also fix a misuse of physical address and virtual address in the s390's
crypto code. And update the input naming at the adjacent vfio_dma_rw().

This is on github:
https://github.com/nicolinc/iommufd/commits/vfio_pin_pages

Terrence has tested this series on i915; Eric has tested on s390.

Thanks!

Changelog
v3:
 * Added a patch to replace roundup with DIV_ROUND_UP in i915 gvt
 * Dropped the "driver->ops->unpin_pages" and NULL checks in PATCH-1
 * Changed to use WARN_ON and separate into lines in PATCH-1
 * Replaced "guest" words with "user" and fix typo in PATCH-5
 * Updated commit log of PATCH-1, PATCH-6, and PATCH-10
 * Added Reviewed/Acked-by from Christoph, Jason, Kirti, Kevin and Eric
 * Added Tested-by from Terrence (i915) and Eric (s390)
v2: https://lore.kernel.org/kvm/20220706062759.24946-1-nicolinc@nvidia.com/
 * Added a patch to make vfio_unpin_pages return void
 * Added two patches to remove PFN list from two s390 callers
 * Renamed "phys_page" parameter to "pages" for vfio_pin_pages
 * Updated commit log of kmap_local_page() patch
 * Added Harald's "Reviewed-by" to pa_ind patch
 * Rebased on top of Alex's extern removal path
v1: https://lore.kernel.org/kvm/20220616235212.15185-1-nicolinc@nvidia.com/

Nicolin Chen (10):
  vfio: Make vfio_unpin_pages() return void
  drm/i915/gvt: Replace roundup with DIV_ROUND_UP
  vfio/ap: Pass in physical address of ind to ap_aqic()
  vfio/ccw: Only pass in contiguous pages
  vfio: Pass in starting IOVA to vfio_pin/unpin_pages API
  vfio/ap: Change saved_pfn to saved_iova
  vfio/ccw: Change pa_pfn list to pa_iova list
  vfio: Rename user_iova of vfio_dma_rw()
  vfio/ccw: Add kmap_local_page() for memcpy
  vfio: Replace phys_pfn with pages for vfio_pin_pages()

 .../driver-api/vfio-mediated-device.rst       |   6 +-
 arch/s390/include/asm/ap.h                    |   6 +-
 drivers/gpu/drm/i915/gvt/kvmgt.c              |  49 ++---
 drivers/s390/cio/vfio_ccw_cp.c                | 195 +++++++++++-------
 drivers/s390/crypto/ap_queue.c                |   2 +-
 drivers/s390/crypto/vfio_ap_ops.c             |  54 +++--
 drivers/s390/crypto/vfio_ap_private.h         |   4 +-
 drivers/vfio/vfio.c                           |  54 ++---
 drivers/vfio/vfio.h                           |   8 +-
 drivers/vfio/vfio_iommu_type1.c               |  45 ++--
 include/linux/vfio.h                          |   9 +-
 11 files changed, 215 insertions(+), 217 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-07-23  2:11 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-08 22:44 [PATCH v3 00/10] Update vfio_pin/unpin_pages API Nicolin Chen
2022-07-08 22:44 ` [PATCH v3 01/10] vfio: Make vfio_unpin_pages() return void Nicolin Chen
2022-07-12 14:21   ` Anthony Krowiak
2022-07-12 18:18     ` Nicolin Chen
2022-07-08 22:44 ` [PATCH v3 02/10] drm/i915/gvt: Replace roundup with DIV_ROUND_UP Nicolin Chen
2022-07-08 22:44 ` [PATCH v3 03/10] vfio/ap: Pass in physical address of ind to ap_aqic() Nicolin Chen
2022-07-08 22:44 ` [PATCH v3 04/10] vfio/ccw: Only pass in contiguous pages Nicolin Chen
2022-07-08 22:44 ` [PATCH v3 05/10] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API Nicolin Chen
2022-07-12 14:25   ` Anthony Krowiak
2022-07-08 22:44 ` [PATCH v3 06/10] vfio/ap: Change saved_pfn to saved_iova Nicolin Chen
2022-07-12 14:28   ` Anthony Krowiak
2022-07-08 22:44 ` [PATCH v3 07/10] vfio/ccw: Change pa_pfn list to pa_iova list Nicolin Chen
2022-07-08 22:44 ` [PATCH v3 08/10] vfio: Rename user_iova of vfio_dma_rw() Nicolin Chen
2022-07-08 22:44 ` [PATCH v3 09/10] vfio/ccw: Add kmap_local_page() for memcpy Nicolin Chen
2022-07-22 22:11 ` [PATCH v3 00/10] Update vfio_pin/unpin_pages API Alex Williamson
2022-07-22 23:12   ` Nicolin Chen
2022-07-23  0:18     ` Alex Williamson
2022-07-23  0:38       ` Nicolin Chen
2022-07-23  1:09         ` Alex Williamson
2022-07-23  2:10           ` Nicolin Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).