[PATCH v3 2/4] qcow2: add configurations for zoned format extension

2023-08-28 Thread Sam Li
To configure the zoned format feature on the qcow2 driver, it requires following arguments: the device size, zoned profile, zone model, zone size, zone capacity, number of conventional zones, limits on zone resources (max append sectors, max open zones, and max_active_zones). To create a qcow2 fil

[PATCH v3 0/4] Add full zoned storage emulation to qcow2 driver

2023-08-28 Thread Sam Li
This patch series add a new extension - zoned format - to the qcow2 driver thereby allowing full zoned storage emulation on the qcow2 img file. Users can attach such a qcow2 file to the guest as a zoned device. To create a qcow2 file with zoned format, use command like this: $ qemu-img create -f q

[PATCH v3 3/4] qcow2: add zoned emulation capability

2023-08-28 Thread Sam Li
By adding zone operations and zoned metadata, the zoned emulation capability enables full emulation support of zoned device using a qcow2 file. The zoned device metadata includes zone type, zoned device state and write pointer of each zone, which is stored to an array of unsigned integers. Each zo

[PATCH v3 4/4] iotests: test the zoned format feature for qcow2 file

2023-08-28 Thread Sam Li
The zoned format feature can be tested by: $ tests/qemu-iotests/check -qcow2 zoned-qcow2 Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/tests/zoned-qcow2 | 135 ++ tests/qemu-iotests/tests/zoned-qcow2.out | 140 +++ 2 files

[PATCH 4/6] vfio/migration: Change vfio_mig_active() semantics

2023-08-28 Thread Avihai Horon
vfio_mig_active() is used by migration_populate_vfio_info() to populate VFIO migration info when it is active. Currently, VFIO migration is considered active if there are VFIO devices and none of them has a migration blocker. Change that and consider VFIO migration to be active if there is a VFIO

[PATCH 3/6] vfio/migration: Add vfio_migratable_devices_num()

2023-08-28 Thread Avihai Horon
Add vfio_migratable_devices_num() function, which returns the number of VFIO devices that are using VFIO migration, and use it in vfio_multiple_devices_migration_is_supported(). This is done in preparation for next patches which will block VFIO migration with postcopy migration or background snaps

[PATCH 2/6] vfio/migration: Fail adding device with enable-migration=on and existing blocker

2023-08-28 Thread Avihai Horon
If a device with enable-migration=on is added and it causes a migration blocker, adding the device should fail with a proper error. This is not the case with multiple device migration blocker when the blocker already exists. If the blocker already exists and a device with enable-migration=on is ad

[PATCH 6/6] vfio/migration: Block VFIO migration with background snapshot

2023-08-28 Thread Avihai Horon
Background snapshot allows creating a snapshot of the VM while it's running and keeping it small by not including dirty RAM pages. The way it works is by first stopping the VM, saving the non-iterable devices' state and then starting the VM and saving the RAM while write protecting it with UFFD. T

[PATCH 5/6] vfio/migration: Block VFIO migration with postcopy migration

2023-08-28 Thread Avihai Horon
VFIO migration is not compatible with postcopy migration. A VFIO device in the destination can't handle page faults for pages that have not been sent yet. Doing such migration will cause the VM to crash in the destination: qemu-system-x86_64: VFIO_MAP_DMA failed: Bad address qemu-system-x86_64: v

[PATCH 0/6] vfio/migration: Block VFIO migration with postcopy and background snapshot

2023-08-28 Thread Avihai Horon
Hello, Recently added VFIO migration is not compatible with some of the pre-existing migration features. This was overlooked and today these combinations are not blocked by QEMU. This series fixes it. Postcopy migration: VFIO migration is not compatible with postcopy migration. A VFIO device in t

[PATCH 04/11] tcg/loongarch64: Lower add/sub_vec to vadd/vsub

2023-08-28 Thread Jiajie Chen
Lower the following ops: - add_vec - sub_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 16 1 file changed, 16 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index cc80e5fa20..eb340a6493 100644 --- a/tcg/lo

[PATCH 07/11] tcg/loongarch64: Lower mul_vec to vmul

2023-08-28 Thread Jiajie Chen
Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 8 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 819dcdba77..bca24b6a20 100644 --- a/tcg/lo

[PATCH 00/11] Lower TCG vector ops to LSX

2023-08-28 Thread Jiajie Chen
This patch series allows qemu to utilize LSX instructions on LoongArch machines to execute TCG vector ops. Jiajie Chen (11): tcg/loongarch64: Import LSX instructions tcg/loongarch64: Lower basic tcg vec ops to LSX tcg/loongarch64: Lower cmp_vec to vseq/vsle/vslt tcg/loongarch64: Lower add/

