[PULL 11/11] linux-user: Avoid mmap of the last byte of the reserved_va

2023-06-30 Thread Richard Henderson
There is an overflow problem in mmap_find_vma_reserved: when reserved_va == UINT32_MAX, end may overflow to 0. Rather than a larger rewrite at this time, simply avoid the final byte of the VA, which avoids searching the final page, which avoids the overflow. Cc: qemu-sta...@nongnu.org Resolves: ht

[PULL 08/11] target/arm: Use float64_to_int32_modulo for FJCVTZS

2023-06-30 Thread Richard Henderson
The standard floating point results are provided by the generic routine. We only need handle the extra Z flag result afterward. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Message-Id: <20230527141910.1885950-5-richard.hender...@linaro.org> --- target/arm/vfp_helper.c | 71 +++-

[PULL 00/11] tcg and misc patch queue

2023-06-30 Thread Richard Henderson
The following changes since commit 408015a97dbe48a9dde8c0d2526c9312691952e7: Merge tag 'pull-vfio-20230630' of https://github.com/legoater/qemu into staging (2023-06-30 08:11:08 +0200) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-202

[PULL 10/11] target/nios2 : Explicitly ask for target-endian loads and stores

2023-06-30 Thread Richard Henderson
From: Peter Maydell When we generate code for guest loads and stores, at the moment they end up being requests for a host-endian access. So for target-system-nios2 (little endian) a load like ldwr3,0(r4) results on an x86 host in the TCG IR qemu_ld_a32_i32 r3,loc2,al+leul,0 but on s

[PULL 06/11] tests/tcg/alpha: Add test for cvttq

2023-06-30 Thread Richard Henderson
Test for invalid, integer overflow, and inexact. Test for proper result, modulo 2**64. Signed-off-by: Richard Henderson Acked-by: Alex Bennée Message-Id: <20230527141910.1885950-3-richard.hender...@linaro.org> --- tests/tcg/alpha/test-cvttq.c| 78 + tests/tcg

[PULL 04/11] accel/tcg: Assert one page in tb_invalidate_phys_page_range__locked

2023-06-30 Thread Richard Henderson
From: Mark Cave-Ayland Ensure that that both the start and last addresses are within the same guest page. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230629082522.606219-3-mark.cave-ayl...@ilande.co.uk> [rth: Use tcg_debug_assert, simplify the expression]

[PULL 07/11] target/alpha: Use float64_to_int64_modulo for CVTTQ

2023-06-30 Thread Richard Henderson
For the most part we can use the new generic routine, though exceptions need some post-processing to sort invalid from integer overflow. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230527141910.1885950-4-richard.hender...@linaro.org> --- target/alpha/fpu_

[PULL 01/11] ui/dbus: fix build errors in dbus_update_gl_cb and dbus_call_update_gl

2023-06-30 Thread Richard Henderson
Add some ifdefs to avoid an unused function and unused variable. Fixes: de1f8ce0abb8 ("ui/dbus: use shared D3D11 Texture2D when possible") Co-developed-by: BALATON Zoltan Message-Id: <336f7697-bcfa-1f5f-e411-6859815aa...@eik.bme.hu> Signed-off-by: Richard Henderson --- ui/dbus-listener.c | 4 ++

[PULL 09/11] tcg: Reduce tcg_assert_listed_vecop() scope

2023-06-30 Thread Richard Henderson
From: Philippe Mathieu-Daudé tcg_assert_listed_vecop() is only used in tcg-op-vec.c. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230629091107.74384-1-phi...@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 6 -- tcg/tcg-op-vec.c

[PULL 03/11] accel/tcg: Fix start page passed to tb_invalidate_phys_page_range__locked

