Re: [Stable-8.1.3 v2 00/59] Patch Round-up for stable 8.1.3, frozen on 2023-11-19

2023-11-20 Thread Michael Tokarev
20.11.2023 18:33, Thomas Huth : ... Maybe add these in case someone wants to run the Avocado tests with 8.1 and the latest version of Python: https://gitlab.com/qemu-project/qemu/-/commit/861f724d03e1748cda1c5b9ec8457a368590cbd5 https://gitlab.com/qemu-project/qemu/-/commit/f0a663b4ced2bf315936

Re: [PATCH 1/1] tcg/loongarch64: Fix tcg_out_mov() Aborted

2023-11-20 Thread Richard Henderson
On 11/19/23 22:59, Song Gao wrote: On LoongArch host, we got an Aborted from tcg_out_mov(). qemu-x86_64 configure with '--enable-debug'. (gdb) b /home1/gaosong/code/qemu/tcg/loongarch64/tcg-target.c.inc:312 Breakpoint 1 at 0x2576f0: file /home1/gaosong/code/qemu/tcg/loongarch64/tcg-target.c.

Re: [PATCH v2 11/14] tests/tcg: enable arm softmmu tests

2023-11-20 Thread Richard Henderson
On 11/20/23 07:08, Alex Bennée wrote: +/* + * Helper macro for the linker calling subroutines from the C code. + */ That's not all it's for. Better "annotating functions with elf type and size". +vector_table: + b reset /* reset vector */ + b undef_instr

[PATCH RFC v3 0/2] hw/arm: Add minimal support for the B-L475E-IOT01A board

2023-11-20 Thread ~inesvarhol
This patch allows to emulate the B-L475E-IOT01A ARM Cortex-M4 board. This is RFC since the implementation isn't complete yet, there are no implemented peripherals, and it's a first contribution to QEMU. The changes from v1 follow the reviews from Philippe Mathieu-Daudé. We additionally changed the

[PATCH RFC v3 2/2] hw/arm: Add minimal support for the B-L475E-IOT01A board

2023-11-20 Thread ~inesvarhol
From: Inès Varhol This commit adds a new B-L475E-IOT01A board using the STM32L475VG SoC. The implementation is derived from the Netduino Plus 2 machine. There are no peripherals implemented, only memory regions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Arnaud Minier Signed-off-by: I

Re: [PATCH for-8.2] target/arm: Set IL bit for pauth, SVE access, BTI trap syndromes

