Re: [PATCH v3] target/s390x: filter deprecated properties based on model expansion type

2024-07-19 Thread Markus Armbruster
Collin Walling writes: > Currently, there is no way to execute the query-cpu-model-expansion > command to retrieve a comprehenisve list of deprecated properties, as > the result is dependent per-model. To enable this, the expansion output > is modified as such: > > When reporting a "full" CPU

[PING][PATCH] hw/intc/ioapic: Delete a wrong IRQ redirection on I/O APIC

2024-07-19 Thread TaiseiIto
This is a ping for the patch below. https://lore.kernel.org/qemu-devel/ty0pr0101mb42850337f8917d1f514107fba4...@ty0pr0101mb4285.apcprd01.prod.exchangelabs.com/

[PATCH v6 8/8] tests/avocado: Boot Linux for RV32 cpu on RV64 QEMU

2024-07-19 Thread LIU Zhiwei
make check-avocado AVOCADO_TESTS=tests/avocado/tuxrun_baselines.py: \ TuxRunBaselineTest:test_riscv64_rv32 Signed-off-by: LIU Zhiwei Suggested-by: Daniel Henrique Barboza --- tests/avocado/tuxrun_baselines.py | 16 1 file changed, 16 insertions(+) diff --git

[PATCH v6 7/8] target/riscv: Add any32 and max32 CPU for RV64 QEMU

2024-07-19 Thread LIU Zhiwei
We may need 32-bit max or 32-bit any CPU for RV64 QEMU. Thus we add these two CPUs for RV64 QEMU. The reason we don't expose them to RV32 QEMU is that we already have max or any cpu with the same configuration. Another reason is that we want to follow the RISC-V custom where addw instruction

[PATCH v6 6/8] target/riscv: Enable RV32 CPU support in RV64 QEMU

2024-07-19 Thread LIU Zhiwei
From: TANG Tiancheng Add gdb XML files and adjust CPU initialization to allow running RV32 CPUs in RV64 QEMU. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis --- configs/targets/riscv64-softmmu.mak | 2 +- target/riscv/cpu.c | 17

[PATCH v6 5/8] target/riscv: Correct mcause/scause bit width for RV32 in RV64 QEMU

2024-07-19 Thread LIU Zhiwei
From: TANG Tiancheng Ensure mcause high bit is correctly set by using 32-bit width for RV32 mode and 64-bit width for RV64 mode. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis --- target/riscv/cpu_helper.c | 8 ++-- 1 file changed, 6 insertions(+), 2

[PATCH v6 4/8] target/riscv: Detect sxl to set bit width for RV32 in RV64

2024-07-19 Thread LIU Zhiwei
From: TANG Tiancheng Ensure correct bit width based on sxl when running RV32 on RV64 QEMU. This is required as MMU address translations run in S-mode. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis --- target/riscv/cpu_helper.c | 17 - 1

[PATCH v6 3/8] target/riscv: Correct SXL return value for RV32 in RV64 QEMU

2024-07-19 Thread LIU Zhiwei
From: TANG Tiancheng Ensure that riscv_cpu_sxl returns MXL_RV32 when runningRV32 in an RV64 QEMU. Signed-off-by: TANG Tiancheng Fixes: 05e6ca5e156 ("target/riscv: Ignore reserved bits in PTE for RV64") Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 5 - 1

[PATCH v6 1/8] target/riscv: Add fw_dynamic_info32 for booting RV32 OpenSBI

2024-07-19 Thread LIU Zhiwei
From: TANG Tiancheng RV32 OpenSBI need a fw_dynamic_info parameter with 32-bit fields instead of target_ulong. In RV64 QEMU, target_ulong is 64. So it is not right for booting RV32 OpenSBI. We create a fw_dynmaic_info32 struct for this purpose. Signed-off-by: TANG Tiancheng Reviewed-by: Liu

[PATCH v6 2/8] target/riscv: Adjust PMP size for no-MMU RV64 QEMU running RV32

2024-07-19 Thread LIU Zhiwei
From: TANG Tiancheng Ensure pmp_size is correctly determined using mxl for RV32 in RV64 QEMU. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis --- target/riscv/pmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/pmp.c

[PATCH v6 0/8] target/riscv: Expose RV32 cpu to RV64 QEMU

2024-07-19 Thread LIU Zhiwei
This patch set aims to expose 32-bit RISC-V cpu to RV64 QEMU. Thus qemu-system-riscv64 can directly boot a RV32 Linux. This patch set has been tested with 6.9.0 Linux Image. And add an avocado tuxrun test in tests/avocado. v6: Use TUXRUN test case instead of boot_linux_console Add any32 and

