All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Halil Pasic <pasic@linux.vnet.ibm.com>
Cc: "Longpeng(Mike)" <longpeng2@huawei.com>,
	qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org,
	luonengjun@huawei.com, cornelia.huck@de.ibm.com,
	stefanha@redhat.com, denglingli@chinamobile.com,
	Jani.Kokkonen@huawei.com, Ola.Liljedahl@arm.com,
	Varun.Sethi@freescale.com, xin.zeng@intel.com,
	brian.a.keating@intel.com, liang.j.ma@intel.com,
	john.griffin@intel.com, weidong.huang@huawei.com, agraf@suse.de,
	jasowang@redhat.com, vincent.jardin@6wind.com,
	arei.gonglei@huawei.com, wangxinxin.wang@huawei.com,
	jianjay.zhou@huawei.com
Subject: Re: [Qemu-devel] [v23 1/2] virtio-crypto: Add virtio crypto device specification
Date: Tue, 9 Jan 2018 19:41:13 +0200	[thread overview]
Message-ID: <20180109193800-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <fcb63fc3-22eb-7f6c-2014-744ee75784eb@linux.vnet.ibm.com>

On Tue, Jan 09, 2018 at 06:05:41PM +0100, Halil Pasic wrote:
> > +\drivernormative{\subsubsection}{Device configuration layout}{Device Types / Crypto Device / Device configuration layout}
> > +
> > +\begin{itemize*}
> > +\item The driver MUST read the \field{status} from the bottom bit of status to check whether the
> > +    VIRTIO_CRYPTO_S_HW_READY is set, and the driver MUST reread it after device reset.
> > +\item The driver MUST NOT transmit any requests to the device if the VIRTIO_CRYPTO_S_HW_READY is not set.
> > +\item The driver MUST read \field{max_dataqueues} field to discover the number of data queues the device supports.
> > +\item The driver MUST read \field{crypto_services} field to discover which services the device is able to offer.
> > +\item The driver SHOULD ignore the not defined algorithms bits.
> > +\item The driver MUST read the detailed algorithms fields based on \field{crypto_services} field.
> > +\item The driver SHOULD read \field{max_size} to discover the maximum size of crypto request the device supports.
> > +\item The driver SHOULD read \field{max_cipher_key_len} to discover the maximum length of cipher key
> > +    the device supports.
> > +\item The driver SHOULD read \field{max_auth_key_len} to discover the maximum length of authenticated
> > +    key the device supports.
> > +\end{itemize*}
> 
> Seems to like a common practice in the virtio spec to say SHOULD read some
> config space parameter in a driver normative but then having no driver normative
> about the operational implications of the parameter.
> 
> While I do think that the reader is usually fully capable of inferring
> the operational requirement, I find it a bit strange: having the operational
> stuff explicit (and possibly needs to be read from the config space implicit)
> seems more straight forward to me.
> 
> Anyway, you are consistent with the rest of the spec, so prefer keeping it
> like this.

The reason for this in virtio generally is that driver is really
only required to be consistent with the device.
Something like reading the value once and storing in e.g.
registry, then using the stored value from registry on
following values seems to also be ok.

Restricting values below the limits allowed by the device
also seems to be ok.

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Halil Pasic <pasic@linux.vnet.ibm.com>
Cc: "Longpeng(Mike)" <longpeng2@huawei.com>,
	qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org,
	luonengjun@huawei.com, cornelia.huck@de.ibm.com,
	stefanha@redhat.com, denglingli@chinamobile.com,
	Jani.Kokkonen@huawei.com, Ola.Liljedahl@arm.com,
	Varun.Sethi@freescale.com, xin.zeng@intel.com,
	brian.a.keating@intel.com, liang.j.ma@intel.com,
	john.griffin@intel.com, weidong.huang@huawei.com, agraf@suse.de,
	jasowang@redhat.com, vincent.jardin@6wind.com,
	arei.gonglei@huawei.com, wangxinxin.wang@huawei.com,
	jianjay.zhou@huawei.com
Subject: [virtio-dev] Re: [Qemu-devel] [v23 1/2] virtio-crypto: Add virtio crypto device specification
Date: Tue, 9 Jan 2018 19:41:13 +0200	[thread overview]
Message-ID: <20180109193800-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <fcb63fc3-22eb-7f6c-2014-744ee75784eb@linux.vnet.ibm.com>

