[PATCH v3] hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`

2025-01-14 Thread Li Zhijian via
This assertion always happens when we sanitize the CXL memory device. $ echo 1 > /sys/bus/cxl/devices/mem0/security/sanitize It is incorrect to register an MSIX number beyond the device's capability. Increase the device's MSIX number to cover the mailbox msix number(9). Fixes: 43efb0bfad2b ("hw/

[PATCH] hw/cxl: Introduce CXL_T3_MSIX_VECTOR enumeration

2025-01-14 Thread Li Zhijian via
Introduce the `CXL_T3_MSIX_VECTOR` enumeration to specify MSIX vector assignments specific to the Type 3 (T3) CXL device. The primary goal of this change is to encapsulate the MSIX vector uses that are unique to the T3 device within an enumeration, improving code readability and maintenance by avo

Re: [PATCH v2] hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`

2025-01-14 Thread Zhijian Li (Fujitsu)
On 10/01/2025 23:44, Jonathan Cameron wrote: > On Fri, 13 Dec 2024 17:36:02 +0800 > Li Zhijian wrote: > >> This assertion always happens when we sanitize the CXL memory device. >> $ echo 1 > /sys/bus/cxl/devices/mem0/security/sanitize >> >> It is incorrect to register an MSIX number beyond the

[PATCH 3/8] hw/s390x/s390-stattrib: Remove the old migration_enabled flag

2025-01-14 Thread Thomas Huth
Now that the machine types that set the migration_enabled flag to false are gone, we can remove it and the related code. Signed-off-by: Thomas Huth --- include/hw/s390x/storage-attributes.h | 1 - hw/s390x/s390-stattrib-kvm.c | 2 +- hw/s390x/s390-stattrib.c | 7 +-- 3

[PATCH 4/8] hw/intc/s390_flic: Remove the obsolete migration_enabled flag

2025-01-14 Thread Thomas Huth
Now that the machine types that set the migration_enabled flag to false are gone, we can remove it and the related code. Signed-off-by: Thomas Huth --- include/hw/s390x/s390_flic.h | 1 - hw/intc/s390_flic.c | 14 -- 2 files changed, 15 deletions(-) diff --git a/include/hw

[PATCH 7/8] target/s390x/gen-features: Remove the v2.11 qemu CPU model

2025-01-14 Thread Thomas Huth
Now that the v2.11 machine is gone, we don't need the v2.11 CPU feature set anymore. Signed-off-by: Thomas Huth --- target/s390x/gen-features.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 41840677ce..150e4d1843 100644

[PATCH 6/8] hw/s390x/event-facility: Remove the obsolete "allow_all_mask_sizes" code

2025-01-14 Thread Thomas Huth
Now that the machine types 2.11 and older have been removed, we don't need the "allow_all_mask_sizes" compatibility handling code anymore and can remove it now. Signed-off-by: Thomas Huth --- hw/s390x/event-facility.c | 37 + 1 file changed, 1 insertion(+), 36

[PATCH 5/8] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.10 and 2.11 machine types

2025-01-14 Thread Thomas Huth
They are older than 6 years, so according to our machine support policy, they can be removed now. There was not anything special in the 2.10 machine type, so just remove it together with the 2.11 machine type. The 2.11 machine type switched some configuration that needs additional cleanups in the

[PATCH 8/8] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.12 machine type

2025-01-14 Thread Thomas Huth
The s390-ccw-virtio-2.12 machine is older than 6 years, so according to our machine support policy, it can be removed now. Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virti

[PATCH 1/8] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.9 machine type

2025-01-14 Thread Thomas Huth
The s390-ccw-virtio-2.9 machine is older than 6 years, so according to our machine support policy, it can be removed now. Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 24 1 file changed, 24 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s

[PATCH 0/8] s390x: Remove deprecated machine types v2.9 up to v2.12

2025-01-14 Thread Thomas Huth
These machine types have been marked as deprecated two releases ago, and are older than 6 years, so according to our support policy, it should be fine to remove them now. Thomas Huth (8): hw/s390x/s390-virtio-ccw: Remove the deprecated 2.9 machine type hw/s390x/css: Remove the obsolete "css_m

[PATCH 2/8] hw/s390x/css: Remove the obsolete "css_migration_enabled" variable

2025-01-14 Thread Thomas Huth
Now that the s390-ccw-virtio-2.9 machine type has been removed, we don't need the "css_migration_enabled" variable anymore and can remove the related code. Signed-off-by: Thomas Huth --- include/hw/s390x/css.h | 6 -- hw/s390x/css.c | 31 +-- 2 files chan

[PATCH] spapr: nested: Add support for reporting Hostwide state counter