[PATCH v5.1 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-19 Thread Joao Martins
By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can force enable without dirty page tracking via enable-migration=on, but that option is generally left for testing

Re: [RFC PATCH 6/7] migration/multifd: Move payload storage out of the channel parameters

2024-07-19 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Jul 19, 2024 at 01:54:37PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Thu, Jul 18, 2024 at 07:32:05PM -0300, Fabiano Rosas wrote: >> >> Peter Xu writes: >> >> >> >> > On Thu, Jul 18, 2024 at 06:27:32PM -0300, Fabiano Rosas wrote: >> >> >> Peter Xu

Re: [RFC PATCH v5 16/16] hw/char/pl011: Implement TX FIFO

2024-07-19 Thread Mark Cave-Ayland
On 19/07/2024 19:10, Philippe Mathieu-Daudé wrote: If the UART back-end chardev doesn't drain data as fast as stdout does or blocks, buffer in the TX FIFO to try again later. This avoids having the IO-thread busy waiting on chardev back-ends, reported recently when testing the Trusted

Re: [PULL 0/3] loongarch-to-apply queue

2024-07-19 Thread Richard Henderson
On 7/19/24 12:26, Song Gao wrote: Merge tag 'pull-target-arm-20240718' ofhttps://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-07-19 07:02:17 +1000) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240719 for you to fetch

Re: [PATCH 3/3] util/fifo8: Introduce fifo8_change_capacity()

2024-07-19 Thread Mark Cave-Ayland
On 19/07/2024 16:16, Philippe Mathieu-Daudé wrote: FIFOs can be resized at runtime. Introduce the fifo8_change_capacity() method to do that. When capacity is changed, the FIFO must be reset. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 10 ++ util/fifo8.c

Re: [PATCH 2/3] util/fifo8: Use fifo8_reset() in fifo8_create()

2024-07-19 Thread Mark Cave-Ayland
On 19/07/2024 16:16, Philippe Mathieu-Daudé wrote: Avoid open-coding fifo8_reset() in fifo8_create(). Signed-off-by: Philippe Mathieu-Daudé --- util/fifo8.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/util/fifo8.c b/util/fifo8.c index

Re: [PATCH 1/3] chardev/char-fe: Document returned value on error

2024-07-19 Thread Mark Cave-Ayland
On 19/07/2024 16:16, Philippe Mathieu-Daudé wrote: qemu_chr_fe_add_watch() and qemu_chr_fe_write[_all]() return -1 on error. Mention it in the documentation. Signed-off-by: Philippe Mathieu-Daudé --- include/chardev/char-fe.h | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v2 RESEND] target/ppc/arch_dump: set prstatus pid to cpuid

2024-07-19 Thread Omar Sandoval
Every other architecture does this, and debuggers need it to be able to identify which prstatus note corresponds to which CPU. Reviewed-by: Thomas Huth Reviewed-by: Harsh Prateek Bora Signed-off-by: Omar Sandoval --- Resend of [1]. No changes other than adding Thomas's Reviewed-by. Thanks,

[PATCH v3] target/s390x: filter deprecated properties based on model expansion type

2024-07-19 Thread Collin Walling
Currently, there is no way to execute the query-cpu-model-expansion command to retrieve a comprehenisve list of deprecated properties, as the result is dependent per-model. To enable this, the expansion output is modified as such: When reporting a "full" CPU model, show the *entire* list of

[PATCH v5 06/16] hw/char/pl011: Extract pl011_write_txdata() from pl011_write()

2024-07-19 Thread Philippe Mathieu-Daudé
When implementing FIFO, this code will become more complex. Start by factoring it out to a new pl011_write_txdata() function. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- hw/char/pl011.c | 20 +--- 1 file changed, 13

[PATCH v5 07/16] hw/char/pl011: Extract pl011_read_rxdata() from pl011_read()

2024-07-19 Thread Philippe Mathieu-Daudé
To keep MemoryRegionOps read/write handlers with similar logic, factor pl011_read_txdata() out of pl011_read(), similar to what the previous commit did to pl011_write(). No functional change intended. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/char/pl011.c | 41

[PATCH v5 01/16] tests/avocado: Add 'device:pl011' tag to tests exercising PL011 UART

2024-07-19 Thread Philippe Mathieu-Daudé
Add the 'device:pl011' tag to various tests using the PL011 UART, so we can run them all at once using: $ make check-avocado AVOCADO_TAGS='device:pl011' Signed-off-by: Philippe Mathieu-Daudé --- tests/avocado/boot_linux.py | 1 + tests/avocado/boot_linux_console.py | 2 ++

[RFC PATCH v5 16/16] hw/char/pl011: Implement TX FIFO

2024-07-19 Thread Philippe Mathieu-Daudé
If the UART back-end chardev doesn't drain data as fast as stdout does or blocks, buffer in the TX FIFO to try again later. This avoids having the IO-thread busy waiting on chardev back-ends, reported recently when testing the Trusted Reference Stack and using the socket backend. Implement

[PATCH v5 11/16] hw/char/pl011: Rename RX FIFO methods

