From: Cornelia Huck <cohuck@redhat.com>
To: Pierre Morel <pmorel@linux.ibm.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
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 <david@gibson.dropbear.id.au>,
Ram Pai <linuxram@us.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
Date: Tue, 16 Jun 2020 15:50:51 +0200 [thread overview]
Message-ID: <20200616155051.5b842895.cohuck@redhat.com> (raw)
In-Reply-To: <e130c5e7-40e5-40a8-eac3-c2d17c90ee7b@linux.ibm.com>
On Tue, 16 Jun 2020 15:41:20 +0200
Pierre Morel <pmorel@linux.ibm.com> wrote:
> On 2020-06-16 14:17, Cornelia Huck wrote:
> > On Tue, 16 Jun 2020 13:57:26 +0200
> > Halil Pasic <pasic@linux.ibm.com> wrote:
> >
> >> On Tue, 16 Jun 2020 12:52:50 +0200
> >> Pierre Morel <pmorel@linux.ibm.com> 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.
next prev parent reply other threads:[~2020-06-16 13:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 12:39 [PATCH v2 0/1] s390: virtio: let's arch choose to accept devices without IOMMU feature Pierre Morel
2020-06-15 12:39 ` [PATCH v2 1/1] s390: virtio: let arch " Pierre Morel
2020-06-16 6:22 ` Jason Wang
2020-06-16 7:33 ` Pierre Morel
2020-06-16 6:55 ` Christian Borntraeger
2020-06-16 7:35 ` Pierre Morel
2020-06-16 12:21 ` Cornelia Huck
2020-06-16 9:52 ` Halil Pasic
2020-06-16 10:52 ` Pierre Morel
2020-06-16 11:57 ` Halil Pasic
2020-06-16 12:17 ` Cornelia Huck
2020-06-16 13:41 ` Pierre Morel
2020-06-16 13:50 ` Cornelia Huck [this message]
2020-06-16 12:20 ` Cornelia Huck
2020-06-16 13:36 ` Pierre Morel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200616155051.5b842895.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pmorel@linux.ibm.com \
--cc=thomas.lendacky@amd.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).