2025-01-14 Thread Vaibhav Jain
Add support for reporting Hostwide state counters for nested KVM pseries guests running with 'cap-nested-hv' with Qemu-TCG acting as L0-hypervisor. sPAPR supports reporting various stats counters for Guest-Management-Area(GMA) thats owned by L0-Hypervisor and are documented at [1]. These stats coun

Re: [RFC 07/13] rust: add bindings for timer

2025-01-14 Thread Zhao Liu
On Tue, Jan 14, 2025 at 05:14:48PM +0100, Paolo Bonzini wrote: > Date: Tue, 14 Jan 2025 17:14:48 +0100 > From: Paolo Bonzini > Subject: Re: [RFC 07/13] rust: add bindings for timer > > On Tue, Jan 14, 2025 at 4:18 PM Zhao Liu wrote: > > ...Now I have a draft for timer binding: > > > > * timer bi

[PATCH v2 2/2] hw/riscv/riscv-iommu-bits: Remove duplicate definitions

2025-01-14 Thread Jason Chien
The header contains duplicate macro definitions. This commit eliminates the duplicate part. Signed-off-by: Jason Chien Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- hw/riscv/riscv-iommu-bits.h | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) d

[PATCH v2 1/2] hw/riscv/riscv-iommu: Remove redundant struct members

2025-01-14 Thread Jason Chien
Initially, the IOMMU would create a thread, but this thread was removed in the merged version. The struct members for thread control should have been removed as well, but they were not removed at that time. Signed-off-by: Jason Chien Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones

[PATCH] hw/nvme: Format Index Mismatch Protection

2025-01-14 Thread Arun Kumar
implement TP4140-(Format Index Mismatch Protection) Signed-off-by: Arun Kumar --- hw/nvme/ctrl.c | 35 ++- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 127c3d2383..46bf522754 100644 --- a/hw/nvme/ctrl.c +++ b

Re: [PATCH] plugins: fix -Werror=maybe-uninitialized false-positive

2025-01-14 Thread Marc-André Lureau
Hi On Tue, Jan 14, 2025 at 8:00 PM Pierrick Bouvier wrote: > > On 1/14/25 02:48, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > ../contrib/plugins/cache.c:638:9: error: ‘l2_cache’ may be used > > uninitialized [-Werror=maybe-uninitialized] > >638 | append_sta

[PATCH v3 2/2] tap: Use g_spawn_sync() and g_spawn_check_wait_status()

2025-01-14 Thread Akihiko Odaki
g_spawn_sync() gives an informative message if it fails to execute the script instead of reporting exiting status 1. g_spawn_check_wait_status() also gives an message easier to understand than the raw value returned by waitpid(). Signed-off-by: Akihiko Odaki Tested-by: Lei Yang --- net/tap.c |

[PATCH v3 0/2] tap: Use g_spawn_sync() and g_spawn_check_wait_status()

2025-01-14 Thread Akihiko Odaki
g_spawn_sync() gives an informative message if it fails to execute the script instead of reporting exiting status 1. g_spawn_check_wait_status() also gives an message easier to understand than the raw value returned by waitpid(). Signed-off-by: Akihiko Odaki --- Changes in v3: - Added GLIB_CHECK

[PATCH v3 1/2] glib-compat: Define g_spawn_check_wait_status()

2025-01-14 Thread Akihiko Odaki
g_spawn_check_exit_status() is renamed to g_spawn_check_wait_status() in 2.70. Signed-off-by: Akihiko Odaki Tested-by: Lei Yang --- include/glib-compat.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/glib-compat.h b/include/glib-compat.h index 86be439ba0ef..a553ba13a3

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-14 Thread Chenyi Qiang
On 1/15/2025 12:06 PM, Alexey Kardashevskiy wrote: > On 10/1/25 17:38, Chenyi Qiang wrote: >> >> >> On 1/10/2025 8:58 AM, Alexey Kardashevskiy wrote: >>> >>> >>> On 9/1/25 15:29, Chenyi Qiang wrote: On 1/9/2025 10:55 AM, Alexey Kardashevskiy wrote: > > > On 9/1/25 13:1

Re: [PATCH v2 2/2] tap: Use g_spawn_sync() and g_spawn_check_wait_status()

2025-01-14 Thread Akihiko Odaki
On 2025/01/06 18:34, Daniel P. Berrangé wrote: On Sat, Jan 04, 2025 at 05:04:08PM +0900, Akihiko Odaki wrote: g_spawn_sync() gives an informative message if it fails to execute the script instead of reporting exiting status 1. g_spawn_check_wait_status() also gives an message easier to understa

Re: [PATCH v2] hw/i386/cpu: remove default_cpu_version and simplify

2025-01-14 Thread Ani Sinha
On Thu, Dec 12, 2024 at 8:19 PM Ani Sinha wrote: > > commit 0788a56bd1ae3 ("i386: Make unversioned CPU models be aliases") > introduced 'default_cpu_version' for PCMachineClass. This created three > categories of CPU models: > - Most unversioned CPU models would use version 1 by default. > - For

