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
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
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
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
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
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
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:
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
ot;address": {
"serial": "SAMSUNG MZQL23T8HCLS-00A07_S64HNE0N500076",
"bus-type": "nvme",
"bus": 0,
"unit": 0,
"pci-controller": {
"bus": 0,
"slot&
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
- 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
"bus": 0,
"unit": 0,
"pci-controller": {
"bus": 0,
"slot": 22,
"domain": 0,
"function": 0
},
"dev": "/dev/nvme0n1",
"tar
"bus": 0,
"unit": 0,
"pci-controller": {
"bus": 0,
"slot": 22,
"domain": 0,
"function": 0
},
"dev": "/dev/nvme0n1",
"tar
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(-)
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
- 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
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
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:
: 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
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(
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
mera +-+
++---+
|
+-+-+
| | |
+---+---+ +-+-++-+
|builtin| |v4l2(ready)||other drivers|
+---+ +---++-+
Signed-off-by: zhenwei pi
---
MAINTAINERS | 7 +
camera/builtin.c| 717
camera/camera-int.h |
--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
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
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
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
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
: 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
++
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
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
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:
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
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
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
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
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
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
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
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/
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
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
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
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/
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
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
nvme_smart_event(n, NVME_SMART_TEMPERATURE);
}
break;
It looks good to me.
Acked-by: zhenwei pi
--
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
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
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
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
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
['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
ervice": [
"akcipher"
],
"id": "cryptodev0",
"client": [
{
"queue": 0,
"type": "lkcf",
"info": "cryptodev-lkcf0"
}
]
}
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
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
"akcipher"
],
"asym-stat": {
"encrypt-ops": 54,
"verify-bytes": 8704,
"sign-ops": 17,
"verify-ops": 34,
"sign-bytes": 340,
"decrypt-bytes": 9215,
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
: 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
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
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
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
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
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.
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
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
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
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:
['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
: 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 |
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
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
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
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
.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
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
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
ts": [
{
"name": "asym-verify-bytes",
"value": 0
},
...
{
"name": "sym-decrypt-bytes",
"value": 5376
},
...
],
"qom-path": "/o
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
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
ot;hash",
"cipher"
],
"id": "cryptodev1",
"client": [
{
"queue": 0,
"type": "builtin"
}
]
},
{
"service": [
"akcipher"
],
&
, 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"}'.
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
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
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
: 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 |
101 - 200 of 385 matches
Mail list logo