[PATCH v6 11/12] cryptodev: Support query-stats QMP command

2023-03-01 Thread zhenwei pi
ts": [ { "name": "asym-verify-bytes", "value": 0 }, ... { "name": "sym-decrypt-bytes", "value": 5376 }, ... ], "qom-path": "/o

[PATCH v6 05/12] cryptodev: Introduce 'query-cryptodev' QMP command

2023-03-01 Thread zhenwei pi
"id": "cryptodev0", "client": [ { "queue": 0, "type": "lkcf" } ] } ], "id": "libvirt-417" } Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- b

[PATCH v6 03/12] cryptodev: Introduce cryptodev alg type in QAPI

2023-03-01 Thread zhenwei pi
['sym', 'asym']} Then we can keep 'CRYPTODEV_BACKEND_ALG_SYM' and avoid lots of changes. 2, changes in this patch(with prefix 'QCRYPTODEV_BACKEND_ALG'). To avoid breaking the rule of QAPI, use 2 here. Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei

[PATCH v6 02/12] cryptodev: Remove 'name' & 'model' fields

2023-03-01 Thread zhenwei pi
We have already used qapi to generate crypto device types, this allows to convert type to a string 'model', so the 'model' field is not needed. And the 'name' field is not used by any backend driver, drop it. Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenw

[PATCH v6 07/12] hmp: add cryptodev info command

