[PATCH v2 08/13] accel/tcg: Move @iommu_notifiers from CPUState to TCG AccelCPUState

2024-04-29 Thread Philippe Mathieu-Daudé
@iommu_notifiers is specific to TCG system emulation, move it to AccelCPUState. Restrict TCG specific code in system/physmem.c, adding an empty stub for tcg_register_iommu_notifier(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id:

[PATCH v2 12/13] accel/tcg: Restrict icount to system emulation

2024-04-29 Thread Philippe Mathieu-Daudé
So far we don't support icount on user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-24-phi...@linaro.org> --- accel/tcg/cpu-exec.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/accel/tcg/cpu-exec.c

[PATCH v2 03/13] accel/tcg: Move @plugin_mem_cbs from CPUState to CPUNegativeOffsetState

2024-04-29 Thread Philippe Mathieu-Daudé
@plugin_mem_cbs is accessed by tcg generated code, move it to CPUNegativeOffsetState. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 2 +- include/hw/core/cpu.h | 13 +++-- include/qemu/plugin.h | 2 +- accel/tcg/plugin-gen.c | 5 +++--

[PATCH v2 05/13] accel/tcg: Restrict IcountDecr / can_do_io / CPUTLB to TCG

2024-04-29 Thread Philippe Mathieu-Daudé
IcountDecr union, the can_do_io field, the CPUTLB* structures and the "exec/tlb-common.h" header are only required for TCG. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-16-phi...@linaro.org> --- include/exec/tlb-common.h | 4

[PATCH v2 10/13] accel/tcg: Remove NULL check in tcg_flush_jmp_cache()

2024-04-29 Thread Philippe Mathieu-Daudé
I /think/ this check added in commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization before registration") is now unnecessary, but I don't have the WASM reproducer mentioned in: https://lore.kernel.org/qemu-devel/20221027141856.w5umjgklawgu7pqv@heavy/ to confirm. Ilya, do you mind testing? If

Re: [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply

2024-04-29 Thread Markus Armbruster
Collin Walling writes: > Retain a list of deprecated features disjoint from any particular > CPU model. A query-cpu-model-expansion reply will now provide a list of > properties (i.e. features) that are flagged as deprecated. Example: > > { > "return": { > "model": { >

Re: [PULL 1/1] hw/ufs: Fix buffer overflow bug

2024-04-29 Thread Thomas Huth
On 30/04/2024 02.17, Richard Henderson wrote: On 4/28/24 20:25, Jeuk Kim wrote: From: Jeuk Kim It fixes the buffer overflow vulnerability in the ufs device. The bug was detected by sanitizers. You can reproduce it by: cat << EOF |\ qemu-system-x86_64 \ -display none -machine accel=qtest -m

[PATCH v2 00/13] exec: Rework around CPUState user fields (part 2)

2024-04-29 Thread Philippe Mathieu-Daudé
Missing review: 1, 3, 4, 10 Since v1: - First 13 patches queued - Restrict qemu_plugin_vcpu_exit_hook() to (TCG) plugins - Restrict cpu_plugin_mem_cbs_enabled() to TCG (plugins) - Addressed Richard review comments on the others: - Move cpu_plugin_mem_cbs_enabled() - Do not move mem_io_pc,

[PATCH v2 06/13] accel/tcg: Move @jmp_env from CPUState to TCG AccelCPUState

2024-04-29 Thread Philippe Mathieu-Daudé
@jmp_env is specific to TCG accelerator, move it to its AccelCPUState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-17-phi...@linaro.org> --- accel/tcg/internal-common.h | 1 + accel/tcg/tcg-accel-ops.h | 1 + accel/tcg/vcpu-state.h

Re: [PULL 0/1] net/slirp: Use newer slirp_*_hostxfwd API

2024-04-29 Thread Richard Henderson
On 4/28/24 17:10, Samuel Thibault wrote: The following changes since commit 03555199b63aa1fbce24d16287e141c33f572a24: net/slirp: Use newer slirp_*_hostxfwd API (2024-04-29 02:04:58 +0200) are available in the Git repository at: https://people.debian.org/~sthibault/qemu.git

[PATCH] target/loongarch/kvm: Fix VM recovery from disk failures

2024-04-29 Thread Song Gao
vmstate does not save kvm_state_conter, which can cause VM recovery from disk to fail. Signed-off-by: Song Gao --- target/loongarch/machine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/loongarch/machine.c b/target/loongarch/machine.c index c7029fb9b4..4cd1bf06ff 100644 ---

Re: [PATCH v3] input-linux: Add option to not grab a device upon guest startup

2024-04-29 Thread Justinien Bouron
Just a ping to make sure this patch hasn't been lost in the noise. The relevant patchew page is https://patchew.org/QEMU/20240403055002.890760-1-justinien.bou...@gmail.com/ Regards, Justinien Bouron

Re: [PATCH v2 06/15] hw/riscv/virt.c: support for RISC-V IOMMU PCIDevice hotplug

2024-04-29 Thread Frank Chang
Reviewed-by: Frank Chang Daniel Henrique Barboza 於 2024年3月8日 週五 上午12:06寫道: > > From: Tomasz Jeznach > > Generate device tree entry for riscv-iommu PCI device, along with > mapping all PCI device identifiers to the single IOMMU device instance. > > Signed-off-by: Tomasz Jeznach >

Re: [PULL 0/1] target/sparc late fix

2024-04-29 Thread Mark Cave-Ayland
On 28/04/2024 04:10, M Bazz wrote: Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. The 9.0 Changelog was never updated. Could someone with the permissions please add the following to the SPARC section: sparc32: Fixed a

[PATCH v2 11/13] accel/tcg: Move @tcg_cflags from CPUState to TCG AccelCPUState

2024-04-29 Thread Philippe Mathieu-Daudé
@tcg_cflags is specific to TCG accelerator, move it to its AccelCPUState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-23-phi...@linaro.org> --- accel/tcg/vcpu-state.h | 2 ++ include/hw/core/cpu.h | 4 +--- accel/tcg/cpu-exec.c | 6

[PATCH v2 07/13] accel/tcg: Move @cflags_next_tb from CPUState to TCG AccelCPUState

2024-04-29 Thread Philippe Mathieu-Daudé
@cflags_next_tb is specific to TCG accelerator, move it to its AccelCPUState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-19-phi...@linaro.org> --- accel/tcg/vcpu-state.h| 2 ++ include/hw/core/cpu.h | 1 -

[PATCH v2 09/13] accel/tcg: Move @tb_jmp_cache from CPUState to TCG AccelCPUState

2024-04-29 Thread Philippe Mathieu-Daudé
@tb_jmp_cache is specific to TCG accelerator, move it to its AccelCPUState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-21-phi...@linaro.org> --- accel/tcg/tb-jmp-cache.h | 4 ++-- accel/tcg/vcpu-state.h| 2 ++

[PATCH v2 04/13] accel/tcg: Move @plugin_state from CPUState to TCG AccelCPUState

2024-04-29 Thread Philippe Mathieu-Daudé
@plugin_state is specific to TCG accelerator, move it to its AccelCPUState. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- TODO: check dubious include of "accel/tcg/vcpu-state.h" in hw/core/cpu-common.c. --- accel/tcg/vcpu-state.h | 5 +

[PATCH v2 13/13] accel/tcg: Move icount fields from CPUState to TCG AccelCPUState

2024-04-29 Thread Philippe Mathieu-Daudé
Both @icount_budget and @icount_extra fields are specific to TCG accelerator, move them to its AccelCPUState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-25-phi...@linaro.org> --- accel/tcg/vcpu-state.h | 4

[PATCH v2 01/13] accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins

2024-04-29 Thread Philippe Mathieu-Daudé
qemu_plugin_vcpu_exit_hook() is specific to TCG plugins, so must be restricted to it in cpu_common_unrealizefn(), similarly to how qemu_plugin_create_vcpu_state() is restricted in the cpu_common_realizefn() counterpart. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c | 4 1

[PATCH v2 02/13] accel/tcg: Restrict cpu_plugin_mem_cbs_enabled() to TCG

2024-04-29 Thread Philippe Mathieu-Daudé
So far cpu_plugin_mem_cbs_enabled() is only called from TCG, so reduce it to accel/tcg/. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <5f59c754-44e5-4743-a2dd-87ef8e13e...@linaro.org> --- accel/tcg/internal-common.h | 17 +

Re: [PATCH v2 10/13] accel/tcg: Remove NULL check in tcg_flush_jmp_cache()

2024-04-29 Thread Ilya Leoshkevich
On Mon, Apr 29, 2024 at 11:30:47PM +0200, Philippe Mathieu-Daudé wrote: > I /think/ this check added in commit 4e4fa6c12d ("accel/tcg: > Complete cpu initialization before registration") is now > unnecessary, but I don't have the WASM reproducer mentioned > in: >

Re: [PATCH v2 07/15] test/qtest: add riscv-iommu-pci tests

2024-04-29 Thread Frank Chang
Reviewed-by: Frank Chang Daniel Henrique Barboza 於 2024年3月8日 週五 上午12:05寫道: > > To test the RISC-V IOMMU emulation we'll use its PCI representation. > Create a new 'riscv-iommu-pci' libqos device that will be present with > CONFIG_RISCV_IOMMU. This config is only available for RISC-V, so this >

[PATCH 0/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-04-29 Thread Avihai Horon
Hello, This series adds a new QAPI event for VFIO device migration state change. This event will be emitted when a VFIO device changes its state, for example, during migration or when stopping/starting the guest. This event can be used by management applications to get updates on the current

Re: [PATCH 00/41] target/sparc: Implement VIS4

2024-04-29 Thread Mark Cave-Ayland
On 29/04/2024 22:02, Richard Henderson wrote: On 4/29/24 13:52, Mark Cave-Ayland wrote: No objections here about the remainder of the series, other than that I don't have an easy/obvious way to test the new instructions... I was thinking about adding support to RISU, but the gcc compile farm

Re: [PATCH v2 2/6] migration: Remove 'inc' option from migrate command

2024-04-29 Thread Peter Xu
On Fri, Apr 26, 2024 at 10:14:04AM -0300, Fabiano Rosas wrote: > The block incremental option for block migration has been deprecated > in 8.2 in favor of using the block-mirror feature. Remove it now. > > Deprecation commit 40101f320d ("migration: migrate 'inc' command > option is deprecated.").

Re: [PATCH v2 01/13] accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins

2024-04-29 Thread Richard Henderson
On 4/29/24 14:30, Philippe Mathieu-Daudé wrote: qemu_plugin_vcpu_exit_hook() is specific to TCG plugins, so must be restricted to it in cpu_common_unrealizefn(), similarly to how qemu_plugin_create_vcpu_state() is restricted in the cpu_common_realizefn() counterpart. Signed-off-by: Philippe

Re: [PATCH v2 03/13] accel/tcg: Move @plugin_mem_cbs from CPUState to CPUNegativeOffsetState

2024-04-29 Thread Richard Henderson
On 4/29/24 14:30, Philippe Mathieu-Daudé wrote: @plugin_mem_cbs is accessed by tcg generated code, move it to CPUNegativeOffsetState. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 2 +- include/hw/core/cpu.h | 13 +++-- include/qemu/plugin.h |

Re: [PULL 1/1] hw/ufs: Fix buffer overflow bug

2024-04-29 Thread Thomas Huth
On 30/04/2024 06.32, Thomas Huth wrote: On 30/04/2024 02.17, Richard Henderson wrote: On 4/28/24 20:25, Jeuk Kim wrote: From: Jeuk Kim It fixes the buffer overflow vulnerability in the ufs device. The bug was detected by sanitizers. You can reproduce it by: cat << EOF |\ qemu-system-x86_64

Re: [PATCH v2 0/4] Sparc CPU naming and help text improvements

2024-04-29 Thread Mark Cave-Ayland
On 19/04/2024 09:48, Thomas Huth wrote: The Sparc CPU naming and the corresponding help text is somewhat confusing for the users. We should avoid spaces in the Names and provide clear information to the users what can be passed to the "-cpu" option. While we're at it, also remove the "+" from

Re: [PATCH 00/41] target/sparc: Implement VIS4

2024-04-29 Thread Richard Henderson
On 4/29/24 13:52, Mark Cave-Ayland wrote: No objections here about the remainder of the series, other than that I don't have an easy/obvious way to test the new instructions... I was thinking about adding support to RISU, but the gcc compile farm sparc machines have been down for ages, so no

Re: [PATCH v2] Hexagon: add PC alignment check and exception

2024-04-29 Thread Richard Henderson
On 4/29/24 12:40, Matheus Tavares Bernardino wrote: @@ -144,6 +148,9 @@ static inline void cpu_get_tb_cpu_state(CPUHexagonState *env, vaddr *pc, hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, IS_TIGHT_LOOP, 1); } *flags = hex_flags; +if (*pc & PCALIGN_MASK) { +

Re: [PATCH v2 09/12] accel/tcg: Restrict cpu_loop_exit_requested() to TCG

2024-04-29 Thread Philippe Mathieu-Daudé
On 29/4/24 00:17, Philippe Mathieu-Daudé wrote: On 29/4/24 00:08, Richard Henderson wrote: On 4/28/24 14:49, Philippe Mathieu-Daudé wrote: cpu_loop_exit_requested() is specific to TCG, move it to "exec/translate-all.h". Signed-off-by: Philippe Mathieu-Daudé ---   include/exec/exec-all.h  

Re: [PATCH] MAINTAINERS: Update my email address

2024-04-29 Thread Stefano Stabellini
On Mon, 29 Apr 2024, Anthony PERARD wrote: > From: Anthony PERARD > > Signed-off-by: Anthony PERARD Acked-by: Stefano Stabellini > --- > MAINTAINERS | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 302b6fd00c..ea9672fc52 100644 >

Re: [PATCH v2 04/13] accel/tcg: Move @plugin_state from CPUState to TCG AccelCPUState

2024-04-29 Thread Richard Henderson
On 4/29/24 14:30, Philippe Mathieu-Daudé wrote: @plugin_state is specific to TCG accelerator, move it to its AccelCPUState. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- TODO: check dubious include of "accel/tcg/vcpu-state.h" in hw/core/cpu-common.c.

Re: [PULL 1/1] hw/ufs: Fix buffer overflow bug

2024-04-29 Thread Richard Henderson
On 4/28/24 20:25, Jeuk Kim wrote: From: Jeuk Kim It fixes the buffer overflow vulnerability in the ufs device. The bug was detected by sanitizers. You can reproduce it by: cat << EOF |\ qemu-system-x86_64 \ -display none -machine accel=qtest -m 512M -M q35 -nodefaults -drive \

Re: [PATCH v2 05/15] hw/riscv: add riscv-iommu-sys platform device

2024-04-29 Thread Frank Chang
Reviewed-by: Frank Chang Daniel Henrique Barboza 於 2024年3月8日 週五 上午12:05寫道: > > From: Tomasz Jeznach > > This device models the RISC-V IOMMU as a sysbus device. > > Signed-off-by: Tomasz Jeznach > Signed-off-by: Daniel Henrique Barboza > --- > hw/riscv/meson.build | 2 +- >

Re: [PATCH] target/loongarch: Put cpucfg operation before CSR register

2024-04-29 Thread gaosong
在 2024/4/28 上午11:16, Bibo Mao 写道: On Loongarch, cpucfg is register for cpu feature, some other registers depend on cpucfg feature such as perf CSR registers. Here put cpucfg read/write operations before CSR register, so that KVM knows how many perf CSR registers are valid from pre-set cpucfg

Re: [RFC 1/2] iova_tree: add an id member to DMAMap

2024-04-29 Thread Si-Wei Liu
On 4/29/2024 1:14 AM, Eugenio Perez Martin wrote: On Thu, Apr 25, 2024 at 7:44 PM Si-Wei Liu wrote: On 4/24/2024 12:33 AM, Eugenio Perez Martin wrote: On Wed, Apr 24, 2024 at 12:21 AM Si-Wei Liu wrote: On 4/22/2024 1:49 AM, Eugenio Perez Martin wrote: On Sat, Apr 20, 2024 at 1:50 AM

Re: [PATCH 00/24] exec: Rework around CPUState user fields (part 2)

2024-04-29 Thread Philippe Mathieu-Daudé
On 29/4/24 00:14, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (24): exec/user: Move 'thunk.h' from 'exec/user' to 'user' coverity: Update user emulation regexp accel/tcg: Move user definition of cpu_interrupt() to user-exec.c accel/tcg: Duplicate cpu_exit() for user /

Re: [PATCH 23/24] accel/tcg: Restrict icount to system emulation

2024-04-29 Thread Richard Henderson
On 4/28/24 15:14, Philippe Mathieu-Daudé wrote: So far we don't support icount on user emulation. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 6 ++ 1 file changed, 6 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH 24/24] accel/tcg: Move icount fields from CPUState to TCG AccelCPUState

2024-04-29 Thread Richard Henderson
On 4/28/24 15:14, Philippe Mathieu-Daudé wrote: Both @icount_budget and @icount_extra fields are specific to TCG accelerator, move them to its AccelCPUState. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/vcpu-state.h | 4 include/hw/core/cpu.h| 3 ---

Re: [PATCH] hw/loongarch: Refine default numa id calculation

2024-04-29 Thread gaosong
在 2024/3/19 上午10:26, Bibo Mao 写道: With numa_test test case, there is subcase named test_def_cpu_split(), there are 8 sockets and 2 numa nodes. Here is command line: "-machine smp.cpus=8,smp.sockets=8 -numa node,memdev=ram -numa node" The required result is: node 0 cpus: 0 2 4 6 node 1

[PATCH 1/3] qapi/vfio: Add VFIO device migration state change QAPI event

2024-04-29 Thread Avihai Horon
Add a new QAPI event for VFIO device migration state change. This event will be emitted when a VFIO device changes its migration state, for example, during migration or when stopping/starting the guest. This event can be used by management applications to get updates on the current state of the

[PATCH 2/3] vfio/migration: Emit VFIO device migration state change QAPI event

2024-04-29 Thread Avihai Horon
Emit VFIO device migration state change QAPI event when a VFIO device changes its migration state. This can be used by management applications to get updates on the current state of the VFIO device for their own purposes. A new per VFIO device capability, "migration-events", is added so events

[PATCH 3/3] vfio/migration: Don't emit STOP_COPY state change event twice

2024-04-29 Thread Avihai Horon
When migrating a VFIO device that supports pre-copy, it is transitioned to STOP_COPY twice: once in vfio_vmstate_change() and second time in vfio_save_complete_precopy(). The second transition is harmless, as it's a STOP_COPY->STOP_COPY no-op transition. However, with the newly added migration

Re: [PATCH v2 2/4] hw/arm/sbsa-ref: Force CPU generic timer to 62.5MHz

2024-04-29 Thread Marcin Juszkiewicz
W dniu 26.04.2024 o 14:29, Peter Maydell pisze: The default frequency used by the 'max' CPU is about to change, so make the sbsa-ref board force the CPU frequency to the value which the firmware expects. Newer versions of TF-A will read the frequency from the CPU's CNTFRQ_EL0 register:

Re: [PATCH v1] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-04-29 Thread Daniil Tatianin
On 4/29/24 11:51 AM, Markus Armbruster wrote: Daniil Tatianin writes: This can be used to force-synchronize the time in guest after a long stop-cont pause, which can be useful for serverless-type workload. Also add a comment to highlight the fact that this (and one other QMP command) only

Re: [PATCH v4 1/1] hw/arm/sbsa-ref: Enable CPU cluster on ARM sbsa machine

2024-04-29 Thread Marcin Juszkiewicz
W dniu 26.04.2024 o 18:06, Richard Henderson pisze: Isn't this basically what MPIDR_EL1 is supposed to indicate? We do not yet implement all of that in QEMU, but should. QEMU has socket/cluster/core/thread model which could map to aff3/aff2/aff1/aff0 (or aff0/1/2/3) of MPIDR_EL1 register,

[PULL 7/9] target/loongarch/cpu.c: typo fix: expection

2024-04-29 Thread Michael Tokarev
Fixes: 1590154ee437 ("target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'") Signed-off-by: Michael Tokarev Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch/cpu.c

[PULL 0/9] Trivial patches for 2024-04-29

2024-04-29 Thread Michael Tokarev
The following changes since commit fd87be1dada5672f877e03c2ca8504458292c479: Merge tag 'accel-20240426' of https://github.com/philmd/qemu into staging (2024-04-26 15:28:13 -0700) are available in the Git repository at: https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches for you to

[PULL 4/9] scripts/checkpatch: Avoid author email mangled by qemu-*@nongnu.org

2024-04-29 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Commit f5177798d8 ("scripts: report on author emails that are mangled by the mailing list") added a check for qemu-devel@ list, extend the regexp to cover more such qemu-trivial@, qemu-block@ and qemu-ppc@. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael

[PULL 6/9] backends/cryptodev-builtin: Fix local_error leaks

2024-04-29 Thread Michael Tokarev
From: Li Zhijian via It seems that this error does not need to be propagated to the upper, directly output the error to avoid the leaks Closes: https://gitlab.com/qemu-project/qemu/-/issues/2283 Fixes: 2fda101de07 ("virtio-crypto: Support asynchronous mode") Signed-off-by: Li Zhijian

[PATCH v3 01/19] backends: Introduce HostIOMMUDevice abstract

2024-04-29 Thread Zhenzhong Duan
Introduce HostIOMMUDevice as an abstraction of host IOMMU device. Introduce .realize() to initialize HostIOMMUDevice further after instance init. Introduce a macro CONFIG_HOST_IOMMU_DEVICE to define the usage for VFIO, and VDPA in the future. Suggested-by: Cédric Le Goater Signed-off-by:

[PATCH v3 03/19] backends/iommufd: Introduce abstract HostIOMMUDeviceIOMMUFD device

2024-04-29 Thread Zhenzhong Duan
HostIOMMUDeviceIOMMUFD represents a host IOMMU device under iommufd backend. Currently it contains public iommufd handle and device id which will be passed to vIOMMU to allocate/free ioas, hwpt, etc. When nested translation is supported in future, vIOMMU will request iommufd related operations

Re: [PATCH v4] riscv: thead: Add th.sxstatus CSR emulation

2024-04-29 Thread Christoph Müllner
On Mon, Apr 29, 2024 at 5:29 AM Alistair Francis wrote: > > On Mon, Apr 22, 2024 at 4:53 PM Christoph Müllner > wrote: > > > > The th.sxstatus CSR can be used to identify available custom extension > > on T-Head CPUs. The CSR is documented here: > > > >

[PATCH v5] riscv: thead: Add th.sxstatus CSR emulation

2024-04-29 Thread Christoph Müllner
The th.sxstatus CSR can be used to identify available custom extension on T-Head CPUs. The CSR is documented here: https://github.com/T-head-Semi/thead-extension-spec/blob/master/xtheadsxstatus.adoc An important property of this patch is, that the th.sxstatus MAEE field is not set (indicating

Re: [PULL 20/38] accel/whpx: Use accel-specific per-vcpu @dirty field

2024-04-29 Thread Philippe Mathieu-Daudé
On 28/4/24 22:12, Volker Rümelin wrote: Am 26.04.24 um 21:41 schrieb Philippe Mathieu-Daudé: WHPX has a specific use of the CPUState::vcpu_dirty field (CPUState::vcpu_dirty is not used by common code). To make this field accel-specific, add and use a new @dirty variable in the AccelCPUState

Re: [PATCH v1] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-04-29 Thread Daniil Tatianin
On 4/29/24 12:40 PM, Philippe Mathieu-Daudé wrote: On 29/4/24 11:34, Daniil Tatianin wrote: On 4/29/24 11:51 AM, Markus Armbruster wrote: Daniil Tatianin writes: This can be used to force-synchronize the time in guest after a long stop-cont pause, which can be useful for serverless-type

[PATCH v3 07/19] vfio/container: Implement HostIOMMUDeviceClass::realize() handler

2024-04-29 Thread Zhenzhong Duan
Utilize range_get_last_bit() to get host IOMMU address width and package it in HostIOMMUDeviceCaps for query with .check_cap(). Signed-off-by: Zhenzhong Duan --- hw/vfio/container.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/vfio/container.c

[PATCH v3 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-04-29 Thread Zhenzhong Duan
From: Yi Liu Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU. In set call, a new structure VTDHostIOMMUDevice which holds a reference to HostIOMMUDevice is stored in hash table indexed by PCI BDF. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan ---

[PATCH v3 13/19] vfio: Create host IOMMU device instance

2024-04-29 Thread Zhenzhong Duan
Create host IOMMU device instance in vfio_attach_device() and call .realize() to initialize it further. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/common.c | 18 +- 2 files changed, 18

Re: [PATCH 0/3] virtio-net: Convert feature properties to OnOffAuto

2024-04-29 Thread Michael S. Tsirkin
On Sun, Apr 28, 2024 at 04:21:06PM +0900, Akihiko Odaki wrote: > Based-on: <20240428-rss-v10-0-73cbaa91a...@daynix.com> > ("[PATCH v10 00/18] virtio-net RSS/hash report fixes and improvements") > > Some features are not always available, and virtio-net used to disable > them when not available

Re: [PATCH v2 04/15] hw/riscv: add riscv-iommu-pci device

2024-04-29 Thread Frank Chang
Daniel Henrique Barboza 於 2024年3月8日 週五 上午12:04寫道: > > From: Tomasz Jeznach > > The RISC-V IOMMU can be modelled as a PCIe device following the > guidelines of the RISC-V IOMMU spec, chapter 7.1, "Integrating an IOMMU > as a PCIe device". > > Signed-off-by: Tomasz Jeznach > Signed-off-by: Daniel

Re: [PATCH v3 4/4] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 25.04.24 23:30, Fabiano Rosas wrote: @@ -797,13 +801,18 @@ fail: MIGRATION_STATUS_FAILED); migration_incoming_state_destroy(); -if (migrate_has_error(s)) { -WITH_QEMU_LOCK_GUARD(>error_mutex) { -error_report_err(s->error); +if

Re: [PATCH v7 09/12] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents

2024-04-29 Thread Markus Armbruster
fan writes: > On Fri, Apr 26, 2024 at 11:12:50AM +0200, Markus Armbruster wrote: >> nifan@gmail.com writes: [...] >> > diff --git a/qapi/cxl.json b/qapi/cxl.json >> > index 4281726dec..2dcf03d973 100644 >> > --- a/qapi/cxl.json >> > +++ b/qapi/cxl.json >> > @@ -361,3 +361,72 @@ >> > ## >>

Re: [PATCH v1] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-04-29 Thread Markus Armbruster
Daniil Tatianin writes: > This can be used to force-synchronize the time in guest after a long > stop-cont pause, which can be useful for serverless-type workload. > > Also add a comment to highlight the fact that this (and one other QMP > command) only works for the MC146818 RTC controller. > >

[PATCH v3 02/19] vfio/container: Introduce HostIOMMUDeviceLegacyVFIO device

2024-04-29 Thread Zhenzhong Duan
HostIOMMUDeviceLegacyVFIO represents a host IOMMU device under VFIO legacy container backend. It includes a link to VFIODevice. Suggested-by: Eric Auger Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 12 hw/vfio/container.c

[PATCH v3 00/19] Add a host IOMMU device abstraction to check with vIOMMU

2024-04-29 Thread Zhenzhong Duan
Hi, The most important change in this version is instroducing a common HostIOMMUDeviceCaps structure in HostIOMMUDevice and a new interface between vIOMMU and HostIOMMUDevice. HostIOMMUDeviceClass::realize() is introduced to initialize HostIOMMUDeviceCaps and other fields of HostIOMMUDevice

[PATCH v3 11/19] backends/iommufd: Implement HostIOMMUDeviceClass::check_cap() handler

2024-04-29 Thread Zhenzhong Duan
Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- backends/iommufd.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/backends/iommufd.c b/backends/iommufd.c index d61209788a..28faec528e 100644 --- a/backends/iommufd.c +++ b/backends/iommufd.c @@ -233,6

[PATCH v3 10/19] vfio/container: Implement HostIOMMUDeviceClass::check_cap() handler

2024-04-29 Thread Zhenzhong Duan
Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/container.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 863eec3943..3683487605 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -1164,11

[PATCH v3 04/19] vfio/iommufd: Introduce HostIOMMUDeviceIOMMUFDVFIO device

2024-04-29 Thread Zhenzhong Duan
HostIOMMUDeviceIOMMUFDVFIO represents a host IOMMU device under VFIO iommufd backend. It will be created during VFIO device attaching and passed to vIOMMU. It includes a link to VFIODevice so that we can do VFIO device specific operations, i.e., [at/de]taching hwpt, etc. Signed-off-by: Zhenzhong

[PATCH v3 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-04-29 Thread Zhenzhong Duan
From: Yi Liu pci_device_[set|unset]_iommu_device() call pci_device_get_iommu_bus_devfn() to get iommu_bus->iommu_ops and call [set|unset]_iommu_device callback to set/unset HostIOMMUDevice for a given PCI device. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Nicolin Chen

[PATCH v3 09/19] vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler

2024-04-29 Thread Zhenzhong Duan
It calls iommufd_backend_get_device_info() to get host IOMMU related information and translate it into HostIOMMUDeviceCaps for query with .check_cap(). Introduce macro VTD_MGAW_FROM_CAP to get MGAW which equals to (aw_bits - 1). Signed-off-by: Zhenzhong Duan --- include/hw/i386/intel_iommu.h |

[PATCH v3 16/19] vfio/pci: Pass HostIOMMUDevice to vIOMMU

2024-04-29 Thread Zhenzhong Duan
With HostIOMMUDevice passed, vIOMMU can check compatibility with host IOMMU, call into IOMMUFD specific methods, etc. Originally-by: Yi Liu Signed-off-by: Nicolin Chen Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.c | 20 +++- 1 file changed, 15

[PATCH v4 4/4] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Now we do set MIGRATION_FAILED state, but don't give a chance to orchestrator to query migration state and get the error. Let's provide a possibility for QMP-based orchestrators to get an error like with outgoing migration. For hmp_migrate_incoming(), let's enable the new behavior: HMP is not

[PATCH v4 1/4] migration: move trace-point from migrate_fd_error to migrate_set_error

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index

[PATCH v4 2/4] migration: process_incoming_migration_co(): complete cleanup on failure

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/migration.c

[PATCH v4 0/4] migration: do not exit on incoming failure

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Hi all! The series brings an option to not immediately exit on incoming migration failure, giving a possibility to orchestrator to get the error through QAPI and shutdown QEMU by "quit". v4: - add r-b and a-b by Fabiano and Markus - improve wording in 04 as Markus suggested v3: - don't refactor

[PATCH v4 3/4] migration: process_incoming_migration_co(): rework error reporting

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 20 +++- 1 file changed, 11

Re: [PATCH v4] target/riscv: Implement dynamic establishment of custom decoder

2024-04-29 Thread Huang Tao
On 2024/4/29 15:58, Huang Tao wrote: On 2024/4/29 11:51, Alistair Francis wrote: On Thu, Mar 14, 2024 at 7:23 PM Huang Tao wrote: In this patch, we modify the decoder to be a freely composable data structure instead of a hardcoded one. It can be dynamically builded up according to the

Re: [PATCH v3 5/5] qapi: introduce CONFIG_READ event

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 24.04.24 15:11, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Send a new event when guest reads virtio-pci config after virtio_notify_config() call. That's useful to check that guest fetched modified config, for example after resizing disk backend. Signed-off-by: Vladimir

[PATCH v2] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-04-29 Thread Daniil Tatianin
This can be used to force-synchronize the time in guest after a long stop-cont pause, which can be useful for serverless-type workload. Also add a comment to highlight the fact that this (and one other QMP command) only works for the MC146818 RTC controller. Signed-off-by: Daniil Tatianin ---

Re: [PATCH v1] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-04-29 Thread Philippe Mathieu-Daudé
On 29/4/24 11:34, Daniil Tatianin wrote: On 4/29/24 11:51 AM, Markus Armbruster wrote: Daniil Tatianin writes: This can be used to force-synchronize the time in guest after a long stop-cont pause, which can be useful for serverless-type workload. Also add a comment to highlight the fact

Re: [PATCH v1] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-04-29 Thread Philippe Mathieu-Daudé
On 29/4/24 11:43, Daniil Tatianin wrote: On 4/29/24 12:40 PM, Philippe Mathieu-Daudé wrote: On 29/4/24 11:34, Daniil Tatianin wrote: On 4/29/24 11:51 AM, Markus Armbruster wrote: Daniil Tatianin writes: This can be used to force-synchronize the time in guest after a long stop-cont pause,

Re: [PATCH v2] mc146818rtc: add a way to generate RTC interrupts via QMP

2024-04-29 Thread Philippe Mathieu-Daudé
On 29/4/24 11:41, Daniil Tatianin wrote: This can be used to force-synchronize the time in guest after a long stop-cont pause, which can be useful for serverless-type workload. Also add a comment to highlight the fact that this (and one other QMP command) only works for the MC146818 RTC

[PULL 1/9] target/i386/cpu: Remove "x86" prefix from the CPU list

2024-04-29 Thread Michael Tokarev
From: Thomas Huth Printing an "x86" in front of each CPU name is not helpful at all: It is confusing for the users since they don't know whether they have to specify these letters for the "-cpu" parameter, too, and it also takes some precious space in the dense output of the CPU entries. Let's

[PULL 9/9] checkpatch.pl: forbid strerrorname_np()

2024-04-29 Thread Michael Tokarev
From: Daniel Henrique Barboza Commit d424db2354 removed an instance of strerrorname_np() because it was breaking building with musl libc. A recent RISC-V patch ended up re-introducing it again by accident. Put this function in the baddies list in checkpatch.pl to avoid this situation again.

[PULL 2/9] target/s390x/cpu_models: Rework the output of "-cpu help"

2024-04-29 Thread Michael Tokarev
From: Thomas Huth Printing an "s390x" in front of each CPU name is not helpful at all: It is confusing for the users since they don't know whether they have to specify these letters for the "-cpu" parameter, too, and it also takes some precious space in the dense output of the CPU entries. Let's

[PULL 3/9] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list

2024-04-29 Thread Michael Tokarev
From: Thomas Huth Printing a "PowerPC" in front of each CPU name is not helpful at all: It is confusing for the users since they don't know whether they have to specify these letters for the "-cpu" parameter, too, and it also takes some precious space in the dense output of the CPU entries.

[PULL 8/9] target/riscv/kvm: remove sneaky strerrorname_np() instance

2024-04-29 Thread Michael Tokarev
From: Daniel Henrique Barboza Commit d424db2354 excluded some strerrorname_np() instances because they break musl libc builds. Another instance happened to slip by via commit d4ff3da8f4. Remove it before it causes trouble again. Fixes: d4ff3da8f4 (target/riscv/kvm: initialize 'vlenb' via

[PULL 5/9] scripts/checkpatch: Do not use mailmap

2024-04-29 Thread Michael Tokarev
From: Philippe Mathieu-Daudé The .mailmap file fixes mistake we already did. Do not use it when running checkpatch.pl, otherwise we might commit the very same mistakes. Reported-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Signed-off-by: Michael

[PATCH v3 06/19] range: Introduce range_get_last_bit()

2024-04-29 Thread Zhenzhong Duan
This helper get the highest 1 bit position of the upper bound. If the range is empty or upper bound is zero, -1 is returned. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/qemu/range.h | 11 +++ 1 file changed, 11 insertions(+) diff --git

Re: [PATCH v4] target/riscv: Implement dynamic establishment of custom decoder

2024-04-29 Thread Huang Tao
On 2024/4/29 11:51, Alistair Francis wrote: On Thu, Mar 14, 2024 at 7:23 PM Huang Tao wrote: In this patch, we modify the decoder to be a freely composable data structure instead of a hardcoded one. It can be dynamically builded up according to the extensions. This approach has several

[PATCH] hw/char/stm32l4x5_usart: Fix memory corruption by adding correct class_size

2024-04-29 Thread Thomas Huth
"make check-qtest-aarch64" recently started failing on FreeBSD builds, and valgrind on Linux also detected that there is something fishy with the new stm32l4x5-usart: The code forgot to set the correct class_size here, so the various class_init functions in this file wrote beyond the allocated

Re: [PATCH v3 4/5] qapi: introduce device-sync-config

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 24.04.24 14:48, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add command to sync config from vhost-user backend to the device. It may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not triggered interrupt to the guest or just not available (not supported by

Re: [PATCH] hw/char/stm32l4x5_usart: Fix memory corruption by adding correct class_size

2024-04-29 Thread Philippe Mathieu-Daudé
On 29/4/24 09:59, Thomas Huth wrote: "make check-qtest-aarch64" recently started failing on FreeBSD builds, and valgrind on Linux also detected that there is something fishy with the new stm32l4x5-usart: The code forgot to set the correct class_size here, so the various class_init functions in

[PATCH 0/2] accel: Fix NULL deref in NVMM / WHPX vCPU init

2024-04-29 Thread Philippe Mathieu-Daudé
Fix recently introduced NULL deref in NVMM/WHPX vCPU init() handlers. Philippe Mathieu-Daudé (2): accel/whpx: Fix NULL dereference in whpx_init_vcpu() accel/nvmm: Fix NULL dereference in nvmm_init_vcpu() target/i386/nvmm/nvmm-all.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- 2 files

[PATCH 1/2] accel/whpx: Fix NULL dereference in whpx_init_vcpu()

2024-04-29 Thread Philippe Mathieu-Daudé
When mechanically moving the @dirty field to AccelCPUState in commit 9ad49538c7, we neglected cpu->accel is still NULL when we want to dereference it. Fixes: 9ad49538c7 ("accel/whpx: Use accel-specific per-vcpu @dirty field") Reported-by: Volker Rümelin Suggested-by: Volker Rümelin

[PATCH 2/2] accel/nvmm: Fix NULL dereference in nvmm_init_vcpu()

2024-04-29 Thread Philippe Mathieu-Daudé
When mechanically moving the @dirty field to AccelCPUState in commit 79f1926b2d, we neglected cpu->accel is still NULL when we want to dereference it. Reported-by: Volker Rümelin Suggested-by: Volker Rümelin Fixes: 79f1926b2d ("accel/nvmm: Use accel-specific per-vcpu @dirty field")

  1   2   3   >