[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) --- crypto/hmac-gcrypt.c | 111 ++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/crypto/hmac-gcrypt.c b/crypto/hmac-gcrypt.c index 6e07415

[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

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)" > > This patch introduce HMAC algorithms framewo

Re: [Qemu-devel] [PATCH REPOST v19 1/2] virtio-crypto: Add virtio crypto device specification

2017-09-26 Thread Longpeng (Mike)
Hi Halil, On 2017/9/15 22:39, Halil Pasic wrote: > > > On 09/11/2017 03:12 AM, Longpeng(Mike) wrote: >> From: Gonglei >> >> The virtio crypto device is a virtual crypto device (ie. hardware >> crypto accelerator card). Currently, the virtio crypto device

Re: [Qemu-devel] [PATCH REPOST v19 1/2] virtio-crypto: Add virtio crypto device specification

2017-09-26 Thread Longpeng (Mike)
Hi Halil, On 2017/9/15 23:59, Halil Pasic wrote: > > > On 09/11/2017 03:12 AM, Longpeng(Mike) wrote: >> From: Gonglei >> >> The virtio crypto device is a virtual crypto device (ie. hardware >> crypto accelerator card). Currently, the virtio crypto device

Re: [Qemu-devel] [PATCH v19 0/2] virtio-crypto: virtio crypto device specification

2017-08-31 Thread Longpeng (Mike)
Ping... Stefan, Halil, do you have any suggestion ? -- Regards, Longpeng(Mike) On 2017/8/26 15:53, Longpeng(Mike) wrote: > Hi guys, > > I'll work on the virtio-crypto spec with Gonglei together, Because He is > so busy on the inner production project. > > --- >

Re: [Qemu-devel] [PATCH v19 0/2] virtio-crypto: virtio crypto device specification

2017-09-01 Thread Longpeng (Mike)
Hi Halil, On 2017/9/1 19:45, Halil Pasic wrote: > > > On 09/01/2017 02:47 AM, Longpeng (Mike) wrote: >> Ping... >> >> Stefan, Halil, do you have any suggestion ? >> > > Hi Longpeng, > > I've ran trough your patch, and it reads much better t

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v19 0/2] virtio-crypto: virtio crypto device specification

2017-09-07 Thread Longpeng (Mike)
On 2017/9/6 21:52, Michael S. Tsirkin wrote: > On Fri, Sep 01, 2017 at 01:45:45PM +0200, Halil Pasic wrote: >> >> >> On 09/01/2017 02:47 AM, Longpeng (Mike) wrote: >>> Ping... >>> >>> Stefan, Halil, do you have any suggestion ? >>> &g

Re: [Qemu-devel] [PATCH v19 0/2] virtio-crypto: virtio crypto device specification

2017-09-07 Thread Longpeng (Mike)
On 2017/9/8 11:49, Michael S. Tsirkin wrote: > On Fri, Sep 01, 2017 at 08:47:28AM +0800, Longpeng (Mike) wrote: >> Ping... >> >> Stefan, Halil, do you have any suggestion ? > > I do not see this patchset in the virtio list archives. > It could be that youa re

Re: [Qemu-devel] [PATCH v19 0/2] virtio-crypto: virtio crypto device specification

2017-09-07 Thread Longpeng (Mike)
On 2017/9/8 12:31, Michael S. Tsirkin wrote: > On Fri, Sep 08, 2017 at 12:22:01PM +0800, Longpeng (Mike) wrote: >> >> >> On 2017/9/8 11:49, Michael S. Tsirkin wrote: >> >>> On Fri, Sep 01, 2017 at 08:47:28AM +0800, Longpeng (Mike) wrote: >>>>

[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) --- crypto/aead.c | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/crypto/aead.c b/crypto/aead.c

[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) --- crypto/aead-gcrypt.c | 173 +-- 1 file changed, 167 insertions(+), 6 deletions(-) diff --git a/crypto/aead-gcrypt.c b/crypto/aead-gcrypt.c index 9465518

[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 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) --- crypto/Makefile.objs | 3 + crypto/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) --- tests/Makefile.include | 2 + tests/test-crypto-aead.c | 357 +++ 2 files changed, 359 insertions(+) create mode 100644 tests/test-crypto-aead.c diff --git a/tests

[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: 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) --- crypto/aead-nettle.c | 174 --- 1 file changed, 167 insertions(+), 7 deletions(-) diff --git a/crypto/aead-nettle.c b/crypto/aead-nettle.c index cfb9d33..7a2296d

