Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1532215

RE: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver

From "Gonglei (Arei)" <arei.gonglei@huawei.com>
Newsgroups linux.kernel
Subject RE: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver
Date 2016-11-29 13:00 +0100
Message-ID <sIPeN-7XO-17@gated-at.bofh.it> (permalink)
References <sIt4B-1Zr-3@gated-at.bofh.it> <sIt4B-1Zr-1@gated-at.bofh.it> <sIu0G-2yY-31@gated-at.bofh.it> <sIFIt-1vJ-9@gated-at.bofh.it> <sINd0-6J1-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>
> Subject: Re: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver
> 
> 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.
> 
I prefer to the second way. The device set the incorrect status,
then the driver prevent the device from being used and print some
error message to notice that.

Patch will go.

Regards,
-Gonglei
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] virtio-crypto: add Linux driver Gonglei <arei.gonglei@huawei.com> - 2016-11-28 13:20 +0100
  Re: [PATCH v3] crypto: add virtio-crypto driver Cornelia Huck <cornelia.huck@de.ibm.com> - 2016-11-28 14:20 +0100
    RE: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver "Gonglei (Arei)" <arei.gonglei@huawei.com> - 2016-11-29 02:50 +0100
      Re: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver Cornelia Huck <cornelia.huck@de.ibm.com> - 2016-11-29 10:50 +0100
        RE: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver "Gonglei (Arei)" <arei.gonglei@huawei.com> - 2016-11-29 13:00 +0100
  Re: [PATCH v3] crypto: add virtio-crypto driver Halil Pasic <pasic@linux.vnet.ibm.com> - 2016-11-28 18:40 +0100
    RE: [PATCH v3] crypto: add virtio-crypto driver "Gonglei (Arei)" <arei.gonglei@huawei.com> - 2016-11-29 04:50 +0100
  RE: [PATCH v3] crypto: add virtio-crypto driver "Gonglei (Arei)" <arei.gonglei@huawei.com> - 2016-11-29 07:50 +0100
  RE: [PATCH v3] crypto: add virtio-crypto driver "Gonglei (Arei)" <arei.gonglei@huawei.com> - 2016-11-29 09:30 +0100
    Re: [PATCH v3] crypto: add virtio-crypto driver Stefan Hajnoczi <stefanha@redhat.com> - 2016-11-29 10:30 +0100
      Re: [PATCH v3] crypto: add virtio-crypto driver Cornelia Huck <cornelia.huck@de.ibm.com> - 2016-11-29 10:40 +0100
        RE: [PATCH v3] crypto: add virtio-crypto driver "Gonglei (Arei)" <arei.gonglei@huawei.com> - 2016-11-29 12:50 +0100
      RE: [PATCH v3] crypto: add virtio-crypto driver "Gonglei (Arei)" <arei.gonglei@huawei.com> - 2016-11-29 10:40 +0100

csiph-web