2024-07-19 Thread Philippe Mathieu-Daudé
In preparation of having a TX FIFO, rename the RX FIFO methods. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/char/pl011.c | 12 ++-- hw/char/trace-events | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff

[PATCH v5 09/16] tests/qtest: Update tests using PL011 UART

2024-07-19 Thread Philippe Mathieu-Daudé
We weren't enabling the PL011 TX UART before using it on the raspi and virt machines. Update the ASM code prefixing: *UART_CTRL = UART_ENABLE | TX_ENABLE; to: while (true) { *UART_DATA = 'T'; } Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/boot-serial-test.c | 15

[PATCH v5 15/16] hw/char/pl011: Drain TX FIFO when no backend connected

2024-07-19 Thread Philippe Mathieu-Daudé
When no character backend is connected, the PL011 frontend just drains the FIFO. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/pl011.c | 13 + hw/char/trace-events | 1 + 2 files changed, 14 insertions(+) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index

[PATCH v5 13/16] hw/char/pl011: Introduce pl011_xmit() as GSource

2024-07-19 Thread Philippe Mathieu-Daudé
Extract pl011_xmit() from pl011_write_txdata(). Use the FIFO to pass the character to be transmitted. Implement it using the FEWatchFunc prototype, since we want to register it as GSource later. While the return value is not yet used, we return G_SOURCE_REMOVE meaning the GSource is removed from

[PATCH v5 12/16] hw/char/pl011: Add transmit FIFO to PL011State

2024-07-19 Thread Philippe Mathieu-Daudé
In order to make the next commit easier to review, introduce the transmit FIFO, but do not yet use it. We only migrate the TX FIFO if it is in use. When migrating from new to old VM: - if the fifo is empty, migration will still work because of the subsection. - if the fifo is not empty, the

[PATCH v5 14/16] hw/char/pl011: Consider TX FIFO overrun error

2024-07-19 Thread Philippe Mathieu-Daudé
When transmission is disabled, characters are still queued to the FIFO which eventually overruns. Report that error condition in the status register. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/pl011.c | 17 + hw/char/trace-events | 1 + 2 files changed, 18

[PATCH v5 10/16] hw/char/pl011: Check if receiver is enabled

2024-07-19 Thread Philippe Mathieu-Daudé
Do not receive characters when UART or receiver are disabled. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/char/pl011.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index c76283dccf..0ce91c13d3

[PATCH v5 02/16] hw/char/pl011: Remove unused 'readbuff' field

2024-07-19 Thread Philippe Mathieu-Daudé
Since its introduction in commit cdbdb648b7 ("ARM Versatile Platform Baseboard emulation.") PL011State::readbuff as never been used. Remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/char/pl011.h | 1 - hw/char/pl011.c | 2 +- 2 files changed, 1 insertion(+), 2

[PATCH v5 05/16] hw/char/pl011: Split RX/TX path of pl011_reset_fifo()

2024-07-19 Thread Philippe Mathieu-Daudé
To be able to reset the RX or TX FIFO separately, split pl011_reset_fifo() in two. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/char/pl011.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git

[PATCH v5 04/16] hw/char/pl011: Move pl011_loopback_enabled|tx() around

2024-07-19 Thread Philippe Mathieu-Daudé
We'll soon use pl011_loopback_enabled() and pl011_loopback_tx() from functions defined before their declarations. In order to avoid forward-declaring them, move them around. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/pl011.c | 66 - 1 file

[PATCH v5 08/16] hw/char/pl011: Warn when using disabled transmitter

2024-07-19 Thread Philippe Mathieu-Daudé
We shouldn't transmit characters when the full UART or its transmitter is disabled. However we don't want to break the possibly incomplete "my first bare metal assembly program"s, so we choose to simply display a warning when this occurs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex

[PATCH v5 03/16] hw/char/pl011: Move pl011_put_fifo() earlier

2024-07-19 Thread Philippe Mathieu-Daudé
Avoid forward-declaring pl011_put_fifo() by moving it earlier. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/pl011.c | 46 ++ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index

[PATCH v5 00/16] hw/char/pl011: Implement TX (async) FIFO to avoid blocking the main loop

2024-07-19 Thread Philippe Mathieu-Daudé
Hi, This series add support for (async) FIFO on the transmit path of the PL011 UART. Last patch still broken (chars are emitted async), still patches 1-11 could be merged for this release... Since v4: - Rebased (loopback) - Addressed Richard & Juan migration comments - Split in smaller patches

[PATCH] tests/avocado: Allow overwritting AVOCADO_SHOW env variable

2024-07-19 Thread Philippe Mathieu-Daudé
The 'app' level logging is useful, but sometimes we want more, for example QEMU leverages the 'console' logging. Allow overwritting AVOCADO_SHOW from environment, i.e.: $ make check-avocado AVOCADO_SHOW='app,console' Signed-off-by: Philippe Mathieu-Daudé --- tests/Makefile.include | 2 +- 1

