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

2022-07-03 Thread zhenwei pi
sion 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);' instead of hard code. v1: - Imple

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

2022-07-04 Thread zhenwei pi
On 7/4/22 15:28, Marc-André Lureau wrote: Hi On Mon, Jul 4, 2022 at 6:42 AM zhenwei pi <mailto:pizhen...@bytedance.com>> wrote: A vCPU thread always reaches 100% utilization when: - guest uses idle=poll - disable HLT vm-exit - enable MWAIT Add new guest agen

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

2022-07-05 Thread zhenwei pi
On 7/4/22 16:00, zhenwei pi wrote:     +##     +# @GuestOsType:     +#     +# An enumeration of OS type     +#     +# Since: 7.1     +##     +{ 'enum': 'GuestOsType',     +  'data': [ 'linuxos', 'windowsos' ] } I wou

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

2022-07-06 Thread zhenwei pi
On 7/6/22 15:20, Marc-André Lureau wrote: Hi On Wed, Jul 6, 2022 at 7:09 AM zhenwei pi <mailto:pizhen...@bytedance.com>> wrote: On 7/4/22 16:00, zhenwei pi wrote: > > >>     +## >>     +# @GuestOsType: >>     +# &g

[PATCH] cryptodev: Handle unexpected request to avoid crash

2023-04-27 Thread zhenwei pi
7;) Cc: Gonglei Cc: Mauro Matteo Cascella Cc: Xiao Lei Cc: Yongkang Jia Reported-by: Yiming Tao Signed-off-by: zhenwei pi --- backends/cryptodev.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 94ca393cee..d3fe92d8c0 100644

Re: Re: [PULL 11/73] cryptodev: Support query-stats QMP command

