All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/9] iommufd/iova_bitmap: Bug fixes for IOMMU dirty tracking
@ 2024-02-02 13:34 Joao Martins
  2024-02-02 13:34 ` [PATCH v1 1/9] iommufd/iova_bitmap: Bounds check mapped::pages access Joao Martins
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Joao Martins @ 2024-02-02 13:34 UTC (permalink / raw)
  To: iommu
  Cc: Jason Gunthorpe, Kevin Tian, Suravee Suthikulpanit, Lu Baolu,
	Joao Martins, Avihai Horon, Alex Williamson,
	Shameerali Kolothum Thodi

Hey,

This relatively small series fixes a couple of bugs while extending the
selftests to test it all and one small improvement for in iova bitmap
number of iterations.

The main bug is that we miss marking part of the required dirty bits in
the migration stream when we record hugepage PTE dirty pages on a lower
page size bitmap. This is due to how we iterate IOVA bitmap ranges (see
patch 4) and that the end of the range might not be aligned to the huge
page size. As I tried to find a reproducer[0] (which were very hard in
my setup) fixed up other things around it related to the same subject.

I have a separate set of changes, that proved also instrumental in
reproducing some of these corner cases in a more predictable manner but
with IOMMU drivers instead, rather than IOMMUFD mock IOMMU driver...
without relying on VF specific behaviour. Though, it relies on being
able to map IOVAs as dirty. This is not included in this series, as I
am not sure yet if such direction would make sense (outside of testing).
Comments, appreciated.

The selftests in this series (a large majority of the series changes)
are meant to be kept in this order to be more clear in history that the
selftests exercise a given fix added earlier in the series.
The last patch is an efficiency improvement, but can act as workaround if
the IOVA ranges are smaller than 64G, which is why it is placed last.

[I think this should be targetted for -rc rather than -next]

Regards,
	Joao

[0] Using latest qemu draft here: https://github.com/jpemartins/qemu/commits/iommufd-v4

Joao Martins (9):
  iommufd/iova_bitmap: Bounds check mapped::pages access
  iommufd/iova_bitmap: Switch iova_bitmap::bitmap to an u8 array
  iommufd/selftest: Test u64 unaligned bitmaps
  iommufd/iova_bitmap: Handle recording beyond the mapped pages
  iommufd/selftest: Refactor dirty bitmap tests
  iommufd/selftest: Refactor mock_domain_read_and_clear_dirty()
  iommufd/selftest: Hugepage mock domain support
  iommufd/selftest: Add mock IO hugepages tests
  iommufd/iova_bitmap: Consider page offset for the pages to be pinned

 drivers/iommu/iommufd/iommufd_test.h          |  1 +
 drivers/iommu/iommufd/iova_bitmap.c           | 68 +++++++++++++---
 drivers/iommu/iommufd/selftest.c              | 79 ++++++++++++++-----
 tools/testing/selftests/iommu/iommufd.c       | 78 ++++++++++++++----
 tools/testing/selftests/iommu/iommufd_utils.h | 39 +++++----
 5 files changed, 205 insertions(+), 60 deletions(-)

-- 
2.17.2


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

end of thread, other threads:[~2024-05-24 11:23 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 13:34 [PATCH v1 0/9] iommufd/iova_bitmap: Bug fixes for IOMMU dirty tracking Joao Martins
2024-02-02 13:34 ` [PATCH v1 1/9] iommufd/iova_bitmap: Bounds check mapped::pages access Joao Martins
2024-02-07 16:49   ` Avihai Horon
2024-02-02 13:34 ` [PATCH v1 2/9] iommufd/iova_bitmap: Switch iova_bitmap::bitmap to an u8 array Joao Martins
2024-02-07 16:50   ` Avihai Horon
2024-02-02 13:34 ` [PATCH v1 3/9] iommufd/selftest: Test u64 unaligned bitmaps Joao Martins
2024-02-02 13:34 ` [PATCH v1 4/9] iommufd/iova_bitmap: Handle recording beyond the mapped pages Joao Martins
2024-02-07 16:51   ` Avihai Horon
2024-05-24 11:22   ` Joao Martins
2024-02-02 13:34 ` [PATCH v1 5/9] iommufd/selftest: Refactor dirty bitmap tests Joao Martins
2024-02-02 13:34 ` [PATCH v1 6/9] iommufd/selftest: Refactor mock_domain_read_and_clear_dirty() Joao Martins
2024-02-02 13:34 ` [PATCH v1 7/9] iommufd/selftest: Hugepage mock domain support Joao Martins
2024-02-02 13:34 ` [PATCH v1 8/9] iommufd/selftest: Add mock IO hugepages tests Joao Martins
2024-02-02 13:34 ` [PATCH v1 9/9] iommufd/iova_bitmap: Consider page offset for the pages to be pinned Joao Martins
2024-02-07 16:52   ` Avihai Horon
2024-02-06 18:13 ` [PATCH v1 0/9] iommufd/iova_bitmap: Bug fixes for IOMMU dirty tracking Jason Gunthorpe
2024-02-06 18:32   ` Joao Martins
2024-02-06 20:57     ` Joao Martins
2024-02-07  8:41     ` Tian, Kevin
2024-02-07 10:23       ` Joao Martins
2024-02-08  8:21         ` Tian, Kevin
2024-02-08 17:23           ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.