Re: [RFC PATCH 6/7] migration/multifd: Move payload storage out of the channel parameters

2024-07-19 Thread Peter Xu
On Fri, Jul 19, 2024 at 01:54:37PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Jul 18, 2024 at 07:32:05PM -0300, Fabiano Rosas wrote: > >> Peter Xu writes: > >> > >> > On Thu, Jul 18, 2024 at 06:27:32PM -0300, Fabiano Rosas wrote: > >> >> Peter Xu writes: > >> >> > >> >> >

Re: [RFC PATCH v3] contrib/plugins: control flow plugin

2024-07-19 Thread Pierrick Bouvier
On 7/19/24 03:07, Alex Bennée wrote: Pierrick Bouvier writes: On 7/18/24 07:59, Alex Bennée wrote: This is a simple control flow tracking plugin that uses the latest inline and conditional operations to detect and track control flow changes. It is currently an exercise at seeing how useful

Re: [PATCH] tests/avocado: Move common Avocado tags to class

2024-07-19 Thread Thomas Huth
On 19/07/2024 17.13, Philippe Mathieu-Daudé wrote: When Avocado tags apply to all tests in a class, we can define them once in the class: they will be applied to all test methods. Signed-off-by: Philippe Mathieu-Daudé --- tests/avocado/boot_linux.py | 2 +-

[PATCH v1 6/9] Add CPUID enumeration for RDT

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Add CPUID enumeration for intel RDT monitoring and allocation, as well as the flags used in the enumeration code. Signed-off-by: Hendrik Wüthrich --- hw/i386/rdt.c | 29 ++ include/hw/i386/rdt.h | 29 ++ target/i386/cpu.c | 91

[PATCH] hw/acpi/ich9: Add periodic and swsmi timer

