Re: [Qemu-devel] Question about add AF_ALG backend for virtio-crypto

2017-02-08 Thread Longpeng (Mike)
Hi Daniel, On 2017/2/8 18:53, Daniel P. Berrange wrote: > On Wed, Feb 08, 2017 at 06:46:04PM +0800, Longpeng (Mike) wrote: >> Hi Daniel, >> >> I was writing AF_ALG-backed for QEMU crypto these days, I think there're more >> than two ways to implements it. >>

Re: [Qemu-devel] Question about add AF_ALG backend for virtio-crypto

2017-02-08 Thread Longpeng (Mike)
way you'd prefer, or do you have any better suggestion? Thanks! -- Regards, Longpeng(Mike) On 2017/1/10 21:30, Daniel P. Berrange wrote: > On Tue, Jan 10, 2017 at 12:17:48PM +, Gonglei (Arei) wrote: >>> >>>>> >>>>>> >>>>>>>

Re: [Qemu-devel] Question about add AF_ALG backend for virtio-crypto

2017-02-09 Thread Longpeng (Mike)
Hi Daniel, On 2017/2/9 18:11, Daniel P. Berrange wrote: > On Thu, Feb 09, 2017 at 10:58:55AM +0800, Longpeng (Mike) wrote: >> Hi Daniel, >> >> So...you prefer approach 1 with a driver-table dispatch layer, right? >> And this implies that we must either rename some

[Qemu-devel] [PATCH v2] qtest: virtio: zeroed last vring_desc after allocate

2017-01-16 Thread Longpeng(Mike)
As qvring_indirect_desc_setup() wouldn't initialize last vring_desc, so it's filled with dirty data, this might cause virtio backend broken. For example, the last bit of this vring_desc's flags might be 1, so virtqueue_read_next_desc() would report "Desc next is ***". Signed-off-by

Re: [Qemu-devel] [PATCH] qtest: virtio: zeroed last VRingDesc after allocate

2017-01-16 Thread Longpeng (Mike)
Hi Stefan, On 2017/1/16 22:13, Stefan Hajnoczi wrote: > On Sat, Jan 14, 2017 at 05:59:36PM +0800, Longpeng(Mike) wrote: .. >> diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c >> index ec30cb9..b29c69e 100644 >> --- a/tests/libqos/virtio.c >>

Re: [Qemu-devel] [PATCH v3] target-i386: present virtual L3 cache info for vcpus

2016-09-05 Thread Longpeng (Mike)
Hi Eduardo, On 2016/9/6 2:53, Eduardo Habkost wrote: > On Fri, Sep 02, 2016 at 10:22:55AM +0800, Longpeng(Mike) wrote: > [...] >> --- >> Changes since v2: >> - add more useful commit mesage. >> - rename "compat-cache" to "l3-cache-shared

[Qemu-devel] [PATCH v4 1/2] pc: Add 2.8 machine

2016-09-05 Thread Longpeng(Mike)
Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- hw/i386/pc_piix.c| 17 ++--- hw/i386/pc_q35.c | 16 +--- include/hw/compat.h | 2 ++ include/hw/i386/pc.h | 3 +++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc_piix.

[Qemu-devel] [PATCH v4 2/2] target-i386: present virtual L3 cache info for vcpus

2016-09-05 Thread Longpeng(Mike)
.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- include/hw/i386/pc.h | 9 + target-i386/cpu.c| 49 - target-i386/cpu.h| 6 ++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/include/h

[Qemu-devel] [PATCH v4 0/2] targte-i386: Add virtual L3 cache support

2016-09-05 Thread Longpeng(Mike)
_COMPAT_2_7. - fix a "intentionally introducde bug": make intel's and amd's consistently. - fix the CPUID.(EAX=4, ECX=3):EAX[25:14]. - test the performance if vcpus running on sparate sockets: with L3 cache, the performance improves 7.2%~33.1%(avg: 15.7%). --- Longpeng(Mike) (2): pc:

[Qemu-devel] [PATCH RESEND v4 1/2] pc: Add 2.8 machine

2016-09-05 Thread Longpeng(Mike)
Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- hw/i386/pc_piix.c| 16 +--- hw/i386/pc_q35.c | 13 +++-- include/hw/compat.h | 2 ++ include/hw/i386/pc.h | 3 +++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/h

[Qemu-devel] [PATCH RESEND v4 2/2] target-i386: present virtual L3 cache info for vcpus

2016-09-05 Thread Longpeng(Mike)
.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- include/hw/i386/pc.h | 9 + target-i386/cpu.c| 49 - target-i386/cpu.h| 6 ++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/include/h

[Qemu-devel] [PATCH RESEND v4 0/2] targte-i386: Add virtual L3 cache support

2016-09-05 Thread Longpeng(Mike)
_COMPAT_2_7. - fix a "intentionally introducde bug": make intel's and amd's consistently. - fix the CPUID.(EAX=4, ECX=3):EAX[25:14]. - test the performance if vcpus running on sparate sockets: with L3 cache, the performance improves 7.2%~33.1%(avg: 15.7%). --- Longpeng(Mike) (2): pc:

[Qemu-devel] [PATCH RESEND v3] target-i386: present virtual L3 cache info for vcpus

2016-09-01 Thread Longpeng(Mike)
.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- Changes since v2: - add more useful commit mesage. - rename "compat-cache" to "l3-cache-shared". Changes since v1: - fix the compat problem: set compat_props on PC_COMPAT_2_7. - fix a

