[PULL 18/30] accel: Rename HVF 'struct hvf_vcpu_state' -> AccelCPUState

2023-06-28 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Rename the 'hvf_vcpu_state' structure as 'AccelCPUState'. Use the generic 'accel' field of CPUState instead of 'hvf'. Replace g_malloc0() by g_new0() for readability. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by:

[PULL 10/30] accel: Move HAX hThread to accelerator context

2023-06-28 Thread Philippe Mathieu-Daudé
hThread variable is only used by the HAX accelerator, so move it to the accelerator specific context. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230624174121.11508-9-phi...@linaro.org> --- include/hw/core/cpu.h | 1 -

[PULL 13/30] accel: Inline NVMM get_qemu_vcpu()

2023-06-28 Thread Philippe Mathieu-Daudé
No need for this helper to access the CPUState::accel field. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230624174121.11508-12-phi...@linaro.org> --- target/i386/nvmm/nvmm-all.c | 28 +++- 1 file changed, 11 insertions(+), 17

[PULL 15/30] accel: Rename WHPX 'struct whpx_vcpu' -> AccelCPUState

2023-06-28 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Rename WHPX 'whpx_vcpu' as 'AccelCPUState'; use the typedef. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230624174121.11508-14-phi...@linaro.org> --- target/i386/whpx/whpx-all.c | 30

[PULL 23/30] hw/arm/sbsa-ref: Include missing 'sysemu/kvm.h' header