[PATCH 03/11] tcg/loongarch64: Lower cmp_vec to vseq/vsle/vslt

2023-08-28 Thread Jiajie Chen
Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 25 + 2 files changed, 26 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target-con-set.h index 37b3f80bf9..e80fc7f3f

[PATCH 08/11] tcg/loongarch64: Lower vector min max ops

2023-08-28 Thread Jiajie Chen
Lower the following ops: - smin_vec - smax_vec - umin_vec - umax_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 32 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tc

[PATCH 11/11] tcg/loongarch64: Lower bitsel_vec to vbitsel

2023-08-28 Thread Jiajie Chen
Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 11 ++- tcg/loongarch64/tcg-target.h | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/

[PATCH 02/11] tcg/loongarch64: Lower basic tcg vec ops to LSX

2023-08-28 Thread Jiajie Chen
LSX support on host cpu is detected via hwcap. Lower the following ops to LSX: - dup_vec - dupi_vec - dupm_vec - ld_vec - st_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target-con-set.h | 2 + tcg/loongarch64/tcg-target-con-str.h | 1 + tcg/loongarch64/tcg-target.c.inc | 223

[PATCH 10/11] tcg/loongarch64: Lower vector shift vector ops

2023-08-28 Thread Jiajie Chen
Lower the following ops: - shlv_vec - shrv_vec - sarv_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 24 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tc

[PATCH 06/11] tcg/loongarch64: Lower neg_vec to vneg

2023-08-28 Thread Jiajie Chen
Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 10 ++ tcg/loongarch64/tcg-target.h | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tc

[PATCH 09/11] tcg/loongarch64: Lower vector saturated ops

2023-08-28 Thread Jiajie Chen
Lower the following ops: - ssadd_vec - usadd_vec - sssub_vec - ussub_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 32 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch6

[PATCH 05/11] tcg/loongarch64: Lower vector bitwise operations

2023-08-28 Thread Jiajie Chen
Lower the following ops: - and_vec - andc_vec - or_vec - orc_vec - xor_vec - nor_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 35 tcg/loongarch64/tcg-target.h | 6 +++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git

Re: [PATCH vOther2 1/1] qemu-nbd: Restore "qemu-nbd -v --fork" output

2023-08-28 Thread Eric Blake
On Fri, Aug 25, 2023 at 10:08:38PM +0200, Denis V. Lunev wrote: > Closing stderr earlier is good for daemonized qemu-nbd under ssh > earlier, but breaks the case where -v is being used to track what is > happening in the server, as in iotest 233. Keeping the iotest output unchanged is a nice effec

[PATCH 1/6] migration: Add migration prefix to functions in target.c

2023-08-28 Thread Avihai Horon
The functions in target.c are not static, yet they don't have a proper migration prefix. Add such prefix. Signed-off-by: Avihai Horon --- migration/migration.h | 4 ++-- migration/migration.c | 6 +++--- migration/savevm.c| 2 +- migration/target.c| 8 4 files changed, 10 insert

Re: [RFC PATCH v2 0/6] Add API for list cpu extensions

2023-08-28 Thread Daniel Henrique Barboza
On 8/28/23 10:58, Igor Mammedov wrote: On Mon, 28 Aug 2023 16:45:30 +0800 LIU Zhiwei wrote: Some times we want to know what is the really mean of one cpu option. For example, in RISC-V, we usually specify a cpu in this way: -cpu rv64,v=on If we don't look into the source code, we can't get

Re: [PATCH 1/3] hw/mips/jazz: Remove the big_endian variable

2023-08-28 Thread Philippe Mathieu-Daudé
On 28/8/23 14:41, Thomas Huth wrote: On 28/08/2023 14.19, Philippe Mathieu-Daudé wrote: Hi Thomas, On 25/8/23 19:51, Thomas Huth wrote: There is an easier way to get a value that can be used to decide whether the target is big endian or not: Simply use the target_words_bigendian() function ins

Re: [PATCH] tests/avocado/machine_aspeed.py: Update SDK images

2023-08-28 Thread Philippe Mathieu-Daudé
On 28/8/23 16:33, Cédric Le Goater wrote: On 8/28/23 15:54, Joel Stanley wrote: On Mon, 28 Aug 2023 at 09:01, Cédric Le Goater wrote: Switch to the latest v8.06 release which introduces interesting changes for the AST2600 I2C and I3C models. Also take the AST2600 A2 images instead of the defa

Re: [PATCH] linux-user/riscv: Add new extensions to hwprobe