[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 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) --- crypto/Makefile.objs | 3 + crypto/aead

[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) --- crypto/aead-gcrypt.c | 173 +-- 1 file changed, 167 insertions(+), 6 deletions(-) diff --git a/crypto/aead-gcrypt.c b/crypto/aead-gcrypt.c index 9465518

[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: Lon

[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) --- crypto/aead.c | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/crypto/aead.c b/crypto/aead.c

[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) --- crypto/aead-nettle.c | 174 --- 1 file changed, 167 insertions(+), 7 deletions(-) diff --git a/crypto/aead-nettle.c b/crypto/aead-nettle.c index cfb9d33..7a2296d

[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) --- tests/Makefile.include | 2 + tests/test-crypto-aead.c | 357 +++ 2 files changed, 359 insertions(+) create mode 100644 tests/test-crypto-aead.c diff --git a/tests

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 such

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

2017-01-08 Thread Longpeng (Mike)
t it seems 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)

[Qemu-devel] [PATCH] crypto: afalg: fix a NULL pointer dereference

2017-11-05 Thread Longpeng(Mike)
ltlen, errp); if (ret == 0) { return ret; } error_free(*errp); // <--- here So we must check 'errp & *errp' before dereference. Signed-off-by: Longpeng(Mike) --- crypto/hash.c | 4 +++- 1 file changed, 3 ins

[Qemu-devel] [v21 0/2] virtio-crypto: virtio crypto device specification

2017-11-05 Thread Longpeng(Mike)
This is the specification about the new virtio crypto device. --- v21 -> v20 - rename 'queue_id' to 'reserved' [Halil] - redescribe the format of the structures which using 'union' in the previous version [Halil] v20 -> v19 - fix some typos and grammar fixes [Halil] - make queue_id reserve

[Qemu-devel] [RFC 03/10] virtio-crypto: remove queue_id field in ctrl header

2017-11-05 Thread Longpeng(Mike)
The queue_id is needless bacause we can get the info from VirtQueue->queue_index. For existing frontend driver, this field is always zero, so we can just mark this field as reserved and ingore its value. Signed-off-by: Longpeng(Mike) --- hw/virtio/virtio-crypto.c

[Qemu-devel] [RFC 01/10] virtio-crypto: remove virtio_crypto_op_ctrl_req structure

2017-11-05 Thread Longpeng(Mike)
The struct virtio_crypto_op_ctrl_req is not needed, we can use 'header + payload' instead as suggested by Halil. This can makes the code simpler to add MUX-mode support in the next patch. Signed-off-by: Longpeng(Mike) --- hw/virtio/virtio-crypto.c

[Qemu-devel] [RFC 06/10] cryptodev: add stateless mode cipher support

2017-11-05 Thread Longpeng(Mike)
Adds stateless mode cipher support. Signed-off-by: Longpeng(Mike) --- backends/cryptodev.c | 21 + include/hw/virtio/virtio-crypto.h | 1 + include/sysemu/cryptodev.h| 18 ++ 3 files changed, 40 insertions(+) diff --git a/backends

[Qemu-devel] [RFC 08/10] cryptodev: extract one util function

2017-11-05 Thread Longpeng(Mike)
From: Gonglei So that the new function can be used by both seesion creation and the following stateless crypto operation. Signed-off-by: Gonglei Signed-off-by: Longpeng(Mike) --- backends/cryptodev-builtin.c | 100 +-- 1 file changed, 58 insertions

[Qemu-devel] [RFC 10/10] virtio-crypto: add host feature bits support

2017-11-05 Thread Longpeng(Mike)
From: Gonglei We enable all feature bits acquiescently. Signed-off-by: Gonglei --- hw/virtio/virtio-crypto.c | 15 +++ include/hw/virtio/virtio-crypto.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index e46c4

[Qemu-devel] [RFC 04/10] virtio-crypto: remove virtio_crypto_op_data_req structure

2017-11-05 Thread Longpeng(Mike)
The struct virtio_crypto_op_data_req is not needed, we can use 'header + payload' instead. This makes the code simpler to add MUX-mode support in the next patch. Signed-off-by: Longpeng(Mike) --- hw/virtio/virtio-crypto.c | 34 ++ includ

[Qemu-devel] [RFC 07/10] virtio-crypto: add stateless crypto request handler