2023-11-20 Thread Richard Henderson
On 11/20/23 07:01, Peter Maydell wrote: The syndrome register value always has an IL field at bit 25, which is 0 for a trap on a 16 bit instruction, and 1 for a trap on a 32 bit instruction (or for exceptions which aren't traps on a known instruction, like PC alignment faults). This means that ou

[PATCH RFC v3 1/2] hw/arm: Add minimal support for the STM32L4x5 SoC

2023-11-20 Thread ~inesvarhol
From: Inès Varhol This patch adds a new STM32L4x5 SoC, it is necessary to add support for the B-L475E-IOT01A board. The implementation is derived from the STM32F405 SoC. The implementation contains no peripherals, only memory regions are implemented. Reviewed-by: Philippe Mathieu-Daudé Signed-

Re: [PATCH v2 07/14] docs/emulation: expand warning about semihosting

2023-11-20 Thread Richard Henderson
On 11/20/23 07:08, Alex Bennée wrote: A surprising feature of calls like SYS_READC is this can cause QEMU to indefinitely block as there is no handling for EOF. Clarifies: https://gitlab.com/qemu-project/qemu/-/issues/1963 Signed-off-by: Alex Bennée --- docs/about/emulation.rst | 5 +++-- 1

Re: [PATCH v2 08/14] docs/system: clarify limits of using gdbstub in system emulation

2023-11-20 Thread Richard Henderson
On 11/20/23 07:08, Alex Bennée wrote: It seems some users will try and use the gdbstub to debug userspace inside a system emulation. While possible clarify the limitations of this approach and direct the users to a less head scratching way of debugging user-space. Signed-off-by: Alex Bennée Cla

Re: [PATCH 00/16] hw/uefi: add uefi variable service

2023-11-20 Thread Gerd Hoffmann
On Mon, Nov 20, 2023 at 12:53:45PM +0100, Alexander Graf wrote: > Hey Gerd! > > On 15.11.23 16:12, Gerd Hoffmann wrote: > > This patch adds a virtual device to qemu which the uefi firmware can use > > to store variables. This moves the UEFI variable management from > > privileged guest code (mana

Re: [PATCH v6 01/21] backends/iommufd: Introduce the iommufd object

2023-11-20 Thread Cédric Le Goater
Hello Zhenzhong On 11/20/23 11:07, Duan, Zhenzhong wrote: Hi Cédric, -Original Message- From: Cédric Le Goater Sent: Monday, November 20, 2023 4:25 PM Subject: Re: [PATCH v6 01/21] backends/iommufd: Introduce the iommufd object A similar issue with a fix submitted below, ccing relat

[PATCH-for-9.0] iothread: Remove unused Error** argument in aio_context_set_aio_params

2023-11-20 Thread Philippe Mathieu-Daudé
aio_context_set_aio_params() doesn't use its undocumented Error** argument. Remove it to simplify. Note this removes a use of "unchecked Error**" in iothread_set_aio_context_params(). Signed-off-by: Philippe Mathieu-Daudé --- include/block/aio.h | 3 +-- iothread.c | 3 +-- util/aio-po

Re: [PATCH v2 08/14] docs/system: clarify limits of using gdbstub in system emulation

2023-11-20 Thread Philippe Mathieu-Daudé
On 20/11/23 16:08, Alex Bennée wrote: It seems some users will try and use the gdbstub to debug userspace inside a system emulation. While possible clarify the limitations of this approach and direct the users to a less head scratching way of debugging user-space. Signed-off-by: Alex Bennée Cla

Re: [PATCH V5 04/12] cpus: start vm in suspended state

2023-11-20 Thread Fabiano Rosas
Steve Sistare writes: > Provide the vm_resume helper which resumes the vm in the requested state, > correctly restoring the suspended state. > > Signed-off-by: Steve Sistare > --- > include/sysemu/runstate.h | 8 > system/cpus.c | 11 +++ > 2 files changed, 19 inse

Re: [PATCH v2 11/14] tests/tcg: enable arm softmmu tests

2023-11-20 Thread Peter Maydell
On Mon, 20 Nov 2023 at 15:08, Alex Bennée wrote: > > To make it easier to test 32 bit Arm softmmu issues implement a basic > boot.S so we can build the multiarch tests. Currently CHECK_UNALIGNED > is disabled as I haven't got the right magic set for it to work. > > Message-Id: <20231115205542.3092

Re: [PATCH v2 08/14] docs/system: clarify limits of using gdbstub in system emulation

2023-11-20 Thread Peter Maydell
On Mon, 20 Nov 2023 at 15:08, Alex Bennée wrote: > > It seems some users will try and use the gdbstub to debug userspace > inside a system emulation. While possible clarify the limitations of > this approach and direct the users to a less head scratching way of > debugging user-space. > > Signed-o

Re: [PATCH V5 05/12] migration: preserve suspended runstate

2023-11-20 Thread Fabiano Rosas
Steve Sistare writes: > A guest that is migrated in the suspended state automaticaly wakes and > continues execution. This is wrong; the guest should end migration in > the same state it started. The root cause is that the outgoing migration > code automatically wakes the guest, then saves the

Re: [PATCH RFC v3 0/2] hw/arm: Add minimal support for the B-L475E-IOT01A board

2023-11-20 Thread Philippe Mathieu-Daudé
On 20/11/23 17:35, ~inesvarhol wrote: This patch allows to emulate the B-L475E-IOT01A ARM Cortex-M4 board. This is RFC since the implementation isn't complete yet, there are no implemented peripherals, and it's a first contribution to QEMU. The changes from v1 follow the reviews from Philippe Mat

[PATCH for-8.2] target/arm: Handle overflow in calculation of next timer tick

2023-11-20 Thread Peter Maydell
In commit edac4d8a168 back in 2015 when we added support for the virtual timer offset CNTVOFF_EL2, we didn't correctly update the timer-recalculation code that figures out when the timer interrupt is next going to change state. We got it wrong in two ways: * for the 0->1 transition, we didn't noti

Re: [PATCH v2] target/arm: Add overflow check for gt_recalc_timer

2023-11-20 Thread Peter Maydell
On Thu, 9 Nov 2023 at 15:14, Leonid Komarianskyi wrote: > > Peter Maydell, thank you for your comments. > I apologize for so late response - returned to this issue and now I will > answer faster. I fixed the commit according to your recommendations, > please take a look at the new version. > > >

Re: [PATCH for-8.2] target/arm: Handle overflow in calculation of next timer tick

2023-11-20 Thread Richard Henderson
On 11/20/23 09:35, Peter Maydell wrote: In commit edac4d8a168 back in 2015 when we added support for the virtual timer offset CNTVOFF_EL2, we didn't correctly update the timer-recalculation code that figures out when the timer interrupt is next going to change state. We got it wrong in two ways:

Re: [PATCH for-8.2] target/arm: Handle overflow in calculation of next timer tick

2023-11-20 Thread Peter Maydell
On Mon, 20 Nov 2023 at 17:52, Richard Henderson wrote: > > On 11/20/23 09:35, Peter Maydell wrote: > > In commit edac4d8a168 back in 2015 when we added support for > > the virtual timer offset CNTVOFF_EL2, we didn't correctly update > > the timer-recalculation code that figures out when the timer

Re: [PATCH V5 06/12] migration: preserve suspended for snapshot

2023-11-20 Thread Fabiano Rosas
Steve Sistare writes: > Restoring a snapshot can break a suspended guest. Snapshots suffer from > the same suspended-state issues that affect live migration, plus they must > handle an additional problematic scenario, which is that a running vm must > remain running if it loads a suspended snaps

Re: [PATCH V5 07/12] migration: preserve suspended for bg_migration

2023-11-20 Thread Fabiano Rosas
Steve Sistare writes: > Do not wake a suspended guest during bg_migration, and restore the prior > state at finish rather than unconditionally running. Allow the additional > state transitions that occur because bg migration forces RUN_STATE_PAUSED to > save the precopy device state. > > Signed-

Re: [PATCH V5 01/12] cpus: refactor vm_stop

2023-11-20 Thread Steven Sistare
On 11/20/2023 8:22 AM, Fabiano Rosas wrote: > Steve Sistare writes: >> Refactor the vm_stop functions into one common subroutine do_vm_stop called >> with options. No functional change. >> >> Signed-off-by: Steve Sistare >> --- >> system/cpus.c | 44 +---

Re: [PATCH V5 06/12] migration: preserve suspended for snapshot

2023-11-20 Thread Steven Sistare
On 11/20/2023 1:13 PM, Fabiano Rosas wrote: > Steve Sistare writes: > >> Restoring a snapshot can break a suspended guest. Snapshots suffer from >> the same suspended-state issues that affect live migration, plus they must >> handle an additional problematic scenario, which is that a running vm

Re: [PATCH V5 02/12] cpus: stop vm in suspended state

2023-11-20 Thread Steven Sistare
On 11/20/2023 9:15 AM, Fabiano Rosas wrote: > Steve Sistare writes: > >> A vm in the suspended state is not completely stopped. > > Is this a statement of a fact about VMs in the suspended state in > general or is this describing what this patch is trying to fix? The former. >> The VCPUs hav

Re: [PATCH 1/2] target/riscv/cpu_helper.c: Invalid exception on MMU translation stage

2023-11-20 Thread Daniel Henrique Barboza
On 11/20/23 09:06, Ivan Klokov wrote: According to RISCV priveleged spec sect. 5.3.2 Virtual Address Translation Process s/priveleged/privileged access-fault exceptions may raise only after PMA/PMP check. Current implementation generates an acces-fault for mbare mode even if there were n

Re: [PATCH 2/2] target/riscv/cpu_helper.c: Fix mxr bit behavior

2023-11-20 Thread Daniel Henrique Barboza
On 11/20/23 09:06, Ivan Klokov wrote: According to RISCV Specification sect 9.5 on two stage translation when V=1 the vsstatus(mstatus in QEMU's terms) field MXR, which makes execute-only pages readable, only overrides VS-stage page protection. Setting MXR at HS-level(mstatus_hs), however, ove

Re: [PATCH] tests/avocado/reverse_debugging: Disable the ppc64 tests by default

2023-11-20 Thread John Snow
On Wed, Nov 15, 2023 at 12:23 PM Daniel P. Berrangé wrote: > > On Wed, Nov 15, 2023 at 01:14:53PM +, Daniel P. Berrangé wrote: > > On Wed, Nov 15, 2023 at 07:23:01AM +0100, Thomas Huth wrote: > > > On 15/11/2023 02.15, Nicholas Piggin wrote: > > > > On Wed Nov 15, 2023 at 4:29 AM AEST, Thomas

Re: [PATCH v6 0/8] Unified CPU type check

2023-11-20 Thread Marcin Juszkiewicz
W dniu 20.11.2023 o 01:27, Gavin Shan pisze: Testing === With the following command lines, the output messages are varied before and after the series is applied. ./build/qemu-system-aarch64\ -accel tcg -machine virt,gic-version=3 \ -cpu cortex-a8 -smp maxcpus=2,cpus=1

Re: [RFC PATCH 1/3] hw/cxl/cxl-mailbox-utils: Add support for feature commands (8.2.9.6)

2023-11-20 Thread Davidlohr Bueso
On Tue, 14 Nov 2023, shiju.j...@huawei.com wrote: From: Shiju Jose CXL spec 3.0 section 8.2.9.6 describes optional device specific features. CXL devices supports features with changeable attributes. Get Supported Features retrieves the list of supported device specific features. The settings o

Re: [PATCH V5 01/12] cpus: refactor vm_stop

2023-11-20 Thread Peter Xu
On Mon, Nov 20, 2023 at 02:09:31PM -0500, Steven Sistare wrote: > On 11/20/2023 8:22 AM, Fabiano Rosas wrote: > > Steve Sistare writes: > >> Refactor the vm_stop functions into one common subroutine do_vm_stop called > >> with options. No functional change. > >> > >> Signed-off-by: Steve Sistare

Re: [PATCH V5 01/12] cpus: refactor vm_stop

2023-11-20 Thread Steven Sistare
On 11/20/2023 2:46 PM, Peter Xu wrote: > On Mon, Nov 20, 2023 at 02:09:31PM -0500, Steven Sistare wrote: >> On 11/20/2023 8:22 AM, Fabiano Rosas wrote: >>> Steve Sistare writes: Refactor the vm_stop functions into one common subroutine do_vm_stop called with options. No functional chang

Re: [PATCH V5 02/12] cpus: stop vm in suspended state

2023-11-20 Thread Peter Xu
On Mon, Nov 13, 2023 at 10:33:50AM -0800, Steve Sistare wrote: > A vm in the suspended state is not completely stopped. The VCPUs have been > paused, but the cpu clock still runs, and runstate notifiers for the > transition to stopped have not been called. Modify vm_stop_force_state to > complete

Re: [PATCH V5 01/12] cpus: refactor vm_stop

2023-11-20 Thread Fabiano Rosas
Steven Sistare writes: > On 11/20/2023 8:22 AM, Fabiano Rosas wrote: >> Steve Sistare writes: >>> Refactor the vm_stop functions into one common subroutine do_vm_stop called >>> with options. No functional change. >>> >>> Signed-off-by: Steve Sistare >>> --- >>> system/cpus.c | 44 +++

Re: [PATCH V5 02/12] cpus: stop vm in suspended state

2023-11-20 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Nov 13, 2023 at 10:33:50AM -0800, Steve Sistare wrote: >> A vm in the suspended state is not completely stopped. The VCPUs have been >> paused, but the cpu clock still runs, and runstate notifiers for the >> transition to stopped have not been called. Modify vm_stop_f

Re: [PATCH V5 02/12] cpus: stop vm in suspended state

2023-11-20 Thread Steven Sistare
On 11/20/2023 2:59 PM, Peter Xu wrote: > On Mon, Nov 13, 2023 at 10:33:50AM -0800, Steve Sistare wrote: >> A vm in the suspended state is not completely stopped. The VCPUs have been >> paused, but the cpu clock still runs, and runstate notifiers for the >> transition to stopped have not been calle

Re: [PATCH v2] audio: Free consumed default audio devices

2023-11-20 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH V5 02/12] cpus: stop vm in suspended state

2023-11-20 Thread Steven Sistare
On 11/20/2023 3:47 PM, Fabiano Rosas wrote: > Peter Xu writes: >> On Mon, Nov 13, 2023 at 10:33:50AM -0800, Steve Sistare wrote: >>> A vm in the suspended state is not completely stopped. The VCPUs have been >>> paused, but the cpu clock still runs, and runstate notifiers for the >>> transition t

[PATCH-for-9.0 00/25] memory: Propagate Error* when possible

2023-11-20 Thread Philippe Mathieu-Daudé
Hi, This series is remotely connected with the "dynamic machine" project. We need QOM objects created either from command line, QMP or loaded by modules to NOT fail exiting the whole QEMU process, but cleanly propagate any error before failing cleanly. In preparation for that big goal, we start r

[PATCH-for-9.0 06/25] memory: Have memory_region_init_ram() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 6 -- 2

[PATCH-for-9.0 04/25] memory: Simplify memory_region_init_rom_nomigrate() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, &errp) ) { ... retur

[PATCH-for-9.0 02/25] memory: Have memory_region_init_ram_nomigrate() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 5 +++-- 2 f

[PATCH-for-9.0 07/25] memory: Have memory_region_init_rom() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 6 -- 2

[PATCH-for-9.0 01/25] memory: Have memory_region_init_ram_flags_nomigrate() return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 fi

[PATCH-for-9.0 03/25] memory: Have memory_region_init_rom_nomigrate() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 8 ++--

[PATCH-for-9.0 09/25] memory: Simplify memory_region_init_rom_device_nomigrate() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, errp; @@ - memory_region_init_rom_device_nomigrate(mr, owner, arg3, arg4, arg5, arg6, &errp); if ( - errp + !memory_region_init_rom_device_nomigrate(mr, owner, arg3, arg4, a

[PATCH-for-9.0 13/25] memory: Have memory_region_init_ram_from_fd() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 fi

[PATCH-for-9.0 10/25] memory: Have memory_region_init_rom_device() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 6 -- 2

[PATCH-for-9.0 14/25] backends: Use g_autofree in HostMemoryBackendClass::alloc() handlers

2023-11-20 Thread Philippe Mathieu-Daudé
In preparation of having HostMemoryBackendClass::alloc() handlers return a boolean, have them use g_autofree. Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem-epc.c | 3 +-- backends/hostmem-file.c | 3 +-- backends/hostmem-memfd.c | 3 +-- backends/hostmem-ram.c | 3 +-- 4 files

[PATCH-for-9.0 05/25] memory: Simplify memory_region_init_ram_from_fd() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, arg7, errp; @@ - memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7, &errp); if ( - errp + !memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, a

[PATCH-for-9.0 12/25] memory: Have memory_region_init_ram_from_file() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 fi

[PATCH-for-9.0 20/25] hw: Simplify memory_region_init_ram() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_ram(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_ram(mr, owner, arg3, arg4, &errp) ) { ... return; } and removi

[PATCH-for-9.0 19/25] misc: Simplify qemu_prealloc_mem() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem.c | 22 +++--- hw/virtio/virtio-mem.c | 6 ++ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 1b0043a0d9..30f69b2cb5 100644 --- a/backends/hostmem.c ++

[PATCH-for-9.0 17/25] backends: Reduce variable scope in host_memory_backend_memory_complete

2023-11-20 Thread Philippe Mathieu-Daudé
Reduce the &local_err variable use and remove the 'out:' label. Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 3f8eb936d7..1b0043a0d9 100644 --- a/backends/host

[PATCH-for-9.0 16/25] backends: Have HostMemoryBackendClass::alloc() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/hostmem.h | 10 +- backends/hostmem-epc.c |

[PATCH-for-9.0 21/25] hw/arm: Simplify memory_region_init_rom() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_rom(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_rom(mr, owner, arg3, arg4, &errp) ) { ... return; } and removi

[PATCH-for-9.0 11/25] memory: Have memory_region_init_resizeable_ram() return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 fi

[PATCH-for-9.0 23/25] hw/misc: Simplify memory_region_init_ram_from_fd() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, arg7, errp; @@ - memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7, &errp); if ( - errp + !memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, a

[PATCH-for-9.0 15/25] backends: Simplify host_memory_backend_memory_complete()

2023-11-20 Thread Philippe Mathieu-Daudé
Return early if bc->alloc is NULL. De-indent the if() ladder. Note, this avoids a pointless call to error_propagate() with errp=NULL at the 'out:' label. Change trivial when reviewed with 'git-diff --ignore-all-space'. Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem.c | 133

[PATCH-for-9.0 22/25] hw/sparc: Simplify memory_region_init_ram_nomigrate() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_ram_nomigrate(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_ram_nomigrate(mr, owner, arg3, arg4, &errp) ) { ... retur

[PATCH-for-9.0 24/25] hw/nvram: Simplify memory_region_init_rom_device() calls

2023-11-20 Thread Philippe Mathieu-Daudé
Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, errp; @@ - memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &errp); if ( - errp + !memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &errp)

[PATCH-for-9.0 25/25] hw/pci-host/raven: Propagate error in raven_realize()

2023-11-20 Thread Philippe Mathieu-Daudé
When an Error** reference is available, it is better to propagate local errors, rather then using generic ones, which might terminate the whole QEMU process. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/raven.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw

[PATCH-for-9.0 18/25] util/oslib: Have qemu_prealloc_mem() handler return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/osdep.h | 4 +++- util/oslib-posix.c | 7 +-- uti

[PATCH-for-9.0 08/25] memory: Have memory_region_init_rom_device_nomigrate() return a boolean

2023-11-20 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 fi

Re: [PATCH V5 02/12] cpus: stop vm in suspended state

2023-11-20 Thread Peter Xu
On Mon, Nov 20, 2023 at 03:55:54PM -0500, Steven Sistare wrote: > If we drop force, then all calls to vm_stop will completely stop the > suspended state, eg an hmp "stop" command. This causes two problems. > First, that is a change in user-visible behavior for something that > currently works, IMH

[PATCH v2] disas/cris: Pass buffer size to format_dec() to avoid overflow warning

2023-11-20 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Propagate the buffer size to format_dec() and use snprintf(). This should silence this UBSan -Wformat-overflow warning: In file included from /usr/include/stdio.h:906, from include/qemu/osdep.h:114, from ../disas/cris.c:21:

Re: Converting images to stdout

2023-11-20 Thread Eric Blake
On Thu, Nov 16, 2023 at 06:48:09PM +0100, Alberto Garcia wrote: > Hi, > > I haven't written here in a while :) but I have something small that I > would like to discuss. > > Using qemu-img to convert an image and writing the result directly to > stdout is a question that has already been raised i

[PATCH v4 00/11] Add powernv10 I2C devices and tests

2023-11-20 Thread Glenn Miles
This series of patches includes support, tests and fixes for adding PCA9552 and PCA9554 I2C devices to the powernv10 chip. The PCA9552 device is used for PCIe slot hotplug power control and monitoring, while the PCA9554 device is used for presence detection of IBM CableCard devices. Both devices

[PATCH v4 07/11] ppc/pnv: Fix PNV I2C invalid status after reset

2023-11-20 Thread Glenn Miles
The PNV I2C Controller was clearing the status register after a reset without repopulating the "upper threshold for I2C ports", "Command Complete" and the SCL/SDA input level fields. Fixed this for resets caused by a system reset as well as from writing to the "Immediate Reset" register. Reviewed

[PATCH v4 02/11] misc/pca9552: Let external devices set pca9552 inputs

2023-11-20 Thread Glenn Miles
Allow external devices to drive pca9552 input pins by adding input GPIO's to the model. This allows a device to connect its output GPIO's to the pca9552 input GPIO's. In order for an external device to set the state of a pca9552 pin, the pin must first be configured for high impedance (LED is off

[PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type

2023-11-20 Thread Glenn Miles
Create a new powernv machine type, powernv10-rainier, that will contain rainier-specific devices. Signed-off-by: Glenn Miles --- hw/ppc/pnv.c | 29 +++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 9c29727337..3481a1220

[PATCH v4 08/11] ppc/pnv: Use resettable interface to reset child I2C buses

2023-11-20 Thread Glenn Miles
The QEMU I2C buses and devices use the resettable interface for resetting while the PNV I2C controller and parent buses and devices have not yet transitioned to this new interface and use the old reset strategy. This was preventing the I2C buses and devices wired to the PNV I2C controller from bein

[PATCH v4 05/11] ppc/pnv: Wire up pca9552 GPIO pins for PCIe hotplug power control

2023-11-20 Thread Glenn Miles
For power10-rainier, a pca9552 device is used for PCIe slot hotplug power control by the Power Hypervisor code. The code expects that some time after it enables power to a PCIe slot by asserting one of the pca9552 GPIO pins 0-4, it should see a "power good" signal asserted on one of pca9552 GPIO p

[PATCH v4 09/11] misc: Add a pca9554 GPIO device model

2023-11-20 Thread Glenn Miles
Specs are available here: https://www.nxp.com/docs/en/data-sheet/PCA9554_9554A.pdf This is a simple model supporting the basic registers for GPIO mode. The device also supports an interrupt output line but the model does not yet support this. Signed-off-by: Glenn Miles --- Changes from pr

[PATCH v4 04/11] ppc/pnv: Add pca9552 to powernv10-rainier for PCIe hotplug power control

2023-11-20 Thread Glenn Miles
The Power Hypervisor code expects to see a pca9552 device connected to the 3rd PNV I2C engine on port 1 at I2C address 0x63 (or left- justified address of 0xC6). This is used by hypervisor code to control PCIe slot power during hotplug events. Signed-off-by: Glenn Miles --- Changes from previou

[PATCH v4 01/11] misc/pca9552: Fix inverted input status

2023-11-20 Thread Glenn Miles
The pca9552 INPUT0 and INPUT1 registers are supposed to hold the logical values of the LED pins. A logical 0 should be seen in the INPUT0/1 registers for a pin when its corresponding LSn bits are set to 0, which is also the state needed for turning on an LED in a typical usage scenario. Existing

[PATCH v4 06/11] ppc/pnv: PNV I2C engines assigned incorrect XSCOM addresses

2023-11-20 Thread Glenn Miles
The PNV I2C engines for power9 and power10 were being assigned a base XSCOM address that was off by one I2C engine's address range such that engine 0 had engine 1's address and so on. The xscom address assignment was being based on the device tree engine numbering, which starts at 1. Rather than

[PATCH v4 10/11] ppc/pnv: Add a pca9554 I2C device to powernv10-rainier

2023-11-20 Thread Glenn Miles
For powernv10-rainier, the Power Hypervisor code expects to see a pca9554 device connected to the 3rd PNV I2C engine on port 1 at I2C address 0x25 (or left-justified address of 0x4A). This is used by the hypervisor code to detect if a "Cable Card" is present. Signed-off-by: Glenn Miles --- Chan

[PATCH v4 11/11] ppc/pnv: Test pnv i2c master and connected devices

2023-11-20 Thread Glenn Miles
Tests the following for both P9 and P10: - I2C master POR status - I2C master status after immediate reset Tests the following for powernv10-ranier only: - Config pca9552 hotplug device pins as inputs then Read the INPUT0/1 registers to verify all pins are high - Connected GPIO pin tes

Re: [PATCH-for-8.2 v2] backends/cryptodev: Do not ignore throttle/backends Errors

2023-11-20 Thread zhenwei pi
Looks good to me. Thanks! Reviewed-by: zhenwei pi On 11/20/23 23:04, Philippe Mathieu-Daudé wrote: Both cryptodev_backend_set_throttle() and CryptoDevBackendClass::init() can set their Error** argument. Do not ignore them, return early on failure. Use the ERRP_GUARD() macro as suggested in com

Re: [PATCH v6 0/8] Unified CPU type check

2023-11-20 Thread Gavin Shan
On 11/21/23 05:42, Marcin Juszkiewicz wrote: W dniu 20.11.2023 o 01:27, Gavin Shan pisze: Testing === With the following command lines, the output messages are varied before and after the series is applied.    ./build/qemu-system-aarch64    \    -accel tcg -machine virt,gic-version

Re: [RFC PATCH 2/3] hw/cxl/cxl-mailbox-utils: Add device patrol scrub control feature

2023-11-20 Thread Davidlohr Bueso
On Tue, 14 Nov 2023, shiju.j...@huawei.com wrote: +case CXL_FEATURE_PATROL_SCRUB: +/* Fill supported feature entry for device patrol scrub control */ +supported_feats->feat_entries[entry] = + (struct CXLSupportedFeatureEntry) { +

Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type

2023-11-20 Thread Nicholas Piggin
On Tue Nov 21, 2023 at 9:51 AM AEST, Glenn Miles wrote: > Create a new powernv machine type, powernv10-rainier, that > will contain rainier-specific devices. Is the plan to have a base powernv10 common to all and then powernv10-rainier looks like a Rainier? Or would powernv10 just be a rainier? I

Re: [PATCH 1/1] tcg/loongarch64: Fix tcg_out_mov() Aborted

2023-11-20 Thread gaosong
在 2023/11/20 下午11:59, Richard Henderson 写道: On 11/19/23 22:59, Song Gao wrote: On LoongArch host,  we got an Aborted from tcg_out_mov(). qemu-x86_64 configure with '--enable-debug'. (gdb) b /home1/gaosong/code/qemu/tcg/loongarch64/tcg-target.c.inc:312 Breakpoint 1 at 0x2576f0: file /home1/ga

[PULL 0/1] loongarch fixes for 8.2

2023-11-20 Thread Song Gao
The following changes since commit af9264da80073435fd78944bc5a46e695897d7e5: Merge tag '20231119-xtensa-1' of https://github.com/OSLL/qemu-xtensa into staging (2023-11-20 05:25:19 -0500) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20231121

[PULL 1/1] tcg/loongarch64: Fix tcg_out_mov() Aborted

2023-11-20 Thread Song Gao
On LoongArch host, we got an Aborted from tcg_out_mov(). qemu-x86_64 configure with '--enable-debug'. > (gdb) b /home1/gaosong/code/qemu/tcg/loongarch64/tcg-target.c.inc:312 > Breakpoint 1 at 0x2576f0: file > /home1/gaosong/code/qemu/tcg/loongarch64/tcg-target.c.inc, line 312. > (gdb) run hello

Re: [PATCH v3 1/5] docs/system/arm: Fix for rename of type "xlnx.bbram-ctrl"

2023-11-20 Thread Alistair Francis
On Fri, Nov 17, 2023 at 9:47 PM Thomas Huth wrote: > > From: Markus Armbruster > > Fixes: b65b4b7ae3c8 (xlnx-bbram: hw/nvram: Use dot in device type name) > Signed-off-by: Markus Armbruster > [thuth: Use longhand syntax to avoid problems with the "." in the name] > Reviewed-by: Peter Maydell >

Re: [PATCH v3 2/5] hw: Replace anti-social QOM type names (again)

2023-11-20 Thread Alistair Francis
On Fri, Nov 17, 2023 at 9:47 PM Thomas Huth wrote: > > From: Markus Armbruster > > QOM type names containing ',' result in awful UI. We got rid of them > in v6.0.0 (commit e178113ff64 hw: Replace anti-social QOM type names). > A few have crept back since: > > xlnx,cframe-reg > xlnx,efuse

Re: [PATCH v3 3/5] memory: Remove "qemu:" prefix from the "qemu:ram-discard-manager" type name

2023-11-20 Thread Alistair Francis
On Fri, Nov 17, 2023 at 9:46 PM Thomas Huth wrote: > > Type names should not contain special characters like ":". Let's > remove the whole prefix here since it does not really seem to be > helpful to have such a prefix here. The type name is only used > internally for an interface type, so the ren

Re: [PATCH v3 4/5] tests/unit/test-io-task: Rename "qemu:dummy" to avoid colon in the name

2023-11-20 Thread Alistair Francis
On Fri, Nov 17, 2023 at 11:08 PM Thomas Huth wrote: > > Type names should not contain special characters like ":" (so that > they are easier to use with QAPI and other parts). We are going to > forbid such names in an upcoming patch. Thus let's replace the ":" > here with a "-". > > Reviewed-by: D

Re: [PATCH v3 5/5] qom/object: Limit type names to alphanumerical and some few special characters

2023-11-20 Thread Alistair Francis
On Fri, Nov 17, 2023 at 9:46 PM Thomas Huth wrote: > > QOM names currently don't have any enforced naming rules. This > can be problematic, e.g. when they are used on the command line > for the "-device" option (where the comma is used to separate > properties). To avoid that such problematic type

RE: [PATCH v6 01/21] backends/iommufd: Introduce the iommufd object

2023-11-20 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Tuesday, November 21, 2023 1:09 AM >Subject: Re: [PATCH v6 01/21] backends/iommufd: Introduce the iommufd object > >Hello Zhenzhong > >On 11/20/23 11:07, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Original Message- >>> From: Cé

Re: [PATCH trivial 17/21] target/riscv/cpu.h: spelling fix: separatly

2023-11-20 Thread Alistair Francis
On Wed, Nov 15, 2023 at 3:04 AM Michael Tokarev wrote: > > Fixes: 40336d5b1d4c "target/riscv: Add HS-mode virtual interrupt and IRQ > filtering support." > Cc: Rajnesh Kanwal > Cc: Alistair Francis > Signed-off-by: Michael Tokarev Reviewed-by: Alistair Francis Alistair > --- > target/risc

Re: [PATCH] linux-user/riscv: Add Zicboz block size to hwprobe

2023-11-20 Thread Alistair Francis
On Sat, Nov 11, 2023 at 3:52 AM Palmer Dabbelt wrote: > > Support for probing the Zicboz block size landed in Linux 6.6, which was > released a few weeks ago. This provides the user-configured block size > when Zicboz is enabled. > > Signed-off-by: Palmer Dabbelt Reviewed-by: Alistair Francis

Re: [PATCH] linux-user/riscv: Add Zicboz block size to hwprobe

2023-11-20 Thread Alistair Francis
On Sat, Nov 11, 2023 at 3:52 AM Palmer Dabbelt wrote: > > Support for probing the Zicboz block size landed in Linux 6.6, which was > released a few weeks ago. This provides the user-configured block size > when Zicboz is enabled. > > Signed-off-by: Palmer Dabbelt Thanks! Applied to riscv-to-ap

Re: [PATCH for-8.2] hw/riscv/virt.c: do create_fdt() earlier, add finalize_fdt()

2023-11-20 Thread Alistair Francis
On Sat, Nov 11, 2023 at 3:26 AM Daniel Henrique Barboza wrote: > > Commit 49554856f0 fixed a problem, where TPM devices were not appearing > in the FDT, by delaying the FDT creation up until virt_machine_done(). > This create a side effect (see gitlab #1925) - devices that need access > to the '/c

Re: [PATCH v2] target/riscv: don't verify ISA compatibility for zicntr and zihpm

2023-11-20 Thread Alistair Francis
On Wed, Nov 15, 2023 at 12:46 AM Clément Chigot wrote: > > The extensions zicntr and zihpm were officially added in the privilege > instruction set specification 1.12. However, QEMU has been implemented > them long before it and thus they are forced to be on during the cpu > initialization to ensu

Re: [PATCH for-8.2] hw/riscv/virt.c: do create_fdt() earlier, add finalize_fdt()

2023-11-20 Thread Alistair Francis
On Sat, Nov 11, 2023 at 3:26 AM Daniel Henrique Barboza wrote: > > Commit 49554856f0 fixed a problem, where TPM devices were not appearing > in the FDT, by delaying the FDT creation up until virt_machine_done(). > This create a side effect (see gitlab #1925) - devices that need access > to the '/c

<    1   2   3   >