2023-08-28 Thread Richard Henderson
On 8/28/23 07:56, Robbin Ehn wrote: This patch adds the new extensions in linux 6.5 to the hwprobe syscall. And fixes RVC check to OR with correct value. The previous variable contains 0 therefore it did work. Signed-off-by: Robbin Ehn --- linux-user/syscall.c | 14 +- 1 file cha

Re: [PATCH] hw/net/rocker: avoid NULL pointer dereference in of_dpa_cmd_add_l2_flood

2023-08-28 Thread Philippe Mathieu-Daudé
On 27/8/23 13:07, Mauro Matteo Cascella wrote: On Sat, Aug 26, 2023 at 4:31 PM Mauro Matteo Cascella wrote: On Fri, Jun 24, 2022 at 4:40 PM Mauro Matteo Cascella wrote: rocker_tlv_parse_nested could return early because of no group ids in the group_tlvs. In such case tlvs is NULL; tlvs[i +

Re: [PATCH] tests/avocado/machine_aspeed.py: Update SDK images

2023-08-28 Thread Cédric Le Goater
On 8/28/23 17:50, Philippe Mathieu-Daudé wrote: On 28/8/23 16:33, Cédric Le Goater wrote: On 8/28/23 15:54, Joel Stanley wrote: On Mon, 28 Aug 2023 at 09:01, Cédric Le Goater wrote: Switch to the latest v8.06 release which introduces interesting changes for the AST2600 I2C and I3C models. Al

Re: [PATCH 00/32] hw/sd: eMMC support

2023-08-28 Thread Cédric Le Goater
Hello, On 7/3/23 15:24, Cédric Le Goater wrote: Hello, This series adds an extension for a new eMMC device using the framework Philippe put in place to support various SD implementations. Previous discussion on the same topic: http://patchwork.ozlabs.org/project/qemu-devel/list/?series

Re: [PATCH 04/20] target/riscv: move riscv_tcg_ops to tcg-cpu.c

2023-08-28 Thread Philippe Mathieu-Daudé
On 25/8/23 15:08, Daniel Henrique Barboza wrote: Move the remaining of riscv_tcg_ops now that we have a working realize() implementation. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 58 - target/riscv/cpu.h | 4 --- ta

Re: [PATCH 08/20] target/riscv: move 'host' CPU declaration to kvm.c

2023-08-28 Thread Philippe Mathieu-Daudé
On 25/8/23 15:08, Daniel Henrique Barboza wrote: This CPU only exists if we're compiling with KVM so move it to the kvm specific file. While we're at it, change its class_init() to enable the user_extensions_flag class property, sparing us from having to execute riscv_cpu_add_user_properties() by

Re: [PATCH 11/20] target/riscv: introduce KVM AccelCPUClass

2023-08-28 Thread Philippe Mathieu-Daudé
On 25/8/23 15:08, Daniel Henrique Barboza wrote: Add a KVM accelerator class like we did with TCG. The difference is that, at least for now, we won't be using a realize() implementation for this accelerator. We'll start by assiging kvm_riscv_cpu_add_kvm_properties(), renamed to kvm_cpu_instance_

Re: [PATCH 12/20] target/riscv: move KVM only files to kvm subdir

2023-08-28 Thread Philippe Mathieu-Daudé
On 25/8/23 15:08, Daniel Henrique Barboza wrote: Move the files to a 'kvm' dir to promote more code separation between accelerators and making our lives easier supporting build options such as --disable-tcg. Rename kvm.c to kvm-cpu.c to keep it in line with its TCG counterpart. Signed-off-by: D

[PATCH v7 0/7] Hyper-V Dynamic Memory Protocol driver (hv-balloon 🎈️)

2023-08-28 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This is a continuation of the v6 of the patch series located here: https://lore.kernel.org/qemu-devel/cover.1689786474.git.maciej.szmigi...@oracle.com/ Changes from v6: * Split the hv-balloon driver implementation into multiple files holding particular data structure

[PATCH v7 3/7] Add Hyper-V Dynamic Memory Protocol definitions

2023-08-28 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This commit adds Hyper-V Dynamic Memory Protocol definitions, taken from hv_balloon Linux kernel driver, adapted to the QEMU coding style and definitions. Signed-off-by: Maciej S. Szmigiero --- include/hw/hyperv/dynmem-proto.h | 423 +++

[PATCH v7 4/7] Add a Hyper-V Dynamic Memory Protocol driver (hv-balloon)

2023-08-28 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This driver is like virtio-balloon on steroids: it allows both changing the guest memory allocation via ballooning and inserting pieces of extra RAM into it on demand from a provided memory backend. One of advantages of these over ACPI-based PC DIMM hotplug is that su

[PATCH v7 6/7] qapi: Add HV_BALLOON_STATUS_REPORT event and its QMP query command

2023-08-28 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the hv-balloon driver for (optional) guest memory status reports. Signed-off-by: Maciej S. Szmigiero --- hw/hyperv/hv-balloon.c | 31 +++- monitor/monitor.c | 1 + qapi/machine.json | 64 ++

[PATCH v7 5/7] qapi: Add query-memory-devices support to hv-balloon

2023-08-28 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the driver to report its provided memory state information. Co-developed-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/core/machine-hmp-cmds.c | 15 +++ hw/hyperv/hv-balloon.c | 27 +- qapi/machine.j

[PATCH v7 1/7] memory-device: Support empty memory devices

2023-08-28 Thread Maciej S. Szmigiero
From: David Hildenbrand Let's support empty memory devices -- memory devices that don't have a memory device region in the current configuration. hv-balloon with an optional memdev is the primary use case. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory-d

[PATCH v7 7/7] hw/i386/pc: Support hv-balloon

2023-08-28 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Add the necessary plumbing for the hv-balloon driver to the PC machine. Co-developed-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/i386/Kconfig | 1 + hw/i386/pc.c| 22 ++ 2 files changed, 23 insertions(+) diff --git a/hw

[PATCH v7 2/7] memory-device: Drop size alignment check

2023-08-28 Thread Maciej S. Szmigiero
From: David Hildenbrand There is no strong requirement that the size has to be multiples of the requested alignment, let's drop it. This is a preparation for hv-baloon. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory-device.c | 6 -- 1 file changed, 6

Re: [PATCH 02/11] tcg/loongarch64: Lower basic tcg vec ops to LSX

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: +static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg rd, int64_t v64) +{ +/* Try vldi if imm can fit */ +if (vece <= MO_32 && (-0x200 <= v64 && v64 <= 0x1FF)) { +uint32_t imm = (vece <<

Re: [PATCH 1/3] hw/mips/jazz: Remove the big_endian variable

2023-08-28 Thread Thomas Huth
On 28/08/2023 17.48, Philippe Mathieu-Daudé wrote: On 28/8/23 14:41, Thomas Huth wrote: On 28/08/2023 14.19, Philippe Mathieu-Daudé wrote: Hi Thomas, On 25/8/23 19:51, Thomas Huth wrote: There is an easier way to get a value that can be used to decide whether the target is big endian or not:

Re: [PATCH 03/11] tcg/loongarch64: Lower cmp_vec to vseq/vsle/vslt

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 25 + 2 files changed, 26 insertions(+) Reviewed-by: Richard Henderson @@ -1624,6 +1624,15 @@ static void tcg_o

Re: [PATCH 13/32] hw/sd: Introduce a "sd-card" SPI variant model

2023-08-28 Thread Philippe Mathieu-Daudé
On 3/7/23 15:24, Cédric Le Goater wrote: and replace the SDState::spi attribute with a test checking the SDProto array of commands. Signed-off-by: Cédric Le Goater --- include/hw/sd/sd.h | 3 +++ hw/arm/stellaris.c | 3 +-- hw/riscv/sifive_u.c | 3 +-- hw/sd/sd.c | 52 +++

Re: [PATCH 04/11] tcg/loongarch64: Lower add/sub_vec to vadd/vsub

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Lower the following ops: - add_vec - sub_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 16 1 file changed, 16 insertions(+) Reviewed-by: Richard Henderson For further improvement, VADDI and VSUBI have a 5-bit

Re: [PATCH 05/11] tcg/loongarch64: Lower vector bitwise operations

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Lower the following ops: - and_vec - andc_vec - or_vec - orc_vec - xor_vec - nor_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 35 tcg/loongarch64/tcg-target.h | 6 +++--- 2 files changed, 38

Re: [PATCH 06/11] tcg/loongarch64: Lower neg_vec to vneg

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 10 ++ tcg/loongarch64/tcg-target.h | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) Reviewed-by: Richard Henders

Re: [PATCH 07/11] tcg/loongarch64: Lower mul_vec to vmul

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 8 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 08/11] tcg/loongarch64: Lower vector min max ops

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Lower the following ops: - smin_vec - smax_vec - umin_vec - umax_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 32 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 33 insertions(+), 1 del

Re: [PATCH 09/11] tcg/loongarch64: Lower vector saturated ops

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Lower the following ops: - ssadd_vec - usadd_vec - sssub_vec - ussub_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 32 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 33 insertions(+), 1

Re: [PATCH 10/11] tcg/loongarch64: Lower vector shift vector ops

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Lower the following ops: - shlv_vec - shrv_vec - sarv_vec Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target.c.inc | 24 tcg/loongarch64/tcg-target.h | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) Reviewed