2023-06-28 Thread Philippe Mathieu-Daudé
"sysemu/kvm.h" is indirectly pulled in. Explicit its inclusion to avoid when refactoring include/: hw/arm/sbsa-ref.c:693:9: error: implicit declaration of function 'kvm_enabled' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (kvm_enabled()) { ^ Reviewed-by: Leif

[PULL 03/30] accel: Re-enable WHPX cross-build on case sensitive filesystems

2023-06-28 Thread Philippe Mathieu-Daudé
Since MinGW commit 395dcfdea ("rename hyper-v headers and def files to lower case") [*], WinHvPlatform.h and WinHvEmulation.h got respectively renamed as winhvplatform.h / winhvemulation.h. The mingw64-headers package included in the Fedora version we use for CI does include this commit; and

[PULL 05/30] accel: Remove unused hThread variable on TCG/WHPX

2023-06-28 Thread Philippe Mathieu-Daudé
On Windows hosts, cpu->hThread is assigned but never accessed: remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230624174121.11508-4-phi...@linaro.org> --- accel/tcg/tcg-accel-ops-mttcg.c | 4 accel/tcg/tcg-accel-ops-rr.c | 3 ---

[PATCH 1/2] vhost-user: Change one_time to per_device request

2023-06-28 Thread Tom Lonergan
Some devices, like virtio-scsi, consist of one vhost_dev, while others, like virtio-net, contain multiple vhost_devs. The QEMU vhost-user code has a concept of one-time messages which is misleading. One-time messages are sent once per operation on the device, not once for the lifetime of the

[PATCH 2/2] vhost-user: Make RESET_DEVICE a per device message

2023-06-28 Thread Tom Lonergan
A device reset is issued per device, not per VQ. The legacy device reset message, VHOST_USER_RESET_OWNER, is already a per device message. Therefore, this change adds the proper message, VHOST_USER_RESET_DEVICE, to per device messages. Signed-off-by: Tom Lonergan --- hw/virtio/vhost-user.c | 1

Re: [PATCH V3 1/2] migration: file URI

2023-06-28 Thread Peter Xu
On Wed, Jun 28, 2023 at 01:07:24PM -0400, Peter Xu wrote: > On Thu, Jun 22, 2023 at 01:37:30PM -0700, Steve Sistare wrote: > > Extend the migration URI to support file:. This can be used for > > any migration scenario that does not require a reverse path. It can be > > used as an alternative to

Re: [PATCH V3 2/2] migration: file URI offset

2023-06-28 Thread Peter Xu
On Thu, Jun 22, 2023 at 01:37:31PM -0700, Steve Sistare wrote: > Allow an offset option to be specified as part of the file URI, in > the form "file:filename,offset=offset", where offset accepts the common > size suffixes, or the 0x prefix, but not both. Migration data is written > to and read

Re: [PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-06-28 Thread Marcelo Tosatti
On Fri, Jun 16, 2023 at 04:08:30PM +0200, Anthony Harivel wrote: > Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL > interface (Running Average Power Limit) for advertising the accumulated > energy consumption of various power domains (e.g. CPU packages, DRAM, > etc.). > >

Re: [PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-06-28 Thread Anthony Harivel
Marcelo Tosatti, Jun 28, 2023 at 19:26: Hi Marcelo, > On Fri, Jun 16, 2023 at 04:08:30PM +0200, Anthony Harivel wrote: > This feature is activated with -accel kvm,rapl=true. > >> I suppose this should be a CPU flag instead? -cpu xxx,rapl=on. It's possible yes then I might need to make sure that

Re: [PATCH v3 3/6] target/ppc: Move CPU QOM definitions to cpu-qom.h

2023-06-28 Thread Greg Kurz
On Tue, 27 Jun 2023 13:51:21 +0200 Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > --- > target/ppc/cpu-qom.h | 5 + > target/ppc/cpu.h | 6 -- > 2 files changed, 5 insertions(+), 6 deletions(-) > > diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h >

[PATCH v4 4/6] util/osdep: Introduce qemu_close_range()

2023-06-28 Thread Bin Meng
This introduces a new QEMU API qemu_close_range() that closes all open file descriptors from first to last (included). This API will try a more efficient call to close_range(), or walk through of /proc/self/fd whenever these are possible, otherwise it falls back to a plain close loop.

[PATCH v4 6/6] net: tap: Use qemu_close_range() to close fds

2023-06-28 Thread Bin Meng
From: Zhangjin Wu Current codes using a brute-force traversal of all file descriptors do not scale on a system where the maximum number of file descriptors is set to a very large value (e.g.: in a Docker container of Manjaro distribution it is set to 1073741816). QEMU just looks frozen during

[PATCH v4 3/6] util/async-teardown: Fall back to close fds one by one

2023-06-28 Thread Bin Meng
When opening /proc/self/fd fails, current codes just return directly, but we can fall back to close fds one by one. Signed-off-by: Bin Meng --- - feel free to drop this patch if it does not make too much sense (no changes since v2) Changes in v2: - new patch: "util/async-teardown: Fall back

Re: [PULL 00/10] qemu-sparc queue 20230628

2023-06-28 Thread Richard Henderson
://github.com/mcayland/qemu.git tags/qemu-sparc-20230628 for you to fetch changes up to 6b90a4cdc04ec7ca94c3f664d63ee43c2046a875: escc: emulate dip switch language layout settings on SUN keyboard (2023-06-28 10:54:25 +0100) qemu-sparc

Re: [PULL 0/1] virtio: regression fix

2023-06-28 Thread Richard Henderson
On 6/28/23 13:41, Michael S. Tsirkin wrote: The following changes since commit a0d7215e339b61c7d7a7b3fcf754954d80d93eb8: vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present (2023-06-26 09:50:00 -0400) are available in the Git repository at:

[PATCH v4 5/6] util/async-teardown: Use qemu_close_range() to close fds

2023-06-28 Thread Bin Meng
From: Zhangjin Wu Based on the old close_all_open_fd() of util/async-teardown.c, a new generic qemu_close_range() has been added in osdep.c. Now, let's switch over to use the generic qemu_close_range(). Signed-off-by: Zhangjin Wu Signed-off-by: Bin Meng --- Changes in v4: - call sysconf

Re: [PATCH V3 1/2] migration: file URI

2023-06-28 Thread Peter Xu
On Thu, Jun 22, 2023 at 01:37:30PM -0700, Steve Sistare wrote: > Extend the migration URI to support file:. This can be used for > any migration scenario that does not require a reverse path. It can be > used as an alternative to 'exec:cat > file' in minimized containers that > do not contain

Re: [PATCH v3 4/6] util/osdep: Introduce qemu_close_range()

2023-06-28 Thread Bin Meng
On 2023/6/19 17:18:53, "Claudio Imbrenda" wrote: On Sat, 17 Jun 2023 13:36:19 +0800 Bin Meng wrote: This introduces a new QEMU API qemu_close_range() that closes all open file descriptors from first to last (included). This API will try a more efficient call to close_range(), or walk

[PATCH] target/arm: gdbstub: Guard M-profile code with CONFIG_TCG

2023-06-28 Thread Fabiano Rosas
This code is only relevant when TCG is present in the build. Building with --disable-tcg --enable-xen on an x86 host we get: $ ../configure --target-list=x86_64-softmmu,aarch64-softmmu --disable-tcg --enable-xen $ make -j$(nproc) ... libqemu-aarch64-softmmu.fa.p/target_arm_gdbstub.c.o: in

Re: [RFC 7/7] hw/mem/cxl_type3: add read/write support to dynamic capacity

2023-06-28 Thread ni...@outlook.com
The 05/15/2023 16:22, Jonathan Cameron wrote: > On Thu, 11 May 2023 17:56:40 + > Fan Ni wrote: > > > From: Fan Ni > > > > Before the change, read from or write to dynamic capacity of the memory > > device is not support as 1) no host backed file/memory is provided for > > it; 2) no address

Re: [PATCH] target/arm: gdbstub: Guard M-profile code with CONFIG_TCG

2023-06-28 Thread Philippe Mathieu-Daudé
On 28/6/23 18:48, Fabiano Rosas wrote: This code is only relevant when TCG is present in the build. Building with --disable-tcg --enable-xen on an x86 host we get: $ ../configure --target-list=x86_64-softmmu,aarch64-softmmu --disable-tcg --enable-xen $ make -j$(nproc) ...

[QEMU][PATCH v1] tests/qtest: xlnx-canfd-test: Fix code coverity issues

2023-06-28 Thread Vikram Garhwal
Following are done to fix the coverity issues: 1. Change read_data to fix the CID 1512899: Out-of-bounds access (OVERRUN) 2. Fix match_rx_tx_data to fix CID 1512900: Logically dead code (DEADCODE) 3. Replace rand() in generate_random_data() with g_rand_int() Signed-off-by: Vikram Garhwal ---

Re: [RESEND PATCH v5 5/5] hw/pci: ensure PCIE devices are plugged into only slot 0 of PCIE port

2023-06-28 Thread Ani Sinha
> On 27-Jun-2023, at 7:57 PM, Michael S. Tsirkin wrote: > > On Tue, Jun 27, 2023 at 02:38:44PM +0200, Igor Mammedov wrote: >> On Tue, 27 Jun 2023 08:23:25 -0400 >> "Michael S. Tsirkin" wrote: >> >>> On Tue, Jun 27, 2023 at 01:58:49PM +0200, Igor Mammedov wrote: On Tue, 27 Jun 2023

[PULL 01/30] MAINTAINERS: Update Roman Bolshakov email address

2023-06-28 Thread Philippe Mathieu-Daudé
r.bolsha...@yadro.com is bouncing: Update Roman's email address using one found somewhere on the Internet; this way he can Ack-by. (Reorder Taylor's line to keep the section sorted alphabetically). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Roman Bolshakov Message-Id:

[PULL 00/30] Accelerator patches for 2023-06-28

2023-06-28 Thread Philippe Mathieu-Daudé
The following changes since commit b111569da9f82fdf05df03184836a4564adef599: Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-06-28 08:42:32 +0200) are available in the Git repository at: https://github.com/philmd/qemu.git tags/accel-20230628

[PULL 07/30] accel: Destroy HAX vCPU threads once done

2023-06-28 Thread Philippe Mathieu-Daudé
When the vCPU thread finished its processing, destroy it and signal its destruction to generic vCPU management layer. Add a sanity check for the vCPU accelerator context. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230624174121.11508-6-phi...@linaro.org>

[PULL 09/30] accel: Rename HAX 'struct hax_vcpu_state' -> AccelCPUState

2023-06-28 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Start with the HAX context, renaming its forward declarated structure 'hax_vcpu_state' as 'AccelCPUState'. Document the CPUState field. Directly use the typedef. Remove the amusing but now unnecessary casts in NVMM / WHPX.

[PULL 11/30] accel: Remove NVMM unreachable error path

2023-06-28 Thread Philippe Mathieu-Daudé
g_malloc0() can not fail. Remove the unreachable error path. https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html#glib-Memory-Allocation.description Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230624174121.11508-10-phi...@linaro.org>

[PULL 04/30] accel: Document generic accelerator headers

2023-06-28 Thread Philippe Mathieu-Daudé
These headers are meant to be include by any file to check the availability of accelerators, thus are not accelerator specific. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson Message-Id: <20230624174121.11508-3-phi...@linaro.org> --- include/sysemu/hax.h | 2 ++

[PULL 27/30] target/i386/WHPX: Fix error message when fail to set ProcessorCount

2023-06-28 Thread Philippe Mathieu-Daudé
From: Zhao Liu 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology") changes the meaning of MachineState.smp.cores from "the number of cores in one package" to "the number of cores in one die" and doesn't fix other uses of MachineState.smp.cores. And because of the

[PULL 29/30] exec/memory: Add symbol for memory listener priority for device backend

2023-06-28 Thread Philippe Mathieu-Daudé
From: Isaku Yamahata Add MEMORY_LISTENER_PRIORITY_DEV_BACKEND for the symbolic value for memory listener to replace the hard-coded value 10 for the device backend. No functional change intended. Signed-off-by: Isaku Yamahata Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PULL 16/30] accel: Inline WHPX get_whpx_vcpu()

2023-06-28 Thread Philippe Mathieu-Daudé
No need for this helper to access the CPUState::accel field. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230624174121.11508-15-phi...@linaro.org> --- target/i386/whpx/whpx-all.c | 29 ++--- 1 file changed, 10 insertions(+), 19

[PULL 30/30] exec/memory: Add symbol for the min value of memory listener priority

2023-06-28 Thread Philippe Mathieu-Daudé
From: Isaku Yamahata Add MEMORY_LISTNER_PRIORITY_MIN for the symbolic value for the min value of the memory listener instead of the hard-coded magic value 0. Add explicit initialization. No functional change intended. Signed-off-by: Isaku Yamahata Reviewed-by: Philippe Mathieu-Daudé

