[PATCH 14/14] vfio/mdev: add mdev available instance checking to the core
Christoph Hellwig
hch at lst.de
Tue Jul 19 14:48:08 UTC 2022
On Mon, Jul 18, 2022 at 10:00:26PM -0400, Eric Farman wrote:
> > + if (!drv->get_available) {
> > + if (atomic_dec_and_test(&parent->available_instances))
> > {
>
> Ah, subtle change between v5 and v6 to use atomics. As vfio-ccw only
> has 1 available instance per mdev, this breaks us. Did you mean
> atomic_dec_if_positive() ?
Yes, this should have been atomic_dec_if_positive. Or just an open
coded atomic_dec + atomic_read a the only reason to use an atomic is
for the sysfs file that reads it outside the lock.
More information about the intel-gvt-dev
mailing list