[PULL 0/3] Dirty page rate and dirty page limit 20230829 patches

2023-08-28 Thread Hyman Huang
Merge tag 'pull-target-arm-20230824' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2023-08-24 10:08:33 -0400) are available in the Git repository at: https://github.com/newfriday/qemu.git tags/dirtylimit-dirtyrate-fixes-pull-request for you to fetch changes up to e424d9

[PULL 1/3] softmmu: Fix dirtylimit memory leak

2023-08-28 Thread Hyman Huang
From: "alloc.young" Fix memory leak in hmp_info_vcpu_dirty_limit,use g_autoptr to handle memory deallocation. Signed-off-by: alloc.young Reviewed-by: Hyman Huang Message-Id: Signed-off-by: Hyman Huang --- softmmu/dirtylimit.c | 16 +++- 1 file changed, 7 insertions(+), 9 deleti

[PULL 2/3] softmmu/dirtylimit: Convert free to g_free

2023-08-28 Thread Hyman Huang
From: "alloc.young" Convert free to g_free to match g_new and g_malloc functions. Fixes: cc2b33eab0 ("softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically") Fixes: baa609832e ("softmmu/dirtylimit: Implement virtual CPU throttle") Signed-off-by: alloc.young Reviewed-by: Hyman H

[PULL 3/3] migration/dirtyrate: Fix precision losses and g_usleep overshoot