2023-05-02 Thread zhenwei pi
On 5/3/23 01:03, Peter Maydell wrote: On Wed, 8 Mar 2023 at 01:11, Michael S. Tsirkin wrote: From: zhenwei pi Now we can use "query-stats" QMP command to query statistics of crypto devices. (Originally this was designed to show statistics by '{"execute": &q

[PATCH] cryptodev: fix memory leak during stats query

2023-05-03 Thread zhenwei pi
object_get_canonical_path already returns newly allocated memory, this means no additional g_strdup required. Remove g_strdup to avoid memory leak. Fixes: Coverity CID 1508074 Fixes: f2b901098 ("cryptodev: Support query-stats QMP command") Cc: Peter Maydell Signed-off-by:

Re: Re: [PATCH] cryptodev: fix memory leak during stats query

2023-05-26 Thread zhenwei pi
On 5/3/23 20:59, Peter Maydell wrote: On Wed, 3 May 2023 at 12:54, zhenwei pi wrote: object_get_canonical_path already returns newly allocated memory, this means no additional g_strdup required. Remove g_strdup to avoid memory leak. Fixes: Coverity CID 1508074 Fixes: f2b901098 ("cryp

[PATCH 2/2] qga/commands-posix: Support NVMe disk type

2022-03-02 Thread zhenwei pi
ot;address": { "serial": "SAMSUNG MZQL23T8HCLS-00A07_S64HNE0N500076", "bus-type": "nvme", "bus": 0, "unit": 0, "pci-controller": { "bus": 0, "slot&

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

2022-03-02 Thread zhenwei pi
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 for QAPI. Signed-off-by: zhenwei pi --- qga/qapi-schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qga/qapi-schema.json b/qga

[PATCH 0/2] QAPI: Support NVMe disk type

2022-03-02 Thread zhenwei pi
- Introduce NVMe disk type - Support NVMe disk type for posix Zhenwei Pi (2): qapi: Introduce NVMe disk bus type qga/commands-posix: Support NVMe disk type qga/commands-posix.c | 5 - qga/qapi-schema.json | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.20.1

[RESEND] qga: Introduce NVMe disk bus type

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

[PATCH v2] qga: Introduce NVMe disk bus type

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

[PATCH] qga: Introduce disk smart

2022-03-04 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 | 77 qga/qapi-schema.json | 50 +++- 2 files changed, 126 insertions(+), 1 deletion(-)

[PATCH 1/3] virtio-crypto: header update

2022-01-20 Thread zhenwei pi
Update header from linux, support akcipher service. Signed-off-by: lei he Signed-off-by: zhenwei pi --- .../standard-headers/linux/virtio_crypto.h| 98 +-- 1 file changed, 89 insertions(+), 9 deletions(-) diff --git a/include/standard-headers/linux/virtio_crypto.h b

[PATCH 0/3] Support akcipher for virtio-crypto

2022-01-20 Thread zhenwei pi
- Support akcipher for virtio-crypto. - Introduce akcipher class. - Introduce ASN1 decoder into QEMU. - Implement RSA backend by nettle/hogweed. Lei He (1): crypto: Introduce RSA algorithm Zhenwei Pi (2): virtio-crypto: header update virtio_crypto: Support virtio crypto asym operation

[PATCH 2/3] virtio_crypto: Support virtio crypto asym operation

2022-01-20 Thread zhenwei pi
can provide asymmetric support for guest, but the asymmetric request from guest shoule always fail until an available asymmetric backend gets supported. Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 201 ++ back

[PATCH 3/3] crypto: Introduce RSA algorithm

2022-01-20 Thread zhenwei pi
tmp/data 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 v5 1/9] virtio-crypto: header update

2022-05-12 Thread zhenwei pi
: Add test suite for crypto akcipher Fixed the issues you pointed out. Do you have suggestions about the other patches? Or I'll send the v6 series? On 5/12/22 17:55, Daniel P. Berrangé wrote: On Thu, Apr 28, 2022 at 09:59:35PM +0800, zhenwei pi wrote: Update header from linux, support a

[PATCH v6 3/9] crypto: Introduce akcipher crypto class

2022-05-13 Thread zhenwei pi
ned-off-by: zhenwei pi Reviewed-by: Daniel P. Berrangé --- crypto/akcipher.c | 102 crypto/akcipherpriv.h | 55 + crypto/meson.build| 1 + include/crypto/akcipher.h | 158 ++ 4 files changed, 316 insertions(

[PATCH v6 2/9] qapi: crypto-akcipher: Introduce akcipher types to qapi

2022-05-13 Thread zhenwei pi
From: Lei He Introduce akcipher types, also include RSA related types. Reviewed-by: Daniel P. Berrangé 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

[PATCH v6 4/9] crypto: add ASN.1 DER decoder

2022-05-13 Thread zhenwei pi
From: Lei He Add an ANS.1 DER decoder which is used to parse asymmetric cipher keys Signed-off-by: zhenwei pi Signed-off-by: lei he --- crypto/der.c | 189 +++ crypto/der.h | 81 ++ crypto/meson.build | 1 + tests/unit

[PATCH v6 0/9] Introduce akcipher service for virtio-crypto

2022-05-13 Thread zhenwei pi
duce ASN1 decoder into QEMU. - Implement RSA backend by nettle/hogweed. Lei He (6): qapi: crypto-akcipher: Introduce akcipher types to qapi crypto: add ASN.1 DER decoder crypto: Implement RSA algorithm by hogweed crypto: Implement RSA algorithm by gcrypt test/crypto: Add test suite for cry

[PATCH v6 1/9] virtio-crypto: header update

2022-05-13 Thread zhenwei pi
Update header from linux, support akcipher service. Reviewed-by: Daniel P. Berrangé 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

[PATCH v6 7/9] test/crypto: Add test suite for crypto akcipher

2022-05-13 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 Reviewed-by: Daniel P. Berrangé --- tests/bench/benchmark-crypto-akcipher.c | 157 ++ tests/bench/meson.build | 1 + tests/bench/test_akcipher_keys.inc

[PATCH v6 6/9] crypto: Implement RSA algorithm by gcrypt

2022-05-13 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: zhenwei pi Signed-off-by: lei he --- crypto/akcipher-gcrypt.c.inc | 597 +++ crypto

[PATCH v6 8/9] tests/crypto: Add test suite for RSA keys

2022-05-13 Thread zhenwei pi
From: Lei He As Daniel suggested, Add tests suite for rsakey, as a way to prove that we can handle DER errors correctly. Signed-off-by: zhenwei pi Signed-off-by: lei he Reviewed-by: Daniel P. Berrangé --- tests/unit/test-crypto-akcipher.c | 285 +- 1 file changed

[PATCH v6 5/9] crypto: Implement RSA algorithm by hogweed

2022-05-13 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 v6 9/9] crypto: Introduce RSA algorithm

2022-05-13 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 0/3] recover hardware corrupted page by virtio balloon

