search for: virtio_crypto_config

Displaying 20 results from an estimated 48 matches for "virtio_crypto_config".

2020 Aug 05
0
[PATCH v3 32/38] virtio_crypto: convert to LE accessors
...c index c8a962c62663..aeecce27fe8f 100644 --- a/drivers/crypto/virtio/virtio_crypto_core.c +++ b/drivers/crypto/virtio/virtio_crypto_core.c @@ -204,8 +204,8 @@ static int virtcrypto_update_status(struct virtio_crypto *vcrypto) u32 status; int err; - virtio_cread(vcrypto->vdev, - struct virtio_crypto_config, status, &status); + virtio_cread_le(vcrypto->vdev, + struct virtio_crypto_config, status, &status); /* * Unknown status bits would be a host error and the driver @@ -323,31 +323,31 @@ static int virtcrypto_probe(struct virtio_device *vdev) if (!vcrypto) return -ENOMEM; -...
2016 Nov 28
2
[PATCH v3] crypto: add virtio-crypto driver
On Mon, 28 Nov 2016 20:08:23 +0800 Gonglei <arei.gonglei at 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 devi...
2016 Nov 28
2
[PATCH v3] crypto: add virtio-crypto driver
On Mon, 28 Nov 2016 20:08:23 +0800 Gonglei <arei.gonglei at 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 devi...
2016 Nov 29
1
[virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver
...t;arei.gonglei at 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&...
2016 Nov 29
1
[virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver
...t;arei.gonglei at 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&...
2016 Nov 28
3
[virtio-dev] Re: [PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
...better explain what is the issue you are facing? > > virtio_cwrite/virtio_cread all accept and return native types. > > > virtio_cwrite/virtio_cread are used to write/read configuration > space for virtio devices. For virtio-crypto device, I used __le32/64 directly > in struct virtio_crypto_config. The sparse reports warnings if I use virtio_cread() > for virtio-crypto device. I suspect that's because you are doing cread into an le32 variable. > Furthermore, it means the warnings exist for all VIRTIO_1 devices because > they are definitely LE, which it's not necessary to...
2016 Nov 28
3
[virtio-dev] Re: [PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
...better explain what is the issue you are facing? > > virtio_cwrite/virtio_cread all accept and return native types. > > > virtio_cwrite/virtio_cread are used to write/read configuration > space for virtio devices. For virtio-crypto device, I used __le32/64 directly > in struct virtio_crypto_config. The sparse reports warnings if I use virtio_cread() > for virtio-crypto device. I suspect that's because you are doing cread into an le32 variable. > Furthermore, it means the warnings exist for all VIRTIO_1 devices because > they are definitely LE, which it's not necessary to...
2016 Nov 27
2
[PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
On Tue, Nov 22, 2016 at 04:10:22PM +0800, Gonglei wrote: > Virtio modern devices are always little edian, let's introduce > the LE functions for read/write configuration space for > virtio modern devices, which avoid complaint by Sparse when > we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices. > > Signed-off-by: Gonglei <arei.gonglei at huawei.com> > ---
2016 Nov 27
2
[PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
On Tue, Nov 22, 2016 at 04:10:22PM +0800, Gonglei wrote: > Virtio modern devices are always little edian, let's introduce > the LE functions for read/write configuration space for > virtio modern devices, which avoid complaint by Sparse when > we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices. > > Signed-off-by: Gonglei <arei.gonglei at huawei.com> > ---
2016 Nov 28
4
[PATCH v3] virtio-crypto: add Linux driver
v3: - set cpu affinity when data queues are not equal to the number of online cpus. [Michael] - add TODO comments for cpu hotplug (changing the relationship of binding virtqueue and cpu) - use __u32/64 in the config space since the virtio->get() doesn't support byte-swap yet. [Michael] - drop the whole patch 1 of v2 because the above reason. - add VERSION_1 check at the beginning of
2016 Nov 28
4
[PATCH v3] virtio-crypto: add Linux driver
v3: - set cpu affinity when data queues are not equal to the number of online cpus. [Michael] - add TODO comments for cpu hotplug (changing the relationship of binding virtqueue and cpu) - use __u32/64 in the config space since the virtio->get() doesn't support byte-swap yet. [Michael] - drop the whole patch 1 of v2 because the above reason. - add VERSION_1 check at the beginning of
2016 Nov 22
0
[PATCH v2 2/2] crypto: add virtio-crypto driver
...ity(vi); + put_online_cpus(); + + return 0; + +err_free: + virtcrypto_free_queues(vi); +err: + return ret; +} + +static int virtcrypto_update_status(struct virtio_crypto *vcrypto) +{ + __le32 status_le; + u32 status; + int err; + + status_le = virtio_cread32_le(vcrypto->vdev, + offsetof(struct virtio_crypto_config, status)); + status = le32_to_cpu(status_le); + + /* Ignore unknown (future) status bits */ + status &= VIRTIO_CRYPTO_S_HW_READY; + + if (vcrypto->status == status) + return 0; + + vcrypto->status = status; + + if (vcrypto->status & VIRTIO_CRYPTO_S_HW_READY) { + err = virtcrypto_...
2016 Nov 14
3
[PATCH] crypto: add virtio-crypto driver
...) + goto err_free; + + get_online_cpus(); + virtcrypto_set_affinity(vi); + put_online_cpus(); + + return 0; + +err_free: + virtcrypto_free_queues(vi); +err: + return ret; +} + +static void virtcrypto_update_status(struct virtio_crypto *vcrypto) +{ + u32 v; + + virtio_cread(vcrypto->vdev, struct virtio_crypto_config, status, &v); + + /* Ignore unknown (future) status bits */ + v &= VIRTIO_CRYPTO_S_HW_READY; + + if (vcrypto->status == v) + return; + + vcrypto->status = v; + + if (vcrypto->status & VIRTIO_CRYPTO_S_HW_READY) + pr_info("virtio_crypto: accelerator is ready\n"); + el...
2016 Nov 14
3
[PATCH] crypto: add virtio-crypto driver
...) + goto err_free; + + get_online_cpus(); + virtcrypto_set_affinity(vi); + put_online_cpus(); + + return 0; + +err_free: + virtcrypto_free_queues(vi); +err: + return ret; +} + +static void virtcrypto_update_status(struct virtio_crypto *vcrypto) +{ + u32 v; + + virtio_cread(vcrypto->vdev, struct virtio_crypto_config, status, &v); + + /* Ignore unknown (future) status bits */ + v &= VIRTIO_CRYPTO_S_HW_READY; + + if (vcrypto->status == v) + return; + + vcrypto->status = v; + + if (vcrypto->status & VIRTIO_CRYPTO_S_HW_READY) + pr_info("virtio_crypto: accelerator is ready\n"); + el...
2016 Nov 28
0
[PATCH v3] crypto: add virtio-crypto driver
...+ get_online_cpus(); + virtcrypto_set_affinity(vi); + put_online_cpus(); + + return 0; + +err_free: + virtcrypto_free_queues(vi); +err: + return ret; +} + +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; + + if (vcrypto->status == status) + return 0; + + vcrypto->status = status; + + if (vcrypto->status & VIRTIO_CRYPTO_S_HW_READY) { + err = virtcrypto_dev_start(vcrypto); +...
2016 Nov 29
0
[PATCH v4 1/1] crypto: add virtio-crypto driver
...+ get_online_cpus(); + virtcrypto_set_affinity(vi); + put_online_cpus(); + + return 0; + +err_free: + virtcrypto_free_queues(vi); +err: + return ret; +} + +static int virtcrypto_update_status(struct virtio_crypto *vcrypto) +{ + u32 status; + int err; + + virtio_cread(vcrypto->vdev, + struct virtio_crypto_config, status, &status); + + /* + * Unknown status bits would be a host error and the driver + * should consider the device to be broken. + */ + if (status & (~VIRTIO_CRYPTO_S_HW_READY)) { + dev_err(&vcrypto->vdev->dev, + "Unknown status bits: 0x%x\n", status); + + vir...
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...irtcrypto_free_queues(vi); > +err: > + return ret; > +} > + > +static int virtcrypto_update_status(struct virtio_crypto *vcrypto) > +{ > + __le32 status_le; > + u32 status; > + int err; > + > + status_le = virtio_cread32_le(vcrypto->vdev, > + offsetof(struct virtio_crypto_config, status)); > + status = le32_to_cpu(status_le); > + > + /* Ignore unknown (future) status bits */ > + status &= VIRTIO_CRYPTO_S_HW_READY; > + > + if (vcrypto->status == status) > + return 0; > + > + vcrypto->status = status; > + > + if (vcrypto->status...
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...irtcrypto_free_queues(vi); > +err: > + return ret; > +} > + > +static int virtcrypto_update_status(struct virtio_crypto *vcrypto) > +{ > + __le32 status_le; > + u32 status; > + int err; > + > + status_le = virtio_cread32_le(vcrypto->vdev, > + offsetof(struct virtio_crypto_config, status)); > + status = le32_to_cpu(status_le); > + > + /* Ignore unknown (future) status bits */ > + status &= VIRTIO_CRYPTO_S_HW_READY; > + > + if (vcrypto->status == status) > + return 0; > + > + vcrypto->status = status; > + > + if (vcrypto->status...
2016 Nov 28
5
[PATCH v3] crypto: add virtio-crypto driver
...> + return 0; > + > +err_free: > + virtcrypto_free_queues(vi); > +err: > + return ret; > +} > + > +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; > + > + if (vcrypto->status == status) > + return 0; > + > + vcrypto->status = status; > + > + if (vcrypto->status & VIRTIO_CRYPTO_S_HW_RE...
2016 Nov 28
5
[PATCH v3] crypto: add virtio-crypto driver
...> + return 0; > + > +err_free: > + virtcrypto_free_queues(vi); > +err: > + return ret; > +} > + > +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; > + > + if (vcrypto->status == status) > + return 0; > + > + vcrypto->status = status; > + > + if (vcrypto->status & VIRTIO_CRYPTO_S_HW_RE...