2023-08-28 Thread Hyman Huang
From: Andrei Gudkov Signed-off-by: Andrei Gudkov Reviewed-by: Hyman Huang Message-Id: <8ddb0d40d143f77aab8f602bd494e01e5fa01614.1691161009.git.gudkov.and...@huawei.com> Signed-off-by: Hyman Huang --- migration/dirtyrate.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

Re: [PATCH 11/11] tcg/loongarch64: Lower bitsel_vec to vbitsel

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: Signed-off-by: Jiajie Chen --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 11 ++- tcg/loongarch64/tcg-target.h | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) Reviewed-by: Richard Hende

Re: [PATCH 02/11] tcg/loongarch64: Lower basic tcg vec ops to LSX

2023-08-28 Thread Jiajie Chen
There seems to some problem with the email server, try my another email address to send this email. On 2023/8/29 00:57, Richard Henderson wrote: On 8/28/23 08:19, Jiajie Chen wrote: +static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg

Re: [PATCH 00/11] Lower TCG vector ops to LSX

2023-08-28 Thread Richard Henderson
On 8/28/23 08:19, Jiajie Chen wrote: This patch series allows qemu to utilize LSX instructions on LoongArch machines to execute TCG vector ops. Jiajie Chen (11): tcg/loongarch64: Import LSX instructions tcg/loongarch64: Lower basic tcg vec ops to LSX tcg/loongarch64: Lower cmp_vec to vs

Re: [PATCH v2 02/11] target/tricore: Implement CRCN insn

2023-08-28 Thread Richard Henderson
On 8/28/23 04:26, Bastian Koppelmann wrote: reported inhttps://gitlab.com/qemu-project/qemu/-/issues/1667 Signed-off-by: Bastian Koppelmann --- v1 -> v2: - Removed useless deposits in crc_div() - Replaced final deposit() with extract() in helper_crcn() - Add trap for CRCN insn if

Re: [PATCH v2 04/11] target/tricore: Implement FTOU insn

2023-08-28 Thread Richard Henderson
On 8/28/23 04:26, Bastian Koppelmann wrote: Signed-off-by: Bastian Koppelmann --- v1 -> v2: - Remove special case for NAN input - Clarified, why we need arg < 0.0 special case target/tricore/fpu_helper.c | 32 +++ target/tricore/helper.h

Re: [PATCH v2 05/11] target/tricore: Clarify special case for FTOUZ insn

2023-08-28 Thread Richard Henderson
On 8/28/23 04:26, Bastian Koppelmann wrote: this is not something other ISAs do, so clarify it with a comment. Signed-off-by: Bastian Koppelmann --- target/tricore/fpu_helper.c | 5 + 1 file changed, 5 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 06/11] target/tricore: Implement ftohp insn

2023-08-28 Thread Richard Henderson
On 8/28/23 04:26, Bastian Koppelmann wrote: reported inhttps://gitlab.com/qemu-project/qemu/-/issues/1667 Signed-off-by: Bastian Koppelmann --- v1 -> v2: - Removed special case for f_arg being infinity - Clarified, why we need a special case for arg being NAN target/tricore/fpu_help

