[PATCH] vl: Free machine list

2023-07-21 Thread Akihiko Odaki
Free machine list and make LeakSanitizer happy. Signed-off-by: Akihiko Odaki --- softmmu/vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..802f728298 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1484,7 +1484,8 @@ static g

[PATCH v3 1/2] kvm: Introduce kvm_arch_get_default_type hook

2023-07-21 Thread Akihiko Odaki
kvm_arch_get_default_type() returns the default KVM type. This hook is particularly useful to derive a KVM type that is valid for "none" machine model, which is used by libvirt to probe the availability of KVM. For MIPS, the existing mips_kvm_type() is reused. This function ensures the availabilit

[PATCH v3 2/2] accel/kvm: Specify default IPA size for arm64

2023-07-21 Thread Akihiko Odaki
Before this change, the default KVM type, which is used for non-virt machine models, was 0. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configured if the host > supports the extension KVM_CAP_ARM

[PATCH v3 0/2] accel/kvm: Specify default IPA size for arm64

2023-07-21 Thread Akihiko Odaki
Some Arm systems such as Apple Silicon Macs have IPA size smaller than the default used by KVM. Introduce our own default IPA size that fits on such a system. V2 -> V3: Changed to use the maximum IPA size as the default. V1 -> V2: Introduced an arch hook Akihiko Odaki (2): kvm: Introduce kvm_ar

[PATCH] kvm: Remove KVM_CREATE_IRQCHIP support assumption

2023-07-21 Thread Andrew Jones
Since Linux commit 00f918f61c56 ("RISC-V: KVM: Skeletal in-kernel AIA irqchip support") checking KVM_CAP_IRQCHIP returns non-zero when the RISC-V platform has AIA. The cap indicates KVM supports at least one of the following ioctls: KVM_CREATE_IRQCHIP KVM_IRQ_LINE KVM_GET_IRQCHIP KVM_SET_I

[PULL 1/2] xen_arm: Create virtio-mmio devices during initialization

2023-07-21 Thread Stefano Stabellini
From: Oleksandr Tyshchenko In order to use virtio backends we need to allocate virtio-mmio parameters (irq and base) and register corresponding buses. Use the constants defined in public header arch-arm.h to be aligned with the toolstack. So the number of current supported virtio-mmio devices is

[PULL 2/2] xen_arm: Initialize RAM and add hi/low memory regions

2023-07-21 Thread Stefano Stabellini
From: Oleksandr Tyshchenko In order to use virtio backends we need to initialize RAM for the xen-mapcache (which is responsible for mapping guest memory using foreign mapping) to work. Calculate and add hi/low memory regions based on machine->ram_size. Use the constants defined in public header

[PULL 0/2] xen-virtio-1-tag

2023-07-21 Thread Stefano Stabellini
The following changes since commit d1181d29370a4318a9f11ea92065bea6bb159f83: Merge tag 'pull-nbd-2023-07-19' of https://repo.or.cz/qemu/ericb into staging (2023-07-20 09:54:07 +0100) are available in the Git repository at: https://gitlab.com/sstabellini/qemu.git xen-virtio-1-tag for you to

Re: [PATCH 3/3] target/riscv: Add cycle & instret privilege mode filtering support

2023-07-21 Thread Kevin Xue
On Tue, Jul 18, 2023 at 6:25 PM Weiwei Li wrote: > > > On 2023/7/19 06:47, Kaiwen Xue wrote: > > QEMU only calculates dummy cycles and instructions, so there is no > > actual means to stop the icount in QEMU. Hence this patch merely adds > > the functionality of accessing the cfg registers, and ca

Re: [PATCH 1/3] target/riscv: Add cycle & instret privilege mode filtering properties

2023-07-21 Thread Kevin Xue
On Tue, Jul 18, 2023 at 6:21 PM Weiwei Li wrote: > > > On 2023/7/19 06:47, Kaiwen Xue wrote: > > This adds the properties for ISA extension smcntrpmf. Patches > > implementing it will follow. > > > > Signed-off-by: Kaiwen Xue > > Signed-off-by: Kaiwen Xue > > --- > > target/riscv/cpu.c | 2

Re: [RFC PATCH 11/12] vdpa: use SVQ to stall dataplane while NIC state is being restored

2023-07-21 Thread Si-Wei Liu
On 7/20/2023 11:14 AM, Eugenio Pérez wrote: Some dynamic state of a virtio-net vDPA devices is restored from CVQ in the event of a live migration. However, dataplane needs to be disabled so the NIC does not receive buffers in the invalid ring. As a default method to achieve it, let's offer a

Re: [PATCH] ppc/pegasos2: Fix reg property of 64 bit BARs in device tree

2023-07-21 Thread BALATON Zoltan
On Sat, 22 Jul 2023, BALATON Zoltan wrote: The board firmware handles this correctly following the Open Firmware standard which we missed. This fixes 64 bit BARs when using VOF. In case it helps review this is defined in page 5 of this document: https://www.openbios.org/data/docs/bus.pci.pdf

