[PATCH] qtest: migration: Add failure test for 'uri' and 'channels' combination in 'migrate' QAPI

2024-02-08 Thread Het Gala
Ensure failure occurs while adding validation test for 'uri' and 'channels' arguments used simultaneously in the 'migrate' QAPI command. Signed-off-by: Het Gala --- tests/qtest/migration-helpers.c | 14 ++-- tests/qtest/migration-helpers.h | 5 +-- tests/qtest/migration-test.c| 60

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-08 Thread Michael Tokarev
09.02.2024 00:21, Stefan Hajnoczi wrote: On Thu, 1 Feb 2024 at 06:37, Michael Tokarev wrote: for (;;) { -bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS); +bytes = MIN(size - offset, BDRV_REQUEST_MAX_BYTES); Hmm. This smells like a -stable material, but you know

Re: [PATCH v2 7/8] mips: allow compiling out CONFIG_MIPS_ITU

2024-02-08 Thread Philippe Mathieu-Daudé
On 8/2/24 09:26, Paolo Bonzini wrote: On Wed, Feb 7, 2024 at 8:12 PM Philippe Mathieu-Daudé wrote: Hi Paolo, On 7/2/24 12:14, Paolo Bonzini wrote: itc_reconfigure() is referenced from TCG, provide a stub if needed. This makes it possible to build a QEMU binary that only includes boards

Re: Unit Test Aborts when building with -ftrapv compiler option

2024-02-08 Thread Thomas Huth
On 08/02/2024 20.23, Richard Schmitt wrote: In an attempt to build qemu with hardened gcc compiler options, we specified the -ftrapv switch rather than the -fwrapv switch.  The switches define the behavior of integer overflows.  -ftrapv causes an abort on integer overflow, -fwrapv causes

[RFC PATCH v2 2/4] linux-user/riscv: Add Ssdtso extension to hwprobe

2024-02-08 Thread Christoph Müllner
This patch exposes Ssdtso via hwprobe in QEMU's user space emulator. Signed-off-by: Christoph Müllner --- linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 24fa11d946..bf0d66b8a8 100644 --- a/linux-user/syscall.c +++

[RFC PATCH v2 4/4] linux-user/riscv: Implement dynamic memory consistency model support

2024-02-08 Thread Christoph Müllner
This patch implements the dynamic memory consistency model prctl calls for RISC-V. The implementation introduces a single boolean variable to keep the DTSO state. Signed-off-by: Christoph Müllner --- linux-user/riscv/target_prctl.h | 76 - target/riscv/cpu.c

[RFC PATCH v2 1/4] RISC-V: Add support for Ssdtso

2024-02-08 Thread Christoph Müllner
The Ssdtso extension introduces a DTSO field to the {m,s,h}envcfg register to enable TSO at run-time. Building on top of Ztso support, this patch treats Ssdtso just like Ztso (always execute in TSO mode), which should be fine from a correctness perspective. Similar like Ztso, this is expected to

[RFC PATCH v2 0/4] RISC-V: Add dynamic TSO support

2024-02-08 Thread Christoph Müllner
The upcoming RISC-V Ssdtso specification introduces a bit in the senvcfg CSR to switch the memory consistency model of user mode at run-time from RVWMO to TSO. The active consistency model can therefore be switched on a per-hart base and managed by the kernel on a per-process base. This patch

[RFC PATCH v2 3/4] linux-user/prctl: Add dynamic memory consistency model prctl API

2024-02-08 Thread Christoph Müllner
This patch implements the prctl calls to set and get the current memory consistency model. This patch does not implement any real functionality but just defines the relevant hooks, where target code take over. Signed-off-by: Christoph Müllner --- linux-user/syscall.c | 17 + 1