Re: [Qemu-devel] [PATCH v2] target-i386: present virtual L3 cache info for vcpus

2016-09-01 Thread Longpeng (Mike)
Hi Michael, On 2016/9/1 21:27, Michael S. Tsirkin wrote: > On Thu, Sep 01, 2016 at 02:58:05PM +0800, l00371263 wrote: >> From: "Longpeng(Mike)" <longpe...@huawei.com> >> >> Some software algorithms are based on the hardware's cache info, for example, &g

[Qemu-devel] [PATCH v3] target-i386: present virtual L3 cache info for vcpus

2016-09-01 Thread Longpeng(Mike)
From: "Longpeng(Mike)" <longp...@huawei2.com> Some software algorithms are based on the hardware's cache info, for example, for x86 linux kernel, when cpu1 want to wakeup a task on cpu2, cpu1 will trigger a resched IPI and told cpu2 to do the wakeup if they don't share low level c

Re: [Qemu-devel] [PATCH v3] target-i386: present virtual L3 cache info for vcpus

2016-09-04 Thread Longpeng (Mike)
Hi Michael, On 2016/9/3 6:52, Michael S. Tsirkin wrote: > On Fri, Sep 02, 2016 at 10:22:55AM +0800, Longpeng(Mike) wrote: >> From: "Longpeng(Mike)" <longp...@huawei2.com> >> >> Some software algorithms are based on the hardware's cache info, for example, &g

Re: [Qemu-devel] [RFC] target-i386: present virtual L3 cache info for vcpus

2016-08-30 Thread Longpeng (Mike)
Hi Eduardo, On 2016/8/30 22:25, Eduardo Habkost wrote: > On Mon, Aug 29, 2016 at 09:17:02AM +0800, Longpeng (Mike) wrote: >> This patch presents virtual L3 cache info for virtual cpus. > > Just changing the L3 cache size in the CPUID code will make > guests see a different ca

Re: [Qemu-devel] [PATCH 0/2] pc: fixes broken compat logic

2016-09-17 Thread Longpeng (Mike)
> target-i386: turn off CPU.l3-cache only for 2.7 and older machine > types > > include/hw/i386/pc.h | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > You're right, thank you for correcting my mistakes :) -- Regards, Longpeng(Mike)

[Qemu-devel] [PATCH v5 1/2] pc: Add 2.8 machine

2016-09-06 Thread Longpeng(Mike)
This will used by the next patch. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- hw/i386/pc_piix.c| 16 +--- hw/i386/pc_q35.c | 13 +++-- include/hw/i386/pc.h | 3 +++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.

[Qemu-devel] [PATCH v5 2/2] target-i386: present virtual L3 cache info for vcpus

2016-09-06 Thread Longpeng(Mike)
.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- include/hw/i386/pc.h | 9 + target-i386/cpu.c| 49 - target-i386/cpu.h| 6 ++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/include/h

[Qemu-devel] [PATCH v5 0/2] targte-i386: Add virtual L3 cache support

2016-09-06 Thread Longpeng(Mike)
parate sockets: with L3 cache, the performance improves 7.2%~33.1%(avg: 15.7%). Longpeng(Mike) (2): pc: Add 2.8 machine target-i386: present virtual L3 cache info for vcpus hw/i386/pc_piix.c| 16 +--- hw/i386/pc_q35.c | 13 +++-- include/hw/i386

[Qemu-devel] [RFC] target-i386: present virtual L3 cache info for vcpus

2016-08-28 Thread Longpeng (Mike)
topology is "1*socket 8*cores 2*threads". After present virtual L3 cache info for VM, the amounts of RES IPI in guest reduce 85%. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- target-i386/cpu.c | 34 +++--- 1 file changed, 27 insertions(+), 7

Re: [Qemu-devel] [PATCH for-2.9 v2] crypto: add 3des-ede support when using libgcrypt/nettle