Re: [PATCH 02/11] hw/mips/loongson3_virt: Keep reference of vCPUs in machine_init()

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: Keep references of all vCPUs created. That allows to directly access the first vCPU without using the &first_cpu global. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 9 + 1 file changed, 5 insertions(+), 4 deleti

Re: [PATCH 11/11] hw/mips/loongson3_bootp: Move to common_ss[]

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: loongson3_bootp.c doesn't contain any target-specific code and can be build generically, move it to common_ss[]. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH 10/11] hw/mips/loongson3_virt: Propagate %processor_id to init_boot_param()

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: Propagate %processor_id from mips_loongson3_virt_init() where we have a reference to the first vCPU, so use it instead of the &first_cpu global. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 7 +++ 1 file changed, 3 i

Re: [PATCH] tap-linux: Open ipvtap and macvtap

2025-01-14 Thread Akihiko Odaki
On 2025/01/13 11:59, Jason Wang wrote: On Sat, Jan 11, 2025 at 1:43 PM Akihiko Odaki wrote: Hi Jason, Can you check this patch again? I would like to have this if 1) it would be used by libvirt. or 2) there's no other way to do this I need this to make QEMU work with macvtap on mkosi,

Re: [PATCH 09/11] hw/mips/loongson3_virt: Propagate processor_id to init_loongson_params()

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: Remove one &first_cpu use in hw/mips/loongson3_bootp.c. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_bootp.h | 2 +- hw/mips/loongson3_bootp.c | 5 ++--- hw/mips/loongson3_virt.c | 1 + 3 files changed, 4 insertions(+), 4 dele

Re: [PATCH 08/11] hw/mips/loongson3_bootp: Propagate processor_id to init_cpu_info()

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_bootp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 07/11] hw/mips/loongson3_virt: Propagate cpu_count to init_boot_param()

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: Remove one use of the 'current_machine' global. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson r~ diff --git a/hw/mips/loongs

Re: [PATCH 06/11] hw/mips/loongson3: Propagate cpu_count to init_loongson_params()

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: Propagate the %cpu_count from the machine file, allowing to remove the "hw/boards.h" dependency (which is machine specific) from loongson3_bootp. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_bootp.h | 1 + hw/mips/loongson3_boot

Re: [PATCH 05/11] hw/mips/loongson3_bootp: Include missing headers

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: MemMapEntry is declared in "exec/hwaddr.h", cpu_to_le32() in "qemu/bswap.h". These headers are indirectly included via "cpu.h". Include them explicitly in order to avoid when removing "cpu.h": In file included from ../../hw/mips/loongson3_bootp.

Re: [PATCH 04/11] hw/mips/loongson3_virt: Pass CPU argument to get_cpu_freq_hz()

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: Pass the first vCPU as argument, allowing to remove another &first_cpu global use. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson

Re: [PATCH 03/11] hw/mips/loongson3_virt: Have fw_conf_init() access local loaderparams

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: 'loaderparams' is declared statically. Let fw_conf_init() access its 'cpu_freq' and 'ram_size' fields. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) Revie

Re: [PATCH 01/11] hw/mips/loongson3_virt: Factor generic_cpu_reset() out

2025-01-14 Thread Richard Henderson
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote: main_cpu_reset() is misleadingly named "main": it resets all vCPUs, with a special case for the first vCPU. Factor generic_cpu_reset() out of main_cpu_reset(), allowing to remove one &first_cpu use. Signed-off-by: Philippe Mathieu-Daudé --- hw/m

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-14 Thread Akihiko Odaki
On 2025/01/15 2:02, Peter Xu wrote: On Tue, Jan 14, 2025 at 05:43:09PM +0900, Akihiko Odaki wrote: memory_region_finalize() is not a function to tell the owner is leaving, but the memory region itself is being destroyed. It is when the lifecycle of the MR is the same as the owner. That holds

Re: [PATCH v6 1/7] tests: virt: Update expected ACPI tables for virt test

2025-01-14 Thread Ani Sinha
On Tue, Jan 14, 2025 at 11:16 PM Alireza Sanaee wrote: > > From: Yicong Yang > > Update the ACPI tables according to the acpi aml_build change, also > empty bios-tables-test-allowed-diff.h. Where is this part? That is the part where you empty bios-tables-test-allowed-diff.h.? You are supposed to

Re: [PATCH v3] feat: add loongarch page table walker support for debugger memory access