2022-05-20 Thread zhenwei pi
her host, the corrupted pages are actually recovered, once the guest gets the 'corrupted_pages' with 0, then the guest could unpoison all the poisoned pages which are recorded in the balloon driver. zhenwei pi (3): memory-failure: Introduce memory failure notifier mm/memor

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

2022-05-20 Thread zhenwei pi
ep_new_page. So add 'bool reset_kpte' to get a change to fix the PTE entry if the page is fixed by hypervisor. Signed-off-by: zhenwei pi --- include/linux/mm.h | 2 +- mm/hwpoison-inject.c | 2 +- mm/memory-failure.c | 26 +++--- 3 files changed, 21 insertions

[PATCH 1/3] memory-failure: Introduce memory failure notifier

2022-05-20 Thread zhenwei pi
Introduce memory failure notifier, once hardware memory failure occurs, after the kernel handles the corrupted page successfully, someone who registered this chain gets noticed of the corrupted PFN. Signed-off-by: zhenwei pi --- include/linux/mm.h | 2 ++ mm/memory-failure.c | 33

[PATCH 3/3] virtio_balloon: Introduce memory recover

2022-05-20 Thread zhenwei pi
ry corruption fault at 7f5be2e5a010 The 'HardwareCorrupted' in /proc/meminfo also shows 0 kB. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 243 include/uapi/linux/virtio_balloon.h | 16 ++ 2 files changed, 259 insertions(+) diff

Re: Re: [PATCH 0/5] Introduce camera subsystem and USB video device

2022-01-04 Thread zhenwei pi
On 1/4/22 9:39 PM, Daniel P. Berrangé wrote: On Mon, Dec 27, 2021 at 10:27:29PM +0800, zhenwei pi wrote: 1, The full picture of this patch set: +-+ ++ +---+ |UVC(done)| |virtio(TODO)| |other HW device

Re: Re: [PATCH 4/5] usb: allow max 8192 bytes for desc

2022-01-04 Thread zhenwei pi
On 1/4/22 11:22 PM, Philippe Mathieu-Daudé wrote: On 27/12/21 15:27, zhenwei pi wrote: A device of USB video class usually uses larger desc structure, so use larger buffer to avoid failure. Signed-off-by: zhenwei pi ---   hw/usb/desc.c | 15 ---   hw/usb/desc.h |  1 +   2 files

[PATCH v2 0/2] Introduce camera subsystem

2022-01-06 Thread zhenwei pi
ers| +-+ +--++-+ With this patch set, We can run a desktop VM (Ex Ubuntu-2004), several camera APPs(cheese, kamoso, guvcview and qcam) work fine. Some works still in working: 1, hot-plug 2, compat with live migration 3, several actions defined in UVC SPEC Zhenwei Pi (2): camera: Introduce cam

[PATCH v2 1/2] camera: Introduce camera subsystem and builtin driver

2022-01-06 Thread zhenwei pi
mera +-+ ++---+ | +-+-+ | | | +---+---+ +-+-++-+ |builtin| |v4l2(ready)||other drivers| +---+ +---++-+ Signed-off-by: zhenwei pi --- MAINTAINERS | 7 + camera/builtin.c| 717 camera/camera-int.h |

[PATCH v2 2/2] camera: v4l2: Introduce v4l2 camera driver

2022-01-06 Thread zhenwei pi
--info -d /dev/video0 ... Device Caps : 0x0421 Video Capture ... The basic logic of v4l2 driver: stream on -> qbuf -> dqbuf(drive by POLLIN event) -> qbuf -> dqbuf ... -> stream off Signed-off-by: zhenwei pi --- camera/meson.build | 4 + camera/tra

Re: [PATCH v2 0/2] Introduce camera subsystem

2022-01-09 Thread zhenwei pi
Hi, Peter & Daniel Sorry about that I'm not clear enough to add a new subsystem into QEMU, could you give me more hint? On 1/6/22 4:53 PM, zhenwei pi wrote: v1 -> v2: [missing CC qemu-devel@nongnu.org, resend] Separate v1 patch set into 2 parts: Introduce camera sub

[PATCH] usb: allow max 8192 bytes for desc

