public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Joao Martins <joao.m.martins@oracle.com>
Cc: kvm@vger.kernel.org, Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Avihai Horon <avihaih@nvidia.com>,
	Yishai Hadas <yishaih@nvidia.com>
Subject: Re: [PATCH v1 2/2] vfio/iova_bitmap: Fix PAGE_SIZE unaligned bitmaps
Date: Fri, 25 Nov 2022 08:42:09 -0400	[thread overview]
Message-ID: <Y4C4ITz7oCFBmjWi@ziepe.ca> (raw)
In-Reply-To: <8914ef49-aad4-1461-1176-6d46190d5cd8@oracle.com>

On Fri, Nov 25, 2022 at 10:37:39AM +0000, Joao Martins wrote:

> > Yes, when we move this to iommufd the test suite should be included,
> > either as integrated using the mock domain and the selftests or
> > otherwise.
>
> So in iommufd counterpart I have already tests which exercise this. But not as
> extensive.

We are getting to the point where we should start posting the iommufd
dirty tracking stuff. Do you have time to work on it for the next
cycle? Meaning get it largely sorted out in the next 3 weeks for review?

> > void iova_bitmap_set(struct iova_bitmap *bitmap,
> > 		     unsigned long iova, size_t length)
> > {
> > 	struct iova_bitmap_map *mapped = &bitmap->mapped;
> > 	unsigned cur_bit =
> > 		((iova - mapped->iova) >> mapped->pgshift) + mapped->pgoff * 8;
> > 	unsigned long last_bit =
> > 		(((iova + length - 1) - mapped->iova) >> mapped->pgshift) +
> > 		mapped->pgoff * 8;
> > 
> > 	do {
> > 		unsigned int page_idx = cur_bit / BITS_PER_PAGE;
> > 		unsigned int nbits =
> > 			min(BITS_PER_PAGE - cur_bit, last_bit - cur_bit + 1);

min(BITS_PER_PAGE - (cur_bit % BITS_PER_PAGE), ...)

> Not sure if the vfio tree is a rebasing tree (or not?) and can just send a new
> version, 

It isn't, you should just post a new patch on top of Alex's current
tree "rework iova_bitmap_et to handle all page crossings" and along
the way revert the first bit

Jason

  reply	other threads:[~2022-11-25 12:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 19:31 [PATCH v1 0/2] vfio/iova_bitmap: bug fixes Joao Martins
2022-10-25 19:31 ` [PATCH v1 1/2] vfio/iova_bitmap: Explicitly include linux/slab.h Joao Martins
2022-10-25 19:31 ` [PATCH v1 2/2] vfio/iova_bitmap: Fix PAGE_SIZE unaligned bitmaps Joao Martins
2022-11-24 18:20   ` Jason Gunthorpe
2022-11-25 10:37     ` Joao Martins
2022-11-25 12:42       ` Jason Gunthorpe [this message]
2022-11-25 14:31         ` Joao Martins
2022-11-09 20:09 ` [PATCH v1 0/2] vfio/iova_bitmap: bug fixes Joao Martins
2022-11-10 20:16 ` Alex Williamson

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=Y4C4ITz7oCFBmjWi@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=alex.williamson@redhat.com \
    --cc=avihaih@nvidia.com \
    --cc=cohuck@redhat.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=yishaih@nvidia.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