2016-12-08 Thread Longpeng (Mike)
On 2016/12/8 17:33, Daniel P. Berrange wrote: > On Thu, Dec 08, 2016 at 10:33:28AM +0800, Longpeng(Mike) wrote: >> Libgcrypt and nettle support 3des-ede, so this patch add 3des-ede >> support when using libgcrypt or nettle. >> >> Signed-off-by: Longpeng(

[Qemu-devel] [PATCH for-2.9 v1 0/7] crypto: add HMAC algorithms support

2016-12-11 Thread Longpeng(Mike)
Since QEMU has been supported cryptodev, so it is necessary to support more crypto algorithms(i.e. hmac,aead) in QEMU backend. This patchset add HMAC algorithms support. Longpeng(Mike) (7): qapi: crypto: add defination about HMAC algorithms crypto: add HMAC algorithms framework configure

[Qemu-devel] [PATCH for-2.9 v1 7/7] crypto: add HMAC algorithms testcases

2016-12-11 Thread Longpeng(Mike)
This patch add HMAC algorithms testcases Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/Makefile.include | 2 + tests/test-crypto-hmac.c | 162 +++ 2 files changed, 164 insertions(+) create mode 100644 tests/test-crypto-

[Qemu-devel] [PATCH for-2.9 v1 3/7] configure: add CONFIG_GCRYPT_SUPPORT_HMAC item

2016-12-11 Thread Longpeng(Mike)
This item will be used for support libcrypt-backed HMAC algorithms. Support for hmac has been added in Libgcrypt 1.6.0, but we cannot use pkg-config to get libcrypt's version. However we can make a in configure to know whether current libcrypt support hmac. Signed-off-by: Longpeng(Mike) <lon

[Qemu-devel] [PATCH for-2.9 v2 5/7] crypto: support HMAC algorithms based on glibc

2016-12-12 Thread Longpeng(Mike)
This patch add glibc-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-glib.c | 119 + 1 file changed, 119 insertions(+) diff --git a/crypto/hmac-glib.c b/crypto/hmac-glib.c index 4

[Qemu-devel] [PATCH for-2.9 v2 1/7] qapi: crypto: add defination about HMAC algorithms

2016-12-12 Thread Longpeng(Mike)
This patch introduce HMAC algorithms relevant defination, they will be used by the following patch. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- qapi/crypto.json | 17 + 1 file changed, 17 insertions(+) diff --git a/qapi/crypto.json b/qapi/crypto.json index f

[Qemu-devel] [PATCH for-2.9 v2 6/7] crypto: support HMAC algorithms based on nettle

2016-12-12 Thread Longpeng(Mike)
This patch add nettle-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-nettle.c | 118 +-- 1 file changed, 115 insertions(+), 3 deletions(-) diff --git a/crypto/hmac-nettle.c b/crypt

[Qemu-devel] [PATCH for-2.9 v2 0/7] crypto: add HMAC algorithms support

2016-12-12 Thread Longpeng(Mike)
Since QEMU has been supported cryptodev, so it is necessary to support more crypto algorithms(i.e. hmac,aead) in QEMU backend. This patchset add HMAC algorithms support. --- Changes since v1: - check whether algorithm is supported in testcase [build test] --- Longpeng(Mike) (7): qapi

[Qemu-devel] [PATCH for-2.9 v2 4/7] crypto: support HMAC algorithms based on libgcrypt

2016-12-12 Thread Longpeng(Mike)
This patch add HMAC algorithms based on libgcrypt support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-gcrypt.c | 138 +++ 1 file changed, 138 insertions(+) diff --git a/crypto/hmac-gcrypt.c b/crypto/hmac-gcrypt.c

[Qemu-devel] [PATCH for-2.9 v2 2/7] crypto: add HMAC algorithms framework

2016-12-12 Thread Longpeng(Mike)
This patch introduce HMAC algorithms framework. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/Makefile.objs | 4 ++ crypto/hmac-gcrypt.c | 44 ++ crypto/hmac-glib.c | 44 ++ crypto/hmac-nettle.c | 44 ++ crypto/hmac.c

[Qemu-devel] [PATCH for-2.9 v1 5/7] crypto: support HMAC algorithms based on glibc

2016-12-11 Thread Longpeng(Mike)
This patch add glibc-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-glib.c | 119 + 1 file changed, 119 insertions(+) diff --git a/crypto/hmac-glib.c b/crypto/hmac-glib.c index 4

[Qemu-devel] [PATCH for-2.9 v2 7/7] crypto: add HMAC algorithms testcases

2016-12-12 Thread Longpeng(Mike)
This patch add HMAC algorithms testcases Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/Makefile.include | 2 + tests/test-crypto-hmac.c | 166 +++ 2 files changed, 168 insertions(+) create mode 100644 tests/test-crypto-

[Qemu-devel] [PATCH for-2.9 v1 1/7] qapi: crypto: add defination about HMAC algorithms

2016-12-11 Thread Longpeng(Mike)
This patch introduce HMAC algorithms relevant defination, they will be used by the following patch. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- qapi/crypto.json | 17 + 1 file changed, 17 insertions(+) diff --git a/qapi/crypto.json b/qapi/crypto.json index f

[Qemu-devel] [PATCH for-2.9 v1 2/7] crypto: add HMAC algorithms framework

2016-12-11 Thread Longpeng(Mike)
This patch introduce HMAC algorithms framework. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/Makefile.objs | 4 ++ crypto/hmac-gcrypt.c | 44 ++ crypto/hmac-glib.c | 44 ++ crypto/hmac-nettle.c | 44 ++ crypto/hmac.c

[Qemu-devel] [PATCH for-2.9 v1 4/7] crypto: support HMAC algorithms based on libgcrypt

2016-12-11 Thread Longpeng(Mike)
This patch add HMAC algorithms based on libgcrypt support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-gcrypt.c | 138 +++ 1 file changed, 138 insertions(+) diff --git a/crypto/hmac-gcrypt.c b/crypto/hmac-gcrypt.c

[Qemu-devel] [PATCH for-2.9 v1 6/7] crypto: support HMAC algorithms based on nettle

2016-12-11 Thread Longpeng(Mike)
This patch add nettle-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-nettle.c | 118 +-- 1 file changed, 115 insertions(+), 3 deletions(-) diff --git a/crypto/hmac-nettle.c b/crypt

[Qemu-devel] [PATCH for-2.9 v2 3/7] configure: add CONFIG_GCRYPT_SUPPORT_HMAC item

2016-12-12 Thread Longpeng(Mike)
This item will be used for support libcrypt-backed HMAC algorithms. Support for hmac has been added in Libgcrypt 1.6.0, but we cannot use pkg-config to get libcrypt's version. However we can make a in configure to know whether current libcrypt support hmac. Signed-off-by: Longpeng(Mike) <lon

[Qemu-devel] [PATCH for-2.9 v3 4/6] crypto: support HMAC algorithms based on glibc

2016-12-12 Thread Longpeng(Mike)
This patch add glibc-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-glib.c | 99 -- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/crypto/hmac-glib.c b/crypto/hmac-

[Qemu-devel] [PATCH for-2.9 v3 2/6] crypto: add HMAC algorithms framework

2016-12-12 Thread Longpeng(Mike)
This patch introduce HMAC algorithms framework. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/Makefile.objs | 4 ++ crypto/hmac-gcrypt.c | 45 ++ crypto/hmac-glib.c | 44 ++ crypto/hmac-nettle.c | 45 ++ crypto/hmac.c

[Qemu-devel] [PATCH for-2.9 v3 5/6] crypto: support HMAC algorithms based on nettle

2016-12-12 Thread Longpeng(Mike)
This patch add nettle-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-nettle.c | 136 +-- 1 file changed, 133 insertions(+), 3 deletions(-) diff --git a/crypto/hmac-nettle.c b/crypt

[Qemu-devel] [PATCH for-2.9 v3 0/6] crypto: add HMAC algorithms support

2016-12-12 Thread Longpeng(Mike)
n testcase [build test] --- Longpeng(Mike) (6): configure: add CONFIG_GCRYPT_HMAC item crypto: add HMAC algorithms framework crypto: support HMAC algorithms based on libgcrypt crypto: support HMAC algorithms based on glibc crypto: support HMAC algorithms based on nettle crypto: add HMAC

Re: [Qemu-devel] [PATCH for-2.9 v2 7/7] crypto: add HMAC algorithms testcases

2016-12-12 Thread Longpeng (Mike)
Hi Daniel, Thanks for your review, and I fix them as your suggestion in V3, please review V3 when you're free. :) Regards, On 2016/12/12 18:31, Daniel P. Berrange wrote: > On Mon, Dec 12, 2016 at 04:08:12PM +0800, Longpeng(Mike) wrote: >> This patch add HMAC algorithms testcases >

[Qemu-devel] [PATCH for-2.9 v3 3/6] crypto: support HMAC algorithms based on libgcrypt

2016-12-12 Thread Longpeng(Mike)
This patch add HMAC algorithms based on libgcrypt support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-gcrypt.c | 111 ++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/crypto/hmac-gcrypt.c b/crypt

[Qemu-devel] [PATCH for-2.9 v3 1/6] configure: add CONFIG_GCRYPT_HMAC item

2016-12-12 Thread Longpeng(Mike)
This item will be used for support libcrypt-backed HMAC algorithms. Support for hmac has been added in Libgcrypt 1.6.0, but we cannot use pkg-config to get libcrypt's version. However we can make a in configure to know whether current libcrypt support hmac. Signed-off-by: Longpeng(Mike) <lon

[Qemu-devel] [PATCH for-2.9 v3 6/6] crypto: add HMAC algorithms testcases

2016-12-12 Thread Longpeng(Mike)
This patch add HMAC algorithms testcases Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/Makefile.include | 2 + tests/test-crypto-hmac.c | 266 +++ 2 files changed, 268 insertions(+) create mode 100644 tests/test-crypto-

Re: [Qemu-devel] [PATCH for-2.9 v3 0/6] crypto: add HMAC algorithms support

2016-12-12 Thread Longpeng (Mike)
implicit declaration of > function ‘g_hmac_new’ > /tmp/qemu-test/src/crypto/hmac-glib.c:74: warning: nested extern declaration > of ‘g_hmac_new’ > /tmp/qemu-test/src/crypto/hmac-glib.c:76: error: ‘QCryptoHmacGlib’ has no > member named ‘ghmac’ > /tmp/qemu-test/src/crypto/hmac-glib.c: In function ‘qcrypto_hmac_free’: > /tmp/qemu-test/src/crypto/hmac-glib.c:99: warning: implicit declaration of > function ‘g_hmac_unref’ > /tmp/qemu-test/src/crypto/hmac-glib.c:99: warning: nested extern declaration > of ‘g_hmac_unref’ > /tmp/qemu-test/src/crypto/hmac-glib.c:99: error: ‘QCryptoHmacGlib’ has no > member named ‘ghmac’ > /tmp/qemu-test/src/crypto/hmac-glib.c: In function ‘qcrypto_hmac_bytesv’: > /tmp/qemu-test/src/crypto/hmac-glib.c:118: warning: implicit declaration of > function ‘g_hmac_update’ > /tmp/qemu-test/src/crypto/hmac-glib.c:118: warning: nested extern declaration > of ‘g_hmac_update’ > /tmp/qemu-test/src/crypto/hmac-glib.c:118: error: ‘QCryptoHmacGlib’ has no > member named ‘ghmac’ > /tmp/qemu-test/src/crypto/hmac-glib.c:136: warning: implicit declaration of > function ‘g_hmac_get_digest’ > /tmp/qemu-test/src/crypto/hmac-glib.c:136: warning: nested extern declaration > of ‘g_hmac_get_digest’ > /tmp/qemu-test/src/crypto/hmac-glib.c:136: error: ‘QCryptoHmacGlib’ has no > member named ‘ghmac’ > make: *** [crypto/hmac-glib.o] Error 1 > make: *** Waiting for unfinished jobs > CC hw/bt/hci-csr.o > make[1]: *** [docker-run] Error 2 > make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-9oq6lvoc/src' > make: *** [docker-run-test-quick@centos6] Error 2 > === OUTPUT END === > > Test command exited with code: 2 > > > --- > Email generated automatically by Patchew [http://patchew.org/]. > Please send your feedback to patchew-de...@freelists.org -- Regards, Longpeng(Mike)

[Qemu-devel] [PATCH for-2.9 v4 5/6] crypto: support HMAC algorithms based on nettle

2016-12-13 Thread Longpeng(Mike)
This patch add nettle-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-nettle.c | 136 +-- 1 file changed, 133 insertions(+), 3 deletions(-) diff --git a/crypto/hmac-nettle.c b/crypt

[Qemu-devel] [PATCH for-2.9 v4 0/6] crypto: add HMAC algorithms support

2016-12-13 Thread Longpeng(Mike)
t. [Daniel] - rewrite testcase based on test-crypto-hash. [Daniel] Changes since v1: - check whether algorithm is supported in testcase [build test] --- Longpeng(Mike) (6): configure: add CONFIG_GCRYPT_HMAC item crypto: add HMAC algorithms framework crypto: support HMAC algorithms based on

[Qemu-devel] [PATCH for-2.9 v4 6/6] crypto: add HMAC algorithms testcases

2016-12-13 Thread Longpeng(Mike)
This patch add HMAC algorithms testcases Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/Makefile.include | 2 + tests/test-crypto-hmac.c | 266 +++ 2 files changed, 268 insertions(+) create mode 100644 tests/test-crypto-

[Qemu-devel] [PATCH for-2.9 v4 4/6] crypto: support HMAC algorithms based on glib

2016-12-13 Thread Longpeng(Mike)
This patch add glib-backed HMAC algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-glib.c | 122 + 1 file changed, 122 insertions(+) diff --git a/crypto/hmac-glib.c b/crypto/hmac-glib.c index 3

[Qemu-devel] [PATCH for-2.9 v4 2/6] crypto: add HMAC algorithms framework

2016-12-13 Thread Longpeng(Mike)
This patch introduce HMAC algorithms framework. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/Makefile.objs | 4 ++ crypto/hmac-gcrypt.c | 45 ++ crypto/hmac-glib.c | 44 ++ crypto/hmac-nettle.c | 45 ++ crypto/hmac.c

Re: [Qemu-devel] [PATCH for-2.9 v3 0/6] crypto: add HMAC algorithms support

2016-12-13 Thread Longpeng (Mike)
Hi Daniel, On 2016/12/13 17:35, Daniel P. Berrange wrote: > On Tue, Dec 13, 2016 at 03:01:47PM +0800, Longpeng(Mike) wrote: >> Since QEMU has been supported cryptodev, so it is necessary to support >> more crypto algorithms(i.e. hmac,aead) in QEMU backend. >> >> This p

[Qemu-devel] [PATCH for-2.9 v4 1/6] configure: add CONFIG_GCRYPT_HMAC item

2016-12-13 Thread Longpeng(Mike)
This item will be used for support libcrypt-backed HMAC algorithms. Support for hmac has been added in Libgcrypt 1.6.0, but we cannot use pkg-config to get libcrypt's version. However we can make a in configure to know whether current libcrypt support hmac. Signed-off-by: Longpeng(Mike) <lon

[Qemu-devel] [PATCH for-2.9 v4 3/6] crypto: support HMAC algorithms based on libgcrypt

2016-12-13 Thread Longpeng(Mike)
This patch add HMAC algorithms based on libgcrypt support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/hmac-gcrypt.c | 111 ++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/crypto/hmac-gcrypt.c b/crypt

[Qemu-devel] [PATCH for-2.9] cryptodev: remove single-DES support in cryptodev

2016-12-06 Thread Longpeng(Mike)
Single-DES is obsolete and it's broken/useless for decades, we should remove it in cryptodev, as suggested by Daniel. Guest who wants to use this obsolete cipher alg will use its built-in implementation instead. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- backends/cry

Re: [Qemu-devel] [PATCH for-2.9 1/3] crypto: add standard des support

2016-12-06 Thread Longpeng (Mike)
Hi Eric, On 2016/12/6 3:15, Eric Blake wrote: > On 12/05/2016 02:59 AM, Longpeng(Mike) wrote: >> This patch add standart DES support. > > s/standart/standard/ > >> >> Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> >> --- > >> +++

[Qemu-devel] [PATCH for-2.9 2/2] cryptodev: add 3des-ede support

2016-12-07 Thread Longpeng(Mike)
This patch add 3des-ede support for cryptodev. However this is effective only when backend using libgcrypt/nettle, because cipher-builtin doesn't support 3des-ede yet. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- backends/cryptodev-builtin.c | 12 1 file chang

[Qemu-devel] [PATCH for-2.9 1/2] crypto: add 3des-ede support when using libgcrypt/nettle

2016-12-07 Thread Longpeng(Mike)
Libgcrypt and nettle support 3des-ede, so this patch add 3des-ede support when using libgcrypt or nettle. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/cipher-gcrypt.c | 6 ++ crypto/cipher-nettle.c | 37 + crypto/ci

Re: [Qemu-devel] [PATCH for-2.9 1/2] crypto: add 3des-ede support when using libgcrypt/nettle

2016-12-07 Thread Longpeng (Mike)
On 2016/12/7 17:19, Longpeng (Mike) wrote: > > > On 2016/12/7 16:52, Gonglei (Arei) wrote: > >>> -Original Message- >>> From: longpeng >>> Sent: Wednesday, December 07, 2016 4:34 PM >>> To: berra...@redhat.com; ebl...@redhat.com; ar

[Qemu-devel] [PATCH for-2.9 0/2] crypto: add 3des-ede support

2016-12-07 Thread Longpeng(Mike)
This patchset add 3DES-EDE support when using gcrypt/nettle. Due to the virtio-crypto has been supportted, the guest can use various cipher-algo including 3DES-EDE. Longpeng(Mike) (2): crypto: add 3des-ede support when using libgcrypt/nettle cryptodev: add 3des-ede support backends

Re: [Qemu-devel] [PATCH for-2.9 1/2] crypto: add 3des-ede support when using libgcrypt/nettle

2016-12-07 Thread Longpeng (Mike)
(H); Zhoujian (jay, Euler); longpeng >> Subject: [PATCH for-2.9 1/2] crypto: add 3des-ede support when using >> libgcrypt/nettle >> >> Libgcrypt and nettle support 3des-ede, so this patch add 3des-ede >> support when using libgcrypt or nettle. >> >> Si

Re: [Qemu-devel] [PATCH for-2.9 1/2] crypto: add 3des-ede support when using libgcrypt/nettle

2016-12-07 Thread Longpeng (Mike)
Hi Daniel, On 2016/12/7 17:37, Daniel P. Berrange wrote: > On Wed, Dec 07, 2016 at 04:33:41PM +0800, Longpeng(Mike) wrote: .. >> diff --git a/qapi/crypto.json b/qapi/crypto.json >> index 5c9d7d4..848b6cd 100644 >> --- a/qapi/crypto.json >> +++ b/qapi/cr

[Qemu-devel] [PATCH for-2.9 v2] crypto: add 3des-ede support when using libgcrypt/nettle

2016-12-07 Thread Longpeng(Mike)
Libgcrypt and nettle support 3des-ede, so this patch add 3des-ede support when using libgcrypt or nettle. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- Changes since v1: - rename 3des-ede to 3des. [Daniel] - add (since 2.9) in comment. [Gonglei] - add ctr(3des) te

[Qemu-devel] [PATCH for-2.9] cryptodev: add 3des-ede support

2016-12-07 Thread Longpeng(Mike)
This patch add 3des-ede support for cryptodev. However this is effective only when backend using libgcrypt/nettle, because cipher-builtin doesn't support 3des-ede yet. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- Changes since v1: - split the original pathset. [G

[Qemu-devel] [PATCH] qtest: virtio: zeroed last VRingDesc after allocate

2017-01-14 Thread Longpeng(Mike)
d the last VRingDesc in qvring_indirect_desc_setup(). Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/libqos/virtio.c | 8 1 file changed, 8 insertions(+) diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c index ec30cb9..b29c69e 100644 --- a/tests/libqos/virt

[Qemu-devel] [PATCH] cryptodev: setiv only when really need

2017-01-13 Thread Longpeng(Mike)
ECB mode cipher doesn't need IV, if we setiv for it then qemu crypto API would report "Expected IV size 0 not **", so we should setiv only when the cipher algos really need. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- backends/cryptodev-builtin.c | 10 ++ 1

Re: [Qemu-devel] [PATCH for-2.9 1/3] crypto: add standard des support

2016-12-05 Thread Longpeng (Mike)
Hi Daniel, On 2016/12/5 17:18, Daniel P. Berrange wrote: > On Mon, Dec 05, 2016 at 04:59:38PM +0800, Longpeng(Mike) wrote: .. >> diff --git a/qapi/crypto.json b/qapi/crypto.json >> index 5c9d7d4..d403ab9 100644 >> --- a/qapi/crypto.json >> +++ b/qapi/cr

[Qemu-devel] [PATCH for-2.9 v2 2/2] cryptodev: add xts(aes) support

2016-12-05 Thread Longpeng(Mike)
This patch add xts(aes) support. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> Reviewed-by: Gonglei <arei.gong...@huawei.com> --- backends/cryptodev-builtin.c | 8 1 file changed, 8 insertions(+) diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-bui

[Qemu-devel] [PATCH for-2.9 v2 1/2] cryptodev: fix the check of aes algorithm

2016-12-05 Thread Longpeng(Mike)
As the key length of xts(aes) is different with other mode of aes, so we should check specially in cryptodev_builtin_get_aes_algo, if it is xts mode. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- backends/cryptodev-builtin.c | 47 +++-

[Qemu-devel] [PATCH for-2.9 v2 0/2] cryptodev: support xts(aes) algorithm

2016-12-05 Thread Longpeng(Mike)
This patchset firstly fix a bug in cryptodev_builtin_get_aes_algo, and then add xts(aes) algorithm support. --- Changes since v1: - change macro's defination. [Arei] --- Longpeng(Mike) (2): cryptodev: fix the check of aes algorithm cryptodev: add xts(aes) support backends/cryptodev

[Qemu-devel] [PATCH for-2.9 2/3] cryptodev: switch to standard des

2016-12-05 Thread Longpeng(Mike)
The cryptodev use DES-RFB for ecb(des) currently, we should use standard DES for cryptodev instead. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- backends/cryptodev-builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/cryptodev-builtin.c b/ba

[Qemu-devel] [PATCH for-2.9 1/3] crypto: add standard des support

2016-12-05 Thread Longpeng(Mike)
This patch add standart DES support. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/cipher-gcrypt.c | 3 +++ crypto/cipher-nettle.c | 13 ++--- crypto/cipher.c| 5 - qapi/crypto.json | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-)