2023-03-01 Thread zhenwei pi
/backends/cryptodev-hmp-cmds.c b/backends/cryptodev-hmp-cmds.c new file mode 100644 index 00..4f7220bb13 --- /dev/null +++ b/backends/cryptodev-hmp-cmds.c @@ -0,0 +1,54 @@ +/* + * HMP commands related to cryptodev + * + * Copyright (c) 2023 Bytedance.Inc + * + * Authors: + *zhenwei pi

[PATCH v6 09/12] cryptodev: Account statistics

2023-03-01 Thread zhenwei pi
pto device. Signed-off-by: zhenwei pi --- backends/cryptodev.c | 68 +++--- include/sysemu/cryptodev.h | 49 +++ 2 files changed, 112 insertions(+), 5 deletions(-) diff --git a/backends/cryptodev.c b/backends/cryptodev.c index

[PATCH v6 04/12] cryptodev: Introduce server type in QAPI

2023-03-01 Thread zhenwei pi
Introduce cryptodev service type in cryptodev.json, then apply this to related codes. Now we can remove VIRTIO_CRYPTO_SERVICE_xxx dependence from QEMU cryptodev. Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c| 8 backends/cryptodev

[PATCH v6 06/12] cryptodev-builtin: Detect akcipher capability

2023-03-01 Thread zhenwei pi
Rather than exposing akcipher service/RSA algorithm to virtio crypto device unconditionally, detect akcipher capability from akcipher crypto framework. This avoids unsuccessful requests. Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 18

[PATCH v6 08/12] cryptodev: Use CryptoDevBackendOpInfo for operation

2023-03-01 Thread zhenwei pi
.c in the next step. (In theory, VirtIOCryptoReq is a private structure used by virtio-crypto only) Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 9 +++-- backends/cryptodev-lkcf.c| 9 +++-- backends/cryptodev.c

[PATCH v6 10/12] cryptodev: support QoS

2023-03-01 Thread zhenwei pi
qemu-monitor-command buster --hmp qom-set /objects/cryptodev1 \ throttle-ops 100 or cancel limitation: virsh qemu-monitor-command buster --hmp qom-set /objects/cryptodev1 \ throttle-ops 0 Reviewed-by: Daniel P. Berrangé Signed-off-by: zhenwei pi --- backends/cry

Re: Re: [PATCH v5 07/12] hmp: add cryptodev info command

2023-03-01 Thread zhenwei pi
On 3/1/23 18:47, Dr. David Alan Gilbert wrote: * zhenwei pi (pizhen...@bytedance.com) wrote: Example of this command: # virsh qemu-monitor-command vm --hmp info cryptodev cryptodev1: service=[akcipher|mac|hash|cipher] queue 0: type=builtin cryptodev0: service=[akcipher] queue 0

PING: [for-8.0 v2 00/11] Refactor cryptodev

2022-12-15 Thread zhenwei pi
Hi, Lei Could you please review this series? On 11/22/22 22:07, zhenwei pi wrote: v1 -> v2: - fix coding style and use 'g_strjoin()' instead of 'char services[128]' (suggested by Dr. David Alan Gilbert) - wrapper function 'cryptodev_backend_account' to r

Re: Re: [for-8.0 v2 00/11] Refactor cryptodev

2022-12-21 Thread zhenwei pi
On 12/20/22 23:36, Michael S. Tsirkin wrote: On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote: v1 -> v2: - fix coding style and use 'g_strjoin()' instead of 'char services[128]' (suggested by Dr. David Alan Gilbert) - wrapper function 'cryptode

PING: [for-8.0 v2 00/11] Refactor cryptodev

2023-01-02 Thread zhenwei pi
Hi, Markus & Michael Could you please take a look at the changes of QAPI part? On 12/22/22 10:04, zhenwei pi wrote: On 12/20/22 23:36, Michael S. Tsirkin wrote: On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote: v1 -> v2: - fix coding style and use 'g_strjoin()'

[PATCH] qapi: Document QCryptodevBackendServiceType

2024-08-11 Thread zhenwei pi
QCryptodevBackendServiceType was introduced by bc304a6442e (cryptodev: Introduce server type in QAPI). However there is a lack of member description. Thanks to Markus for pointing out this. Signed-off-by: zhenwei pi --- qapi/cryptodev.json | 10 ++ 1 file changed, 10 insertions(+) diff

Re: The members of QCryptodevBackendServiceType are undocumented

2024-08-11 Thread zhenwei pi
Hi Markus, Sorry for the lack of necessary description. I sent a patch, please review it. On 8/9/24 02:09, Markus Armbruster wrote: > Hi Zhenwei Pi, > > You added the type in commit bc304a6442e (cryptodev: Introduce server > type in QAPI). The doc comment describes none of the memb

Re: Re: [PATCH] qapi: Document QCryptodevBackendServiceType

2024-08-12 Thread zhenwei pi
On 8/12/24 14:14, Philippe Mathieu-Daudé wrote: > On 12/8/24 03:42, zhenwei pi wrote: >> QCryptodevBackendServiceType was introduced by >> bc304a6442e (cryptodev: Introduce server type in QAPI). However there >> is a lack of member description. Thanks to Markus for

PING: [PATCH] qapi: Document QCryptodevBackendServiceType

2024-08-19 Thread zhenwei pi
Hi Markus, This seems to be ignored... On 8/13/24 09:51, zhenwei pi wrote: > On 8/12/24 14:14, Philippe Mathieu-Daudé wrote: >> On 12/8/24 03:42, zhenwei pi wrote: >>> QCryptodevBackendServiceType was introduced by >>> bc304a6442e (cryptodev: Introduce server type in

[PATCH] meson: Remove libumad dependence

2024-06-11 Thread zhenwei pi
e Mathieu-Daudé Signed-off-by: zhenwei pi --- meson.build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meson.build b/meson.build index ec59effca2..226b97ea26 100644 --- a/meson.build +++ b/meson.build @@ -1885,11 +1885,9 @@ endif rdma = not_found if not get_option(&#

[PATCH v2 1/1] meson: Remove libibumad dependence

2024-06-11 Thread zhenwei pi
e Mathieu-Daudé Signed-off-by: zhenwei pi --- meson.build | 4 +--- tests/lcitool/projects/qemu.yml | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/meson.build b/meson.build index ec59effca2..226b97ea26 100644 --- a/meson.build +++ b/meson.build @@ -1885,11 +

[PATCH v2 0/1] meson: Remove libibumad dependence

2024-06-11 Thread zhenwei pi
v1 -> v2: remove libibumad from tests/lcitool/projects/qemu.yml v1: remove libibumad dependence Zhenwei Pi (1): meson: Remove libibumad dependence meson.build | 4 +--- tests/lcitool/projects/qemu.yml | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) -- 2.34.1

[PATCH v3 0/2] meson: Remove libibumad dependence

2024-06-11 Thread zhenwei pi
v2 -> v3: - refresh lcitool after removing libibumad v1 -> v2: - remove libibumad from tests/lcitool/projects/qemu.yml v1: - remove libibumad dependence Zhenwei Pi (2): meson: Remove libibumad dependence test: Remove libibumad dependence meson

[PATCH v3 1/2] meson: Remove libibumad dependence

2024-06-11 Thread zhenwei pi
e Mathieu-Daudé Signed-off-by: zhenwei pi --- meson.build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meson.build b/meson.build index ec59effca2..226b97ea26 100644 --- a/meson.build +++ b/meson.build @@ -1885,11 +1885,9 @@ endif rdma = not_found if not get_option(&#

[PATCH v3 2/2] test: Remove libibumad dependence

2024-06-11 Thread zhenwei pi
Remove libibumad dependence from the test environment. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: zhenwei pi --- scripts/ci/setup/ubuntu/ubuntu-2204-aarch64.yaml | 1 - scripts/ci/setup/ubuntu/ubuntu-2204-s390x.yaml| 1 - tests/docker/dockerfiles/debian-amd64-cross.docker

Re: Re: [PATCH v11 02/10] block/raw: add persistent reservation in/out driver

2024-09-09 Thread zhenwei pi
On 9/10/24 04:18, Keith Busch wrote: On Mon, Sep 09, 2024 at 07:34:45PM +0800, Changqi Lu wrote: +static int coroutine_fn GRAPH_RDLOCK +raw_co_pr_register(BlockDriverState *bs, uint64_t old_key, + uint64_t new_key, BlockPrType type, + bool ptpl, bool ignore

[PATCH v2] qga: Introduce disk smart

2022-03-06 Thread zhenwei pi
smart log info. Introduce disk smart, and implement NVMe smart on linux. CC: Keith Busch Signed-off-by: zhenwei pi --- qga/commands-posix.c | 78 qga/qapi-schema.json | 50 +++- 2 files changed, 127 insertions(+), 1 deletion(-)

[PATCH v2 RESEND] qga: Introduce disk smart

2022-03-06 Thread zhenwei pi
smart log info. Introduce disk smart, and implement NVMe smart on linux. CC: Keith Busch Signed-off-by: zhenwei pi --- qga/commands-posix.c | 78 qga/qapi-schema.json | 50 +++- 2 files changed, 127 insertions(+), 1 deletion(-)

Re: Re: [PATCH] qga: Introduce disk smart

2022-03-06 Thread zhenwei pi
On 3/4/22 10:51 PM, Keith Busch wrote: On Fri, Mar 04, 2022 at 04:54:07PM +0800, zhenwei pi wrote: +smart->u.nvme.temperature = le16_to_cpu(log.temperature); The 'temperature' offset is not properly aligned, so I think you need to use an unaligned le accessor l

[PATCH v3] qga: Introduce disk smart

2022-03-07 Thread zhenwei pi
smart log info. Introduce disk smart, and implement NVMe smart on linux. Thanks to Keith and Marc-André. CC: Keith Busch Signed-off-by: zhenwei pi --- qga/commands-posix.c | 73 qga/qapi-schema.json | 53 +++- 2 files ch

[PATCH v3 0/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread zhenwei pi
. - Test sscanf return value by '(i == EOF)' (To Marc-André: name is declared as 'char name[64];', so we can't test '!name'). - Suggested by Marc-André, use 'int clk_tck = sysconf(_SC_CLK_TCK);' instead of hard code. v1: - Implement guest agent command

[PATCH v3 1/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread zhenwei pi
a/qga-qapi-types.h:948:28: error: expected member name or ';' after declaration specifiers GuestLinuxCpuStats linux; ~~ ^ :336:15: note: expanded from here Also add 'linux' into polluted_words. Signed-off-by: zhenwei pi --

[PATCH v4 2/2] qga: add command 'guest-get-cpustats'

2022-07-06 Thread zhenwei pi
ned-off-by: zhenwei pi --- qga/commands-posix.c | 89 qga/commands-win32.c | 6 +++ qga/qapi-schema.json | 81 3 files changed, 176 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index

[PATCH v4 0/2] qga: add command 'guest-get-cpustats'

2022-07-06 Thread zhenwei pi
;man proc', also add linux version infomation. - Test sscanf return value by '(i == EOF)' (To Marc-André: name is declared as 'char name[64];', so we can't test '!name'). - Suggested by Marc-André, use 'int clk_tck = sysconf(_SC_CLK_TCK);'

[PATCH v4 1/2] qapi: Avoid generating C identifier 'linux'

2022-07-06 Thread zhenwei pi
'linux' is not usable as identifier, because C compilers targeting Linux predefine it as a macro expanding to 1. Add it to @polluted_words. 'unix' is already there. Suggested-by: Markus Armbruster Reviewed-by: Marc-André Lureau Signed-off-by: zhenwei pi --- scripts/qapi

Re: Re: [PATCH v4 1/2] qapi: Avoid generating C identifier 'linux'

2022-07-06 Thread zhenwei pi
On 7/7/22 14:26, Markus Armbruster wrote: zhenwei pi writes: 'linux' is not usable as identifier, because C compilers targeting Linux predefine it as a macro expanding to 1. Add it to @polluted_words. 'unix' is already there. Suggested-by: Markus Armbruster Rev

[PATCH] monitor: Support specified vCPU registers

2022-07-19 Thread zhenwei pi
ses about 3ms; 'info register 12' uses about 150us. Signed-off-by: zhenwei pi --- hmp-commands-info.hx | 6 +++--- monitor/misc.c | 19 +++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 3ffa24bd6

Re: Re: [PATCH 3/3] virtio_balloon: Introduce memory recover

2022-05-24 Thread zhenwei pi
On 5/25/22 03:35, Sean Christopherson wrote: On Fri, May 20, 2022, zhenwei pi wrote: @@ -59,6 +60,12 @@ enum virtio_balloon_config_read { VIRTIO_BALLOON_CONFIG_READ_CMD_ID = 0, }; +/* the request body to commucate with host side */ +struct __virtio_balloon_recover