Re: [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
On 8/2/24 19:33, BALATON Zoltan wrote: On Thu, 8 Feb 2024, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

[PATCH] MAINTAINERS: Update Aleksandar Rikalo email

2024-02-08 Thread Aleksandar Rikalo
Syrmia LLC has been acquired recently and the syrmia.com domain will disappear soon, so updating my email in the MAINTAINERS file. Signed-off-by: Aleksandar Rikalo --- MAINTAINERS | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index

Re: [External] [PATCH v2 05/23] migration/multifd: Drop MultiFDSendParams.normal[] array

2024-02-08 Thread Hao Xiang
On Fri, Feb 2, 2024 at 2:30 AM wrote: > > From: Peter Xu > > This array is redundant when p->pages exists. Now we extended the life of > p->pages to the whole period where pending_job is set, it should be safe to > always use p->pages->offset[] rather than p->normal[]. Drop the array. > >

[PATCH] qemu-options.hx: Add zoom-to-fit to option summary for gtk

2024-02-08 Thread BALATON Zoltan
The detailed help lists zoom-to-fit as valid option but it is missing from the short option summary. Add it there too. Signed-off-by: BALATON Zoltan --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index

[PATCH] system: Move memory_ldst.c.inc to system

2024-02-08 Thread BALATON Zoltan
This file is only used by system/physmem.c so move them together. Signed-off-by: BALATON Zoltan --- memory_ldst.c.inc => system/memory_ldst.c.inc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename memory_ldst.c.inc => system/memory_ldst.c.inc (100%) diff --git a/memory_ldst.c.inc

[PATCH 6/9] hw/i386/pc: Confine system flash handling to pc_sysfw

2024-02-08 Thread Bernhard Beschow
Rather than distributing PC system flash handling across three files, let's confine it to one. Now, pc_system_firmware_init() creates, configures and cleans up the system flash which makes the code easier to understand. It also avoids the extra call to pc_system_flash_cleanup_unused() in the Xen

[PATCH 8/9] hw/i386/pc: Populate RTC attribute directly

2024-02-08 Thread Bernhard Beschow
Both the piix and the q35 machines introduce an rtc_state variable and defer the initialization of the X86MachineState::rtc attribute to pc_cmos_init(). Resolve this complication which makes pc_cmos_init() do what it says on the tin. Signed-off-by: Bernhard Beschow --- hw/i386/pc.c | 8

[PATCH 5/9] hw/i386/pc: Defer smbios_set_defaults() to machine_done

2024-02-08 Thread Bernhard Beschow
Handling most of smbios data generation in the machine_done notifier is similar to how the ARM virt machine handles it which also calls smbios_set_defaults() there. The result is that all pc machines are freed from explicitly worrying about smbios setup. Signed-off-by: Bernhard Beschow ---

[PATCH 3/9] hw/i386/x86: Turn apic_xrupt_override into class attribute

2024-02-08 Thread Bernhard Beschow
The attribute isn't user-changeable and only true for pc-based machines. Turn it into a class attribute which allows for inlining pc_guest_info_init() into pc_machine_initfn(). Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 3 ++- hw/i386/acpi-common.c | 3 ++- hw/i386/pc.c

[PATCH 0/9] Simplify initialization of PC machines

2024-02-08 Thread Bernhard Beschow
The series aims to simplify the initialization process of all PC-based machines. It consists of streamlining redundant code, as well as consolidating the setup of system flash and generation of smbios data which are currently fairly distributed. These changes are expected to make the code easier

[PATCH 9/9] hw/i386/pc_{piix, q35}: Eliminate local pci_bus/pci_host variables

2024-02-08 Thread Bernhard Beschow
There is no advantage in having these local variables which 1/ needlessly have different identifiers in both machines and 2/ which are redundant to pcms->bus which is almost as short. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 14 ++ hw/i386/pc_q35.c | 16

[PATCH 2/9] hw/i386/pc_piix: Share pc_cmos_init() invocation between pc and isapc machines

2024-02-08 Thread Bernhard Beschow
Both invocations are the same and either one is always executed. Avoid this redundancy. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5ed3d69181..adb3b5ed43 100644 ---

[PATCH 1/9] hw/i386/x86: Let ioapic_init_gsi() take parent as pointer

2024-02-08 Thread Bernhard Beschow
Rather than taking a QOM name which has to be resolved, let's pass the parent directly as pointer. This simplifies the code. Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 2 +- hw/i386/microvm.c | 2 +- hw/i386/pc_piix.c | 7 +++ hw/i386/pc_q35.c | 4 ++--

[PATCH 7/9] hw/i386/pc_sysfw: Inline pc_system_flash_create() and remove it

2024-02-08 Thread Bernhard Beschow
pc_system_flash_create() checked for pcmc->pci_enabled which is redundant since its caller already checked it. The method can be turned into just two lines, so inline and remove it. Signed-off-by: Bernhard Beschow --- hw/i386/pc_sysfw.c | 15 ++- 1 file changed, 2 insertions(+), 13

[PATCH 4/9] hw/i386/pc: Merge pc_guest_info_init() into pc_machine_initfn()

2024-02-08 Thread Bernhard Beschow
Resolves redundant code in the piix and q35 machines. Signed-off-by: Bernhard Beschow --- include/hw/i386/pc.h | 2 -- hw/i386/pc.c | 9 +++-- hw/i386/pc_piix.c| 2 -- hw/i386/pc_q35.c | 2 -- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git

Unit Test Aborts when building with -ftrapv compiler option

2024-02-08 Thread Richard Schmitt
In an attempt to build qemu with hardened gcc compiler options, we specified the -ftrapv switch rather than the -fwrapv switch. The switches define the behavior of integer overflows. -ftrapv causes an abort on integer overflow, -fwrapv causes overflows to simply wrap without any error

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-08 Thread Stefan Hajnoczi
On Thu, 1 Feb 2024 at 06:37, Michael Tokarev wrote: > > 30.01.2024 03:27, Stefan Hajnoczi wrote: > > The following expression is incorrect because blk_pread_nonzeroes() > > deals in units of bytes, not sectors: > > > >bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) > >