2024-07-19 Thread Dominic Prinz
This patch implements the periodic and the swsmi ICH9 chipset timer. They are especially useful when prototyping UEFI firmware (e.g. with EDK2's OVMF) with QEMU. This includes that writes to the SMI_STS register are enabled for the corresponding two bits. Signed-off-by: Dominic Prinz ---

[PATCH v1 7/9] Add RDT feature flags.

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Add RDT features to feature word / TCG. Signed-off-by: Hendrik Wüthrich --- target/i386/cpu.c | 30 -- target/i386/cpu.h | 2 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index

[PATCH v1 4/9] Add RDT functionality

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Add RDT code to Associate CLOSID with RMID / set RMID for monitoring, write COS, and read monitoring data. This patch does not add code for the guest to interact through these things with MSRs, only the actual ability for the RDT device to do them. Signed-off-by: Hendrik

[PATCH v1 8/9] Adjust CPUID level for RDT features

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Adjust minimum CPUID level if RDT monitoring or allocation features are enabled to ensure that CPUID will return them. Signed-off-by: Hendrik Wüthrich --- target/i386/cpu.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/target/i386/cpu.c

[PATCH v1 9/9] Adjust level for RDT on full_cpuid_auto_level

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Make sure that RDT monitoring and allocation features are included in in full_cpuid_auto_level. Signed-off-by: Hendrik Wüthrich --- target/i386/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index

[PATCH v1 2/9] Add state for RDT device.

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Add structures and variables needed to emulate Intel RDT, including module-internal sturctures and state in ArchCPU. No functionality yet. Signed-off-by: Hendrik Wüthrich --- hw/i386/rdt.c | 33 + target/i386/cpu.h | 5 + 2

[PATCH v1 0/9] target:386/ Emulate Intel RDT features needed to mount ResCtrl in Linux

2024-07-19 Thread Hendrik Wuethrich
From: Hendrik Wüthrich The aim of this patch series is to emulate Intel RDT features in order to make testing of the linux Resctrl subsystem possible with Qemu. A branch with the patches applied can be found at: https://github.com/Gray-Colors/Intel_RDT_patches_applied The changes made

[PATCH v1 1/9] Add Intel RDT device to config.

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Change config to show RDT, add minimal code to the rdt.c module to make sure things still compile. Signed-off-by: Hendrik Wüthrich --- hw/i386/Kconfig | 4 hw/i386/meson.build | 1 + hw/i386/rdt.c | 49 +++

[PATCH v1 3/9] Add init and realize funciontality for RDT device.

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Add code to initialize all necessary state for the RDT device. Signed-off-by: Hendrik Wüthrich --- hw/i386/rdt.c | 28 1 file changed, 28 insertions(+) diff --git a/hw/i386/rdt.c b/hw/i386/rdt.c index cf246ab835..259dafc963 100644 ---

[PATCH v1 5/9] Add RDT device interface through MSRs

2024-07-19 Thread Hendrik Wuethrich
From: ‪Hendrik Wüthrich Implement rdmsr and wrmsr for the following MSRs: * MSR_IA32_PQR_ASSOC * MSR_IA32_QM_EVTSEL * MSR_IA32_QM_CTR * IA32_L3_QOS_Mask_n * IA32_L2_QOS_Mask_n * IA32_L2_QoS_Ext_BW_Thrtl_n This allows for the guest to call RDT-internal functions to associate an RMID with a

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-19 Thread Joao Martins
On 19/07/2024 15:24, Joao Martins wrote: > On 19/07/2024 15:17, Cédric Le Goater wrote: >> On 7/19/24 14:05, Joao Martins wrote: >>> By default VFIO migration is set to auto, which will support live >>> migration if the migration capability is set *and* also dirty page >>> tracking is supported.

Re: [RFC PATCH 6/7] migration/multifd: Move payload storage out of the channel parameters

2024-07-19 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Jul 18, 2024 at 07:32:05PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Thu, Jul 18, 2024 at 06:27:32PM -0300, Fabiano Rosas wrote: >> >> Peter Xu writes: >> >> >> >> > On Thu, Jul 18, 2024 at 04:39:00PM -0300, Fabiano Rosas wrote: >> >> >> v2 is

[PATCH] hw/vfio/container: Fix SIGSEV on vfio_container_instance_finalize()

2024-07-19 Thread Eric Auger
In vfio_connect_container's error path, the base container is removed twice form the VFIOAddressSpace QLIST: first on the listener_release_exit label and second, on free_container_exit label, through object_unref(container), which calls vfio_container_instance_finalize(). Let's remove the first

Re: [PATCH v3 2/5] target/arm/kvm: Fix PMU feature bit early

2024-07-19 Thread Akihiko Odaki
On 2024/07/19 21:21, Cornelia Huck wrote: On Fri, Jul 19 2024, Akihiko Odaki wrote: On 2024/07/18 21:07, Peter Maydell wrote: On Tue, 16 Jul 2024 at 13:50, Akihiko Odaki wrote: kvm_arm_get_host_cpu_features() used to add the PMU feature unconditionally, and kvm_arch_init_vcpu() removed it

Re: [PATCH V2 06/11] migration: fix mismatched GPAs during cpr

2024-07-19 Thread Peter Xu
On Sun, Jun 30, 2024 at 12:40:29PM -0700, Steve Sistare wrote: > For new cpr modes, ramblock_is_ignored will always be true, because the > memory is preserved in place rather than copied. However, for an ignored > block, parse_ramblock currently requires that the received address of the > block

Re: [RFC PATCH] cxl: avoid duplicating report from MCE & device

2024-07-19 Thread Dave Jiang
On 7/1/24 7:12 PM, Shiyang Ruan wrote: > > > 在 2024/6/25 21:56, Shiyang Ruan 写道: >> >> >> 在 2024/6/22 1:51, Dan Williams 写道: >>> Shiyang Ruan wrote: Background: Since CXL device is a memory device, while CPU consumes a poison page of CXL device, it always triggers a MCE by

Re: [PATCH v9 4/7] qapi: add blockdev-replace command

2024-07-19 Thread Vladimir Sementsov-Ogievskiy
On 18.07.24 15:00, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add a command that can replace bs in following BdrvChild structures: - qdev blk root child - block-export blk root child - any child of BlockDriverState selected by child-name Signed-off-by: Vladimir

Re: [PATCH v5 00/18] SMMUv3 nested translation support

2024-07-19 Thread Peter Maydell
On Fri, 19 Jul 2024 at 16:36, Julien Grall wrote: > > Hi, > > On 18/07/2024 10:43, Julien Grall wrote: > > Hi Eric, > > > > On 17/07/2024 18:43, Eric Auger wrote: > >> Hi Peter, Richard, > >> > >> On 7/17/24 17:09, Jean-Philippe Brucker wrote: > >>> On Mon, Jul 15, 2024 at 08:45:00AM +,

Re: [PATCH v5 00/18] SMMUv3 nested translation support

2024-07-19 Thread Julien Grall
Hi, On 18/07/2024 10:43, Julien Grall wrote: Hi Eric, On 17/07/2024 18:43, Eric Auger wrote: Hi Peter, Richard, On 7/17/24 17:09, Jean-Philippe Brucker wrote: On Mon, Jul 15, 2024 at 08:45:00AM +, Mostafa Saleh wrote: Currently, QEMU supports emulating either stage-1 or stage-2 SMMUs

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-19 Thread Joao Martins
On 19/07/2024 15:24, Joao Martins wrote: > On 19/07/2024 15:17, Cédric Le Goater wrote: >> On 7/19/24 14:05, Joao Martins wrote: >>> By default VFIO migration is set to auto, which will support live >>> migration if the migration capability is set *and* also dirty page >>> tracking is supported.

Re: [PATCH v2] target/s390x: filter deprecated properties based on model expansion type

2024-07-19 Thread Collin Walling
On 7/19/24 7:11 AM, Markus Armbruster wrote: > Thomas Huth writes: > >> On 18/07/2024 20.22, Collin Walling wrote: >>> On 7/18/24 9:39 AM, Markus Armbruster wrote: Collin Walling writes: > As s390 CPU models progress and deprecated properties are dropped > outright, it will be

[PATCH 0/3] util/fifo8: Introduce fifo8_change_capacity()

2024-07-19 Thread Philippe Mathieu-Daudé
Preliminary series to PL011 FIFO work: - Clarify doc in qemu_chr_fe_* - Introduce fifo8_change_capacity() Philippe Mathieu-Daudé (3): chardev/char-fe: Document returned value on error util/fifo8: Use fifo8_reset() in fifo8_create() util/fifo8: Introduce fifo8_change_capacity()

Re: [PATCH v2] target/s390x: filter deprecated properties based on model expansion type

2024-07-19 Thread Collin Walling
On 7/19/24 6:16 AM, Thomas Huth wrote: > On 18/07/2024 20.22, Collin Walling wrote: >> On 7/18/24 9:39 AM, Markus Armbruster wrote: >>> Collin Walling writes: >>> As s390 CPU models progress and deprecated properties are dropped outright, it will be cumbersome for management apps to

[PATCH 3/3] util/fifo8: Introduce fifo8_change_capacity()

2024-07-19 Thread Philippe Mathieu-Daudé
FIFOs can be resized at runtime. Introduce the fifo8_change_capacity() method to do that. When capacity is changed, the FIFO must be reset. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 10 ++ util/fifo8.c | 7 +++ 2 files changed, 17 insertions(+) diff

[PATCH 1/3] chardev/char-fe: Document returned value on error

2024-07-19 Thread Philippe Mathieu-Daudé
qemu_chr_fe_add_watch() and qemu_chr_fe_write[_all]() return -1 on error. Mention it in the documentation. Signed-off-by: Philippe Mathieu-Daudé --- include/chardev/char-fe.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index

[PATCH 2/3] util/fifo8: Use fifo8_reset() in fifo8_create()

2024-07-19 Thread Philippe Mathieu-Daudé
Avoid open-coding fifo8_reset() in fifo8_create(). Signed-off-by: Philippe Mathieu-Daudé --- util/fifo8.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/util/fifo8.c b/util/fifo8.c index 4e01b532d9..2925fe5611 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@

[PATCH] tests/avocado: Move common Avocado tags to class

2024-07-19 Thread Philippe Mathieu-Daudé
When Avocado tags apply to all tests in a class, we can define them once in the class: they will be applied to all test methods. Signed-off-by: Philippe Mathieu-Daudé --- tests/avocado/boot_linux.py | 2 +- tests/avocado/boot_xen.py | 17 +

Re: [PATCH] tests/avocado: Move LinuxTest related code into a separate file

2024-07-19 Thread Philippe Mathieu-Daudé
On 19/7/24 14:49, Philippe Mathieu-Daudé wrote: On 19/7/24 11:50, Thomas Huth wrote: Only some few tests are using the LinuxTest class. Move the related code into a separate file so that this does not pollute the main namespace. Signed-off-by: Thomas Huth ---  

Re: [PATCH V2 02/11] migration: cpr-state

2024-07-19 Thread Peter Xu
On Sun, Jun 30, 2024 at 12:40:25PM -0700, Steve Sistare wrote: > CPR must save state that is needed after QEMU is restarted, when devices > are realized. Thus the extra state cannot be saved in the migration stream, > as objects must already exist before that stream can be loaded. Instead, >

Re: [RFC PATCH 5/7] migration/multifd: Isolate ram pages packet data

2024-07-19 Thread Fabiano Rosas
Fabiano Rosas writes: > While we cannot yet disentangle the multifd packet from page data, we > can make the code a bit cleaner by setting the page-related fields in > a separate function. > > Signed-off-by: Fabiano Rosas > --- > migration/multifd.c | 104

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-19 Thread Joao Martins
On 19/07/2024 15:17, Cédric Le Goater wrote: > On 7/19/24 14:05, Joao Martins wrote: >> By default VFIO migration is set to auto, which will support live >> migration if the migration capability is set *and* also dirty page >> tracking is supported. >> >> For testing purposes one can force enable

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-19 Thread Cédric Le Goater
On 7/19/24 14:05, Joao Martins wrote: By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can force enable without dirty page tracking via enable-migration=on, but

Re: [PATCH v5 08/13] vfio/{iommufd,container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-19 Thread Cédric Le Goater
On 7/19/24 14:04, Joao Martins wrote: Move the HostIOMMUDevice::realize() to be invoked during the attach of the device before we allocate IOMMUFD hardware pagetable objects (HWPT). This allows the use of the hw_caps obtained by IOMMU_GET_HW_INFO that essentially tell if the IOMMU behind the

Re: [PATCH v5 01/13] vfio/pci: Extract mdev check into an helper

2024-07-19 Thread Cédric Le Goater
On 7/19/24 14:04, Joao Martins wrote: In preparation to skip initialization of the HostIOMMUDevice for mdev, extract the checks that validate if a device is an mdev into helpers. A vfio_device_is_mdev() is created, and subsystems consult VFIODevice::mdev to check if it's mdev or not.

Re: [RFC PATCH 6/7] migration/multifd: Move payload storage out of the channel parameters

2024-07-19 Thread Peter Xu
On Thu, Jul 18, 2024 at 07:32:05PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Jul 18, 2024 at 06:27:32PM -0300, Fabiano Rosas wrote: > >> Peter Xu writes: > >> > >> > On Thu, Jul 18, 2024 at 04:39:00PM -0300, Fabiano Rosas wrote: > >> >> v2 is ready, but unfortunately this

[PATCH] hw/x86: add a couple of comments explaining how the kernel image is parsed

2024-07-19 Thread Ani Sinha
Cosmetic: add comments in x86_load_linux() pointing to the kernel documentation so that users can better understand the code. CC: qemu-triv...@nongnu.org Signed-off-by: Ani Sinha --- hw/i386/x86-common.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v6 0/4] docs/interop/firmware.json: scripts/qapi-gen.py compatibility

2024-07-19 Thread Philippe Mathieu-Daudé
On 19/7/24 09:37, Thomas Weißschuh wrote: Thomas Weißschuh (4): docs/interop/firmware.json: add new enum FirmwareFormat docs/interop/firmware.json: add new enum FirmwareArchitecture docs/interop/firmware.json: convert "Example" section docs: add test for

Re: [PATCH v5 00/19] Reconstruct loongson ipi driver

2024-07-19 Thread Philippe Mathieu-Daudé
On 19/7/24 14:56, Jiaxun Yang wrote: 在2024年7月18日七月 下午9:32,Philippe Mathieu-Daudé写道: Since v4: - Fix build failure due to rebase (Song) - Loongarch -> LoongArch (Song) - Added Song's tags Since v3: - Use DEFINE_TYPES() macro (unreviewed patch #1) - Update MAINTAINERS - Added Bibo's tags For

Re: [PATCH v5 00/19] Reconstruct loongson ipi driver

2024-07-19 Thread Jiaxun Yang
在2024年7月18日七月 下午9:32,Philippe Mathieu-Daudé写道: > Since v4: > - Fix build failure due to rebase (Song) > - Loongarch -> LoongArch (Song) > - Added Song's tags > > Since v3: > - Use DEFINE_TYPES() macro (unreviewed patch #1) > - Update MAINTAINERS > - Added Bibo's tags For the whole series:

Re: [PATCH] tests/avocado: Move LinuxTest related code into a separate file

2024-07-19 Thread Philippe Mathieu-Daudé
On 19/7/24 11:50, Thomas Huth wrote: Only some few tests are using the LinuxTest class. Move the related code into a separate file so that this does not pollute the main namespace. Signed-off-by: Thomas Huth --- tests/avocado/avocado_qemu/__init__.py | 239 +-

Re: [PATCH] tests/avocado/mem-addr-space-check: Remove unused "import signal"

2024-07-19 Thread Philippe Mathieu-Daudé
On 19/7/24 11:54, Thomas Huth wrote: The "signal" module is not used here, so we can remove this import statement. Signed-off-by: Thomas Huth --- tests/avocado/mem-addr-space-check.py | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v6 4/4] docs: add test for firmware.json QAPI