2022-01-11 Thread zhenwei pi
stack gets no change. CC: Philippe Mathieu-Daudé Signed-off-by: zhenwei pi --- hw/usb/desc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 8b6eaea407..57d2aedba1 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -632,7 +632,7 @@ int

Re: Re: [PATCH] usb: allow max 8192 bytes for desc

2022-01-11 Thread zhenwei pi
On 1/11/22 8:25 PM, Daniel P. Berrangé wrote: On Tue, Jan 11, 2022 at 12:21:42PM +, Peter Maydell wrote: On Tue, 11 Jan 2022 at 10:54, zhenwei pi wrote: A device of USB video class usually uses larger desc structure, so use larger buffer to avoid failure. (dev-video.c is ready

Re: Re: Re: [PATCH] usb: allow max 8192 bytes for desc

2022-01-11 Thread zhenwei pi
On 1/11/22 8:38 PM, Daniel P. Berrangé wrote: On Tue, Jan 11, 2022 at 08:27:35PM +0800, zhenwei pi wrote: On 1/11/22 8:25 PM, Daniel P. Berrangé wrote: On Tue, Jan 11, 2022 at 12:21:42PM +, Peter Maydell wrote: On Tue, 11 Jan 2022 at 10:54, zhenwei pi wrote: A device of USB video

[PATCH v2] usb: allow max 8192 bytes for desc

2022-01-11 Thread zhenwei pi
: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: zhenwei pi --- hw/usb/desc.c | 15 --- hw/usb/desc.h | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 8b6eaea407..7f6cc2f99b 100644 --- a/hw/usb/desc.c ++

[PATCH v2 2/3] virtio_crypto: Support virtio crypto asym operation

2022-02-11 Thread zhenwei pi
can provide asymmetric support for guest, but the asymmetric request from guest shoule always fail until an available asymmetric backend gets supported. Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 201 ++ back

[PATCH v2 1/3] virtio-crypto: header update

2022-02-11 Thread zhenwei pi
Update header from linux, support akcipher service. 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/virtio_crypto.h b

[PATCH v2 3/3] crypto: Introduce RSA algorithm

2022-02-11 Thread zhenwei pi
tmp/data 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 v2 0/3] Support akcipher for virtio-crypto

2022-02-11 Thread zhenwei pi
v1 -> v2: - Update virtio_crypto.h from v2 version of related kernel patch. v1: - Support akcipher for virtio-crypto. - Introduce akcipher class. - Introduce ASN1 decoder into QEMU. - Implement RSA backend by nettle/hogweed. Lei He (1): crypto: Introduce RSA algorithm Zhenwei Pi (2): vir

[PATCH 2/2] hw/misc/pvpanic: Use standard headers instead

2022-02-21 Thread zhenwei pi
QEMU side has already imported pvpanic.h from linux, remove bit definitions from include/hw/misc/pvpanic.h, and use include/standard-headers/linux/pvpanic.h instead. Also minor changes for PVPANIC_CRASHLOADED -> PVPANIC_CRASH_LOADED. Signed-off-by: zhenwei pi --- hw/misc/pvpanic-isa.c

[PATCH 1/2] headers: Add pvpanic.h

2022-02-21 Thread zhenwei pi
Since 2020, linux kernel started to export pvpanic.h. Import the latest version from linux into QEMU. Signed-off-by: zhenwei pi --- include/standard-headers/linux/pvpanic.h | 9 + scripts/update-linux-headers.sh | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create

[PATCH v5 1/9] virtio-crypto: header update

2022-04-28 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 v5 0/9] Introduce akcipher service for virtio-crypto

2022-04-28 Thread zhenwei pi
y 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: Introduce RSA algorithm backends/cryptodev-buil

[PATCH v5 2/9] qapi: crypto-akcipher: Introduce akcipher types to qapi

2022-04-28 Thread zhenwei pi
From: Lei He Introduce akcipher types, also include RSA related types. Reviewed-by: Daniel P. Berrangé 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

[PATCH v5 6/9] crypto: Implement RSA algorithm by gcrypt

2022-04-28 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 | 520 +++ crypto/akcipher.c| 4

[PATCH v5 3/9] crypto: Introduce akcipher crypto class