Re: Re: [PATCH v7 0/9] Introduce akcipher service for virtio-crypto

2022-05-26 Thread zhenwei pi
decoder crypto: Implement RSA algorithm by hogweed crypto: Implement RSA algorithm by gcrypt test/crypto: Add test suite for crypto akcipher tests/crypto: Add test suite for RSA keys Zhenwei Pi (3): virtio-crypto: header update crypto: Introduce akcipher crypto class crypto: In

Re: Re: [PATCH 3/3] virtio_balloon: Introduce memory recover

2022-05-26 Thread zhenwei pi
On 5/27/22 03:18, Michael S. Tsirkin wrote: On Fri, May 20, 2022 at 03:06:48PM +0800, zhenwei pi wrote: Introduce a new queue 'recover VQ', this allows guest to recover hardware corrupted page: Guest 5.MF -> 6.RVQ FE10.

Re: [PATCH 0/3] recover hardware corrupted page by virtio balloon

2022-05-26 Thread zhenwei pi
Hi, Andrew & Naoya I would appreciate it if you could give me any hint about the changes of memory/memory-failure! On 5/20/22 15:06, zhenwei pi wrote: Hi, I'm trying to recover hardware corrupted page by virtio balloon, the workflow of this feature like this: Guest

Re: Re: [PATCH 0/3] recover hardware corrupted page by virtio balloon

