On 3/4/2024 12:27 PM, Alex Williamson wrote:
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
On Thu, 29 Feb 2024 14:05:58 -0800
Brett Creeley <bcreeley@xxxxxxx> wrote:
On 2/29/2024 1:11 AM, Shameer Kolothum wrote:
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
The deferred_reset logic was added to vfio migration drivers to prevent
a circular locking dependency with respect to mm_lock and state mutex.
This is mainly because of the copy_to/from_user() functions(which takes
mm_lock) invoked under state mutex. But for HiSilicon driver, the only
place where we now hold the state mutex for copy_to_user is during the
PRE_COPY IOCTL. So for pre_copy, release the lock as soon as we have
updated the data and perform copy_to_user without state mutex. By this,
we can get rid of the deferred_reset logic.
Link: https://lore.kernel.org/kvm/20240220132459.GM13330@xxxxxxxxxx/
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@xxxxxxxxxx>
Shameer,
Thanks for providing this example. After seeing this, it probably
doens't make sense to accept my 2/2 patch at
https://lore.kernel.org/kvm/20240228003205.47311-3-brett.creeley@xxxxxxx/.
I have reworked that patch and am currently doing some testing with it
to make sure it's functional. Once I have some results I will send a v3.
Darn, somehow this thread snuck by me last week. Currently your series
is at the top of my next branch, so I'll just rebase it to 8512ed256334
("vfio/pds: Always clear the save/restore FDs on reset") to drop your
2/2 and wait for something new relative to the reset logic. Thanks,
Alex
That works for me.
Thanks,
Brett