2022-04-28 Thread zhenwei pi
ned-off-by: zhenwei pi --- crypto/akcipher.c | 102 crypto/akcipherpriv.h | 55 + crypto/meson.build| 1 + include/crypto/akcipher.h | 158 ++ 4 files changed, 316 insertions(+) create mode 100644 crypto/

[PATCH v5 4/9] crypto: add ASN.1 DER decoder

2022-04-28 Thread zhenwei pi
From: Lei He Add an ANS.1 DER decoder which is used to parse asymmetric cipher keys Signed-off-by: zhenwei pi Signed-off-by: lei he --- crypto/der.c | 190 +++ crypto/der.h | 82 ++ crypto/meson.build | 1 + tests/unit

[PATCH v5 7/9] test/crypto: Add test suite for crypto akcipher

2022-04-28 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 Reviewed-by: Daniel P. Berrangé --- tests/bench/benchmark-crypto-akcipher.c | 157 ++ tests/bench/meson.build | 4 + tests/bench/test_akcipher_keys.inc

[PATCH v5 5/9] crypto: Implement RSA algorithm by hogweed

2022-04-28 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 v5 8/9] tests/crypto: Add test suite for RSA keys

2022-04-28 Thread zhenwei pi
From: Lei He As Daniel suggested, Add tests suite for rsakey, as a way to prove that we can handle DER errors correctly. Signed-off-by: lei he --- tests/unit/test-crypto-akcipher.c | 285 +- 1 file changed, 282 insertions(+), 3 deletions(-) diff --git a/tests/unit/

[PATCH v5 9/9] crypto: Introduce RSA algorithm

2022-04-28 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

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

2022-05-04 Thread zhenwei pi
Hi, Paolo I would appreciate it if you could review 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 size

Re: [PATCH] hw/nvme: fix smart aen

2022-05-06 Thread zhenwei pi
nvme_smart_event(n, NVME_SMART_TEMPERATURE); } break; It looks good to me. Acked-by: zhenwei pi -- zhenwei pi

[PATCH 0/2] hw/nvme: support smart AEN

2022-05-07 Thread zhenwei pi
, works fine. Zhenwei Pi (2): hw/nvme: introduce smart bits of aen cfg hw/nvme: support smart AEN hw/nvme/ctrl.c | 9 - include/block/nvme.h | 8 +++- 2 files changed, 15 insertions(+), 2 deletions(-) -- 2.20.1

[PATCH 1/2] hw/nvme: introduce smart bits of aen cfg

2022-05-07 Thread zhenwei pi
According to NVM Express v1.4, Section 5.21.1.11 (Asynchronous Event Configuration), introduce bit 0 ~ bit 5. Signed-off-by: zhenwei pi --- include/block/nvme.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/block/nvme.h b/include/block/nvme.h index

[PATCH 2/2] hw/nvme: support smart AEN

2022-05-07 Thread zhenwei pi
ot;: "/machine/peripheral/nvme0", "property": "smart_critical_warning", "value":1 } }' Signed-off-by: zhenwei pi --- hw/nvme/ctrl.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 03760ddeae..823

PING: [PATCH v5 9/9] crypto: Introduce RSA algorithm

2022-05-08 Thread zhenwei pi
Hi, Lei I would appreciate it if you could review this patch! On 4/28/22 21:59, zhenwei pi wrote: There are two parts in this patch: 1, support akcipher service by cryptodev-builtin driver 2, virtio-crypto driver supports akcipher service In principle, we should separate this into two patches

Re: Re: [PATCH 0/2] hw/nvme: support smart AEN

2022-05-09 Thread zhenwei pi
On 5/9/22 19:12, Klaus Jensen wrote: On May 7 15:26, zhenwei pi wrote: Hi, In this series, firstly introduce smart related bits of aen cfg, then support this in oaes. Linux guest does not support this currently, I also send a series to enable smart AEN: https://lore.kernel.org/lkml

[PATCH for 8.0 3/8] cryptodev: Introduce cryptodev alg type in QAPI

2022-11-10 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. Signed-off-by: zhenwei pi --- backends/cryptodev-builtin

[PATCH for 8.0 5/8] cryptodev: Introduce 'query-cryptodev' QMP command

2022-11-10 Thread zhenwei pi
ervice": [ "akcipher" ], "id": "cryptodev0", "client": [ { "queue": 0, "type": "lkcf", "info": "cryptodev-lkcf0" } ] }