Re: [PATCH 12/13] target/hppa: Update SeaBIOS-hppa to version 16

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: From: Helge Deller SeaBIOS-hppa version 16 news & enhancements: - Initial 64-bit firmware release - Added fault handler to catch and report firmware bugs - Use Qemu's builtin_console_out() via diag 0x101 - parisc-qemu-install Makefile target to install

Re: [PATCH 13/13] hw/hppa/machine: Load 64-bit firmware on 64-bit machines

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: From: Helge Deller Load the 64-bit SeaBIOS-hppa firmware by default when running on a 64-bit machine. This will enable us to later support more than 4GB of RAM and is required that the OS (or PALO bootloader) will start or install a 64-bit kernel

Re: [PATCH 11/13] target/hppa: PDC_BTLB_INFO uses 32-bit ints

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: From: Helge Deller The BTLB helper function stores the BTLB info (four 32-bit ints) into the memory of the guest. They are only available when emulating a 32-bit CPU in the guest, so use "uint32_t" instead of "target_ulong" here. Signed-off-by: Helge

Re: [PATCH 0/2] block: Allow concurrent BB context changes

2024-02-08 Thread Stefan Hajnoczi
On Wed, 7 Feb 2024 at 04:36, Hanna Czenczek wrote: > > On 06.02.24 17:53, Stefan Hajnoczi wrote: > > On Fri, Feb 02, 2024 at 03:47:53PM +0100, Hanna Czenczek wrote: > > Hi, > > Without the AioContext lock, a BB's context may kind of change at any > time (unless it has a root node, and I/O

Re: [PATCH 10/13] target/hppa: Check privilege only when PSW.P is set

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: From: Helge Deller CHECK_MOST_PRIVILEGED() should check the privilege level only when the PSW.P bit is set. Signed-off-by: Helge Deller --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 09/13] target/hppa: Allow read-access to PSW with rsm 0,reg instruction

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: From: Helge Deller HP-UX 11 and HP ODE tools use the "rsm 0,%reg" instruction in not priviledged code paths to get the current PSW flags. The constant 0 means that no bits of the PSW shall be reset, so this is effectively a read-only access to the PSW.

Re: [PATCH 05/13] hw/pci-host/astro: Implement Hard Fail and Soft Fail mode

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: From: Helge Deller The Astro/Elroy chip can work in either Hard-Fail or Soft-Fail mode. Hard fail means the system bus will send an HPMC (=crash) to the processor, soft fail means the system bus will ignore timeouts of MMIO-reads or MMIO-writes and