2025-01-14 Thread Miao Hao
On 2025/1/15 11:20, bibo mao wrote: Applied to loongarch-next with small modification with comments such as: target/loongarch: Add page table walker support for debugger usage When dump memory content with gva address, software page table walker is necessary to get responding gpa address. He

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-14 Thread Alexey Kardashevskiy
On 13/1/25 21:54, David Hildenbrand wrote: On 08.01.25 11:56, Chenyi Qiang wrote: On 1/8/2025 12:48 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: As the commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated discard") highlighted, some subsystems like V

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-14 Thread Alexey Kardashevskiy
On 10/1/25 17:38, Chenyi Qiang wrote: On 1/10/2025 8:58 AM, Alexey Kardashevskiy wrote: On 9/1/25 15:29, Chenyi Qiang wrote: On 1/9/2025 10:55 AM, Alexey Kardashevskiy wrote: On 9/1/25 13:11, Chenyi Qiang wrote: On 1/8/2025 7:20 PM, Alexey Kardashevskiy wrote: On 8/1/25 21:56, Ch

[PATCH v2] hw/intc/riscv_aplic: Remove redundant "hart_idx" masking

2025-01-14 Thread Huang Borong
Remove the redundant masking of "hart_idx", as the same operation is performed later during address calculation. This change impacts the "hart_idx" value in the final qemu_log_mask() call. The original "hart_idx" parameter should be used for logging to ensure accuracy, rather than the masked value

Re: [PATCH 0/7] Enable shared device assignment

2025-01-14 Thread Alexey Kardashevskiy
On 11/1/25 01:14, Jason Gunthorpe wrote: On Fri, Jan 10, 2025 at 02:45:39PM +0100, David Hildenbrand wrote: In your commit I read: "Implement the cut operation to be hitless, changes to the page table during cutting must cause zero disruption to any ongoing DMA. This is the expectation of the

Re: [PATCH v3] feat: add loongarch page table walker support for debugger memory access

2025-01-14 Thread bibo mao
Applied to loongarch-next with small modification with comments such as: target/loongarch: Add page table walker support for debugger usage When dump memory content with gva address, software page table walker is necessary to get responding gpa address. Here page table walker is added for debug

Re: [RFC 1/4] spdm-socket: add seperate send/recv functions

2025-01-14 Thread Alistair Francis
On Wed, Jan 8, 2025 at 12:04 AM Wilfred Mallawa via wrote: > > This is to support uni-directional transports such as SPDM > over Storage. As specified by the DMTF DSP0286. > > Signed-off-by: Wilfred Mallawa > --- > backends/spdm-socket.c | 25 + > include/system/spd

Re: [RFC 2/4] spdm: add spdm storage transport virtual header

2025-01-14 Thread Wilfred Mallawa
On Fri, 2025-01-10 at 10:04 +0100, Klaus Jensen wrote: > On Jan  7 15:29, Wilfred Mallawa via wrote: > > This header contains the transport encoding for an SPDM message > > that > > uses the SPDM over Storage transport as defined by the DMTF > > DSP0286. > > > > Signed-off-by: Wilfred Mallawa > >

Re: [RFC PATCH 2/5] system/memory: support unaligned access

2025-01-14 Thread Tomoyuki HIROSE
On 2025/01/11 0:08, Peter Xu wrote: On Fri, Jan 10, 2025 at 07:11:27PM +0900, Tomoyuki HIROSE wrote: MR implementation to be safe when unaligned accessing (current xHCI implementation does not handle unaligned accesses but the spec allows unaligned accesses). In addition, maybe it would be bett

Re: [ISSUE] memdev cannot be enabled after reboot due to failed dvsec range check [QEMU setup]

2025-01-14 Thread Zhijian Li (Fujitsu)
Cced QEMU, Hi Fan, I recalled we had a reboot issue[1] months ago I guess your issue was caused by some registers not reset during reboot. [1] https://lore.kernel.org/linux-cxl/20240409075846.85370-1-lizhij...@fujitsu.com/ On 15/01/2025 04:30, Fan Ni wrote: > Hi, > > Recently, while testing

[RFC PATCH] target/openrisc: Call cpu_openrisc_clock_init() in cpu_realize()

2025-01-14 Thread Philippe Mathieu-Daudé
OpenRISC timer is architecturally tied to the CPU. It doesn't belong to the machine init() code to instanciate it: move its creation when a vCPU is realized (after being created). Reported-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- hw/openrisc/openrisc_sim.c | 2 -- hw/openris

[PATCH 13/16] migration: Cleanup qemu_savevm_state_complete_precopy()

2025-01-14 Thread Peter Xu
Now qemu_savevm_state_complete_precopy() is never used in postcopy, clean it up as in_postcopy==false now unconditionally. Signed-off-by: Peter Xu --- migration/savevm.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/migration/savevm.c b/migration/savev

[PATCH 16/16] migration: Trivial cleanup on JSON writer of vmstate_save()

