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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: 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

[PATCH] ppc/spapr: Initialize max_cpus limit to an allowed usable limit.

2023-11-21 Thread Harsh Prateek Bora
Initialize the machine specific max_cpus limit to a usable limit 4096. Keeping between 4096 to 8192 will throw IRQ not free error due to XIVE limitation and keeping beyond 8192 will hit assert in tcg_region_init or spapr_xive_claim_irq. Logs: Without patch fix: [root@host build]#

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: 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, ); if ( - errp +

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: 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, ); if ( - errp +

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_rom(mr, owner, arg3, arg4, ); if ( - errp + !memory_region_init_rom(mr, owner, arg3, arg4, )

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

2023-11-21 Thread Cédric Le Goater
Adding Reza. On 11/21/23 21:03, Miles Glenn wrote: On Tue, 2023-11-21 at 19:36 +0100, Cédric Le Goater wrote: On 11/21/23 00:51, Glenn Miles wrote: 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

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_ram(mr, owner, arg3, arg4, ); if ( - errp + !memory_region_init_ram(mr, owner, arg3, arg4, )

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- Commit message missing but indeed there's not much to say Reviewed-by: Manos Pitsidianakis

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: Reduce the _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

[RFC PATCH v7] ppc: Enable 2nd DAWR support on p10

2023-11-21 Thread Shivaprasad G Bhat
Extend the existing watchpoint facility from TCG DAWR0 emulation to DAWR1 on POWER10. As per the PAPR, bit 0 of byte 64 in pa-features property indicates availability of 2nd DAWR registers. i.e. If this bit is set, 2nd DAWR is present, otherwise not. Use KVM_CAP_PPC_DAWR1 capability to find

[PATCH 2/3] tests/unit/test-qmp-event: Simplify event emission check

2023-11-21 Thread Markus Armbruster
The generated qapi_event_send_FOO() call an event emitter function. It's test_qapi_event_emit() in this test. It compares the actual event to the expected event, and sets a flag to record it was called. The test functions set expected data and clear the flag before calling qapi_event_send_FOO(),

[PATCH 1/3] tests/unit/test-qmp-event: Drop superfluous mutex

2023-11-21 Thread Markus Armbruster
Mutex @test_event_lock is held from fixture setup to teardown, protecting global variable @test_event_data. But tests always run one after the other, so this is superfluous. It also confuses Coverity. Drop the mutex. Fixes: CID 1527425 Signed-off-by: Markus Armbruster ---

[PATCH 3/3] tests/unit/test-qmp-event: Replace fixture by global variables

2023-11-21 Thread Markus Armbruster
The fixture buys us exactly nothing, as we need a global variable anyway, for test_qapi_event_emit(). Drop it. Signed-off-by: Markus Armbruster --- tests/unit/test-qmp-event.c | 91 - 1 file changed, 30 insertions(+), 61 deletions(-) diff --git

[PATCH 0/3] tests/unit/test-qmp-event: Unconfuse Coverity & simplify

2023-11-21 Thread Markus Armbruster
Markus Armbruster (3): tests/unit/test-qmp-event: Drop superfluous mutex tests/unit/test-qmp-event: Simplify event emission check tests/unit/test-qmp-event: Replace fixture by global variables tests/unit/test-qmp-event.c | 108 +++- 1 file changed, 31

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: 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é ---

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: 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:

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

2023-11-21 Thread Manos Pitsidianakis
On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé wrote: In preparation of having HostMemoryBackendClass::alloc() handlers return a boolean, have them use g_autofree. Signed-off-by: Philippe Mathieu-Daudé --- Reviewed-by: Manos Pitsidianakis

Re: [PATCH qemu v2] Fixing the basic functionality of STM32 timers

2023-11-21 Thread Alistair Francis
On Tue, Oct 31, 2023 at 6:35 AM ~lbryndza wrote: > > From: Lucjan Bryndza > > The current implementation of timers does not work properly > even in basic functionality. A counter configured to report > an interrupt every 10ms reports the first interrupts after a > few seconds. There are also no

Re: [PULL 46/49] target/riscv: Don't assume PMU counters are continuous

2023-11-21 Thread Alistair Francis
On Fri, Nov 10, 2023 at 1:24 AM Peter Maydell wrote: > > On Tue, 7 Nov 2023 at 02:36, Alistair Francis wrote: > > > > From: Rob Bradford > > > > Check the PMU available bitmask when checking if a counter is valid > > rather than comparing the index against the number of PMUs. > > > >

[PULL 5/6] target/riscv/cpu_helper.c: Invalid exception on MMU translation stage

2023-11-21 Thread Alistair Francis
From: Ivan Klokov According to RISCV privileged spec sect. 5.3.2 Virtual Address Translation Process access-fault exceptions may raise only after PMA/PMP check. Current implementation generates an access-fault for mbare mode even if there were no PMA/PMP errors. This patch removes the

[PULL 4/6] riscv: Fix SiFive E CLINT clock frequency

2023-11-21 Thread Alistair Francis
From: Román Cárdenas If you check the manual of SiFive E310 (https://cdn.sparkfun.com/assets/7/f/0/2/7/fe310-g002-manual-v19p05.pdf), you can see in Figure 1 that the CLINT is connected to the real time clock, which also feeds the AON peripheral (they share the same clock). In page 43, the

[PULL 3/6] target/riscv: don't verify ISA compatibility for zicntr and zihpm

2023-11-21 Thread Alistair Francis
From: Clément Chigot 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 ensure compatibility (see riscv_cpu_init).

[PULL 2/6] hw/riscv/virt.c: do create_fdt() earlier, add finalize_fdt()

2023-11-21 Thread Alistair Francis
From: Daniel Henrique Barboza 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 '/chosen' FDT node during realize() stopped

[PULL 6/6] target/riscv/cpu_helper.c: Fix mxr bit behavior

2023-11-21 Thread Alistair Francis
From: Ivan Klokov 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, overrides both VS-stage

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

2023-11-21 Thread Alistair Francis
The following changes since commit 8fa379170c2a12476021f5f50d6cf3f672e79e7b: Update version for v8.2.0-rc1 release (2023-11-21 13:56:12 -0500) are available in the Git repository at: https://github.com/alistair23/qemu.git tags/pull-riscv-to-apply-20231122 for you to fetch changes up to

[PULL 1/6] linux-user/riscv: Add Zicboz block size to hwprobe

2023-11-21 Thread Alistair Francis
From: Palmer Dabbelt 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 Reviewed-by: Daniel Henrique Barboza

[PATCH v4 4/4] hw/riscv/virt: Add IOPMP support

2023-11-21 Thread Ethan Chen via
If a source device is connected to the IOPMP device, its memory access will be checked by the IOPMP rule. - Add 'iopmp=on' option to add an iopmp device and a dma device which is connected to the iopmp to machine. This option is assumed to be "off" - Add 'iopmp_cascade=on' option to add second

[PATCH v4 1/4] hw/core: Add config stream

2023-11-21 Thread Ethan Chen via
Make other device can use /hw/core/stream.c by select this config. Signed-off-by: Ethan Chen --- hw/Kconfig | 1 + hw/core/Kconfig | 3 +++ hw/core/meson.build | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/Kconfig b/hw/Kconfig index 9ca7b38c31..e4d153dce7

[PATCH v4 3/4] hw/dma: Add Andes ATCDMAC300 support

2023-11-21 Thread Ethan Chen via
ATCDMAC300 is a direct memory access controller (DMAC) which transfers data efficiently between devices on the AMBA AXI4 bus. ATCDMAC300 supports up to 8 DMA channels. Each DMA channel provides a set of registers to describe the intended data transfers To support RISC-V IOPMP, a memory access

[PATCH v4 2/4] Add RISC-V IOPMP support

2023-11-21 Thread Ethan Chen via
Support specification Version 1.0.0-draft4 rapid-k model. The specification url: https://github.com/riscv-non-isa/iopmp-spec/blob/main/riscv_iopmp_specification.pdf IOPMP check memory access from deivce is valid or not. This implementation uses IOMMU to change address space that device access.

[PATCH v4 0/4] Support RISC-V IOPMP

2023-11-21 Thread Ethan Chen via
This series implements IOPMP specification v1.0.0-draft4 rapid-k model. The specification url: https://github.com/riscv-non-isa/iopmp-spec/blob/main/riscv_iopmp_specification.pdf When IOPMP is enabled, a DMA device ATCDMAC300 is added to RISC-V virt platform. This DMA device is connected to the

RE: [PATCH v7 00/27] vfio: Adopt iommufd

2023-11-21 Thread Duan, Zhenzhong
>-Original Message- >From: Nicolin Chen >Sent: Wednesday, November 22, 2023 6:56 AM >Subject: Re: [PATCH v7 00/27] vfio: Adopt iommufd > >On Tue, Nov 21, 2023 at 04:43:59PM +0800, Zhenzhong Duan wrote: > >> qemu code: >https://github.com/yiliu1765/qemu/commits/zhenzhong/iommufd_cdev_v7

RE: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset interface

2023-11-21 Thread Duan, Zhenzhong
Hi Philippe, >-Original Message- >From: Philippe Mathieu-Daudé >Sent: Wednesday, November 22, 2023 2:39 AM >Subject: Re: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset >interface > >Hi Zhenzhong, > >On 21/11/23 09:44, Zhenzhong Duan wrote: >> Legacy vfio pci and iommufd cdev

RE: [PATCH v7 00/27] vfio: Adopt iommufd

2023-11-21 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Wednesday, November 22, 2023 1:23 AM >Subject: Re: [PATCH v7 00/27] vfio: Adopt iommufd > >Hello Zhenzhong > >On 11/21/23 09:43, Zhenzhong Duan wrote: >> Hi, >> >> Thanks all for giving guides and comments on previous series, this is >>

Re: [PATCH v2 0/2] Fix mmu translation with H extension

2023-11-21 Thread Alistair Francis
On Tue, Nov 21, 2023 at 5:19 PM Ivan Klokov wrote: > > A series of patches that correct the conversion of virtual addresses > to physical ones. Correct exception for mbare mode and fix MXR bit > behavior with MPV\MPRV bits. > --- > v2: >- Fix typo, specify the fixed commits > --- > > Ivan

[ANNOUNCE] QEMU 8.2.0-rc1 is now available

2023-11-21 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the second release candidate for the QEMU 8.2 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-8.2.0-rc1.tar.xz

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

2023-11-21 Thread Alistair Francis
On Tue, Nov 21, 2023 at 6:53 PM 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

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

2023-11-21 Thread Alistair Francis
On Tue, Nov 21, 2023 at 6:51 PM Ivan Klokov wrote: > > According to RISCV privileged spec sect. 5.3.2 Virtual Address Translation > Process > access-fault exceptions may raise only after PMA/PMP check. Current > implementation > generates an access-fault for mbare mode even if there were no

Re: [PATCH] hw/timer/hpet: Convert DPRINTF to trace events

2023-11-21 Thread Dan Hoffman
bump On Sat, Nov 18, 2023 at 5:13 PM Daniel Hoffman wrote: > > This conversion is pretty straight-forward. Standardized some formatting > so the +0 and +4 offset cases can recycle the same message. > > Signed-off-by: Daniel Hoffman > --- > hw/timer/hpet.c | 55

Re: [PATCH v3] hw/i386: fix short-circuit logic with non-optimizing builds

2023-11-21 Thread Dan Hoffman
>From their Discord server in reply to a question about whether such a patch would be upstreamed: "I suspect this only works in gcc -O0 because of its AST-level "fold", which clang intentionally doesn't implement. So probably not." I hope that's enough information to resolve this patch. If any of

Re: [PATCH for-9.0] hw: Add compat machines for 9.0

2023-11-21 Thread Gavin Shan
On 11/20/23 19:42, Cornelia Huck wrote: Add 9.0 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck --- hw/arm/virt.c | 9 - hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 17

Re: [PATCH v7 00/27] vfio: Adopt iommufd

2023-11-21 Thread Nicolin Chen
On Tue, Nov 21, 2023 at 04:43:59PM +0800, Zhenzhong Duan wrote: > qemu code: https://github.com/yiliu1765/qemu/commits/zhenzhong/iommufd_cdev_v7 > Based on vfio-next, commit id: c487fb8a50 I've tested with an aarch64-softmmu build using both legacy VFIO passthrough and IOMMUFD+cdev, although

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

2023-11-21 Thread Peter Xu
On Tue, Nov 21, 2023 at 04:21:18PM -0500, Steven Sistare wrote: > On 11/20/2023 4:44 PM, Peter Xu wrote: > > 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.

[PULL 0/1] Seabios hppa v13 patches

2023-11-21 Thread deller
From: Helge Deller The following changes since commit ea6a33e776f0a4bda94460ab0945d953fc801dd1: Revert "tests/avocado: Enable reverse_debugging.py tests in gitlab CI" (2023-11-21 10:28:55 -0500) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git

Re: [PULL 0/1] linux-user late fix

2023-11-21 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes. signature.asc Description: PGP signature

[PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support

2023-11-21 Thread Volodymyr Babchuk
From: Oleksandr Tyshchenko The bridge is needed for virtio-pci support, as QEMU can emulate the whole bridge with any virtio-pci devices connected to it. This patch provides a flexible way to configure PCIe brige resources with xenstore. We made this for several reasons: - We don't want to

[PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-21 Thread Volodymyr Babchuk
From: David Woodhouse This allows a XenDevice implementation to know whether it was created by QEMU, or merely discovered in XenStore after the toolstack created it. This will allow us to create frontend/backend nodes only when we should, rather than unconditionally attempting to overwrite them

[PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-21 Thread Volodymyr Babchuk
From: Oleksandr Tyshchenko Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to inherit the owner of the directory. Note that for other than Dom0 domain (non toolstack domain) the "driver_domain" property should be set in domain config file for the toolstack to create required

[PATCH v2 5/6] xen_arm: Set mc->max_cpus to GUEST_MAX_VCPUS in xen_arm_init()

2023-11-21 Thread Volodymyr Babchuk
From: Oleksandr Tyshchenko The number of vCPUs used for the IOREQ configuration (machine->smp.cpus) should really match the system value as for each vCPU we setup a dedicated evtchn for the communication with Xen at the runtime. This is needed for the IOREQ to be properly configured and work if

[PATCH v2 0/6] xen-arm: add support for virtio-pci

2023-11-21 Thread Volodymyr Babchuk
Hello, This patch series adds the basic support for virtio-pci for xen-arm guests. The main changes are in "xen_arm: Add virtual PCIe host bridge support", while most of other patches are required to make QEMU work as device model in a non-privileged domains like driver domain. Changes v1->v2:

[PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-21 Thread Volodymyr Babchuk
Add option to preserve owner when creating an entry in Xen Store. This may be needed in cases when Qemu is working as device model in a domain that is Domain-0, e.g. in driver domain. "owner" parameter for qemu_xen_xs_create() function can have special value XS_PRESERVE_OWNER, which will make

[PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-21 Thread Volodymyr Babchuk
was created by QEMU Xen PV devices in QEMU can be created in two ways: either by QEMU itself, if they were passed via command line, or by Xen toolstack. In the latter case, QEMU scans XenStore entries and configures devices accordingly. In the second case we don't want QEMU to write/delete

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

2023-11-21 Thread Steven Sistare
On 11/20/2023 4:44 PM, Peter Xu wrote: > 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

Re: [PATCH qemu 1/1] Implement STM32L4x5 EXTI

2023-11-21 Thread Philippe Mathieu-Daudé
Hi Arnaud, On 11/11/23 15:33, ~aminier wrote: From: Arnaud Minier Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/Kconfig| 1 + hw/arm/stm32l4x5_soc.c| 65 +- hw/misc/Kconfig | 3 + hw/misc/meson.build

[PATCH 0/1 for qemu-8.2] SeaBIOS-hppa v13

2023-11-21 Thread deller
From: Helge Deller Please pull an update of SeaBIOS-hppa to v13 to fix a system reboot crash in qemu-system-hppa as reported in https://gitlab.com/qemu-project/qemu/-/issues/1991 Helge Deller (1): target/hppa: Update SeaBIOS-hppa to version 13 pc-bios/hppa-firmware.img | Bin 681332 ->

[PATCH-for-9.0] meson: Allow building binary with no target-specific files in hw/

2023-11-21 Thread Philippe Mathieu-Daudé
Allow building a qemu-system-foo binary with target-agnostic only HW models. Signed-off-by: Philippe Mathieu-Daudé --- Although this is for 9.0, I wanted to post it today to celebrate :) Once reviewed I plan to queue it via my heterogenenous-cpus tree. --- meson.build | 8 +--- 1 file

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

2023-11-21 Thread Miles Glenn
On Tue, 2023-11-21 at 19:36 +0100, Cédric Le Goater wrote: > On 11/21/23 00:51, Glenn Miles wrote: > > 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

[PATCH v5 5/9] ppc/pnv: Wire up pca9552 GPIO pins for PCIe hotplug power control

2023-11-21 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

[PATCH v5 9/9] ppc/pnv: Test pnv i2c master and connected devices

2023-11-21 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

[PATCH v5 3/9] ppc/pnv: New powernv10-rainier machine type

2023-11-21 Thread Glenn Miles
Create a new powernv machine type, powernv10-rainier, that will contain rainier-specific devices. Signed-off-by: Glenn Miles --- Changes from previous version: - Formatting changes - Capitalized "Rainier" in machine description string - Changed powernv10-rainier parent to

[PATCH v5 7/9] misc: Add a pca9554 GPIO device model

2023-11-21 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. Reviewed-by: Cédric Le Goater Signed-off-by:

[PATCH v5 6/9] ppc/pnv: Use resettable interface to reset child I2C buses

2023-11-21 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

[PATCH v5 4/9] ppc/pnv: Add pca9552 to powernv10-rainier for PCIe hotplug power control

2023-11-21 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. Reviewed-by: Cédric Le Goater Signed-off-by: Glenn

[PATCH v5 2/9] misc/pca9552: Let external devices set pca9552 inputs

2023-11-21 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

[PATCH v5 1/9] misc/pca9552: Fix inverted input status

2023-11-21 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 v5 8/9] ppc/pnv: Add a pca9554 I2C device to powernv10-rainier

2023-11-21 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 --- No

[PATCH v5 0/9] Add powernv10 I2C devices and tests

2023-11-21 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

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

2023-11-21 Thread Richard Henderson
On 11/21/23 12:50, Richard Henderson wrote: On 11/20/23 15:32, Philippe Mathieu-Daudé wrote: Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ -   memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, ); if ( -   errp +  

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

2023-11-21 Thread Richard Henderson
On 11/20/23 15:32, Philippe Mathieu-Daudé wrote: Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, ); if ( - errp + !memory_region_init_rom_nomigrate(mr, owner,

Re: [PATCH for-8.2 0/2] qdev array property fixes

2023-11-21 Thread Thomas Huth
On 21/11/2023 18.34, Kevin Wolf wrote: Kevin Wolf (2): qdev: Fix crash in array property getter string-output-visitor: Support lists for non-integer types hw/core/qdev-properties.c| 33 ++--- qapi/string-output-visitor.c | 24 2

Re: [PATCH] target/arm: Don't implement *32_EL2 registers when EL1 is AArch64 only

2023-11-21 Thread Richard Henderson
On 11/21/23 08:46, Peter Maydell wrote: The system registers DBGVCR32_EL2, FPEXC32_EL2, DACR32_EL2 and IFSR32_EL2 are present only to allow an AArch64 EL2 or EL3 to read and write the contents of an AArch32-only system register. The architecture requires that they are present only when EL1 can

Re: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset interface

2023-11-21 Thread Philippe Mathieu-Daudé
Hi Zhenzhong, On 21/11/23 09:44, Zhenzhong Duan wrote: Legacy vfio pci and iommufd cdev have different process to hot reset vfio device, expand current code to abstract out pci_hot_reset callback for legacy vfio, this same interface will also be used by iommufd cdev vfio device. Rename

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

2023-11-21 Thread Cédric Le Goater
On 11/21/23 00:51, Glenn Miles wrote: 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"

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

2023-11-21 Thread Miles Glenn
On Tue, 2023-11-21 at 19:26 +0100, Cédric Le Goater wrote: > On 11/21/23 17:36, Miles Glenn wrote: > > On Tue, 2023-11-21 at 08:29 +0100, Cédric Le Goater wrote: > > > On 11/21/23 02:33, Nicholas Piggin wrote: > > > > On Tue Nov 21, 2023 at 9:51 AM AEST, Glenn Miles wrote: > > > > > Create a new

Re: [PATCH-for-8.2? 2/6] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize()

2023-11-21 Thread Eric Auger
Hi Phil, On 11/21/23 18:40, Philippe Mathieu-Daudé wrote: > Commit 0be6bfac62 ("qdev: Implement variable length array properties") > added the DEFINE_PROP_ARRAY() macro with the following comment: > > * It is the responsibility of the device deinit code to free the > * @_arrayfield memory. >

Re: [PATCH v3] hw/i386: fix short-circuit logic with non-optimizing builds

2023-11-21 Thread Dan Hoffman
I'm writing a patch to clang's constant folding to address this case (doesn't seem too difficult). I'll either follow up with a link to some submissions I've made or a bug report on the project describing the issue. On Tue, Nov 21, 2023 at 10:15 AM Eric Blake wrote: > > On Mon, Nov 20, 2023 at

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

2023-11-21 Thread Cédric Le Goater
On 11/21/23 17:36, Miles Glenn wrote: On Tue, 2023-11-21 at 08:29 +0100, Cédric Le Goater wrote: On 11/21/23 02:33, Nicholas Piggin wrote: 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.

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

2023-11-21 Thread Cédric Le Goater
On 11/21/23 00:51, Glenn Miles wrote: 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

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

2023-11-21 Thread Cédric Le Goater
On 11/21/23 00:51, Glenn Miles wrote: 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

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

2023-11-21 Thread Cédric Le Goater
On 11/21/23 00:51, Glenn Miles wrote: 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

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

2023-11-21 Thread Cédric Le Goater
On 11/21/23 00:51, Glenn Miles wrote: 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

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

2023-11-21 Thread Cédric Le Goater
On 11/21/23 17:36, Miles Glenn wrote: On Tue, 2023-11-21 at 08:29 +0100, Cédric Le Goater wrote: On 11/21/23 02:33, Nicholas Piggin wrote: 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.

[ANNOUNCE] QEMU 8.1.3 Stable released

2023-11-21 Thread Michael Tokarev
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi everyone, The QEMU v8.1.3 stable release is now available. You can grab the tarball from our download page here: https://www.qemu.org/download/#source v8.1.3 is now tagged in the official qemu.git repository, and the stable-8.1 branch has

[ANNOUNCE] QEMU 7.2.7 Stable released

2023-11-21 Thread Michael Tokarev
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi everyone, The QEMU v7.2.7 stable release is now available. You can grab the tarball from our download page here: https://www.qemu.org/download/#source v7.2.7 is now tagged in the official qemu.git repository, and the stable-7.2 branch has

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

2023-11-21 Thread Miles Glenn
On Tue, 2023-11-21 at 07:46 +0100, Cédric Le Goater wrote: > On 11/21/23 00:51, Glenn Miles wrote: > > Create a new powernv machine type, powernv10-rainier, that > > will contain rainier-specific devices. > > > > Signed-off-by: Glenn Miles > > --- > > hw/ppc/pnv.c | 29

[PATCH-for-8.2? 3/6] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize()

2023-11-21 Thread Philippe Mathieu-Daudé
Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 4fb013afcc added: DEFINE_PROP_ARRAY("oscclk", MPS2SCC,

[PATCH-for-8.2 6/6] hw/input/stellaris_gamepad: Free StellarisGamepad::keycodes[] array

2023-11-21 Thread Philippe Mathieu-Daudé
Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit a75f336b97 added: DEFINE_PROP_ARRAY("keycodes",

[PATCH-for-8.2? 4/6] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize()

2023-11-21 Thread Philippe Mathieu-Daudé
Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 68fbcc344e added: DEFINE_PROP_ARRAY("read-only", XlnxEFuse,

[PATCH-for-8.2? 5/6] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array

2023-11-21 Thread Philippe Mathieu-Daudé
Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 9e4aa1fafe added: DEFINE_PROP_ARRAY("pg0-lock",

[PATCH-for-8.2? 1/6] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field

2023-11-21 Thread Philippe Mathieu-Daudé
The VirtioPCIDeviceTypeInfo structure, added in commit a4ee4c8baa ("virtio: Helper for registering virtio device types") got extended in commit 8ea90ee690 ("virtio: add class_size") with the @class_size field. Do similarly with the @instance_finalize field. Signed-off-by: Philippe Mathieu-Daudé

[PATCH-for-8.2 0/6] hw: Free DEFINE_PROP_ARRAY()'s arrays in instance_finalize()

2023-11-21 Thread Philippe Mathieu-Daudé
In few places we forget to free the array allocated by the DEFINE_PROP_ARRAY() macro handlers. Fix that. Philippe Mathieu-Daudé (6): hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize() hw/misc/mps2-scc: Free

[PATCH-for-8.2? 2/6] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize()

2023-11-21 Thread Philippe Mathieu-Daudé
Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 8077b8e549 added: DEFINE_PROP_ARRAY("reserved-regions",

[PATCH for-8.2 0/2] qdev array property fixes

2023-11-21 Thread Kevin Wolf
Kevin Wolf (2): qdev: Fix crash in array property getter string-output-visitor: Support lists for non-integer types hw/core/qdev-properties.c| 33 ++--- qapi/string-output-visitor.c | 24 2 files changed, 46 insertions(+), 11

[PATCH for-8.2 1/2] qdev: Fix crash in array property getter

2023-11-21 Thread Kevin Wolf
Passing an uninitialised list to visit_start_list() happens to work for the QObject output visitor because it treats the pointer as an opaque value and never dereferences it, but the string output visitor expects a valid list to check if it has more than one element. The existing code crashes

[PATCH for-8.2 2/2] string-output-visitor: Support lists for non-integer types

2023-11-21 Thread Kevin Wolf
With the introduction of list-based array properties in qdev, the string output visitor has to deal with lists of non-integer elements now ('info qtree' prints all properties with the string output visitor). Currently there is no explicit support for such lists, and the resulting output is only

Re: [PATCH] scripts: adjust url to Coverity tools

2023-11-21 Thread Peter Maydell
On Tue, 21 Nov 2023 at 17:05, Paolo Bonzini wrote: > > The URL to the Coverity tools download has changed; the old one points > to an obsolete version that is not supported anymore. Adjust to point > to the correct and supported tools. > > Suggested-by: Peter Maydell > Signed-off-by: Paolo

Re: Instruction virtual address in TCG Plugins

2023-11-21 Thread Alex Bennée
Mikhail Tyutin writes: >> >> > I suspect it is because of memory mappings by guest OS that changes >> >> > virtual addresses for that block. >> >> > >> >> > I also looked at gen_empty_udata_cb() function and considered to extend >> >> > plugin API to pass a program counter >> >> > value as

Re: [PATCH v7 00/27] vfio: Adopt iommufd

2023-11-21 Thread Cédric Le Goater
Hello Zhenzhong On 11/21/23 09:43, Zhenzhong Duan wrote: Hi, Thanks all for giving guides and comments on previous series, this is the remaining part of the iommufd support. Besides suggested changes in v6, I'd like to highlight two changes for final review: 1. Instantiate can_be_deleted

Re: QEMU Summit Minutes 2023

2023-11-21 Thread Alex Bennée
Peter Maydell writes: > QEMU Summit Minutes 2023 > > > As usual, we held a QEMU Summit meeting at KVM Forum. This is an > invite-only meeting for the most active maintainers and submaintainers > in the project, and we discuss various project-wide issues, usually >

[PATCH] scripts: adjust url to Coverity tools

2023-11-21 Thread Paolo Bonzini
The URL to the Coverity tools download has changed; the old one points to an obsolete version that is not supported anymore. Adjust to point to the correct and supported tools. Suggested-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/run-coverity-scan | 4 ++-- 1

  1   2   3   >