[Qemu-devel] [PATCH for-2.9 3/3] tests: crypto: add testcase for standard des(ecb)

2016-12-05 Thread Longpeng(Mike)
As we have added standart DES support when using gcrypt/nettle, so this patch add a testcase for standard ecb(des). Note: the data is copied from linux-kernel's tcrypt module. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/test-crypto-cipher.c | 11 +++ 1 file c

Re: [Qemu-devel] [PATCH for-2.9 3/3] tests: crypto: add testcase for standard des(ecb)

2016-12-05 Thread Longpeng (Mike)
Hi Daniel, On 2016/12/5 17:24, Daniel P. Berrange wrote: > On Mon, Dec 05, 2016 at 04:59:40PM +0800, Longpeng(Mike) wrote: .. >> { >> +.path = "/crypto/cipher/des-ecb", >> +.alg = QCRYPTO_CIPHER_ALG_DES, >> +.mode = QCRY

[Qemu-devel] [PATCH for-2.9 0/2] cryptodev: support xts(aes) algorithm

2016-12-04 Thread Longpeng(Mike)
This patchset firstly fix a bug in cryptodev_builtin_get_aes_algo, and then add xts(aes) algorithm support. Longpeng(Mike) (2): cryptodev: fix the check of aes algorithm cryptodev: add xts(aes) support backends/cryptodev-builtin.c | 55 +--- 1 file

[Qemu-devel] [PATCH for-2.9 2/2] cryptodev: add xts(aes) support

2016-12-04 Thread Longpeng(Mike)
This patch add xts(aes) support. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- backends/cryptodev-builtin.c | 8 1 file changed, 8 insertions(+) diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index 9dec6b8..ecad565 100644 --- a/backends/cry

[Qemu-devel] [PATCH for-2.9 1/2] cryptodev: fix the check of aes algorithm

2016-12-04 Thread Longpeng(Mike)
As the key length of xts(aes) is different with other mode of aes, so we should check specially in cryptodev_builtin_get_aes_algo, if it is xts mode. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- backends/cryptodev-builtin.c | 47 +++-

[Qemu-devel] [PATCH for-2.9 0/3] crypto: add standard des support

2016-12-05 Thread Longpeng(Mike)
including standard DES. Longpeng(Mike) (3): crypto: add standard des support cryptodev: switch to standard des tests: crypto: add testcase for standard des(ecb) backends/cryptodev-builtin.c | 2 +- crypto/cipher-gcrypt.c | 3 +++ crypto/cipher-nettle.c | 13 ++--- crypto

Re: [Qemu-devel] [PATCH for-2.9 1/2] cryptodev: fix the check of aes algorithm

2016-12-05 Thread Longpeng (Mike)
56; >> +} else if (key_len == AES_KEYSIZE_256) { /* equals AES_KEYSIZE_128_XTS >> */ > > So I think you can: > #define AES_KEYSIZE_128_XTS AES_KEYSIZE_256 All right, I send a V2 later. :) > > > Regards, > -Gonglei > .. > -- Regards, Longpeng(Mike)

[Qemu-devel] [PATCH RESEND 4/6] crypto: implement gcrypt-backed AEAD algorithms

2017-01-04 Thread Longpeng(Mike)
This patch add gcrypt-backed AEAD algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/aead-gcrypt.c | 173 +-- 1 file changed, 167 insertions(+), 6 deletions(-) diff --git a/crypto/aead-gcrypt.c b/crypt

[Qemu-devel] [PATCH RESEND 1/6] configure: add CONFIG_GCRYPT/NETTLE_AEAD item

2017-01-04 Thread Longpeng(Mike)
This item will be used for gcrypt/nettle backed AEAD algorithms. It's hardly to decide which version of gcrypt/nettle started supporting AEAD algorithms, but it's easily for us to making a test in configure to know whether current gcrypt/nettle support AEAD. Signed-off-by: Longpeng(Mike) <lon

[Qemu-devel] [PATCH RESEND 2/6] crypto: add AEAD algorithms framework

2017-01-04 Thread Longpeng(Mike)
This patch introduce AEAD algorithms framework. We currently plan to support six basic AEAD algorithms, ccm(aes128/192/256) and gcm(aes128/192/256), so we need to add ccm/gcm mode in qapi/crypto.json simultaneously. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/Makefil

[Qemu-devel] [PATCH RESEND 0/6] crypto:add AEAD algorithms support

2017-01-04 Thread Longpeng(Mike)
, and it will be used by the virtio-crypto in the near future. --- Longpeng(Mike) (6): configure: add CONFIG_GCRYPT/NETTLE_AEAD item crypto: add AEAD algorithms framework crypto: implement nettle-backed AEAD algorithms crypto: implement gcrypt-backed AEAD algorithms crypto: implement

[Qemu-devel] [PATCH RESEND 6/6] crypto: add AEAD algorithms testcases

2017-01-04 Thread Longpeng(Mike)
This patch add some AEAD algorithms testcases Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/Makefile.include | 2 + tests/test-crypto-aead.c | 357 +++ 2 files changed, 359 insertions(+) create mode 100644 tests/test-crypto-

[Qemu-devel] [PATCH RESEND 3/6] crypto: implement nettle-backed AEAD algorithms

2017-01-04 Thread Longpeng(Mike)
This patch add nettle-backed AEAD algorithms Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/aead-nettle.c | 174 --- 1 file changed, 167 insertions(+), 7 deletions(-) diff --git a/crypto/aead-nettle.c b/crypto/aead-nettle.c

[Qemu-devel] [PATCH RESEND 5/6] crypto: implement other common funcs for AEAD algorithms

2017-01-04 Thread Longpeng(Mike)
If currently gcrypt/nettle doesn't support AEAD alg, then we should implement some no-op funcs. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/aead.c | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/crypto/ae

[Qemu-devel] [PATCH 2/6] crypto: add AEAD algorithms framework

2017-01-02 Thread Longpeng(Mike)
This patch introduce AEAD algorithms framework. We currently plan to support six basic AEAD algorithms, ccm(aes128/192/256) and gcm(aes128/192/256), so we need to add ccm/gcm mode in qapi/crypto.json simultaneously. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/Makefil

[Qemu-devel] [PATCH 5/6] crypto: implement other common funcs for AEAD algorithms

2017-01-02 Thread Longpeng(Mike)
If currently gcrypt/nettle doesn't support AEAD alg, then we should implement some no-op funcs. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/aead.c | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/crypto/ae

[Qemu-devel] [PATCH 4/6] crypto: implement gcrypt-backed AEAD algorithms

2017-01-02 Thread Longpeng(Mike)
This patch add gcrypt-backed AEAD algorithms support Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/aead-gcrypt.c | 173 +-- 1 file changed, 167 insertions(+), 6 deletions(-) diff --git a/crypto/aead-gcrypt.c b/crypt

[Qemu-devel] [PATCH 0/6] add AEAD algorithms support

2017-01-02 Thread Longpeng(Mike)
Since QEMU has been supported cryptodev, so it is necessary to support more crypto algorithms(i.e. hmac,aead) in QEMU backend. We have already added HMAC support, and this patchset adds AEAD algos support. Longpeng(Mike) (6): configure: add CONFIG_GCRYPT/NETTLE_AEAD item crypto: add AEAD

[Qemu-devel] [PATCH 6/6] crypto: add AEAD algorithms testcases

2017-01-02 Thread Longpeng(Mike)
This patch add some AEAD algorithms testcases Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- tests/Makefile.include | 2 + tests/test-crypto-aead.c | 357 +++ 2 files changed, 359 insertions(+) create mode 100644 tests/test-crypto-

[Qemu-devel] [PATCH 1/6] configure: add CONFIG_GCRYPT/NETTLE_AEAD item

2017-01-02 Thread Longpeng(Mike)
This item will be used for gcrypt/nettle backed AEAD algorithms. It's hardly to decide which version of gcrypt/nettle started supporting AEAD algorithms, but it's easily for us to making a test in configure to know whether current gcrypt/nettle support AEAD. Signed-off-by: Longpeng(Mike) <lon

[Qemu-devel] [PATCH 3/6] crypto: implement nettle-backed AEAD algorithms

2017-01-02 Thread Longpeng(Mike)
This patch add nettle-backed AEAD algorithms Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/aead-nettle.c | 174 --- 1 file changed, 167 insertions(+), 7 deletions(-) diff --git a/crypto/aead-nettle.c b/crypto/aead-nettle.c

[Qemu-devel] Question about add AF_ALG backend for virtio-crypto

2017-01-08 Thread Longpeng (Mike)
that Catalin didn't do it, so I'm confuse about wether it is need to add a AF_ALG backend. Do you have any suggestion? Thanks :) -- Regards, Longpeng(Mike)