[PATCH for 8.0 4/8] cryptodev: Introduce server type in QAPI

2022-11-10 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. Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c| 8 backends/cryptodev-lkcf.c | 2 +- backends

[PATCH for 8.0 8/8] hmp: add cryptodev info command

2022-11-10 Thread zhenwei pi
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: type=lkcf Signed-off-by: zhenwei pi --- hmp-commands-info.hx | 14 ++ include/monitor

[PATCH for 8.0 6/8] cryptodev: Support statistics

2022-11-10 Thread zhenwei pi
"akcipher" ], "asym-stat": { "encrypt-ops": 54, "verify-bytes": 8704, "sign-ops": 17, "verify-ops": 34, "sign-bytes": 340, "decrypt-bytes": 9215,

[PATCH for 8.0 7/8] cryptodev-builtin: Detect akcipher capability

2022-11-10 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. Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 25 + 1 file changed

[PATCH for 8.0 0/8] Refactor cryptodev

2022-11-10 Thread zhenwei pi
: detect akcipher capability instead of exposing akcipher service unconditionally. Zhenwei Pi (8): cryptodev: Introduce cryptodev.json cryptodev: Remove 'name' & 'model' fields cryptodev: Introduce cryptodev alg type in QAPI cryptodev: Introduce server type in QAP

[PATCH for 8.0 2/8] cryptodev: Remove 'name' & 'model' fields

2022-11-10 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. Signed-off-by: zhenwei pi --- backends/cryptodev-b

[PATCH for 8.0 1/8] cryptodev: Introduce cryptodev.json

2022-11-10 Thread zhenwei pi
Introduce QCryptodevBackendType in cryptodev.json, also apply this to related codes. Then we can drop 'enum CryptoDevBackendOptionsType'. Signed-off-by: zhenwei pi --- MAINTAINERS | 1 + backends/cryptodev-builtin.c| 2 +- backends/cryptodev-lkcf.c

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

2022-06-08 Thread zhenwei pi
Hi, Michael QEMU side was reviewed by Gonglei a week ago. To avoid this to be ignored, PING! 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

Re: Re: [PULL 54/54] crypto: Introduce RSA algorithm

2022-06-10 Thread zhenwei pi
On 6/11/22 02:05, Richard Henderson wrote: On 6/10/22 08:55, Philippe Mathieu-Daudé wrote: On 10/6/22 09:59, Michael S. Tsirkin wrote: From: zhenwei pi +static int cryptodev_builtin_set_rsa_options( +    int virtio_padding_algo, +    int virtio_hash_algo

[PATCH v9 0/1] Introduce akcipher service for virtio-crypto

2022-06-10 Thread zhenwei pi
akcipher class - Seperate 'virtio_crypto: Support virtio crypto asym operation' into: - crypto: Introduce akcipher crypto class - virtio-crypto: Introduce RSA algorithm v1 -> v2: - Update virtio_crypto.h from v2 version of related kernel patch. v1: - Support akcipher for virtio-crypto.

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

2022-06-10 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 In principle, we should separate this into two patches, to avoid compiling error, merge them into one. Then virtio-crypto gets request from guest side, and

[PATCH v10 0/1] Introduce akcipher service for virtio-crypto

2022-06-10 Thread zhenwei pi
el patch. v1: - Support akcipher for virtio-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 | 276 + backends/cryptodev-vho

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

2022-06-10 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 In principle, we should separate this into two patches, to avoid compiling error, merge them into one. Then virtio-crypto gets request from guest side, and

PING: [PATCH v4 00/12] Refactor cryptodev

2023-02-05 Thread zhenwei pi
Hi Michael Please correct me if I miss anything... On 1/29/23 10:57, zhenwei pi wrote: v4 -> v5: - suggested by MST, use 'PRIu32' instead of '%u' to print a uint32_t value - correct *QCryptodevBackendClient* and *QCryptodevInfo* in qapi/cryptodev.json v3 -> v4:

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

2023-02-28 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 v5 01/12] cryptodev: Introduce cryptodev.json

2023-02-28 Thread zhenwei pi
: Daniel P. Berrangé Signed-off-by: zhenwei pi --- MAINTAINERS | 1 + backends/cryptodev-builtin.c| 2 +- backends/cryptodev-lkcf.c | 2 +- backends/cryptodev-vhost-user.c | 4 ++-- backends/cryptodev-vhost.c | 4 ++-- include/sysemu/cryptodev.h |

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

2023-02-28 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 v5 10/12] cryptodev: support QoS

