From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 15 May 2019 15:50:17 +0200 From: Cornelia Huck Subject: Re: [PATCH 10/10] virtio/s390: make airq summary indicators DMA Message-ID: <20190515155017.0d3e2543.cohuck@redhat.com> In-Reply-To: <3a8353e2-97e3-778e-ab2e-ef285ac7027d@linux.ibm.com> References: <20190426183245.37939-1-pasic@linux.ibm.com> <20190426183245.37939-11-pasic@linux.ibm.com> <20190513142010.36c8478f.cohuck@redhat.com> <3a8353e2-97e3-778e-ab2e-ef285ac7027d@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Michael Mueller Cc: Halil Pasic , kvm@vger.kernel.org, linux-s390@vger.kernel.org, Martin Schwidefsky , Sebastian Ott , virtualization@lists.linux-foundation.org, "Michael S. Tsirkin" , Christoph Hellwig , Thomas Huth , Christian Borntraeger , Viktor Mihajlovski , Vasily Gorbik , Janosch Frank , Claudio Imbrenda , Farhan Ali , Eric Farman List-ID: On Wed, 15 May 2019 15:43:23 +0200 Michael Mueller wrote: > On 13.05.19 14:20, Cornelia Huck wrote: > > On Fri, 26 Apr 2019 20:32:45 +0200 > > Halil Pasic wrote: > > > >> Hypervisor needs to interact with the summary indicators, so these > >> need to be DMA memory as well (at least for protected virtualization > >> guests). > >> > >> Signed-off-by: Halil Pasic > >> --- > >> drivers/s390/virtio/virtio_ccw.c | 24 +++++++++++++++++------- > >> 1 file changed, 17 insertions(+), 7 deletions(-) > > > > (...) > > > >> @@ -237,7 +243,8 @@ static void virtio_airq_handler(struct airq_struct *airq) > >> read_unlock(&info->lock); > >> } > >> > >> -static struct airq_info *new_airq_info(void) > >> +/* call with drivers/s390/virtio/virtio_ccw.cheld */ > > > > Hm, where is airq_areas_lock defined? If it was introduced in one of > > the previous patches, I have missed it. > > There is no airq_areas_lock defined currently. My assumption is that > this will be used in context with the likely race condition this > part of the patch is talking about. > > @@ -273,8 +281,9 @@ static unsigned long get_airq_indicator(struct > virtqueue *vqs[], int nvqs, > unsigned long bit, flags; > > for (i = 0; i < MAX_AIRQ_AREAS && !indicator_addr; i++) { > + /* TODO: this seems to be racy */ > if (!airq_areas[i]) > - airq_areas[i] = new_airq_info(); > + airq_areas[i] = new_airq_info(i); > > > As this shall be handled by a separate patch I will drop the comment > in regard to airq_areas_lock from this patch as well for v2. Ok, that makes sense. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH 10/10] virtio/s390: make airq summary indicators DMA Date: Wed, 15 May 2019 15:50:17 +0200 Message-ID: <20190515155017.0d3e2543.cohuck@redhat.com> References: <20190426183245.37939-1-pasic@linux.ibm.com> <20190426183245.37939-11-pasic@linux.ibm.com> <20190513142010.36c8478f.cohuck@redhat.com> <3a8353e2-97e3-778e-ab2e-ef285ac7027d@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <3a8353e2-97e3-778e-ab2e-ef285ac7027d@linux.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Michael Mueller Cc: Vasily Gorbik , linux-s390@vger.kernel.org, Thomas Huth , Claudio Imbrenda , kvm@vger.kernel.org, Sebastian Ott , "Michael S. Tsirkin" , Farhan Ali , Eric Farman , virtualization@lists.linux-foundation.org, Halil Pasic , Christoph Hellwig , Martin Schwidefsky , Viktor Mihajlovski , Janosch Frank List-Id: virtualization@lists.linuxfoundation.org On Wed, 15 May 2019 15:43:23 +0200 Michael Mueller wrote: > On 13.05.19 14:20, Cornelia Huck wrote: > > On Fri, 26 Apr 2019 20:32:45 +0200 > > Halil Pasic wrote: > > > >> Hypervisor needs to interact with the summary indicators, so these > >> need to be DMA memory as well (at least for protected virtualization > >> guests). > >> > >> Signed-off-by: Halil Pasic > >> --- > >> drivers/s390/virtio/virtio_ccw.c | 24 +++++++++++++++++------- > >> 1 file changed, 17 insertions(+), 7 deletions(-) > > > > (...) > > > >> @@ -237,7 +243,8 @@ static void virtio_airq_handler(struct airq_struct *airq) > >> read_unlock(&info->lock); > >> } > >> > >> -static struct airq_info *new_airq_info(void) > >> +/* call with drivers/s390/virtio/virtio_ccw.cheld */ > > > > Hm, where is airq_areas_lock defined? If it was introduced in one of > > the previous patches, I have missed it. > > There is no airq_areas_lock defined currently. My assumption is that > this will be used in context with the likely race condition this > part of the patch is talking about. > > @@ -273,8 +281,9 @@ static unsigned long get_airq_indicator(struct > virtqueue *vqs[], int nvqs, > unsigned long bit, flags; > > for (i = 0; i < MAX_AIRQ_AREAS && !indicator_addr; i++) { > + /* TODO: this seems to be racy */ > if (!airq_areas[i]) > - airq_areas[i] = new_airq_info(); > + airq_areas[i] = new_airq_info(i); > > > As this shall be handled by a separate patch I will drop the comment > in regard to airq_areas_lock from this patch as well for v2. Ok, that makes sense.