Re: [Qemu-devel] [PATCH RESEND 2/6] crypto: add AEAD algorithms framework

2017-01-06 Thread Longpeng (Mike)
Hi Daniel, On 2017/1/6 19:28, Daniel P. Berrange wrote: > On Thu, Jan 05, 2017 at 08:49:37AM +0800, Longpeng(Mike) wrote: >> This patch introduce AEAD algorithms framework. > > So AEAD is essentially just encryption with extra metadata on > input and output stages. As

Re: [Qemu-devel] [PULL v1 3/7] crypto: add HMAC algorithms framework

2016-12-21 Thread Longpeng (Mike)
Hi Daniel, Can you pick this patch together ? [PATCH for-2.9 v4 1/6] configure: add CONFIG_GCRYPT_HMAC item Or it will be picked by somebody else ? :) On 2016/12/21 22:35, Daniel P. Berrange wrote: > From: "Longpeng(Mike)" <longpe...@huawei.com> > > This patch

Re: [Qemu-devel] [PATCH for-2.10 01/19] crypto: cipher: introduce context free function

2017-04-10 Thread Longpeng (Mike)
On 2017/4/10 23:01, Eric Blake wrote: > On 04/10/2017 03:59 AM, Longpeng(Mike) wrote: >> Refactors the qcrypto_cipher_free(), splits it into two parts. One >> is gcrypt/nettle__cipher_free_ctx() to free the special context. > > Your mail forgot to include 'In-Reply

[Qemu-devel] [PATCH for-2.10 04/19] crypto: cipher: introduce qcrypto_cipher_ctx_new for builtin-backend

2017-04-10 Thread Longpeng(Mike)
Extracts qcrypto_cipher_ctx_new() from qcrypto_cipher_new() for glib-backend impls. Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> --- crypto/cipher-builtin.c | 101 ++-- 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/

  1   2   3   4   5   6   >