[PULL 24/30] target/arm: Restrict KVM-specific fields from ArchCPU

2023-06-28 Thread Philippe Mathieu-Daudé
These fields shouldn't be accessed when KVM is not available. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230405160454.97436-8-phi...@linaro.org> --- target/arm/cpu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/cpu.h

[PATCH] MAINTAINERS: Promote Cédric to VFIO co-maintainer

2023-06-28 Thread Alex Williamson
Cédric has stepped up involvement in vfio, reviewing and managing patches, as well as pull requests. This work deserves gratitude and punishment with a promotion to co-maintainer ;) Signed-off-by: Alex Williamson --- Cédric, I'd also support if you wanted to add a tree entry here.

[PULL 26/30] target/riscv: Restrict KVM-specific fields from ArchCPU

2023-06-28 Thread Philippe Mathieu-Daudé
These fields shouldn't be accessed when KVM is not available. Restrict the KVM timer migration state. Rename the KVM timer post_load() handler accordingly, because cpu_post_load() is too generic. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Message-Id:

[PULL 28/30] exec/memory: Add symbolic value for memory listener priority for accel

2023-06-28 Thread Philippe Mathieu-Daudé
From: Isaku Yamahata Add MEMORY_LISTNER_PRIORITY_ACCEL for the symbolic value for the memory listener to replace the hard-coded value 10 for accel. No functional change intended. Signed-off-by: Isaku Yamahata Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Philippe

Re: [PATCH] MAINTAINERS: Promote Cédric to VFIO co-maintainer

2023-06-28 Thread Philippe Mathieu-Daudé
On 28/6/23 19:29, Alex Williamson wrote: Cédric has stepped up involvement in vfio, reviewing and managing patches, as well as pull requests. This work deserves gratitude and punishment with a promotion to co-maintainer ;) Signed-off-by: Alex Williamson --- Cédric, I'd also support if you

Re: [PATCH v2 2/2] vfio/migration: Make VFIO migration non-experimental

2023-06-28 Thread Joao Martins
On 28/06/2023 13:54, Cédric Le Goater wrote: > On 6/28/23 09:31, Avihai Horon wrote: >> The major parts of VFIO migration are supported today in QEMU. This >> includes basic VFIO migration, device dirty page tracking and precopy >> support. >> >> Thus, at this point in time, it seems appropriate

Re: [PATCH] net/vhost-net: do not assert on null pointer return from tap_get_vhost_net()

2023-06-28 Thread Ani Sinha
> On 28-Jun-2023, at 5:20 PM, Philippe Mathieu-Daudé wrote: > > On 28/6/23 13:44, Ani Sinha wrote: >>> On 28-Jun-2023, at 5:12 PM, Michael S. Tsirkin wrote: >>> >>> On Wed, Jun 28, 2023 at 04:58:04PM +0530, Ani Sinha wrote: When 'vhost=off' or no vhost specific options at all are

Re: [PATCH v2 2/2] vfio/migration: Make VFIO migration non-experimental

2023-06-28 Thread Joao Martins
On 28/06/2023 08:31, Avihai Horon wrote: > The major parts of VFIO migration are supported today in QEMU. This > includes basic VFIO migration, device dirty page tracking and precopy > support. > > Thus, at this point in time, it seems appropriate to make VFIO migration > non-experimental: remove

[PATCH v4 0/6] net/tap: Fix QEMU frozen issue when the maximum number of file descriptors is very large

2023-06-28 Thread Bin Meng
Current codes using a brute-force traversal of all file descriptors do not scale on a system where the maximum number of file descriptors is set to a very large value (e.g.: in a Docker container of Manjaro distribution it is set to 1073741816). QEMU just looks frozen during start-up. The

[PATCH v4 1/6] tests/tcg/cris: Fix the coding style

2023-06-28 Thread Bin Meng
The code style does not conform with QEMU's. Correct it so that the upcoming commit does not trigger checkpatch warnings. Signed-off-by: Bin Meng Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- (no changes since v2) Changes in v2: - new patch: "tests/tcg/cris: Fix the

[PATCH v4 2/6] tests/tcg/cris: Correct the off-by-one error

2023-06-28 Thread Bin Meng
sysconf(_SC_OPEN_MAX) returns the maximum number of files that a process can have open at any time, which means the fd should not be larger than or equal to the return value. Signed-off-by: Bin Meng Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- (no changes since v2)

[PULL 20/30] accel/kvm: Declare kvm_direct_msi_allowed in stubs

2023-06-28 Thread Philippe Mathieu-Daudé
Avoid when calling kvm_direct_msi_enabled() from arm_gicv3_its_common.c the next commit: Undefined symbols for architecture arm64: "_kvm_direct_msi_allowed", referenced from: _its_class_name in hw_intc_arm_gicv3_its_common.c.o ld: symbol(s) not found for architecture arm64