2022-05-26 Thread zhenwei pi
can't find obvious relationship between UE and CE. So from the point of my view, to fix the corrupted page for VM seems good enough. And yes, unpoisoning several pages does not help significantly, but it is still a chance to make the virtualization better. -- zhenwei pi

Introduce akcipher service for virtio-crypto

2022-05-27 Thread zhenwei pi
irtio-crypto. - Introduce akcipher class. - Introduce ASN1 decoder into QEMU. - Implement RSA backend by nettle/hogweed. Zhenwei Pi (1): crypto: Introduce RSA algorithm backends/cryptodev-builtin.c | 274 + backends/cryptodev-vhost-user.c | 34 +++- backends/crypto

[PATCH v8 1/1] crypto: Introduce RSA algorithm

2022-05-27 Thread zhenwei pi
a enc=pkcs1 >/tmp/enc.pub echo "Dec with priv key..." keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec cmp /tmp/data /tmp/dec echo "Verify with pub key..." keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1 Signed-off-by

Re: Re: [PATCH 2/3] mm/memory-failure.c: support reset PTE during unpoison

2022-05-29 Thread zhenwei pi
On 5/30/22 13:02, HORIGUCHI NAOYA(堀口 直也) wrote: On Fri, May 20, 2022 at 03:06:47PM +0800, zhenwei pi wrote: Origianlly, unpoison_memory() is only used by hwpoison-inject, and unpoisons a page which is poisoned by hwpoison-inject too. The kernel PTE entry has no change during software poison

Re: Re: [PATCH 0/3] recover hardware corrupted page by virtio balloon

2022-05-30 Thread zhenwei pi
On 5/30/22 15:41, David Hildenbrand wrote: On 27.05.22 08:32, zhenwei pi wrote: On 5/27/22 02:37, Peter Xu wrote: On Wed, May 25, 2022 at 01:16:34PM -0700, Jue Wang wrote: The hypervisor _must_ emulate poisons identified in guest physical address space (could be transported from the source

Re: Re: [PATCH 3/3] virtio_balloon: Introduce memory recover

2022-05-30 Thread zhenwei pi
unregister_memory_failure_notifier(&vb->memory_failure_nb); + cancel_work_sync(&vb->unpoison_memory_work); + } + Could we be leaking memory from the virtballoon_remove() path? Yes, I'll fix the possible memory leak here. Thanks a lot. -- zhenwei pi

Re: RE: [PATCH v8 1/1] crypto: Introduce RSA algorithm

2022-05-30 Thread zhenwei pi
On 5/30/22 21:31, Gonglei (Arei) wrote: -Original Message- From: zhenwei pi [mailto:pizhen...@bytedance.com] Sent: Friday, May 27, 2022 4:48 PM To: m...@redhat.com; Gonglei (Arei) Cc: qemu-devel@nongnu.org; virtualizat...@lists.linux-foundation.org; helei.si...@bytedance.com; berra

Re: RE: RE: [PATCH v8 1/1] crypto: Introduce RSA algorithm

2022-05-31 Thread zhenwei pi
On 5/31/22 20:08, Gonglei (Arei) wrote: -Original Message- From: zhenwei pi [mailto:pizhen...@bytedance.com] Sent: Tuesday, May 31, 2022 9:48 AM To: Gonglei (Arei) Cc: qemu-devel@nongnu.org; m...@redhat.com; virtualizat...@lists.linux-foundation.org; helei.si...@bytedance.com; berra

Re: Re: Re: [PATCH 0/3] recover hardware corrupted page by virtio balloon

2022-05-31 Thread zhenwei pi
On 5/31/22 12:08, Jue Wang wrote: On Mon, May 30, 2022 at 8:49 AM Peter Xu wrote: On Mon, May 30, 2022 at 07:33:35PM +0800, zhenwei pi wrote: A VM uses RAM of 2M huge page. Once a MCE(@HVAy in [HVAx,HVAz)) occurs, the 2M([HVAx,HVAz)) of hypervisor becomes unaccessible, but the guest poisons

