RE: [PATCH v2 vfio 0/2] vfio/pds: Fix and simplify resets

From: Shameerali Kolothum Thodi
Date: Wed Feb 28 2024 - 04:08:41 EST




> -----Original Message-----
> From: Brett Creeley <brett.creeley@xxxxxxx>
> Sent: Wednesday, February 28, 2024 12:32 AM
> To: jgg@xxxxxxxx; yishaih@xxxxxxxxxx; Shameerali Kolothum Thodi
> <shameerali.kolothum.thodi@xxxxxxxxxx>; kevin.tian@xxxxxxxxx;
> alex.williamson@xxxxxxxxxx; kvm@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Cc: shannon.nelson@xxxxxxx; brett.creeley@xxxxxxx
> Subject: [PATCH v2 vfio 0/2] vfio/pds: Fix and simplify resets
>
> This small series contains a fix and readability improvements for
> resets.
>
> v2:
> - Split single patch into 2 patches
> - Improve commit messages

Just a query on the reset_done handler and the deferred_reset()
logic in this driver. From a quick look, it doesn't look like you have
a condition where a copy_to/from_user() is under state_mutex. So
do you think we can get rid of the deferred_reset logic from this
driver? Please see the discussion here,
https://lore.kernel.org/kvm/20240220132459.GM13330@xxxxxxxxxx/

For HiSilicon, we do have the lock taken for PRE_COPY, but that needs fixing
and then can get rid of the deferred_reset. I will sent out a patch for
that soon.

Thanks,
Shameer

>
> v1:
> https://lore.kernel.org/kvm/20240126183225.19193-1-
> brett.creeley@xxxxxxx/
>
> Brett Creeley (2):
> vfio/pds: Always clear the save/restore FDs on reset
> vfio/pds: Refactor/simplify reset logic
>
> drivers/vfio/pci/pds/pci_drv.c | 2 +-
> drivers/vfio/pci/pds/vfio_dev.c | 14 +++++++-------
> drivers/vfio/pci/pds/vfio_dev.h | 7 ++++++-
> 3 files changed, 14 insertions(+), 9 deletions(-)
>
> --
> 2.17.1