[PATCH v2] vfio/container: Fix container object destruction

2024-11-15 Thread Cédric Le Goater
When commit 96b7af4388b3 intoduced a .instance_finalize() handler, it did not take into account that the container was not necessarily inserted into the container list of the address space. Hence, if the container object is destroyed, by calling object_unref() for example, before vfio_address_space

RE: [PATCH v2] vfio/container: Fix container object destruction

2024-11-15 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, November 15, 2024 4:35 PM >Subject: [PATCH v2] vfio/container: Fix container object destruction > >When commit 96b7af4388b3 intoduced a .instance_finalize() handler, >it did not take into account that the container was not neces

Re: [PATCH for-9.2] vfio/container: Fix container object destruction

2024-11-15 Thread Cédric Le Goater
Zhenzhong On 11/15/24 08:45, Duan, Zhenzhong wrote: Hi Cédric, -Original Message- From: Cédric Le Goater Sent: Friday, November 15, 2024 2:53 PM Subject: [PATCH for-9.2] vfio/container: Fix container object destruction When commit 96b7af4388b3 intoduced a .instance_finalize() handler

[PATCH v2] vhost_net: fix assertion triggered by batch of host notifiers processing

2024-11-15 Thread Zuo boqun via
From: zuoboqun When the backend of vhost_net restarts during the vm is running, vhost_net is stopped and started. The virtio_device_grab_ioeventfd() fucntion in vhost_net_enable_notifiers() will result in a call to virtio_bus_set_host_notifier()(assign=false). And now virtio_device_grab_ioeventf

Re: QEMU wiki theme table of contents changes

2024-11-15 Thread Daniel P . Berrangé
On Thu, Nov 14, 2024 at 02:04:35PM -0500, Stefan Hajnoczi wrote: > On Thu, 14 Nov 2024 at 05:51, Daniel P. Berrangé wrote: > > > > Looking at > > > > https://wiki.qemu.org/ChangeLog/9.2 > > > > I'm thinking that I'm sure there used to be a table of contents present > > at the top of pages, but n

Re: [PATCH v2] vhost_net: fix assertion triggered by batch of host notifiers processing

2024-11-15 Thread Stefano Garzarella
On Fri, Nov 15, 2024 at 04:03:12PM +0800, Zuo boqun wrote: From: zuoboqun When the backend of vhost_net restarts during the vm is running, vhost_net is stopped and started. The virtio_device_grab_ioeventfd() fucntion in vhost_net_enable_notifiers() will result in a call to virtio_bus_set_host_n

Re: [PATCH v1 2/2] migration: Do not perform RAMBlock dirty sync during the first iteration

2024-11-15 Thread David Hildenbrand
But then I realized that even memory_region_clear_dirty_bitmap() will not clear the ramblock_dirty_bitmap_ bits! It's only concerned about listener->log_clear() calls. Looking for DIRTY_MEMORY_BLOCK_SIZE users, only cpu_physical_memory_sync_dirty_bitmap() and cpu_physical_memory_clear_dirty_rang

Re: [PATCH] hw: Add "loadparm" property to scsi disk devices for booting on s390x

2024-11-15 Thread Thomas Huth
On 15/11/2024 12.49, Paolo Bonzini wrote: On Fri, Nov 15, 2024 at 7:30 AM Thomas Huth wrote: Ok, great! Sounds like we have a passable solution for QEMU 9.2. We still can refine the loadparm handling of the scsi devices in future QEMU releases, but this will now at least solve the present probl

Re: [PATCH 09/19] hw/intc/xilinx_intc: Only expect big-endian accesses

2024-11-15 Thread Michal Simek
On 11/14/24 23:43, Philippe Mathieu-Daudé wrote: +Michal for Linux driver On 5/11/24 23:08, Edgar E. Iglesias wrote: On Tue, Nov 05, 2024 at 02:04:21PM +0100, Philippe Mathieu-Daudé wrote: Per the datasheet (reference added in file header, p.9) 'Programming Model' -> 'Register Data Types an

Re: [PATCH] docs: explicitly permit a "commonly known identity" with SoB

2024-11-15 Thread Peter Maydell
On Mon, 21 Oct 2024 at 20:10, Daniel P. Berrangé wrote: > > The docs for submitting a patch describe using your "Real Name" with > the Signed-off-by line. Although somewhat ambiguous, this has often > been interpreted to mean someone's legal name. > > In recent times, there's been a general push b

Re: [PATCH] configure: Use -ef to compare paths

2024-11-15 Thread Paolo Bonzini
On 11/11/24 08:50, Thomas Huth wrote: On 11/11/2024 08.19, Akihiko Odaki wrote: configure checks if it is executed in the source directory by comparing the literal paths, but there may be multiple representations of a directory due to symbolic links. Use the -ef operator to tell if they point to

Re: [PATCH 02/10] target/loongarch: Declare loongarch_cpu_dump_state() locally

2024-11-15 Thread Richard Henderson
On 11/15/24 07:20, Philippe Mathieu-Daudé wrote: loongarch_cpu_dump_state() is not used outside of cpu.c, no need to expose its prototype. Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/internals.h | 2 -- target/loongarch/cpu.c | 2 +- 2 files changed, 1 insertion(+), 3 de