Re: Re: [PATCH 0/3] recover hardware corrupted page by virtio balloon

2022-06-02 Thread zhenwei pi
On 6/1/22 15:59, David Hildenbrand wrote: On 01.06.22 04:17, zhenwei pi wrote: On 5/31/22 12:08, Jue Wang wrote: On Mon, May 30, 2022 at 8:49 AM Peter Xu wrote: On Mon, May 30, 2022 at 07:33:35PM +0800, zhenwei pi wrote: A VM uses RAM of 2M huge page. Once a MCE(@HVAy in [HVAx,HVAz

[PATCH v3 1/6] virtio-crypto: header update

2022-03-22 Thread zhenwei pi
Update header from linux, support akcipher service. Reviewed-by: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi --- .../standard-headers/linux/virtio_crypto.h| 82 ++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/include/standard-headers/linux

[PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-22 Thread zhenwei pi
hogweed tests/crypto: Add test suite for crypto akcipher Zhenwei Pi (3): virtio-crypto: header update crypto: Introduce akcipher crypto class virtio-crypto: Introduce RSA algorithm backends/cryptodev-builtin.c | 319 +++- backends/cryptodev-vhost-user.c |

[PATCH v3 3/6] crypto: Introduce akcipher crypto class

2022-03-22 Thread zhenwei pi
Support basic asymmetric operations: encrypt, decrypt, sign and verify. Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi --- crypto/akcipher.c | 78 + crypto/meson.build| 1 + include/crypto/akcipher.h | 139

[PATCH v3 2/6] crypto-akcipher: Introduce akcipher types to qapi

2022-03-22 Thread zhenwei pi
From: Lei He Introduce akcipher types, also include RSA & ECDSA related types. Signed-off-by: Lei He Signed-off-by: zhenwei pi --- qapi/crypto.json | 86 1 file changed, 86 insertions(+) diff --git a/qapi/crypto.json b/qapi/crypto.json i

[PATCH v3 6/6] virtio-crypto: Introduce RSA algorithm

2022-03-22 Thread zhenwei pi
There are two parts in this patch: 1, support akcipher service by cryptodev-builtin driver 2, virtio-crypto driver supports akcipher service Then virtio-crypto gets request from guest side, and forwards the request to builtin driver to handle it. Test with a guest linux: 1, The self-test framewor

[PATCH v3 4/6] crypto: Implement RSA algorithm by hogweed

2022-03-22 Thread zhenwei pi
From: Lei He Introduce ASN.1 decoder, and implement RSA algorithm by hogweed from nettle. Thus QEMU supports a 'real' RSA backend to handle request from guest side. It's important to test RSA offload case without OS & hardware requirement. Signed-off-by: lei he Signed

[PATCH v3 5/6] tests/crypto: Add test suite for crypto akcipher

2022-03-22 Thread zhenwei pi
From: Lei He Add unit test and benchmark test for crypto akcipher. Signed-off-by: lei he Signed-off-by: zhenwei pi --- tests/bench/benchmark-crypto-akcipher.c | 163 ++ tests/bench/meson.build | 6 + tests/bench/test_akcipher_keys.inc | 277 + tests/unit

Re: Re: [PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-23 Thread zhenwei pi
On 3/23/22 13:17, Eric Biggers wrote: On Wed, Mar 23, 2022 at 10:49:06AM +0800, zhenwei pi wrote: v2 -> v3: - Introduce akcipher types to qapi - Add test/benchmark suite for akcipher class - Seperate 'virtio_crypto: Support virtio crypto asym operation' into: - crypto: Intro

[RESEND 1/2] qga: Introduce NVMe disk bus type

2022-03-23 Thread zhenwei pi
"bus": 0, "unit": 0, "pci-controller": { "bus": 0, "slot": 22, "domain": 0, "function": 0 }, "dev": "/dev/nvme0n1", "tar

[RESEND 2/2] qga: Introduce disk smart

2022-03-23 Thread zhenwei pi
smart log info. Introduce disk smart, and implement NVMe smart on linux. Thanks to Keith and Marc-André. CC: Keith Busch Reviewed-by: Marc-André Lureau Signed-off-by: zhenwei pi --- qga/commands-posix.c | 73 qga/qapi-schema.json

[RESEND 0/2] Introduce NVMe type and Smart for qga

2022-03-23 Thread zhenwei pi
Introduce NVMe disk type for qga firstly, then support SMART in the response of command "guest-get-disks". Originally I sent the 2 patch separately, because the second patch is dependent on the first one. So resend them in a patchset. Zhenwei Pi (2): qga: Introduce NVMe disk bus

Re: Re: [RESEND 1/2] qga: Introduce NVMe disk bus type

2022-03-23 Thread zhenwei pi
On 3/23/22 18:53, Philippe Mathieu-Daudé wrote: On 23/3/22 11:19, zhenwei pi wrote: Assigning a NVMe disk by VFIO or emulating a NVMe controller by QEMU, a NVMe disk get exposed in guest side. Support NVMe disk bus type and implement posix version. Test PCI passthrough case: ~#virsh qemu

Re: Re: [PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-23 Thread zhenwei pi
On 3/23/22 20:36, Michael S. Tsirkin wrote: On Wed, Mar 23, 2022 at 10:49:06AM +0800, zhenwei pi wrote: v2 -> v3: - Introduce akcipher types to qapi - Add test/benchmark suite for akcipher class - Seperate 'virtio_crypto: Support virtio crypto asym operation' into: - cryp

Re: Re: [PATCH v3 1/6] virtio-crypto: header update

2022-03-23 Thread zhenwei pi
On 3/23/22 23:38, Daniel P. Berrangé wrote: On Wed, Mar 23, 2022 at 10:49:07AM +0800, zhenwei pi wrote: Update header from linux, support akcipher service. I'm assuming this is updated for *non-merged* Linux headers, since I don't see these changes present in current linux.git

Re: Re: Re: [PATCH v3 0/6] Support akcipher for virtio-crypto

2022-03-23 Thread zhenwei pi
On 3/24/22 02:03, Eric Biggers wrote: On Wed, Mar 23, 2022 at 03:32:37PM +0800, zhenwei pi wrote: On 3/23/22 13:17, Eric Biggers wrote: On Wed, Mar 23, 2022 at 10:49:06AM +0800, zhenwei pi wrote: v2 -> v3: - Introduce akcipher types to qapi - Add test/benchmark suite for akcipher cl

[PATCH v4 0/8] Introduce akcipher service for virtio-crypto

2022-04-11 Thread zhenwei pi
- Implement RSA backend by nettle/hogweed. Lei He (4): crypto-akcipher: Introduce akcipher types to qapi crypto: add ASN.1 decoder crypto: Implement RSA algorithm by hogweed crypto: Implement RSA algorithm by gcrypt Zhenwei Pi (3): virtio-crypto: header update crypto: Introduce akc

[PATCH v4 1/8] virtio-crypto: header update

2022-04-11 Thread zhenwei pi
Update header from linux, support akcipher service. Reviewed-by: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi --- .../standard-headers/linux/virtio_crypto.h| 82 ++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/include/standard-headers/linux

[PATCH v4 3/8] crypto: Introduce akcipher crypto class

2022-04-11 Thread zhenwei pi
Support basic asymmetric operations: encrypt, decrypt, sign and verify. Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi --- crypto/akcipher.c | 102 + crypto/akcipherpriv.h | 43 +++ crypto/meson.build| 1

[PATCH v4 2/8] crypto-akcipher: Introduce akcipher types to qapi

2022-04-11 Thread zhenwei pi
From: Lei He Introduce akcipher types, also include RSA related types. Signed-off-by: Lei He Signed-off-by: zhenwei pi --- qapi/crypto.json | 64 1 file changed, 64 insertions(+) diff --git a/qapi/crypto.json b/qapi/crypto.json index

[PATCH v4 4/8] crypto: add ASN.1 decoder

2022-04-11 Thread zhenwei pi
From: Lei He Add an ANS.1 decoder which is used to parse asymmetric cipher keys Signed-off-by: zhenwei pi Signed-off-by: Lei He --- crypto/asn1_decoder.c | 161 ++ crypto/asn1_decoder.h | 75 +++ crypto/meson.build| 1

[PATCH v4 8/8] crypto: Introduce RSA algorithm

2022-04-11 Thread zhenwei pi
a enc=pkcs1 >/tmp/enc.pub echo "Dec with priv key..." keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec cmp /tmp/data /tmp/dec echo "Verify with pub key..." keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1 Signed-off-by

[PATCH v4 5/8] crypto: Implement RSA algorithm by hogweed

2022-04-11 Thread zhenwei pi
From: Lei He Implement RSA algorithm by hogweed from nettle. Thus QEMU supports a 'real' RSA backend to handle request from guest side. It's important to test RSA offload case without OS & hardware requirement. Signed-off-by: Lei He Signed-off-by: zhenwei pi --- crypto/ak

[PATCH v4 6/8] crypto: Implement RSA algorithm by gcrypt

2022-04-11 Thread zhenwei pi
From: Lei He Added gcryt implementation of RSA algorithm, RSA algorithm implemented by gcrypt has a higher priority than nettle because it supports raw padding. Signed-off-by: Lei He --- crypto/akcipher-gcrypt.c.inc | 531 +++ crypto/akcipher.c| 4

[PATCH v4 7/8] tests/crypto: Add test suite for crypto akcipher

2022-04-11 Thread zhenwei pi
From: lei he Add unit test and benchmark test for crypto akcipher. Signed-off-by: lei he Signed-off-by: zhenwei pi --- tests/bench/benchmark-crypto-akcipher.c | 161 ++ tests/bench/meson.build | 4 + tests/bench/test_akcipher_keys.inc | 537

Re: Re: [PATCH v4 0/8] Introduce akcipher service for virtio-crypto

2022-04-12 Thread zhenwei pi
that virtio-crypto could also provide the functionality of an HSM?  Or does the standard require that the keys are provided by the guest? Paolo I'm very interested in this, I'll try in Q3-2022 or later. -- zhenwei pi

PING: Re: [PATCH v4 1/1] monitor: Support specified vCPU registers

2022-09-06 Thread zhenwei pi
PING! On 8/15/22 20:00, Dr. David Alan Gilbert wrote: * zhenwei pi (pizhen...@bytedance.com) wrote: Originally we have to get all the vCPU registers and parse the specified one. To improve the performance of this usage, allow user specified vCPU id to query registers. Run a VM with 16 vCPU

[PATCH v2 0/2] qga: Support NVMe disk type and SMART

2022-04-19 Thread zhenwei pi
v1 -> v2: - Update version from 7.0 to 7.1. v1: - Introduce NVMe type for command 'guest-get-disks'. - Introduce SMART, and implement NVMe SMART for command 'guest-get-disks'. Zhenwei Pi (2): qga: Introduce NVMe disk bus type qga: Introduce disk smart qg

[PATCH v2 1/2] qga: Introduce NVMe disk bus type

2022-04-19 Thread zhenwei pi
"bus": 0, "unit": 0, "pci-controller": { "bus": 0, "slot": 22, "domain": 0, "function": 0 }, "dev": "/dev/nvme0n1", "target&q

[PATCH v2 2/2] qga: Introduce disk smart

2022-04-19 Thread zhenwei pi
smart log info. Introduce disk smart, and implement NVMe smart on linux. Thanks to Keith and Marc-André. CC: Keith Busch Reviewed-by: Marc-André Lureau Signed-off-by: zhenwei pi --- qga/commands-posix.c | 73 qga/qapi-schema.json

[PATCH] KVM: HWPoison: Fix memory address&size during remap

2022-04-19 Thread zhenwei pi
stead. Finally poisoning/unpoisoning a page gets static in kvm-all.c, Signed-off-by: zhenwei pi --- accel/kvm/kvm-all.c | 47 ++-- include/sysemu/kvm_int.h | 12 -- target/arm/kvm64.c | 1 - target/i386/kvm/kvm.c| 1 - 4 files change

PING: [PATCH v4 0/8] Introduce akcipher service for virtio-crypto

2022-04-20 Thread zhenwei pi
Hi Daniel, Could you please review this series? On 4/11/22 18:43, zhenwei pi wrote: v3 -> v4: - Coding style fix: Akcipher -> AkCipher, struct XXX -> XXX, Rsa -> RSA, XXX-alg -> XXX-algo. - Change version info in qapi/crypto.json, from 7.0 -> 7.1. - Remove ecdsa from qapi/cry

PING: [PATCH v2 0/2] qga: Support NVMe disk type and SMART

2022-04-26 Thread zhenwei pi
Hi, Markus & Michael Could you please give any hint about this patch? On 4/20/22 10:26, zhenwei pi wrote: v1 -> v2: - Update version from 7.0 to 7.1. v1: - Introduce NVMe type for command 'guest-get-disks'. - Introduce SMART, and implement NVMe SMART for command

PING: [PATCH] KVM: HWPoison: Fix memory address&size during remap

2022-04-26 Thread zhenwei pi
Hi, Paolo & Peter Could you please review this patch? On 4/20/22 14:45, zhenwei pi wrote: qemu exits during reset with log: qemu-system-x86_64: Could not remap addr: 1000@22001000 Currently, after MCE on RAM of a guest, qemu records a ram_addr only, remaps this address with a fixed

PING: [PATCH v2 0/5] Misc fixes for throttle

2023-07-10 Thread zhenwei pi
Hi, This series has been reviewed by Alberto, can someone review / merge this? On 6/27/23 15:24, zhenwei pi wrote: v1 -> v2: - rename 'ThrottleTimerType' to 'ThrottleType' - add assertion to throttle_schedule_timer Something remained: - 'bool is_write' is n

[PATCH v3 0/6] Misc fixes for throttle

2023-07-12 Thread zhenwei pi
TimerType instead of timers[0], timer[1]... - support read-only and write-only for throttle - adapt related test codes - cryptodev uses a write-only throttle timer Zhenwei Pi (6): throttle: introduce enum ThrottleType test-throttle: use enum ThrottleType throttle: support read-only and wri

[PATCH v3 6/6] throttle: use enum ThrottleType instead of bool is_write

2023-07-12 Thread zhenwei pi
enum ThrottleType is already there, use ThrottleType instead of 'bool is_write' for throttle API, also modify related codes from block, fsdev, cryptodev and tests. Signed-off-by: zhenwei pi --- backends/cryptodev.c| 9 + block/throttle-groups.c | 6 -- fsdev/

[PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction

2023-07-12 Thread zhenwei pi
Operations on a crytpodev are considered as *write* only, the callback of read direction is never invoked. Use NULL instead of an unreachable path(cryptodev_backend_throttle_timer_cb on read direction). Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- backends/cryptodev.c | 3 +-- 1

[PATCH v3 2/6] test-throttle: use enum ThrottleType

2023-07-12 Thread zhenwei pi
Use enum ThrottleType instead in the throttle test codes. Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index 7adb5e6652

[PATCH v3 1/6] throttle: introduce enum ThrottleType

2023-07-12 Thread zhenwei pi
Use enum ThrottleType instead of number index. Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- include/qemu/throttle.h | 11 --- util/throttle.c | 16 +--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/qemu/throttle.h b/include

[PATCH v3 4/6] test-throttle: test read only and write only

2023-07-12 Thread zhenwei pi
Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 66 ++ 1 file changed, 66 insertions(+) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index a60b5fe22e..5547837a58 100644 --- a/tests/unit/test

[PATCH v3 3/6] throttle: support read-only and write-only

2023-07-12 Thread zhenwei pi
direction in throttle, this reduces memory, and uplayer does not need a dummy callback any more. Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- util/throttle.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/util/throttle.c b/util

Re: [PATCH] cryptodev: Handle unexpected request to avoid crash

2023-06-24 Thread zhenwei pi
Hi Michael Could you please apply this patch? On 5/26/23 11:38, Lei He wrote: On Apr 27, 2023, at 16:05, zhenwei pi wrote: Generally guest side should discover which services the device is able to offer, then do requests on device. However it's also possible to break this rule in a

[PATCH 0/5] Misc fixes for throttle

2023-06-25 Thread zhenwei pi
Hi, v1: - introduce enum ThrottleTimerType instead of timers[0], timer[1]... - support read-only and write-only for throttle - adapt related test codes - cryptodev uses a write-only throttle timer Zhenwei Pi (5): throttle: introduce enum ThrottleTimerType test-throttle: use enum

[PATCH 3/5] throttle: support read-only and write-only

2023-06-25 Thread zhenwei pi
direction in throttle, this reduces memory, and uplayer does not need a dummy callback any more. Signed-off-by: zhenwei pi --- util/throttle.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/util/throttle.c b/util/throttle.c index c1cc24831c..01faee783c

[PATCH 4/5] test-throttle: test read only and write only

2023-06-25 Thread zhenwei pi
Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 66 ++ 1 file changed, 66 insertions(+) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index 5fc2de4d47..d7973980d1 100644 --- a/tests/unit/test-throttle.c +++ b/tests/unit/test

[PATCH 1/5] throttle: introduce enum ThrottleTimerType

2023-06-25 Thread zhenwei pi
Use enum ThrottleTimerType instead of number index. Signed-off-by: zhenwei pi --- include/qemu/throttle.h | 12 +--- util/throttle.c | 16 +--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index

[PATCH 5/5] cryptodev: use NULL throttle timer cb for read direction

2023-06-25 Thread zhenwei pi
Operations on a crytpodev are considered as *write* only, the callback of read direction is never invoked. Use NULL instead of an unreachable path(cryptodev_backend_throttle_timer_cb on read direction). Signed-off-by: zhenwei pi --- backends/cryptodev.c | 3 +-- 1 file changed, 1 insertion

[PATCH 2/5] test-throttle: use enum ThrottleTimerType

2023-06-25 Thread zhenwei pi
Use enum ThrottleTimerType instead in the throttle test codes. Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index 7adb5e6652..5fc2de4d47 100644 --- a

Re: Re: [PATCH 1/5] throttle: introduce enum ThrottleTimerType

2023-06-26 Thread zhenwei pi
On 6/27/23 05:24, Alberto Garcia wrote: On Sun 25 Jun 2023 04:56:27 PM +08, zhenwei pi wrote: Use enum ThrottleTimerType instead of number index. +typedef enum { +THROTTLE_TIMER_READ = 0, +THROTTLE_TIMER_WRITE, +THROTTLE_TIMER_MAX +} ThrottleTimerType; If you're doing t

Re: Re: [PATCH 3/5] throttle: support read-only and write-only

2023-06-26 Thread zhenwei pi
On 6/27/23 05:38, Alberto Garcia wrote: On Sun 25 Jun 2023 04:56:29 PM +08, zhenwei pi wrote: void throttle_timers_attach_aio_context(ThrottleTimers *tt, AioContext *new_context) { -tt->timers[THROTTLE_TIMER_READ] = -aio_timer_

<    1   2   3   4   >