Re: [PATCH 0/3] pegasos2 fixes for 8.1

2023-07-21 Thread BALATON Zoltan
On Fri, 21 Jul 2023, Daniel Henrique Barboza wrote: On 7/18/23 21:32, BALATON Zoltan wrote: These are some small fixes when using pegasos2 with the QEMU built in VOF instead of the non-free board firmware that fix bugs in the generated device tree and matches the board firmware in the reset stat

[PATCH] ppc/pegasos2: Fix reg property of 64 bit BARs in device tree

2023-07-21 Thread BALATON Zoltan
The board firmware handles this correctly following the Open Firmware standard which we missed. This fixes 64 bit BARs when using VOF. Signed-off-by: BALATON Zoltan --- hw/ppc/pegasos2.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.

Re: [RFC PATCH 07/12] vdpa: add vhost_vdpa_reset_queue

2023-07-21 Thread Si-Wei Liu
On 7/20/2023 11:14 AM, Eugenio Pérez wrote: Split out vq reset operation in its own function, as it may be called with ring reset. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virt

Re: [PULL 5/5] linux-user: Fix qemu-arm to run static armhf binaries

2023-07-21 Thread Helge Deller
On 7/21/23 17:14, Michael Tokarev wrote: 19.07.2023 18:52, Helge Deller wrote: qemu-user crashes immediately when running static binaries on the armhf architecture. The problem is the memory layout where the executable is loaded before the interpreter library, in which case the reserved brk regi

[PATCH 6/9] include/exec: typedef abi_ptr to vaddr in softmmu

2023-07-21 Thread Anton Johansson via
In system mode, abi_ptr is primarily used for representing addresses when accessing guest memory with cpu_[st|ld]*(). Widening it from target_ulong to vaddr reduces the target dependence of these functions and is step towards building accel/ once for system mode. Signed-off-by: Anton Johansson --

[PATCH 2/9] accel/hvf: Widen pc/saved_insn for hvf_sw_breakpoint

2023-07-21 Thread Anton Johansson via
Widens the pc and saved_insn fields of hvf_sw_breakpoint from target_ulong to vaddr. Other hvf_* functions accessing hvf_sw_breakpoint are also widened to match. Signed-off-by: Anton Johansson --- include/sysemu/hvf.h | 6 +++--- accel/hvf/hvf-accel-ops.c | 4 ++-- accel/hvf/hvf-all.c

[PATCH 1/9] accel/kvm: Widen pc/saved_insn for kvm_sw_breakpoint

2023-07-21 Thread Anton Johansson via
Widens the pc and saved_insn fields of kvm_sw_breakpoint from target_ulong to vaddr. The pc argument of kvm_find_sw_breakpoint is also widened to match. Signed-off-by: Anton Johansson --- include/sysemu/kvm.h | 6 +++--- accel/kvm/kvm-all.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions

[PATCH 8/9] accel/tcg: Widen address arg. in tlb_compare_set()

2023-07-21 Thread Anton Johansson via
Signed-off-by: Anton Johansson --- accel/tcg/cputlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 8e9dc51cd1..2f97ae2fda 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1108,7 +1108,7 @@ static void tlb_add_large_p

[PATCH 7/9] include/exec: Widen tlb_hit/tlb_hit_page()

2023-07-21 Thread Anton Johansson via
tlb_addr is changed from target_ulong to uint64_t to match the type of a CPUTLBEntry value, and the addressed is changed to vaddr. Signed-off-by: Anton Johansson --- include/exec/cpu-all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-all.h b/include/ex

[PATCH 9/9] accel/tcg: Update run_on_cpu_data static assert

2023-07-21 Thread Anton Johansson via
As we are now using vaddr for representing guest addresses, update the static assert to check that vaddr fits in the run_on_cpu_data union. Signed-off-by: Anton Johansson --- accel/tcg/cputlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tc

[PATCH 5/9] Replace target_ulong with abi_ptr in cpu_[st|ld]*()