[PATCH] tcg: Allow top bit of SIMD_DATA_BITS to be set in simd_desc()

2024-11-15 Thread Peter Maydell
In simd_desc() we create a SIMD descriptor from various pieces including an arbitrary data value from the caller. We try to sanitize these to make sure everything will fit: the 'data' value needs to fit in the SIMD_DATA_BITS (== 22) sized field. However we do that sanitizing with: tcg_debug_as

Re: [PATCH v3 1/9] hw: eliminate qdev_try_new, isa_try_new & usb_try_new

2024-11-15 Thread Peter Xu
On Fri, Nov 15, 2024 at 05:25:13PM +, Daniel P. Berrangé wrote: > diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c > index 40b2567aa7..558f17d3ba 100644 > --- a/hw/s390x/s390-pci-bus.c > +++ b/hw/s390x/s390-pci-bus.c > @@ -922,11 +922,7 @@ static S390PCIBusDevice > *s390_pci_devi

Re: [PATCH v3 2/9] qom: refactor checking abstract property when creating instances

2024-11-15 Thread Peter Xu
On Fri, Nov 15, 2024 at 05:25:14PM +, Daniel P. Berrangé wrote: > Push an Error object into object_initialize_with_type, so that > reporting of attempts to create an abstract type is handled at > the lowest level. > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH v3 7/9] qom: introduce qdev_new_dynamic()

2024-11-15 Thread Peter Xu
On Fri, Nov 15, 2024 at 05:25:19PM +, Daniel P. Berrangé wrote: > qdev_new() has a failure scenario where it will assert() if given > an abstract type. Callers which are creating qdevs based on user > input, or unknown/untrusted type names, must manually check the > result of qdev_class_is_abst

Re: [PATCH v3 1/9] hw: eliminate qdev_try_new, isa_try_new & usb_try_new

2024-11-15 Thread Daniel P . Berrangé
On Fri, Nov 15, 2024 at 12:54:10PM -0500, Peter Xu wrote: > On Fri, Nov 15, 2024 at 05:25:13PM +, Daniel P. Berrangé wrote: > > diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c > > index 40b2567aa7..558f17d3ba 100644 > > --- a/hw/s390x/s390-pci-bus.c > > +++ b/hw/s390x/s390-pci-bu

Re: [PATCH v2 4/4] qapi: expose all schema features to code

2024-11-15 Thread Daniel P . Berrangé
On Fri, Nov 15, 2024 at 08:47:20AM +0100, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Thu, Nov 14, 2024 at 01:48:28PM +0100, Markus Armbruster wrote: > >> Daniel P. Berrangé writes: > >> > >> > This replaces use of the constants from the QapiSpecialFeatures > >> > enum, with

Re: [PATCH 0/5] Make WDOGCONTROL.INTEN the counter enable of the CMSDK APB Watchdog

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 17:21, Roque Arcudia Hernandez wrote: > > Hello, > > I forgot to add the -v 2 to this patch series. This is the second > version after Peter's feedback. Shall I resend it again or is it fine > like this? It's fine like this, no need to resend just to add the v2 tag. -- PMM

[PULL 12/14] linux-user/ppc: Reduce vdso alignment to 4k

2024-11-15 Thread Richard Henderson
Reduce vdso alignment to minimum page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/ppc/Makefile.vdso | 6 -- linux-user/ppc/vdso-32.so| Bin 3020 -> 3020 bytes linux-user/ppc/vdso-64.so| Bin 3896 -> 3896 bytes linux-user/ppc/vdso-64le.

Re: [RFC PATCH 2/5] hw/arm/smmuv3: Add initial support for SMMUv3 Nested device

