[PATCH 0/2] migrate inflight emulated SCSI request for the scsi disk device

2024-05-24 Thread Hyman Huang
SI request be migrated during live migration, similar to the DMA SCSI request. Hyman Huang (2): scsi-disk: Introduce the migrate_emulate_scsi_request field scsi-disk: Fix crash for VM configured with USB CDROM after live migration hw/scsi/scsi-disk.c | 35 +

[PATCH 1/2] scsi-disk: Introduce the migrate_emulate_scsi_request field

2024-05-24 Thread Hyman Huang
with a CDROM during live migration. Signed-off-by: Hyman Huang Message-Id: <2da3a08785453478079cfd46d8293ee68d284391.1712577715.git.yong.hu...@smartx.com> --- hw/scsi/scsi-disk.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scs

[PATCH 2/2] scsi-disk: Fix crash for VM configured with USB CDROM after live migration

2024-05-24 Thread Hyman Huang
SCSI request be migrated during live migration, similar to the DMA SCSI request. Signed-off-by: Hyman Huang --- hw/scsi/scsi-disk.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 0985676f73..d6e9d9e8d4 1

[PATCH RESEND 1/2] scsi-disk: Introduce the migrate_emulate_scsi_request field

2024-04-08 Thread Hyman Huang
with a CDROM during live migration. Signed-off-by: Hyman Huang --- hw/scsi/scsi-disk.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 4bd7af9d0c..0985676f73 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c

[PATCH RESEND 0/2] Fix crash of VMs configured with the CDROM device

2024-04-08 Thread Hyman Huang
Hyman Huang (2): scsi-disk: Introduce the migrate_emulate_scsi_request field scsi-disk: Fix crash of VMs configured with the CDROM device hw/scsi/scsi-disk.c | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) -- 2.39.3

[PATCH RESEND 2/2] scsi-disk: Fix crash of VMs configured with the CDROM device

2024-04-08 Thread Hyman Huang
up usb_msd_data_in 8/8 (scsi 8) shutting down, reason=crashed To summarize, the missing scsi request during a live migration may cause a VM configured with a CDROM to crash. Migrating the SCSI request that the scsi-disk is handling is the simple approach, assuming that it actually exists. Signed-o

[PATCH 1/2] scsi-disk: Introduce the migrate_emulate_scsi_request field

2024-04-03 Thread Hyman Huang
with a CDROM during live migration. Signed-off-by: Hyman Huang --- hw/scsi/scsi-disk.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 4bd7af9d0c..0985676f73 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c

[PATCH 2/2] scsi-disk: Fix the migration crash of the CDROM device with USB bus

2024-04-03 Thread Hyman Huang
up usb_msd_data_in 8/8 (scsi 8) shutting down, reason=crashed To summarize, the missing scsi request during a live migration may cause a VM configured with a CDROM to crash. Migrating the SCSI request that the scsi-disk is handling is the simple approach, assuming that it actually exists. Signed-o

[PATCH RFC 0/3] Support GM/T 0018-2012 cryptographic standard

2024-02-24 Thread Hyman Huang
e uploaded this series with the intention of receiving feedback, as the title suggests. We would welcome any suggestions and feedback regarding this feature. Hyman Huang (3): crypto: Introduce GM/T 0018-2012 cryptographic driver meson.build: Support GM/T 0018-2012 cryptographic standard cry

[PATCH RFC 1/3] crypto: Introduce GM/T 0018-2012 cryptographic driver

2024-02-24 Thread Hyman Huang
https://github.com/guanzhi/GM-Standards/blob/master/GMT密码行标/ GMT%200018-2012%20密码设备应用接口规范.pdf" This patch implement the basic functions of GM/T 0018-2012 standard. Currently, for block encryption, it support SM4 cipher algorithm only. Signed-off-by: Hyman Huang --- MAINTAINERS | 3

[PATCH RFC 3/3] crypto: Allow GM/T 0018-2012 to support SM4 cipher algorithm

2024-02-24 Thread Hyman Huang
Since GM/T 0018-2012 was probed by SM4 cipher algorithm, allow it to support SM4 cipher algorithm in block encryption. Signed-off-by: Hyman Huang --- crypto/block-luks.c | 4 ++-- crypto/cipher.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/block-luks.c b

[PATCH RFC 2/3] meson.build: Support GM/T 0018-2012 cryptographic standard

2024-02-24 Thread Hyman Huang
API and enable the feature if crypto-gmt is given explictly. This feature defaults to disabled. Signed-off-by: Hyman Huang --- crypto/meson.build| 3 +++ meson.build | 30 ++ meson_options.txt | 2 ++ scripts/meson

[PATCH v4 1/3] qmp: Switch x-query-virtio-status back to numeric encoding

