[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250619123504.GA1643390@ziepe.ca>
Date: Thu, 19 Jun 2025 09:35:04 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: lizhe.67@...edance.com
Cc: david@...hat.com, akpm@...ux-foundation.org, alex.williamson@...hat.com,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, peterx@...hat.com
Subject: Re: [PATCH v4 2/3] gup: introduce unpin_user_folio_dirty_locked()
On Thu, Jun 19, 2025 at 05:05:42PM +0800, lizhe.67@...edance.com wrote:
> As I understand it, there seem to be some issues with this
> implementation. How can we obtain the value of dma->has_reserved
> (acquiring it within vfio_pin_pages_remote() might be a good option)
Yes, you record it during vfio_pin_pages operations. If VFIO call
iommu_map on something that went down the non-GUP path then it sets
the flag.
> and ensure that this value remains unchanged from the time of
> assignment until we perform the unpin operation?
Map/unmap are paired and not allowed to race so that isn't an issue.
> I've searched through the code and it appears that there are
> instances where SetPageReserved() is called outside of the
> initialization phase. Please correct me if I am wrong.
It should not be relevant here, pages under use by VFIO are not
permitted to change it will break things.
Jason
Powered by blists - more mailing lists