lkml.org 
[lkml]   [2022]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v17 14/15] s390/ap: notify drivers on config changed and scan complete callbacks
On Mon, 7 Feb 2022 14:39:31 -0500
Tony Krowiak <akrowiak@linux.ibm.com> wrote:

> > Back to the topic of locking: it looks to me that on this path you
> > do the filtering and thus the accesses to matrix_mdev->shadow_apcb,
> > matrix_mdev->matrix and matrix_dev->config_info some of which are
> > of type write whithout the matrix_dev->lock held. More precisely
> > only with the matrix_dev->guests_lock held in "read" mode.
> >
> > Did I misread the code? If not, how is that OK?
>
> You make a valid point, a struct rw_semaphore is not adequate for the
> purposes
> it is used in this patch series. It needs to be a mutex.
>

Good we agree that v17 is racy.

>
> For v18 which is forthcoming probably this week, I've been reworking the
> locking
> based on your observation that the struct ap_guest is not necessary given we
> already have a list of the mediated devices which contain the KVM
> pointer. On the other

[..]
>
> >
> > BTW I got delayed on my "locking rules" writeup. Sorry for that!
>
> No worries, I've been writing up a vfio-ap-locking.rst document to
> include with the next
> version of the patch series.

I'm looking forward to v18 including that document. I prefer not to
discuss what you wrote about the approach taken in v18 now. It is easier
to me when I have both the text stating the intended design, and the
code that is supposed to adhere to this design.

Regards,
Halil

\
 
 \ /
  Last update: 2022-02-08 02:49    [W:0.112 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site