2024-02-21 Thread Hyman Huang
ecause x-query-virtio-status comes without a stability promise. Signed-off-by: Hyman Huang Acked-by: Markus Armbruster --- hw/virtio/virtio-hmp-cmds.c | 25 +++-- hw/virtio/virtio-qmp.c | 23 ++--- qapi/virtio.json| 192 3 files change

[PATCH v4 2/3] virtio: Declare the decoding functions to static

2024-02-21 Thread Hyman Huang
qmp_decode_protocols(), qmp_decode_status(), and qmp_decode_features() are now only used in virtio-hmp-cmds.c. So move them into there, redeclare them to static, and replace the qmp_ prefix with hmp_. Signed-off-by: Hyman Huang --- hw/virtio/meson.build | 4 +- hw/virtio/virtio-hmp

[PATCH v4 3/3] qapi: Define VhostDeviceProtocols and VirtioDeviceFeatures as plain C types

2024-02-21 Thread Hyman Huang
VhostDeviceProtocols and VirtioDeviceFeatures are only used in virtio-hmp-cmds.c. So define them as plain C types there, and drop them from the QAPI schema. Signed-off-by: Hyman Huang Reviewed-by: Markus Armbruster --- hw/virtio/virtio-hmp-cmds.c | 16 +++ qapi/virtio.json

[PATCH v4 0/3] Adjust the output of x-query-virtio-status

2024-02-21 Thread Hyman Huang
. For the HMP output, display the human-readable information and drop the unknown bits in practice. 3. For the QMP output, remove the descriptive strings and only display bits encoded as numbers. Hyman Huang (3): qmp: Switch x-query-virtio-status back to numeric encoding virtio: Declare

[PATCH] qapi: Craft the BlockdevCreateOptionsLUKS comment

2024-02-20 Thread Hyman Huang
Add comment in detail for commit 433957bb7f (qapi: Make parameter 'file' optional for BlockdevCreateOptionsLUKS). Signed-off-by: Hyman Huang --- qapi/block-core.json | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block

[PATCH] docs/devel: Add introduction to LUKS volume with detached header

2024-02-19 Thread Hyman Huang
Signed-off-by: Hyman Huang --- MAINTAINERS | 1 + docs/devel/luks-detached-header.rst | 182 2 files changed, 183 insertions(+) create mode 100644 docs/devel/luks-detached-header.rst diff --git a/MAINTAINERS b/MAINTAINERS index a24c2b51b6

[PATCH v3 2/3] virtio: Declare the decoding functions to static

2024-02-02 Thread Hyman Huang
qmp_decode_protocols(), qmp_decode_status(), and qmp_decode_features() are now only used in virtio-hmp-cmds.c. So move them into there, redeclare them to static, and replace the qmp_ prefix with hmp_. Signed-off-by: Hyman Huang --- hw/virtio/meson.build | 3 +- hw/virtio/virtio-hmp

[PATCH v3 1/3] qmp: Switch x-query-virtio-status back to numeric encoding

2024-02-02 Thread Hyman Huang
e x-query-virtio-status does comes without a stability promise. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 25 +++-- hw/virtio/virtio-qmp.c | 23 ++--- qapi/virtio.json| 192 3 files changed, 45 insertions(+), 195 deletions

[PATCH v3 3/3] qapi: Define VhostDeviceProtocols and VirtioDeviceFeatures as plain C types

2024-02-02 Thread Hyman Huang
VhostDeviceProtocols and VirtioDeviceFeatures are only used in virtio-hmp-cmds.c. So define them as plain C types there, and drop them from the QAPI schema. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 16 +++ qapi/virtio.json| 39

[PATCH v3 0/3] Adjust the output of x-query-virtio-status

2024-02-02 Thread Hyman Huang
output just in HMP. 2. For the HMP output, display the human-readable information and drop the unknown bits in practice. 3. For the QMP output, remove the descriptive strings and only display bits encoded as numbers. Hyman Huang (3): qmp: Switch x-query-virtio-status back to numeric

[PATCH v2 1/2] i386/sev: Sort the error message

2024-01-07 Thread Hyman Huang
he command line is invalid Signed-off-by: Hyman Huang --- target/i386/sev.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 9a71246682..96eff73001 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -923,7 +92

[PATCH v2 0/2] Nitpick at the error message's output

2024-01-07 Thread Hyman Huang
v2: - rebase on master - add a commit to sort the error message so that an explanation error number can be returned on all failure paths Hyman Huang (2): i386/sev: Sort the error message i386/sev: Nitpick at the error message's output target/i386/sev.c | 10 +++--- 1 file changed, 7

[PATCH v2 2/2] i386/sev: Nitpick at the error message's output

2024-01-07 Thread Hyman Huang
on the failure path. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé Message-Id: --- target/i386/sev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 96eff73001..3fef8cf163 100644 --- a/target/i386/sev.c +++ b/target/i386

