From: Avihai Horon <avihaih@nvidia.com>
To: Joao Martins <joao.m.martins@oracle.com>, iommu@lists.linux.dev
Cc: Jason Gunthorpe <jgg@nvidia.com>,
Kevin Tian <kevin.tian@intel.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Lu Baolu <baolu.lu@linux.intel.com>,
Alex Williamson <alex.williamson@redhat.com>,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Subject: Re: [PATCH v1 4/9] iommufd/iova_bitmap: Handle recording beyond the mapped pages
Date: Wed, 7 Feb 2024 18:51:37 +0200 [thread overview]
Message-ID: <62dcdaa3-936c-460a-8a54-edf7fa212599@nvidia.com> (raw)
In-Reply-To: <20240202133415.23819-5-joao.m.martins@oracle.com>
On 02/02/2024 15:34, Joao Martins wrote:
> External email: Use caution opening links or attachments
>
>
> IOVA bitmap is a zerocopy scheme of recording dirty bits that iterate the
> different bitmap user pages at chunks of maximum of PAGE_SIZE/sizeof(struct
> page*) pages.
>
> When the iterations are split up into 64G, the end of the range may be
> broken up in a way that's aligned with a non base page PTE size. This leads
> to only part of the huge page being recorded in the bitmap. Note that in
> pratice this is only a problem for IOMMU dirty tracking i.e. when the
> backing PTEs are in IOMMU hugepages and the bitmap is in base page
> granularity. So far this not something that affects VF dirty trackers
> (which reports and records at the same granularity).
>
> To fix that, if there is a remainder of bits left to set in which the
> current IOVA bitmap doesn't cover, make a copy of the bitmap structure and
> iterate-and-set the rest of the bits remaining. Finally, when advancing the
> iterator, skip all the bits that were set ahead.
>
> Reported-by: Avihai Horon <avihaih@nvidia.com>
> Fixes: f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains")
> Fixes: 421a511a293f ("iommu/amd: Access/Dirty bit support in IOPTEs")
> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Tested-by: Avihai Horon <avihaih@nvidia.com>
next prev parent reply other threads:[~2024-02-07 16:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62dcdaa3-936c-460a-8a54-edf7fa212599@nvidia.com \
--to=avihaih@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joao.m.martins@oracle.com \
--cc=kevin.tian@intel.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=suravee.suthikulpanit@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox