Re: [PATCH] error: Move ERRP_GUARD() to the beginning of the function

2024-03-11 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > Since the commit 05e385d2a9 ("error: Move ERRP_GUARD() to the beginning > of the function"), there are new codes that don't put ERRP_GUARD() at > the beginning of the functions. > > As stated in the commit 05e385d2a9: "include/qapi/error.h advises to put > E

Re: [PATCH v2 00/13] Cleanup on SMP and its test

2024-03-11 Thread Thomas Huth
On 12/03/2024 07.46, Zhao Liu wrote: Hi Philippe, On Sat, Mar 09, 2024 at 02:49:17PM +0100, Philippe Mathieu-Daudé wrote: Date: Sat, 9 Mar 2024 14:49:17 +0100 From: Philippe Mathieu-Daudé Subject: Re: [PATCH v2 00/13] Cleanup on SMP and its test On 9/3/24 01:46, Zhao Liu wrote: Hi Philippe,

Re: [PATCH] spapr: avoid overhead of finding vhyp class in critical operations

2024-03-11 Thread Harsh Prateek Bora
Hi Nick, One minor comment below: On 2/24/24 13:03, Nicholas Piggin wrote: PPC_VIRTUAL_HYPERVISOR_GET_CLASS is used in critical operations like interrupts and TLB misses and is quite costly. Running the kvm-unit-tests sieve program with radix MMU enabled thrashes the TCG TLB and spends a lot of

Re: [PATCH v5] pc: q35: Bump max_cpus to 4096 vcpus

2024-03-11 Thread Ani Sinha
> On 28-Feb-2024, at 20:03, Ani Sinha wrote: > > Since commit f10a570b093e6 ("KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS to allow > up to 4096 vCPUs") > Linux kernel can support upto a maximum number of 4096 vcpus when MAXSMP is > enabled in the kernel. At present, QEMU has been tested to correctl

Re: [PATCH v2 00/13] Cleanup on SMP and its test

2024-03-11 Thread Zhao Liu
Hi Philippe, On Sat, Mar 09, 2024 at 02:49:17PM +0100, Philippe Mathieu-Daudé wrote: > Date: Sat, 9 Mar 2024 14:49:17 +0100 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH v2 00/13] Cleanup on SMP and its test > > On 9/3/24 01:46, Zhao Liu wrote: > > Hi Philippe, > > > > > > > > Can you s

[PATCH v2 1/1] memory tier: acpi/hmat: create CPUless memory tiers after obtaining HMAT info

2024-03-11 Thread Ho-Ren (Jack) Chuang
The current implementation treats emulated memory devices, such as CXL1.1 type3 memory, as normal DRAM when they are emulated as normal memory (E820_TYPE_RAM). However, these emulated devices have different characteristics than traditional DRAM, making it important to distinguish them. Thus, we mod

[PATCH v2 0/1] Improved Memory Tier Creation for CPUless NUMA Nodes

2024-03-11 Thread Ho-Ren (Jack) Chuang
When a memory device, such as CXL1.1 type3 memory, is emulated as normal memory (E820_TYPE_RAM), the memory device is indistinguishable from normal DRAM in terms of memory tiering with the current implementation. The current memory tiering assigns all detected normal memory nodes to the same DRAM t

Re: [PATCH 4/5] plugins: conditional callbacks

2024-03-11 Thread Pierrick Bouvier
On 3/11/24 19:43, Alex Bennée wrote: Pierrick Bouvier writes: Extend plugins API to support callback called with a given criteria (evaluated inline). Added functions: - qemu_plugin_register_vcpu_tb_exec_cond_cb - qemu_plugin_register_vcpu_insn_exec_cond_cb They expect as parameter a conditio

Re: [PATCH 4/5] plugins: conditional callbacks

2024-03-11 Thread Pierrick Bouvier
On 3/11/24 14:08, Alex Bennée wrote: Pierrick Bouvier writes: Extend plugins API to support callback called with a given criteria (evaluated inline). Added functions: - qemu_plugin_register_vcpu_tb_exec_cond_cb - qemu_plugin_register_vcpu_insn_exec_cond_cb They expect as parameter a conditio

Re: [PATCH v5 00/14] Nested PAPR API (KVM on PowerVM)

2024-03-11 Thread Nicholas Piggin
On Fri Mar 8, 2024 at 9:19 PM AEST, Harsh Prateek Bora wrote: > There is an existing Nested-HV API to enable nested guests on powernv > machines. However, that is not supported on pseries/PowerVM LPARs. > This patch series implements required hcall interfaces to enable nested > guests with KVM on P

[PATCH] error: Move ERRP_GUARD() to the beginning of the function

2024-03-11 Thread Zhao Liu
From: Zhao Liu Since the commit 05e385d2a9 ("error: Move ERRP_GUARD() to the beginning of the function"), there are new codes that don't put ERRP_GUARD() at the beginning of the functions. As stated in the commit 05e385d2a9: "include/qapi/error.h advises to put ERRP_GUARD() right at the beginnin

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

2024-03-11 Thread Huang Tao
In this patch, we modify the decoder to be a freely composable data structure instead of a hardcoded one. It can be dynamically builded up according to the extensions. This approach has several benefits: 1. Provides support for heterogeneous cpu architectures. As we add decoder in RISCVCPU, each

Re: [PATCH v5 0/8] qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs

2024-03-11 Thread Het Gala
Can also check the passed build at https://gitlab.com/galahet/Qemu/-/pipelines/1209497470 On 12/03/24 3:23 am, Het Gala wrote: With recent migrate QAPI changes, enabling the direct use of the 'channels' argument to avoid redundant URI string parsing is achieved. v4->v5 Changelog: ---

Re: [PATCH-for-9.0] docs: Deprecate the pseries-2.12 machines

2024-03-11 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 5:04 AM AEST, Philippe Mathieu-Daudé wrote: > pSeries machines before 3.0 have complex migration back > compatibility code we'd like to get ride of. The last > one is 2.12, which is 6 years old. We just deprecated up > to the 2.11 machine in commit 1392617d35 ("spapr: Tag > p

Re: [PATCH v2] spapr: Tag pseries-2.1 - 2.11 machines as deprecated

2024-03-11 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 4:56 AM AEST, Daniel P. Berrangé wrote: > On Mon, Mar 11, 2024 at 06:46:53PM +0100, Philippe Mathieu-Daudé wrote: > > Hi, > > > > On 14/12/23 19:17, Cédric Le Goater wrote: > > > pseries machines before version 2.11 have undergone many changes to > > > correct issues, mostly

Re: [PATCH 01/13] ppc: Drop support for POWER9 and POWER10 DD1 chips

2024-03-11 Thread Harsh Prateek Bora
On 3/12/24 10:20, Harsh Prateek Bora wrote: On 3/12/24 00:21, Nicholas Piggin wrote: The POWER9 DD1 and POWER10 DD1 chips are not public and are no longer of any use in QEMU. Remove them. Signed-off-by: Nicholas Piggin ---   hw/ppc/spapr_cpu_core.c |  2 --   target/ppc/cpu-models.c |  4 -

