From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 534B8C04E53 for ; Wed, 15 May 2019 13:50:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A12A2070D for ; Wed, 15 May 2019 13:50:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbfEONuZ (ORCPT ); Wed, 15 May 2019 09:50:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725953AbfEONuY (ORCPT ); Wed, 15 May 2019 09:50:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A892F7DCD7; Wed, 15 May 2019 13:50:24 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76E275D9E5; Wed, 15 May 2019 13:50:19 +0000 (UTC) Date: Wed, 15 May 2019 15:50:17 +0200 From: Cornelia Huck 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 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> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 15 May 2019 13:50:24 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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.