Re: [PATCH 04/13] hw/pci-host/astro: Avoid aborting on access failure

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: @@ -610,6 +607,7 @@ static MemTxResult astro_chip_write_with_attrs(void *opaque, hwaddr addr, uint64_t val, unsigned size, MemTxAttrs attrs) { +

Re: [PATCH 03/13] target/hppa: Fix PSW_W and PSW_E bits in rsm, ssm and mtsm

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: #define PSW_E0x0400 +#define PSW_E_BIT37 /* PA2.0 only */ #define PSW_W0x0800 /* PA2.0 only */ +#define PSW_W_BIT36 /* PA2.0 only */ ... +target_ulong

Re: [PATCH 02/13] target/hppa: Add "diag 0x101" for console output support

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: @@ -484,3 +486,33 @@ uint64_t HELPER(hshradd)(uint64_t r1, uint64_t r2, uint32_t sh) } return ret; } + +/* + * diag_console_output() is a helper function used during the initial bootup + * process of the SeaBIOS-hppa firmware. During the

Re: [PATCH 01/13] disas/hppa: Add disassembly for qemu specific instructions

2024-02-08 Thread Richard Henderson
On 2/7/24 08:20, del...@kernel.org wrote: From: Helge Deller Add disassembly of opcodes for "HALT QEMU", "RESET QEMU" and "RESTORE SHR" (restore shadow registers). Signed-off-by: Helge Deller --- disas/hppa.c | 4 1 file changed, 4 insertions(+) Reviewed-by: Richard Henderson r~

Re: migration-test random intermittent failure, openbsd VM

2024-02-08 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:04, Fabiano Rosas wrote: > > Peter Maydell writes: > > +cc Daniel. > > > Random intermittent in migration-test when running the tests > > in the openbsd VM (i.e. what you get from 'make -C build vm-build-openbsd') > > Any ideas? > > Where's your HEAD at? 03e4bc0bc02 in

Re: [PULL v2 00/39] tcg patch queue

2024-02-08 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:22, Richard Henderson wrote: > > v2: Fix rebase error in patch 38 (tcg/s390x: Support TCG_COND_TST{EQ,NE}). > > > r~ > > > The following changes since commit 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440: > > Merge tag 'pull-qapi-2024-02-03' of https://repo.or.cz/qemu/armbru

Re: [PATCH v3 2/6] util/bufferiszero: introduce an inline wrapper

2024-02-08 Thread Richard Henderson
On 2/6/24 21:13, Alexander Monakov wrote: Thank you. I agree we shouldn't penalize non-x86 hosts here, but to be honest I'd really like to keep this optimization because so many places in Qemu invoke buffer_is_zero with a constant length, allowing the compiler to optimize out the length test.

[PATCH v6 1/6] linux-headers: drop pvpanic.h

2024-02-08 Thread Thomas Weißschuh
misc/pvpanic.h from the Linux UAPI does not define a Linux UAPI but a qemu device API. This leads to a weird process when updates to the interface are needed: 1) Change to the specification in the qemu tree 2) Change to the header in the Linux tree 3) Re-import of the header into Qemu. The

[PATCH v6 4/6] hw/misc/pvpanic: add support for normal shutdowns

2024-02-08 Thread Thomas Weißschuh
Shutdown requests are normally hardware dependent. By extending pvpanic to also handle shutdown requests, guests can submit such requests with an easily implementable and cross-platform mechanism. Acked-by: Cornelia Huck Signed-off-by: Thomas Weißschuh --- docs/specs/pvpanic.rst| 2 ++

[PATCH v6 5/6] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal

2024-02-08 Thread Thomas Weißschuh
From: Alejandro Jimenez Emit a QMP event on receiving a PVPANIC_SHUTDOWN event. Even though a typical SHUTDOWN event will be sent, it will be indistinguishable from a shutdown originating from other cases (e.g. KVM exit due to KVM_SYSTEM_EVENT_SHUTDOWN) that also issue the guest-shutdown cause.

[PATCH v6 2/6] hw/misc/pvpanic: centralize definition of supported events

2024-02-08 Thread Thomas Weißschuh
The different components of pvpanic duplicate the list of supported events. Move it to the shared header file to minimize changes when new events are added. Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Thomas Weißschuh --- hw/misc/pvpanic-isa.c | 2 +-

[PATCH v6 3/6] tests/qtest/pvpanic: use centralized definition of supported events

2024-02-08 Thread Thomas Weißschuh
Avoid the necessity to update all tests when new events are added to the device. Acked-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Thomas Weißschuh --- tests/qtest/pvpanic-pci-test.c | 5 +++-- tests/qtest/pvpanic-test.c | 5 +++-- 2 files changed, 6 insertions(+), 4

[PATCH v6 0/6] hw/misc/pvpanic: add support for normal shutdowns

2024-02-08 Thread Thomas Weißschuh
Shutdown requests are normally hardware dependent. By extending pvpanic to also handle shutdown requests, guests can submit such requests with an easily implementable and cross-platform mechanism. The background is the usage of minimal Linux kernels with different architectures for testing

[PATCH v6 6/6] tests/qtest/pvpanic: add tests for pvshutdown event

2024-02-08 Thread Thomas Weißschuh
Validate that a shutdown via the pvpanic device emits the correct QMP events. Signed-off-by: Thomas Weißschuh Reviewed-by: Thomas Huth --- tests/qtest/pvpanic-pci-test.c | 39 +++ tests/qtest/pvpanic-test.c | 29 + 2 files

[PATCH v3 1/1] tests/qtest: Fixing GMAC test to run in 7xx

2024-02-08 Thread Nabih Estefan
Fixing the nocm_gmac-test.c file to run on a nuvoton 7xx machine instead of 8xx. Also fixing comments referencing this and values expecting 8xx. Change-Id: Iabd0fba14910c3f1e883c4a9521350f3db9ffab8 Signed-Off-By: Nabih Estefan Reviewed-by: Tyrone Ting --- tests/qtest/meson.build | 4 +-

[PATCH v3 0/1] Sending small fix for NPCM GMAC test to properly test on Nuvoton 7xx

2024-02-08 Thread Nabih Estefan
Accidentally added extra file to v2 that broke email sending (and was not meant to be upstreamed). Sending our v3 to skip that confusion. Removing testing for PCS registers since that doesn't exist on 7xx. Nabih Estefan (1): tests/qtest: Fixing GMAC test to run in 7xx tests/qtest/meson.build

[PATCH v2 0/1] Sending small fix for NPCM GMAC test to properly test on Nuvoton 7xx

2024-02-08 Thread Nabih Estefan
Removing testing for PCS registers since that doesn't exist on 7xx. Nabih Estefan (1): tests/qtest: Fixing GMAC test to run in 7xx obmc-phosphor-image-gsj.static.mtd | Bin 0 -> 33554432 bytes tests/qtest/meson.build| 4 +- tests/qtest/npcm_gmac-test.c | 84

Re: [PATCH v2] target/riscv: Update $ra with current $pc in trans_cm_jalt()

2024-02-08 Thread Richard Henderson
On 2/6/24 22:18, Jason Chien wrote: The original implementation sets $pc to the address read from the jump vector table first and links $ra with the address of the next instruction after the updated $pc. After jumping to the updated $pc and executing the next ret instruction, the program jumps

[PATCH v2 0/1] Sending small fix for NPCM GMAC test to properly test on Nuvoton 7xx

2024-02-08 Thread Nabih Estefan
Removing testing for PCS registers since that doesn't exist on 7xx. Nabih Estefan (1): tests/qtest: Fixing GMAC test to run in 7xx obmc-phosphor-image-gsj.static.mtd | Bin 0 -> 33554432 bytes tests/qtest/meson.build| 4 +- tests/qtest/npcm_gmac-test.c | 84

Re: [PATCH v3 8/9] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents

2024-02-08 Thread fan
On Wed, Jan 24, 2024 at 04:50:04PM +, Jonathan Cameron wrote: > On Tue, 7 Nov 2023 10:07:12 -0800 > nifan@gmail.com wrote: > > > From: Fan Ni > > > > Since fabric manager emulation is not supported yet, the change implements > > the functions to add/release dynamic capacity extents as

Re: [External] Re: [PATCH 3/6] migration/multifd: Support for zero pages transmission in multifd format.

2024-02-08 Thread Hao Xiang
On Tue, Feb 6, 2024 at 8:25 PM Peter Xu wrote: > > On Tue, Feb 06, 2024 at 11:19:05PM +, Hao Xiang wrote: > > diff --git a/migration/multifd.c b/migration/multifd.c > > index 25cbc6dc6b..a20d0ed10e 100644 > > --- a/migration/multifd.c > > +++ b/migration/multifd.c > > @@ -264,6 +264,7 @@

[PATCH V3 00/13] allow cpr-reboot for vfio

2024-02-08 Thread Steve Sistare
Allow cpr-reboot for vfio if the guest is in the suspended runstate. The guest drivers' suspend methods flush outstanding requests and re-initialize the devices, and thus there is no device state to save and restore. The user is responsible for suspending the guest before initiating cpr, such as

[PATCH V3 13/13] migration: update cpr-reboot description

2024-02-08 Thread Steve Sistare
Clarify qapi for cpr-reboot migration mode, and add vfio support. Signed-off-by: Steve Sistare --- qapi/migration.json | 36 +++- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index 8197083..c83e0c0

[PATCH V3 07/13] migration: per-mode notifiers

2024-02-08 Thread Steve Sistare
Keep a separate list of migration notifiers for each migration mode. Suggested-by: Peter Xu Signed-off-by: Steve Sistare --- include/migration/misc.h | 2 ++ migration/migration.c| 22 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git

[PATCH V3 08/13] migration: refactor migrate_fd_connect failures

2024-02-08 Thread Steve Sistare
Move common code for the error path in migrate_fd_connect to a shared fail label. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- migration/migration.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/migration/migration.c

[PATCH V3 09/13] migration: notifier error checking

2024-02-08 Thread Steve Sistare
Check the status returned by migration notifiers and report errors. If notifiers fail, call the notifiers again so they can clean up. None of the notifiers return an error status at this time. Signed-off-by: Steve Sistare --- include/migration/misc.h | 3 ++- migration/migration.c| 40

[PATCH V3 02/13] migration: remove error from notifier data

2024-02-08 Thread Steve Sistare
Remove the error object from opaque data passed to notifiers. Use the new error parameter passed to the notifier instead. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- hw/virtio/vhost-user.c | 8 include/migration/misc.h | 1 - migration/postcopy-ram.c | 1 -

[PATCH V3 05/13] migration: remove postcopy_after_devices

2024-02-08 Thread Steve Sistare
postcopy_after_devices and migration_in_postcopy_after_devices are no longer used, so delete them. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 - migration/migration.c| 7 --- migration/migration.h| 2 -- 3 files changed, 10 deletions(-) diff --git

[PATCH V3 12/13] vfio: allow cpr-reboot migration if suspended

2024-02-08 Thread Steve Sistare
Allow cpr-reboot for vfio if the guest is in the suspended runstate. The guest drivers' suspend methods flush outstanding requests and re-initialize the devices, and thus there is no device state to save and restore. The user is responsible for suspending the guest before initiating cpr, such as

[PATCH V3 10/13] migration: stop vm for cpr

2024-02-08 Thread Steve Sistare
When migration for cpr is initiated, stop the vm and set state RUN_STATE_FINISH_MIGRATE before ram is saved. This eliminates the possibility of ram and device state being out of sync, and guarantees that a guest in the suspended state remains suspended, because qmp_cont rejects a cont command in

[PATCH V3 01/13] notify: pass error to notifier with return

2024-02-08 Thread Steve Sistare
Pass an error object as the third parameter to "notifier with return" notifiers, so clients no longer need to bundle an error object in the opaque data. The new parameter is used in a later patch. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- hw/virtio/vhost-user.c | 2 +-

[PATCH V3 11/13] vfio: register container for cpr

2024-02-08 Thread Steve Sistare
Define entry points to perform per-container cpr-specific initialization and teardown. Signed-off-by: Steve Sistare --- hw/vfio/container.c | 11 ++- hw/vfio/cpr.c | 19 +++ hw/vfio/iommufd.c | 6 ++ hw/vfio/meson.build

[PATCH V3 03/13] migration: convert to NotifierWithReturn

2024-02-08 Thread Steve Sistare
Change all migration notifiers to type NotifierWithReturn, so notifiers can return an error status in a future patch. For now, pass NULL for the notifier error parameter, and do not check the return value. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- hw/net/virtio-net.c|

[PATCH V3 06/13] migration: MigrationNotifyFunc

2024-02-08 Thread Steve Sistare
Define MigrationNotifyFunc to improve type safety and simplify migration notifiers. Signed-off-by: Steve Sistare --- hw/net/virtio-net.c | 4 +--- hw/vfio/migration.c | 3 +-- include/migration/misc.h | 7 ++- migration/migration.c| 4 ++-- net/vhost-vdpa.c | 6 ++

[PATCH V3 04/13] migration: MigrationEvent for notifiers

2024-02-08 Thread Steve Sistare
Passing MigrationState to notifiers is unsound because they could access unstable migration state internals or even modify the state. Instead, pass the minimal info needed in a new MigrationEvent struct, which could be extended in the future if needed. Suggested-by: Peter Xu Signed-off-by:

Re: [PATCH] kvm: emit GUEST_PANICKED event in case of abnormal KVM exit

2024-02-08 Thread Andrey Drobyshev
On 1/25/24 18:36, Andrey Drobyshev wrote: > On 1/11/24 15:15, Andrey Drobyshev wrote: >> On 11/1/23 18:13, Denis V. Lunev wrote: >>> On 11/1/23 16:23, Andrey Drobyshev wrote: Currently we emit GUEST_PANICKED event in case kvm_vcpu_ioctl() returns KVM_EXIT_SYSTEM_EVENT with the event type

Re: [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-08 Thread BALATON Zoltan
On Thu, 8 Feb 2024, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index

Re: [PATCH] block: allocate aligned write buffer for 'truncate -m full'

2024-02-08 Thread Andrey Drobyshev
On 1/25/24 18:46, Vladimir Sementsov-Ogievskiy wrote: > On 11.12.23 13:55, Andrey Drobyshev wrote: >> In case we're truncating an image opened with O_DIRECT, we might get >> -EINVAL on write with unaligned buffer.  In particular, when running >> iotests/298 with '-nocache' we get: >> >> qemu-io:

Re: [PATCH v3 04/11] hw/i386/pc_q35: Realize LPC PCI function before accessing it

2024-02-08 Thread BALATON Zoltan
On Thu, 8 Feb 2024, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7ca3f465e0..f67e5a55df 100644

Re: [RFC PATCH 0/5] QEMU v7.2.0 aarch64 Nested Virtualization Support

2024-02-08 Thread Eric Auger
Hi Miguel, On 2/8/24 18:33, Miguel Luis wrote: > Hi Eric, > >> On 8 Feb 2024, at 15:55, Eric Auger wrote: >> >> Hi Miguel, >> >> On 2/27/23 17:37, Miguel Luis wrote: >>> This series adds ARMv8.3/8.4 nested virtualization support in KVM mode. >>> >>> To enable nested virtualization for a guest,

Re: [PATCH 08/13] hw/arm/mps3r: Initial skeleton for mps3-an536 board

2024-02-08 Thread Philippe Mathieu-Daudé
On 8/2/24 18:07, Cédric Le Goater wrote: +/* + * The MPS3 DDR is 3GiB, but on a 32-bit host QEMU doesn't permit + * emulation of that much guest RAM, so artificially make it smaller. + */ +#if HOST_LONG_BITS == 32 +#define MPS3_DDR_SIZE (1 * GiB) +#else +#define MPS3_DDR_SIZE (3 * GiB) +#endif