Re: [PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-11 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 7:07 AM AEST, BALATON Zoltan wrote: > On Mon, 11 Mar 2024, Philippe Mathieu-Daudé wrote: > > On 11/3/24 19:51, Nicholas Piggin wrote: > >> From: Benjamin Gray > >> > >> Add POWER10 pa-features entry. > >> > >> Notably DEXCR and and [P]HASHST/[P]HASHCHK instruction support

Re: [PATCH 01/13] ppc: Drop support for POWER9 and POWER10 DD1 chips

2024-03-11 Thread Harsh Prateek Bora
On 3/12/24 00:21, Nicholas Piggin wrote: The POWER9 DD1 and POWER10 DD1 chips are not public and are no longer of any use in QEMU. Remove them. Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_cpu_core.c | 2 -- target/ppc/cpu-models.c | 4 target/ppc/cpu_init.c | 7 ++- ta

Re: [PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-11 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 6:05 AM AEST, Philippe Mathieu-Daudé wrote: > On 11/3/24 19:51, Nicholas Piggin wrote: > > From: Benjamin Gray > > > > Add POWER10 pa-features entry. > > > > Notably DEXCR and and [P]HASHST/[P]HASHCHK instruction support is > > advertised. Each DEXCR aspect is allocated a

RE: [PATCH v2 3/9] aspeed/sdmc: Add AST2700 support

2024-03-11 Thread Jamin Lin
> >> > > Hi Cedrice, > > > > Thanks for review and sorry reply you late. > > > >> On 3/4/24 10:29, Jamin Lin wrote: > >>> The SDRAM memory controller(DRAMC) controls the access to external > >>> DDR4 and DDR5 SDRAM and power up to DDR4 and DDR5 PHY. > >>> > >>> The DRAM memory controller of AST2700

Re: [PATCH V3 1/1] target/loongarch: Fixed tlb huge page loading issue

2024-03-11 Thread lixianglai
Hi Richard: @@ -495,30 +508,10 @@ target_ulong helper_lddir(CPULoongArchState *env, target_ulong base,   shift = FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTEWIDTH);   shift = (shift + 1) * 3;   -    if (huge) { -    return base; -    } -    switch (level) { -    case 1: -    dir_bas

Re: [PATCH] target/ppc: Fix GDB SPR regnum indexing

2024-03-11 Thread Akihiko Odaki
On 2024/03/12 2:54, Nicholas Piggin wrote: Fix an off by one bug. Cc: Akihiko Odaki Cc: Alex Bennée Fixes: 1b53948ff8f70 ("target/ppc: Use GDBFeature for dynamic XML") Signed-off-by: Nicholas Piggin Reviewed-by: Akihiko Odaki --- target/ppc/gdbstub.c | 7 +++ 1 file changed, 3 ins

Re: [PATCH v2] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-03-11 Thread LIU Zhiwei
On 2024/3/11 11:08, Yu-Ming Chang wrote: Both CSRRS and CSRRC always read the addressed CSR and cause any read side effects regardless of rs1 and rd fields. Note that if rs1 specifies a register holding a zero value other than x0, the instruction will still attempt to write the unmodified value

[PATCH V8 6/8] physmem: Add helper function to destroy CPU AddressSpace

2024-03-11 Thread Salil Mehta via
Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also involves destruction of the CPU AddressSpace. Add common function to help destroy the CPU AddressSpace. Signed-off-by: Salil Mehta Tested-by: Vishnu Pajjuri Reviewed-by: Gavin Shan Tested-by: Xianglai Li Tested-by: Miguel

Re: [PATCH v3 1/3] hw/core: Cleanup unused included headers in cpu-common.c

2024-03-11 Thread Zhao Liu
> > Thanks for helpping me verify this!! > > > > EMM, but I'm still not understanding how this approach distinguishes > > whether hw/core/cpu-common.c needs the header (include/exec/cpu-common.h) > > directly or just include/exec/memory.h needs that header? For the latter, > > the header needn't b

[PATCH V8 8/8] docs/specs/acpi_hw_reduced_hotplug: Add the CPU Hotplug Event Bit

2024-03-11 Thread Salil Mehta via
GED interface is used by many hotplug events like memory hotplug, NVDIMM hotplug and non-hotplug events like system power down event. Each of these can be selected using a bit in the 32 bit GED IO interface. A bit has been reserved for the CPU hotplug event. Signed-off-by: Salil Mehta Reviewed-by

[PATCH V8 7/8] gdbstub: Add helper function to unregister GDB register space

2024-03-11 Thread Salil Mehta via
Add common function to help unregister the GDB register space. This shall be done in context to the CPU unrealization. Signed-off-by: Salil Mehta Tested-by: Vishnu Pajjuri Reviewed-by: Gavin Shan Tested-by: Xianglai Li Tested-by: Miguel Luis Reviewed-by: Shaoqin Huang --- gdbstub/gdbstub.c

[PATCH V8 4/8] hw/acpi: Update GED _EVT method AML with CPU scan

2024-03-11 Thread Salil Mehta via
OSPM evaluates _EVT method to map the event. The CPU hotplug event eventually results in start of the CPU scan. Scan figures out the CPU and the kind of event(plug/unplug) and notifies it back to the guest. Update the GED AML _EVT method with the call to \\_SB.CPUS.CSCN Also, macro CPU_SCAN_METHOD

[PATCH V8 5/8] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2024-03-11 Thread Salil Mehta via
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is IO port based and existing CPUs AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on ARM arch CPUs control device(\\_SB.PRES) register interface is memory-mapped hence _CRS ob

[PATCH V8 3/8] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2024-03-11 Thread Salil Mehta via
ACPI GED (as described in the ACPI 6.4 spec) uses an interrupt listed in the _CRS object of GED to intimate OSPM about an event. Later then demultiplexes the notified event by evaluating ACPI _EVT method to know the type of event. Use ACPI GED to also notify the guest kernel about any CPU hot(un)pl

[PATCH V8 2/8] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2024-03-11 Thread Salil Mehta via
CPU ctrl-dev MMIO region length could be used in ACPI GED and various other architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more appropriate common header file. Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Review

[PATCH V8 1/8] accel/kvm: Extract common KVM vCPU {creation, parking} code

2024-03-11 Thread Salil Mehta via
KVM vCPU creation is done once during the vCPU realization when Qemu vCPU thread is spawned. This is common to all the architectures as of now. Hot-unplug of vCPU results in destruction of the vCPU object in QOM but the corresponding KVM vCPU object in the Host KVM is not destroyed as KVM doesn't

[PATCH V8 0/8] Add architecture agnostic code to support vCPU Hotplug

2024-03-11 Thread Salil Mehta via
Virtual CPU hotplug support is being added across various architectures[1][3]. This series adds various code bits common across all architectures: 1. vCPU creation and Parking code refactor [Patch 1] 2. Update ACPI GED framework to support vCPU Hotplug [Patch 2,3] 3. ACPI CPUs AML code change [Pat

Re: [PATCH v12 4/7] target/riscv: remove 'over' brconds from vector trans

2024-03-11 Thread LIU Zhiwei
On 2024/3/12 2:08, Daniel Henrique Barboza wrote: The previous patch added an early vstart >= vl exit in all vector helpers, most of them using the VSTART_CHECK_EARLY_EXIT() macro, and now we're left with a lot of 'brcond' that has not use. The pattern goes like this: VSTART_CHECK_EARLY_E

RE: [PATCH V2 09/11] migration: privatize colo interfaces

2024-03-11 Thread Zhang, Chen
> -Original Message- > From: Steve Sistare > Sent: Tuesday, March 12, 2024 1:49 AM > To: qemu-devel@nongnu.org > Cc: Alex Williamson ; Cedric Le Goater > ; Michael S. Tsirkin ; David Hildenbrand > ; Peter Xu ; Fabiano Rosas > ; Zhang, Hailiang ; Zhang, > Chen ; Li Zhijian ; Jason Wang >

[PATCH] meson: Make DEBUG_REMAP a meson option

2024-03-11 Thread Ilya Leoshkevich
Currently DEBUG_REMAP is a macro that needs to be manually #defined to be activated, which makes it hard to have separate build directories dedicated to testing the code with it. Promote it to a meson option. Signed-off-by: Ilya Leoshkevich --- bsd-user/qemu.h | 6 ++ linux-use

Re: [RISC-V][tech-server-soc] [RISC-V][tech-server-platform] [RFC 1/2] hw/riscv: Add server platform reference machine

2024-03-11 Thread Atish Kumar Patra
On Mon, Mar 11, 2024 at 7:38 AM Andrew Jones wrote: > > On Mon, Mar 11, 2024 at 04:55:24AM -0700, Wu, Fei2 wrote: > > On 3/8/2024 5:20 PM, Andrew Jones wrote: > > > On Thu, Mar 07, 2024 at 02:26:18PM +0800, Wu, Fei wrote: > > >> On 3/7/2024 8:48 AM, Alistair Francis wrote: > > >>> On Thu, Mar 7, 2

[PATCH] gdbstub: Fix double close() of the follow-fork-mode socket

2024-03-11 Thread Ilya Leoshkevich
When the terminal GDB_FORK_ENABLED state is reached, the coordination socket is not needed anymore and is therefore closed. However, if there is a communication error between QEMU gdbstub and GDB, the generic error handling code attempts to close it again. Fix by closing it later - before returnin

[PATCH 0/2] migration: mapped-ram fixes

2024-03-11 Thread Fabiano Rosas
Hi, Here are the fixes for the dup() issues found by Coverity. @Peter Xu, I fixed the leak you found, but I'm holding on to that patch because I noticed we're not freeing the ioc in the error paths. I'll need to add some infrastructure to be able to cancel the glib polling (qio_channel_add_watch_

[PATCH 1/2] io: Introduce qio_channel_file_new_dupfd

2024-03-11 Thread Fabiano Rosas
Add a new helper function for creating a QIOChannelFile channel with a duplicated file descriptor. This saves the calling code from having to do error checking on the dup() call. Suggested-by: Daniel P. Berrangé Signed-off-by: Fabiano Rosas --- include/io/channel-file.h | 18 ++

[PATCH 2/2] migration: Fix error handling after dup in file migration

2024-03-11 Thread Fabiano Rosas
The file migration code was allowing a possible -1 from a failed call to dup() to propagate into the new QIOFileChannel::fd before checking for validity. Coverity doesn't like that, possibly due to the the lseek(-1, ...) call that would ensue before returning from the channel creation routine. Use

[PULL 20/34] migration: export migration_is_running

2024-03-11 Thread peterx
From: Steve Sistare Delete the MigrationState parameter from migration_is_running and move it to the public API in misc.h. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-5-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- include/migration/m

[PULL 31/34] migration/multifd: Implement zero page transmission on the multifd thread.

2024-03-11 Thread peterx
From: Hao Xiang 1. Add zero_pages field in MultiFDPacket_t. 2. Implements the zero page detection and handling on the multifd threads for non-compression, zlib and zstd compression backends. 3. Added a new value 'multifd' in ZeroPageDetection enumeration. 4. Adds zero page counters and updates mu

[PULL 30/34] migration/multifd: Add new migration option zero-page-detection.

2024-03-11 Thread peterx
From: Hao Xiang This new parameter controls where the zero page checking is running. 1. If this parameter is set to 'legacy', zero page checking is done in the migration main thread. 2. If this parameter is set to 'none', zero page checking is disabled. Signed-off-by: Hao Xiang Reviewed-by: Pet

[PULL 25/34] migration: privatize colo interfaces

2024-03-11 Thread peterx
From: Steve Sistare Remove private migration interfaces from net/colo-compare.c and push them to migration/colo.c. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-10-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- migration/colo.c | 17 ++

[PULL 27/34] migration: purge MigrationState from public interface

2024-03-11 Thread peterx
From: Steve Sistare Move remaining MigrationState references from the public file misc.h to the private file migration.h. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-12-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- include/migration/m

[PULL 21/34] migration: export vcpu_dirty_limit_period

2024-03-11 Thread peterx
From: Steve Sistare Define and export vcpu_dirty_limit_period to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-6-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- include/migration/client-options.h

[PULL 15/34] migration: Fix format in error message

2024-03-11 Thread peterx
From: Anthony PERARD In file_write_ramblock_iov(), "offset" is "uintptr_t" and not "ram_addr_t". While usually they are both equivalent, this is not the case with CONFIG_XEN_BACKEND. Use the right format. This will fix build on 32-bit. Fixes: f427d90b9898 ("migration/multifd: Support outgoing m

Re: [PATCH v4 0/8] qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs

2024-03-11 Thread Het Gala
On 12/03/24 3:08 am, Peter Xu wrote: On Tue, Mar 12, 2024 at 03:01:51AM +0530, Het Gala wrote: On 12/03/24 2:55 am, Peter Xu wrote: On Sat, Mar 09, 2024 at 01:11:45PM +0530, Het Gala wrote: Can find the reference to the githab pipeline (before patchset) : https://urldefense.proofpoint.com/v2/

[PULL 29/34] migration/multifd: Allow clearing of the file_bmap from multifd

2024-03-11 Thread peterx
From: Fabiano Rosas We currently only need to clear the mapped-ram file bitmap from the migration thread during save_zero_page. We're about to add support for zero page detection on the multifd thread, so allow ramblock_set_file_bmap_atomic() to also clear the bits. Signed-off-by: Fabiano Rosas

[PULL 05/34] migration: Report error when shutdown fails

2024-03-11 Thread peterx
From: Cédric Le Goater This will help detect issues regarding I/O channels usage. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240304122844.1888308-7-...@redhat.com Signed-off-by: Peter Xu --- migration/qemu-file

[PULL 32/34] migration/multifd: Implement ram_save_target_page_multifd to handle multifd version of MigrationOps::ram_save_target_page.

2024-03-11 Thread peterx
From: Hao Xiang 1. Add a dedicated handler for MigrationOps::ram_save_target_page in multifd live migration. 2. Refactor ram_save_target_page_legacy so that the legacy and multifd handlers don't have internal functions calling into each other. Signed-off-by: Hao Xiang Reviewed-by: Fabiano Rosas

[PULL 07/34] migration: Add documentation for SaveVMHandlers

2024-03-11 Thread peterx
From: Cédric Le Goater The SaveVMHandlers structure is still in use for complex subsystems and devices. Document the handlers since we are going to modify a few later. Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240304122844.1888308-9-...@redhat.com

[PULL 18/34] migration: export migration_is_setup_or_active

2024-03-11 Thread peterx
From: Steve Sistare Delete the MigrationState parameter from migration_is_setup_or_active and move it to the public API in misc.h. Signed-off-by: Steve Sistare Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/1710179338-294359-3-git-send-email-steven.sist...@oracle.com Sign

[PULL 22/34] migration: migration_thread_is_self

2024-03-11 Thread peterx
From: Steve Sistare Define and export migration_thread_is_self to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-7-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- include/migration/misc.h | 1 + mi

[PULL 10/34] migration/rdma: Fix a memory issue for migration

2024-03-11 Thread peterx
From: Yu Zhang In commit 3fa9642ff7 change was made to convert the RDMA backend to accept MigrateAddress struct. However, the assignment of "host" leads to data corruption on the target host and the failure of migration. isock->host = rdma->host; By allocating the memory explicitly for it w

[PULL 28/34] migration/multifd: Allow zero pages in file migration

2024-03-11 Thread peterx
From: Fabiano Rosas Currently, it's an error to have no data pages in the multifd file migration because zero page detection is done in the migration thread and zero pages don't reach multifd. This is enforced with the pages->num assert. We're about to add zero page detection on the multifd thre

[PULL 34/34] migration/multifd: Add new migration test cases for legacy zero page checking.

2024-03-11 Thread peterx
From: Hao Xiang Now that zero page checking is done on the multifd sender threads by default, we still provide an option for backward compatibility. This change adds a qtest migration test case to set the zero-page-detection option to "legacy" and run multifd migration with zero page checking on

[PULL 26/34] migration: delete unused accessors

2024-03-11 Thread peterx
From: Steve Sistare Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-11-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- include/migration/misc.h | 3 --- migration/migration.c| 10 -- 2 files changed, 13 deletions(-) diff --git

[PULL 09/34] migration/multifd: Don't fsync when closing QIOChannelFile

2024-03-11 Thread peterx
From: Fabiano Rosas Commit bc38feddeb ("io: fsync before closing a file channel") added a fsync/fdatasync at the closing point of the QIOChannelFile to ensure integrity of the migration stream in case of QEMU crash. The decision to do the sync at qio_channel_close() was not the best since that f

[PULL 33/34] migration/multifd: Enable multifd zero page checking by default.

2024-03-11 Thread peterx
From: Hao Xiang 1. Set default "zero-page-detection" option to "multifd". Now zero page checking can be done in the multifd threads and this becomes the default configuration. 2. Handle migration QEMU9.0 -> QEMU8.2 compatibility. We provide backward compatibility where zero page checking is done

[PULL 06/34] migration: Remove SaveStateHandler and LoadStateHandler typedefs

2024-03-11 Thread peterx
From: Cédric Le Goater They are only used once. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240304122844.1888308-8-...@redhat.com Signed-off-by: Peter Xu --- include/migration/register.h | 4 ++-- include/qemu/typedefs.h

[PULL 24/34] migration: migration_file_set_error

2024-03-11 Thread peterx
From: Steve Sistare Define and export migration_file_set_error to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-9-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- include/migration/misc.h | 2 ++

[PULL 12/34] physmem: Reduce local variable scope in flatview_read/write_continue()

2024-03-11 Thread peterx
From: Jonathan Cameron Precursor to factoring out the inner loops for reuse. Reviewed-by: Peter Xu Signed-off-by: Jonathan Cameron Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20240307153710.30907-3-jonathan.came...@huawei.com Signed-off

[PULL 01/34] migration: Don't serialize devices in qemu_savevm_state_iterate()

2024-03-11 Thread peterx
From: Avihai Horon Commit 90697be8896c ("live migration: Serialize vmstate saving in stage 2") introduced device serialization in qemu_savevm_state_iterate(). The rationale behind it was to first complete migration of slower changing block devices and only then migrate the RAM, to avoid sending f

[PULL 23/34] migration: migration_is_device

2024-03-11 Thread peterx
From: Steve Sistare Define and export migration_is_device to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-8-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- include/migration/misc.h | 1 + hw/vfio

[PULL 17/34] migration: remove migration.h references

2024-03-11 Thread peterx
From: Steve Sistare Remove migration.h from files that no longer need it due to previous commits. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-2-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- hw/vfio/container.c| 1 - hw/virtio/

[PULL 00/34] Migration 20240311 patches

2024-03-11 Thread peterx
/migration-20240311-pull-request for you to fetch changes up to 1815338df00fd0a3fe25085564c6966f74c8f43d: migration/multifd: Add new migration test cases for legacy zero page checking. (2024-03-11 16:57:09 -0400) Migration pu

[PULL 08/34] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in case of error

2024-03-11 Thread peterx
From: Cédric Le Goater When commit bd2270608fa0 ("migration/ram.c: add a notifier chain for precopy") added PRECOPY_NOTIFY_SETUP notifiers at the end of qemu_savevm_state_setup(), it didn't take into account a possible error in the loop calling vmstate_save() or .save_setup() handlers. Check ret

[PULL 16/34] migration: export fewer options

2024-03-11 Thread peterx
From: Steve Sistare A small number of migration options are accessed by migration clients, but to see them clients must include all of options.h, which is mostly for migration core code. migrate_mode() in particular will be needed by multiple clients. Refactor the option declarations so clients

[PULL 03/34] vfio/migration: Add a note about migration rate limiting

2024-03-11 Thread peterx
From: Avihai Horon VFIO migration buffer size is currently limited to 1MB. Therefore, there is no need to check if migration rate exceeded, as in the worst case it will exceed by only 1MB. However, if the buffer size is later changed to a bigger value, vfio_save_iterate() should enforce migratio

[PULL 04/34] migration/ram: add additional check

2024-03-11 Thread peterx
From: Maksim Davydov If a migration stream is broken, the address and flag reading can return zero. Thus, an irrelevant flag error will be returned instead of EIO. It can be fixed by additional check after the reading. Signed-off-by: Maksim Davydov Link: https://lore.kernel.org/r/2024030414420

[PULL 02/34] vfio/migration: Refactor vfio_save_state() return value

2024-03-11 Thread peterx
From: Avihai Horon Currently, vfio_save_state() returns 1 regardless of whether there is more data to send or not. This was done to prevent a fast changing VFIO device from potentially blocking other devices from sending their data, as qemu_savevm_state_iterate() serialized devices. Now that qem

[PULL 19/34] migration: export migration_is_active

2024-03-11 Thread peterx
From: Steve Sistare Delete the MigrationState parameter from migration_is_active so it can be exported and used without including migration.h. Signed-off-by: Steve Sistare Link: https://lore.kernel.org/r/1710179338-294359-4-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu ---

[PULL 14/34] physmem: Fix wrong address in large address_space_read/write_cached_slow()

2024-03-11 Thread peterx
From: Jonathan Cameron If the access is bigger than the MemoryRegion supports, flatview_read/write_continue() will attempt to update the Memory Region. but the address passed to flatview_translate() is relative to the cache, not to the FlatView. On arm/virt with interleaved CXL memory emulation

[PULL 13/34] physmem: Factor out body of flatview_read/write_continue() loop

2024-03-11 Thread peterx
From: Jonathan Cameron This code will be reused for the address_space_cached accessors shortly. Also reduce scope of result variable now we aren't directly calling this in the loop. Signed-off-by: Jonathan Cameron Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/20240307153710.

[PULL 11/34] physmem: Rename addr1 to more informative mr_addr in flatview_read/write() and similar

2024-03-11 Thread peterx
From: Jonathan Cameron The calls to flatview_read/write[_continue]() have parameters addr and addr1 but the names give no indication of what they are addresses of. Rename addr1 to mr_addr to reflect that it is the translated address offset within the MemoryRegion returned by flatview_translate().

[PATCH v5 1/8] Add 'to' object into migrate_qmp()

2024-03-11 Thread Het Gala
Add the 'to' object into migrate_qmp(), so we can use migrate_get_socket_address() inside migrate_qmp() to get the port value. This is not applied to other migrate_qmp* because they don't need the port. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qt

[PATCH v5 5/8] Add migrate_set_ports into migrate_qmp to update migration port value

2024-03-11 Thread Het Gala
migrate_get_connect_qdict gets qdict with the dst QEMU parameters. migrate_set_ports() from list of channels reads each QDict for port, and fills the port with correct value in case it was 0 in the test. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas --- tests/qtest/migration-helpers.c |

[PATCH v5 7/8] Add multifd_tcp_plain test using list of channels instead of uri

2024-03-11 Thread Het Gala
Add a positive test to check multifd live migration but this time using list of channels (restricted to 1) as the starting point instead of simple uri string. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas --- tests/qtest/migration-test.c | 30 +++--- 1 file changed

[PATCH v5 8/8] Add negative tests to validate migration QAPIs

2024-03-11 Thread Het Gala
Migration QAPI arguments - uri and channels are mutually exhaustive. Add negative validation tests, one with both arguments present and one with none present. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qtest/migration-test.c | 53 ++

[PATCH v5 2/8] Replace connect_uri and move migrate_get_socket_address inside migrate_qmp

2024-03-11 Thread Het Gala
Move the calls to migrate_get_socket_address() into migrate_qmp(). Get rid of connect_uri and replace it with args->connect_uri only because 'to' object will help to generate connect_uri with the correct port number. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas --- tests/qtest/migration-

[PATCH v5 6/8] Add channels parameter in migrate_qmp

2024-03-11 Thread Het Gala
Alter migrate_qmp() to allow use of channels parameter, but only fill the uri with correct port number if there are no channels. Here we don't want to allow the wrong cases of having both or none (ex: migrate_qmp_fail). Signed-off-by: Het Gala Suggested-by: Fabiano Rosas --- tests/qtest/migrati

[PATCH v5 0/8] qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs

2024-03-11 Thread Het Gala
With recent migrate QAPI changes, enabling the direct use of the 'channels' argument to avoid redundant URI string parsing is achieved. To ensure backward compatibility, both 'uri' and 'channels' are kept as optional parameters in migration QMP commands. However, they are mutually exhaustive, requ

[PATCH v5 4/8] Add channels parameter in migrate_qmp_fail

2024-03-11 Thread Het Gala
Alter migrate_qmp_fail() to allow both uri and channels independently. For channels, convert string to a Dict. No dealing with migrate_get_socket_address() here because we will fail before starting the migration anyway. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas --- tests/qtest/migrati

[PATCH v5 3/8] Replace migrate_get_connect_uri inplace of migrate_get_socket_address

2024-03-11 Thread Het Gala
Refactor migrate_get_socket_address to internally utilize 'socket-address' parameter, reducing redundancy in the function definition. migrate_get_socket_address implicitly converts SocketAddress into str. Move migrate_get_socket_address inside migrate_get_connect_uri which should return the uri st

Re: [PATCH v4 0/8] qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs

2024-03-11 Thread Peter Xu
On Tue, Mar 12, 2024 at 03:01:51AM +0530, Het Gala wrote: > > On 12/03/24 2:55 am, Peter Xu wrote: > > On Sat, Mar 09, 2024 at 01:11:45PM +0530, Het Gala wrote: > > > Can find the reference to the githab pipeline (before patchset) : > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__gitlab

Re: [PATCH v4 0/8] qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs

2024-03-11 Thread Het Gala
On 12/03/24 2:55 am, Peter Xu wrote: On Sat, Mar 09, 2024 at 01:11:45PM +0530, Het Gala wrote: Can find the reference to the githab pipeline (before patchset) : https://urldefense.proofpoint.com/v2/url?u=https-3A__gitlab.com_galahet_Qemu_-2D_pipelines_1207185095&d=DwIBaQ&c=s883GpUCOChKOHiocYtG

Re: [PATCH v4 0/8] qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs

2024-03-11 Thread Peter Xu
On Sat, Mar 09, 2024 at 01:11:45PM +0530, Het Gala wrote: > Can find the reference to the githab pipeline (before patchset) : > https://gitlab.com/galahet/Qemu/-/pipelines/1207185095 > > Can find the reference to the githab pipeline (after patchset) : > https://gitlab.com/galahet/Qemu/-/pipelines/

Re: [PATCH v4 5/8] Add migrate_set_ports into migrate_qmp to update migration port value

2024-03-11 Thread Het Gala
On 12/03/24 12:12 am, Fabiano Rosas wrote: Het Gala writes: migrate_set_get_qdict gets qdict with the dst QEMU parameters s/set_// Ack migrate_set_ports() from list of channels reads each QDict for port, and fills the port with correct value in case it was 0 in the test. Signed-off-by: He

Re: [PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-11 Thread BALATON Zoltan
On Mon, 11 Mar 2024, Philippe Mathieu-Daudé wrote: On 11/3/24 19:51, Nicholas Piggin wrote: From: Benjamin Gray Add POWER10 pa-features entry. Notably DEXCR and and [P]HASHST/[P]HASHCHK instruction support is advertised. Each DEXCR aspect is allocated a bit in the device tree, using the 68--7

Re: [PATCH v6 7/7] migration/multifd: Add new migration test cases for legacy zero page checking.

2024-03-11 Thread Peter Xu
On Mon, Mar 11, 2024 at 06:00:15PM +, Hao Xiang wrote: > From: Hao Xiang > > Now that zero page checking is done on the multifd sender threads by > default, we still provide an option for backward compatibility. This > change adds a qtest migration test case to set the zero-page-detection > o

Re: [PATCH v4 3/8] Replace migrate_get_connect_uri inplace of migrate_get_socket_address

2024-03-11 Thread Het Gala
On 12/03/24 2:21 am, Fabiano Rosas wrote: Het Gala writes: On 11/03/24 11:49 pm, Fabiano Rosas wrote: Het Gala writes: bool migrate_watch_for_events(QTestState *who, const char *name, @@ -130,7 +140,7 @@ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, g_

Re: [PATCH v4 3/8] Replace migrate_get_connect_uri inplace of migrate_get_socket_address

2024-03-11 Thread Fabiano Rosas
Het Gala writes: > On 11/03/24 11:49 pm, Fabiano Rosas wrote: >> Het Gala writes: >> >>> >>> bool migrate_watch_for_events(QTestState *who, const char *name, >>> @@ -130,7 +140,7 @@ void migrate_qmp(QTestState *who, QTestState *to, const >>> char *uri, >>> >>> g_assert(!qdict_haskey(

Re: [PATCH v6 6/7] migration/multifd: Enable multifd zero page checking by default.

2024-03-11 Thread Fabiano Rosas
Hao Xiang writes: > From: Hao Xiang > > 1. Set default "zero-page-detection" option to "multifd". Now > zero page checking can be done in the multifd threads and this > becomes the default configuration. > 2. Handle migration QEMU9.0 -> QEMU8.2 compatibility. We provide > backward compatibility

Re: [PATCH v6 0/7] Introduce multifd zero page checking.

2024-03-11 Thread Peter Xu
On Mon, Mar 11, 2024 at 06:00:08PM +, Hao Xiang wrote: > v6 update: > * Make ZERO_PAGE_DETECTION_NONE option work in legacy migration. > * Rebase on top of 7489f7f3f81dcb776df8c1b9a9db281fc21bf05f. Queued, thanks. -- Peter Xu

Re: [PATCH v6 6/7] migration/multifd: Enable multifd zero page checking by default.

2024-03-11 Thread Peter Xu
On Mon, Mar 11, 2024 at 06:00:14PM +, Hao Xiang wrote: > From: Hao Xiang > > 1. Set default "zero-page-detection" option to "multifd". Now > zero page checking can be done in the multifd threads and this > becomes the default configuration. > 2. Handle migration QEMU9.0 -> QEMU8.2 compatibili

Re: [PATCH] target/i386: fix direction of "32-bit MMU" test

2024-03-11 Thread Mark Cave-Ayland
On 11/03/2024 07:58, Paolo Bonzini wrote: The low bit of MMU indices for x86 TCG indicates whether the processor is in 32-bit mode and therefore linear addresses have to be masked to 32 bits. However, the index was computed incorrectly, leading to possible conflicts in the TLB for any address ab

Re: [PATCH V2 00/11] privatize migration.h

2024-03-11 Thread Steven Sistare
On 3/11/2024 4:28 PM, Peter Xu wrote: On Mon, Mar 11, 2024 at 04:24:14PM -0400, Steven Sistare wrote: On 3/11/2024 3:45 PM, Steven Sistare wrote: On 3/11/2024 3:30 PM, Peter Xu wrote: Steve, On Mon, Mar 11, 2024 at 10:48:47AM -0700, Steve Sistare wrote: Changes in V2:    * rebase to migrati

Re: [PATCH v4 3/8] Replace migrate_get_connect_uri inplace of migrate_get_socket_address

2024-03-11 Thread Het Gala
On 11/03/24 11:49 pm, Fabiano Rosas wrote: Het Gala writes: bool migrate_watch_for_events(QTestState *who, const char *name, @@ -130,7 +140,7 @@ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, g_assert(!qdict_haskey(args, "uri")); if (!uri) { -co

  1   2   3   4   5   >