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

2023-12-24 Thread Hyman Huang
v3: - Rebase on master - Add a test case for detached LUKS header - Adjust the design to honour preallocation of the payload device - Adjust the design to honour the payload offset from the header, even when detached - Support detached LUKS header creation using qemu-img - Support detached LUKS h

[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, 1

[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 insertion

[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-iotests

[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é Message-Id: <5b99f60c7317092a

[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
The LUKS disk with detached header consists of a separate LUKS header and payload. This LUKS disk type should be formatted as follows: 1. add the secret to lock/unlock the cipher stored in the detached LUKS header $ virsh qemu-monitor-command vm '{"execute":"object-add", > "arguments":{"qom-typ

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

2023-12-24 Thread Hyman Huang
By enhancing the LUKS driver, it is possible to enable the detachable LUKS header and, as a result, achieve general encryption for any disk format that QEMU has supported. Take the qcow2 as an example, the usage of the generic LUKS encryption as follows: 1. add a protocol blockdev node of data di

[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 Huang --- bl

[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, 1

[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-iotests

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

2023-12-24 Thread Hyman Huang
The LUKS disk with detached header consists of a separate LUKS header and payload. This LUKS disk type should be formatted as follows: 1. add the secret to lock/unlock the cipher stored in the detached LUKS header $ virsh qemu-monitor-command vm '{"execute":"object-add", > "arguments":{"qom-typ

[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
By enhancing the LUKS driver, it is possible to enable the detachable LUKS header and, as a result, achieve general encryption for any disk format that QEMU has supported. Take the qcow2 as an example, the usage of the generic LUKS encryption as follows: 1. add a protocol blockdev node of data di

[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 Huang --- bl

[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 insertion

[v3 00/10] Support generic Luks encryption

2023-12-24 Thread Hyman Huang
v3: - Rebase on master - Add a test case for detached LUKS header - Adjust the design to honour preallocation of the payload device - Adjust the design to honour the payload offset from the header, even when detached - Support detached LUKS header creation using qemu-img - Support detached LUKS h

[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é Message-Id: <5b99f60c7317092a

Re: [PATCH v5 1/2] qom: new object to associate device to numa node

2023-12-24 Thread Ankit Agrawal
Thanks Markus for the review. >> Introduce a new acpi-generic-initiator object to allow host admin provide the >> device and the corresponding NUMA nodes. Qemu maintain this association and >> use this object to build the requisite GI Affinity Structure. > > Pardon my ignorance...  What makes this

[PATCH v6 2/2] hw/acpi: Implement the SRAT GI affinity structure

2023-12-24 Thread ankita
From: Ankit Agrawal ACPI spec provides a scheme to associate "Generic Initiators" [1] (e.g. heterogeneous processors and accelerators, GPUs, and I/O devices with integrated compute or DMA engines GPUs) with Proximity Domains. This is achieved using Generic Initiator Affinity Structure in SRAT. Du

[PATCH v6 0/2] acpi: report numa nodes for device memory using GI

2023-12-24 Thread ankita
From: Ankit Agrawal There are upcoming devices which allow CPU to cache coherently access their memory. It is sensible to expose such memory as NUMA nodes separate from the sysmem node to the OS. The ACPI spec provides a scheme in SRAT called Generic Initiator Affinity Structure [1] to allow an a

[PATCH v6 1/2] qom: new object to associate device to numa node

2023-12-24 Thread ankita
From: Ankit Agrawal NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows partitioning of the GPU device resources (including device memory) into several (upto 8) isolated instances. Each of the partitioned memory needs a dedicated NUMA node to operate. The partitions are not fi

Re: [PATCH for 9.0 00/12] Map memory at destination .load_setup in vDPA-net migration

2023-12-24 Thread Lei Yang
QE tested this series with regression tests, there are no new regression issues. Tested-by: Lei Yang On Sat, Dec 16, 2023 at 1:28 AM Eugenio Pérez wrote: > > Current memory operations like pinning may take a lot of time at the > destination. Currently they are done after the source of the mi

Re: [PATCH v2 02/17] hw/loongarch: Add load initrd

2023-12-24 Thread gaosong
在 2023/12/21 下午3:09, maobibo 写道: On 2023/12/18 下午5:00, Song Gao wrote: we load initrd ramdisk after kernel_high address Signed-off-by: Song Gao ---   hw/loongarch/boot.c | 29 -   1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/h

Re: [PATCH v2 03/17] hw/loongarch: Add init_cmdline

2023-12-24 Thread gaosong
在 2023/12/21 下午3:20, maobibo 写道: On 2023/12/18 下午5:00, Song Gao wrote: Add init_cmline and set boot_info->a0, a1 Signed-off-by: Song Gao ---   hw/loongarch/boot.c | 21 +   include/hw/loongarch/virt.h |  2 ++   target/loongarch/cpu.h  |  2 ++   3 files changed,

Re: [PATCH v2 01/17] hw/loongarch: Move boot fucntions to boot.c

2023-12-24 Thread gaosong
在 2023/12/21 下午3:04, maobibo 写道: On 2023/12/18 下午5:00, Song Gao wrote: Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao ---   hw/loongarch/boot.c | 127   hw/loongarch/meso

Re: [PATCH v2 04/17] hw/loongarch: Add slave cpu boot_code

2023-12-24 Thread gaosong
在 2023/12/21 下午3:22, maobibo 写道: On 2023/12/18 下午5:00, Song Gao wrote: Signed-off-by: Song Gao ---   hw/loongarch/boot.c | 65 -   1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 4bfe24274

Re: [PATCH for-8.2?] target/i386: Fix 32-bit wrapping of pc/eip computation

2023-12-24 Thread Michael Tokarev
12.12.2023 20:25, Richard Henderson: In 32-bit mode, pc = eip + cs_base is also 32-bit, and must wrap. Failure to do so results in incorrect memory exceptions to the guest. Before 732d548732ed, this was implicitly done via truncation to target_ulong but only in qemu-system-i386, not qemu-system-x

Re: PCIe with Designware RC.

2023-12-24 Thread BALATON Zoltan
On Sun, 24 Dec 2023, Shlomo Pongratz wrote: Thank you, see comment inside. On Sun, Dec 24, 2023 at 1:11 PM BALATON Zoltan wrote: On Sun, 24 Dec 2023, Shlomo Pongratz wrote: Hi, I'm working on a AARCH64 project that uses the designeware (hw/pci-host/designware.c). I've copied the designware i

Re: PCIe with Designware RC.

2023-12-24 Thread Shlomo Pongratz
Thank you, see comment inside. On Sun, Dec 24, 2023 at 1:11 PM BALATON Zoltan wrote: > > On Sun, 24 Dec 2023, Shlomo Pongratz wrote: > > Hi, > > I'm working on a AARCH64 project that uses the designeware > > (hw/pci-host/designware.c). > > I've copied the designware initialization from hw/arm/fsl

[PATCH] virtio-blk: Fix potential nullpointer read access in virtio_blk_data_plane_destroy

2023-12-24 Thread Stefan Weil via
Fixes: CID 1532828 Fixes: b6948ab01d ("virtio-blk: add iothread-vq-mapping parameter") Signed-off-by: Stefan Weil --- hw/block/dataplane/virtio-blk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 6debd

Re: PCIe with Designware RC.

2023-12-24 Thread BALATON Zoltan
On Sun, 24 Dec 2023, Shlomo Pongratz wrote: Hi, I'm working on a AARCH64 project that uses the designeware (hw/pci-host/designware.c). I've copied the designware initialization from hw/arm/fsl-imx7.c and I hope I've updated the dtsi correctly. After fixing an issue with the iATU windows (see patc

PCIe with Designware RC.

2023-12-24 Thread Shlomo Pongratz
Hi, I'm working on a AARCH64 project that uses the designeware (hw/pci-host/designware.c). I've copied the designware initialization from hw/arm/fsl-imx7.c and I hope I've updated the dtsi correctly. After fixing an issue with the iATU windows (see patch https://lists.gnu.org/archive/html/qemu-deve