[PULL 22/30] hw/intc/arm_gic: Rename 'first_cpu' argument

2023-06-28 Thread Philippe Mathieu-Daudé
"hw/core/cpu.h" defines 'first_cpu' as QTAILQ_FIRST_RCU(). arm_gic_common_reset_irq_state() calls its second argument 'first_cpu', producing a build failure when "hw/core/cpu.h" is included: hw/intc/arm_gic_common.c:238:68: warning: omitting the parameter name in a function definition is a

[PULL 12/30] accel: Rename NVMM 'struct qemu_vcpu' -> AccelCPUState

2023-06-28 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Rename NVMM 'qemu_vcpu' as 'AccelCPUState'; directly use the typedef, remove unnecessary casts. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230624174121.11508-11-phi...@linaro.org> ---

[PATCH 4/6] tests/qtest: migration: Use migrate_incoming_qmp where appropriate

2023-06-28 Thread Fabiano Rosas
Use the new migrate_incoming_qmp helper in the places that currently open-code calling migrate-incoming. Signed-off-by: Fabiano Rosas Reviewed-by: Juan Quintela --- tests/qtest/meson.build | 1 + tests/qtest/migration-test.c | 12 ++--- tests/qtest/virtio-net-failover.c | 77

[PATCH 1/6] migration: Set migration status early in incoming side

2023-06-28 Thread Fabiano Rosas
We are sending a migration event of MIGRATION_STATUS_SETUP at qemu_start_incoming_migration but never actually setting the state. This creates a window between qmp_migrate_incoming and process_incoming_migration_co where the migration status is still MIGRATION_STATUS_NONE. Calling query-migrate

[PATCH 5/6] tests/qtest: migration: Add support for negative testing of qmp_migrate

