[PATCH for-8.2 1/4] block: Fix bdrv_graph_wrlock() call in blk_remove_bs()

2023-11-15 Thread Kevin Wolf
While not all callers of blk_remove_bs() are correct in this respect, the assumption in the function is that callers hold the AioContext lock of the BlockBackend (this is required by the drain calls in it). In order to avoid deadlock in the nested event loop, bdrv_graph_wrlock() has then to be cal

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

2023-11-15 Thread Daniel P . Berrangé
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 Huth wrote: > > > > On 14/11/2023 17.37, Philippe Mathieu-Daudé wrote:

Re: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-15 Thread Stefan Hajnoczi
On Wed, 15 Nov 2023 at 11:57, Mike Christie wrote: > > On 11/15/23 6:57 AM, Stefan Hajnoczi wrote: > > On Wed, Nov 15, 2023 at 12:43:02PM +0100, Stefano Garzarella wrote: > >> On Mon, Nov 13, 2023 at 06:36:44PM -0600, Mike Christie wrote: > >>> This adds support for vhost-scsi to be able to create

Re: [PATCH] softmmu/memory: use memcpy for multi-byte accesses

2023-11-15 Thread Patrick Venture
On Wed, Nov 15, 2023 at 9:02 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 11/15/23 08:58, Patrick Venture wrote: > > > > > > On Wed, Nov 15, 2023 at 2:35 AM Peter Maydell > > wrote: > > > > On Tue, 14 Nov 2023 at 20:55, Patrick Venture >

Re: [PATCH] softmmu/memory: use memcpy for multi-byte accesses

2023-11-15 Thread Patrick Venture
On Wed, Nov 15, 2023 at 9:26 AM Patrick Venture wrote: > > > On Wed, Nov 15, 2023 at 9:02 AM Richard Henderson < > richard.hender...@linaro.org> wrote: > >> On 11/15/23 08:58, Patrick Venture wrote: >> > >> > >> > On Wed, Nov 15, 2023 at 2:35 AM Peter Maydell > >

[PATCH 0/3] Misc fixes for 8.2

2023-11-15 Thread David Woodhouse
Fix a use-after-free (or double-free) due to net_cleanup() freeing NICs that don't belong to it, fix a newly-introduced launch failure with a documented command line, and clean up code to avoid a Coverity warning. David Woodhouse (3): net: do not delete nics in net_cleanup() vl: disabl

[PATCH 3/3] hw/xen: clean up xen_block_find_free_vdev() to avoid Coverity false positive

2023-11-15 Thread David Woodhouse
From: David Woodhouse Coverity couldn't see that nr_existing was always going to be zero when qemu_xen_xs_directory() returned NULL in the ENOENT case (CID 1523906). Perhaps more to the point, neither could Peter at first glance. Improve the code to hopefully make it clearer to Coverity and huma

[PATCH 1/3] net: do not delete nics in net_cleanup()

2023-11-15 Thread David Woodhouse
From: David Woodhouse In net_cleanup() we only need to delete the netdevs, as those may have state which outlives Qemu when it exits, and thus may actually need to be cleaned up on exit. The nics, on the other hand, are owned by the device which created them. Most devices don't bother to clean u

[PATCH 2/3] vl: disable default serial when xen-console is enabled

2023-11-15 Thread David Woodhouse
From: David Woodhouse If a Xen console is configured on the command line, do not add a default serial port. Signed-off-by: David Woodhouse --- system/vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system/vl.c b/system/vl.c index 5af7ced2a1..8109231834 100644 --- a/system/vl.c +++ b/s

Re: [PATCH v3 31/70] i386/tdx: Allows mrconfigid/mrowner/mrownerconfig for TDX_INIT_VM

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:14:40AM -0500, Xiaoyao Li wrote: > From: Isaku Yamahata > > Three sha384 hash values, mrconfigid, mrowner and mrownerconfig, of a TD > can be provided for TDX attestation. > > So far they were hard coded as 0. Now allow user to specify those values > via property mrcon

[PATCH 0/4] ICH9 root PCI hotplug

2023-11-15 Thread Thierry Escande
Hi, This series fixes acpi_hotplug_bridge accessor names, adds new accessors for acpi-root-pci-hotplug property, and enables root PCI hotplug by default for Q35 machine. Thierry Escande (4): ich9: Remove unused hotplug field from ICH9LPCPMRegs struct ich9: Renamed use_acpi_hotplug_bridge acce

[PATCH 1/4] ich9: Remove unused hotplug field from ICH9LPCPMRegs struct

2023-11-15 Thread Thierry Escande
This patch removes the unused field use_acpi_hotplug_bridge from the ICH9LPCPMRegs structure as it is now part of AcpiPciHpState. Hotplug fields have been removed from piix4 state structure by commit 6536e427ce49 (pcihp: move fields enabling hotplug into AcpiPciHpState) so do the same for ich9. S

[PATCH 3/4] ich9: Add accessors for acpi-root-pci-hotplug