2023-07-21 Thread Anton Johansson via
Changes the address type of the guest memory read/write functions from target_ulong to abi_ptr. (abi_ptr is currently typedef'd to target_ulong but that will change in a following commit.) This will reduce the coupling between accel/ and target/. Note: Function pointers that point to cpu_[st|ld]*(

[PATCH 3/9] target: Use vaddr for kvm_arch_[insert|remove]_hw_breakpoint

2023-07-21 Thread Anton Johansson via
Changes the signature of the target-defined functions for inserting/removing kvm hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/kvm/kvm-all.c and makes the api target-agnostic. Signed-off-by: Anton Johansson --- includ

[PATCH 0/9] Replace remaining target_ulong in system-mode accel

2023-07-21 Thread Anton Johansson via
This patchset replaces the remaining uses of target_ulong in the accel/ directory. Specifically, the address type of a few kvm/hvf functions is widened to vaddr, and the address type of the cpu_[st|ld]*() functions is changed to abi_ptr (which is re-typedef'd to vaddr in system mode). As a starti

[PATCH 4/9] target: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint

2023-07-21 Thread Anton Johansson via
Changes the signature of the target-defined functions for inserting/removing hvf hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/hvf/hvf-all.c and makes the api target-agnostic. Signed-off-by: Anton Johansson --- includ

Re: [PATCH 1/2] Reduce vdpa initialization / startup overhead

2023-07-21 Thread Si-Wei Liu
On 7/21/2023 3:39 AM, Eugenio Perez Martin wrote: On Tue, Jul 18, 2023 at 12:55 PM Michael S. Tsirkin wrote: On Thu, Apr 20, 2023 at 10:59:56AM +0200, Eugenio Perez Martin wrote: On Thu, Apr 20, 2023 at 7:25 AM Pei Li wrote: Hi all, My bad, I just submitted the kernel patch. If we are pa

Re: [PATCH 0/3] pegasos2 fixes for 8.1

2023-07-21 Thread Daniel Henrique Barboza
On 7/18/23 21:32, BALATON Zoltan wrote: These are some small fixes when using pegasos2 with the QEMU built in VOF instead of the non-free board firmware that fix bugs in the generated device tree and matches the board firmware in the reset state of on-board USB devices. This fixes booting Amig

Re: [PATCH v6 5/5] target/riscv: select KVM AIA in riscv virt machine

2023-07-21 Thread Andrew Jones
On Fri, Jul 14, 2023 at 08:44:27AM +, Yong-Xuan Wang wrote: ... > +#if defined(CONFIG_KVM) > +static char *virt_get_kvm_aia(Object *obj, Error **errp) > +{ > +RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); > + > +return g_strdup(kvm_aia_mode_str(s->kvm_aia_mode)); > +} > + > +static void

Re: [PATCH v6 3/5] target/riscv: Create an KVM AIA irqchip

2023-07-21 Thread Andrew Jones
On Fri, Jul 14, 2023 at 08:44:25AM +, Yong-Xuan Wang wrote: > We create a vAIA chip by using the KVM_DEV_TYPE_RISCV_AIA and then set up > the chip with the KVM_DEV_RISCV_AIA_GRP_* APIs. > > Signed-off-by: Yong-Xuan Wang > Reviewed-by: Jim Shu > Reviewed-by: Daniel Henrique Barboza > Reviewe

[PATCH] tests/avocado/migration: Remove the malfunctioning s390x tests

2023-07-21 Thread Thomas Huth
The tests from tests/avocado/migration.py do not work at all on s390x - the bios shuts down immediately when it cannot find a boot disk, so there is nothing left to migrate here. For doing a proper migration test, we would need a proper payload, but we already do such tests in the migration *qtest*

[PATCH 4/4] cxl/vendor: SK hynix Niagara Multi-Headed SLD Device

2023-07-21 Thread Gregory Price
Create a new device to emulate the SK hynix Niagara MHSLD platform. This device has custom CCI commands that allow for applying isolation to each memory block between hosts. This enables an early form of dynamic capacity, whereby the NUMA node maps the entire region, but the host is responsible fo

[PATCH 3/4] cxl/type3: minimum MHD cci support

2023-07-21 Thread Gregory Price
Implement the MHD GET_INFO cci command and add a shared memory region to the type3 device to host the information. Add a helper program to initialize this shared memory region. Add a function pointer to type3 devices for future work that will allow an mhd device to provide a hook to validate whet

[PATCH 1/4] cxl/mailbox: change CCI cmd set structure to be a member, not a refernce

2023-07-21 Thread Gregory Price
This allows devices to have fully customized CCIs, along with complex devices where wrapper devices can override or add additional CCI commands without having to replicate full command structures or pollute a base device with every command that might ever be used. Signed-off-by: Gregory Price ---

[PATCH 2/4] cxl/mailbox: interface to add CCI commands to an existing CCI

2023-07-21 Thread Gregory Price
This enables wrapper devices to customize the base device's CCI (for example, with custom commands outside the specification) without the need to change the base device. The also enabled the base device to dispatch those commands without requiring additional driver support. Signed-off-by: Gregory

[PATCH 0/4] CXL: SK hynix Niagara MHSLD Device

2023-07-21 Thread Gregory Price
Base repo: https://gitlab.com/jic23/qemu Base branch: cxl-2023-07-17 This patch set includes an emulation of the SK hynix Niagara MHSLD platform with custom CCI commands that allow for isolation of memory blocks between attached hosts. There are 4 total patches in this set: 1 & 2: Modifications t

Re: [PATCH v2] target/ppc: Generate storage interrupts for radix RC changes

2023-07-21 Thread Cédric Le Goater
On 7/21/23 18:08, Daniel Henrique Barboza wrote: On 7/20/23 23:38, Nicholas Piggin wrote: On Thu Jul 13, 2023 at 3:35 AM AEST, Shawn Anastasio wrote: On 7/12/23 11:56 AM, Cédric Le Goater wrote: Hello Shawn, On 7/12/23 18:13, Shawn Anastasio wrote: Change radix model to always generate a s

Re: [PATCH v2] target/ppc: Generate storage interrupts for radix RC changes

2023-07-21 Thread Daniel Henrique Barboza
On 7/20/23 23:38, Nicholas Piggin wrote: On Thu Jul 13, 2023 at 3:35 AM AEST, Shawn Anastasio wrote: On 7/12/23 11:56 AM, Cédric Le Goater wrote: Hello Shawn, On 7/12/23 18:13, Shawn Anastasio wrote: Change radix model to always generate a storage interrupt when the R/C bits are not set ap

Re: [PATCH v2 3/4] vhost: Add high-level state save/load functions

2023-07-21 Thread Hanna Czenczek
On 21.07.23 17:18, Eugenio Perez Martin wrote: On Wed, Jul 12, 2023 at 1:17 PM Hanna Czenczek wrote: vhost_save_backend_state() and vhost_load_backend_state() can be used by vhost front-ends to easily save and load the back-end's state to/from the migration stream. Because we do not know the f

Re: [PATCH 3/6] vhost: Do not reset suspended devices on stop

2023-07-21 Thread Hanna Czenczek
On 21.07.23 17:25, Eugenio Perez Martin wrote: On Tue, Jul 11, 2023 at 5:52 PM Hanna Czenczek wrote: Move the `suspended` field from vhost_vdpa into the global vhost_dev struct, so vhost_dev_stop() can check whether the back-end has been suspended by `vhost_ops->vhost_dev_start(hdev, false)`.

Re: [PATCH v3 6/6] throttle: use enum ThrottleType instead of bool is_write

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: enum ThrottleType is already there, use ThrottleType instead of 'bool is_write' for throttle API, also modify related codes from block, fsdev, cryptodev and tests. Signed-off-by: zhenwei pi --- backends/cryptodev.c| 9 + block/throttle-gr

Re: [PATCH 5/6] vhost-vdpa: Match vhost-user's status reset

2023-07-21 Thread Eugenio Perez Martin
On Wed, Jul 19, 2023 at 4:10 PM Hanna Czenczek wrote: > > On 18.07.23 16:50, Stefan Hajnoczi wrote: > > On Tue, Jul 11, 2023 at 05:52:27PM +0200, Hanna Czenczek wrote: > >> vhost-vdpa and vhost-user differ in how they reset the status in their > >> respective vhost_reset_status implementations: vh

Re: [PATCH v3 2/6] test-throttle: use enum ThrottleType

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: Use enum ThrottleType instead in the throttle test codes. Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v3 4/6] test-throttle: test read only and write only

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 66 ++ 1 file changed, 66 insertions(+) Reviewed-by: Hanna Czenczek

Re: [PATCH v3 3/6] throttle: support read-only and write-only

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: Only one direction is necessary in several scenarios: - a read-only disk - operations on a device are considered as *write* only. For example, encrypt/decrypt/sign/verify operations on a cryptodev use a single *write* timer(read timer callback is defined

Re: [PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: Operations on a crytpodev are considered as *write* only, the callback s/crytpodev/cryptodev/ of read direction is never invoked. Use NULL instead of an unreachable path(cryptodev_backend_throttle_timer_cb on read direction). Reviewed-by: Alberto Garcia

Re: [PATCH v3 1/6] throttle: introduce enum ThrottleType

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: Use enum ThrottleType instead of number index. Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- include/qemu/throttle.h | 11 --- util/throttle.c | 16 +--- 2 files changed, 17 insertions(+), 10 deletions(-) [...]

Re: [PATCH v6 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-21 Thread Bui Quang Minh
On 7/21/23 03:47, Peter Xu wrote: On Mon, Jul 17, 2023 at 11:29:56PM +0700, Bui Quang Minh wrote: On 7/17/23 17:47, Joao Martins wrote: +Peter, +Jason (intel-iommu maintainer/reviewer) Thanks for copying me, Joan. On 15/07/2023 16:22, Bui Quang Minh wrote: As userspace APIC now supports x

Re: [PATCH 3/6] vhost: Do not reset suspended devices on stop

2023-07-21 Thread Eugenio Perez Martin
On Tue, Jul 11, 2023 at 5:52 PM Hanna Czenczek wrote: > > Move the `suspended` field from vhost_vdpa into the global vhost_dev > struct, so vhost_dev_stop() can check whether the back-end has been > suspended by `vhost_ops->vhost_dev_start(hdev, false)`. If it has, > there is no need to reset it;

Re: [PULL 5/5] linux-user: Fix qemu-arm to run static armhf binaries

2023-07-21 Thread Michael Tokarev
21.07.2023 18:14, Michael Tokarev пишет: 19.07.2023 18:52, Helge Deller wrote: qemu-user crashes immediately when running static binaries on the armhf architecture. The problem is the memory layout where the executable is loaded before the interpreter library, in which case the reserved brk regi

Re: [PATCH v2 3/4] vhost: Add high-level state save/load functions

2023-07-21 Thread Eugenio Perez Martin
On Wed, Jul 12, 2023 at 1:17 PM Hanna Czenczek wrote: > > vhost_save_backend_state() and vhost_load_backend_state() can be used by > vhost front-ends to easily save and load the back-end's state to/from > the migration stream. > > Because we do not know the full state size ahead of time, > vhost_s

Re: [PULL 5/5] linux-user: Fix qemu-arm to run static armhf binaries

2023-07-21 Thread Michael Tokarev
19.07.2023 18:52, Helge Deller wrote: qemu-user crashes immediately when running static binaries on the armhf architecture. The problem is the memory layout where the executable is loaded before the interpreter library, in which case the reserved brk region clashes with the interpreter code and i

[PATCH v9 04/10] migration: convert rdma backend to accept MigrateAddress

2023-07-21 Thread Het Gala
RDMA based transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for RDMA connection into well defined InetSocketAddress struct. Suggested-by: Aravind Retnakaran

[PATCH v9 07/10] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax

2023-07-21 Thread Het Gala
migration_channels_and_uri_compatible() check for transport mechanism suitable for multifd migration gets executed when the caller calls old uri syntax. It needs it to be run when using the modern MigrateChannel QAPI syntax too. After URI -> 'MigrateChannel' : migration_channels_and_uri_compatible

[PATCH v9 06/10] migration: New migrate and migrate-incoming argument 'channels'

2023-07-21 Thread Het Gala
MigrateChannelList allows to connect accross multiple interfaces. Add MigrateChannelList struct as argument to migration QAPIs. We plan to include multiple channels in future, to connnect multiple interfaces. Hence, we choose 'MigrateChannelList' as the new argument over 'MigrateChannel' to make m

[PATCH v9 02/10] migration: convert migration 'uri' into 'MigrateAddress'

2023-07-21 Thread Het Gala
This patch parses 'migrate' and 'migrate-incoming' QAPI's 'uri' string containing migration connection related information and stores them inside well defined 'MigrateAddress' struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/exec.c

[PATCH v9 10/10] migration: modify test_multifd_tcp_none() to use new QAPI syntax.

2023-07-21 Thread Het Gala
modify multifd tcp common test to incorporate the new QAPI syntax defined. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- tests/qtest/migration-test.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-tes

[PATCH v9 03/10] migration: convert socket backend to accept MigrateAddress

2023-07-21 Thread Het Gala
Socket transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for socket connection into well defined SocketAddress struct. Suggested-by: Aravind Retnakaran Signed

[PATCH v9 08/10] migration: Implement MigrateChannelList to qmp migration flow.

2023-07-21 Thread Het Gala
Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for qmp migration. For current series, limit the size of MigrateChannelList to single element (single interface) as runtime check. Suggested-by: Aravind Retnakaran Signed-of

[PATCH v9 05/10] migration: convert exec backend to accept MigrateAddress.

2023-07-21 Thread Het Gala
Exec transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for exec connection into strList struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Revi

[PATCH v9 09/10] migration: Implement MigrateChannelList to hmp migration flow.

2023-07-21 Thread Het Gala
Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for hmp migration. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/migration-hmp-cmds.c | 16 +--- migration/migration.c | 5 ++

[PATCH v9 00/10] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration

2023-07-21 Thread Het Gala
This is v9 patchset of modified 'migrate' and 'migrate-incoming' QAPI design for upstream review. Would like to thank all the maintainers that actively participated in the v8 patchset discussion and gave insightful suggestions to improve the patches. Link to previous upstream community patchset

[PATCH v9 01/10] migration: New QAPI type 'MigrateAddress'

2023-07-21 Thread Het Gala
This patch introduces well defined MigrateAddress struct and its related child objects. The existing argument of 'migrate' and 'migrate-incoming' QAPI - 'uri' is of type string. The current implementation follows double encoding scheme for fetching migration parameters like 'uri' and this is not a

Re: [PATCH 3/4] vdpa: Restore vlan filtering state

2023-07-21 Thread Hawkins Jiawei
On 2023/7/21 19:57, Eugenio Perez Martin wrote: > On Wed, Jul 19, 2023 at 9:48 AM Hawkins Jiawei wrote: >> >> This patch introduces vhost_vdpa_net_load_single_vlan() >> and vhost_vdpa_net_load_vlan() to restore the vlan >> filtering state at device's startup. >> >> Co-developed-by: Eugenio Pérez

Re: [PATCH] target/riscv/cpu.c: do not run 'host' CPU with TCG

2023-07-21 Thread Daniel Henrique Barboza
On 7/21/23 11:37, Philippe Mathieu-Daudé wrote: On 21/7/23 15:34, Daniel Henrique Barboza wrote: The 'host' CPU is available in a CONFIG_KVM build and it's currently available for all accels, but is a KVM only CPU. This means that in a RISC-V KVM capable host we can do things like this: $ ./

Re: [PATCH] target/riscv/cpu.c: do not run 'host' CPU with TCG

2023-07-21 Thread Philippe Mathieu-Daudé
On 21/7/23 15:34, Daniel Henrique Barboza wrote: The 'host' CPU is available in a CONFIG_KVM build and it's currently available for all accels, but is a KVM only CPU. This means that in a RISC-V KVM capable host we can do things like this: $ ./build/qemu-system-riscv64 -M virt,accel=tcg -cpu hos

[PATCH for-8.1] target/arm: Special case M-profile in debug_helper.c code

2023-07-21 Thread Peter Maydell
A lot of the code called from helper_exception_bkpt_insn() is written assuming A-profile, but we will also call this helper on M-profile CPUs when they execute a BKPT insn. This used to work by accident, but recent changes mean that we will hit an assert when some of this code calls down into lowe

Re: [PATCH 6/6] vhost-user: Have reset_status fall back to reset

2023-07-21 Thread Hanna Czenczek
On 20.07.23 18:03, Stefan Hajnoczi wrote: On Wed, Jul 19, 2023 at 04:27:58PM +0200, Hanna Czenczek wrote: On 19.07.23 16:11, Hanna Czenczek wrote: On 18.07.23 17:10, Stefan Hajnoczi wrote: On Tue, Jul 11, 2023 at 05:52:28PM +0200, Hanna Czenczek wrote: The only user of vhost_user_reset_status

Re: [PATCH 7/7] tests/avocado: ppc64 pseries reverse debugging test

2023-07-21 Thread Nicholas Piggin
On Mon Jun 26, 2023 at 7:34 PM AEST, Nicholas Piggin wrote: > On Mon Jun 26, 2023 at 5:49 PM AEST, Pavel Dovgalyuk wrote: > > On 23.06.2023 15:57, Nicholas Piggin wrote: > > > pseries can run reverse-debugging well enough to pass basic tests. > > > > > > There is strangeness with reverse-continue

[PATCH] virtio: Fix packed virtqueue used_idx mask

2023-07-21 Thread Hanna Czenczek
virtio_queue_packed_set_last_avail_idx() is used by vhost devices to set the internal queue indices to what has been reported by the vhost back-end through GET_VRING_BASE. For packed virtqueues, this 32-bit value is expected to contain both the device's internal avail and used indices, as well as

[PATCH] target/riscv/cpu.c: do not run 'host' CPU with TCG

2023-07-21 Thread Daniel Henrique Barboza
The 'host' CPU is available in a CONFIG_KVM build and it's currently available for all accels, but is a KVM only CPU. This means that in a RISC-V KVM capable host we can do things like this: $ ./build/qemu-system-riscv64 -M virt,accel=tcg -cpu host --nographic qemu-system-riscv64: H extension requ

Re: [PATCH 1/2] hw/char/riscv_htif: Fix printing of console characters on big endian hosts

2023-07-21 Thread Philippe Mathieu-Daudé
On 21/7/23 11:47, Thomas Huth wrote: The character that should be printed is stored in the 64 bit "payload" variable. The code currently tries to print it by taking the address of the variable and passing this pointer to qemu_chr_fe_write(). However, this only works on little endian hosts where t

[PATCH] target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt()

2023-07-21 Thread jianchunfu
It's unnecessary for non-KVM accelerators(TCG, for example), to call this function, so change the order of kvm_enable() judgment. The static inline function that returns -1 directly does not work in TCG's situation. Signed-off-by: jianchunfu --- hw/ppc/ppc.c | 8 ++-- target/ppc/kvm.c

Re: [PATCH v2] accel/kvm: Specify default IPA size for arm64

2023-07-21 Thread Peter Maydell
On Fri, 21 Jul 2023 at 08:30, Philippe Mathieu-Daudé wrote: > > Hi Akihiko, > > On 21/7/23 08:24, Akihiko Odaki wrote: > > libvirt uses "none" machine type to test KVM availability. Before this > > change, QEMU used to pass 0 as machine type when calling KVM_CREATE_VM. > > > > The kernel documenta

Re: [PATCH for-8.2 6/6] vfio/migration: Allow migration of multiple P2P supporting devices

2023-07-21 Thread Cédric Le Goater
On 7/16/23 10:15, Avihai Horon wrote: Now that P2P support has been added to VFIO migration, allow migration of multiple devices if all of them support P2P migration. Single device migration is allowed regardless of P2P migration support. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins

Re: [PATCH 3/4] vdpa: Restore vlan filtering state

2023-07-21 Thread Eugenio Perez Martin
On Wed, Jul 19, 2023 at 9:48 AM Hawkins Jiawei wrote: > > This patch introduces vhost_vdpa_net_load_single_vlan() > and vhost_vdpa_net_load_vlan() to restore the vlan > filtering state at device's startup. > > Co-developed-by: Eugenio Pérez > Signed-off-by: Eugenio Pérez > Signed-off-by: Hawkins

[PATCH] scripts/qemu-binfmt-conf.sh: refresh

2023-07-21 Thread Michael Tokarev
Currently qemu-binfmt-conf.sh does a number of strange things. 1. --systemd requires an argument - the CPU type to register, while --debian (which is actually --binfmt-support) does not accept such an argument, so it is not possible to specify which CPU(s) to register for debian. 2. Why

Re: [PATCH for-8.2 5/6] vfio/migration: Add P2P support for VFIO migration

2023-07-21 Thread Cédric Le Goater
On 7/16/23 10:15, Avihai Horon wrote: VFIO migration uAPI defines an optional intermediate P2P quiescent state. While in the P2P quiescent state, P2P DMA transactions cannot be initiated by the device, but the device can respond to incoming ones. Additionally, all outstanding P2P transactions are

Re: [PATCH for-8.2 4/6] vfio/migration: Refactor PRE_COPY and RUNNING state checks

2023-07-21 Thread Cédric Le Goater
On 7/16/23 10:15, Avihai Horon wrote: From: Joao Martins Move the PRE_COPY and RUNNING state checks to helper functions. This is in preparation for adding P2P VFIO migration support, where these helpers will also test for PRE_COPY_P2P and RUNNING_P2P states. Signed-off-by: Joao Martins Signe

Re: [PATCH] numa: Skip invalidation of cluster and NUMA node boundary for qtest

2023-07-21 Thread Peter Maydell
On Fri, 21 Jul 2023 at 11:44, Gavin Shan wrote: > > There are warning messages printed from tests/qtest/numa-test.c, > to complain the CPU cluster and NUMA node boundary is broken. Since > the broken boundary is expected, we don't want to see the warning > messages. > > # cd /home/gavin/sandbox/

Re: [PATCH v21 01/20] s390x/cpu topology: add s390 specifics to CPU topology

2023-07-21 Thread Pierre Morel
On 7/18/23 18:31, Nina Schoetterl-Glausch wrote: Reviewed-by: Nina Schoetterl-Glausch Some notes below. The s390x/ prefix in the title might suggest that this patch is s390 specific, but it touches common files. Right. What do you suggest? I can cut it in two or squash it with patch num

RE: [PATCH v1] migration: refactor migration_completion

2023-07-21 Thread Wang, Wei W
On Friday, July 21, 2023 4:38 AM, Peter Xu wrote: > Looks good to me, after addressing Isaku's comments. > > The current_active_state is very unfortunate, along with most of the calls to > migrate_set_state() - I bet most of the code will definitely go wrong if that > cmpxchg didn't succeed inside

Re: [PATCH v6 0/3] hw/ufs: Add Universal Flash Storage (UFS) support

2023-07-21 Thread Stefan Hajnoczi
Is there a test case along the lines of tests/qtest/ahci-test.c that exercises this new code? It's important to have at least a basic test that initializes the device and performs a write followed by a read to verify that I/O is working. This will allow the CI system and anyone who modifies the UF

[PATCH] vhost-user-scsi: support reconnect to backend

2023-07-21 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. Tested with spdk backend. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 - hw/scsi/vhost-scsi-common.c | 27 ++--- hw/scsi/vhost-user-scsi.c | 163

Re: [PULL 03/18] numa: Validate cluster and NUMA node boundary if required

2023-07-21 Thread Gavin Shan
On 7/20/23 23:10, Peter Maydell wrote: On Mon, 26 Jun 2023 at 12:15, Paolo Bonzini wrote: From: Gavin Shan For some architectures like ARM64, multiple CPUs in one cluster can be associated with different NUMA nodes, which is irregular configuration because we shouldn't have this in baremet

[PATCH] numa: Skip invalidation of cluster and NUMA node boundary for qtest

2023-07-21 Thread Gavin Shan
There are warning messages printed from tests/qtest/numa-test.c, to complain the CPU cluster and NUMA node boundary is broken. Since the broken boundary is expected, we don't want to see the warning messages. # cd /home/gavin/sandbox/qemu.main/build # MALLOC_PERTURB_=255 QTEST_QEMU_BINARY=./qe

Re: [PATCH 1/2] Reduce vdpa initialization / startup overhead

2023-07-21 Thread Eugenio Perez Martin
On Tue, Jul 18, 2023 at 12:55 PM Michael S. Tsirkin wrote: > > On Thu, Apr 20, 2023 at 10:59:56AM +0200, Eugenio Perez Martin wrote: > > On Thu, Apr 20, 2023 at 7:25 AM Pei Li wrote: > > > > > > Hi all, > > > > > > My bad, I just submitted the kernel patch. If we are passing some generic > > > c

Re: [PATCH 2/2] hw/char/riscv_htif: Fix the console syscall on big endian hosts

2023-07-21 Thread Daniel Henrique Barboza
On 7/21/23 06:47, Thomas Huth wrote: Values that have been read via cpu_physical_memory_read() from the guest's memory have to be swapped in case the host endianess differs from the guest. Fixes: a6e13e31d5 ("riscv_htif: Support console output via proxy syscall") Signed-off-by: Thomas Huth -

Re: [PATCH 1/2] hw/char/riscv_htif: Fix printing of console characters on big endian hosts

2023-07-21 Thread Daniel Henrique Barboza
On 7/21/23 06:47, Thomas Huth wrote: The character that should be printed is stored in the 64 bit "payload" variable. The code currently tries to print it by taking the address of the variable and passing this pointer to qemu_chr_fe_write(). However, this only works on little endian hosts wher

Re: [PATCH 2/2] hw/char/riscv_htif: Fix the console syscall on big endian hosts

2023-07-21 Thread Bin Meng
On Fri, Jul 21, 2023 at 5:48 PM Thomas Huth wrote: > > Values that have been read via cpu_physical_memory_read() from the > guest's memory have to be swapped in case the host endianess differs typo: endianness > from the guest. > > Fixes: a6e13e31d5 ("riscv_htif: Support console output via proxy

Re: [PATCH 1/2] hw/char/riscv_htif: Fix printing of console characters on big endian hosts

2023-07-21 Thread Bin Meng
On Fri, Jul 21, 2023 at 5:48 PM Thomas Huth wrote: > > The character that should be printed is stored in the 64 bit "payload" > variable. The code currently tries to print it by taking the address > of the variable and passing this pointer to qemu_chr_fe_write(). However, > this only works on litt

Re: [PATCH-for-8.1] target/tricore: Rename tricore_feature

2023-07-21 Thread Bastian Koppelmann
On Fri, Jul 21, 2023 at 10:54:43AM +0200, Philippe Mathieu-Daudé wrote: > On 21/7/23 09:31, Philippe Mathieu-Daudé wrote: > > On 21/7/23 08:06, Bastian Koppelmann wrote: > > > this name is used by capstone and will lead to a build failure of QEMU, > > > when capstone is enabled. So we rename it to

Re: [PULL 00/14] NBD patches for 2023-07-19

2023-07-21 Thread Peter Maydell
On Wed, 19 Jul 2023 at 21:39, Eric Blake wrote: > > The following changes since commit 2c27fdc7a626408ee2cf30d791aa0b63027c7404: > > Update version for v8.1.0-rc0 release (2023-07-19 20:31:43 +0100) > > are available in the Git repository at: > > https://repo.or.cz/qemu/ericb.git tags/pull-nbd

Re: [PULL 0/5] Linux user brk fixes patches

2023-07-21 Thread Peter Maydell
On Wed, 19 Jul 2023 at 16:53, Helge Deller wrote: > > The following changes since commit 361d5397355276e3007825cc17217c1e4d4320f7: > > Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into > staging (2023-07-17 15:49:27 +0100) > > are available in the Git repository at: > >

[PATCH 2/2] hw/char/riscv_htif: Fix the console syscall on big endian hosts

2023-07-21 Thread Thomas Huth
Values that have been read via cpu_physical_memory_read() from the guest's memory have to be swapped in case the host endianess differs from the guest. Fixes: a6e13e31d5 ("riscv_htif: Support console output via proxy syscall") Signed-off-by: Thomas Huth --- hw/char/riscv_htif.c | 9 + 1

[PATCH 0/2] riscv: Fix the console of the Spike machine on big endian hosts

2023-07-21 Thread Thomas Huth
The tests/avocado/riscv_opensbi.py avocado test is currently failing on big endian hosts since the console of the Spike machine is not working there. With two small patches, this can be fixed: First patch fixes riscv64, and the second one fixes riscv32. Thomas Huth (2): hw/char/riscv_htif: Fix p

[PATCH 1/2] hw/char/riscv_htif: Fix printing of console characters on big endian hosts

2023-07-21 Thread Thomas Huth
The character that should be printed is stored in the 64 bit "payload" variable. The code currently tries to print it by taking the address of the variable and passing this pointer to qemu_chr_fe_write(). However, this only works on little endian hosts where the least significant bits are stored on

Re: [PATCH for-8.2 0/4] rtc devices: Avoid putting time_t in 32-bit variables

2023-07-21 Thread Peter Maydell
On Fri, 21 Jul 2023 at 10:16, Philippe Mathieu-Daudé wrote: > > Hi Peter, > > On 20/7/23 17:58, Peter Maydell wrote: > > This patchset was prompted by a couple of Coverity warnings > > (CID 1507157, 1517772) which note that in the m48t59 RTC device model > > we keep an offset in a time_t variable

Re: [PATCH for-8.2 0/4] rtc devices: Avoid putting time_t in 32-bit variables

2023-07-21 Thread Peter Maydell
On Fri, 21 Jul 2023 at 10:03, Philippe Mathieu-Daudé wrote: > > +Markus > > On 20/7/23 17:58, Peter Maydell wrote: > > This patchset was prompted by a couple of Coverity warnings > > (CID 1507157, 1517772) which note that in the m48t59 RTC device model > > we keep an offset in a time_t variable bu

Re: [PATCH for-8.2 1/4] hw/rtc/m48t59: Use 64-bit arithmetic in set_alarm()

2023-07-21 Thread Peter Maydell
On Fri, 21 Jul 2023 at 10:09, Philippe Mathieu-Daudé wrote: > > On 20/7/23 17:58, Peter Maydell wrote: > > In the m48t59 device we almost always use 64-bit arithmetic when > > dealing with time_t deltas. The one exception is in set_alarm(), > > which currently uses a plain 'int' to hold the diffe

  1   2   >