2017-11-05 Thread Longpeng(Mike)
: Gonglei [simplify the code] Signed-off-by: Longpeng(Mike) Signed-off-by: Longpeng(Mike) --- backends/cryptodev-builtin.c | 3 +- hw/virtio/virtio-crypto.c | 311 +++-- include/standard-headers/linux/virtio_crypto.h | 161

[Qemu-devel] [v21 RESEND 0/2] virtio-crypto: virtio crypto device specification

2017-11-05 Thread Longpeng(Mike)
This is the specification about the new virtio crypto device. --- v21 -> v20 - rename 'queue_id' to 'reserved' [Halil] - redescribe the format of the structures which using 'union' in the previous version [Halil] v20 -> v19 - fix some typos and grammar fixes [Halil] - make queue_id reserve

[Qemu-devel] [v21 RESEND 1/2] virtio-crypto: Add virtio crypto device specification

2017-11-05 Thread Longpeng(Mike)
-off-by: Gonglei Signed-off-by: Longpeng(Mike) --- acknowledgements.tex |3 + content.tex |2 + virtio-crypto.tex| 1426 ++ 3 files changed, 1431 insertions(+) create mode 100644 virtio-crypto.tex diff --git a

[Qemu-devel] [RFC 09/10] cryptodev-builtin: add stateless cipher support

2017-11-05 Thread Longpeng(Mike)
Adds stateless cipher support for builtin-backend Signed-off-by: Gonglei [simplify the code & correct the return value] Signed-off-by: Longpeng(Mike) --- backends/cryptodev-builtin.c | 86 1 file changed, 86 insertions(+) diff --git a/back

[Qemu-devel] [v21 RESEND 2/2] virtio-crypto: Add conformance clauses

2017-11-05 Thread Longpeng(Mike)
From: Gonglei Add the conformance targets and clauses for virtio-crypto device. Signed-off-by: Gonglei Signed-off-by: Longpeng(Mike) --- conformance.tex | 29 + 1 file changed, 29 insertions(+) diff --git a/conformance.tex b/conformance.tex index 7b7df32..266a22f

[Qemu-devel] [v21 2/2] virtio-crypto: Add conformance clauses

2017-11-05 Thread Longpeng(Mike)
From: Gonglei Add the conformance targets and clauses for virtio-crypto device. Signed-off-by: Gonglei Signed-off-by: Longpeng(Mike) --- conformance.tex | 29 + 1 file changed, 29 insertions(+) diff --git a/conformance.tex b/conformance.tex index 7b7df32..266a22f

[Qemu-devel] [v21 1/2] virtio-crypto: Add virtio crypto device specification

2017-11-05 Thread Longpeng(Mike)
-off-by: Gonglei Signed-off-by: Longpeng(Mike) --- acknowledgements.tex |3 + content.tex |2 + virtio-crypto.tex| 1426 ++ 3 files changed, 1431 insertions(+) create mode 100644 virtio-crypto.tex diff --git a

[Qemu-devel] [RFC 00/10] virtio-crypto: add multiplexing mode support

2017-11-05 Thread Longpeng(Mike)
benefit is obvious for HASH service because it's usually a one-blob operation. --- Gonglei (2): cryptodev: extract one util function virtio-crypto: add host feature bits support Longpeng(Mike) (8): virtio-crypto: remove virtio_crypto_op_ctrl_req structure virtio-crypto: add session cre

[Qemu-devel] [RFC 02/10] virtio-crypto: add session creation logic for mux mode

2017-11-05 Thread Longpeng(Mike)
Adds some macros about the features of multiplexing mode and supports the session create for this mode. Signed-off-by: Longpeng(Mike) --- hw/virtio/virtio-crypto.c | 13 +++-- include/standard-headers/linux/virtio_crypto.h | 7 +++ 2 files changed, 18

[Qemu-devel] [RFC 05/10] virtio-crypto: add dataq operation logic for mux mode

2017-11-05 Thread Longpeng(Mike)
Adds dataq operation support for MUX mode. Signed-off-by: Longpeng(Mike) --- hw/virtio/virtio-crypto.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 828d7ef..10a0c35 100644 --- a/hw/virtio/virtio-crypto.c

Re: [Qemu-devel] [PATCH] crypto: afalg: fix a NULL pointer dereference