[PATCH] i386/sev: Nitpick at the error message's output

2024-01-05 Thread Hyman Huang
on the failure path. Signed-off-by: Hyman Huang --- target/i386/sev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 9a71246682..4a69ca457c 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1019,7 +1019,7 @@ int sev_kvm_init

[PATCH v2 1/2] qapi/virtio: Keep feature and status bits in the QMP output

2024-01-04 Thread Hyman Huang
y, without the need for additional feature encoding. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 29 -- hw/virtio/virtio-qmp.c | 23 ++--- qapi/virtio.json| 192 3 files changed, 48 insertions(+), 196 deletions(-) diff

[PATCH v2 2/2] hmp: Drop unknown feature and status bits

2024-01-04 Thread Hyman Huang
The QMP command "x-query-virtio-status" outputs the full feature and status bit information, so there is no need to maintain it in the HMP output; drop it. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 13 - 1 file changed, 13 deletions(-) diff --git a

[PATCH v2 0/2] Adjust the output of x-query-virtio-status

2024-01-04 Thread Hyman Huang
the descriptive strings and only display bits encoded as numbers. Hyman Huang (2): qapi/virtio: Keep feature and status bits in the QMP output hmp: Drop unknown feature and status bits hw/virtio/virtio-hmp-cmds.c | 42 hw/virtio/virtio-qmp.c | 23 ++--- qapi/virtio.json

[PATCH 2/2] hmp: Drop unknown feature and status bits

2023-12-28 Thread Hyman Huang
The QMP command "x-query-virtio-status" outputs the full feature and status bit information, so there is no need to maintain it in the HMP output; drop it. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 13 - 1 file changed, 13 deletions(-) diff --git a

[PATCH 0/2] Adjust the output of x-query-virtio-status

2023-12-28 Thread Hyman Huang
in HMP. 2. For the HMP output, display the human-readable information and drop the unknown bits in practice. 3. For the QMP output, remove the descriptive strings and only display bits encoded as numbers. Please review, thanks, Yong Hyman Huang (2): qapi/virtio: Keep feature and status bits

[PATCH 1/2] qapi/virtio: Keep feature and status bits in the QMP output

2023-12-28 Thread Hyman Huang
y, without the need for additional feature encoding. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 25 +++-- hw/virtio/virtio-qmp.c | 23 ++--- qapi/virtio.json| 192 3 files changed, 45 insertions(+), 195 deletions(-) diff

[PULL 1/1] migration/dirtyrate: Remove an extra parameter

2023-12-25 Thread Hyman Huang
From: Wafer vcpu_dirty_stat_collect() has an unused parameter so remove it. Signed-off-by: Wafer Reviewed-by: Hyman Huang Message-Id: <20231204012230.4123-1-wa...@jaguarmicro.com> --- migration/dirtyrate.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mig

[PULL 0/1] Dirty page rate and dirty page limit 20231225 patch

2023-12-25 Thread Hyman Huang
The following changes since commit 191710c221f65b1542f6ea7fa4d30dde6e134fd7: Merge tag 'pull-request-2023-12-20' of https://gitlab.com/thuth/qemu into staging (2023-12-20 09:40:16 -0500) are available in the Git repository at: https://github.com/newfriday/qemu.git

[PATCH RESEND v3 00/10] Support generic Luks encryption

2023-12-24 Thread Hyman Huang
ibvirt-2-format", "driver":"luks", > "file":"libvirt-1-format", "header":"libvirt-2-storage", > "key-secret":"libvirt-2-format-secret0"}}' 6. add the virtio-blk device finally $ virsh qemu-monitor-command

[PATCH RESEND v3 04/10] crypto: Introduce creation option and structure for detached LUKS header

2023-12-24 Thread Hyman Huang
Introduce 'header' field in BlockdevCreateOptionsLUKS to support detached LUKS header creation. Meanwhile, introduce header-related field in QCryptoBlock. Signed-off-by: Hyman Huang --- crypto/blockpriv.h | 3 +++ qapi/block-core.json | 3 +++ qapi/crypto.json | 5 - 3 files changed

[PATCH RESEND v3 10/10] MAINTAINERS: Add section "Detached LUKS header"

2023-12-24 Thread Hyman Huang
I've built interests in block cryptography and also have been working on projects related to this subsystem. Add a section to the MAINTAINERS file for detached LUKS header, it only has a test case in it currently. Signed-off-by: Hyman Huang --- MAINTAINERS | 5 + 1 file changed, 5

[PATCH RESEND v3 05/10] crypto: Mark the payload_offset_sector invalid for detached LUKS header