Re: [PATCH] kconfig: Add NVME to s390x machines

2023-08-28 Thread Thomas Huth
On 28/08/2023 17.01, Cédric Le Goater wrote: From: Cédric Le Goater We recently had issues with nvme devices on big endian platforms. Include their compilation on s390x to ease tests. Signed-off-by: Cédric Le Goater --- hw/nvme/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH v2 07/11] target/tricore: Implement hptof insn

2023-08-28 Thread Richard Henderson
On 8/28/23 04:26, Bastian Koppelmann wrote: Resolves:https://gitlab.com/qemu-project/qemu/-/issues/1667 Signed-off-by: Bastian Koppelmann --- v1 -> v2: - Removed special case for f_arg being infinity - Clarified, why we need a special case for arg being NAN target/tricore/fpu_helper.

Re: [PATCH v2 09/11] target/tricore: Swap src and dst reg for RCRR_INSERT

2023-08-28 Thread Richard Henderson
On 8/28/23 04:26, Bastian Koppelmann wrote: Signed-off-by: Bastian Koppelmann --- target/tricore/translate.c | 8 tests/tcg/tricore/asm/macros.h | 9 + tests/tcg/tricore/asm/test_insert.S | 5 + 3 files changed, 18 insertions(+), 4 deletions(-) Acked-by:

Re: [PATCH for-8.2] target/s390x/kvm: Simplify the GPRs, ACRs, CRs and prefix synchronization code

2023-08-28 Thread Thomas Huth
On 14/08/2023 21.06, Thomas Huth wrote: KVM_SYNC_GPRS, KVM_SYNC_ACRS, KVM_SYNC_CRS and KVM_SYNC_PREFIX are available since kernel 3.10. Since we already require at least kernel 3.15 in the s390x KVM code, we can assume that the KVM_CAP_SYNC_REGS sync code is always possible for these registers, a

Re: [PATCH 3/8] target/translate: Include missing 'exec/cpu_ldst.h' header

2023-08-28 Thread Richard Henderson
On 8/28/23 07:55, Philippe Mathieu-Daudé wrote: All these files access the CPU LD/ST API declared in "exec/cpu_ldst.h". Signed-off-by: Philippe Mathieu-Daudé --- target/avr/helper.c | 1 + target/i386/tcg/fpu_helper.c | 1 + target/i386/tcg/sysemu/excp_helper.c | 1 +

Re: [PATCH 4/8] target/translate: Remove unnecessary 'exec/cpu_ldst.h' header

2023-08-28 Thread Richard Henderson
On 8/28/23 07:55, Philippe Mathieu-Daudé wrote: All these files only access the translator_ld/st API declared in "exec/translator.h". The CPU ld/st API from declared in "exec/cpu_ldst.h" is not used, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/translate.c | 1 - tar

Re: [PATCH 6/8] target/helpers: Remove unnecessary 'exec/cpu_ldst.h' header

2023-08-28 Thread Richard Henderson
On 8/28/23 07:55, Philippe Mathieu-Daudé wrote: These files don't use the CPU ld/st API, remove the unnecessary "exec/cpu_ldst.h" header. Signed-off-by: Philippe Mathieu-Daudé --- target/cris/op_helper.c | 1 - target/mips/tcg/fpu_helper.c | 1 - target/mips/tcg/sysemu/l

Re: [PATCH 5/8] target/translate: Restrict 'exec/cpu_ldst.h' to user emulation

2023-08-28 Thread Richard Henderson
On 8/28/23 07:55, Philippe Mathieu-Daudé wrote: Only handle_sigsegv_accerr_write(), declared with user emulation, requires "exec/cpu_ldst.h" (for the abi_ptr typedef). Signed-off-by: Philippe Mathieu-Daudé --- include/exec/exec-all.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Rev

Re: [PATCH 7/8] target/helper: Remove unnecessary 'qemu/main-loop.h' header

2023-08-28 Thread Richard Henderson
On 8/28/23 07:55, Philippe Mathieu-Daudé wrote: "qemu/main-loop.h" declares functions related to QEMU's main loop mutex, which these files don't access. Remove the unused "qemu/main-loop.h" header. Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/pmu.h | 2 -- target/

Re: [PATCH 8/8] target/mips: Remove unused headers in lcsr_helper.c