2017-11-06 Thread Longpeng (Mike)
On 2017/11/7 1:18, Stefan Hajnoczi wrote: > On Mon, Nov 06, 2017 at 02:21:11PM +0800, Longpeng(Mike) wrote: >> Test-crypto-hash calls qcrypto_hash_bytesv/digest/base64 with >> errp=NULL, this will cause a NULL poniter deference if afalg_driver >> doesn't support r

Re: [Qemu-devel] [PATCH] crypto: afalg: fix a NULL pointer dereference

2017-11-06 Thread Longpeng (Mike)
On 2017/11/7 1:00, Eric Blake wrote: > On 11/06/2017 12:21 AM, Longpeng(Mike) wrote: >> Test-crypto-hash calls qcrypto_hash_bytesv/digest/base64 with >> errp=NULL, this will cause a NULL poniter deference if afalg_driver > > s/poniter deference/pointer dereference/ >

Re: [Qemu-devel] [PATCH] crypto: afalg: fix a NULL pointer dereference

2017-11-07 Thread Longpeng (Mike)
On 2017/11/7 17:16, Daniel P. Berrange wrote: > On Tue, Nov 07, 2017 at 10:27:10AM +0800, Longpeng (Mike) wrote: >> >> >> On 2017/11/7 1:00, Eric Blake wrote: >> >>> On 11/06/2017 12:21 AM, Longpeng(Mike) wrote: >>>> Test-crypto-hash calls qcryp

[Qemu-devel] [PATCH v2] crypto: afalg: fix a NULL pointer dereference

2017-11-07 Thread Longpeng(Mike)
From: Longpeng Test-crypto-hash calls qcrypto_hash_bytesv/digest/base64 with errp=NULL, this will cause a NULL pointer deference if afalg_driver doesn't support requested algos: ret = qcrypto_hash_afalg_driver.hash_bytesv(alg, iov, niov, result

Re: [Qemu-devel] [v21 RESEND 1/2] virtio-crypto: Add virtio crypto device specification

2017-11-12 Thread Longpeng (Mike)
Hi Stefan, On 2017/11/11 1:02, Stefan Hajnoczi wrote: > On Mon, Nov 06, 2017 at 02:58:47PM +0800, Longpeng(Mike) wrote: >> From: Gonglei >> >> The virtio crypto device is a virtual crypto device (ie. hardware >> crypto accelerator card). Currently, the virtio cr

[Qemu-devel] [v23 2/2] virtio-crypto: Add conformance clauses

2017-12-30 Thread Longpeng(Mike)
From: Gonglei Add the conformance targets and clauses for virtio-crypto device. Signed-off-by: Gonglei Signed-off-by: Zhoujian Signed-off-by: Longpeng(Mike) --- conformance.tex | 29 + 1 file changed, 29 insertions(+) diff --git a/conformance.tex b

[Qemu-devel] [v23 0/2] virtio-crypto: virtio crypto device specification

2017-12-30 Thread Longpeng(Mike)
This is the specification about the new virtio crypto device. --- v23 -> v22 - rename MUX_MODE to REVISION_1 [Halil] - fixed-length paramenters' instead of 'header' and 'variable-length parameters' instead of 'extra parameters' [Halil] - add guidance about VIRTIO_CRYPTO_FLAG_SESSION_MODE [Ha

[Qemu-devel] [v23 1/2] virtio-crypto: Add virtio crypto device specification

2017-12-30 Thread Longpeng(Mike)
-off-by: Gonglei Signed-off-by: Zhoujian Signed-off-by: Longpeng(Mike) --- acknowledgements.tex |4 + content.tex |2 + virtio-crypto.tex| 1525 ++ 3 files changed, 1531 insertions(+) create mode 100644 virtio-crypto.tex diff

Re: [Qemu-devel] [virtio-dev] Re: [v22 1/2] virtio-crypto: Add virtio crypto device specification

2018-01-04 Thread Longpeng (Mike)
On 2018/1/4 4:43, Halil Pasic wrote: > > > On 12/30/2017 08:57 AM, Longpeng (Mike) wrote: >>> What you actually do is the following. You define a >>> 'VIRTIO_CRYPTO_F__STATELESS_MODE feature bit is negotiated' >>> (A) mode and a '.

Re: [Qemu-devel] [v23 1/2] virtio-crypto: Add virtio crypto device specification