2023-12-24 Thread Hyman Huang
Set the payload_offset_sector to a value that is nearly never reached in order to mark it as invalid and indicate that 0 should be the offset of the read/write operation on the 'file' protocol blockdev node. Signed-off-by: Hyman Huang --- crypto/block-luks.c | 41

[PATCH RESEND v3 09/10] tests: Add detached LUKS header case

2023-12-24 Thread Hyman Huang
Signed-off-by: Hyman Huang --- tests/qemu-iotests/tests/luks-detached-header | 214 ++ .../tests/luks-detached-header.out| 5 + 2 files changed, 219 insertions(+) create mode 100755 tests/qemu-iotests/tests/luks-detached-header create mode 100644 tests/qemu

[PATCH RESEND v3 01/10] crypto: Introduce option and structure for detached LUKS header

2023-12-24 Thread Hyman Huang
Add the "header" option for the LUKS format. This field would be used to identify the blockdev's position where a detachable LUKS header is stored. In addition, introduce header field in struct BlockCrypto Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé

[PATCH RESEND v3 08/10] crypto: Introduce 'detached-header' field in QCryptoBlockInfoLUKS

2023-12-24 Thread Hyman Huang
When querying the LUKS disk with the qemu-img tool or other APIs, add information about whether the LUKS header is detached. Additionally, update the test case with the appropriate modification. Signed-off-by: Hyman Huang --- crypto/block-luks.c| 2 ++ qapi/crypto.json | 3

[PATCH RESEND v3 03/10] qapi: Make parameter 'file' optional for BlockdevCreateOptionsLUKS

2023-12-24 Thread Hyman Huang
To support detached LUKS header creation, make the existing 'file' filed in BlockdevCreateOptionsLUKS optional, while also adding an extra optional 'header' field in the next commit. Signed-off-by: Hyman Huang --- block/crypto.c | 21 ++--- qapi/block-core.json | 5

[PATCH RESEND v3 06/10] block: Support detached LUKS header creation using blockdev-create

2023-12-24 Thread Hyman Huang
virsh qemu-monitor-command vm '{"execute":"blockdev-add", > "arguments": {"driver":"file", "filename": > "/path/to/detached_luks_payload_raw.img", "node-name": > "luks-payload-raw-storage"}}' 6. do

[PATCH RESEND v3 02/10] crypto: Support generic LUKS encryption