2023-08-28 Thread Richard Henderson
On 8/28/23 07:55, Philippe Mathieu-Daudé wrote: This files only access the address_space_ld/st API, declared in "exec/cpu-all.h", already included by "cpu.h". Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/sysemu/lcsr_helper.c | 3 --- 1 file changed, 3 deletions(-) Reviewed-by:

[PATCH 10/10] accel/tcg: Introduce do_st16_mmio_leN

2023-08-28 Thread Richard Henderson
Split out int_st_mmio_leN, to be used by both do_st_mmio_leN and do_st16_mmio_leN. Move the locks down into the two functions, since each one now covers all accesses to once page. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 88 ++ 1 file

[PATCH 01/10] accel/tcg: Simplify tlb_plugin_lookup

2023-08-28 Thread Richard Henderson
Now that we defer address space update and tlb_flush until the next async_run_on_cpu, the plugin run at the end of the instruction no longer has to contend with a flushed tlb. Therefore, delete SavedIOTLB entirely. Properly return false from tlb_plugin_lookup when we do not have a tlb match. Fixe

[PATCH 06/10] accel/tcg: Replace direct use of io_readx/io_writex in do_{ld, st}_1

2023-08-28 Thread Richard Henderson
Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index d2e4c4459d..6a7f6bf701 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -2339,7 +2339,8 @@ static uint8_t do_l

[PATCH 09/10] accel/tcg: Introduce do_ld16_mmio_beN

2023-08-28 Thread Richard Henderson
Split out int_ld_mmio_beN, to be used by both do_ld_mmio_beN and do_ld16_mmio_beN. Move the locks down into the two functions, since each one now covers all accesses to once page. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 91 ++ 1 file

[PATCH 08/10] accel/tcg: Merge io_writex into do_st_mmio_leN

2023-08-28 Thread Richard Henderson
Avoid multiple calls to io_prepare for unaligned acceses. One call to do_st_mmio_leN will never cross pages. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 82 +- 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/accel/tcg/cput

[PATCH 00/10] plugin and tcg cleanups to cputlb.c.

2023-08-28 Thread Richard Henderson
Based-on: 20230826232415.80233-1-richard.hender...@linaro.org ("[PATCH 0/3] softmmu: Use async_run_on_cpu in tcg_commit") Remove the SaveIOTLB hackery, now that the flush won't happen until the TB. Clean up the locking, so that we don't try to take the lock twice. Clean up the iotlb lookup so th

[PATCH 05/10] accel/tcg: Merge cpu_transaction_failed into io_failed

2023-08-28 Thread Richard Henderson
Push computation down into the if statements to the point the data is used. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 33 + 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b1dc213675..d2

[PATCH 02/10] accel/tcg: Split out io_prepare and io_failed

2023-08-28 Thread Richard Henderson
These are common code from io_readx and io_writex. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 77 +++--- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index fcf6ccebff..17987f74e5 100

[PATCH 07/10] accel/tcg: Merge io_readx into do_ld_mmio_beN

2023-08-28 Thread Richard Henderson
Avoid multiple calls to io_prepare for unaligned acceses. One call to do_ld_mmio_beN will never cross pages. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 84 +- 1 file changed, 30 insertions(+), 54 deletions(-) diff --git a/accel/tcg/cput

[PATCH 04/10] plugin: Simplify struct qemu_plugin_hwaddr

2023-08-28 Thread Richard Henderson
Rather than saving MemoryRegionSection and offset, save phys_addr and MemoryRegion. This matches up much closer with the plugin api. Signed-off-by: Richard Henderson --- include/qemu/plugin-memory.h | 11 ++- accel/tcg/cputlb.c | 16 +--- plugins/api.c

[PATCH 03/10] accel/tcg: Use CPUTLBEntryFull.phys_addr in io_failed

2023-08-28 Thread Richard Henderson
Since the introduction of CPUTLBEntryFull, we can recover the full cpu address space physical address without having to examine the MemoryRegionSection. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/accel/

Re: [PATCH 00/11] Lower TCG vector ops to LSX

2023-08-28 Thread Richard Henderson
On 8/28/23 10:29, Richard Henderson wrote: We should probably improve tcg_gen_not_vec to try NOR.  This would support loongarch64, and allow the special expansion in PPC and S390X to be removed. Hmm, no. The tcg optimizer does better when NOT is supported directly. There is a whole series of f

[PATCH] tcg: Remove vecop_list check from tcg_gen_not_vec

2023-08-28 Thread Richard Henderson
The not pattern is always available via generic expansion. See debug block in tcg_can_emit_vecop_list. Signed-off-by: Richard Henderson --- tcg/tcg-op-vec.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index ad8ee08a7e..094298bb27