2025-01-14 Thread Peter Xu
Two small cleanups in the same section of vmstate_save(): - Check vmdesc before the "mixed null/non-null data in array" logic, to be crystal clear that it's only about the JSON writer, not the vmstate on its own in the migration stream. - Since we have is_null variable now, use that to re

[PATCH 09/16] migration: Drop cached migration state in migration_maybe_pause()

2025-01-14 Thread Peter Xu
I can't see why we must cache the state now after we avoided possible CANCEL race: that's the only thing I can think of that can modify the migration state concurrently with the migration thread itself. Make all the state updates to happen always, then we don't need to cache the state anymore. Si

[PATCH 08/16] migration: Adjust locking in migration_maybe_pause()

2025-01-14 Thread Peter Xu
In migration_maybe_pause() QEMU may yield BQL before waiting for a semaphore. However it yields the BQL too early, which logically gives it chance for the main thread to quickly take the BQL and modify the state to CANCELLING. To avoid such race condition from happening at all, always update the

[PATCH 12/16] migration: Unwrap qemu_savevm_state_complete_precopy() in postcopy

2025-01-14 Thread Peter Xu
Postcopy invokes qemu_savevm_state_complete_precopy() twice for a long time, and that caused way too much confusions. Let's clean this up and make postcopy easier to read. It's actually fairly straightforward: postcopy starts with saving non-postcopiable iterables, then later it saves again with

[PATCH 02/16] migration: Do not construct JSON description if suppressed

2025-01-14 Thread Peter Xu
QEMU machine has a property "suppress-vmdesc". When it is enabled, QEMU will stop attaching JSON VM description at the end of the precopy migration stream (postcopy is never affected because postcopy never attach that). However even if it's suppressed by the user, the source QEMU will still constr

[PATCH 00/16] migration: Switchover phase refactoring

2025-01-14 Thread Peter Xu
CI: https://gitlab.com/peterx/qemu/-/pipelines/1625266692 (note: warning is present on rust stuff, but shouldn't be relevant) This series refactors the migration switchover path quite a bit. I started this work initially to measure the JSON writer overhead, but then I decided to cleanup the s

[PATCH 11/16] migration: Notify COMPLETE once for postcopy

2025-01-14 Thread Peter Xu
Postcopy invokes qemu_savevm_state_complete_precopy() twice, that means it'll invoke COMPLETE notify twice.. also twice the tracepoints that marking precopy complete. Move that notification (along with the tracepoint) out to the caller, so that postcopy will only notify once right at the start of

[PATCH 01/16] migration: Remove postcopy implications in should_send_vmdesc()

2025-01-14 Thread Peter Xu
should_send_vmdesc() has a hack inside (which was not reflected in the function name) in that it tries to detect global postcopy state and that will affect the value to be returned. It's easier to keep the helper simple by only check the suppress-vmdesc property. Then: - On the sender side of

[PATCH 15/16] migration: Merge precopy/postcopy on switchover start

2025-01-14 Thread Peter Xu
Now after all the cleanups, finally we can merge the switchover startup phase into one single function for precopy/postcopy. Signed-off-by: Peter Xu --- migration/migration.c | 62 ++- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/migrati

[PATCH 14/16] migration: Always set DEVICE state

2025-01-14 Thread Peter Xu
DEVICE state was introduced back in 2017: https://lore.kernel.org/qemu-devel/20171020090556.18631-1-dgilb...@redhat.com/ Quote from Dave's cover letter, when the pre-switchover phase was enabled, the state transition looks like this: The precopy flow is: active->pre-switchover->device->compl

[PATCH 03/16] migration: Optimize postcopy on downtime by avoiding JSON writer