2023-06-30 Thread Richard Henderson
From: Mark Cave-Ayland Due to a copy-paste error in tb_invalidate_phys_range, the wrong start address was passed to tb_invalidate_phys_page_range__locked. Correct is to use the start of each page in turn. Signed-off-by: Mark Cave-Ayland Fixes: e506ad6a05 ("accel/tcg: Pass last not end to tb_inv

[PULL 05/11] fpu: Add float64_to_int{32,64}_modulo

2023-06-30 Thread Richard Henderson
Add versions of float64_to_int* which do not saturate the result. Reviewed-by: Christoph Muellner Tested-by: Christoph Muellner Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Message-Id: <20230527141910.1885950-2-richard.hender...@linaro.org> --- include/fpu/softfloat.h | 3 ++

[PULL 02/11] audio: dbus requires pixman

2023-06-30 Thread Richard Henderson
From: Marc-André Lureau Commit commit 6cc5a615 ("ui/dbus: win32 support") has broken audio/dbus compilation when pixman is not included. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1739 Signed-off-by: Marc-André Lureau Message-Id: <20230630214156.2181558-1-marcandre.lur...@redhat.com>

Re: [PATCH v3 00/14] Misc clean ups to target/ppc exception handling

2023-06-30 Thread Daniel Henrique Barboza
On 6/30/23 19:57, BALATON Zoltan wrote: On Fri, 30 Jun 2023, Daniel Henrique Barboza wrote: Patches 1, 2, 3, 5, 7 and 11 are queued. If you would be so kind to get the remaining patches, rebase them on top of my ppc-next and resend, I believe there's more stuff to be queued. Thanks for tak

Re: [PATCH] audio: dbus requires pixman

2023-06-30 Thread Richard Henderson
On 6/30/23 23:41, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Commit commit 6cc5a615 ("ui/dbus: win32 support") has broken audio/dbus compilation when pixman is not included. Fixes:https://gitlab.com/qemu-project/qemu/-/issues/1739 Signed-off-by: Marc-André Lureau --- audio/me

Re: [PATCH] pcie: Release references of virtual functions

2023-06-30 Thread Akihiko Odaki
On 2023/04/21 17:09, Michael S. Tsirkin wrote: On Tue, Apr 11, 2023 at 12:11:30PM +0200, Philippe Mathieu-Daudé wrote: On 11/4/23 11:04, Akihiko Odaki wrote: pci_new() automatically retains a reference to a virtual function when registering it so we need to release the reference when unregister

Re: [PATCH] pnv/xive2: Allow indirect TIMA accesses of all sizes

2023-06-30 Thread Philippe Mathieu-Daudé
Hi Frederic, On 26/6/23 13:25, Frederic Barrat wrote: On 26/06/2023 11:48, Philippe Mathieu-Daudé wrote: On 26/6/23 11:40, Frederic Barrat wrote: Booting linux on the powernv10 machine logs a few errors like: Invalid read at addr 0x38, size 1, region 'xive-ic-tm-indirect', reason: invalid si

Re: [PATCH v2 4/4] accel/tcg: Move perf and debuginfo support to tcg

2023-06-30 Thread Philippe Mathieu-Daudé
On 1/7/23 01:40, Ilya Leoshkevich wrote: tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich --- accel/tcg

Re: [PULL 17/33] ui/dbus: win32 support

2023-06-30 Thread Philippe Mathieu-Daudé
On 30/6/23 23:41, Marc-André Lureau wrote: Hi On Thu, Jun 29, 2023 at 7:55 PM Bernhard Beschow > wrote: Am 27. Juni 2023 13:02:14 UTC schrieb marcandre.lur...@redhat.com : >From: Marc-André Lureau mailto:marcandre.lur

[PATCH] ui: Link dbus-display with pixman again

2023-06-30 Thread Philippe Mathieu-Daudé
Since its introduction in commit 142ca628a7 ("ui: add a D-Bus display backend"), dbus_display1 depends on pixman. Unfortunatly the refactor commit 1222070e77 ("meson: ensure dbus-display generated code is built before other units") dropped that dependency. Recently commit 6cc5a6159a ("ui/dbus: win3

[PATCH v2 1/4] target: Make qemu_target_page_mask() available for *-user

2023-06-30 Thread Ilya Leoshkevich
Currently qemu_target_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as well. Make use of it in perf.c. Signed-off-by: Ilya Leoshkevich --- accel/tcg/perf.c | 2 +- softmmu/physmem.c | 5 - target/meson.build | 2 ++ target/t

[PATCH v2 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2023-06-30 Thread Ilya Leoshkevich
Preparation for moving perf.c to tcg/. This affects only profiling guest code, which has code in a non-0 based segment, e.g., 16-bit code, which is not particularly important. Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- accel/tcg/perf.c | 4 1 file changed, 4 delet

[PATCH v2 0/4] accel/tcg: Move perf and debuginfo support to tcg

2023-06-30 Thread Ilya Leoshkevich
v1: https://lists.gnu.org/archive/html/qemu-devel/2023-06/msg07037.html v1 -> v2: Move qemu_target_page_mask() hunk to patch 1. Fix typos. Hi, This series is a follow-up to discussion in [1]; the goal is to build perf and debuginfo support only one time. I had to move tb_cflags() and q

[PATCH v2 2/4] tcg: Make tb_cflags() usable from target-agnostic code

2023-06-30 Thread Ilya Leoshkevich
Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich --- include/exec/exec-all.h | 6 -- include/exec/translation-block.h | 6

[PATCH v2 4/4] accel/tcg: Move perf and debuginfo support to tcg

2023-06-30 Thread Ilya Leoshkevich
tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich --- accel/tcg/meson.build | 2 -- accel/tcg/tran

Re: [PATCH 4/4] accel/tcg: Move perf and debuginfo support to tcg

2023-06-30 Thread Philippe Mathieu-Daudé
On 30/6/23 22:36, Ilya Leoshkevich wrote: tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich --- accel/tc

Re: [PATCH 1/4] target: Make qemu_softmmu_page_mask() available for *-user

2023-06-30 Thread Philippe Mathieu-Daudé
On 30/6/23 22:36, Ilya Leoshkevich wrote: Currently qemu_softmmu_page_mask() is usable only from the softmmu s/qemu_softmmu_page_mask/qemu_target_page_mask/? code. Make it possible to use it from the *-user code as wel. Signed-off-by: Ilya Leoshkevich --- softmmu/physmem.c | 5 -

Re: [PATCH 2/4] tcg: Make tb_cflags() usable from target-agnostic code

2023-06-30 Thread Philippe Mathieu-Daudé
On 30/6/23 22:36, Ilya Leoshkevich wrote: Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Signed-off-by: Ilya Leoshkevich --- include/exec/exec-all.h | 6 -- include/exec/translation-block.h

Re: [PATCH v3 00/14] Misc clean ups to target/ppc exception handling

2023-06-30 Thread BALATON Zoltan
On Fri, 30 Jun 2023, Daniel Henrique Barboza wrote: Patches 1, 2, 3, 5, 7 and 11 are queued. If you would be so kind to get the remaining patches, rebase them on top of my ppc-next and resend, I believe there's more stuff to be queued. Thanks for taking care of these. I'll do the rebase of rem

[PATCH] hw/vfio/pci-quirks: Sanitize capability pointer

2023-06-30 Thread Alex Williamson
Coverity reports a tained scalar when traversing the capabilities chain (CID 1516589). In practice I've never seen a device with a chain so broken as to cause an issue, but it's also pretty easy to sanitize. Fixes: f6b30c1984f7 ("hw/vfio/pci-quirks: Support alternate offset for GPUDirect Cliques

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-06-30 Thread Bernhard Beschow
Am 30. Juni 2023 11:32:42 UTC schrieb Olaf Hering : >Fri, 30 Jun 2023 08:05:29 + Bernhard Beschow : > >> Yes. Have a look for piix3/piix4 here: >> https://www.intel.com/design/archives/chipsets/440/index.htm > >This is hidden behind a login or whatever. None of the links ask annoying quest

Re: Unused variables in dbus_call_update_gl

2023-06-30 Thread Marc-André Lureau
Hi Richard On Fri, Jun 30, 2023 at 4:31 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/29/23 15:15, BALATON Zoltan wrote: > > On Thu, 29 Jun 2023, BALATON Zoltan wrote: > >> Hello, > >> > >> After recent commits I'm now getting: > >> > >> ../ui/dbus-listener.c: In function ‘db

[PATCH] audio: dbus requires pixman

2023-06-30 Thread marcandre . lureau
From: Marc-André Lureau Commit commit 6cc5a615 ("ui/dbus: win32 support") has broken audio/dbus compilation when pixman is not included. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1739 Signed-off-by: Marc-André Lureau --- audio/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 d

Re: [PULL 17/33] ui/dbus: win32 support

2023-06-30 Thread Marc-André Lureau
Hi On Thu, Jun 29, 2023 at 7:55 PM Bernhard Beschow wrote: > > > Am 27. Juni 2023 13:02:14 UTC schrieb marcandre.lur...@redhat.com: > >From: Marc-André Lureau > > > >D-Bus doesn't support fd-passing on Windows (AF_UNIX doesn't have > >SCM_RIGHTS yet, but there are other means to share objects.

[PATCH v3 4/6] migration: Set migration status early in incoming side

2023-06-30 Thread Fabiano Rosas
We are sending a migration event of MIGRATION_STATUS_SETUP at qemu_start_incoming_migration but never actually setting the state. This creates a window between qmp_migrate_incoming and process_incoming_migration_co where the migration status is still MIGRATION_STATUS_NONE. Calling query-migrate du

[PATCH v3 3/6] tests/qtest: migration: Use migrate_incoming_qmp where appropriate

2023-06-30 Thread Fabiano Rosas
Use the new migrate_incoming_qmp helper in the places that currently open-code calling migrate-incoming. Signed-off-by: Fabiano Rosas Reviewed-by: Juan Quintela --- tests/qtest/meson.build | 1 + tests/qtest/migration-test.c | 12 ++--- tests/qtest/virtio-net-failover.c | 77 +++

[PATCH v3 2/6] tests/qtest: migration: Add migrate_incoming_qmp helper

2023-06-30 Thread Fabiano Rosas
file-based migration requires the target to initiate its migration after the source has finished writing out the data in the file. Currently there's no easy way to initiate 'migrate-incoming', allow this by introducing migrate_incoming_qmp helper, similarly to migrate_qmp. Also make sure migration

[PATCH v3 5/6] tests/qtest: migration: Add support for negative testing of qmp_migrate

2023-06-30 Thread Fabiano Rosas
There is currently no way to write a test for errors that happened in qmp_migrate before the migration has started. Add a version of qmp_migrate that ensures an error happens. To make use of it a test needs to set MigrateCommon.result as MIG_TEST_QMP_ERROR. Signed-off-by: Fabiano Rosas --- test

[PATCH v3 6/6] tests/qtest: migration-test: Add tests for file-based migration

2023-06-30 Thread Fabiano Rosas
Add basic tests for file-based migration. Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 99 1 file changed, 99 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 2fdf6a115e..a180f53b5a 100644 --- a/

[PATCH v3 0/6] migration: Test the new "file:" migration

2023-06-30 Thread Fabiano Rosas
Based-on: [PATCH V4 0/2] migration file URI https://lore.kernel.org/r/1688135108-316997-1-git-send-email-steven.sist...@oracle.com Since v2: - removed the extra setup event. Libvirt has been enabling events for a long time, it should be safe - fixed small issues pointed out by Peter (leaking m

[PATCH v3 1/6] tests/qtest: migration: Expose migrate_set_capability

2023-06-30 Thread Fabiano Rosas
The following patch will make use of this function from within migrate-helpers.c, so move it there. Reviewed-by: Juan Quintela Reviewed-by: Thomas Huth Signed-off-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 11 +++ tests/qtest/migration-helpers.h | 3 +++ tests/qtest/migra

[PATCH 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2023-06-30 Thread Ilya Leoshkevich
Preparation for moving perf.c to tcg/. This affects only profiling guest code, which has code in a non-0 based segment, e.g., 16-bit code, which is not particularly important. Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- accel/tcg/perf.c | 4 1 file changed, 4 delet

[PATCH 0/4] accel/tcg: Move perf and debuginfo support to tcg

2023-06-30 Thread Ilya Leoshkevich
Hi, This series is a follow-up to discussion in [1]; the goal is to build perf and debuginfo support only one time. I had to move tb_cflags() and qemu_target_page_mask(), and I'm not sure if my choices there are perfect. Please let me know if there are better locations for them. Best regards, Il

[PATCH 4/4] accel/tcg: Move perf and debuginfo support to tcg

2023-06-30 Thread Ilya Leoshkevich
tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich --- accel/tcg/meson.build | 2 -- accel/tcg/tran

[PATCH 2/4] tcg: Make tb_cflags() usable from target-agnostic code

2023-06-30 Thread Ilya Leoshkevich
Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Signed-off-by: Ilya Leoshkevich --- include/exec/exec-all.h | 6 -- include/exec/translation-block.h | 6 ++ 2 files changed, 6 insertions(+),

[PATCH 1/4] target: Make qemu_softmmu_page_mask() available for *-user

2023-06-30 Thread Ilya Leoshkevich
Currently qemu_softmmu_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as wel. Signed-off-by: Ilya Leoshkevich --- softmmu/physmem.c | 5 - target/meson.build | 2 ++ target/target-common.c | 9 + 3 files changed, 11 insertio

Re: [PATCH v3 00/14] Misc clean ups to target/ppc exception handling

2023-06-30 Thread Daniel Henrique Barboza
Zoltan, Patches 1, 2, 3, 5, 7 and 11 are queued. If you would be so kind to get the remaining patches, rebase them on top of my ppc-next and resend, I believe there's more stuff to be queued. Thanks, Daniel On 6/15/23 20:03, BALATON Zoltan wrote: These are some small clean ups for target

Re: [PATCH 0/2] target/sparc: Enable MTTCG

2023-06-30 Thread Mark Cave-Ayland
On 30/06/2023 19:05, Richard Henderson wrote: On 6/22/23 16:36, Mark Cave-Ayland wrote: On 20/06/2023 17:40, Richard Henderson wrote: With the addition of TCG_GUEST_DEFAULT_MO, there's nothing in the cpu emulation preventing this from working.  There is some board model work to be done for sp

Re: [PATCH] sungem: Add WOL MMIO

2023-06-30 Thread Daniel Henrique Barboza
On 6/25/23 17:16, Nicholas Piggin wrote: Apple sungem devices are expected to have WOL MMIO registers. Add a region to prevent transaction failures, and implement the WOL-disable CSR write because the Linux driver reset writes this. Signed-off-by: Nicholas Piggin --- Queued in gitlab.com/d

Re: [PATCH 08/24] bsd-user: Use page_check_range_empty for MAP_EXCL

2023-06-30 Thread Richard Henderson
On 6/30/23 20:46, Warner Losh wrote: On Fri, Jun 30, 2023 at 7:22 AM Richard Henderson > wrote: The previous check returned -1 when any page within [start, start+len) is unmapped, not when all are unmapped. Cc: Warner Losh mailto:i...@bsdimp.c

Re: [RFC 5/7] hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response

2023-06-30 Thread ni...@outlook.com
The 05/15/2023 15:37, Jonathan Cameron wrote: > On Thu, 11 May 2023 17:56:40 + > Fan Ni wrote: > > > From: Fan Ni > > > > Per CXL spec 3.0, we implemented the two mailbox commands: > > Add Dynamic Capacity Response (Opcode 4802h) 8.2.9.8.9.3, and > > Release Dynamic Capacity Response (Opcod

Re: [PATCH] pnv/xive2: Allow indirect TIMA accesses of all sizes

2023-06-30 Thread Daniel Henrique Barboza
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel On 6/26/23 06:40, Frederic Barrat wrote: Booting linux on the powernv10 machine logs a few errors like: Invalid read at addr 0x38, size 1, region 'xive-ic-tm-indirect', reason: invalid size (min:8 max:8) Invalid write at addr 0

Re: [PATCH 1/2] target/ppc: Fix icount access for some hypervisor instructions

2023-06-30 Thread Daniel Henrique Barboza
On 6/25/23 07:36, Nicholas Piggin wrote: Several instructions and register access require icount reads and are missing translator_io_start(). Signed-off-by: Nicholas Piggin --- Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel target/ppc/translate.c | 7 +++ 1 fil

Re: [PATCH 2/2] tests/avocado: record_replay test for ppc powernv machine

2023-06-30 Thread Daniel Henrique Barboza
On 6/25/23 07:37, Nicholas Piggin wrote: The powernv machine can boot Linux to VFS mount with icount enabled. Add a test case for it. Signed-off-by: Nicholas Piggin --- Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel tests/avocado/replay_kernel.py | 16 ++

Re: [PATCH 0/2] target/ppc: Easy parts of the POWER chiptod series

2023-06-30 Thread Daniel Henrique Barboza
On 6/29/23 01:58, Cédric Le Goater wrote: On 6/25/23 14:03, Nicholas Piggin wrote: Cedric kindly reviewed these already so I think they should be good to go now. This is just a rebase and slight rewording the changelog. Still haven't completed the main chiptod device yet. Thanks, Nick Nicho

Re: [PATCH 2/2] target/ppc: Add TFMR SPR implementation with read and write helpers

2023-06-30 Thread Daniel Henrique Barboza
On 6/25/23 09:03, Nicholas Piggin wrote: TFMR is the Time Facility Management Register which is specific to POWER CPUs, and used for the purpose of timebase management (generally by firmware, not the OS). Add helpers for the TFMR register, which will form part of the core timebase facility mo

Re: [PATCH 1/2] target/ppc: Tidy POWER book4 SPR registration

2023-06-30 Thread Daniel Henrique Barboza
On 6/25/23 09:03, Nicholas Piggin wrote: POWER book4 (implementation-specific) SPRs are sometimes in their own functions, but in other cases are mixed with architected SPRs. Do some spring cleaning on these. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- Queued in gitlab

Re: [PATCH] os-posix: Allow 'chroot' via '-run-with' and deprecate the old '-chroot' option

2023-06-30 Thread Ján Tomko
On a Friday in 2023, Thomas Huth wrote: We recently introduced "-run-with" for options that influence the runtime behavior of QEMU. This option has the big advantage that it can group related options (so that it is easier for the users to spot them) and that the options become introspectable via

Re: [PATCH 08/24] bsd-user: Use page_check_range_empty for MAP_EXCL

2023-06-30 Thread Warner Losh
On Fri, Jun 30, 2023 at 7:22 AM Richard Henderson < richard.hender...@linaro.org> wrote: > The previous check returned -1 when any page within > [start, start+len) is unmapped, not when all are unmapped. > > Cc: Warner Losh > Cc: Kyle Evans > Signed-off-by: Richard Henderson > --- > bsd-user/m

Re: RFC: bsd-user broken a while ago, is this the right fix?

2023-06-30 Thread Warner Losh
On Fri, Jun 30, 2023 at 12:24 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/26/23 11:52, Richard Henderson wrote: > > On 6/26/23 10:28, Daniel P. Berrangé wrote: > >> Just CC'ing Richard to make sure it catches his attention. > >> > >> On Sat, Jun 24, 2023 at 12:40:33AM -0600,

Re: RFC: bsd-user broken a while ago, is this the right fix?

2023-06-30 Thread Richard Henderson
On 6/26/23 11:52, Richard Henderson wrote: On 6/26/23 10:28, Daniel P. Berrangé wrote: Just CC'ing Richard to make sure it catches his attention. On Sat, Jun 24, 2023 at 12:40:33AM -0600, Warner Losh wrote: This change: commit f00506aeca2f6d92318967693f8da8c713c163f3 Merge: d37158bb242 87e303

[PATCH v4 19/38] plugins: force slow path when plugins instrument memory ops

2023-06-30 Thread Alex Bennée
The lack of SVE memory instrumentation has been an omission in plugin handling since it was introduced. Fortunately we can utilise the probe_* functions to force all all memory access to follow the slow path. We do this by checking the access type and presence of plugin memory callbacks and if set

[PATCH v4 22/38] docs/devel: add some front matter to the devel index

2023-06-30 Thread Alex Bennée
Give an overview of the most useful bits of the devel documentation to read depending on what the developer wants to do. Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230623122100.1640995-22-alex.ben...@l

[PATCH v4 15/38] tests/docker: convert riscv64-cross to lcitool

2023-06-30 Thread Alex Bennée
We still need to base this on Debian Sid until riscv64 is promoted to a release architecture (or another distro provides a full cross compile target). We use the new qemu-minimal project description to avoid bringing in all the extra dependencies because every extra package is another chance for si

[PATCH v4 23/38] include/migration: mark vmstate_register() as a legacy function

2023-06-30 Thread Alex Bennée
Mention that QOM-ified devices already have support for registering the description. Reviewed-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Acked-by: Peter Xu Signed-off-by: Alex Bennée Message-Id: <20230619171437.357374-3-alex.ben...@linaro.org> --- v3

[PATCH v4 18/38] target/arm: make arm_casq_ptw CONFIG_TCG only

2023-06-30 Thread Alex Bennée
The ptw code is accessed by non-TCG code (specifically arm_pamax and arm_cpu_get_phys_page_attrs_debug) but most of it is really only for TCG emulation. Seeing as we already assert for a non TARGET_AARCH64 build lets extend the test rather than further messing with the ifdef ladder. Signed-off-by:

[PATCH v4 37/38] docs: Document security implications of debugging

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich Now that the GDB stub explicitly implements reading host files (note that it was already possible by changing the emulated code to open and read those files), concerns may arise that it undermines security. Document the status quo, which is that the users are already respo

[PATCH v4 36/38] gdbstub: Add support for info proc mappings

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich Currently the GDB's generate-core-file command doesn't work well with qemu-user: the resulting dumps are huge [1] and at the same time incomplete (argv and envp are missing). The reason is that GDB has no access to proc mappings and therefore has to fall back to using heuri

[PATCH v4 30/38] gdbstub: clean-up vcont handling to avoid goto

2023-06-30 Thread Alex Bennée
We can handle all the error exit cases by using g_autofree() for the one thing that needs cleaning up on the exit. Message-Id: <20230627160943.2956928-29-alex.ben...@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- gdbstub/gdbstub.c

[PATCH v4 33/38] linux-user: Emulate /proc/self/smaps

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich /proc/self/smaps is an extension of /proc/self/maps: it provides the same lines, plus additional information about each range. GDB uses /proc/self/smaps when available, which means that generate-core-file tries it first before falling back to /proc/self/maps. This, in turn

[PATCH v4 26/38] docs/devel: split qom-api reference into new file

2023-06-30 Thread Alex Bennée
Lets try and keep the overview of the sub-system digestible by splitting the core API stuff into a separate file. As QOM and QDEV work together we should also try and enumerate the qdev_ functions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230619171437.357374-

[PATCH v4 29/38] gdbstub: Permit reverse step/break to provide stop response

2023-06-30 Thread Alex Bennée
From: Nicholas Piggin The final part of the reverse step and break handling is to bring the machine back to a debug stop state. gdb expects a response. A gdb 'rsi' command hangs forever because the gdbstub filters out the response (also observable with reverse_debugging.py avocado tests). Fix b

[PATCH v4 28/38] gdbstub: lightly refactor connection to avoid snprintf

2023-06-30 Thread Alex Bennée
This may be a bit too much to avoid an snprintf and the slightly dodgy assign to a const variable. But hopefully not. Signed-off-by: Alex Bennée --- v2 - fix checkpatch warning --- gdbstub/softmmu.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/gdbst

[PATCH v4 17/38] tests/avocado: Make the test_arm_bpim2u_gmac test more reliable

2023-06-30 Thread Alex Bennée
From: Thomas Huth The test_arm_bpim2u_gmac test sometimes fails (ca. 1 out of 20 runs here) since the disk shows up as /dev/mmcblk1 instead of /dev/mmcblk0 in some runs. No matter of the name in /dev, the major:minor encoding seems always to be the same, so we can fix this issue by using the corr

Re: [PATCH] target/nios2 : Explicitly ask for target-endian loads and stores

2023-06-30 Thread Richard Henderson
On 6/23/23 19:25, Peter Maydell wrote: When we generate code for guest loads and stores, at the moment they end up being requests for a host-endian access. So for target-system-nios2 (little endian) a load like ldwr3,0(r4) results on an x86 host in the TCG IR qemu_ld_a32_i32 r3,lo

[PATCH v4 24/38] include/hw/qdev-core: fixup kerneldoc annotations

2023-06-30 Thread Alex Bennée
Fix up the kerneldoc markup and start documenting the various fields in QDEV related structures. This involved: - moving overall description to a DOC: comment at top - fixing various markup issues for types and structures - adding missing Return: statements - adding some typedefs to hide QLIST

[PATCH v4 16/38] tests/avocado: update firmware to enable sbsa-ref/max

2023-06-30 Thread Alex Bennée
From: Marcin Juszkiewicz Update prebuilt firmware images to have TF-A with FEAT_FGT support enabled. This allowed us to enable test for "max" cpu in sbsa-ref machine. Signed-off-by: Marcin Juszkiewicz Message-Id: <20230530152240.79160-1-marcin.juszkiew...@linaro.org> Signed-off-by: Alex Bennée

[PATCH v4 21/38] plugins: update lockstep to use g_memdup2

2023-06-30 Thread Alex Bennée
The old g_memdup is deprecated, use the replacement. Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230627160943.2956928-20-alex.ben...@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- contrib/plugins/lockstep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v4 31/38] linux-user: Expose do_guest_openat() and do_guest_readlink()

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich These functions will be required by the GDB stub in order to provide the guest view of /proc to GDB. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id: <20230621203627.1808446-2-...@linux.ibm.com> Signed-off-by: Alex Benn

[PATCH v4 27/38] docs/devel: introduce some key concepts for QOM development

2023-06-30 Thread Alex Bennée
Using QOM correctly is increasingly important to maintaining a modern code base. However the current documentation skips some important concepts before launching into a simple example. Lets: - at least mention properties - mention TYPE_OBJECT and TYPE_DEVICE - talk about why we have realize/

[PATCH v4 20/38] plugins: fix memory leak while parsing options

2023-06-30 Thread Alex Bennée
It was hard to track down this leak as it was an internal allocation by glib and the backtraces did not give much away. The autofree was freeing the allocation with g_free() but not taking care of the individual strings. They should have been freed with g_strfreev() instead. Searching the glib sou

[PATCH v4 35/38] gdbstub: Report the actual qemu-user pid

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich Currently qemu-user reports pid 1 to GDB. Resolve the TODO and report the actual PID. Using getpid() relies on the assumption that there is only one GDBProcess. Add an assertion to make sure that future changes don't break it. Reviewed-by: Alex Bennée Signed-off-by: Ilya

[PATCH v4 25/38] docs/devel/qom.rst: Correct code style

2023-06-30 Thread Alex Bennée
From: Philippe Mathieu-Daudé Per commit 067109a11c ("docs/devel: mention the spacing requirement for QOM"): For a storage structure the first declaration should always be called “parent_obj” and for a class structure the first member should always be called “parent_class” Adapt the QOM rS

[PATCH v4 34/38] gdbstub: Expose gdb_get_process() and gdb_get_first_cpu_in_process()

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich These functions will be needed by user-target.c in order to retrieve the name of the executable. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-5-...@linux.ibm.com> Signed-off-by: Alex Bennée --- gdbstub/internals.h | 2 ++

[PATCH v4 32/38] linux-user: Add "safe" parameter to do_guest_openat()

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich gdbstub cannot meaningfully handle QEMU_ERESTARTSYS, and it doesn't need to. Add a parameter to do_guest_openat() that makes it use openat() instead of safe_openat(), so that it becomes usable from gdbstub. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson M

[PATCH v4 03/38] gitlab: reduce testing scope of check-gcov

2023-06-30 Thread Alex Bennée
This keeps timing out on gitlab due to some qtests taking a long time. As this is just ensuring the gcov machinery is working and not attempting to be comprehensive lets skip qtest in this run. Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230623122100.1640995-4-alex.ben...@linaro.org> Revie

[PATCH v4 11/38] tests/lcitool: update to latest version

2023-06-30 Thread Alex Bennée
We need this for the riscv64 and gcc-native mappings. As the older alpine release has been dropped from the mappings we also need to bump the version of alpine we use. Message-Id: <20230623122100.1640995-13-alex.ben...@linaro.org> Acked-by: Richard Henderson Signed-off-by: Alex Bennée --- tests

[PATCH v4 01/38] gitlab: explicit set artifacts publishing criteria

2023-06-30 Thread Alex Bennée
From: Daniel P. Berrangé If not set explicitly, gitlab assumes 'when: on_success" as the publishing criteria for artifacts. This is reasonable if the artifact is an output deliverable of the job. This is useless if the artifact is a log file to be used for debugging job failures. This change mak

Re: [PATCH 0/2] target/sparc: Enable MTTCG

2023-06-30 Thread Richard Henderson
On 6/22/23 16:36, Mark Cave-Ayland wrote: On 20/06/2023 17:40, Richard Henderson wrote: With the addition of TCG_GUEST_DEFAULT_MO, there's nothing in the cpu emulation preventing this from working.  There is some board model work to be done for sparc64, where max_cpus = 1. I've tried testing

[PATCH v4 09/38] tests/docker: add test-fuzz

2023-06-30 Thread Alex Bennée
Running the fuzzer requires some hoop jumping and some problems only show up in containers. This basically replicates the build-oss-fuzz job from our CI so we can run in the same containers we use in CI. Message-Id: <20230626215926.2522656-10-alex.ben...@linaro.org> Reviewed-by: Alexander Bulekov

[PATCH v4 08/38] tests/qtests: clean-up and fix leak in generic_fuzz

2023-06-30 Thread Alex Bennée
An update to the clang tooling detects more issues with the code including a memory leak from the g_string_new() allocation. Clean up the code to avoid the allocation and use ARRAY_SIZE while we are at it. Signed-off-by: Alex Bennée --- v3 - use g_strconcat instead --- tests/qtest/fuzz/generi

[PATCH v4 05/38] tests/tcg: add mechanism to handle plugin arguments

2023-06-30 Thread Alex Bennée
We recently missed a regression that should have been picked up by check-tcg. This was because the libmem plugin is effectively a NOP if the user doesn't specify the type to use. Rather than changing the default behaviour add an additional expansion so we can take this into account in future. Mes

[PATCH v4 12/38] tests/lcitool: Bump fedora container versions

2023-06-30 Thread Alex Bennée
From: Erik Skultety Fedora 37 -> 38 Signed-off-by: Erik Skultety Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230627160943.2956928-13-alex.ben...@linaro.org> Message-Id: [AJB: Dropped alpine (in prev commit), reflow commit msg] Signed-off-by: Alex Bennée -

[PATCH v4 04/38] docs/devel: remind developers to run CI container pipeline when updating images

2023-06-30 Thread Alex Bennée
From: Ani Sinha When new dependencies and packages are added to containers, its important to run CI container generation pipelines on gitlab to make sure that there are no obvious conflicts between packages that are being added and those that are already present. Running CI container pipelines wi

[PATCH v4 14/38] tests/lcitool: introduce qemu-minimal

2023-06-30 Thread Alex Bennée
This is a very bare bones set of dependencies for a minimal build of QEMU. This will be useful for minimal cross-compile sanity check based on things like Debian Sid where stuff isn't always in sync. Message-Id: <20230623122100.1640995-16-alex.ben...@linaro.org> Signed-off-by: Alex Bennée --- v2

[PATCH v4 38/38] tests/tcg: Add a test for info proc mappings

2023-06-30 Thread Alex Bennée
From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-9-...@linux.ibm.com> Signed-off-by: Alex Bennée --- tests/tcg/multiarch/Makefile.target | 9 ++- .../multiarch/gdbstub/test-proc-mappings.py | 65 ++

[PATCH v4 07/38] scripts/oss-fuzz: add a suppression for keymap

2023-06-30 Thread Alex Bennée
When updating to the latest fedora the santizer found more leaks inside xkbmap: FAILED: pc-bios/keymaps/ar /builds/stsquad/qemu/build-oss-fuzz/qemu-keymap -f pc-bios/keymaps/ar -l ara = ==3604==ERROR: LeakSanitizer: detected m

[PATCH v4 00/38] maintainer omnibus: testing, fuzz, plugins, documentation, gdbstub (pre-PR)

2023-06-30 Thread Alex Bennée
As softfreeze is fast approaching I thought it would be work combining my various trees into an omnibus series to ease the review and merging. The testing updates exposed a number of latent leaks that confused the oss-fuzz jobs (hence the test-fuzz addition to help debug that). This also includes

[PATCH v4 10/38] Makefile: add lcitool-refresh to UNCHECKED_GOALS

2023-06-30 Thread Alex Bennée
This is yet another make target you usually run in the top level of the source directory. Message-Id: <20230623122100.1640995-12-alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4 06/38] qemu-keymap: properly check return from xkb_keymap_mod_get_index

2023-06-30 Thread Alex Bennée
We can return XKB_MOD_INVALID for AltGr which rightly gets flagged by sanitisers as an overly wide shift attempt. Properly check the return type and leave the bitmap as zero in that case. Tested output before and after is unchanged with the gb and ara keymaps. Signed-off-by: Alex Bennée Reviewed-

[PATCH v4 13/38] tests/lcitool: add an explicit gcc-native package

2023-06-30 Thread Alex Bennée
We need a native compiler to build the hexagon codegen tools. In our current images we already have a gcc as a side effect of a broken dependency between gcovr and lcov but this will be fixed when we move to bookworm. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987818 for details. Update

  1   2   3   4   5   >