qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	Luonengjun <luonengjun@huawei.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"Huangweidong (C)" <weidong.huang@huawei.com>,
	"Wubin (H)" <wu.wubin@huawei.com>,
	"xin.zeng@intel.com" <xin.zeng@intel.com>,
	Claudio Fontana <Claudio.Fontana@huawei.com>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"pasic@linux.vnet.ibm.com" <pasic@linux.vnet.ibm.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"Zhoujian (jay, Euler)" <jianjay.zhou@huawei.com>,
	"Hanweidong (Randy)" <hanweidong@huawei.com>,
	"arei.gonglei@hotmail.com" <arei.gonglei@hotmail.com>,
	"Xuquan (Quan Xu)" <xuquan8@huawei.com>,
	longpeng <longpeng2@huawei.com>,
	"salvatore.benedetto@intel.com" <salvatore.benedetto@intel.com>
Subject: Re: [Qemu-devel] [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver
Date: Tue, 29 Nov 2016 10:44:06 +0100	[thread overview]
Message-ID: <20161129104406.6c110ae0.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020DA14A53D@DGGEMA505-MBX.china.huawei.com>

On Tue, 29 Nov 2016 01:37:44 +0000
"Gonglei (Arei)" <arei.gonglei@huawei.com> wrote:

> > On Mon, 28 Nov 2016 20:08:23 +0800
> > Gonglei <arei.gonglei@huawei.com> wrote:
> > 
> > > +static int virtcrypto_update_status(struct virtio_crypto *vcrypto)
> > > +{
> > > +	u32 status;
> > > +	int err;
> > > +
> > > +	virtio_cread(vcrypto->vdev,
> > > +	    struct virtio_crypto_config, status, &status);
> > > +
> > > +	/* Ignore unknown (future) status bits */
> > > +	status &= VIRTIO_CRYPTO_S_HW_READY;
> > 
> > I'm wondering what the driver really should do if it encounters unknown
> > status bits.
> > 
> > I'd expect that new status bits are guarded by a feature bit and that
> > the device should not set status bits if the respective feature bit has
> > not been negotiated. Therefore, unknown status bits would be a host
> > error and the driver should consider the device to be broken.
> > 
> > Thoughts?
> > 
> I agree with you. 
> 
> The reasonable way is reset the device if the driver
> receive an unknown status IMO.

What about setting FAILED in the generic virtio status? This indicates
to the host that the driver 'has given up on the device', as the spec
puts it. If the driver simply resets it, chances are that we will end
up in the same situation again (after all, that's a host bug).

Or/additionally use virtio_break_device(), as a quick grep revealed
that qemu, for one, does not do anything with FAILED. That way at least
the driver will stop mucking with the device.

  reply	other threads:[~2016-11-29  9:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 12:08 [Qemu-devel] [PATCH v3] virtio-crypto: add Linux driver Gonglei
2016-11-28 12:08 ` [Qemu-devel] [PATCH v3] crypto: add virtio-crypto driver Gonglei
2016-11-28 13:12   ` Cornelia Huck
2016-11-29  1:37     ` [Qemu-devel] [virtio-dev] " Gonglei (Arei)
2016-11-29  9:44       ` Cornelia Huck [this message]
2016-11-29 11:50         ` Gonglei (Arei)
2016-11-28 16:02   ` [Qemu-devel] " kbuild test robot
2016-11-28 16:20   ` Stefan Hajnoczi
2016-11-28 17:19     ` Michael S. Tsirkin
2016-11-28 17:37       ` Halil Pasic
2016-11-29  3:40         ` Gonglei (Arei)
2016-11-29  3:32       ` Gonglei (Arei)
2016-11-29  6:47       ` Gonglei (Arei)
2016-11-29  8:22       ` Gonglei (Arei)
2016-11-29  9:25         ` Stefan Hajnoczi
2016-11-29  9:29           ` Cornelia Huck
2016-11-29 11:46             ` Gonglei (Arei)
2016-11-29  9:31           ` Gonglei (Arei)

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=20161129104406.6c110ae0.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=Claudio.Fontana@huawei.com \
    --cc=arei.gonglei@hotmail.com \
    --cc=arei.gonglei@huawei.com \
    --cc=davem@davemloft.net \
    --cc=hanweidong@huawei.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jianjay.zhou@huawei.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longpeng2@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=salvatore.benedetto@intel.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=weidong.huang@huawei.com \
    --cc=wu.wubin@huawei.com \
    --cc=xin.zeng@intel.com \
    --cc=xuquan8@huawei.com \
    /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).