qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Farhan Ali <alifm@linux.ibm.com>
Cc: qemu-devel@nongnu.org, frankja@linux.ibm.com, mst@redhat.com,
	pasic@linux.ibm.com, borntraeger@de.ibm.com,
	arei.gonglei@huawei.com, longpeng2@huawei.com,
	Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>,
	mjrosato@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [RFC v1 1/1] virtio-crypto: Allow disabling of cipher algorithms for virtio-crypto device
Date: Wed, 13 Jun 2018 16:05:12 +0100	[thread overview]
Message-ID: <20180613150512.GA19901@redhat.com> (raw)
In-Reply-To: <7b51465a-b7c1-58ec-1ef6-9fe791e96bbf@linux.ibm.com>

On Wed, Jun 13, 2018 at 11:01:05AM -0400, Farhan Ali wrote:
> Hi Daniel
> 
> On 06/13/2018 05:37 AM, Daniel P. Berrangé wrote:
> > On Tue, Jun 12, 2018 at 03:48:34PM -0400, Farhan Ali wrote:
> > > The virtio-crypto driver currently propagates to the guest
> > > all the cipher algorithms that the backend cryptodev can
> > > support. But in certain cases where the guest has more
> > > performant mechanism to handle some algorithms, it would be
> > > useful to propagate only a subset of the algorithms.
> > 
> > I'm not really convinced by this.
> > 
> > The performance of crypto algorithms has many influencing
> > factors, making it pretty hard to decide which is best
> > without actively testing specific impls and comparing
> > them in a manner which matches the application usage
> > pattern. eg in theory the kernel crypto impl of an alg
> > is faster than a userspace impl, if the kernel uses
> > hardware accel and userspace does not. This, however,
> > ignores the overhead of the kernel/userspace switch.
> > The real world performance winner, thus depends on the
> > amount of data being processed in each operation. Some
> > times userspace can win & sometimes kernel space can
> > win. This is even more relevant to virtio-crypto as
> > it has more expensive context switches.
> 
> True. But what if the guest can perform some crypto algorithms without a
> incurring a VM exit? For example in s390 we have the cpacf instructions to
> perform crypto and this instruction is implemented for us by our hardware
> virtualization technology. In such a case it would be better not to use
> virtio-crypto's implementation of such a crypto algorithm.
> 
> At the same time we would like to take advantage of virtio-crypto's
> acceleration capabilities for certain crypto algorithms for which there is
> no hardware assistance.

IIUC, the kernel's crypto layer can support multiple implementations of
any algorithm. Providers can report a priority against implementations
which influences which impl is used in practice. So if there's a native
instruction for a partiuclar algorithm I would expect the impl registered
for that to be designated higher priority than other impls, so that it is
used in preference to other impls.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2018-06-13 15:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1528832686.git.alifm@linux.ibm.com>
2018-06-12 19:48 ` [Qemu-devel] [RFC v1 1/1] virtio-crypto: Allow disabling of cipher algorithms for virtio-crypto device Farhan Ali
2018-06-13  0:57   ` Gonglei (Arei)
2018-06-13 20:14     ` Farhan Ali
2018-06-13  9:37   ` Daniel P. Berrangé
2018-06-13 15:01     ` Farhan Ali
2018-06-13 15:05       ` Daniel P. Berrangé [this message]
2018-06-13 17:28         ` Halil Pasic
2018-06-14  8:21           ` Daniel P. Berrangé
2018-06-14 14:50             ` Farhan Ali
2018-06-14 15:10               ` Daniel P. Berrangé
2018-06-14 16:12                 ` Farhan Ali
2018-06-14 16:15                   ` Daniel P. Berrangé
2018-06-15 13:17                   ` Viktor VM Mihajlovski
2018-06-15 15:10                     ` Farhan Ali
2018-06-18 10:27                       ` Viktor VM Mihajlovski
2018-06-15  0:52                 ` Gonglei (Arei)
2018-06-15  9:26                   ` Daniel P. Berrangé
2018-06-15 13:07         ` Christian Borntraeger

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=20180613150512.GA19901@redhat.com \
    --to=berrange@redhat.com \
    --cc=alifm@linux.ibm.com \
    --cc=arei.gonglei@huawei.com \
    --cc=borntraeger@de.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=longpeng2@huawei.com \
    --cc=mihajlov@linux.vnet.ibm.com \
    --cc=mjrosato@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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).