Re: [PATCH] hw/loongarch/boot: Support Linux raw boot image

2024-12-24 Thread Jiaxun Yang
在2024年12月24日十二月 上午4:03,bibo mao写道: > On 2024/12/23 上午8:30, Jiaxun Yang wrote: >> Many distros are shipping raw kernel images (i.e. vmlinux.efi). >> >> Support booting such image by parsing header as per Linux's >> specification [1]. >> >> [1]: https://docs.kernel.org/arch/loongarch/booting.htm

Re: [PATCH v4 1/7] i386/cpu: add IsDefined flag to smp-cache property

2024-12-24 Thread Alireza Sanaee via
On Mon, 23 Dec 2024 17:48:18 + Jonathan Cameron wrote: > On Mon, 16 Dec 2024 17:54:08 + > Alireza Sanaee wrote: > > > This commit adds IsDefined flag to the object and this helps in > > avoiding extra checks for every single layer of caches in both x86 > > and ARM. > > > > There is alr

Re: [PATCH v2] hw/loongarch/boot: Support Linux raw boot image

2024-12-24 Thread Richard Henderson
On 12/24/24 07:06, Jiaxun Yang wrote: +static int64_t load_loongarch_linux_image(const char *filename, + uint64_t *kernel_entry, + uint64_t *kernel_low, + uint64_t *kernel_hi

Re: [PATCH v5 04/11] target/i386/kvm: Only save/load kvmclock MSRs when kvmclock enabled

2024-12-24 Thread Paolo Bonzini
On 11/6/24 04:07, Zhao Liu wrote: MSR_KVM_SYSTEM_TIME and MSR_KVM_WALL_CLOCK are attached with the (old) kvmclock feature (KVM_FEATURE_CLOCKSOURCE). So, just save/load them only when kvmclock (KVM_FEATURE_CLOCKSOURCE) is enabled. Signed-off-by: Zhao Liu The MSRs contains the same values as

Re: [PATCH v5 05/11] target/i386/kvm: Save/load MSRs of kvmclock2 (KVM_FEATURE_CLOCKSOURCE2)

2024-12-24 Thread Paolo Bonzini
On 11/6/24 04:07, Zhao Liu wrote: MSR_KVM_SYSTEM_TIME_NEW and MSR_KVM_WALL_CLOCK_NEW are bound to kvmclock2 (KVM_FEATURE_CLOCKSOURCE2). Add the save/load support for these 2 MSRs just like kvmclock MSRs. As mentioned in the previous patch, this is not necessary. If it was needed, you'd have

[PATCH v2] b4-config: Configure Lore masks

2024-12-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20241222-b4-config-v1-1-b3667beb3...@flygoat.com> --- .b4-config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.b4-config b/.b4-config index 5feac156429..af9cfdcd3ed 100644 --- a/.b4-config +++ b/.b4-config @@ -8,3 +8,6 @@ send-au

Re: [PATCH v4 7/7] Update the ACPI tables according to the acpi aml_build change, also empty bios-tables-test-allowed-diff.h.

2024-12-24 Thread Alireza Sanaee via
On Mon, 23 Dec 2024 18:13:32 + Jonathan Cameron wrote: > On Mon, 16 Dec 2024 17:54:14 + > Alireza Sanaee wrote: > > > The disassembled differences between actual and expected PPTT based > > on the following cache topology representation: > > > > ``` > > test_acpi_one("-M > > virt,smp-c

Re: [PATCH] backends/cryptodev-vhost-user: Fix local_error leaks

2024-12-24 Thread Philippe Mathieu-Daudé
Hi Gabriel, On 24/12/24 00:46, Gabriel Barrantes wrote: From c808fa797942b9bd32221594b7eef690a7558b14 Mon Sep 17 00:00:00 2001 From: Gabriel Barrantes Date: Mon, 23 Dec 2024 14:58:12 -0600 Subject: [PATCH] backends/cryptodev-vhost-user: Fix local_error leaks Do not propagate error to the uppe

Re: [PATCH v1 1/3] hw/timer/aspeed: Support different memory region ops

2024-12-24 Thread Philippe Mathieu-Daudé
Hi Jamin, On 16/12/24 08:53, Jamin Lin via wrote: It set "aspeed_timer_ops" struct which containing read and write callbacks to be used when I/O is performed on the TIMER region. Besides, in the previous design of ASPEED SOCs, the timer registers address space are contiguous. ex: TMC00-TMC0C a

RE: [PATCH v1 1/3] hw/timer/aspeed: Support different memory region ops

2024-12-24 Thread Jamin Lin
Hi Philippe, > Subject: Re: [PATCH v1 1/3] hw/timer/aspeed: Support different memory region > ops > > Hi Jamin, > > On 16/12/24 08:53, Jamin Lin via wrote: > > It set "aspeed_timer_ops" struct which containing read and write > > callbacks to be used when I/O is performed on the TIMER region. > >

[PATCH v3 3/3] hw/loongarch/boot: Support 32bit boot code

2024-12-24 Thread Jiaxun Yang
Replace mailbox read/write on LoongArch32 systems with 32bit IOCSR instructions to prevent illegal instructions. Signed-off-by: Jiaxun Yang --- hw/loongarch/boot.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c inde

[PATCH v2] hw/loongarch/boot: Support Linux raw boot image

2024-12-24 Thread Jiaxun Yang
Support booting such image by parsing header as per Linux's specification [1]. This enabled booting vmlinux.efi/vmlinuz.efi shipped by distros without supplying BIOS. [1]: https://docs.kernel.org/arch/loongarch/booting.html Signed-off-by: Jiaxun Yang --- Changes in v2: - Use extract API for get

Re: [PATCH v2 0/7] migration: Drop/unexport migration_is_device() and migration_is_active()

2024-12-24 Thread Peter Xu
On Tue, Dec 24, 2024 at 09:20:08AM +0100, Cédric Le Goater wrote: > Fabiano, Peter, > > On 12/18/24 14:40, Avihai Horon wrote: > > Hello, > > > > This follows up on Peter's series [1] to simplify migration status API > > to a single migration_is_running() function. > > > > Peter's series tried t

Re: [PATCH] hw/mem: support zero memory size CXL device

2024-12-24 Thread Jonathan Cameron via
On Tue, 10 Dec 2024 14:13:29 -0500 Gregory Price wrote: > On Tue, Dec 03, 2024 at 09:15:51PM +, Hongjian Fan wrote: > > Hi Jonathan, > > > > I'm trying to emulate our memory appliance which is similar to a MH-SLD. > > The memory device is connected to the host server while the size of the

[PULL 00/17] vfio queue

2024-12-24 Thread Cédric Le Goater
The following changes since commit aa3a285b5bc56a4208b3b57d4a55291e9c260107: Merge tag 'mem-2024-12-21' of https://github.com/davidhildenbrand/qemu into staging (2024-12-22 14:33:27 -0500) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-vfi

Re: [PATCH v2 0/7] migration: Drop/unexport migration_is_device() and migration_is_active()

2024-12-24 Thread Cédric Le Goater
On 12/24/24 16:12, Peter Xu wrote: On Tue, Dec 24, 2024 at 09:20:08AM +0100, Cédric Le Goater wrote: Fabiano, Peter, On 12/18/24 14:40, Avihai Horon wrote: Hello, This follows up on Peter's series [1] to simplify migration status API to a single migration_is_running() function. Peter's serie

[PULL 15/17] system/dirtylimit: Don't use migration_is_active()

2024-12-24 Thread Cédric Le Goater
From: Avihai Horon vcpu_dirty_rate_stat_collect() uses migration_is_active() to detect whether migration is running or not, in order to get the correct dirty rate period value. However, recently there has been an effort to simplify the migration status API and reduce it to a single migration_is_

[PULL 14/17] vfio/migration: Rename vfio_devices_all_dirty_tracking()

2024-12-24 Thread Cédric Le Goater
From: Avihai Horon vfio_devices_all_dirty_tracking() is used to check if dirty page log sync is needed. However, besides checking the dirty page tracking status, it also checks the pre_copy_dirty_page_tracking flag. Rename it to vfio_devices_log_sync_needed() which reflects its purpose more accu

[PULL 04/17] vfio/igd: canonicalize memory size calculations

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko Add helper functions igd_gtt_memory_size() and igd_stolen_size() for calculating GTT stolen memory and Data stolen memory size in bytes, and use macros to replace the hardware-related magic numbers for better readability. Signed-off-by: Tomita Moeko Reviewed-by: Alex Williams

[PULL 11/17] vfio/container: Add dirty tracking started flag

2024-12-24 Thread Cédric Le Goater
From: Avihai Horon Add a flag to VFIOContainerBase that indicates whether dirty tracking has been started for the container or not. This will be used in the following patches to allow dirty page syncs only if dirty tracking has been started. Signed-off-by: Avihai Horon Reviewed-by: Joao Martin

[PULL 01/17] vfio/igd: fix GTT stolen memory size calculation for gen 8+

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko On gen 8 and later devices, the GTT stolen memory size when GGMS equals 0 is 0 (no preallocated memory) rather than 1MB [1]. [1] 3.1.13, 5th Generation Intel Core Processor Family Datasheet Vol. 2 https://www.intel.com/content/www/us/en/content-details/330835 Fixes: c4c45

[PULL 02/17] vfio/igd: remove unsupported device ids

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko Since e433f208973f ("vfio/igd: return an invalid generation for unknown devices"), the default return of igd_gen() was changed to unsupported. There is no need to filter out those unsupported devices. Reviewed-by: Alex Williamson Reviewed-by: Corvin Köhne Signed-off-by: Tomi

[PULL 07/17] vfio/igd: add macro for declaring mirrored registers

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko igd devices have multipe registers mirroring mmio address and pci config space, more than a single BDSM register. To support this, the read/write functions are made common and a macro is defined to simplify the declaration of MemoryRegionOps. Signed-off-by: Tomita Moeko Revie

[PULL 05/17] vfio/igd: add Gemini Lake and Comet Lake device ids

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko Both Gemini Lake and Comet Lake are gen 9 devices. Many user reports on internet shows legacy mode of igd passthrough works as qemu treats them as gen 8 devices by default before e433f208973f ("vfio/igd: return an invalid generation for unknown devices"). Reviewed-by: Corvin K

Re: [PATCH 01/17] replay: Fix migration use of clock for statistics

2024-12-24 Thread Peter Xu
On Tue, Dec 24, 2024 at 10:24:51AM +0300, Pavel Dovgalyuk wrote: > On 23.12.2024 20:26, Peter Xu wrote: > > On Sat, Dec 21, 2024 at 01:02:01PM +1000, Nicholas Piggin wrote: > > > On Sat Dec 21, 2024 at 2:31 AM AEST, Peter Xu wrote: > > > > On Fri, Dec 20, 2024 at 08:42:03PM +1000, Nicholas Piggin w

[PULL 16/17] migration: Drop migration_is_device()

2024-12-24 Thread Cédric Le Goater
From: Avihai Horon After being removed from VFIO, migration_is_device() no longer has any users. Drop it. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater Acked-by: Peter Xu Tested-by: Joao Martins Link: https://lore.kernel.org/r/20241218134022.21264-7-avih...@nvidia.com Signed-off-

[PULL 10/17] vfio/igd: add x-igd-gms option back to set DSM region size for guest

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko DSM region is likely to store framebuffer in Windows, a small DSM region may cause display issues (e.g. half of the screen is black). Since 971ca22f041b ("vfio/igd: don't set stolen memory size to zero"), the x-igd-gms option was functionally removed, QEMU uses host's original

[PULL 03/17] vfio/igd: align generation with i915 kernel driver

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko Define the igd device generations according to i915 kernel driver to avoid confusion, and adjust comment placement to clearly reflect the relationship between ids and devices. The condition of how GTT stolen memory size is calculated is changed accordingly as GGMS is in multip

[PULL 12/17] vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic

2024-12-24 Thread Cédric Le Goater
From: Avihai Horon During dirty page log sync, vfio_devices_all_dirty_tracking() is used to check if dirty tracking has been started in order to avoid errors. The current logic checks if migration is in ACTIVE or DEVICE states to ensure dirty tracking has been started. However, recently there ha

[PULL 17/17] migration: Unexport migration_is_active()

2024-12-24 Thread Cédric Le Goater
From: Avihai Horon After being removed from VFIO and dirty limit, migration_is_active() no longer has any users outside the migration subsystem, and in fact, it's only used in migration.c. Unexport it and also relocate it so it can be made static. Signed-off-by: Avihai Horon Reviewed-by: Cédri

[PULL 13/17] vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic

2024-12-24 Thread Cédric Le Goater
From: Avihai Horon During DMA unmap with vIOMMU, vfio_devices_all_running_and_mig_active() is used to check whether a dirty page log sync of the unmapped pages is required. Such log sync is needed during migration pre-copy phase, and the current logic detects it by checking if migration is active

[PULL 06/17] vfio/igd: add Alder/Raptor/Rocket/Ice/Jasper Lake device ids

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko All gen 11 and 12 igd devices have 64 bit BDSM register at 0xC0 in its config space, add them to the list to support igd passthrough on Alder/ Raptor/Rocket/Ice/Jasper Lake platforms. Tested legacy mode of igd passthrough works properly on both linux and windows guests with Al

[PULL 08/17] vfio/igd: emulate GGC register in mmio bar0

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko The GGC register at 0x50 of pci config space is a mirror of the same register at 0x108040 of mmio bar0 [1]. i915 driver also reads that register from mmio bar0 instead of config space. As GGC is programmed and emulated by qemu, the mmio address should also be emulated, in the s

[PULL 09/17] vfio/igd: emulate BDSM in mmio bar0 for gen 6-10 devices

2024-12-24 Thread Cédric Le Goater
From: Tomita Moeko A recent commit in i915 driver [1] claims the BDSM register at 0x1080c0 of mmio bar0 has been there since gen 6. Mirror this register to the 32 bit BDSM register at 0x5c in pci config space for gen6-10 devices. [1] https://patchwork.freedesktop.org/patch/msgid/20240202224340.

Re: [PATCH v4 1/7] i386/cpu: add IsDefined flag to smp-cache property

2024-12-24 Thread Zhao Liu
On Tue, Dec 24, 2024 at 08:41:27AM +, Alireza Sanaee wrote: > Date: Tue, 24 Dec 2024 08:41:27 + > From: Alireza Sanaee > Subject: Re: [PATCH v4 1/7] i386/cpu: add IsDefined flag to smp-cache > property > X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) > > On Mon, 23 Dec 2024

Re: [PULL 2/6] linux-user: Use unique error messages for cmsg parsing

2024-12-24 Thread Laurent Vivier
Le 18/12/2024 à 20:52, del...@kernel.org a écrit : From: Helge Deller Avoid using the same error message for two different code paths as it complicates determining the one which actually triggered. Signed-off-by: Helge Deller --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(

Re: [PATCH v2 0/7] migration: Drop/unexport migration_is_device() and migration_is_active()

2024-12-24 Thread Cédric Le Goater
Fabiano, Peter, On 12/18/24 14:40, Avihai Horon wrote: Hello, This follows up on Peter's series [1] to simplify migration status API to a single migration_is_running() function. Peter's series tried to drop migration_is_device() and migration_is_active(), however VFIO used them to check if dir

Re: [PATCH v4 6/7] tests/qtest/bios-table-test: testing new ARM ACPI PPTT topology

2024-12-24 Thread Alireza Sanaee via
On Mon, 23 Dec 2024 18:11:45 + Jonathan Cameron wrote: > On Mon, 16 Dec 2024 17:54:13 + > Alireza Sanaee wrote: > > > Test new PPTT topolopy with cache representation. > > > > Signed-off-by: Alireza Sanaee > > --- > > tests/qtest/bios-tables-test.c | 6 +- > > 1 file changed, 5 i

Re: [PULL 1/6] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()

2024-12-24 Thread Laurent Vivier
Le 18/12/2024 à 20:52, del...@kernel.org a écrit : From: Helge Deller Fixes this warning: Unknown host IFA type: 11 Signed-off-by: Helge Deller --- linux-user/fd-trans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index c04a97c73a..61

Re: [PATCH v3 01/14] s390x/s390-virtio-ccw: don't crash on weird RAM sizes

2024-12-24 Thread David Hildenbrand
On 24.12.24 13:32, Michael Tokarev wrote: 19.12.2024 17:41, David Hildenbrand wrote: KVM is not happy when starting a VM with weird RAM sizes: # qemu-system-s390x --enable-kvm --nographic -m 1234K qemu-system-s390x: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, sl

Re: [PATCH] Add a b4 configuration file

2024-12-24 Thread Jiaxun Yang
在2024年12月24日十二月 上午4:25,Konstantin Ryabitsev写道: > On Sun, Dec 22, 2024 at 04:53:41PM +, Jiaxun Yang wrote: >> +[b4] >> +send-series-to = qemu-devel@nongnu.org >> +send-auto-to-cmd = echo > > Hmm... does it not work without the above line? If so, can you please send a > bug report to t

Re: [PATCH v3 01/14] s390x/s390-virtio-ccw: don't crash on weird RAM sizes

2024-12-24 Thread Michael Tokarev
19.12.2024 17:41, David Hildenbrand wrote: KVM is not happy when starting a VM with weird RAM sizes: # qemu-system-s390x --enable-kvm --nographic -m 1234K qemu-system-s390x: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=0, start=0x0, size=0x244000: Invalid argume

Re: [PATCH v2] b4-config: Configure Lore masks

2024-12-24 Thread Jiaxun Yang
在2024年12月24日十二月 下午1:50,Philippe Mathieu-Daudé写道: > Signed-off-by: Philippe Mathieu-Daudé > --- Reviewed-by: Jiaxun Yang Thanks! > Based-on: <20241222-b4-config-v1-1-b3667beb3...@flygoat.com> > --- > .b4-config | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/.b4-config b/.b4-con

[PATCH v3 1/3] hw/loongarch/boot: Refactor EFI booting protocol generation

2024-12-24 Thread Jiaxun Yang
Refector EFI style booting data structure generation to support 32bit EFI variant on LoongArch32 CPU. All data structs are filled with padding members if necessary and marked as QEMU_PACKED to avoid host ABI alignment impact. Host endian is being cared as well. It also fixed various problems in

[PATCH v3 2/3] hw/loongarch/boot: Take care of host endian for boot code

2024-12-24 Thread Jiaxun Yang
Use stl_p to store instructions so that host endian conversion will be performed. Signed-off-by: Jiaxun Yang --- hw/loongarch/boot.c | 99 +++-- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot

[PATCH v3 0/3] hw/loongarch/booting: Booting protocol refactoring

2024-12-24 Thread Jiaxun Yang
Hi all, This series refactored booting protocol generation code to better accommodate different host ABI / Alignment and endianess. It also enhanced LoongArch32 support. Thanks --- v2: Fix building on 32 bit host Signed-off-by: Jiaxun Yang --- Changes in v3: - v3: Split PATCH 2 to ease revie

Re: [PATCH v5 10/11] target/i386/kvm: Clean up error handling in kvm_arch_init()

2024-12-24 Thread Paolo Bonzini
On 11/6/24 04:07, Zhao Liu wrote: Currently, there're following incorrect error handling cases in kvm_arch_init(): * Missed to handle failure of kvm_get_supported_feature_msrs(). * Missed to return when kvm_vm_enable_disable_exits() fails. At least in these two cases I think it was intentional

Re: [PATCH v5 11/11] target/i386/kvm: Replace ARRAY_SIZE(msr_handlers) with KVM_MSR_FILTER_MAX_RANGES

2024-12-24 Thread Paolo Bonzini
On 11/6/24 04:07, Zhao Liu wrote: kvm_install_msr_filters() uses KVM_MSR_FILTER_MAX_RANGES as the bound when traversing msr_handlers[], while other places still compute the size by ARRAY_SIZE(msr_handlers). In fact, msr_handlers[] is an array with the fixed size KVM_MSR_FILTER_MAX_RANGES, so the

[PATCH V5 16/23] migration-test: memory_backend

2024-12-24 Thread Steve Sistare
Allow each migration test to define its own memory backend, replacing the standard "-m " specification. Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas --- tests/qtest/migration/framework.c | 15 +++ tests/qtest/migration/framework.h | 5 + 2 files changed, 16 insertion

[PATCH V5 07/23] physmem: preserve ram blocks for cpr

2024-12-24 Thread Steve Sistare
Save the memfd for ramblocks in CPR state, along with a name that uniquely identifies it. The block's idstr is not yet set, so it cannot be used for this purpose. Find the saved memfd in new QEMU when creating a block. If size of a resizable block is larger in new QEMU, extend it via the file_ra

[PATCH V5 20/23] tests/qtest: enhance migration channels

2024-12-24 Thread Steve Sistare
Change the migrate_qmp and migrate_qmp_fail channels argument to a QObject type so the caller can manipulate the object before passing it to the helper. Define migrate_str_to_channel to aid such manipulation. Add a channels argument to migrate_incoming_qmp. Signed-off-by: Steve Sistare --- test

[PATCH V5 00/23] Live update: cpr-transfer

2024-12-24 Thread Steve Sistare
What? This patch series adds the live migration cpr-transfer mode, which allows the user to transfer a guest to a new QEMU instance on the same host with minimal guest pause time, by preserving guest RAM in place, albeit with new virtual addresses in new QEMU, and by preserving device file descrip

[PATCH V5 05/23] machine: aux-ram-share option

2024-12-24 Thread Steve Sistare
Allocate auxilliary guest RAM as an anonymous file that is shareable with an external process. This option applies to memory allocated as a side effect of creating various devices. It does not apply to memory-backend-objects, whether explicitly specified on the command line, or implicitly created

[PATCH V5 08/23] hostmem-memfd: preserve for cpr

2024-12-24 Thread Steve Sistare
Preserve memory-backend-memfd memory objects during cpr-transfer. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- backends/hostmem-memfd.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 1672da9..8

[PATCH V5 22/23] migration-test: cpr-transfer

2024-12-24 Thread Steve Sistare
Add a migration test for cpr-transfer mode. Defer the connection to the target monitor, else the test hangs because in cpr-transfer mode QEMU does not listen for monitor connections until we send the migrate command to source QEMU. To test -incoming defer, send a migrate incoming command to the t

[PATCH V5 01/23] backends/hostmem-shm: factor out allocation of "anonymous shared memory with an fd"

2024-12-24 Thread Steve Sistare
Let's factor it out so we can reuse it. Signed-off-by: David Hildenbrand --- backends/hostmem-shm.c | 45 -- include/qemu/osdep.h | 1 + meson.build| 8 ++-- util/oslib-posix.c | 53 ++

[PATCH V5 06/23] migration: cpr-state

2024-12-24 Thread Steve Sistare
CPR must save state that is needed after QEMU is restarted, when devices are realized. Thus the extra state cannot be saved in the migration channel, as objects must already exist before that channel can be loaded. Instead, define auxilliary state structures and vmstate descriptions, not associate

[PATCH V5 13/23] migration: VMSTATE_FD

2024-12-24 Thread Steve Sistare
Define VMSTATE_FD for declaring a file descriptor field in a VMStateDescription. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- include/migration/vmstate.h | 9 + migration/vmstate-types.c | 23 +++ 2 files changed, 32 insertions(+) diff --git a/include/m

[PATCH V5 18/23] tests/qtest: defer connection

2024-12-24 Thread Steve Sistare
Add an option to defer making the connecting to the monitor and qtest sockets when calling qtest_init_with_env. The client makes the connection later by calling qtest_connect and qtest_qmp_handshake. Signed-off-by: Steve Sistare --- tests/qtest/libqtest.c| 80 +++

[PATCH V5 21/23] tests/qtest: assert qmp_ready

2024-12-24 Thread Steve Sistare
Set qmp_ready when the handshake is complete, and assert it when we communicate with the monitor. Suggested-by: Peter Xu Signed-off-by: Steve Sistare --- tests/qtest/libqtest.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/qtest/libqtest.c b/tes

[PATCH V5 02/23] physmem: qemu_ram_alloc_from_fd extensions

2024-12-24 Thread Steve Sistare
Extend qemu_ram_alloc_from_fd to support resizable ram, and define qemu_ram_resize_cb to clean up the API. Add a grow parameter to extend the file if necessary. However, if grow is false, a zero-sized file is always extended. Signed-off-by: Steve Sistare --- include/exec/ram_addr.h | 13 ++

[PATCH V5 04/23] memory: add RAM_PRIVATE

2024-12-24 Thread Steve Sistare
Define the RAM_PRIVATE flag. In RAMBlock creation functions, if MAP_SHARED is 0 in the flags parameter, in a subsequent patch the implementation may still create a shared mapping if other conditions require it. Callers who specifically want a private mapping, eg for objects specified by the user,

[PATCH V5 19/23] migration-test: defer connection

2024-12-24 Thread Steve Sistare
Add an option to defer connection to the target monitor, needed by the cpr-transfer test. Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas --- tests/qtest/migration/framework.c | 23 --- tests/qtest/migration/framework.h | 3 +++ 2 files changed, 23 insertions(+), 3

Re: [PATCH v3 1/3] hw/loongarch/boot: Refactor EFI booting protocol generation

2024-12-24 Thread Philippe Mathieu-Daudé
Hi, On 24/12/24 15:24, Jiaxun Yang wrote: Refector EFI style booting data structure generation to support 32bit EFI variant on LoongArch32 CPU. All data structs are filled with padding members if necessary and marked as QEMU_PACKED to avoid host ABI alignment impact. Host endian is being cared

Re: [PATCH v5 00/11] i386: miscellaneous cleanup

2024-12-24 Thread Paolo Bonzini
On 11/6/24 04:07, Zhao Liu wrote: Hi Paolo and all, Is it necessary to include the first patch (AVX10 cleanup/fix) in v9.2? Others are for v10.0. Compared with v4 [1], * patch 1 (AVX10 fix) and patch 9 (RAPL cleanup) are newly added. * rebased on commit 9a7b0a8618b1 ("Merge tag 'pull-aspee

Re: [PATCH v6 0/4] i386: Support SMP Cache Topology

2024-12-24 Thread Paolo Bonzini
On 12/19/24 09:32, Zhao Liu wrote: Hi folks, This is my v6. since Phili has already merged the general smp cache part, v6 just includes the remaining i386-specific changes to support SMP cache topology for PC machine (currently all patches have got Reviewed-by from previous review). Compared wi

[PATCH V5 14/23] migration: cpr-transfer save and load

2024-12-24 Thread Steve Sistare
Add functions to create a QEMUFile based on a unix URI, for saving or loading, for use by cpr-transfer mode to preserve CPR state. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- include/migration/cpr.h | 3 ++ migration/cpr-transfer.c | 76 +

[PATCH V5 17/23] tests/qtest: optimize migrate_set_ports

2024-12-24 Thread Steve Sistare
Do not query connection parameters if all port numbers are known. This is more efficient, and also solves a problem for the cpr-transfer test. At the point where cpr-transfer calls migrate_qmp and migrate_set_ports, the monitor is not connected and queries are not allowed. Port=0 is never used fo

[PATCH V5 15/23] migration: cpr-transfer mode

2024-12-24 Thread Steve Sistare
Add the cpr-transfer migration mode, which allows the user to transfer a guest to a new QEMU instance on the same host with minimal guest pause time, by preserving guest RAM in place, albeit with new virtual addresses in new QEMU, and by preserving device file descriptors. Pages that were locked i

[PATCH V5 12/23] migration: SCM_RIGHTS for QEMUFile

2024-12-24 Thread Steve Sistare
Define functions to put/get file descriptors to/from a QEMUFile, for qio channels that support SCM_RIGHTS. Maintain ordering such that put(A), put(fd), put(B) followed by get(A), get(fd), get(B) always succeeds. Other get orderings may succeed but are not guaranteed. Signed-off-by: Steve Sis

[PATCH V5 11/23] migration: incoming channel

2024-12-24 Thread Steve Sistare
Extend the -incoming option to allow an @MigrationChannel to be specified. This allows channels other than 'main' to be described on the command line, which will be needed for CPR. Signed-off-by: Steve Sistare --- migration/migration.c | 18 ++ qemu-options.hx | 21

[PATCH V5 03/23] physmem: fd-based shared memory

2024-12-24 Thread Steve Sistare
Create MAP_SHARED RAMBlocks by mmap'ing a file descriptor rather than using MAP_ANON, so the memory can be accessed in another process by passing and mmap'ing the fd. This will allow CPR to support memory-backend-ram and memory-backend-shm objects, provided the user creates them with share=on. Us

[PATCH V5 23/23] migration: cpr-transfer documentation

2024-12-24 Thread Steve Sistare
Signed-off-by: Steve Sistare --- docs/devel/migration/CPR.rst | 182 ++- 1 file changed, 180 insertions(+), 2 deletions(-) diff --git a/docs/devel/migration/CPR.rst b/docs/devel/migration/CPR.rst index 63c3647..9b51611 100644 --- a/docs/devel/migration/CPR

[PATCH V5 10/23] migration: enhance migrate_uri_parse

2024-12-24 Thread Steve Sistare
Export migrate_uri_parse for use outside migration internals, and define a method migrate_is_uri that indicates when migrate_uri_parse should be used. Signed-off-by: Steve Sistare --- include/migration/misc.h | 7 +++ migration/migration.c| 11 +++ migration/migration.h| 2

[PATCH V5 09/23] hostmem-shm: preserve for cpr

2024-12-24 Thread Steve Sistare
Preserve memory-backend-shm memory objects during cpr-transfer. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- backends/hostmem-shm.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backends/hostmem-shm.c b/backends/hostmem-shm.c index fabee41..f67ad27 1

Re: [PATCH v8 08/12] migration/multifd: Add new migration option for multifd DSA offloading.

2024-12-24 Thread Peter Xu
On Mon, Dec 23, 2024 at 11:11:46PM -0800, Yichen Wang wrote: > > @@ -563,6 +572,15 @@ void hmp_migrate_set_parameter(Monitor *mon, const > > QDict *qdict) > > p->has_x_checkpoint_delay = true; > > visit_type_uint32(v, param, &p->x_checkpoint_delay, &err); > > break; > >

Re: [PATCH V5 01/23] backends/hostmem-shm: factor out allocation of "anonymous shared memory with an fd"

2024-12-24 Thread Peter Xu
On Tue, Dec 24, 2024 at 08:16:46AM -0800, Steve Sistare wrote: > Let's factor it out so we can reuse it. > > Signed-off-by: David Hildenbrand Better attach your sign-off here too.. especially when content changed. [xxx: fix build for !posix] Sign-off-by: XXX With that: Reviewed-by: Peter Xu

Re: [PATCH V5 02/23] physmem: qemu_ram_alloc_from_fd extensions

2024-12-24 Thread Peter Xu
On Tue, Dec 24, 2024 at 08:16:47AM -0800, Steve Sistare wrote: > Extend qemu_ram_alloc_from_fd to support resizable ram, and define > qemu_ram_resize_cb to clean up the API. > > Add a grow parameter to extend the file if necessary. However, if > grow is false, a zero-sized file is always extended

Re: [PATCH] make-release: only leave tarball of wrap-file subprojects

2024-12-24 Thread Michael Tokarev
19.12.2024 13:27, Paolo Bonzini wrote: The QEMU source archive is including the sources downloaded from crates.io in both tarball form (in subprojects/packagecache) and expanded/patched form (in the subprojects directory). The former is the more authoritative form, as it has a hash that can be v

Re: [PATCH] make-release: only leave tarball of wrap-file subprojects

2024-12-24 Thread Michael Tokarev
24.12.2024 22:41, Michael Tokarev wrote: 19.12.2024 13:27, Paolo Bonzini wrote: -tar --exclude=.git -cJf ${destination}.tar.xz ${destination} + +exclude=(--exclude=.git) +# include the tarballs in subprojects/packagecache but not their expansion +for sp in $SUBPROJECTS; do +    if grep -xqF "[

Re: [PATCH V5 20/23] tests/qtest: enhance migration channels

2024-12-24 Thread Peter Xu
On Tue, Dec 24, 2024 at 08:17:05AM -0800, Steve Sistare wrote: > Change the migrate_qmp and migrate_qmp_fail channels argument to a QObject > type so the caller can manipulate the object before passing it to the > helper. Define migrate_str_to_channel to aid such manipulation. > Add a channels arg

Re: [PATCH V5 21/23] tests/qtest: assert qmp_ready

2024-12-24 Thread Peter Xu
On Tue, Dec 24, 2024 at 08:17:06AM -0800, Steve Sistare wrote: > Set qmp_ready when the handshake is complete, and assert it when we > communicate with the monitor. > > Suggested-by: Peter Xu > Signed-off-by: Steve Sistare > --- > tests/qtest/libqtest.c | 20 +--- > 1 file chang

Re: [PATCH V5 03/23] physmem: fd-based shared memory

2024-12-24 Thread Peter Xu
On Tue, Dec 24, 2024 at 08:16:48AM -0800, Steve Sistare wrote: > @@ -2079,6 +2100,41 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, > ram_addr_t max_size, > assert((ram_flags & ~(RAM_SHARED | RAM_RESIZEABLE | RAM_PREALLOC | >RAM_NORESERVE | RAM_GUEST_MEMFD))

[PULL 05/72] tcg/optimize: Copy mask writeback to fold_masks

2024-12-24 Thread Richard Henderson
Use of fold_masks should be restricted to those opcodes that can reliably make use of it -- those with a single output, and from higher-level folders that set up the masks. Prepare for conversion of each folder in turn. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/opti

[PATCH 3/5] aspeed: Introduce AST27x0 SoC with Cortex-M4 support

2024-12-24 Thread Steven Lee via
This initial module adds support for the AST27x0 SoC, which features four Cortex-A35 cores and two Cortex-M4 cores. The patch enables emulation of the Cortex-M4 cores, laying the groundwork for co-processor support. Signed-off-by: Steven Lee --- hw/arm/aspeed_ast27x0-cm4.c | 397

[PULL 3/6] hw/loongarch/virt: Create fdt table on machine creation done notification

2024-12-24 Thread Bibo Mao
The same with ACPI table, fdt table is created on machine done notification. Some objects like CPU objects can be created with cold-plug method with command such as -smp x, -device la464-loongarch-cpu, so all objects finish to create when machine is done. Signed-off-by: Bibo Mao Reviewed-by: Bibo

[PULL 0/6] loongarch-to-apply queue

2024-12-24 Thread Bibo Mao
The following changes since commit aa3a285b5bc56a4208b3b57d4a55291e9c260107: Merge tag 'mem-2024-12-21' of https://github.com/davidhildenbrand/qemu into staging (2024-12-22 14:33:27 -0500) are available in the Git repository at: https://gitlab.com/bibo-mao/qemu.git tags/pull-loongarch-20241

[PULL 5/6] target/loongarch: Use auto method with LSX feature

2024-12-24 Thread Bibo Mao
Like LBT feature, add type OnOffAuto for LSX feature setting. Also add LSX feature detection with new VM ioctl command, fallback to old method if it is not supported. Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao --- target/loongarch/cpu.c | 38 +++ target/loongarch/

[PULL 2/6] target/loongarch: Use actual operand size with vbsrl check

2024-12-24 Thread Bibo Mao
Hardcoded 32 bytes is used for vbsrl emulation check, there is problem when options lsx=on,lasx=off is used for vbsrl.v instruction in TCG mode. It injects LASX exception rather LSX exception. Here actual operand size is used. Cc: qemu-sta...@nongnu.org Fixes: df97f338076 ("target/loongarch: Impl

[PULL 4/6] hw/loongarch/virt: Improve fdt table creation for CPU object

2024-12-24 Thread Bibo Mao
For CPU object, possible_cpu_arch_ids() function is used rather than smp.cpus. With command -smp x, -device la464-loongarch-cpu, smp.cpus is not accurate for all possible CPU objects, possible_cpu_arch_ids() is used here. Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao --- hw/loongarch/virt.c | 3

[PULL 6/6] target/loongarch: Use auto method with LASX feature

2024-12-24 Thread Bibo Mao
Like LSX feature, add type OnOffAuto for LASX feature setting. Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao --- target/loongarch/cpu.c | 50 +++ target/loongarch/cpu.h | 2 ++ target/loongarch/kvm/kvm.c | 53 ++ 3 fil

[PULL 1/6] target/loongarch: Fix vldi inst

2024-12-24 Thread Bibo Mao
From: ghy <2247883...@qq.com> Refer to the link below for a description of the vldi instructions: https://jia.je/unofficial-loongarch-intrinsics-guide/lsx/misc/#synopsis_88 Fixed errors in vldi instruction implementation. Signed-off-by: Guo Hongyu Tested-by: Xianglai Li Signed-off-by: Xianglai

Re: [PATCH v6 0/4] i386: Support SMP Cache Topology

2024-12-24 Thread Zhao Liu
> > About smp-cache > > === > > > > The API design has been discussed heavily in [3]. > > > > Now, smp-cache is implemented as a array integrated in -machine. Though > > -machine currently can't support JSON format, this is the one of the > > directions of future. > > > > An example

[PATCH 2/8] futex: Support Windows

2024-12-24 Thread Akihiko Odaki
Windows supports futex-like APIs since Windows 8 and Windows Server 2012. Signed-off-by: Akihiko Odaki --- meson.build | 2 ++ include/qemu/futex.h | 52 ++- tests/unit/test-aio-multithread.c | 2 +- util/lockcnt.c

[PATCH 7/8] migration/colo: Replace QemuSemaphore with QemuEvent

2024-12-24 Thread Akihiko Odaki
colo_exit_sem and colo_incoming_sem represent one-shot events so they can be converted into QemuEvent, which is more lightweight. Signed-off-by: Akihiko Odaki --- migration/migration.h | 6 +++--- migration/colo.c | 20 ++-- 2 files changed, 13 insertions(+), 13 deletions(-

[PATCH 8/8] migration/postcopy: Replace QemuSemaphore with QemuEvent

2024-12-24 Thread Akihiko Odaki
thread_sync_sem is an one-shot event so it can be converted into QemuEvent, which is more lightweight. Signed-off-by: Akihiko Odaki --- migration/migration.h| 4 ++-- migration/postcopy-ram.c | 10 +- migration/savevm.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-)

[PATCH 4/8] qemu-thread: Use futex for QemuEvent on Windows

2024-12-24 Thread Akihiko Odaki
Use the futex-based implementation of QemuEvent on Windows to remove code duplication and remove the overhead of event object construction and destruction. Signed-off-by: Akihiko Odaki --- include/qemu/thread-posix.h | 9 --- include/qemu/thread-win32.h | 6 -- include/qemu/thread.h |

[PATCH 1/8] futex: Check value after qemu_futex_wait()

2024-12-24 Thread Akihiko Odaki
futex(2) - Linux manual page https://man7.org/linux/man-pages/man2/futex.2.html > Note that a wake-up can also be caused by common futex usage patterns > in unrelated code that happened to have previously used the futex > word's memory location (e.g., typical futex-based implementations of > Pthrea

[PATCH 3/8] qemu-thread: Avoid futex abstraction for non-Linux

2024-12-24 Thread Akihiko Odaki
qemu-thread used to abstract pthread primitives into futex for the QemuEvent implementation of POSIX systems other than Linux. However, this abstraction has one key difference: unlike futex, pthread primitives require an explicit destruction, and it must be ordered after wait and wake operations.

[PATCH 0/8] Improve futex usage

2024-12-24 Thread Akihiko Odaki
In a recent discussion, Phil Dennis-Jordan pointed out a quirk in QemuEvent destruction due to futex-like abstraction, which prevented the usage of QemuEvent in new and existing code[1]. With some more thoughts after this discussion, I also found other problem and room of improvement in futex usage

  1   2   3   >