RE: [RFC PATCH 05/19] vfio/pci: Serialize config access with recovery
From: Shameer Kolothum Thodi
Date: Thu Sep 03 2026 - 07:12:45 EST
> -----Original Message-----
> From: K V P, Satyanarayana <satyanarayana.k.v.p@xxxxxxxxx>
> Sent: 02 September 2026 07:28
> To: Shameer Kolothum Thodi <skolothumtho@xxxxxxxxxx>;
> kvm@xxxxxxxxxxxxxxx; linux-pci@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Cc: alex@xxxxxxxxxxx; jgg@xxxxxxxx; kevin.tian@xxxxxxxxx;
> kbusch@xxxxxxxx; michal.winiarski@xxxxxxxxx; Sonang Patel
> <sonangp@xxxxxxxxxx>; Nathan Chen <nathanc@xxxxxxxxxx>; Matt Ochs
> <mochs@xxxxxxxxxx>
> Subject: Re: [RFC PATCH 05/19] vfio/pci: Serialize config access with recovery
>
[...]
> > } else {
> > - if (perm->readfn) {
> > + access_ret = vfio_pci_core_access_begin(vdev);
> > + if (access_ret)
> > + return access_ret;
> > + if (perm->readfn)
> > ret = perm->readfn(vdev, *ppos, count,
> > perm, offset, &val);
> > - if (ret < 0)
> > - return ret;
> > - }
> > + vfio_pci_core_access_end(vdev);
> > + if (ret < 0)
> > + return ret;
>
> The else {} is all about perm->readfn. Can we move
> vfio_pci_core_access_begin() and end() inside the if (perm->readfn) ?
>
> We do not need to bring if (ret < 0) out of if(perm->readfn) in that case.
Right. That’s better, will change it.
Thanks,
Shameer