2024-11-15 Thread Nicolin Chen
On Thu, Nov 14, 2024 at 08:20:08AM +, Shameerali Kolothum Thodi wrote: > > > diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index > > > 46f48fe561..50e47a4ef3 100644 > > > --- a/include/hw/arm/virt.h > > > +++ b/include/hw/arm/virt.h > > > @@ -50,6 +50,9 @@ > > > /* MMIO region siz

Re: [PATCH v2 01/31] include: move include/qapi/qmp/ to include/qobject/

2024-11-15 Thread Daniel P . Berrangé
On Thu, Nov 14, 2024 at 03:30:47PM +0100, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > The general expectation is that header files should follow the same > > file/path naming scheme as the corresponding source file. There are > > various historical exceptions to this practice in Q

Re: [PATCH v1 2/2] migration: Do not perform RAMBlock dirty sync during the first iteration

2024-11-15 Thread David Hildenbrand
We better double check and document that, because it must be guaranteed, not "let's cross fingers". Yes, we should double check on at least known good use cases, maybe not all. E.g., I see nvmm_log_sync() and whpx_log_sync() unconditionally set dirty to all mem always. I actually don't know ho

Re: [PATCH 1/3] hw/watchdog/cmsdk_apb_watchdog: Fix INTEN issues

2024-11-15 Thread Roque Arcudia Hernandez
I'll be removing the extra line in the comment and adding a new patch modifying the link in version 2. On Thu, Nov 14, 2024 at 4:53 AM Peter Maydell wrote: > > On Fri, 8 Nov 2024 at 19:10, Roque Arcudia Hernandez > wrote: > > > > Current watchdog is free running out of reset, this combined with

Re: [PATCH 07/10] accel/tcg: Reduce log_pc() declaration scope

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 15:22, Philippe Mathieu-Daudé wrote: > > log_pc() is only used in cpu-exec.c, move it there. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell thanks -- PMM

[PATCH 1/5] hw/watchdog/cmsdk_apb_watchdog: Fix broken link

2024-11-15 Thread Roque Arcudia Hernandez
The patch changes the comments to point to the latest Design Kit Technical Reference Manual. Signed-off-by: Roque Arcudia Hernandez --- hw/watchdog/cmsdk-apb-watchdog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/watchdog/cmsdk-apb-watchdog.c b/hw/watchdog/cmsdk-ap

[PATCH 5/5] tests/qtest/cmsdk-apb-watchdog-test: Test INTEN as counter enable

2024-11-15 Thread Roque Arcudia Hernandez
The following tests focus on making sure the counter is not running out of reset and the proper use of INTEN as the counter enable. As described in: https://developer.arm.com/documentation/ddi0479/d/apb-components/apb-watchdog/programmers-model The new tests have to target an MPS2 machine because

Re: [PATCH 05/10] accel/tcg: Move cpu_unwind_state_data() declaration

2024-11-15 Thread Philippe Mathieu-Daudé
On 15/11/24 15:48, Peter Maydell wrote: On Fri, 15 Nov 2024 at 15:21, Philippe Mathieu-Daudé wrote: cpu_unwind_state_data() is specific to TCG accelerator, move it to "exec/translate-all.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h| 13 - include

[PATCH 06/12] rust: cargo: store desired warning levels in workspace Cargo.toml

2024-11-15 Thread Paolo Bonzini
An extra benefit of workspaces is that they allow to place lint level settings in a single Cargo.toml; the settings are then inherited by packages in the workspace. Correspondingly, teach rustc_args.py to get the unexpected_cfgs configuration from the workspace Cargo.toml. Note that it is still p

Re: [PATCH 2/2] arm/ptw: respect sctlr.{u}wxn in get_phys_addr_v6

2024-11-15 Thread Pavel Skripkin
Hi Peter, Peter Maydell says: On Thu, 14 Nov 2024 at 16:59, Pavel Skripkin wrote: get_phys_addr_v6() is used for decoding armv7's short descriptor format. Based on ARM ARM AArch32.S1SDHasPermissionsFault(), WXN should be respected in !LPAE mode as well. Signed-off-by: Pavel Skripkin --- t

Re: [PATCH 03/10] target/sparc: Move sparc_restore_state_to_opc() to cpu.c

2024-11-15 Thread Richard Henderson
On 11/15/24 07:20, Philippe Mathieu-Daudé wrote: Most targets define their restore_state_to_opc() handler in cpu.c. In order to keep SPARC aligned, move sparc_restore_state_to_opc() from translate.c to cpu.c. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sp

Re: [PATCH 2/2] arm/ptw: respect sctlr.{u}wxn in get_phys_addr_v6

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 16:54, Pavel Skripkin wrote: > > Hi Peter, > > Peter Maydell says: > > On Thu, 14 Nov 2024 at 16:59, Pavel Skripkin wrote: > >> > >> get_phys_addr_v6() is used for decoding armv7's short descriptor format. > >> Based on ARM ARM AArch32.S1SDHasPermissionsFault(), WXN should

Re: [RFC PATCH 0/6] Enable shared device assignment

2024-11-15 Thread David Hildenbrand
On 15.11.24 17:47, Rob Nertney wrote: On Tue, Oct 08, 2024 at 04:59:45PM +0800, Chenyi Qiang wrote: Hi Paolo, Kindly ping for this thread. The in-place page conversion is discussed at Linux Plumbers. Does it give some direction for shared device assignment enabling work? Hi everybody. Hi,

Re: [PATCH 0/5] Make WDOGCONTROL.INTEN the counter enable of the CMSDK APB Watchdog

2024-11-15 Thread Roque Arcudia Hernandez
Hello, I forgot to add the -v 2 to this patch series. This is the second version after Peter's feedback. Shall I resend it again or is it fine like this? Thanks Roque On Fri, Nov 15, 2024 at 8:03 AM Roque Arcudia Hernandez wrote: > > The following patchset tries to address an issue where the w

Re: [PATCH 06/10] accel/tcg: Remove cpu_unwind_state_data() unused CPUState argument

2024-11-15 Thread Richard Henderson
On 11/15/24 07:20, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- include/exec/translate-all.h | 3 +-- accel/tcg/translate-all.c| 2 +- target/i386/helper.c | 3 ++- target/openrisc/sys_helper.c | 7 +++ 4 files changed, 7 insertions(+), 8 deletion

Re: [PATCH 01/10] target/mips: Drop left-over comment about Jazz machine

2024-11-15 Thread Richard Henderson
On 11/15/24 07:20, Philippe Mathieu-Daudé wrote: Commit 3803b6b427 ("target/mips: Fold jazz behaviour into mips_cpu_do_transaction_failed") removed update on TCGCPUOps and commit 119065574d ("hw/core: Constify TCGCPUOps") made it const. Remove the now irrelevant comment. Signed-off-by: Philippe

Re: [PATCH 08/10] hw/core/cpu: Pass CPUArchState to set/get_pc() handlers

2024-11-15 Thread Richard Henderson
On 11/15/24 08:21, Paolo Bonzini wrote: On 11/15/24 16:54, Peter Maydell wrote: On Fri, 15 Nov 2024 at 15:22, Philippe Mathieu-Daudé wrote: CPUClass set_pc() and get_pc() handlers are target specific. Rather than passing a generic CPUState and forcing QOM casts, we can directly pass the targe

Re: [RFC PATCH 0/6] Enable shared device assignment

2024-11-15 Thread Rob Nertney
On Tue, Oct 08, 2024 at 04:59:45PM +0800, Chenyi Qiang wrote: > Hi Paolo, > > Kindly ping for this thread. The in-place page conversion is discussed > at Linux Plumbers. Does it give some direction for shared device > assignment enabling work? > Hi everybody. Our NVIDIA GPUs currently support thi

Re: [PATCH] tcg: Allow top bit of SIMD_DATA_BITS to be set in simd_desc()

2024-11-15 Thread Richard Henderson
On 11/15/24 09:25, Peter Maydell wrote: In simd_desc() we create a SIMD descriptor from various pieces including an arbitrary data value from the caller. We try to sanitize these to make sure everything will fit: the 'data' value needs to fit in the SIMD_DATA_BITS (== 22) sized field. However w

Re: [PATCH v2 3/7] accel/kvm: Report the loss of a large memory page

2024-11-15 Thread William Roche
Thanks for the feedback on the patches, I'll send a new version in the coming week. But I just wanted to answer now the questions you asked on this specific one as they are related to the importance of fixing the large page failures handling. On 11/12/24 23:22, David Hildenbrand wrote: On 1

[PULL 01/14] linux-user: Fix setreuid and setregid to use direct syscalls

2024-11-15 Thread Richard Henderson
From: Helge Deller The commit fd6f7798ac30 ("linux-user: Use direct syscalls for setuid(), etc") added direct syscall wrappers for setuid(), setgid(), etc since the system calls have different semantics than the libc functions. Add and use the corresponding wrappers for setreuid and setregid whi

[PULL 11/14] linux-user/loongarch64: Reduce vdso alignment to 4k

2024-11-15 Thread Richard Henderson
Reduce vdso alignment to minimum page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/loongarch64/Makefile.vdso | 3 ++- linux-user/loongarch64/vdso.so | Bin 3560 -> 3560 bytes 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/linux

[PULL 14/14] tcg: Allow top bit of SIMD_DATA_BITS to be set in simd_desc()

2024-11-15 Thread Richard Henderson
From: Peter Maydell In simd_desc() we create a SIMD descriptor from various pieces including an arbitrary data value from the caller. We try to sanitize these to make sure everything will fit: the 'data' value needs to fit in the SIMD_DATA_BITS (== 22) sized field. However we do that sanitizing

[PULL 02/14] accel/tcg: Fix user-only probe_access_internal plugin check

2024-11-15 Thread Richard Henderson
The acc_flag check for write should have been against PAGE_WRITE_ORG, not PAGE_WRITE. But it is better to combine two acc_flag checks to a single check against access_type. This matches the system code in cputlb.c. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issue

[PULL 03/14] linux-user: Tolerate CONFIG_LSM_MMAP_MIN_ADDR

2024-11-15 Thread Richard Henderson
From: Ilya Leoshkevich Running qemu-i386 on a system running with SELinux in enforcing mode (more precisely: s390x trixie container on Fedora 40) fails with: qemu-i386: tests/tcg/i386-linux-user/sigreturn-sigmask: Unable to find a guest_base to satisfy all guest address mapping requirements

[PULL 07/14] linux-user: Honor elf alignment when placing images

2024-11-15 Thread Richard Henderson
Most binaries don't actually depend on more than page alignment, but any binary can request it. Not honoring this was a bug. This became obvious when gdb reported Failed to read a valid object file image from memory when examining some vdso which are marked as needing more than page alignme

[PULL 00/14] tcg + linux-user patch queue

2024-11-15 Thread Richard Henderson
The following changes since commit f0a5a31c33a8109061c2493e475c8a2f4d022432: Update version for v9.2.0-rc0 release (2024-11-13 21:44:45 +) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20241115 for you to fetch changes up to

Re: "make clean" after "git pull" runs configure before cleaning.

2024-11-15 Thread Rob Landley
On 11/14/24 17:33, Paolo Bonzini wrote: On 11/15/24 00:10, Rob Landley wrote: Seems a _bit_ awkward to do that (and potentially fail on a random new dependency) just to delete it all again? That's just how Make works. Linux and busybox and so on use make, and I've never seen "make clean" tr

Re: "make clean" after "git pull" runs configure before cleaning.

2024-11-15 Thread Paolo Bonzini
Il ven 15 nov 2024, 22:15 Rob Landley ha scritto: > On 11/14/24 17:33, Paolo Bonzini wrote: > > On 11/15/24 00:10, Rob Landley wrote: > >> Seems a _bit_ awkward to do that (and potentially fail on a random new > >> dependency) just to delete it all again? > > > > That's just how Make works. > > L

Re: [PATCH v3 9/9] hw: enforce use of static, const string with qdev_new()

2024-11-15 Thread Peter Xu
On Fri, Nov 15, 2024 at 05:25:21PM +, Daniel P. Berrangé wrote: > Since qdev_new() will assert(), it should only be used in scenarios > where the caller knows exactly what type it is asking to be created, > and can thus be confident in avoiding abstract types. > > Enforce this by using a macro

Re: [PATCH v2] target/arm: Add cortex-m0+ support

2024-11-15 Thread Peter Maydell
On Wed, 13 Nov 2024 at 17:36, Matthieu Castet wrote: > > Signed-off-by: Matthieu Castet Hi; thanks for version 2; this looks pretty good and I just have a couple of small nits. Firstly, there's still no commit message body text here. Commit messages should explain the intention of the commit and

Re: [PATCH] hw: Add "loadparm" property to scsi disk devices for booting on s390x

2024-11-15 Thread Paolo Bonzini
On 11/15/24 13:26, Thomas Huth wrote: On 15/11/2024 12.49, Paolo Bonzini wrote: On Fri, Nov 15, 2024 at 7:30 AM Thomas Huth wrote: Ok, great! Sounds like we have a passable solution for QEMU 9.2. We still can refine the loadparm handling of the scsi devices in future QEMU releases, but this w

Re: [PATCH v4 0/5] target/i386: Update EPYC CPU models for Cache property, RAS, SVM feature bits

2024-11-15 Thread Maksim Davydov
Hi! On 11/14/24 23:36, Babu Moger wrote: This series addresses the following issues with EPYC CPU models. 1. Update the L1, L2, L3 cache properties to match the actual hardware (PPR). This needs to be updated on all the EPYC models. 2. RAS feature bits (SUCCOR, McaOverflowRecov). 3. Add SV

Re: [PATCH v2 1/8] qom: refactor checking abstract property when creating instances

2024-11-15 Thread Daniel P . Berrangé
On Thu, Nov 14, 2024 at 02:58:56PM -0500, Peter Xu wrote: > On Mon, Nov 11, 2024 at 03:55:48PM +, Daniel P. Berrangé wrote: > > @@ -753,7 +761,7 @@ typedef union { > > } qemu_max_align_t; > > #endif > > > > -static Object *object_new_with_type(Type type) > > +static Object *object_new_with_

Re: [PATCH RESEND v2 19/19] hw/net/xilinx_ethlite: Map RESERVED I/O as unimplemented

2024-11-15 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > In order to track access to reserved I/O space, use yet > another UnimplementedDevice covering the whole device > memory range. Mapped with lower priority (-1). > > The memory flat view becomes: > > (qemu) info mtree -f > FlatView #0 >Root memory region: s

[PATCH 00/10] accel/tcg: API prototype cleanups

2024-11-15 Thread Philippe Mathieu-Daudé
Preparatory cleanup patches extracted to bigger series which rename TCG frontend functions to avoid name clash when linking multiple target into the same binary. Worth to remove few QOM cast boilerplate, per diff-stat: 64 files changed, 230 insertions(+), 355 deletions(-) ---

[PATCH 01/10] target/mips: Drop left-over comment about Jazz machine

2024-11-15 Thread Philippe Mathieu-Daudé
Commit 3803b6b427 ("target/mips: Fold jazz behaviour into mips_cpu_do_transaction_failed") removed update on TCGCPUOps and commit 119065574d ("hw/core: Constify TCGCPUOps") made it const. Remove the now irrelevant comment. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 4 1 f

[PATCH 03/10] target/sparc: Move sparc_restore_state_to_opc() to cpu.c

2024-11-15 Thread Philippe Mathieu-Daudé
Most targets define their restore_state_to_opc() handler in cpu.c. In order to keep SPARC aligned, move sparc_restore_state_to_opc() from translate.c to cpu.c. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.h | 11 --- target/sparc/cpu.c

[PATCH 08/10] hw/core/cpu: Pass CPUArchState to set/get_pc() handlers

2024-11-15 Thread Philippe Mathieu-Daudé
CPUClass set_pc() and get_pc() handlers are target specific. Rather than passing a generic CPUState and forcing QOM casts, we can directly pass the target CPUArchState, simplifying. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 6 +++--- accel/tcg/cpu-exec.c | 7 ++

[PATCH 09/10] hw/core/cpu: Pass CPUArchState to restore_state_to_opc() handler

2024-11-15 Thread Philippe Mathieu-Daudé
CPUClass::restore_state_to_opc() handler is target specific. Rather than passing a generic CPUState and forcing QOM casts, we can directly pass the target CPUArchState, simplifying. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/tcg-cpu-ops.h | 2 +- target/arm/internals.h |

[PATCH 10/10] hw/core/cpu: Pass CPUArchState to cpu_dump_state() handler

2024-11-15 Thread Philippe Mathieu-Daudé
CPUClass::cpu_dump_state() handler is target specific. Rather than passing a generic CPUState and forcing QOM casts, we can directly pass the target CPUArchState, simplifying. Only x86_cpu_dump_state() has to do an extra env_cpu() to access the original CPUState. Signed-off-by: Philippe Mathieu-D

[PATCH 02/10] target/loongarch: Declare loongarch_cpu_dump_state() locally

2024-11-15 Thread Philippe Mathieu-Daudé
loongarch_cpu_dump_state() is not used outside of cpu.c, no need to expose its prototype. Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/internals.h | 2 -- target/loongarch/cpu.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/loongarch/internals.h

[PATCH 05/10] accel/tcg: Move cpu_unwind_state_data() declaration

2024-11-15 Thread Philippe Mathieu-Daudé
cpu_unwind_state_data() is specific to TCG accelerator, move it to "exec/translate-all.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h| 13 - include/exec/translate-all.h | 12 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/i

[PATCH 07/10] accel/tcg: Reduce log_pc() declaration scope

2024-11-15 Thread Philippe Mathieu-Daudé
log_pc() is only used in cpu-exec.c, move it there. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-target.h | 10 -- accel/tcg/cpu-exec.c| 10 ++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/accel/tcg/internal-target.h b/accel/tcg/interna

[PATCH 04/10] accel/tcg: Ensure frontends define restore_state_to_opc handler

2024-11-15 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 8163295f34..033f5fab10 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/

[PATCH 06/10] accel/tcg: Remove cpu_unwind_state_data() unused CPUState argument

2024-11-15 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/exec/translate-all.h | 3 +-- accel/tcg/translate-all.c| 2 +- target/i386/helper.c | 3 ++- target/openrisc/sys_helper.c | 7 +++ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/exec/translate-all.h b/includ

Re: [PATCH] hw: Add "loadparm" property to scsi disk devices for booting on s390x

2024-11-15 Thread Paolo Bonzini
On Fri, Nov 15, 2024 at 7:30 AM Thomas Huth wrote: > Ok, great! Sounds like we have a passable solution for QEMU 9.2. We still > can refine the loadparm handling of the scsi devices in future QEMU > releases, but this will now at least solve the present problem that Boris > reported from the libvi

Re: [PATCH] pci: ensure valid link status bits for downstream ports

2024-11-15 Thread Zhenyu Zhang
On 2024/11/11 20:37, Sebastian Ott wrote: PCI hotplug for downstream endpoints on arm fails because Linux' PCIe hotplug driver doesn't like the QEMU provided LNKSTA: pcieport :08:01.0: pciehp: Slot(2): Card present pcieport :08:01.0: pciehp: Slot(2): Link Up pcieport :08:01

Re: [PATCH v7 08/12] migration/multifd: Add new migration option for multifd DSA offloading.

2024-11-15 Thread Dr. David Alan Gilbert
* Yichen Wang (yichen.w...@bytedance.com) wrote: > From: Hao Xiang > > Intel DSA offloading is an optional feature that turns on if > proper hardware and software stack is available. To turn on > DSA offloading in multifd live migration by setting: > > zero-page-detection=dsa-accel > dsa-accel-p

Re: [PATCH 1/2] target/s390x: Fix the floating-point multiply-and-add NaN rules

2024-11-15 Thread Peter Maydell
On Wed, 23 Oct 2024 at 01:02, Ilya Leoshkevich wrote: > > Order the helper arguments to match the Principles of Operation. > Implement the "Results: MULTIPLY AND ADD" table in pickNaNMulAdd(). > > Reported-by: Peter Maydell > Signed-off-by: Ilya Leoshkevich Reviewed-by: Peter Maydell thanks -

Re: [PATCH 2/2] tests/tcg/s390x: Add the floating-point multiply-and-add test

2024-11-15 Thread Peter Maydell
On Wed, 23 Oct 2024 at 01:02, Ilya Leoshkevich wrote: > > Add a test to prevent regressions. > Share some useful pieces with the vfminmax test. > Remove the duplicates from the floating point class values. > > Signed-off-by: Ilya Leoshkevich > --- > tests/tcg/s390x/Makefile.target | 5 +- > te

Re: [PATCH for-10.0 v2 00/54] accel/tcg: Convert victim tlb to IntervalTree

2024-11-15 Thread Alex Bennée
Pierrick Bouvier writes: > On 11/14/24 12:58, Richard Henderson wrote: >> On 11/14/24 11:56, Pierrick Bouvier wrote: >>> I tested this change by booting a debian x86_64 image, it works as expected. >>> >>> I noticed that this change does not come for free (64s before, 82s after - >>> 1.3x). Is t

[PATCH v2] hw: Add "loadparm" property to scsi disk devices for booting on s390x

2024-11-15 Thread Thomas Huth
While adding the new flexible boot order feature on s390x recently, we missed to add the "loadparm" property to the scsi-hd and scsi-cd devices. This property is required on s390x to pass the information to the boot loader about which kernel should be started or whether the boot menu should be show

Re: [PATCH] hw: Add "loadparm" property to scsi disk devices for booting on s390x

2024-11-15 Thread Thomas Huth
On 15/11/2024 00.30, Jared Rossi wrote: On 11/14/24 12:47 PM, Thomas Huth wrote: On 14/11/2024 16.55, Jared Rossi wrote: On 11/14/24 7:29 AM, Thomas Huth wrote: While adding the new flexible boot order feature on s390x recently, we missed to add the "loadparm" property to the scsi-hd and s

Re: [PATCH 2/2] arm/ptw: respect sctlr.{u}wxn in get_phys_addr_v6

2024-11-15 Thread Peter Maydell
On Thu, 14 Nov 2024 at 16:59, Pavel Skripkin wrote: > > get_phys_addr_v6() is used for decoding armv7's short descriptor format. > Based on ARM ARM AArch32.S1SDHasPermissionsFault(), WXN should be > respected in !LPAE mode as well. > > Signed-off-by: Pavel Skripkin > --- > target/arm/ptw.c | 11

Re: [PULL 0/5] Firmware 20241114 patches

2024-11-15 Thread Peter Maydell
On Thu, 14 Nov 2024 at 11:33, Gerd Hoffmann wrote: > > On Thu, Nov 14, 2024 at 11:10:11AM +, Daniel P. Berrangé wrote: > > On Thu, Nov 14, 2024 at 12:00:56PM +0100, Gerd Hoffmann wrote: > > > The following changes since commit > > > f0a5a31c33a8109061c2493e475c8a2f4d022432: > > > > > > Upda

Re: [PATCH 01/10] target/mips: Drop left-over comment about Jazz machine

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 15:21, Philippe Mathieu-Daudé wrote: > > Commit 3803b6b427 ("target/mips: Fold jazz behaviour into > mips_cpu_do_transaction_failed") removed update on TCGCPUOps > and commit 119065574d ("hw/core: Constify TCGCPUOps") made > it const. Remove the now irrelevant comment. > > S

Re: [PATCH 0/3] target/mips: Convert Octeon LX instructions to decodetree

2024-11-15 Thread Philippe Mathieu-Daudé
On 11/11/24 22:29, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (3): target/mips: Extract gen_base_index_addr() helper target/mips: Extract generic gen_lx() helper target/mips: Convert Octeon LX instructions to decodetree Thanks, series queued to mips-next tree.

Re: [PATCH v2 0/6] target/mips: Convert nanoMIPS LSA opcode to decodetree

2024-11-15 Thread Philippe Mathieu-Daudé
On 12/11/24 17:20, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (6): target/mips: Introduce decode tree bindings for microMIPS ISA target/mips: Introduce decode tree bindings for nanoMIPS ISA target/mips: Have gen_[d]lsa() callers add 1 to shift amount argument target/mips: D

Re: [PATCH v1 2/2] migration: Do not perform RAMBlock dirty sync during the first iteration

2024-11-15 Thread Peter Xu
On Fri, Nov 15, 2024 at 10:11:51AM +0100, David Hildenbrand wrote: > > > > > > > > > > But then I realized that even memory_region_clear_dirty_bitmap() will > > > > > not > > > > > clear the ramblock_dirty_bitmap_ bits! It's only concerned about > > > > > listener->log_clear() calls. > > > > > >

Re: [PATCH 03/10] target/sparc: Move sparc_restore_state_to_opc() to cpu.c

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 15:22, Philippe Mathieu-Daudé wrote: > > Most targets define their restore_state_to_opc() handler in cpu.c. > In order to keep SPARC aligned, move sparc_restore_state_to_opc() > from translate.c to cpu.c. > > Suggested-by: Richard Henderson > Signed-off-by: Philippe Mathieu

[PATCH v2 00/12] rust: improved integration with cargo

2024-11-15 Thread Paolo Bonzini
While we're not sure where we'll be going in the future, for now using cargo remains an important part of developing QEMU Rust code. This is because cargo is the easiest way to run clippy, rustfmt, rustdoc. Cargo also allows working with doc tests, though there are pretty much none yet, and provid

[PATCH 01/12] rust: apply --cfg MESON to all crates

2024-11-15 Thread Paolo Bonzini
We might have more uses for --cfg MESON, even though right now it's only qemu-api that has generated files. Since we're going to add more flags to the add_project_arguments calls for Rust, it makes sense to also add --cfg MESON everywhere. Signed-off-by: Paolo Bonzini --- meson.build

[PATCH 12/12] rust: fix doc test syntax

2024-11-15 Thread Paolo Bonzini
Allow "cargo test --doc" to pass. Reviewed-by: Junjie Mao Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/zeroable.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/qemu-api/src/zeroable.rs b/rust/qemu-api/src/zeroable.rs index 13cdb2ccba5..6125aeed8b4 100644

[PATCH 08/12] rust: fix a couple style issues from clippy

2024-11-15 Thread Paolo Bonzini
These are reported as clippy::semicolon_inside_block and clippy::as_ptr_cast_mut. clippy::semicolon_inside_block can be configured not to lint single-line blocks; just go with the default. Reviewed-by: Junjie Mao Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 8 +-

[PATCH 11/12] rust: ci: add job that runs Rust tools

2024-11-15 Thread Paolo Bonzini
Code checks, as well as documentation generation, are not yet tied to "make check" because they need new version of the Rust toolchain (even nightly in the case of "rustfmt"). Run them in CI using the existing nightly-Rust container. Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/static_checks.y

[PATCH 05/12] rust: build: generate lint flags from Cargo.toml

2024-11-15 Thread Paolo Bonzini
Cargo.toml makes it possible to describe the desired lint level settings in a nice format. We can extend this to Meson-built crates, by teaching rustc_args.py to fetch lint and --check-cfg arguments from Cargo.toml. --check-cfg arguments come from the unexpected_cfgs lint as well as crate features

[PATCH 02/12] rust: allow using build-root bindings.rs from cargo

2024-11-15 Thread Paolo Bonzini
Right now, using cargo with QEMU requires copying by hand the bindings.rs to the source tree. Instead, we can use an include file to escape the cage of cargo's mandated source directory structure. By running cargo within meson's "devenv" and adding a MESON_BUILD_ROOT environment variable, it is e

[PATCH 07/12] rust: build: move strict lints handling to rustc_args.py

2024-11-15 Thread Paolo Bonzini
Make Cargo use unknown_lints = "allow" as well. This is more future proof as we might add new lints to rust/Cargo.toml that are not supported by older versions of rustc or clippy. Signed-off-by: Paolo Bonzini --- meson.build| 12 rust/Cargo.toml| 6

[PATCH 03/12] rust: build: move rustc_args.py invocation to qemu-api crate

2024-11-15 Thread Paolo Bonzini
Only qemu-api needs access to the symbols in config-host.h. Remove the temptation to use them elsewhere by limiting the --cfg arguments to the qemu-api crate. Per-crate invocation of the script will also be needed to add --check-cfg options for each crate's features (when more complex, build-time

[PATCH 04/12] rust: build: restrict --cfg generation to only required symbols

2024-11-15 Thread Paolo Bonzini
Parse the Cargo.toml file, looking for the unexpected_cfgs configuration. When generating --cfg options from the config-host.h file, only use those that are included in the configuration. Signed-off-by: Paolo Bonzini --- rust/qemu-api/meson.build | 2 +- scripts/rust/rustc_args.py | 61 ++

[PATCH 09/12] rust: build: establish a baseline of lints across all crates

2024-11-15 Thread Paolo Bonzini
Many lints that default to allow can be helpful in detecting bugs or keeping the code style homogeneous. Add them liberally, though perhaps not as liberally as in hw/char/pl011/src/lib.rs. In particular, enabling entire groups can be problematic because of bitrot when new links are added in the f

[PATCH v3 4/9] qom: introduce object_new_dynamic()

2024-11-15 Thread Daniel P . Berrangé
object_new() has a failure scenario where it will assert() if given an abstract type. Callers which are creating objects based on user input, or unknown/untrusted type names, must manually check the result of object_class_is_abstract() before calling object_new() to propagate an Error, instead of a

[PATCH v3 2/9] qom: refactor checking abstract property when creating instances

2024-11-15 Thread Daniel P . Berrangé
Push an Error object into object_initialize_with_type, so that reporting of attempts to create an abstract type is handled at the lowest level. Signed-off-by: Daniel P. Berrangé --- qom/object.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/

[PATCH v3 5/9] convert code to object_new_dynamic() where appropriate

2024-11-15 Thread Daniel P . Berrangé
In cases where object_new() is not being passed a static, const string, the caller cannot be sure what type they are instantiating. There is a risk that instantiation could fail, if it is an abstract type. Convert such cases over to use object_new_dynamic() such that they are forced to expect fail

[PATCH v3 0/9] Require error handling for dynamically created objects

2024-11-15 Thread Daniel P . Berrangé
NB, this series is targetting 10.0, NOT for 9.2 freeze. With code like Object *obj = object_new(TYPE_BLAH) the caller can be pretty confident that they will successfully create an object instance of TYPE_BLAH. They know exactly what type has been requested, so it passing an abstract type for

[PATCH v3 1/9] hw: eliminate qdev_try_new, isa_try_new & usb_try_new

2024-11-15 Thread Daniel P . Berrangé
These functions all return NULL rather than asserting, if the requested type is not registered and also cannot be dynamically loaded. In several cases their usage is pointless, since the caller then just reports an error & exits anyway. Easier to just let qdev_new fail with &error_fatal. In other

Re: [PATCH 07/10] accel/tcg: Reduce log_pc() declaration scope

2024-11-15 Thread Richard Henderson
On 11/15/24 07:20, Philippe Mathieu-Daudé wrote: log_pc() is only used in cpu-exec.c, move it there. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-target.h | 10 -- accel/tcg/cpu-exec.c| 10 ++ 2 files changed, 10 insertions(+), 10 deletions(-) Last

[PATCH v3 6/9] qom: enforce use of static, const string with object_new()

2024-11-15 Thread Daniel P . Berrangé
Since object_new() will assert(), it should only be used in scenarios where the caller knows exactly what type it is asking to be created, and can thus be confident in avoiding abstract types. Enforce this by using a macro wrapper which types to paste "" to the type name. This will generate a comp

[PATCH v3 7/9] qom: introduce qdev_new_dynamic()

2024-11-15 Thread Daniel P . Berrangé
qdev_new() has a failure scenario where it will assert() if given an abstract type. Callers which are creating qdevs based on user input, or unknown/untrusted type names, must manually check the result of qdev_class_is_abstract() before calling qdev_new() to propagate an Error, instead of asserting

  1   2   >