2023-11-15 Thread Thierry Escande
This patch adds accessors for acpi-root-pci-hotplug property. PCI hotplug can be enabled/disabled with: -global ICH9-LPC.acpi-root-pci-hotplug=on|off Signed-off-by: Thierry Escande --- hw/acpi/ich9.c | 17 + 1 file changed, 17 insertions(+) diff --git a/hw/acpi/ich9.c b/hw/acp

[PATCH 4/4] ich9: Enable root PCI hotplug by default

2023-11-15 Thread Thierry Escande
This patch initializes use_acpi_root_pci_hotplug to true and enables device PCI hotplug on q35 machine by default. Signed-off-by: Thierry Escande --- hw/acpi/ich9.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index e38c9bb998..ad2c8ad8ed 100644 --- a/hw/ac

[PATCH 2/4] ich9: Renamed use_acpi_hotplug_bridge accessors

2023-11-15 Thread Thierry Escande
The accessors were named as ich9_pm_get/set_acpi_pci_hotplug(). This patch renames them as ich9_pm_get/set_acpi_hotplug_bridge(). Signed-off-by: Thierry Escande --- hw/acpi/ich9.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 2

Re: [PATCH] monitor: flush messages on abort

2023-11-15 Thread Steven Sistare
On 11/15/2023 11:15 AM, Markus Armbruster wrote: > Steven Sistare writes: >> On 11/15/2023 3:41 AM, Markus Armbruster wrote: >>> Daniel P. Berrangé writes: >>> On Fri, Nov 03, 2023 at 03:51:00PM -0400, Steven Sistare wrote: > On 11/3/2023 1:33 PM, Daniel P. Berrangé wrote: >> On Fri,

Re: [PATCH v2 00/20] Use Intel DSA accelerator to offload zero page checking in multifd live migration.

2023-11-15 Thread Elena Ufimtseva
Hello Hao, On Mon, Nov 13, 2023 at 9:42 PM Hao Xiang wrote: > > v2 > * Rebase on top of 3e01f1147a16ca566694b97eafc941d62fa1e8d8. > * Leave Juan's changes in their original form instead of squashing them. > * Add a new commit to refactor the multifd_send_thread function to prepare > for introduc

Re: [PATCH v3 52/70] i386/tdx: handle TDG.VP.VMCALL

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:15:01AM -0500, Xiaoyao Li wrote: > From: Isaku Yamahata > > For GetQuote, delegate a request to Quote Generation Service. > Add property "quote-generation-socket" to tdx-guest, whihc is a property > of type SocketAddress to specify Quote Generation Service(QGS). > > On

Re: [PATCH v6 08/21] vfio/pci: Introduce a vfio pci hot reset interface

2023-11-15 Thread Eric Auger
On 11/14/23 11:09, 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 vfio_pci_ho

Re: [PATCH v3 02/70] RAMBlock: Add support of KVM private guest memfd

2023-11-15 Thread David Hildenbrand
On 15.11.23 08:14, Xiaoyao Li wrote: Add KVM guest_memfd support to RAMBlock so both normal hva based memory and kvm guest memfd based private memory can be associated in one RAMBlock. Introduce new flag RAM_GUEST_MEMFD. When it's set, it calls KVM ioctl to create private guest_memfd during RAMB

Re: [PATCH v3 52/70] i386/tdx: handle TDG.VP.VMCALL

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:15:01AM -0500, Xiaoyao Li wrote: > From: Isaku Yamahata > > For GetQuote, delegate a request to Quote Generation Service. > Add property "quote-generation-socket" to tdx-guest, whihc is a property > of type SocketAddress to specify Quote Generation Service(QGS). > > On

Re: [PATCH v3 53/70] i386/tdx: setup a timer for the qio channel

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:15:02AM -0500, Xiaoyao Li wrote: > From: Chenyi Qiang > > To avoid no response from QGS server, setup a timer for the transaction. > If timeout, make it an error and interrupt guest. Define the threshold of > time to 30s at present, maybe change to other value if not ap

Re: [PATCH v3 03/70] RAMBlock/guest_memfd: Enable KVM_GUEST_MEMFD_ALLOW_HUGEPAGE

2023-11-15 Thread David Hildenbrand
On 15.11.23 08:14, Xiaoyao Li wrote: KVM allows KVM_GUEST_MEMFD_ALLOW_HUGEPAGE for guest memfd. When the flag is set, KVM tries to allocate memory with transparent hugeapge at first and falls back to non-hugepage on failure. However, KVM defines one restriction that size must be hugepage size al

Re: [PATCH v3 04/70] HostMem: Add mechanism to opt in kvm guest memfd via MachineState

2023-11-15 Thread David Hildenbrand
On 15.11.23 08:14, Xiaoyao Li wrote: Add a new member "require_guest_memfd" to memory backends. When it's set to true, it enables RAM_GUEST_MEMFD in ram_flags, thus private kvm guest_memfd will be allocated during RAMBlock allocation. Memory backend's @require_guest_memfd is wired with @require_

Re: QEMU snapshotting