2024-07-19 Thread Markus Armbruster
Thomas Weißschuh writes: > To make sure that the QAPI description stays valid, add a testcase. > > Suggested-by: Philippe Mathieu-Daudé > Link: > https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b8...@linaro.org/ > Reviewed-by: Daniel P. Berrangé > Signed-off-by: Thomas

Re: [PATCH v6 1/4] docs/interop/firmware.json: add new enum FirmwareFormat

2024-07-19 Thread Markus Armbruster
Thomas Weißschuh writes: > Only a small subset of all blockdev drivers make sense for firmware > images. Introduce and use a new enum to represent this. > > This also reduces the dependency on firmware.json from the global qapi > definitions. > > Claim "Since: 3.0" for the new enum, because

Re: [PATCH v6 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture

2024-07-19 Thread Markus Armbruster
Thomas Weißschuh writes: > Only a small subset of all architectures supported by qemu make use of > firmware files. Introduce and use a new enum to represent this. > > This also removes the dependency to machine.json from the global qapi > definitions. > > Claim "Since: 3.0" for the new enum,

Re: [PATCH v3 2/5] target/arm/kvm: Fix PMU feature bit early

2024-07-19 Thread Cornelia Huck
On Fri, Jul 19 2024, Akihiko Odaki wrote: > On 2024/07/18 21:07, Peter Maydell wrote: >> On Tue, 16 Jul 2024 at 13:50, Akihiko Odaki wrote: >>> >>> kvm_arm_get_host_cpu_features() used to add the PMU feature >>> unconditionally, and kvm_arch_init_vcpu() removed it when it is actually >>> not

[PATCH v5 05/13] vfio/iommufd: Introduce auto domain creation

2024-07-19 Thread Joao Martins
There's generally two modes of operation for IOMMUFD: 1) The simple user API which intends to perform relatively simple things with IOMMUs e.g. DPDK. The process generally creates an IOAS and attaches to VFIO and mainly performs IOAS_MAP and UNMAP. 2) The native IOMMUFD API where you have fine

Re: [PATCH v5 00/13] hw/iommufd: IOMMUFD Dirty Tracking

2024-07-19 Thread Joao Martins
Hey Cedric, On 19/07/2024 13:04, Joao Martins wrote: > The unmap case is deferred until further vIOMMU support with migration > is added[3] which will then introduce the usage of > IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR in GET_DIRTY_BITMAP ioctl in the > dma unmap bitmap flow. > A couple notes

[PATCH v5 03/13] backends/iommufd: Extend iommufd_backend_get_device_info() to fetch HW capabilities

2024-07-19 Thread Joao Martins
The helper will be able to fetch vendor agnostic IOMMU capabilities supported both by hardware and software. Right now it is only iommu dirty tracking. Signed-off-by: Joao Martins Reviewed-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater --- include/sysemu/iommufd.h | 2 +- backends/iommufd.c

[PATCH v5 00/13] hw/iommufd: IOMMUFD Dirty Tracking

2024-07-19 Thread Joao Martins
This small series adds support for IOMMU dirty tracking support via the IOMMUFD backend. The hardware capability is available on most recent x86 hardware. The series is divided organized as follows: * Patch 1-2: Fixes a regression into mdev support with IOMMUFD. This one is

[PATCH v5 13/13] vfio/common: Allow disabling device dirty page tracking

2024-07-19 Thread Joao Martins
The property 'x-pre-copy-dirty-page-tracking' allows disabling the whole tracking of VF pre-copy phase of dirty page tracking, though it means that it will only be used at the start of the switchover phase. Add an option that disables the VF dirty page tracking, and fall back into container-based

[PATCH v5 04/13] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt()

2024-07-19 Thread Joao Martins
In preparation to implement auto domains have the attach function return the errno it got during domain attach instead of a bool. -EINVAL is tracked to track domain incompatibilities, and decide whether to create a new IOMMU domain. Signed-off-by: Joao Martins Reviewed-by: Cédric Le Goater

[PATCH v5 09/13] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-07-19 Thread Joao Martins
In preparation to using the dirty tracking UAPI, probe whether the IOMMU supports dirty tracking. This is done via the data stored in hiod::caps::hw_caps initialized from GET_HW_INFO. Qemu doesn't know if VF dirty tracking is supported when allocating hardware pagetable in

[PATCH v5 01/13] vfio/pci: Extract mdev check into an helper

2024-07-19 Thread Joao Martins
In preparation to skip initialization of the HostIOMMUDevice for mdev, extract the checks that validate if a device is an mdev into helpers. A vfio_device_is_mdev() is created, and subsystems consult VFIODevice::mdev to check if it's mdev or not. Signed-off-by: Joao Martins ---

[PATCH v5 02/13] vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev

2024-07-19 Thread Joao Martins
mdevs aren't "physical" devices and when asking for backing IOMMU info, it fails the entire provisioning of the guest. Fix that by skipping HostIOMMUDevice initialization in the presence of mdevs, and skip setting an iommu device when it is known to be an mdev. Cc: Zhenzhong Duan Fixes:

[PATCH v5 06/13] vfio/{iommufd,container}: Remove caps::aw_bits

2024-07-19 Thread Joao Martins
Remove caps::aw_bits which requires the bcontainer::iova_ranges being initialized after device is actually attached. Instead defer that to .get_cap() and call vfio_device_get_aw_bits() directly. This is in preparation for HostIOMMUDevice::realize() being called early during attach_device().

[PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-19 Thread Joao Martins
By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can force enable without dirty page tracking via enable-migration=on, but that option is generally left for testing

Re: [PATCH v2] scripts/checkpatch: more checks on files imported from Linux

2024-07-19 Thread Cornelia Huck
On Thu, Jul 18 2024, Stefano Garzarella wrote: > If a file imported from Linux is touched, emit a warning and suggest > using scripts/update-linux-headers.sh. > > Also check that updating imported files from Linux are not mixed with > other changes, in which case emit an error. > >

[PATCH v5 11/13] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support

2024-07-19 Thread Joao Martins
ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI that fetches the bitmap that tells what was dirty in an IOVA range. A single bitmap is allocated and used across all the hwpts sharing an IOAS which is then used in log_sync() to set Qemu global bitmaps. Signed-off-by: Joao Martins

  1   2   >