[PATCH v8 05/12] virtio-sound: handle VIRTIO_SND_R_PCM_INFO request

2023-08-28 Thread Emmanouil Pitsidianakis
Respond to the VIRTIO_SND_R_PCM_INFO control request with the parameters of each requested PCM stream. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed-off-by: Emmanouil Pitsidianakis

[PATCH v8 02/12] Add virtio-sound-pci device

2023-08-28 Thread Emmanouil Pitsidianakis
This patch adds a PCI wrapper device for the virtio-sound device. It is necessary to instantiate a virtio-snd device in a guest. All sound logic will be added to the virtio-snd device in the following commits. To add this device with a guest, you'll need a >=5.13 kernel compiled with CONFIG_SND_VI

[PATCH v8 10/12] virtio-sound: implement audio output (TX)

2023-08-28 Thread Emmanouil Pitsidianakis
Handle output IO messages in the transmit (TX) virtqueue. It allocates a VirtIOSoundPCMBlock for each IO message and copies the data buffer to it. When the IO buffer is written to the host's sound card, the guest will be notified that it has been consumed. The lifetime of an IO message is: 1. Gu

[PATCH v8 01/12] Add virtio-sound device stub

2023-08-28 Thread Emmanouil Pitsidianakis
Add a new VIRTIO device for the virtio sound device id. Functionality will be added in the following commits. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Reviewed-by: Alex Bennée Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed-

[PATCH v8 03/12] virtio-sound: handle control messages and streams

2023-08-28 Thread Emmanouil Pitsidianakis
Receive guest requests in the control (CTRL) queue of the virtio sound device and reply with a NOT SUPPORTED error to all control commands. The receiving handler is virtio_snd_handle_ctrl(). It stores all control messages in the queue in the device's command queue. Then it calls virtio_snd_process

[PATCH v8 00/12] Add VIRTIO sound card

2023-08-28 Thread Emmanouil Pitsidianakis
This patch series adds an audio device implementing the recent virtio sound spec (1.2) and a corresponding PCI wrapper device. v8 can be found online at: https://gitlab.com/epilys/qemu/-/tree/virtio-snd-v8 Ref 69eb5f4fbae731f5fc05dea8a5f4b656e0de127f Main differences with v7 patch series [^v7]

[PATCH v8 09/12] virtio-sound: handle VIRTIO_SND_R_PCM_RELEASE

2023-08-28 Thread Emmanouil Pitsidianakis
Handle the PCM release control request, which is necessary for flushing pending sound IO. No IO is handled yet so currently it only replies to the request. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Ant

[PATCH v8 11/12] virtio-sound: implement audio capture (RX)

2023-08-28 Thread Emmanouil Pitsidianakis
To perform audio capture we duplicate the TX logic of the previous commit with the following difference: we receive data from the QEMU audio backend and write it in the virt queue IO buffers the guest sends to QEMU. When they are full (i.e. they have `period_bytes` amount of data) or when recording

[PATCH v8 12/12] docs/system: add basic virtio-snd documentation

2023-08-28 Thread Emmanouil Pitsidianakis
This commit adds basic documentation for using virtio-snd. Signed-off-by: Emmanouil Pitsidianakis --- docs/system/device-emulation.rst | 1 + docs/system/devices/virtio-snd.rst | 49 ++ 2 files changed, 50 insertions(+) create mode 100644 docs/system/devices/virti

[PATCH v8 08/12] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE

2023-08-28 Thread Emmanouil Pitsidianakis
Handles the PCM prepare control request. It initializes a PCM stream when the guests asks for it. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed-off-by: Emmanouil Pitsidianakis ---

[PATCH v8 07/12] virtio-sound: handle VIRTIO_SND_R_PCM_SET_PARAMS

2023-08-28 Thread Emmanouil Pitsidianakis
Handle the set parameters control request. It reconfigures a stream based on a guest's preference if the values are valid and supported. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed

[PATCH v8 04/12] virtio-sound: set PCM stream parameters

2023-08-28 Thread Emmanouil Pitsidianakis
This commit sets the virtio-snd device's default PCM parameters in virtio_snd_pcm_set_params_impl(). The same function will be used to set parameters from the guest with VIRTIO_SND_R_PCM_SET_PARAMS in a follow-up commit. PCM parameters describe the sound card parameters that the guest's kernel see

[PATCH v8 06/12] virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP}

2023-08-28 Thread Emmanouil Pitsidianakis
Handle the start and stop control messages for a stream_id. This request does nothing at the moment except for replying to it. Audio playback or capture will be started/stopped here in follow-up commits. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471

<    1   2   3   4   >