All of lore.kernel.org
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.vnet.ibm.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>
Cc: Luonengjun <luonengjun@huawei.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"cornelia.huck@de.ibm.com" <cornelia.huck@de.ibm.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"denglingli@chinamobile.com" <denglingli@chinamobile.com>,
	Jani Kokkonen <Jani.Kokkonen@huawei.com>,
	"Ola.Liljedahl@arm.com" <Ola.Liljedahl@arm.com>,
	"Varun.Sethi@freescale.com" <Varun.Sethi@freescale.com>,
	"xin.zeng@intel.com" <xin.zeng@intel.com>,
	"brian.a.keating@intel.com" <brian.a.keating@intel.com>,
	"liang.j.ma@intel.com" <liang.j.ma@intel.com>,
	"john.griffin@intel.com" <john.griffin@intel.com>,
	"Huangweidong (C)" <weidong.huang@huawei.com>,
	"mike.caraman@nxp.com" <mike.caraman@nxp.com>,
	"agraf@suse.de" <agraf@suse.de>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"nmorey@kalray.eu" <nmorey@kalray.eu>,
	"vincent.jardin@6wind.com" <vincent.jardin@6wind.com>,
	"Wubin (H)" <wu.wubin@huawei.com>,
	"arei.gonglei@hotmail.com" <arei.gonglei@hotmail.com>,
	Linqiangmin <linqiangmin@huawei.com>, Zhbzg <zhbzg@huawei.com>,
	"Chenshanxi (Eety Chen, Euler)" <eety.chen@huawei.com>,
	"Zhanghuimin (Amy)" <amy.zhanghuimin@huawei.com>,
	"lixiao (H)" <lixiao91@huawei.com>
Subject: Re: [Qemu-devel] [virtio-dev] RE: [PATCH v18 1/2] virtio-crypto: Add virtio crypto device specification
Date: Fri, 5 May 2017 16:32:57 +0200	[thread overview]
Message-ID: <deb3c5f2-e4d5-1479-8a3c-2c52a1f263a9@linux.vnet.ibm.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020DA264BF8@DGGEMA505-MBX.china.huawei.com>



On 05/05/2017 07:56 AM, Gonglei (Arei) wrote:
>>
>>
>> On 05/04/2017 03:53 PM, Gonglei (Arei) wrote:
>>> Sorry, I missed one comment in the previous reply.
>>>
>>>>
>>>>> +\end{itemize*}
>>>>> +
>>>>
>>>> What about extensibility regarding "detailed algorithms"? Is the driver
>>>> required ignore algorithms
>>>> it does not "know about"? Should we reserve the not (yet) defined bits?
>>>>
>>> I mean the device MUST set the algorithms mask bits based on supported
>>> algorithms by the device, and the driver read them to get the capacity.
>>> I don't think we should care about the not defined bits.
>>
>> Let us assume that the driver fails if it encounters an unknown bit
>> (i.e. bit 13 set in hash_algo). I do not think there is anything in
>> this document that prohibits the driver doing so -- if there is please
>> do tell. Now at some point we want to support a new hash algorithm.
>> If we can't be sure that existing drivers are going to play along with
>> defining new bits (which are 'not defined bits' using your words for
>> the existing drivers) we have a small problem.
>>
>> Was I clear about my concern?
>>
> Sorry, I'm confused. For the device, it just set the bit mask based on
> supported algorithms. Please see cryptodev_builtin_init() 
> in cryptodev-builtin.c, the current device only support AES_CBC algorithm,
> so we just need set:
>  backend->conf.cipher_algo_l = 1u << VIRTIO_CRYPTO_CIPHER_AES_CBC;
>  backend->conf.hash_algo = 1u << VIRTIO_CRYPTO_HASH_SHA1;
> 
> Then the driver can only register AES CBC algorithm to the LKCF. Other
> algorithms are not supported no matter the driver if register them or not.
> 
> Thanks,
> -Gonglei
> 