On Tue, Jan 09, 2018 at 06:05:41PM +0100, Halil Pasic wrote:
> > +\drivernormative{\subsubsection}{Device configuration layout}{Device Types / Crypto Device / Device configuration layout}
> > +
> > +\begin{itemize*}
> > +\item The driver MUST read the \field{status} from the bottom bit of status to check whether the
> > +    VIRTIO_CRYPTO_S_HW_READY is set, and the driver MUST reread it after device reset.
> > +\item The driver MUST NOT transmit any requests to the device if the VIRTIO_CRYPTO_S_HW_READY is not set.
> > +\item The driver MUST read \field{max_dataqueues} field to discover the number of data queues the device supports.
> > +\item The driver MUST read \field{crypto_services} field to discover which services the device is able to offer.
> > +\item The driver SHOULD ignore the not defined algorithms bits.
> > +\item The driver MUST read the detailed algorithms fields based on \field{crypto_services} field.
> > +\item The driver SHOULD read \field{max_size} to discover the maximum size of crypto request the device supports.
> > +\item The driver SHOULD read \field{max_cipher_key_len} to discover the maximum length of cipher key
> > +    the device supports.
> > +\item The driver SHOULD read \field{max_auth_key_len} to discover the maximum length of authenticated
> > +    key the device supports.
> > +\end{itemize*}
> 
> Seems to like a common practice in the virtio spec to say SHOULD read some
> config space parameter in a driver normative but then having no driver normative
> about the operational implications of the parameter.
> 
> While I do think that the reader is usually fully capable of inferring
> the operational requirement, I find it a bit strange: having the operational
> stuff explicit (and possibly needs to be read from the config space implicit)
> seems more straight forward to me.
> 
> Anyway, you are consistent with the rest of the spec, so prefer keeping it
> like this.

The reason for this in virtio generally is that driver is really
only required to be consistent with the device.
Something like reading the value once and storing in e.g.
registry, then using the stored value from registry on
following values seems to also be ok.

Restricting values below the limits allowed by the device
also seems to be ok.

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


  reply	other threads:[~2018-01-09 17:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-30  9:35 [Qemu-devel] [v23 0/2] virtio-crypto: virtio crypto device specification Longpeng(Mike)
2017-12-30  9:35 ` [Qemu-devel] [v23 1/2] virtio-crypto: Add " Longpeng(Mike)
2018-01-09 17:05   ` Halil Pasic
2018-01-09 17:05     ` [virtio-dev] " Halil Pasic
2018-01-09 17:41     ` Michael S. Tsirkin [this message]
2018-01-09 17:41       ` Michael S. Tsirkin
2018-01-10  5:53     ` Longpeng (Mike)
2018-01-10  5:53       ` [virtio-dev] " Longpeng (Mike)
2018-06-20  3:34       ` [Qemu-devel] [virtio-dev] " Michael S. Tsirkin
2018-06-20  3:34         ` [virtio-dev] Re: [Qemu-devel] " Michael S. Tsirkin
2018-06-20  6:15         ` [Qemu-devel] [virtio-dev] " Longpeng (Mike)
2018-03-16 16:27     ` Michael S. Tsirkin
2018-03-16 16:27       ` [virtio-dev] Re: [Qemu-devel] " Michael S. Tsirkin
2018-03-16 18:18       ` [Qemu-devel] [virtio-dev] " Halil Pasic
2018-03-16 18:18         ` [virtio-dev] Re: [Qemu-devel] " Halil Pasic
2018-03-19  0:13         ` [Qemu-devel] [virtio-dev] " Michael S. Tsirkin
2018-03-19  0:13           ` [virtio-dev] Re: [Qemu-devel] " Michael S. Tsirkin
2018-07-20 12:01     ` Longpeng (Mike)
2018-07-20 12:01       ` [virtio-dev] " Longpeng (Mike)
2018-07-26 16:55       ` Halil Pasic
2018-07-26 16:55         ` [virtio-dev] " Halil Pasic
2018-07-27  0:59         ` Longpeng (Mike)
2018-07-27  0:59           ` [virtio-dev] " Longpeng (Mike)
2018-07-27 11:51         ` [Qemu-devel] [virtio-dev] " Michael S. Tsirkin
2018-07-27 11:51           ` [virtio-dev] Re: [Qemu-devel] " Michael S. Tsirkin
2018-08-01 20:21           ` [Qemu-devel] [virtio-dev] " Halil Pasic
2018-08-01 20:21             ` [virtio-dev] " Halil Pasic
2018-08-02  1:56             ` Longpeng (Mike)
2018-08-02  1:56               ` [virtio-dev] " Longpeng (Mike)
2017-12-30  9:35 ` [Qemu-devel] [v23 2/2] virtio-crypto: Add conformance clauses Longpeng(Mike)
2017-12-30  9:35   ` [virtio-dev] " Longpeng(Mike)

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=20180109193800-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=Jani.Kokkonen@huawei.com \
    --cc=Ola.Liljedahl@arm.com \
    --cc=Varun.Sethi@freescale.com \
    --cc=agraf@suse.de \
    --cc=arei.gonglei@huawei.com \
    --cc=brian.a.keating@intel.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=denglingli@chinamobile.com \
    --cc=jasowang@redhat.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=john.griffin@intel.com \
    --cc=liang.j.ma@intel.com \
    --cc=longpeng2@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vincent.jardin@6wind.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=wangxinxin.wang@huawei.com \
    --cc=weidong.huang@huawei.com \
    --cc=xin.zeng@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.