2025-01-14 Thread Peter Xu
postcopy_start() is the entry function that postcopy is destined to start. It also means QEMU source will not dump VM description, aka, the JSON writer is garbage now. We can leave that to be cleaned up when migration completes, however when with the JSON writer object being present, vmstate_save(

[PATCH 04/16] migration: Avoid two src-downtime-end tracepoints for postcopy

2025-01-14 Thread Peter Xu
Postcopy can trigger this tracepoint twice, while only the 1st one is valid. Avoid triggering the 2nd tracepoint just like what we do with recording the total downtime. Signed-off-by: Peter Xu --- migration/migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migrat

[PATCH 06/16] migration: Synchronize all CPU states only for non-iterable dump

2025-01-14 Thread Peter Xu
Do one shot cpu sync at qemu_savevm_state_complete_precopy_non_iterable(), instead of coding it separately in two places. Note that in the context of qemu_savevm_state_complete_precopy(), this patch is also an optimization for postcopy path, in that we can avoid sync cpu twice during switchover: b

[PATCH 07/16] migration: Adjust postcopy bandwidth during switchover

2025-01-14 Thread Peter Xu
Precopy uses unlimited bandwidth always during switchover, it makes sense because this is so critical and no one would like to throttle bandwidth during the VM blackout. OTOH, postcopy surprisingly didn't do that. There's one line that in the middle of the postcopy switchover it tries to switch t

[PATCH 05/16] migration: Drop inactivate_disk param in qemu_savevm_state_complete*

2025-01-14 Thread Peter Xu
This parameter is only used by one caller, which is the genuine precopy complete path (migration_completion_precopy). The parameter was introduced in a1fbe750fd ("migration: Fix race of image locking between src and dst") to make sure the inactivate will happen before EOF to make sure dest will al

[PATCH 10/16] migration: Take BQL slightly longer in postcopy_start()

2025-01-14 Thread Peter Xu
This paves way for some follow up patch to modify migration states at the end of postcopy_start(), which should better be with the BQL so that there's no way of concurrent cancellation. So we'll do something slightly more with BQL but they're really trivial, hopefully nothing will really chance wi

Re: [PATCH v2 10/37] system: propagate Error to gdbserver_start (and other device setups)

2025-01-14 Thread Ilya Leoshkevich
On Tue, 2025-01-14 at 11:37 +, Alex Bennée wrote: > This started as a clean-up to properly pass a Error handler to the > gdbserver_start so we could do the right thing for command line and > HMP invocations. > > Now that we have cleaned up foreach_device_config_or_exit() in > earlier > patches

Re: [RFC PATCH] tests/qtest/migration: Add cpu hotplug test

2025-01-14 Thread Peter Xu
On Tue, Jan 14, 2025 at 04:14:44PM -0500, Stefan Hajnoczi wrote: > On Tue, 14 Jan 2025 at 15:15, Peter Xu wrote: > > > > On Tue, Jan 14, 2025 at 02:28:46PM -0500, Stefan Hajnoczi wrote: > > > On Tue, 14 Jan 2025 at 09:15, Fabiano Rosas wrote: > > > > > > > > Stefan Hajnoczi writes: > > > > > > >

[PATCH] firmware: qemu_fw_cfg: constify 'struct bin_attribute'

2025-01-14 Thread Thomas Weißschuh
/* --- base-commit: 7f5b6a8ec18e3add4c74682f60b90c31bdf849f2 change-id: 20250114-sysfs-const-bin_attr-qemu_fw_cfg-fa4a95934904 Best regards, -- Thomas Weißschuh

Re: [PATCH V6 00/24] Live update: cpr-transfer

2025-01-14 Thread Steven Sistare
On 1/14/2025 4:14 PM, Steven Sistare wrote: On 1/14/2025 3:29 PM, Fabiano Rosas wrote: Hi Steve, The CI shows some issues, please take a look: https://gitlab.com/farosas/qemu/-/pipelines/1624984802 -- I will fix this bug in V7 tomorrow.  Same failure for each. cross-armhf-us

[PATCH] goldfish_rtc: Fix tick_offset migration

2025-01-14 Thread Rodrigo Dias Correa
Instead of migrating the raw tick_offset, goldfish_rtc migrates a recalculated value based on QEMU_CLOCK_VIRTUAL. As QEMU_CLOCK_VIRTUAL stands still across a save-and-restore cycle, the guest RTC becomes out of sync with the host RTC when the VM is restored. As described in the bug description, it

Re: [PATCH V6 00/24] Live update: cpr-transfer

2025-01-14 Thread Steven Sistare
On 1/14/2025 3:29 PM, Fabiano Rosas wrote: Hi Steve, The CI shows some issues, please take a look: https://gitlab.com/farosas/qemu/-/pipelines/1624984802 -- I will fix this bug in V7 tomorrow. Same failure for each. cross-armhf-user cross-i686-system cross-i686-tci cross-i68

Re: [RFC PATCH] tests/qtest/migration: Add cpu hotplug test

2025-01-14 Thread Stefan Hajnoczi
On Tue, 14 Jan 2025 at 15:15, Peter Xu wrote: > > On Tue, Jan 14, 2025 at 02:28:46PM -0500, Stefan Hajnoczi wrote: > > On Tue, 14 Jan 2025 at 09:15, Fabiano Rosas wrote: > > > > > > Stefan Hajnoczi writes: > > > > > > > On Mon, 13 Jan 2025 at 16:09, Fabiano Rosas wrote: > > > >> > > > >> Bug #2

Re: [PATCH 3/3] accel/tcg: Implement cpu_exec_reset_hold() on user emulation

2025-01-14 Thread Ilya Leoshkevich
On Fri, 2025-01-10 at 00:43 +0100, Ilya Leoshkevich wrote: > On Thu, 2025-01-02 at 19:25 +0100, Philippe Mathieu-Daudé wrote: > > Commit bb6cf6f0168 ("accel/tcg: Factor tcg_cpu_reset_hold() > > out") wanted to restrict tlb_flush() to system emulation, > > but inadvertently also restricted tcg_flush

Re: [PULL v2 00/55] Misc HW patches for 2025-01-12

2025-01-14 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH V6 00/24] Live update: cpr-transfer

2025-01-14 Thread Fabiano Rosas
Hi Steve, The CI shows some issues, please take a look: https://gitlab.com/farosas/qemu/-/pipelines/1624984802

Re: [RFC PATCH] tests/qtest/migration: Add cpu hotplug test

2025-01-14 Thread Peter Xu
On Tue, Jan 14, 2025 at 02:28:46PM -0500, Stefan Hajnoczi wrote: > On Tue, 14 Jan 2025 at 09:15, Fabiano Rosas wrote: > > > > Stefan Hajnoczi writes: > > > > > On Mon, 13 Jan 2025 at 16:09, Fabiano Rosas wrote: > > >> > > >> Bug #2594 is about a failure during migration after a cpu hotplug. Add

Re: [PATCH v1 1/5] linux-headers: NOTFORMERGE - placeholder uapi updates for AP config change

2025-01-14 Thread Eric Farman
On Tue, 2025-01-14 at 13:51 -0500, Rorie Reyes wrote: > On 1/8/25 2:29 AM, Cédric Le Goater wrote: > > Hello Rorie, > > > > On 1/7/25 19:43, Rorie Reyes wrote: > > > This patch adds enumeration constant VFIO_AP_CFG_CHG_IRQ_INDEX to > > > specify > > > an IRQ index for signaling that a change has

Re: [RFC PATCH] tests/qtest/migration: Add cpu hotplug test

2025-01-14 Thread Stefan Hajnoczi
On Tue, 14 Jan 2025 at 09:15, Fabiano Rosas wrote: > > Stefan Hajnoczi writes: > > > On Mon, 13 Jan 2025 at 16:09, Fabiano Rosas wrote: > >> > >> Bug #2594 is about a failure during migration after a cpu hotplug. Add > >> a test that covers that scenario. Start the source with -smp 2 and > >> de

[PATCH v6 3/6] bios-tables-test: prepare to change ARM ACPI virt PPTT

2025-01-14 Thread Alireza Sanaee via
Prepare to update `build_pptt` function to add cache description functionalities, thus add binaries in this patch. Signed-off-by: Alireza Sanaee --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/test

Re: [PATCH v7 1/2] memory: Update inline documentation

2025-01-14 Thread Peter Xu
On Tue, Jan 14, 2025 at 05:42:57PM +, Peter Maydell wrote: > On Tue, 14 Jan 2025 at 17:02, Peter Xu wrote: > > > > On Tue, Jan 14, 2025 at 05:43:09PM +0900, Akihiko Odaki wrote: > > > memory_region_finalize() is not a function to tell the owner is leaving, > > > but > > > the memory region it

[PATCH v2 06/23] docs/qapidoc: add transmogrifier stub

2025-01-14 Thread John Snow
This commit adds a stubbed option to the qapi-doc directive that opts-in to the new rST generator; the implementation of which will follow in subsequent commits. Once all QAPI documents have been converted, this option and the old qapidoc implementation can be dropped. Note that moving code outsi

[PATCH v2 13/23] docs/qapidoc: add visit_errors() method

2025-01-14 Thread John Snow
Notably, this method does not currently address the formatting issues present with the "errors" section in QAPIDoc and just vomits the text verbatim into the rST doc, with somewhat inconsistent results. To be addressed in a future revision. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py |

[PATCH v2 14/23] docs/qapidoc: add format_type() method

2025-01-14 Thread John Snow
This method is responsible for generating a type name for a given member with the correct annotations for the QAPI domain. Features and enums do not *have* types, so they return None. Everything else returns the type name with a "?" suffix if that type is optional, and ensconced in [brackets] if it

[PATCH v2 15/23] docs/qapidoc: add add_field() and generate_field() helper methods

2025-01-14 Thread John Snow
These are simple rST generation methods that assist in getting the types and formatting correct for a field list entry. add_field() is a more raw, direct call while generate_field() is intended to be used for generating the correct field from a member object. Signed-off-by: John Snow --- docs/sp

[PATCH v2 05/23] qapi/schema: add __repr__ to QAPIDoc.Section

2025-01-14 Thread John Snow
Makes debugging far more pleasant when you can just print(section) and get something reasonable to display. Signed-off-by: John Snow --- scripts/qapi/parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index c3004aa70c6..cb259c42a6d 10

[PATCH v2 19/23] docs/qapidoc: add visit_member() method

2025-01-14 Thread John Snow
This method is used for generating the "members" of a wide variety of things, including structs, unions, enums, alternates, etc. The field name it uses to do so is dependent on the type of entity the "member" belongs to. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 27 ++

[PATCH v2 16/23] docs/qapidoc: add visit_feature() method

2025-01-14 Thread John Snow
This adds a simple ":feat name: lorem ipsum ..." line to the generated rST document, so at the moment it's only for "top level" features. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 9 + 1 file changed, 9 insertions(+) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.

[PATCH v2 12/23] docs/qapidoc: add visit_paragraph() method

2025-01-14 Thread John Snow
This transforms "formerly known as untagged sections" into our pure intermediate rST format. These sections are already pure rST, so this method doesn't do a whole lot except ensure appropriate newlines. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 9 + 1 file changed, 9 inserti

[PATCH v2 4/4] target/riscv: add RVA23S64 profile

2025-01-14 Thread Daniel Henrique Barboza
Add RVA23S64 as described in [1]. This profile inherits all mandatory extensions of RVA23U64, making it a child of the U64 profile. A new "rva23s64" profile CPU is also added. This is the generated riscv,isa for it (taken via -M dumpdtb): rv64imafdcbvh_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_

[PATCH v2 09/23] qapi/source: allow multi-line QAPISourceInfo advancing

2025-01-14 Thread John Snow
This is for the sake of the new rST generator (the "transmogrifier") so we can advance multiple lines on occasion while keeping the generated<-->source mappings accurate. next_line now simply takes an optional n parameter which chooses the number of lines to advance. RFC: Here's the exorbitant de

[PATCH v2 23/23] docs/qapidoc: add transmogrifier test document

2025-01-14 Thread John Snow
Signed-off-by: John Snow --- docs/index.rst | 1 + docs/qapi/index.rst | 53 + 2 files changed, 54 insertions(+) create mode 100644 docs/qapi/index.rst diff --git a/docs/index.rst b/docs/index.rst index 0b9ee9901d9..11c18c598a8 100644 --- a/docs

[PATCH v2 07/23] docs/qapidoc: add transmogrifier class stub

2025-01-14 Thread John Snow
Add the beginnings of the Transmogrifier class by adding the rST conversion helpers that will be used to build the virtual rST document. This version of the class does not actually "do anything" yet; each individual feature is added one-at-a-time in the forthcoming commits. Signed-off-by: John Sn

[PATCH v2 1/4] target/riscv: add ssu64xl

2025-01-14 Thread Daniel Henrique Barboza
ssu64xl is defined in RVA22 as: "sstatus.UXL must be capable of holding the value 2 (i.e., UXLEN=64 must be supported)." This is always true in TCG and it's mandatory for RVA23, so claim support for it. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c| 1 + tests

[PATCH v2 2/4] target/riscv: use RVB in RVA22U64

2025-01-14 Thread Daniel Henrique Barboza
>From the time we added RVA22U64 until now the spec didn't declare 'RVB' as a dependency, using zba/zbb/zbs instead. Since then the RVA22 spec [1] added the following in the 'RVA22U64 Mandatory Extensions' section: "B Bit-manipulation instructions Note: The B extension comprises the Zba, Zbb, and

[PATCH v2 0/4] target/riscv: RVA23 profile support

2025-01-14 Thread Daniel Henrique Barboza
Hi, This version implements changes based on Drew's feedback from v1. Most notable change is the addition of zifencei in RVA23S64 that I somehow missed in v1. Patches based on alistair/riscv-to-apply.next. Changes from v1: - patch 2: - do not remove zba/zbb/zbs from the extension list - patch

[PATCH v2 00/23] docs: add basic sphinx-domain rST generator to qapidoc

2025-01-14 Thread John Snow
based-on: https://patchew.org/QEMU/20241213011307.2942030-1-js...@redhat.com/ Hi! This series is a very, very barebones implementation for the new QAPI doc generator. It does not have many features that I presented on at KVM Forum; the point of this patch set is instead to present a stripped down

[PATCH v2 17/23] docs/qapidoc: prepare to record entity being transmogrified

2025-01-14 Thread John Snow
Prepare to keep a record of which entity we're working on documenting for the purposes of being able to change certain generative features conditionally and create stronger assertions. If you find yourself asking: "Wait, but where does the current entity actually get recorded?!", you're right! Tha

[PATCH v2 10/23] docs/qapidoc: add visit_freeform() method

2025-01-14 Thread John Snow
Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 47 ++ 1 file changed, 47 insertions(+) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index 658eae3e386..c42cc3705aa 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sphinx/qapidoc.py @@ -1

[PATCH v2 18/23] docs/qapidoc: add visit_returns() method

2025-01-14 Thread John Snow
Generates :returns: fields for explicit returns statements. Note that this does not presently handle undocumented returns, which is handled in a later commit. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 14 ++ 1 file changed, 14 insertions(+) diff --git a/docs/sphinx/qapid

  1   2   3   >