2023-12-24 Thread Hyman Huang
"driver":"luks", > "file":"libvirt-1-format", "header":"libvirt-2-storage", > "key-secret":"libvirt-2-format-secret0"}}' 6. add the virtio-blk device finally $ virsh qemu-monitor-command vm '{"execute":"devi

[PATCH RESEND v3 07/10] block: Support detached LUKS header creation using qemu-img

2023-12-24 Thread Hyman Huang
Add the 'detached-mode' option to specify the creation of a detached LUKS header. This is how it is used: $ qemu-img create --object secret,id=sec0,data=abc123 -f luks > -o cipher-alg=aes-256,cipher-mode=xts -o key-secret=sec0 > -o detached-mode=true header.luks Signed-off-by: Hyman

[v3 04/10] crypto: Introduce creation option and structure for detached LUKS header

2023-12-24 Thread Hyman Huang
Introduce 'header' field in BlockdevCreateOptionsLUKS to support detached LUKS header creation. Meanwhile, introduce header-related field in QCryptoBlock. Signed-off-by: Hyman Huang --- crypto/blockpriv.h | 3 +++ qapi/block-core.json | 3 +++ qapi/crypto.json | 5 - 3 files changed

[v3 09/10] tests: Add detached LUKS header case

2023-12-24 Thread Hyman Huang
Signed-off-by: Hyman Huang --- tests/qemu-iotests/tests/luks-detached-header | 214 ++ .../tests/luks-detached-header.out| 5 + 2 files changed, 219 insertions(+) create mode 100755 tests/qemu-iotests/tests/luks-detached-header create mode 100644 tests/qemu

[v3 06/10] block: Support detached LUKS header creation using blockdev-create

2023-12-24 Thread Hyman Huang
virsh qemu-monitor-command vm '{"execute":"blockdev-add", > "arguments": {"driver":"file", "filename": > "/path/to/detached_luks_payload_raw.img", "node-name": > "luks-payload-raw-storage"}}' 6. do

[v3 03/10] qapi: Make parameter 'file' optional for BlockdevCreateOptionsLUKS

2023-12-24 Thread Hyman Huang
To support detached LUKS header creation, make the existing 'file' filed in BlockdevCreateOptionsLUKS optional, while also adding an extra optional 'header' field in the next commit. Signed-off-by: Hyman Huang --- block/crypto.c | 21 ++--- qapi/block-core.json | 5

[v3 08/10] crypto: Introduce 'detached-header' field in QCryptoBlockInfoLUKS

2023-12-24 Thread Hyman Huang
When querying the LUKS disk with the qemu-img tool or other APIs, add information about whether the LUKS header is detached. Additionally, update the test case with the appropriate modification. Signed-off-by: Hyman Huang --- crypto/block-luks.c| 2 ++ qapi/crypto.json | 3

[v3 02/10] crypto: Support generic LUKS encryption

2023-12-24 Thread Hyman Huang
"driver":"luks", > "file":"libvirt-1-format", "header":"libvirt-2-storage", > "key-secret":"libvirt-2-format-secret0"}}' 6. add the virtio-blk device finally $ virsh qemu-monitor-command vm '{"execute":"devi

[v3 05/10] crypto: Mark the payload_offset_sector invalid for detached LUKS header

2023-12-24 Thread Hyman Huang
Set the payload_offset_sector to a value that is nearly never reached in order to mark it as invalid and indicate that 0 should be the offset of the read/write operation on the 'file' protocol blockdev node. Signed-off-by: Hyman Huang --- crypto/block-luks.c | 41

[v3 07/10] block: Support detached LUKS header creation using qemu-img

2023-12-24 Thread Hyman Huang
Add the 'detached-mode' option to specify the creation of a detached LUKS header. This is how it is used: $ qemu-img create --object secret,id=sec0,data=abc123 -f luks > -o cipher-alg=aes-256,cipher-mode=xts -o key-secret=sec0 > -o detached-mode=true header.luks Signed-off-by: Hyman

[v3 10/10] MAINTAINERS: Add section "Detached LUKS header"

2023-12-24 Thread Hyman Huang
I've built interests in block cryptography and also have been working on projects related to this subsystem. Add a section to the MAINTAINERS file for detached LUKS header, it only has a test case in it currently. Signed-off-by: Hyman Huang --- MAINTAINERS | 5 + 1 file changed, 5

[v3 00/10] Support generic Luks encryption

2023-12-24 Thread Hyman Huang
header querying - Do some code clean Hyman Huang (10): crypto: Introduce option and structure for detached LUKS header crypto: Support generic LUKS encryption qapi: Make parameter 'file' optional for BlockdevCreateOptionsLUKS crypto: Introduce creation option and structure for detached LUKS

[v3 01/10] crypto: Introduce option and structure for detached LUKS header

2023-12-24 Thread Hyman Huang
Add the "header" option for the LUKS format. This field would be used to identify the blockdev's position where a detachable LUKS header is stored. In addition, introduce header field in struct BlockCrypto Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé

[PATCH v6] crypto: Introduce SM4 symmetric cipher algorithm

2023-12-07 Thread Hyman Huang
and enable the feature silently if it is available. Signed-off-by: Hyman Huang Reviewed-by: Philippe Mathieu-Daudé --- crypto/block-luks.c | 11 crypto/cipher-gcrypt.c.inc | 8 ++ crypto/cipher-nettle.c.inc | 49 + crypto/cipher.c

[PATCH v5] crypto: Introduce SM4 symmetric cipher algorithm

2023-12-07 Thread Hyman Huang
to explicitly control the feature, which would be detected by default. Signed-off-by: Hyman Huang Reviewed-by: Philippe Mathieu-Daudé --- crypto/block-luks.c | 11 crypto/cipher-gcrypt.c.inc | 8 ++ crypto/cipher-nettle.c.inc | 49

[v2 0/4] Support generic Luks encryption

2023-12-06 Thread Hyman Huang
uot;, "header":"libvirt-2-storage", > "key-secret":"libvirt-2-format-secret0"}}' 6. add the virtio-blk device finally $ virsh qemu-monitor-command vm '{"execute":"device_add", > "arguments": {"num-queues":"1

[v2 2/4] crypto: Introduce payload offset set function

2023-12-06 Thread Hyman Huang
Signed-off-by: Hyman Huang --- crypto/block.c | 4 include/crypto/block.h | 1 + 2 files changed, 5 insertions(+) diff --git a/crypto/block.c b/crypto/block.c index 7bb4b74a37..3dcf22a69f 100644 --- a/crypto/block.c +++ b/crypto/block.c @@ -319,6 +319,10 @@ QCryptoHashAlgorithm

[v2 3/4] crypto: Support generic LUKS encryption

2023-12-06 Thread Hyman Huang
"driver":"luks", > "file":"libvirt-1-format", "header":"libvirt-2-storage", > "key-secret":"libvirt-2-format-secret0"}}' 6. add the virtio-blk device finally $ virsh qemu-monitor-command vm '{"execute":"d

[v2 4/4] block: Support detached LUKS header creation for blockdev-create

2023-12-06 Thread Hyman Huang
ot;, > "arguments":{"job-id":"job0", "options":{"driver":"luks", > "size":0, "file":"libvirt-1-storage", "detached-mode":true, > "cipher-alg":"aes-256",

[v2 1/4] crypto: Introduce option and structure for detached LUKS header

2023-12-06 Thread Hyman Huang
Add the "header" option for the LUKS format. This field would be used to identify the blockdev's position where a detachable LUKS header is stored. In addition, introduce header field in struct BlockCrypto Signed-off-by: Hyman Huang --- block/crypto.c | 1 + qapi/block-cor

[RFC 4/8] Gluks: Introduce Gluks options

2023-12-04 Thread Hyman Huang
Similar to Luks, the Gluks format primarily recycles the Luks choices with the exception of the "size" option. Signed-off-by: Hyman Huang --- block/crypto.c | 4 ++-- block/generic-luks.c | 18 ++ block/generic-luks.h | 3 +++ 3 files changed, 23 insert

[RFC 6/8] crypto: Provide the Luks crypto driver to Gluks

2023-12-04 Thread Hyman Huang
Hooks up the Luks crypto driver for Gluks. Signed-off-by: Hyman Huang --- crypto/block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/block.c b/crypto/block.c index 3dcf22a69f..7e695c0a04 100644 --- a/crypto/block.c +++ b/crypto/block.c @@ -27,6 +27,7 @@ static const

[RFC 5/8] qapi: Introduce Gluks types to qapi

2023-12-04 Thread Hyman Huang
Primarily using the Luks types again, Gluks adds an extra option called "header", which points to the Luks header node's description. Signed-off-by: Hyman Huang --- qapi/block-core.json | 22 +- qapi/crypto.json | 10 +++--- 2 files changed, 28 insert

[RFC 1/8] crypto: Export util functions and structures

2023-12-04 Thread Hyman Huang
Luks driver logic is primarily reused by Gluk, which, therefore, exports several pre-existing functions and structures. Signed-off-by: Hyman Huang --- block/crypto.c | 16 block/crypto.h | 23 +++ 2 files changed, 27 insertions(+), 12 deletions(-) diff

[RFC 2/8] crypto: Introduce payload offset set function

2023-12-04 Thread Hyman Huang
Implement the payload offset set function for Gluks. Signed-off-by: Hyman Huang --- crypto/block.c | 4 include/crypto/block.h | 1 + 2 files changed, 5 insertions(+) diff --git a/crypto/block.c b/crypto/block.c index 7bb4b74a37..3dcf22a69f 100644 --- a/crypto/block.c +++ b/crypto

[RFC 3/8] Gluks: Add the basic framework

2023-12-04 Thread Hyman Huang
Gluks would be a built-in format in the QEMU block layer. Signed-off-by: Hyman Huang --- block/generic-luks.c | 81 block/generic-luks.h | 26 ++ block/meson.build| 1 + 3 files changed, 108 insertions(+) create mode 100644 block

[RFC 8/8] block: Support Gluks format image creation using qemu-img

2023-12-04 Thread Hyman Huang
To create a Gluks header image, use the command as follows: $ qemu-img create --object secret,id=sec0,data=abc123 -f gluks > -o cipher-alg=aes-256,cipher-mode=xts -o key-secret=sec0 > cipher.gluks Signed-off-by: Hyman Huang --- block.c | 5 + block/generic-luks.

[RFC 7/8] Gluks: Implement the fundamental block layer driver hooks

2023-12-04 Thread Hyman Huang
Signed-off-by: Hyman Huang --- block/generic-luks.c | 104 ++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/block/generic-luks.c b/block/generic-luks.c index ebc0365d40..32cbedc86f 100644 --- a/block/generic-luks.c +++ b/block/generic

[RFC 0/8] Support generic Luks encryption

2023-12-04 Thread Hyman Huang
mand vm '{"execute":"blockdev-add", "arguments":{"node-name": "libvirt-2-format", "driver": "gluks", "file": "libvirt-1-format", "header": "libvirt-2-storage", "key-secret": &

[PATCH v4] crypto: Introduce SM4 symmetric cipher algorithm

2023-11-29 Thread Hyman Huang
to explicitly control the feature, which would be detected by default. Signed-off-by: Hyman Huang Reviewed-by: Philippe Mathieu-Daudé --- crypto/block-luks.c | 11 crypto/cipher-gcrypt.c.inc | 8 ++ crypto/cipher-nettle.c.inc | 49

[PATCH v3] crypto: Introduce SM4 symmetric cipher algorithm

2023-11-29 Thread Hyman Huang
to explicitly control the feature, which would be detected by default. Signed-off-by: Hyman Huang --- crypto/block-luks.c | 11 crypto/cipher-gcrypt.c.inc | 8 ++ crypto/cipher-nettle.c.inc | 49 + crypto/cipher.c

[PATCH v2] crypto: Introduce SM4 symmetric cipher algorithm

2023-11-28 Thread Hyman Huang
for enabling this feature. Signed-off-by: Hyman Huang --- crypto/block-luks.c | 11 crypto/cipher-gcrypt.c.inc | 8 ++ crypto/cipher-nettle.c.inc | 49 + crypto/cipher.c | 6 meson.build

[PATCH] crypto: Introduce SM4 symmetric cipher algorithm

2023-11-27 Thread Hyman Huang
Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016). SM4 (GBT.32907-2016) is a cryptographic standard issued by the Organization of State Commercial Administration of China (OSCCA) as an authorized cryptographic algorithms for the use within China. Signed-off-by: Hyman Huang --- crypto

[v2 1/2] qapi/virtio: Add feature and status bits for x-query-virtio-status

2023-11-18 Thread Hyman Huang
ne, which implements a vhost-user test case about acked features of vhost-user protocol. Note that since the matching HMP command is typically used for human, leave it unchanged. Signed-off-by: Hyman Huang --- hw/virtio/virtio-qmp.c | 8 qapi/virtio.json | 37

[v2 2/2] vhost-user-test: Add negotiated features check

2023-11-18 Thread Hyman Huang
initialization. The negotiated features check verifies whether the features in the Vhost slave device and the acked_features in QEMU are identical. Through the usage of the vhost-user protocol, the test case seeks to verify that the vhost-user network device is correctly negotiating. Signed-off-by: Hyman

[v2 0/2] vhost-user-test: Add negotiated features check

2023-11-18 Thread Hyman Huang
ity. To do that, we first introduce an "show-bits" argument for x-query-virtio-status such that the feature bits can be used directly, and then implement the test case for negotiated features check. As we post, the code is divided into two patches. Please review, thanks, Yong Hyman Huang (

[RFC 1/2] qapi/virtio: introduce the "show-bits" argument for x-query-virtio-status

2023-11-12 Thread Hyman Huang
tch also serves as a preparation for the next one, which implements a vhost-user test case about acked features of vhost-user protocol. Note that since the matching HMP command is typically used for human, leave it unchanged. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 2 +- hw/

[RFC 2/2] vhost-user-test: Add negotiated features check

2023-11-12 Thread Hyman Huang
initialization. The negotiated features check verifies whether the features in the Vhost slave device and the acked_features in QEMU are identical. Through the usage of the vhost-user protocol, the test case seeks to verify that the vhost-user network device is correctly negotiating. Signed-off-by: Hyman

[RFC 0/2] vhost-user-test: Add negotiated features check

2023-11-12 Thread Hyman Huang
case for negotiated features check. As we post, the code is divided into two patches. Please review, thanks, Yong Hyman Huang (2): qapi/virtio: introduce the "show-bits" argument for x-query-virtio-status vhost-user-test: Add negotiated features check hw/virtio/virtio-hmp-cmds.c |

[v3 6/6] docs/migration: Add the dirty limit section

2023-11-01 Thread Hyman Huang
The dirty limit feature has been introduced since the 8.1 QEMU release but has not reflected in the document, add a section for that. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: <36194a8a23d937392bf13d9fff8e898030c827a3.1697815117.git.yong.hu...@smartx.com> ---

[v3 4/6] tests/migration: Introduce dirty-ring-size option into guestperf

2023-11-01 Thread Hyman Huang
-ring-size 4096 xxx Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: --- tests/migration/guestperf/engine.py | 6 +- tests/migration/guestperf/hardware.py | 8 ++-- tests/migration/guestperf/shell.py| 6 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff

[v3 5/6] tests/migration: Introduce dirty-limit into guestperf

2023-11-01 Thread Hyman Huang
--transport unix \ --filter compr-dirty-limit* --output outputdir Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: <516e7a55dfc6e33d33510be37eb24223de5dc072.1697815117.git.yong.hu...@smartx.com> --- tests/migration/guestperf/comparison.py | 23 +++

[v3 0/6] dirtylimit: miscellaneous patches

2023-11-01 Thread Hyman Huang
case. 3. guestperf for migration: add support for dirtylimit migration. 4. docs for migration: add dirtylimit section. Please review, thanks. Regards, Hyman Huang (6): system/dirtylimit: Fix a race situation system/dirtylimit: Drop the reduplicative check tests: Add migration dirty-limit

[v3 3/6] tests: Add migration dirty-limit capability test

2023-11-01 Thread Hyman Huang
. Note that this test case involves many passes, so it runs in slow mode only. Signed-off-by: Hyman Huang Acked-by: Peter Xu Reviewed-by: Fabiano Rosas Message-Id: --- tests/qtest/migration-test.c | 164 +++ 1 file changed, 164 insertions(+) diff --git a/tests

[v3 2/6] system/dirtylimit: Drop the reduplicative check

2023-11-01 Thread Hyman Huang
Checking if dirty limit is in service is done by the dirtylimit_query_all function, drop the reduplicative check in the qmp_query_vcpu_dirty_limit function. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: <31384f768279027560ab952ebc2bbff1ddb62531.1697815117.git.yong

[v3 1/6] system/dirtylimit: Fix a race situation

2023-11-01 Thread Hyman Huang
Fix a race situation for global variable dirtylimit_state. Also, replace usleep by g_usleep to increase platform accessibility to the sleep function. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: --- system/dirtylimit.c | 20 ++-- 1 file changed, 14

Re: [v2 4/6] tests/migration: Introduce dirty-ring-size option into guestperf

2023-10-27 Thread Hyman Huang
to that. On Fri, Oct 20, 2023 at 11:24 PM Hyman Huang wrote: Dirty ring size configuration is not supported by guestperf tool. Introduce dirty-ring-size (ranges in [1024, 65536]) option so developers can play with dirty-ring and dirty-limit feature easier. To set dirty ring

[v2 5/6] tests/migration: Introduce dirty-limit into guestperf

2023-10-20 Thread Hyman Huang
--transport unix \ --filter compr-dirty-limit* --output outputdir Signed-off-by: Hyman Huang --- tests/migration/guestperf/comparison.py | 23 +++ tests/migration/guestperf/engine.py | 17 + tests/migration/guestperf/progress.py | 16

[v2 0/6] dirtylimit: miscellaneous patches

2023-10-20 Thread Hyman Huang
support for dirtylimit migration. 4. docs for migration: add dirtylimit section. Please review, thanks. Regards, Yong Hyman Huang (6): system/dirtylimit: Fix a race situation system/dirtylimit: Drop the reduplicative check tests: Add migration dirty-limit capability test tests/migration

[v2 3/6] tests: Add migration dirty-limit capability test

2023-10-20 Thread Hyman Huang
. Note that this test case involves many passes, so it runs in slow mode only. Signed-off-by: Hyman Huang Acked-by: Peter Xu Reviewed-by: Fabiano Rosas --- tests/qtest/migration-test.c | 164 +++ 1 file changed, 164 insertions(+) diff --git a/tests/qtest

[v2 6/6] docs/migration: Add the dirty limit section

2023-10-20 Thread Hyman Huang
The dirty limit feature has been introduced since the 8.1 QEMU release but has not reflected in the document, add a section for that. Signed-off-by: Hyman Huang --- docs/devel/migration.rst | 71 1 file changed, 71 insertions(+) diff --git a/docs/devel

[v2 2/6] system/dirtylimit: Drop the reduplicative check

2023-10-20 Thread Hyman Huang
Checking if dirty limit is in service is done by the dirtylimit_query_all function, drop the reduplicative check in the qmp_query_vcpu_dirty_limit function. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas --- system/dirtylimit.c | 4 1 file changed, 4 deletions(-) diff --git

[v2 1/6] system/dirtylimit: Fix a race situation

2023-10-20 Thread Hyman Huang
Fix a race situation for global variable dirtylimit_state. Also, replace usleep by g_usleep to increase platform accessibility to the sleep function. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas --- system/dirtylimit.c | 20 ++-- 1 file changed, 14 insertions(+), 6

[v2 4/6] tests/migration: Introduce dirty-ring-size option into guestperf

2023-10-20 Thread Hyman Huang
-ring-size 4096 xxx Signed-off-by: Hyman Huang --- tests/migration/guestperf/engine.py | 6 +- tests/migration/guestperf/hardware.py | 8 ++-- tests/migration/guestperf/shell.py| 6 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/migration/guestperf

[PATCH 5/6] tests/migration: Introduce dirty-limit into guestperf

2023-10-17 Thread Hyman Huang
--transport unix \ --filter compr-dirty-limit* --output outputdir Signed-off-by: Hyman Huang --- tests/migration/guestperf/comparison.py | 23 +++ tests/migration/guestperf/engine.py | 17 + tests/migration/guestperf/progress.py | 16

[PATCH 4/6] tests/migration: Introduce dirty-ring-size option into guestperf

2023-10-17 Thread Hyman Huang
-ring-size 4096 xxx Signed-off-by: Hyman Huang --- tests/migration/guestperf/engine.py | 6 +- tests/migration/guestperf/hardware.py | 8 ++-- tests/migration/guestperf/shell.py| 6 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/migration/guestperf

[PATCH 6/6] docs/migration: Add the dirty limit section

2023-10-17 Thread Hyman Huang
The dirty limit feature has been introduced since the 8.1 QEMU release but has not reflected in the document, add a section for that. Signed-off-by: Hyman Huang --- docs/devel/migration.rst | 71 1 file changed, 71 insertions(+) diff --git a/docs/devel

  1   2   3   >