[PATCH RISU] risugen/aarch64: SMULH and UMULH require ra == 31

2024-11-15 Thread Richard Henderson
Do not generate ra other than 31, as it is UNPREDICTABLE whether the instruction will trap as invalid. Signed-off-by: Richard Henderson --- aarch64.risu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aarch64.risu b/aarch64.risu index 8f08cd0..87d9c72 100644 --- a/aarch64

[PULL 06/14] cpu: ensure we don't call start_exclusive from cpu_exec

2024-11-15 Thread Richard Henderson
From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20241025175857.2554252-3-pierrick.bouv...@linaro.org> Signed-off-by: Richard Henderson --- cpu-common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

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 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: [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: [RFC PATCH 5/5] hw/arm/virt-acpi-build: Add IORT RMR regions to handle MSI nested binding

2024-11-15 Thread Nicolin Chen
On Thu, Nov 14, 2024 at 11:41:58AM +0100, Eric Auger wrote: > Hi Shameer, > > On 11/14/24 09:48, Shameerali Kolothum Thodi wrote: > > > >> -Original Message- > >> From: Nicolin Chen > >> Sent: Wednesday, November 13, 2024 6:31 PM > >> To: Shameerali Kolothum Thodi > >> Cc: qemu-...@nongn

[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: "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

[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

[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 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

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 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 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 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 05/14] target/i386: fix hang when using slow path for ptw_setl

2024-11-15 Thread Richard Henderson
From: Pierrick Bouvier When instrumenting memory accesses for plugin, we force memory accesses to use the slow path for mmu [1]. This create a situation where we end up calling ptw_setl_slow. This was fixed recently in [2] but the issue still could appear out of plugins use case. Since this func

[PULL 04/14] tests/tcg: Test that sigreturn() does not corrupt the signal mask

2024-11-15 Thread Richard Henderson
From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-ID: <20241108145237.37377-2-...@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/multiarch/sigreturn-sigmask.c | 51 + tests/tcg/multiarch/Makefile.targ

[PULL 13/14] linux-user/arm: Select vdso for be8 and be32 modes

2024-11-15 Thread Richard Henderson
In be8 mode, instructions are little-endian. In be32 mode, instructions are big-endian. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2333 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/elfload.c | 31 + l

[PULL 10/14] linux-user/arm: 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/arm/Makefile.vdso | 2 +- linux-user/arm/vdso-be.so| Bin 2648 -> 2648 bytes linux-user/arm/vdso-le.so| Bin 2648 -> 2648 bytes 3 files changed, 1 insertion(

[PULL 09/14] linux-user/aarch64: 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/aarch64/Makefile.vdso | 5 +++-- linux-user/aarch64/vdso-be.so| Bin 3224 -> 3224 bytes linux-user/aarch64/vdso-le.so| Bin 3224 -> 3224 bytes 3 files change

[PULL 08/14] linux-user: Drop image_info.alignment

2024-11-15 Thread Richard Henderson
This field is write-only. Use only the function-local variable within load_elf_image. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/qemu.h| 1 - linux-user/elfload.c | 7 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user

Re: [PULL 0/8] Block layer patches

2024-11-15 Thread Peter Maydell
On Thu, 14 Nov 2024 at 16:58, Kevin Wolf wrote: > > 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://repo.or.cz/qemu/kevin.git tags/for-upst

[PATCH] nbd-server: Silence server warnings on port probes

2024-11-15 Thread Eric Blake
While testing the use of qemu-nbd in a Pod of a Kubernetes cluster, I got LOTS of log messages of the forms: qemu-nbd: option negotiation failed: Failed to read flags: Unexpected end-of-file before all data were read qemu-nbd: option negotiation failed: Failed to read flags: Unable to read from

Re: QEMU wiki theme table of contents changes

2024-11-15 Thread Daniel P . Berrangé
On Fri, Nov 15, 2024 at 02:21:12PM -0500, Stefan Hajnoczi wrote: > On Fri, 15 Nov 2024 at 03:54, Daniel P. Berrangé wrote: > > > > 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 > > >

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

2024-11-15 Thread Pierrick Bouvier
On 11/15/24 03:43, Alex Bennée wrote: 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, 8

Re: QEMU wiki theme table of contents changes

2024-11-15 Thread Stefan Hajnoczi
On Fri, 15 Nov 2024 at 03:54, Daniel P. Berrangé wrote: > > 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

Re: [PULL 0/2] Migration 20241113 patches

2024-11-15 Thread Peter Maydell
On Wed, 13 Nov 2024 at 20:16, Peter Xu wrote: > > The following changes since commit f0cfd067867668870931c9411d96cd518564b7a8: > > Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging > (2024-11-09 12:34:01 +) > > are available in the Git repository at: > > https://git

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

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 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: [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 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: [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 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

[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 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

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

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 17:24, Richard Henderson wrote: > > 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 ++- > > targe

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

2024-11-15 Thread Daniel P . Berrangé
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 wrapper which types to paste "" to the type name. This will generate a compil

Re: [PATCH v2 6/8] qom: introduce qdev_new_dynamic()

2024-11-15 Thread Daniel P . Berrangé
On Thu, Nov 14, 2024 at 03:47:20PM -0500, Peter Xu wrote: > On Mon, Nov 11, 2024 at 03:55:53PM +, 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

[PATCH v3 3/9] qom: allow failure of object_new_with_class

2024-11-15 Thread Daniel P . Berrangé
Since object_new_with_class() accepts a non-const parameter for the class, callers should be prepared for failures from unexpected input. Add an Error parameter for this and make callers check. If the caller does not already have an Error parameter, it is satisfactory to use &error_abort if the cla

[PATCH v3 8/9] convert code to qdev_new_dynamic() where appropriate

2024-11-15 Thread Daniel P . Berrangé
In cases where qdev_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 qdev_new_dynamic() such that they are forced to expect failure.

[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

[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 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 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 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 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 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

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 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 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: [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 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

[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

[PATCH 1/3] tests/qtest: Add qtest_system_reset() utility function

2024-11-15 Thread Peter Maydell
We have several qtest tests which want to reset the QEMU under test during the course of testing something. They currently generally have their own functions to do this, which work by sending a "system_reset" QMP command. However, "system_reset" only requests a reset, and many of the tests which

[PATCH 3/3] tests/qtest: Use qtest_system_reset_nowait() where appropriate

2024-11-15 Thread Peter Maydell
In the device and drive plug/unplug tests we want to trigger a system reset and then see if we get the appropriate DEVICE_DELETED event. Use qtest_system_reset_nowait() here. Signed-off-by: Peter Maydell --- tests/qtest/device-plug-test.c | 11 +-- tests/qtest/drive_del-test.c | 7 +--

[PATCH 2/3] tests/qtest: Use qtest_system_reset() instead of open-coded versions

2024-11-15 Thread Peter Maydell
Use the qtest_system_reset() function in various tests that were previously open-coding the system-reset. Note that in several cases this fixes a bug where the test did not wait for the RESET QMP event before continuing. Signed-off-by: Peter Maydell --- I can split this patch up if people prefer,

[PATCH 0/3] qtest: Provide and use function for doing system reset

2024-11-15 Thread Peter Maydell
I noticed while reviewing Roque's patchset that adds tests for the CMSDK watchdog device that we are gradually accumulating tests in tests/qtest which open-code "now reset the QEMU system". Moreover, several of those tests get it wrong, by failing to wait for the QMP RESET event that signals that t

[PATCH 10/12] rust: build: add "make clippy", "make rustfmt", "make rustdoc"

2024-11-15 Thread Paolo Bonzini
Abstract common invocations of "cargo", that do not require copying the generated bindgen file or setting up MESON_BUILD_ROOT. In the future these could also do completely without cargo and invoke the underlying programs directly. Reviewed-by: Junjie Mao Signed-off-by: Paolo Bonzini --- rust/m

Re: [PATCH v2 02/18] hw/block:m25p80: Fix coding style

2024-11-15 Thread Philippe Mathieu-Daudé
On 22/10/24 10:40, Jamin Lin via wrote: Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/block/m25p80.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) @@ -1843,7 +1849,7 @@ static void m25p80_register

[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 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 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 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 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 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 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 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 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 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

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

2024-11-15 Thread Philippe Mathieu-Daudé
On 15/11/24 16:03, Roque Arcudia Hernandez wrote: 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(-) Tested-by: Ph

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

2024-11-15 Thread Paolo Bonzini
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 target CPUArchState, simplifying. diff --gi

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

2024-11-15 Thread Alex Bennée
Daniel P. Berrangé writes: > 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. > > > [1] Raised in many contexts at many times, but a decent overall summary >

[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 2/5] hw/watchdog/cmsdk_apb_watchdog: Fix INTEN issues

2024-11-15 Thread Roque Arcudia Hernandez
Current watchdog is free running out of reset, this combined with the fact that current implementation also ensures the counter is running when programing WDOGLOAD creates issues when the firmware defer the programing of WDOGCONTROL.INTEN much later after WDOGLOAD. Arm Programmer's Model documentat

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

2024-11-15 Thread Roque Arcudia Hernandez
The following patchset tries to address an issue where the watchdog counter was running as soon as the device is out of reset. This created a few problems with the firmware under test. It was pointed out that the firmware under test was already working on an emulator using the real RTL. Further rev

[PATCH 4/5] tests/qtest/cmsdk-apb-watchdog-test: Don't abort on assertion failure

2024-11-15 Thread Roque Arcudia Hernandez
Currently the watchdog test has a behavior in which the first test assertion that fails will make the test abort making it impossible to see the result of other tests: # ERROR:../tests/qtest/cmsdk-apb-watchdog-test.c:87:test_watchdog: assertion failed ... Bail out! Aborted Changing the behavi

[PATCH 3/5] tests/qtest/cmsdk-apb-watchdog-test: Parameterize tests

2024-11-15 Thread Roque Arcudia Hernandez
Currently the CMSDK APB watchdog tests target an specialized version of the device (luminaris using the lm3s811evb machine) that prevents the development of tests for the more generic device documented in: https://developer.arm.com/documentation/ddi0479/d/apb-components/apb-watchdog/programmers-mo

Re: [PATCH v2] hw/ppc/pegasos2: Fix IRQ routing from pci.0

2024-11-15 Thread BALATON Zoltan
On Sat, 2 Nov 2024, BALATON Zoltan wrote: The MV64361 has two PCI buses one of which is used for AGP on PegasosII. So far we only emulated the PCI bus on pci.1 but some graphics cards are only recognised by some guests when connected to pci.0 corresponding to the AGP port. So far the interrupts w

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

2024-11-15 Thread Roque Arcudia Hernandez
Thanks for pointing this out. For now I'll be adding the extra line in the version 2 of this patch. On Thu, Nov 14, 2024 at 5:01 AM Peter Maydell wrote: > > On Fri, 8 Nov 2024 at 19:10, Roque Arcudia Hernandez > wrote: > > > > The following tests focus on making sure the counter is not running

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

2024-11-15 Thread Peter Maydell
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 target CPUArchState, simplifying. > diff --git a/include/hw/core/cpu.h b/include/

Re: [PATCH 2/3] tests/qtest/cmsdk-apb-watchdog-test: Parameterize tests

2024-11-15 Thread Roque Arcudia Hernandez
I'll edit the g_test_set_nonfatal_assertions in a separate patch explaining the reasoning behind it in version 2. On Thu, Nov 14, 2024 at 4:55 AM Peter Maydell wrote: > > On Fri, 8 Nov 2024 at 19:10, Roque Arcudia Hernandez > wrote: > > > > Currently the CMSDK APB watchdog tests target an speci

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

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

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 15:23, 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 inse

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

2024-11-15 Thread Peter Maydell
On Fri, 15 Nov 2024 at 15:21, 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é > --- Reviewed-by: Peter Maydell thanks -- PMM

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 05/10] accel/tcg: Move cpu_unwind_state_data() declaration

2024-11-15 Thread Peter Maydell
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/exec/translate-all.h | 12

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

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. > > > > > >

  1   2   >