Now I'm confused too. So let's try to clear things up with two simple
question:

1) Is a device allowed to so set not defined bits ( garbage values or
even worse an implementation specific usage) way (e.g. bit 13 for
hash_algo)?

2) Is a driver allowed to rejects unknown algorithm bits (e.g. give up on
the device because it considers it broken)?

If the answer is 'no' please point me to the appropriate conformance
statements.

Question 1) is about why should we reserve the remaining
bits for future use.

Question 2) is about the interaction with feature bits -- if the answer
is 'yes' then we have to guard new algorithms with feature bits.

Halil

  reply	other threads:[~2017-05-05 14:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-22  6:23 [Qemu-devel] [PATCH v18 0/2] virtio-crypto: virtio crypto device specification Gonglei
2017-04-22  6:23 ` [Qemu-devel] [PATCH v18 1/2] virtio-crypto: Add " Gonglei
2017-05-03 17:11   ` Halil Pasic
2017-05-04 13:33     ` Gonglei (Arei)
2017-05-04 13:55       ` Halil Pasic
2017-05-04 14:13         ` Gonglei (Arei)
2017-05-04 16:10           ` Halil Pasic
2017-05-05  3:39             ` Gonglei (Arei)
2017-05-05 13:52               ` [Qemu-devel] [virtio-dev] " Halil Pasic
2017-05-06  1:30                 ` Gonglei (Arei)
2017-05-04 17:32       ` Halil Pasic
2017-05-04 13:53     ` [Qemu-devel] " Gonglei (Arei)
2017-05-04 16:19       ` [Qemu-devel] [virtio-dev] " Halil Pasic
2017-05-05  5:56         ` Gonglei (Arei)
2017-05-05 14:32           ` Halil Pasic [this message]
2017-05-06  1:50             ` Gonglei (Arei)
2017-05-10 18:02   ` [Qemu-devel] " Halil Pasic
2017-05-15 17:02     ` [Qemu-devel] [virtio-dev] " Halil Pasic
2017-05-16  3:48     ` [Qemu-devel] " Gonglei (Arei)
2017-05-16 11:00       ` Halil Pasic
2017-05-16 15:33   ` [Qemu-devel] [virtio-dev] " Stefan Hajnoczi
2017-05-16 22:40     ` Halil Pasic
2017-05-17  9:18     ` Gonglei (Arei)
2017-04-22  6:23 ` [Qemu-devel] [PATCH v18 2/2] virtio-crypto: Add conformance clauses Gonglei
2017-05-02 21:55 ` [Qemu-devel] [virtio-dev] [PATCH v18 0/2] virtio-crypto: virtio crypto device specification Halil Pasic
2017-05-03  6:29   ` 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=deb3c5f2-e4d5-1479-8a3c-2c52a1f263a9@linux.vnet.ibm.com \
    --to=pasic@linux.vnet.ibm.com \
    --cc=Jani.Kokkonen@huawei.com \
    --cc=Ola.Liljedahl@arm.com \
    --cc=Varun.Sethi@freescale.com \
    --cc=agraf@suse.de \
    --cc=amy.zhanghuimin@huawei.com \
    --cc=arei.gonglei@hotmail.com \
    --cc=arei.gonglei@huawei.com \
    --cc=brian.a.keating@intel.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=denglingli@chinamobile.com \
    --cc=eety.chen@huawei.com \
    --cc=jasowang@redhat.com \
    --cc=john.griffin@intel.com \
    --cc=liang.j.ma@intel.com \
    --cc=linqiangmin@huawei.com \
    --cc=lixiao91@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=mike.caraman@nxp.com \
    --cc=mst@redhat.com \
    --cc=nmorey@kalray.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vincent.jardin@6wind.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=weidong.huang@huawei.com \
    --cc=wu.wubin@huawei.com \
    --cc=xin.zeng@intel.com \
    --cc=zhbzg@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 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.