2023-11-15 Thread Stefan Hajnoczi
On Wed, Nov 15, 2023 at 03:22:02PM +, Brian Cain wrote: > Alexander, Bandan, Paolo, Stefan, Manuel, > > Hi, I'm Brian and I maintain the Hexagon arch for QEMU. Elia, a security > researcher at Qualcomm is exploring ways to fuzz some hexagon OS kernel with > QEMU and in particular leveraging

Re: [PATCH v3 07/70] physmem: Relax the alignment check of host_startaddr in ram_block_discard_range()

2023-11-15 Thread David Hildenbrand
On 15.11.23 08:14, Xiaoyao Li wrote: Commit d3a5038c461 ("exec: ram_block_discard_range") introduced ram_block_discard_range() which grabs some code from ram_discard_range(). However, during code movement, it changed alignment check of host_startaddr from qemu_host_page_size to rb->page_size. Wh

Re: [PATCH v3 08/70] physmem: replace function name with __func__ in ram_block_discard_range()

2023-11-15 Thread David Hildenbrand
On 15.11.23 08:14, Xiaoyao Li wrote: Use __func__ to avoid hard-coded function name. Signed-off-by: Xiaoyao Li --- That can be queued independently. Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH] monitor: flush messages on abort

2023-11-15 Thread Markus Armbruster
Steven Sistare writes: > On 11/15/2023 3:41 AM, Markus Armbruster wrote: >> Daniel P. Berrangé writes: >> >>> On Fri, Nov 03, 2023 at 03:51:00PM -0400, Steven Sistare wrote: On 11/3/2023 1:33 PM, Daniel P. Berrangé wrote: > On Fri, Nov 03, 2023 at 09:01:29AM -0700, Steve Sistare wrote:

Re: [PULL 0/3] tcg+sparc patch queue

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

Re: [PATCH for-8.2 0/4] block: Fix deadlocks with the stream job

2023-11-15 Thread Stefan Hajnoczi
On Wed, Nov 15, 2023 at 06:20:08PM +0100, Kevin Wolf wrote: > This series contains three fixes for deadlocks that follow the same > pattern: A nested event loop in the main thread waits for an iothread to > make progress, but the AioContext lock of that iothread is still held by > the main loop, so

Re: [PATCH v6 17/21] vfio/ccw: Make vfio cdev pre-openable by passing a file handle

2023-11-15 Thread Eric Farman
On Tue, 2023-11-14 at 18:09 +0800, Zhenzhong Duan wrote: > This gives management tools like libvirt a chance to open the vfio > cdev with privilege and pass FD to qemu. This way qemu never needs > to have privilege to open a VFIO or iommu cdev node. > > Signed-off-by: Zhenzhong Duan > Reviewed-by

Re: [PATCH v6 16/21] vfio/ccw: Allow the selection of a given iommu backend

2023-11-15 Thread Eric Farman
On Tue, 2023-11-14 at 18:09 +0800, Zhenzhong Duan wrote: > Now we support two types of iommu backends, let's add the capability > to select one of them. This depends on whether an iommufd object has > been linked with the vfio-ccw device: > > If the user wants to use the legacy backend, it shall n

Re: [PATCH v6 20/21] kconfig: Activate IOMMUFD for s390x machines

2023-11-15 Thread Eric Farman
On Tue, 2023-11-14 at 18:09 +0800, Zhenzhong Duan wrote: > From: Cédric Le Goater > > Signed-off-by: Cédric Le Goater > Signed-off-by: Zhenzhong Duan > Reviewed-by: Matthew Rosato > --- >  hw/s390x/Kconfig | 1 + >  1 file changed, 1 insertion(+) Reviewed-by: Eric Farman

Re: [PATCH 4/4] vfio/ccw: Move VFIODevice initializations in vfio_ccw_instance_init

2023-11-15 Thread Eric Farman
On Wed, 2023-11-15 at 16:32 +0800, Zhenzhong Duan wrote: > Some of the VFIODevice initializations is in vfio_ccw_realize, > move all of them in vfio_ccw_instance_init. > > No functional change intended. > > Suggested-by: Cédric Le Goater > Signed-off-by: Zhenzhong Duan > --- >  hw/vfio/ccw.c |

Re: [PATCH 3/4] vfio/ap: Move VFIODevice initializations in vfio_ap_instance_init

2023-11-15 Thread Eric Farman
On Wed, 2023-11-15 at 16:32 +0800, Zhenzhong Duan wrote: > Some of the VFIODevice initializations is in vfio_ap_realize, > move all of them in vfio_ap_instance_init. > > No functional change intended. > > Suggested-by: Cédric Le Goater > Signed-off-by: Zhenzhong Duan > --- >  hw/vfio/ap.c | 26

Re: [PULL 25/40] tests/qtest: migration: add reboot mode test

