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_HELO_NONE,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 72E89C04AB6 for ; Tue, 28 May 2019 14:56:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51365206BA for ; Tue, 28 May 2019 14:56:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbfE1O4g (ORCPT ); Tue, 28 May 2019 10:56:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43992 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbfE1O4g (ORCPT ); Tue, 28 May 2019 10:56:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B540A19CBA4; Tue, 28 May 2019 14:56:35 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF7C87C564; Tue, 28 May 2019 14:56:29 +0000 (UTC) Date: Tue, 28 May 2019 16:56:27 +0200 From: Cornelia Huck To: Halil Pasic Cc: Michael Mueller , KVM Mailing List , Linux-S390 Mailing List , Sebastian Ott , Heiko Carstens , 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 , Pierre Morel Subject: Re: [PATCH v2 8/8] virtio/s390: make airq summary indicators DMA Message-ID: <20190528165627.76da557a.cohuck@redhat.com> In-Reply-To: <20190528163342.335eea0b.pasic@linux.ibm.com> References: <20190523162209.9543-1-mimu@linux.ibm.com> <20190523162209.9543-9-mimu@linux.ibm.com> <20190527140018.7c2d34ff.cohuck@redhat.com> <20190528163342.335eea0b.pasic@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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 28 May 2019 14:56:35 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 28 May 2019 16:33:42 +0200 Halil Pasic wrote: > On Mon, 27 May 2019 14:00:18 +0200 > Cornelia Huck wrote: > > > On Thu, 23 May 2019 18:22:09 +0200 > > Michael Mueller wrote: > > > > > From: Halil Pasic > > > > > > 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 | 22 +++++++++++++++------- > > > 1 file changed, 15 insertions(+), 7 deletions(-) > > > > (...) > > > > > @@ -1501,6 +1508,7 @@ static int __init virtio_ccw_init(void) > > > { > > > /* parse no_auto string before we do anything further */ > > > no_auto_parse(); > > > + summary_indicators = cio_dma_zalloc(MAX_AIRQ_AREAS); > > > > What happens if this fails? > > Bad things could happen! > > How about adding > > if (!summary_indicators) > virtio_ccw_use_airq = 0; /* fall back to classic */ > > ? > > Since it ain't very likely to happen, we could also just fail > virtio_ccw_init() with -ENOMEM. How high are the chances of things working if we fail to allocate here? Returning with -ENOMEM is probably the more reasonable approach here.