2023-06-28 Thread Fabiano Rosas
There is currently no way to write a test for errors that happened in qmp_migrate before the migration has started. Add a version of qmp_migrate that ensures an error happens and tests the error message. To make use of it a test needs to declare: MigrateCommon args = { .result =

[PATCH 3/6] tests/qtest: migration: Add migrate_incoming_qmp helper

2023-06-28 Thread Fabiano Rosas
file-based migration requires the target to initiate its migration after the source has finished writing out the data in the file. Currently there's no easy way to initiate 'migrate-incoming', allow this by introducing migrate_incoming_qmp helper, similarly to migrate_qmp. Also make sure

[PATCH 0/6] migration: Test the new "file:" migration

2023-06-28 Thread Fabiano Rosas
Based-on: [PATCH V3 0/2] migration file URI https://lore.kernel.org/r/1687466251-310524-1-git-send-email-steven.sist...@oracle.com Since v1: - added the force-emit-setup-event property - added verification that the skipped region is empty CI run:

[PATCH 2/6] tests/qtest: migration: Expose migrate_set_capability

2023-06-28 Thread Fabiano Rosas
The following patch will make use of this function from within migrate-helpers.c, so move it there. Signed-off-by: Fabiano Rosas Reviewed-by: Juan Quintela --- tests/qtest/migration-helpers.c | 11 +++ tests/qtest/migration-helpers.h | 3 +++ tests/qtest/migration-test.c| 11

[PATCH 6/6] tests/qtest: migration-test: Add tests for file-based migration

2023-06-28 Thread Fabiano Rosas
Add basic tests for file-based migration. Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 104 +++ 1 file changed, 104 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index acb778a8cd..b3019f54de 100644 ---

[PATCH v2 06/16] hw/pci-host/q35: Make some property name macros reusable by i440fx

2023-06-28 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- include/hw/i386/pc.h | 4 include/hw/pci-host/q35.h | 5 - hw/i386/pc_q35.c | 8 hw/pci-host/q35.c | 8 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/hw/i386/pc.h

[PATCH v2 01/16] hw/i386/pc_q35: Resolve redundant q35_host variable

2023-06-28 Thread Bernhard Beschow
The variable is redundant to "phb" and is never used by its real type. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth --- hw/i386/pc_q35.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index

[PATCH v2 03/16] hw/pci-host/q35: Initialize PCMachineState::bus in board code

2023-06-28 Thread Bernhard Beschow
The Q35 PCI host currently sets the PC machine's PCI bus attribute through global state, thereby assuming the machine to be a PC machine. The Q35 machine code already holds on to Q35's pci bus attribute, so can easily set its own property while preserving encapsulation. Signed-off-by: Bernhard

[PULL 14/30] accel: Remove WHPX unreachable error path

2023-06-28 Thread Philippe Mathieu-Daudé
g_new0() can not fail. Remove the unreachable error path. https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html#glib-Memory-Allocation.description Reported-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id:

[PULL 17/30] accel: Rename 'cpu_state' -> 'cs'

2023-06-28 Thread Philippe Mathieu-Daudé
Most of the codebase uses 'CPUState *cpu' or 'CPUState *cs'. While 'cpu_state' is kind of explicit, it makes the code harder to review. Simply rename as 'cs'. Acked-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Tested-by: Peter Maydell Message-Id:

[PULL 06/30] accel: Fix a leak on Windows HAX

2023-06-28 Thread Philippe Mathieu-Daudé
hThread is only used on the error path in hax_kick_vcpu_thread(). Fixes: b0cb0a66d6 ("Plumb the HAXM-based hardware acceleration support") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230624174121.11508-5-phi...@linaro.org> --- target/i386/hax/hax-all.c |

[PULL 08/30] accel: Rename 'hax_vcpu' as 'accel' in CPUState

2023-06-28 Thread Philippe Mathieu-Daudé
All accelerators will share a single opaque context in CPUState. Start by renaming 'hax_vcpu' as 'accel'. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230624174121.11508-7-phi...@linaro.org> --- include/hw/core/cpu.h | 2 +-

[PATCH v2 0/2] contrib/plugins: Migrate to the Meson build

2023-06-28 Thread Anton Kochkov
Makefile made a lot of assumption regarding the system to compile for. It was also limited to the Linux (and possibly BSD) only, without the way to compile for macOS or Windows. Changes since v1: - Remove Makefile Anton Kochkov (2): contrib/plugins: add meson build file contrib/plugins:

[PATCH v2 2/2] contrib/plugins: remove Makefile

2023-06-28 Thread Anton Kochkov
Signed-off-by: Anton Kochkov --- contrib/plugins/Makefile | 46 1 file changed, 46 deletions(-) delete mode 100644 contrib/plugins/Makefile diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile deleted file mode 100644 index

[PATCH v2 1/2] contrib/plugins: add meson build file

2023-06-28 Thread Anton Kochkov
Add crossplatform Meson file to build TCG plugins since the Makefile makes wrong assumptions about it being used only on Linux. Tested on Linux and macOS. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1710 Signed-off-by: Anton Kochkov --- contrib/plugins/meson.build | 31

Re: [PATCH qemu] aspeed add montblanc bmc reference from fuji

2023-06-28 Thread Cédric Le Goater
On 6/28/23 12:07, Sittisak Sinprem wrote: Got it Cedric, I just know for it, I am fixing, and will re-send the patch as V2. Could you please use the patch below and send in your series ? Thanks, C. From cfbc865ffe8a4dffe4ac764eb10416aa906a7170 Mon Sep 17 00:00:00 2001 From:

[PATCH] ui/gtk: Make sure the right EGL context is currently bound

2023-06-28 Thread Dongwon Kim
Observed a wrong context is bound when changing the scanout mode. To prevent problem, it is needed to make sure to bind the right context in gtk_egl_set_scanout_mode/gtk_gl_area_set_scanout_mode as well as unbind one in the end of gd_egl_update/gd_gl_area_update. Cc: Gerd Hoffmann Cc: Marc-André

[PATCH v2 16/16] hw/i386/pc_piix: Move i440fx' realize near its qdev_new()

2023-06-28 Thread Bernhard Beschow
I440FX realization is currently mixed with PIIX3 creation. Furthermore, it is common practice to only set properties between a device's qdev_new() and qdev_realize(). Clean up to resolve both issues. Since I440FX spawns a PCI bus let's also move the pci_bus initialization there. Note that when

[PATCH v2 00/16] Q35 and I440FX host bridge QOM cleanup

2023-06-28 Thread Bernhard Beschow
This series resolves the legacy i440fx_init() function and instantiates the I440FX host bridge the QOM way. As a preparation the Q35 host bridge receives some cleanup as well. Most of the Q35 patches have been submitted under [1] before. This series incorporates only the changes making the two

[PATCH v2 12/16] hw/pci-host/i440fx: Add PCI_HOST_{ABOVE, BELOW}_4G_MEM_SIZE properties

2023-06-28 Thread Bernhard Beschow
Introduce the properties in anticipation of QOM'ification; Q35 has the same properties. Note that we want to avoid a "ram size" property in the QOM interface since it seems redundant to both properties introduced in this change. Thus the removal of the ram_size parameter. We assume the invariant

[PATCH v2 02/16] hw/pci-host/q35: Fix double, contradicting .endianness assignment

2023-06-28 Thread Bernhard Beschow
Fixes the following clangd warning (-Winitializer-overrides): q35.c:297:19: Initializer overrides prior initialization of this subobject q35.c:292:19: previous initialization is here Settle on little endian which is consistent with using pci_host_conf_le_ops. Fixes: bafc90bdc594 ("q35:

[PATCH v2 04/16] hw/pci/pci_host: Introduce PCI_HOST_BYPASS_IOMMU macro

2023-06-28 Thread Bernhard Beschow
Introduce a macro to avoid copy and pasting strings which can easily cause typos. Suggested-by: Michael S. Tsirkin Signed-off-by: Bernhard Beschow Reviewed-by: Igor Mammedov --- include/hw/pci/pci_host.h | 2 ++ hw/pci/pci_host.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)

[PATCH v2 14/16] hw/pci-host/i440fx: Resolve i440fx_init()

2023-06-28 Thread Bernhard Beschow
i440fx_init() is a legacy init function. The previous patches worked towards TYPE_I440FX_PCI_HOST_BRIDGE to be instantiated the QOM way. Do this now by transforming the parameters passed to i440fx_init() into property assignments. Signed-off-by: Bernhard Beschow --- include/hw/pci-host/i440fx.h

[PATCH v2 05/16] hw/pci-host/q35: Initialize PCI_HOST_BYPASS_IOMMU property from board code

2023-06-28 Thread Bernhard Beschow
The Q35 PCI host already has a PCI_HOST_BYPASS_IOMMU property. However, the host initializes this property itself by accessing global machine state, thereby assuming it to be a PC machine. Avoid this by having board code set this property. Signed-off-by: Bernhard Beschow Reviewed-by: Igor

[PATCH v2 13/16] hw/pci-host/i440fx: Add I440FX_HOST_PROP_PCI_TYPE property

2023-06-28 Thread Bernhard Beschow
I440FX needs a different PCI device model if the "igd-passthru" property is enabled. The type name is currently passed as a parameter to i440fx_init(). This parameter will be replaced by a property assignment once i440fx_init() gets resolved. Signed-off-by: Bernhard Beschow ---

[PATCH v2 15/16] hw/i386/pc_piix: Turn some local variables into initializers

2023-06-28 Thread Bernhard Beschow
Eliminates an else branch. Suggested-by: Igor Mammedov Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 1df309b8e2..d07218a8c9 100644 --- a/hw/i386/pc_piix.c +++

[PATCH v2 11/16] hw/pci-host/i440fx: Add PCI_HOST_PROP_IO_MEM property

2023-06-28 Thread Bernhard Beschow
Introduce the property in anticipation of QOM'ification; Q35 has the same property. Signed-off-by: Bernhard Beschow --- hw/pci-host/i440fx.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index

[PATCH v2 09/16] hw/pci-host/i440fx: Move i440fx_realize() into PCII440FXState section

2023-06-28 Thread Bernhard Beschow
i440fx_realize() realizes the PCI device inside the host bridge (PCII440FXState), but is implemented between i440fx_pcihost_realize() and i440fx_init() which deal with the host bridge itself (I440FXState). Since we want to append i440fx_init() to i440fx_pcihost_realize() later let's move

[PATCH v2 08/16] hw/pci-host/i440fx: Have common names for some local variables

2023-06-28 Thread Bernhard Beschow
`PCIHostState` is often referred to as `phb`, own device state usually as `s`. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/pci-host/i440fx.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/pci-host/i440fx.c

[PATCH v2 07/16] hw/pci-host/i440fx: Replace magic values by existing constants

2023-06-28 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé --- hw/pci-host/i440fx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 61e7b97ff4..daa4d11104 100644 ---

Re: [PATCH v3 4/6] util/osdep: Introduce qemu_close_range()

2023-06-28 Thread Bin Meng
On 2023/6/19 17:22:53, "Markus Armbruster" wrote: Bin Meng writes: This introduces a new QEMU API qemu_close_range() that closes all open file descriptors from first to last (included). This API will try a more efficient call to close_range(), or walk through of /proc/self/fd whenever

Re: [PATCH v2 2/2] vfio/migration: Make VFIO migration non-experimental

2023-06-28 Thread Cédric Le Goater
On 6/28/23 16:51, Joao Martins wrote: On 28/06/2023 13:54, Cédric Le Goater wrote: On 6/28/23 09:31, Avihai Horon wrote: The major parts of VFIO migration are supported today in QEMU. This includes basic VFIO migration, device dirty page tracking and precopy support. Thus, at this point in

[PATCH 0/2] vhost user one time message fixes

2023-06-28 Thread Tom Lonergan
Add a missing message to vhost_user_one_time_request, and fix naming for the function and update the associated comment. Patch 1: vhost_user_one_time_request is actually catching messages that are sent once per device, not only once for the lifetime of the machine. I've renamed the function to

[PATCH v2 10/16] hw/pci-host/i440fx: Make MemoryRegion pointers accessible as properties

2023-06-28 Thread Bernhard Beschow
The goal is to eliminate i440fx_init() which is a legacy init function. This neccessitates the memory regions to be properties, like in Q35, which will be assigned in board code. Since i440fx needs different PCI devices in Xen mode, and since i440fx shall be self-contained, the PCI device will be

[PATCH 2/7] migration: Introduce migrate_has_error()

2023-06-28 Thread Peter Xu
Introduce a helper to detect whether MigrationState.error is set for whatever reason. It is intended to not taking the error_mutex here because neither do we reference the pointer, nor do we modify the pointer. State why it's safe to do so. This is preparation work for any thread (e.g. source

[PATCH 4/7] migration: Deliver return path file error to migrate state too

2023-06-28 Thread Peter Xu
We've already did this for most of the return path thread errors, but not yet for the IO errors happened on the return path qemufile. Do that too. Remember to reset "err" always, because the ownership is not us anymore, otherwise we're prone to use-after-free later after recovered.

[PATCH 1/7] migration: Let migrate_set_error() take ownership

2023-06-28 Thread Peter Xu
migrate_set_error() used one error_copy() so it always copy an error. However that's not the major use case - the major use case is one would like to pass the error to migrate_set_error() without further touching the error. It can be proved if we see most of the callers are freeing the error

[PATCH 5/7] migration: Display error in query-migrate irrelevant of status

2023-06-28 Thread Peter Xu
Display it as long as being set, irrelevant of FAILED status. E.g., it may also be applicable to PAUSED stage of postcopy, to provide hint on what has gone wrong. The error_mutex seems to be overlooked when referencing the error, add it to be very safe. Signed-off-by: Peter Xu ---

Re: [PATCH] target/arm: gdbstub: Guard M-profile code with CONFIG_TCG

2023-06-28 Thread Fabiano Rosas
Fabiano Rosas writes: > Philippe Mathieu-Daudé writes: > >> On 28/6/23 18:48, Fabiano Rosas wrote: >>> This code is only relevant when TCG is present in the build. Building >>> with --disable-tcg --enable-xen on an x86 host we get: >>> >>> $ ../configure

[RFC PATCH 0/3] ppc/pnv: SMT support for powernv

2023-06-28 Thread Nicholas Piggin
These patches implement enough to boot a SMT powernv machine to Linux and boot a SMP KVM guest inside that. There are a few more SPRs that need to be done, and per-LPAR SPRs are mostly not annotated yet so it can't run in 1LPAR mode. But it is enough to run skiboot/Linux with SMT so I'll just

[PATCH v6 12/20] target/riscv: add KVM specific MISA properties

2023-06-28 Thread Daniel Henrique Barboza
Using all TCG user properties in KVM is tricky. First because KVM supports only a small subset of what TCG provides, so most of the cpu->cfg flags do nothing for KVM. Second, and more important, we don't have a way of telling if any given value is an user input or not. For TCG this has a small

[PATCH v6 01/20] target/riscv: skip features setup for KVM CPUs

2023-06-28 Thread Daniel Henrique Barboza
As it is today it's not possible to use '-cpu host' if the RISC-V host has RVH enabled. This is the resulting error: $ sudo ./qemu/build/qemu-system-riscv64 \ -machine virt,accel=kvm -m 2G -smp 1 \ -nographic -snapshot -kernel ./guest_imgs/Image \ -initrd

[PATCH v6 05/20] target/riscv/cpu.c: restrict 'marchid' value

2023-06-28 Thread Daniel Henrique Barboza
'marchid' shouldn't be set to a different value as previously set for named CPUs. For all other CPUs it shouldn't be freely set either - the spec requires that 'marchid' can't have the MSB (most significant bit) set and every other bit set to zero, i.e. 0x8000 is an invalid 'marchid' value

[PATCH v6 06/20] target/riscv: use KVM scratch CPUs to init KVM properties

2023-06-28 Thread Daniel Henrique Barboza
Certain validations, such as the validations done for the machine IDs (mvendorid/marchid/mimpid), are done before starting the CPU. Non-dynamic (named) CPUs tries to match user input with a preset default. As it is today we can't prefetch a KVM default for these cases because we're only able to

[PATCH v6 04/20] target/riscv/cpu.c: restrict 'mimpid' value

2023-06-28 Thread Daniel Henrique Barboza
Following the same logic used with 'mvendorid' let's also restrict 'mimpid' for named CPUs. Generic CPUs keep setting the value freely. Note that we're getting rid of the default RISCV_CPU_MARCHID value. The reason is that this is not a good default since it's dynamic, changing with with every

Re: [PATCH qemu] aspeed add montblanc bmc reference from fuji

2023-06-28 Thread Sittisak Sinprem
Hi Cédric, I had fixed the function name to support in current branch, but facing about below error while starting ./build/qemu-system-arm -machine montblanc-bmc -drive > file=~/flash-montblanc,format=raw,if=mtd -nographic -netdev > tap,id=netdev0,script=no,downscript=no,ifname=tap0 -net >

[PATCH v6 1/5] tests/acpi: allow changes in DSDT.noacpihp table blob

2023-06-28 Thread Ani Sinha
We are going to fix bio-tables-test in the next patch and hence need to make sure the acpi tests continue to pass. Signed-off-by: Ani Sinha Acked-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git

  1   2   3   4   >