2023-11-15 Thread Steven Sistare
On 11/2/2023 7:40 AM, Juan Quintela wrote: > From: Steve Sistare > > [ Maintainer note: > > I put the test as flaky because our CI has problems with shared > memory. We will remove the flaky bits as soon as we get a solution. > ] How about disabling the test for CI instead (which Fabiano sugge

Re: [External] Re: [PATCH v2 00/20] Use Intel DSA accelerator to offload zero page checking in multifd live migration.

2023-11-15 Thread Hao Xiang
On Wed, Nov 15, 2023 at 9:43 AM Elena Ufimtseva wrote: > > Hello Hao, > > On Mon, Nov 13, 2023 at 9:42 PM Hao Xiang wrote: > > > > v2 > > * Rebase on top of 3e01f1147a16ca566694b97eafc941d62fa1e8d8. > > * Leave Juan's changes in their original form instead of squashing them. > > * Add a new commi

RE: [RFC PATCH] Hexagon (target/hexagon) Make generators object oriented

2023-11-15 Thread Brian Cain
> -Original Message- > From: Taylor Simpson > Sent: Thursday, November 9, 2023 3:26 PM > To: qemu-devel@nongnu.org > Cc: Brian Cain ; Matheus Bernardino (QUIC) > ; Sid Manning ; > richard.hender...@linaro.org; phi...@linaro.org; a...@rev.ng; a...@rev.ng; > ltaylorsimp...@gmail.com > Subj

virtio-sound segmentation fault

2023-11-15 Thread Volker Rümelin
Cc: qemu-devel Hi Manos, it's easy to trigger a segmentation fault with the virtio-sound device. The basic problem is that in function virtio_snd_realize() there is no code in the errror paths to undo the previous steps. To reproduce the segmentation fault start QEMU with an empty PCIe root port

Re: [PATCH 3/3] hw/xen: clean up xen_block_find_free_vdev() to avoid Coverity false positive

2023-11-15 Thread Paul Durrant
On 15/11/2023 12:24, David Woodhouse wrote: From: David Woodhouse Coverity couldn't see that nr_existing was always going to be zero when qemu_xen_xs_directory() returned NULL in the ENOENT case (CID 1523906). Perhaps more to the point, neither could Peter at first glance. Improve the code to

Re: [PATCH 1/4] ich9: Remove unused hotplug field from ICH9LPCPMRegs struct

2023-11-15 Thread Philippe Mathieu-Daudé
On 15/11/23 18:18, Thierry Escande wrote: This patch removes the unused field use_acpi_hotplug_bridge from the ICH9LPCPMRegs structure as it is now part of AcpiPciHpState. Hotplug fields have been removed from piix4 state structure by commit 6536e427ce49 (pcihp: move fields enabling hotplug into

Re: [PATCH] Fix CLINT clock frequency for SiFive E

2023-11-15 Thread Daniel Henrique Barboza
Hi Roman! It helps to add the maintainers/reviewers in the CC when sending the patch. You can see who need to be CCed by using the get_maintainer.pl script. E.g: ./scripts/get_maintainer.pl \[PATCH\]\ Fix\ CLINT\ clock\ frequency\ for\ SiFive\ E\ -\ rcardenas@gmail.com\ -\ 2023-11-10\ 1314.

[PATCH-for-8.2? v2] tests/avocado: Make fetch_asset() unconditionally require a crypto hash

2023-11-15 Thread Philippe Mathieu-Daudé
In a perfect world we'd have reproducible tests, but then we'd be sure we run the same binaries. If a binary artifact isn't hashed, we have no idea what we are running. Therefore enforce hashing for all our artifacts. With this change, unhashed artifacts produce: $ avocado run tests/avocado/mul

[PATCH 08/10] testing: move arm system tests into their own folder

2023-11-15 Thread Alex Bennée
Prepare for expanding the arm system tests by cleaning up the test directory. Signed-off-by: Alex Bennée --- tests/tcg/arm/Makefile.softmmu-target | 5 ++--- tests/tcg/arm/{ => system}/test-armv6m-undef.S | 0 tests/tcg/arm/{ => system}/test-armv6m-undef.ld | 0 3 files changed, 2 ins

Re: [PULL 06/23] tests/tcg: add an explicit gdbstub register tester

2023-11-15 Thread Alex Bennée
"Nicholas Piggin" writes: > On Wed Nov 8, 2023 at 12:23 AM AEST, Alex Bennée wrote: >> We already do a couple of "info registers" for specific tests but this >> is a more comprehensive multiarch test. It also has some output >> helpful for debugging the gdbstub by showing which XML features are >

[PATCH 06/10] docs/emulation: expand warning about semihosting

2023-11-15 Thread Alex Bennée
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 file changed, 3 insertions(+), 2 deletions

[PATCH 10/10] tests/tcg: enable semiconsole test for Arm

2023-11-15 Thread Alex Bennée
This still remains a MANUAL test due to blocking issues. Signed-off-by: Alex Bennée --- tests/tcg/arm/system/semiconsole.c| 42 +++ tests/tcg/arm/Makefile.softmmu-target | 9 ++ 2 files changed, 51 insertions(+) create mode 100644 tests/tcg/arm/system/semiconsol

[PATCH 09/10] tests/tcg: enable arm softmmu tests

2023-11-15 Thread Alex Bennée
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. Signed-off-by: Alex Bennée --- tests/tcg/arm/Makefile.softmmu-target | 64 +- tests/tc

[PATCH 03/10] tests/docker: merge debian-native with debian-amd64

2023-11-15 Thread Alex Bennée
debian-native isn't really needed and suffers from the problem of tracking a distros dependencies rather than the projects. With a little surgery we can make the debian-amd64 container architecture neutral and allow people to use it to build a native QEMU. Rename it so it follows the same non-arch

[PATCH 00/10] random fixes for 8.2 (tests, plugins, docs, semihosting)

2023-11-15 Thread Alex Bennée
I've just been trying to clear some of the bugs against various subsystems. These are mostly testing changes and a minor tweak I found while checking up on semihosting behaviour. Enabling arm-softmmu check-tcg tests expands our testing abilities slightly for the 32 bit side of the family. Let me k

[PATCH 05/10] tests/tcg: fixup Aarch64 semiconsole test

2023-11-15 Thread Alex Bennée
We need to ensure we squash the serial port if we want to hand craft our muxed input. As a bonus emit the example with a V=1 build to make it easier for people to figure out. Signed-off-by: Alex Bennée --- tests/tcg/aarch64/Makefile.softmmu-target | 5 +++-- 1 file changed, 3 insertions(+), 2 de

[PATCH 01/10] tests/docker: replace fedora-i386 with debian-i686

2023-11-15 Thread Alex Bennée
From: Daniel P. Berrangé Fedora is gradually killing off i386 packages in its repos, via a death-by-1000-cuts process. Thus Debian looks like a better long term bet for i686 build testing. It has the added advantage that we can generate it via lcitool too. Signed-off-by: Daniel P. Berrangé Revi

[PATCH 07/10] hw/core: skip loading debug on all failures

2023-11-15 Thread Alex Bennée
ELF_LOAD_FAILED is one of many negative return codes we can have. Lets treat any positive size_t as a success for loading. Signed-off-by: Alex Bennée --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 3c79283777..e7a

[PATCH 04/10] plugins: fix win plugin tests on cross compile

2023-11-15 Thread Alex Bennée
From: Greg Manning Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1972 Cross compile gcc is more picky about argument order than msys. Changed the meson command to take the (now renamed) libqemu_plugin_api.a as a lib, rather than an object. This puts it in the right place on both native

[PATCH 02/10] .gitlab-ci.d/cirrus: Upgrade macOS to 13 (Ventura)

2023-11-15 Thread Alex Bennée
From: Philippe Mathieu-Daudé macOS 14 "Sonoma" was released on September 2023 [1]. According to QEMU's support policy, we stop supporting the previous major release two years after the the new major release has been published. Replace the macOS 12 (Monterey) testing by macOS 13 (Ventura, release

RE: [RFC PATCH] Hexagon (target/hexagon) Make generators object oriented

2023-11-15 Thread Brian Cain
> -Original Message- > From: qemu-devel-bounces+bcain=quicinc@nongnu.org AFAICT the keys for registers and new_registers can be derived from the values > themselves. Rather than worry about copy/paste errors causing these not to > correspond, you can create a dictionary from an iterab

Re: [PATCH 07/10] hw/core: skip loading debug on all failures

2023-11-15 Thread Richard Henderson
On 11/15/23 12:55, Alex Bennée wrote: ELF_LOAD_FAILED is one of many negative return codes we can have. Lets treat any positive size_t as a success for loading. Signed-off-by: Alex Bennée --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Hender

Re: [PATCH 08/10] testing: move arm system tests into their own folder

2023-11-15 Thread Richard Henderson
On 11/15/23 12:55, Alex Bennée wrote: Prepare for expanding the arm system tests by cleaning up the test directory. Signed-off-by: Alex Bennée --- tests/tcg/arm/Makefile.softmmu-target | 5 ++--- tests/tcg/arm/{ => system}/test-armv6m-undef.S | 0 tests/tcg/arm/{ => system}/test-

Re: [PATCH 09/10] tests/tcg: enable arm softmmu tests

2023-11-15 Thread Richard Henderson
On 11/15/23 12:55, Alex Bennée wrote: +vector_table: + b reset /* reset vector */ + b undef_instr/* undefined instruction vector */ + b software_intr /* software interrupt vector */ + b prefetch_abort /* prefetch abort vecto

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

2023-11-15 Thread Philippe Mathieu-Daudé
Hi Inès, On 15/11/23 08:59, ~inesvarhol wrote: From: Inès Varhol This patch adds a new STM32L475VG SoC, it is necessary to add support for the B-L475E-IOT01A board. Thanks for your first contribution! See my comments inline. The implementation is derived from the STM32F405 SoC. You might

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

2023-11-15 Thread Philippe Mathieu-Daudé
Hi Inès, On 15/11/23 09:04, ~inesvarhol wrote: 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. Signed-off-by: default avatarArnau

RE: [RFC PATCH] Hexagon (target/hexagon) Make generators object oriented

2023-11-15 Thread ltaylorsimpson
> -Original Message- > From: Brian Cain > Sent: Wednesday, November 15, 2023 1:51 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: Matheus Bernardino (QUIC) ; Sid > Manning ; richard.hender...@linaro.org; > phi...@linaro.org; a...@rev.ng; a...@rev.ng > Subject: RE: [RFC PATCH] Hexa

Re: [PATCH v3 3/8] ppc/pnv: PNV I2C engines assigned incorrect XSCOM addresses

2023-11-15 Thread Cédric Le Goater
On 11/14/23 20:56, 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 num

Re: [PATCH v3 4/8] ppc/pnv: Fix PNV I2C invalid status after reset

2023-11-15 Thread Cédric Le Goater
On 11/14/23 20:56, 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 t

Re: [PATCH v3 1/8] ppc/pnv: Add pca9552 to powernv10 for PCIe hotplug power control

2023-11-15 Thread Cédric Le Goater
On 11/15/23 17:37, Miles Glenn wrote: On Wed, 2023-11-15 at 08:28 +0100, Cédric Le Goater wrote: On 11/14/23 20:56, Glenn Miles wrote: 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)

Re: [PATCH 07/10] hw/core: skip loading debug on all failures

2023-11-15 Thread Philippe Mathieu-Daudé
On 15/11/23 21:55, Alex Bennée wrote: ELF_LOAD_FAILED is one of many negative return codes we can have. Lets treat any positive size_t as a success for loading. Signed-off-by: Alex Bennée --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathi

Re: [PATCH 08/10] testing: move arm system tests into their own folder

2023-11-15 Thread Philippe Mathieu-Daudé
On 15/11/23 21:55, Alex Bennée wrote: Prepare for expanding the arm system tests by cleaning up the test directory. Signed-off-by: Alex Bennée --- tests/tcg/arm/Makefile.softmmu-target | 5 ++--- tests/tcg/arm/{ => system}/test-armv6m-undef.S | 0 tests/tcg/arm/{ => system}/test-

[PATCH-for-8.2? 0/6] hw/arm/stm32xxx: Report error when incorrect CPU is used

2023-11-15 Thread Philippe Mathieu-Daudé
Hi, While reviewing this [1] series from Arnaud and Inès, I realized STM32 based boards don't check the requested CPU type is correct, and ignore it. Possibly confusing users. Since these simple boards code is used as template, I took the opportunity to sanitize it a bit, using the MachineClass::v

[PATCH-for-8.2? 1/6] hw/arm/stm32f405: Report error when incorrect CPU is used

2023-11-15 Thread Philippe Mathieu-Daudé
Both 'netduinoplus2' and 'olimex-stm32-h405' machines ignore the CPU type requested by the command line. This might confuse users, since the following will create a machine with a Cortex-M4 CPU: $ qemu-system-aarch64 -M netduinoplus2 -cpu cortex-r5f Set the MachineClass::valid_cpu_types field (

[PATCH-for-9.0 5/6] hw/arm/npcm7xx_boards: Simplify setting MachineClass::valid_cpu_types[]

2023-11-15 Thread Philippe Mathieu-Daudé
The npcm7xx Soc is created with a Cortex-A9 core, see in hw/arm/npcm7xx.c: static void npcm7xx_init(Object *obj) { NPCM7xxState *s = NPCM7XX(obj); for (int i = 0; i < NPCM7XX_MAX_NUM_CPUS; i++) { object_initialize_child(obj, "cpu[*]", &s->cpu[i],

[PATCH-for-9.0 6/6] hw/arm/musca: Simplify setting MachineClass::valid_cpu_types[]

2023-11-15 Thread Philippe Mathieu-Daudé
Musca boards use the embedded subsystems (SSE) tied to a specific Cortex core. Our models only use the Cortex-M33. Use the common code introduced in commit c9cf636d48 ("machine: Add a valid_cpu_types property") to check for valid CPU type at the board level. Remove the now unused MachineClass::de

[PATCH-for-8.2? 3/6] hw/arm/stm32f100: Report error when incorrect CPU is used

2023-11-15 Thread Philippe Mathieu-Daudé
The 'stm32vldiscovery' machine ignores the CPU type requested by the command line. This might confuse users, since the following will create a machine with a Cortex-M3 CPU: $ qemu-system-aarch64 -M stm32vldiscovery -cpu neoverse-n1 Set the MachineClass::valid_cpu_types field (introduced in comm

[PATCH-for-8.2? 2/6] hw/arm/stm32f205: Report error when incorrect CPU is used

2023-11-15 Thread Philippe Mathieu-Daudé
The 'netduino2' machine ignores the CPU type requested by the command line. This might confuse users, since the following will create a machine with a Cortex-M3 CPU: $ qemu-system-arm -M netduino2 -cpu cortex-a9 Set the MachineClass::valid_cpu_types field (introduced in commit c9cf636d48 "machi

[PATCH-for-9.0 4/6] hw/arm/msf2: Simplify setting MachineClass::valid_cpu_types[]

2023-11-15 Thread Philippe Mathieu-Daudé
The M2Sxxx SoC family can only be used with Cortex-M3. Propagating the CPU type from the board level is pointless. Hard-code the CPU type at the SoC level. Remove the now ignored MachineClass::default_cpu_type field. Use the common code introduced in commit c9cf636d48 ("machine: Add a valid_cpu_t

Re: [RFC 0/2] vhost-user-test: Add negotiated features check

2023-11-15 Thread Yong Huang
ping On Sun, Nov 12, 2023 at 9:03 PM Hyman Huang wrote: > The patchset "Fix the virtio features negotiation flaw" fix a > vhost-user negotiation flaw: > c9bdc449f9 vhost-user: Fix the virtio features negotiation flaw > bebcac052a vhost-user: Refactor the chr_closed_bh > 937b7d96e4 vhost-user: Re

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

2023-11-15 Thread Nicholas Piggin
On Thu Nov 16, 2023 at 3:22 AM AEST, 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

[PATCH 12/19] qapi/schema: split "checked" field into "checking" and "checked"

2023-11-15 Thread John Snow
Differentiate between "actively in the process of checking" and "checking has completed". This allows us to clean up the types of some internal fields such as QAPISchemaObjectType's members field which currently uses "None" as a canary for determining if check has completed. This simplifies the ty

[PATCH 03/19] qapi/schema: name QAPISchemaInclude entities

2023-11-15 Thread John Snow
It simplifies typing to mandate that entities will always have a name; to achieve this we can occasionally assign an internal name. This alleviates errors such as: qapi/schema.py:287: error: Argument 1 to "__init__" of "QAPISchemaEntity" has incompatible type "None"; expected "str" [arg-type] Try

[PATCH 18/19] qapi/schema: remove unnecessary asserts

2023-11-15 Thread John Snow
With strict typing enabled, these runtime statements aren't necessary anymore. Signed-off-by: John Snow --- scripts/qapi/schema.py | 23 --- 1 file changed, 23 deletions(-) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 5d19b59def0..b5f377e68b8 100644 ---

[PATCH 17/19] qapi/schema: turn on mypy strictness

2023-11-15 Thread John Snow
This patch can be rolled in with the previous one once the series is ready for merge, but for work-in-progress' sake, it's separate here. Signed-off-by: John Snow --- scripts/qapi/mypy.ini | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index

[PATCH 19/19] qapi/schema: refactor entity lookup helpers

2023-11-15 Thread John Snow
This is not a clear win, but I was confused and I couldn't help myself. Before: lookup_entity(self, name: str, typ: Optional[type] = None ) -> Optional[QAPISchemaEntity]: ... lookup_type(self, name: str) -> Optional[QAPISchemaType]: ... resolve_type(self, name: str, info: Optional

[PATCH 00/19] qapi: statically type schema.py

2023-11-15 Thread John Snow
Hi! This branch has some comical name like python-qapi-cleanup-pt6-v2 but, simply, it finishes what I started and statically types all of the QAPI generator code. GitLab CI: https://gitlab.com/jsnow/qemu/-/pipelines/1074124051 Patch 1 is an actual fix, Patch 2 is a minor patch for pylint with no

[PATCH 02/19] qapi/schema: add pylint suppressions

2023-11-15 Thread John Snow
With this, pylint is happy with the file, so enable it in the configuration. Signed-off-by: John Snow --- scripts/qapi/pylintrc | 5 - scripts/qapi/schema.py | 4 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index 90546df5

[PATCH 15/19] qapi/parser: demote QAPIExpression to Dict[str, Any]

2023-11-15 Thread John Snow
Dict[str, object] is a stricter type, but with the way that code is currently arranged, it is infeasible to enforce this strictness. In particular, although expr.py's entire raison d'être is normalization and type-checking of QAPI Expressions, that type information is not "remembered" in any meani

[PATCH 13/19] qapi/schema: fix typing for QAPISchemaVariants.tag_member

2023-11-15 Thread John Snow
There are two related changes here: (1) We need to perform type narrowing for resolving the type of tag_member during check(), and (2) tag_member is a delayed initialization field, but we can hide it behind a property that raises an Exception if it's called too early. This simplifies

[PATCH 11/19] qapi/schema: fix QAPISchemaArrayType.check's call to resolve_type

2023-11-15 Thread John Snow
There's more conditionals in here than we can reasonably pack into a terse little statement, so break it apart into something more explicit. (When would a built-in array ever cause a QAPISemError? I don't know, maybe never - but the type system wasn't happy all the same.) Signed-off-by: John Snow

[PATCH 01/19] qapi/schema: fix QAPISchemaEntity.__repr__()

2023-11-15 Thread John Snow
This needs parentheses to work how you want it to: >>> "%s-%s-%s" % 'a', 'b', 'c' Traceback (most recent call last): File "", line 1, in TypeError: not enough arguments for format string >>> "%s-%s-%s" % ('a', 'b', 'c') 'a-b-c' Signed-off-by: John Snow --- scripts/qapi/schema.py | 2 +- 1 f

[PATCH 07/19] qapi/introspect: assert schema.lookup_type did not fail

2023-11-15 Thread John Snow
lookup_type() is capable of returning None, but introspect.py isn't prepared for that. (And rightly so, if these built-in types are absent, something has gone hugely wrong.) RFC: This is slightly cumbersome as-is, but a patch at the end of this series tries to address it with some slightly slicker

[PATCH 04/19] qapi/schema: declare type for QAPISchemaObjectTypeMember.type

2023-11-15 Thread John Snow
declare, but don't initialize the type of "type" to be QAPISchemaType - and allow the value to be initialized during check(). This avoids the need for several "assert type is not None" statements littered throughout the code by asserting it "will always be set." It's a little hokey, but it works

[PATCH 08/19] qapi/schema: add static typing and assertions to lookup_type()

2023-11-15 Thread John Snow
This function is a bit hard to type as-is; mypy needs some assertions to assist with the type narrowing. Signed-off-by: John Snow --- scripts/qapi/schema.py | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index a10942838

[PATCH 14/19] qapi/schema: assert QAPISchemaVariants are QAPISchemaObjectType

2023-11-15 Thread John Snow
I'm actually not too sure about this one, it seems to hold up at runtime but instead of lying and coming up with an elaborate ruse as a commit message I'm just going to admit I just cribbed my own notes from the last time I typed schema.py and I no longer remember why or if this is correct. Cool!

[PATCH 06/19] qapi/schema: adjust type narrowing for mypy's benefit

2023-11-15 Thread John Snow
We already take care to perform some type narrowing for arg_type and ret_type, but not in a way where mypy can utilize the result. A simple change to use a temporary variable helps the medicine go down. Signed-off-by: John Snow --- scripts/qapi/schema.py | 17 + 1 file changed, 9

[PATCH 16/19] qapi/schema: add type hints

2023-11-15 Thread John Snow
This patch only adds type hints, which aren't utilized at runtime and don't change the behavior of this module in any way. In a scant few locations, type hints are removed where no longer necessary due to inference power from typing all of the rest of creation; and any type hints that no longer ne

[PATCH 05/19] qapi/schema: make c_type() and json_type() abstract methods

2023-11-15 Thread John Snow
These methods should always return a str, it's only the default abstract implementation that doesn't. They can be marked "abstract" by raising NotImplementedError(), which requires subclasses to override the method with the proper return type. Signed-off-by: John Snow --- scripts/qapi/schema.py

[PATCH 10/19] qapi/schema: make QAPISchemaArrayType.element_type non-Optional

2023-11-15 Thread John Snow
This field should always be present and defined. Change this to be a runtime @property that can emit an error if it's called prior to check(). This helps simplify typing by avoiding the need to interrogate the value for None at multiple callsites. RFC: Yes, this is a slightly different technique

[PATCH 09/19] qapi/schema: assert info is present when necessary

2023-11-15 Thread John Snow
QAPISchemaInfo is sometimes defined as an Optional field because built-in definitions don't *have* a source definition. As a consequence, there are a few places where we need to assert that it's present because the root entity definition only suggests it's "Optional". Signed-off-by: John Snow ---

RE: [PATCH v6 11/21] vfio/pci: Make vfio cdev pre-openable by passing a file handle

2023-11-15 Thread Duan, Zhenzhong
Hi Philippe, >-Original Message- >From: Cédric Le Goater >Sent: Wednesday, November 15, 2023 9:05 PM >Subject: Re: [PATCH v6 11/21] vfio/pci: Make vfio cdev pre-openable by passing >a >file handle > >On 11/15/23 13:09, Philippe Mathieu-Daudé wrote: >> Hi Zhenzhong, >> >> On 14/11/23 11:0

RE: [PATCH] tests/qtest: remove unused variables

2023-11-15 Thread Zhang, Chen
> -Original Message- > From: qemu-devel-bounces+chen.zhang=intel@nongnu.org devel-bounces+chen.zhang=intel@nongnu.org> On Behalf Of zhujun2 > Sent: Wednesday, November 15, 2023 4:00 PM > To: th...@redhat.com > Cc: lviv...@redhat.com; pbonz...@redhat.com; qemu-devel@nongnu.org; >

RE: [PATCH 1/4] vfio/pci: Move VFIODevice initializations in vfio_instance_init

2023-11-15 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Wednesday, November 15, 2023 9:12 PM >Subject: Re: [PATCH 1/4] vfio/pci: Move VFIODevice initializations in >vfio_instance_init > >On 11/15/23 09:32, Zhenzhong Duan wrote: >> Some of the VFIODevice initializations is in vfio_realize, >>

Re: [PATCH v3 02/70] RAMBlock: Add support of KVM private guest memfd

2023-11-15 Thread Xiaoyao Li
On 11/16/2023 1:54 AM, David Hildenbrand wrote: On 15.11.23 08:14, Xiaoyao Li wrote: Add KVM guest_memfd support to RAMBlock so both normal hva based memory and kvm guest memfd based private memory can be associated in one RAMBlock. Introduce new flag RAM_GUEST_MEMFD. When it's set, it calls

<    1   2   3   >