Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2465042ybt; Tue, 16 Jun 2020 06:53:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcgqk0ipduG/5SxPk1gs558eZOLdj0AYqqw7LuGe4MqYIUh1GyFcWzeYHX0bZntDk6fnGh X-Received: by 2002:a50:9306:: with SMTP id m6mr2707645eda.216.1592315623869; Tue, 16 Jun 2020 06:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592315623; cv=none; d=google.com; s=arc-20160816; b=gAAp29qsdv1GFzpOilnNUjFV/+AVoxFCpRcK5OtSI8EnN1pMfQ0M6yEWh3zDd/bAQY JW7zJHAuqjBHV5me+tGpGewjbNyMGQ4fewhgFH1tV/mA2vhFBpqOb3fySiyx7HA0KNuI VNPMxxFQqjVRRQauPUInK3iIi/NAVW8gni7J8GqS+HaenBbCcq3naJUbNf+reE+eH4WB rRwfcNfK0G5Qg/csl1Y6/TMvxOYjD0PiMIvxf2GLjuR/QEhfkSDHvL14YGSoaNQpBkq6 5WyvB/rT5b3Qd/1fEcF47lroHvcsA7sHQOGyVRSN/aET5EK3X88XuJxYm9RJtizxLj1U 6r0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=bW70KetN1S9pgLmduemj3sE+2f4ymbV6PKsDI2lVIow=; b=WS5BxBUiGpiLh7bwPWXdlrZtBRk7GFvR/zgwB2mkFDQjQacwJoV0hCiQEHXpqQ4uW0 JLMARcEH9irhUi8JTTHRCImaHn3ECoQyscaQl2gYO+cvjrn+VUqwcikaIDV8pCxBF4yu AM9Yvc7QGkxrDI4fXTmRXds5XjoXQswQpPh5cJSQTeb8gbCnGV7rZfueiYMPvlAIDZ1O URh1SZDC3M3Hizvigw40dkc6H/HNe6ZBSrWaS81KZ/8JpHqnpa1vU78LqvlW//46m0zJ pY+B2nJQ307f/JOMEpgfdu/qQ5OadkY+05xaPL645kokQbR8+lfFeMY3eEP+SlBM6ItR ejNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bs9VPbmY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si10780318eds.227.2020.06.16.06.53.20; Tue, 16 Jun 2020 06:53:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bs9VPbmY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728763AbgFPNvL (ORCPT + 99 others); Tue, 16 Jun 2020 09:51:11 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:44800 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728644AbgFPNvK (ORCPT ); Tue, 16 Jun 2020 09:51:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592315469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bW70KetN1S9pgLmduemj3sE+2f4ymbV6PKsDI2lVIow=; b=bs9VPbmYoCplUqi+W3i0mJAR9XlKNpX6L13lLQw3Zcdx6lpgR1LpPqpLe6ulpJyOBj08r+ CdMPORHKUw/SW8cnvvqsgVunFTzuvVZ9S1zgBmUqm0oWd8ujKpEgPtrNBVpHjVS6J6BI4x lnAL3vuohD7t6M0ljZhaWW7muXPVXrw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-WNGUn7ENPFa3byWrPY6RhQ-1; Tue, 16 Jun 2020 09:51:04 -0400 X-MC-Unique: WNGUn7ENPFa3byWrPY6RhQ-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6239118C35BB; Tue, 16 Jun 2020 13:51:02 +0000 (UTC) Received: from gondolin (ovpn-112-222.ams2.redhat.com [10.36.112.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5EB679303; Tue, 16 Jun 2020 13:50:53 +0000 (UTC) Date: Tue, 16 Jun 2020 15:50:51 +0200 From: Cornelia Huck To: Pierre Morel Cc: Halil Pasic , linux-kernel@vger.kernel.org, borntraeger@de.ibm.com, frankja@linux.ibm.com, mst@redhat.com, jasowang@redhat.com, kvm@vger.kernel.org, linux-s390@vger.kernel.org, virtualization@lists.linux-foundation.org, thomas.lendacky@amd.com, David Gibson , Ram Pai , Heiko Carstens , Vasily Gorbik Subject: Re: [PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature Message-ID: <20200616155051.5b842895.cohuck@redhat.com> In-Reply-To: References: <1592224764-1258-1-git-send-email-pmorel@linux.ibm.com> <1592224764-1258-2-git-send-email-pmorel@linux.ibm.com> <20200616115202.0285aa08.pasic@linux.ibm.com> <20200616135726.04fa8314.pasic@linux.ibm.com> <20200616141744.61b3a139.cohuck@redhat.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Jun 2020 15:41:20 +0200 Pierre Morel wrote: > On 2020-06-16 14:17, Cornelia Huck wrote: > > On Tue, 16 Jun 2020 13:57:26 +0200 > > Halil Pasic wrote: > > > >> On Tue, 16 Jun 2020 12:52:50 +0200 > >> Pierre Morel wrote: > >> > >>>>> int virtio_finalize_features(struct virtio_device *dev) > >>>>> { > >>>>> int ret = dev->config->finalize_features(dev); > >>>>> @@ -179,6 +184,10 @@ int virtio_finalize_features(struct virtio_device *dev) > >>>>> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) > >>>>> return 0; > >>>>> > >>>>> + if (arch_needs_iommu_platform(dev) && > >>>>> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) > >>>>> + return -EIO; > >>>>> + > >>>> > >>>> Why EIO? > >>> > >>> Because I/O can not occur correctly? > >>> I am open to suggestions. > >> > >> We use -ENODEV if feature when the device rejects the features we > >> tried to negotiate (see virtio_finalize_features()) and -EINVAL when > >> the F_VERSION_1 and the virtio-ccw revision ain't coherent (in > >> virtio_ccw_finalize_features()). Any of those seems more fitting > >> that EIO to me. BTW does the error code itself matter in any way, > >> or is it just OK vs some error? > > > > If I haven't lost my way, we end up in the driver core probe failure > > handling; we probably should do -ENODEV if we just want probing to fail > > and -EINVAL or -EIO if we want the code to moan. > > > > what about returning -ENODEV and add a dedicated warning here? > Sounds good at least to me.