2023-02-28 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 Signed-off-by: zhenwei pi --- backends/cryptodev.c | 138 + includ

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

2023-02-28 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 v5 04/12] cryptodev: Introduce server type in QAPI

2023-02-28 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 v5 08/12] cryptodev: Use CryptoDevBackendOpInfo for operation

2023-02-28 Thread zhenwei pi
.c in the next step. (In theory, VirtIOCryptoReq is a private structure used by virtio-crypto only) Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 9 +++-- backends/cryptodev-lkcf.c| 9 +++-- backends/cryptodev.c | 18 +- hw/virtio/virtio-cry

[PATCH v5 12/12] MAINTAINERS: add myself as the maintainer for cryptodev

2023-02-28 Thread zhenwei pi
I developed the akcipher service, QoS setting, QMP/HMP commands and statistics accounting for crypto device. Making myself as the maintainer for QEMU's cryptodev. Cc: Gonglei Signed-off-by: zhenwei pi --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTA

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

2023-02-28 Thread zhenwei pi
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: type=lkcf Signed-off-by: zhenwei pi --- backends/cryptodev-hmp-cmds.c | 54

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

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

[PATCH v5 09/12] cryptodev: Account statistics

2023-02-28 Thread zhenwei pi
pto device. Signed-off-by: zhenwei pi --- backends/cryptodev.c | 68 +++--- include/sysemu/cryptodev.h | 31 + qapi/cryptodev.json| 54 ++ 3 files changed, 148 insertions(+), 5 deletions(-) diff --git

[PATCH v5 00/12] Refactor cryptodev

2023-02-28 Thread zhenwei pi
e declare, remove some virtio related dependence. - add statistics: OPS and bandwidth. - add QMP command: query-cryptodev - add HMP info command: cryptodev - misc fix: detect akcipher capability instead of exposing akcipher service unconditionally. Zhenwei Pi (12): cryptodev: Introduce cryptodev.j

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

2023-02-28 Thread zhenwei pi
ot;hash", "cipher" ], "id": "cryptodev1", "client": [ { "queue": 0, "type": "builtin" } ] }, { "service": [ "akcipher" ], &

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

2023-02-28 Thread zhenwei pi
, Michael S. Tsirkin wrote: On Sun, Jan 29, 2023 at 10:57:46AM +0800, zhenwei pi wrote: Now we can use "query-stats" QMP command to query statistics of crypto devices. (Originally this was designed to show statistics by '{"execute": "query-cryptodev"}'.

Re: Re: [PATCH v5 09/12] cryptodev: Account statistics

2023-03-01 Thread zhenwei pi
On 3/1/23 17:44, Daniel P. Berrangé wrote: On Wed, Mar 01, 2023 at 10:51:21AM +0800, zhenwei pi wrote: Account OPS/BPS for crypto device, this will be used for 'query-stats' QEMU monitor command and QoS in the next step. Note that a crypto device may support symmetric mode, asymm

[PATCH v6 00/12] Refactor cryptodev

2023-03-01 Thread zhenwei pi
y. - support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP command works fine. - add myself as the maintainer for cryptodev. v1: - introduce cryptodev.json to describe the attributes of crypto device, then drop duplicated type declare, remove some virtio relate

[PATCH v6 12/12] MAINTAINERS: add myself as the maintainer for cryptodev

2023-03-01 Thread zhenwei pi
I developed the akcipher service, QoS setting, QMP/HMP commands and statistics accounting for crypto device. Making myself as the maintainer for QEMU's cryptodev. Cc: Gonglei Signed-off-by: zhenwei pi --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTA

[PATCH v6 01/12] cryptodev: Introduce cryptodev.json

2023-03-01 Thread zhenwei pi
: Daniel P. Berrangé Signed-off-by: zhenwei pi --- MAINTAINERS | 1 + backends/cryptodev-builtin.c| 2 +- backends/cryptodev-lkcf.c | 2 +- backends/cryptodev-vhost-user.c | 4 ++-- backends/cryptodev-vhost.c | 4 ++-- include/sysemu/cryptodev.h |

<    1   2   3   4   >