2018-01-09 Thread Longpeng (Mike)
Hi Halil, We are fixing the Intel BUG these days, so I will go through your comments after we're done. Thanks. -- Regards, Longpeng(Mike) On 2018/1/10 1:05, Halil Pasic wrote: > > > On 12/30/2017 10:35 AM, Longpeng(Mike) wrote: >> From: Gonglei >> >> The v

Re: [Qemu-devel] [virtio-dev] Re: [v22 1/2] virtio-crypto: Add virtio crypto device specification

2017-12-18 Thread Longpeng (Mike)
Hi Halil, On 2017/12/11 21:54, Halil Pasic wrote: > > > On 12/11/2017 01:56 PM, Longpeng (Mike) wrote: >> >> >> On 2017/12/6 19:01, Halil Pasic wrote: >> >>> >>> >>> On 12/06/2017 08:37 AM, Longpeng(Mike) wrote: >>>> +

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [v22 1/2] virtio-crypto: Add virtio crypto device specification

2017-12-23 Thread Longpeng (Mike)
On 2017/12/18 20:29, Halil Pasic wrote: > > > On 12/18/2017 09:43 AM, Longpeng (Mike) wrote: >> Hi Halil, >> >> On 2017/12/11 21:54, Halil Pasic wrote: >> >>> >>> >>> On 12/11/2017 01:56 PM, Longpeng (Mike) wrote: >>>> &g

Re: [Qemu-devel] [v22 1/2] virtio-crypto: Add virtio crypto device specification

2017-12-29 Thread Longpeng (Mike)
On 2017/12/21 0:44, Halil Pasic wrote: > Meta: Updated Connie's email. > > On 12/06/2017 08:37 AM, Longpeng(Mike) wrote: >> From: Gonglei >> >> The virtio crypto device is a virtual crypto device (ie. hardware >> crypto accelerator card). Currently, th

[RFC] cpus: avoid get stuck in pause_all_vcpus

2020-03-10 Thread Longpeng(Mike)
From: Longpeng We find an issue when repeat reboot in guest during migration, it cause the migration thread never be waken up again. | | LOCK BQL | ...| main_loop_should_exit

Re: [PATCH RESEND 2/3] vhost: fix a null pointer reference of vhost_log

2020-03-10 Thread Longpeng (Mike)
在 2020/3/10 16:23, Michael S. Tsirkin 写道: > On Tue, Mar 10, 2020 at 04:04:35PM +0800, Longpeng (Mike, Cloud > Infrastructure Service Product Dept.) wrote: >> >> >> On 2020/3/10 13:57, Michael S. Tsirkin wrote: >>> On Mon, Feb 24, 2020 at 02:42:18PM +0800, Longpeng

Re: [RFC] cpus: avoid get stuck in pause_all_vcpus

2020-03-10 Thread Longpeng (Mike)
ro exit > status 2. > filter=--filter=label=com.qemu.instance.uuid=88af8ba44214464d881ef7c7786167f4 > make[1]: *** [docker-run] Error 1 > make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-a0j9h14_/src' > make: *** [docker-run-test-debug@fedora] Error 2 > > real27m55.506s > user0m8.248s > > > The full log is available at > http://patchew.org/logs/20200310091443.1326-1-longpe...@huawei.com/testing.asan/?type=message. > --- > Email generated automatically by Patchew [https://patchew.org/]. > Please send your feedback to patchew-de...@redhat.com > -- Regards, Longpeng(Mike)

[PATCH 2/2] migration: add vsock as data channel support

2020-08-06 Thread Longpeng(Mike)
The vsock channel is more widely use in some new features, for example, the Nitro/Enclave. It can also be used as the migration channel. Signed-off-by: Longpeng(Mike) --- migration/migration.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b

[PATCH 1/2] migration: unify the framework of socket-type channel

2020-08-06 Thread Longpeng(Mike)
up, this would be helpful for us to add other socket-type channels. Signed-off-by: Longpeng(Mike) --- migration/migration.c | 18 ++--- migration/socket.c| 72 +++ migration/socket.h| 11 +++- 3 files changed, 26 insertions

[PATCH 0/2] migration: add vsock channel support

2020-08-06 Thread Longpeng(Mike)
Longpeng (Mike) (2): migration: unify the framework of socket-type channel migration: add vsock as data channel support migration/migration.c | 20 +++--- migration/socket.c| 72 +++ migration/socket.h| 11 +++- 3 files

[PATCH] cpus: avoid stucking in pause_all_vcpus due to race