Re: migration-test random intermittent failure, openbsd VM

2024-02-08 Thread Daniel P . Berrangé
On Thu, Feb 08, 2024 at 03:04:23PM -0300, Fabiano Rosas wrote: > Peter Maydell writes: > > +cc Daniel. > > > Random intermittent in migration-test when running the tests > > in the openbsd VM (i.e. what you get from 'make -C build vm-build-openbsd') > > Any ideas? > > Where's your HEAD at? >

[PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/leon3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 2dfb742566..0df5fc949d 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c

[PATCH v3 07/11] hw/sh4/r2d: Realize IDE controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sh4/r2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index e9f316a6ce..c73e8f49b8 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -285,9 +285,9 @@

[PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-08 Thread Philippe Mathieu-Daudé
Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc64/sparc64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index

[PATCH v3 05/11] hw/ppc/prep: Realize ISA bridge before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/prep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 1a6cd05c61..4eb5477069 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -278,9 +278,9 @@

[PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/sun4m.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index e782c8ec7a..d52e6a7213 100644 --- a/hw/sparc/sun4m.c +++

[PATCH v3 04/11] hw/i386/pc_q35: Realize LPC PCI function before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7ca3f465e0..f67e5a55df 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@

[PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices

2024-02-08 Thread Philippe Mathieu-Daudé
Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/leon3.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index

[PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index c9f22f8515..db662a2065 100644 --- a/hw/misc/macio/macio.c

[PATCH v3 03/11] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary

2024-02-08 Thread Philippe Mathieu-Daudé
Instead of filling an array of all the possible IRQs, only call qdev_get_gpio_in() when an IRQ is used. Remove the array from RX62NState. Doing so we avoid calling qdev_get_gpio_in() on an unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/rx/rx62n.h | 1 - hw/rx/rx62n.c

[PATCH v3 02/11] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h'

2024-02-08 Thread Philippe Mathieu-Daudé
"qemu/units.h" is not used in the "hw/rx/rx62n.h" header, include it in the source where it is. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/rx/rx62n.h | 1 - hw/rx/rx-gdbsim.c | 1 + hw/rx/rx62n.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v3 01/11] hw/ide/ich9: Use AHCIPCIState typedef

2024-02-08 Thread Philippe Mathieu-Daudé
QEMU coding style recommend using structure typedefs: https://www.qemu.org/docs/master/devel/style.html#typedefs Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ich.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index

[PATCH v3 00/11] hw: Strengthen SysBus & QBus API

2024-02-08 Thread Philippe Mathieu-Daudé
Hi, This series ensure following is called *before* a device is realized: - qbus_new() - sysbus_init_mmio() - qdev_init_gpio_in_named_with_opaque() and these are called *after* it is: - sysbus_mmio_map() - sysbus_connect_irq(), - qdev_connect_gpio_out() - qdev_connect_gpio_out_named() Patches

Re: [PATCH 09/88] esp: update TC check logic in do_dma_pdma_cb() to check for TC == 0

2024-02-08 Thread Paolo Bonzini
On Thu, Feb 8, 2024 at 10:46 AM Mark Cave-Ayland wrote: > > On 01/02/2024 11:36, Paolo Bonzini wrote: > > > Il gio 1 feb 2024, 12:25 Mark Cave-Ayland > > ha scritto: > > > > On 01/02/2024 10:46, Paolo Bonzini wrote: > > > > > On Fri, Jan 12, 2024 at

Re: migration-test random intermittent failure, openbsd VM

2024-02-08 Thread Fabiano Rosas
Peter Maydell writes: +cc Daniel. > Random intermittent in migration-test when running the tests > in the openbsd VM (i.e. what you get from 'make -C build vm-build-openbsd') > Any ideas? Where's your HEAD at? > > 106/847 qemu:qtest+qtest-x86_64 / qtest-x86_64/migration-test >

Re: [PATCH] target/arm: Don't get MDCR_EL2 in pmu_counter_enabled() before checking ARM_FEATURE_PMU

2024-02-08 Thread Philippe Mathieu-Daudé
On 8/2/24 16:33, Peter Maydell wrote: It doesn't make sense to read the value of MDCR_EL2 on a non-A-profile CPU, and in fact if you try to do it we will assert: #6 0x74b95e96 in __GI___assert_fail (assertion=0x565a8c70 "!arm_feature(env, ARM_FEATURE_M)", file=0x565a6e5c

Re: [RFC PATCH 0/5] QEMU v7.2.0 aarch64 Nested Virtualization Support

2024-02-08 Thread Miguel Luis
Hi Eric, > On 8 Feb 2024, at 15:55, Eric Auger wrote: > > Hi Miguel, > > On 2/27/23 17:37, Miguel Luis wrote: >> This series adds ARMv8.3/8.4 nested virtualization support in KVM mode. >> >> To enable nested virtualization for a guest, the host must expose EL2 >> support via QEMU command line

Re: [PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-08 Thread Eugenio Perez Martin
On Wed, Feb 7, 2024 at 11:18 AM Kevin Wolf wrote: > > Am 06.02.2024 um 17:44 hat Eugenio Perez Martin geschrieben: > > On Mon, Feb 5, 2024 at 2:49 PM Kevin Wolf wrote: > > > > > > Am 05.02.2024 um 13:22 hat Eugenio Perez Martin geschrieben: > > > > On Fri, Feb 2, 2024 at 2:25 PM Kevin Wolf

migration-test random intermittent failure, openbsd VM

2024-02-08 Thread Peter Maydell
Random intermittent in migration-test when running the tests in the openbsd VM (i.e. what you get from 'make -C build vm-build-openbsd') Any ideas? 106/847 qemu:qtest+qtest-x86_64 / qtest-x86_64/migration-test ERROR 157.51s killed by signal 6 SIGABRT

Re: [PATCH 08/13] hw/arm/mps3r: Initial skeleton for mps3-an536 board

2024-02-08 Thread Cédric Le Goater
+/* + * The MPS3 DDR is 3GiB, but on a 32-bit host QEMU doesn't permit + * emulation of that much guest RAM, so artificially make it smaller. + */ +#if HOST_LONG_BITS == 32 +#define MPS3_DDR_SIZE (1 * GiB) +#else +#define MPS3_DDR_SIZE (3 * GiB) +#endif Generically, can we migrate a VM

Re: [PATCH 08/13] hw/arm/mps3r: Initial skeleton for mps3-an536 board

2024-02-08 Thread Peter Maydell
On Wed, 7 Feb 2024 at 09:02, Philippe Mathieu-Daudé wrote: > > On 6/2/24 14:29, Peter Maydell wrote: > > The AN536 is another FPGA image for the MPS3 development board. Unlike > > the existing FPGA images we already model, this board uses a Cortex-R > > family CPU, and it does not use any

Re: [RFC PATCH 0/5] QEMU v7.2.0 aarch64 Nested Virtualization Support

2024-02-08 Thread Eric Auger
Hi Miguel, On 2/27/23 17:37, Miguel Luis wrote: > This series adds ARMv8.3/8.4 nested virtualization support in KVM mode. > > To enable nested virtualization for a guest, the host must expose EL2 > support via QEMU command line switches: > > -machine virt,accel=kvm,virtualization=on > >

Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU

2024-02-08 Thread Daniel P . Berrangé
On Fri, Feb 02, 2024 at 12:10:58AM +0800, Zhao Liu wrote: > Hi Daniel, > > On Thu, Feb 01, 2024 at 09:21:48AM +, Daniel P. Berrangé wrote: > > Date: Thu, 1 Feb 2024 09:21:48 + > > From: "Daniel P. Berrangé" > > Subject: Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU > > > >

Re: [PATCH v3 1/3] hw/i2c: core: Add reset

2024-02-08 Thread Peter Maydell
On Fri, 2 Feb 2024 at 20:48, Joe Komlodi wrote: > > It's possible for a reset to come in the middle of a transaction, which > causes the bus to be in an old state when a new transaction comes in. > > Signed-off-by: Joe Komlodi > --- > hw/i2c/core.c| 19 +++ >

Re: [PATCH v3 3/3] hw/i2c: smbus_slave: Reset state on reset

2024-02-08 Thread Peter Maydell
On Fri, 2 Feb 2024 at 20:48, Joe Komlodi wrote: > > If a reset comes while the SMBus device is not in its idle state, it's > possible for it to get confused on valid transactions post-reset. > > Signed-off-by: Joe Komlodi > --- > hw/i2c/smbus_slave.c | 9 + > 1 file changed, 9

Re: [PATCH v3 2/3] hw/i2c/smbus_slave: Add object path on error prints

2024-02-08 Thread Peter Maydell
On Fri, 2 Feb 2024 at 20:48, Joe Komlodi wrote: > > The current logging doesn't tell us which specific smbus device is an > error state. > > Signed-off-by: Joe Komlodi > --- Reviewed-by: Peter Maydell thanks -- PMM

  1   2   >