2020-03-16 Thread Longpeng(Mike)
From: Longpeng We found an issue when repeat reboot in guest during migration, it cause the migration thread never be waken up again. | | LOCK BQL | ...| main_loop_should_exit

[PATCH RESEND 0/3] fix some warnings by static code scan tool

2020-02-23 Thread Longpeng(Mike)
From: Longpeng Hi guys, Our tool find some potential issues in QEMU source code, maybe they're misreported, hope you could have a look at them. Longpeng (Mike) (3): vfio/pci: fix a null pointer reference in vfio_rom_read vhost: fix a null pointer reference of vhost_log util/pty:

[PATCH RESEND 2/3] vhost: fix a null pointer reference of vhost_log

2020-02-23 Thread Longpeng(Mike)
From: Longpeng vhost_log_alloc() may fails and returned pointer of log is null. However there're two places derefernce the return pointer without check. Signed-off-by: Longpeng --- hw/virtio/vhost.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/vir

[PATCH RESEND 1/3] vfio/pci: fix a null pointer reference in vfio_rom_read

2020-02-23 Thread Longpeng(Mike)
From: Longpeng vfio_pci_load_rom() maybe failed and then the vdev->rom is NULL in some situation (though I've not encountered yet), maybe we should avoid the VM abort. Signed-off-by: Longpeng --- hw/vfio/pci.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw

[PATCH RESEND 3/3] util/pty: fix a null pointer reference in qemu_openpty_raw

2020-02-23 Thread Longpeng(Mike)
From: Longpeng q_ptsname may failed ane return null, so use the returned pointer as the param of strcpy will cause null pointer deference. Use the return string of openpty instead of call ptsname. Signed-off-by: Longpeng --- util/qemu-openpty.c | 10 ++ 1 file changed, 2 insertions(+),

[PATCH 3/5] vfio: defer to enable msix in migration resume phase

2021-08-25 Thread Longpeng(Mike)
25 5th 36 33 6th 44 40 7th 51 47 8th 58 54 Total 258ms 232ms Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 22 ++ hw/vfio/pci.h | 1 + 2 files changed, 23 insertions(+) diff --git a/hw/

[PATCH 4/5] kvm: irqchip: support defer to commit the route

2021-08-25 Thread Longpeng(Mike)
The kvm_irqchip_commit_routes() is relatively expensive, so provide the users a choice to commit the route immediately or not when they add msi/msix route. Signed-off-by: Longpeng(Mike) --- accel/kvm/kvm-all.c| 10 +++--- accel/stubs/kvm-stub.c | 3 ++- hw/misc/ivshmem.c | 2

[PATCH 2/5] msix: simplfy the conditional in msix_set/unset_vector_notifiers

2021-08-25 Thread Longpeng(Mike)
'msix_function_masked' is kept pace with the device's config, we can use it to replace the complex conditional in msix_set/unset_vector_notifiers. poll_notifier should be reset to NULL in the error path in msix_set_vector_notifiers, fix it incidentally. Signed-off-by: Longpeng(Mik

[PATCH 1/5] vfio: use helper to simplfy the failure path in vfio_msi_enable

2021-08-25 Thread Longpeng(Mike)
: Longpeng(Mike) --- hw/vfio/pci.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index e1ea1d8..7cc43fe 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -47,6 +47,7 @@ static void vfio_disable_interrupts

[PATCH 0/5] optimize the downtime for vfio migration

2021-08-25 Thread Longpeng(Mike)
232ms 21ms Longpeng (Mike) (5): vfio: use helper to simplfy the failure path in vfio_msi_enable msix: simplfy the conditional in msix_set/unset_vector_notifiers vfio: defer to enable msix in migration resume phase kvm: irqchip: support defer to commit the route vfio: defer to co

[PATCH 5/5] vfio: defer to commit kvm route in migraiton resume phase

2021-08-25 Thread Longpeng(Mike)
th 44 3 7th 51 3 8th 58 4 Total 258ms 21ms The optimition can be also applied to msi type. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 47 --- 1 file changed, 44 insertions(+), 3

[RFC] vfio/migration: reduce the msix virq setup cost in resume phase

2021-08-12 Thread Longpeng(Mike)
tup, the unmasked vector will use qemu interrupt as default and switch to kvm interrupt once it fires. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 39 ++- hw/vfio/pci.h | 2 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.

[PATCH v3 3/9] vfio: simplify the failure path in vfio_msi_enable

2021-09-20 Thread Longpeng(Mike)
Use vfio_msi_disable_common to simplify the error handling in vfio_msi_enable. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 1e6797fd4b..8e97ca93cf 100644 --- a/hw/vfio

[PATCH v3 6/9] kvm: irqchip: extract kvm_irqchip_add_deferred_msi_route

2021-09-20 Thread Longpeng(Mike)
Extract a common helper that add MSI route for specific vector but does not commit immediately. Signed-off-by: Longpeng(Mike) --- accel/kvm/kvm-all.c | 15 +-- include/sysemu/kvm.h | 6 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b

[PATCH v3 5/9] msix: reset poll_notifier to NULL if fail to set notifiers

2021-09-20 Thread Longpeng(Mike)
'msix_vector_poll_notifier' should be reset to NULL in the error path in msix_set_vector_notifiers(). Signed-off-by: Longpeng(Mike) --- hw/pci/msix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 67682289af..805770942b 100644 --- a/hw/pci/ms

[PATCH v3 8/9] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration"

2021-09-20 Thread Longpeng(Mike)
Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8fe238b11d..2de1cc5425 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -610,9 +610,6 @@ static __attribute__((unu

[PATCH v3 0/9] optimize the downtime for vfio migration

2021-09-20 Thread Longpeng(Mike)
ute to minimize code changes[Alex] - enable the optimization in msi setup path[Alex] Longpeng (Mike) (9): vfio: simplify the conditional statements in vfio_msi_enable vfio: move re-enabling INTX out of the common helper vfio: simplify the failure path in vfio_msi_enable msix: simpli

[PATCH v3 1/9] vfio: simplify the conditional statements in vfio_msi_enable

2021-09-20 Thread Longpeng(Mike)
It's unnecessary to test against the specific return value of VFIO_DEVICE_SET_IRQS, since any positive return is an error indicating the number of vectors we should retry with. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v3 2/9] vfio: move re-enabling INTX out of the common helper

2021-09-20 Thread Longpeng(Mike)
Move re-enabling INTX out, and the callers should decide to re-enable it or not. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index f7a3a13fb0..1e6797fd4b 100644 --- a/hw/vfio

[PATCH v3 4/9] msix: simplify the conditional in msix_set/unset_vector_notifiers

2021-09-20 Thread Longpeng(Mike)
'msix_function_masked' is synchronized with the device's config, we can use it to replace the complex conditional statementis in msix_set/unset_vector_notifiers. Signed-off-by: Longpeng(Mike) --- hw/pci/msix.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH v3 7/9] vfio: add infrastructure to commit the deferred kvm routing

2021-09-20 Thread Longpeng(Mike)
'defer_kvm_irq_routing' indicates whether we should defer to commit the kvm routing. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 43 ++- hw/vfio/pci.h | 1 + 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c

[PATCH v3 9/9] vfio: defer to commit kvm irq routing when enable msi/msix

2021-09-20 Thread Longpeng(Mike)
igned and need to process in this round. The optimition can be applied to msi type too. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 36 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 2de1cc5425..b26

[PATCH v2 1/9] vfio: simplify the conditional statements in vfio_msi_enable

2021-09-08 Thread Longpeng(Mike)
It's unnecessary to test against the specific return value of VFIO_DEVICE_SET_IRQS, since any positive return is an error indicating the number of vectors we should retry with. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v2 0/9] optimize the downtime for vfio migration

2021-09-08 Thread Longpeng(Mike)
the optimization in msi setup path[Alex] Longpeng (Mike) (9): vfio: simplify the conditional statements in vfio_msi_enable vfio: move re-enabling INTX out of the common helper vfio: simplify the failure path in vfio_msi_enable msix: simplify the conditional in msix_set/unset_vector_notifi

[PATCH v2 5/9] msix: reset poll_notifier to NULL if fail to set notifiers

2021-09-08 Thread Longpeng(Mike)
'msix_vector_poll_notifier' should be reset to NULL in the error path in msix_set_vector_notifiers(). Signed-off-by: Longpeng(Mike) --- hw/pci/msix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 6768228..8057709 100644 --- a/hw/pci/msix.c ++

[PATCH v2 8/9] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration"

2021-09-08 Thread Longpeng(Mike)
Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index dda60a5..4aedb5a 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -608,9 +608,6 @@ static void vfio_commit_kvm_msi_virq(VFI

[PATCH v2 2/9] vfio: move re-enabling INTX out of the common helper

2021-09-08 Thread Longpeng(Mike)
Move re-enabling INTX out, and the callers should decide to re-enable it or not. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index f7a3a13..1e6797f 100644 --- a/hw/vfio/pci.c

[PATCH v2 6/9] kvm: irqchip: extract kvm_irqchip_add_deferred_msi_route

2021-09-08 Thread Longpeng(Mike)
Extract a common helper that add MSI route for specific vector but does not commit immediately. Signed-off-by: Longpeng(Mike) --- accel/kvm/kvm-all.c | 15 +-- include/sysemu/kvm.h | 6 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b

[PATCH v2 4/9] msix: simplify the conditional in msix_set/unset_vector_notifiers

2021-09-08 Thread Longpeng(Mike)
'msix_function_masked' is synchronized with the device's config, we can use it to replace the complex conditional statementis in msix_set/unset_vector_notifiers. Signed-off-by: Longpeng(Mike) --- hw/pci/msix.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH v2 3/9] vfio: simplify the failure path in vfio_msi_enable

2021-09-08 Thread Longpeng(Mike)
Use vfio_msi_disable_common to simplify the error handling in vfio_msi_enable. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 1e6797f..8236cd7 100644 --- a/hw/vfio/pci.c

[PATCH v2 9/9] vfio: defer to commit kvm irq routing when enable msi/msix

2021-09-08 Thread Longpeng(Mike)
igned and need to process in this round. The optimition can be applied to msi type too. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 33 +++-- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 4aedb5a..cc85cc1 100644

[PATCH v2 7/9] vfio: add infrastructure to commit the deferred kvm routing

2021-09-08 Thread Longpeng(Mike)
'defer_kvm_irq_routing' indicates whether we should defer to commit the kvm routing. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 42 +- hw/vfio/pci.h | 1 + 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c

Re: [Qemu-devel] [BUG] VM abort after migration

2019-07-09 Thread Longpeng (Mike)
state after all the pci devs are saved ? >> Does this problem only happen with e1000? I think so. >> If it's only e1000 I think we should fix it - I think once the VM is >> stopped for doing the device migration it shouldn't be raising >> interrupts. > > >

Re: [Qemu-devel] [BUG] VM abort after migration

2019-07-10 Thread Longpeng (Mike)
在 2019/7/10 11:57, Jason Wang 写道: > > On 2019/7/10 上午11:36, Longpeng (Mike) wrote: >> 在 2019/7/10 11:25, Jason Wang 写道: >>> On 2019/7/8 下午5:47, Dr. David Alan Gilbert wrote: >>>> * longpeng (longpe...@huawei.com) wrote: >>>>> Hi guys, >>>

[Qemu-devel] [PATCH] usb/xchi: avoid trigger assertion if guest write wrong epid

2019-04-29 Thread Longpeng(Mike)
From: Longpeng we found the following core in our environment: 0 0x7fc6b06c2237 in raise () 1 0x7fc6b06c3928 in abort () 2 0x7fc6b06bb056 in __assert_fail_base () 3 0x7fc6b06bb102 in __assert_fail () 4 0x00702e36 in xhci_kick_ep (...) 6 0x0047767f in access_w

Re: [Qemu-devel] [PATCH] usb/xchi: avoid trigger assertion if guest write wrong epid

2019-04-29 Thread Longpeng (Mike)
Hi Philippe, On 2019/4/29 19:16, Philippe Mathieu-Daudé wrote: > Hi Mike, > > On 4/29/19 9:39 AM, Longpeng(Mike) wrote: >> From: Longpeng >> >> we found the following core in our environment: >> 0 0x7fc6b06c2237 in raise () >> 1 0x7fc6b06c3928

Re: [Qemu-devel] [PATCH] usb/xchi: avoid trigger assertion if guest write wrong epid

2019-04-29 Thread Longpeng (Mike)
On 2019/4/29 20:10, Philippe Mathieu-Daudé wrote: > On 4/29/19 1:42 PM, Longpeng (Mike) wrote: >> Hi Philippe, >> >> On 2019/4/29 19:16, Philippe Mathieu-Daudé wrote: >> >>> Hi Mike, >>> >>> On 4/29/19 9:39 AM, Longpeng(Mike) wrote: >>

<    1   2   3   4   5   6   >