Re: [PATCH 2/2] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions

2023-05-02 Thread Cédric Le Goater
On 4/13/23 21:01, Shivaprasad G Bhat wrote: Add test for vextractbm, vextractwm, vextractdm and vextractqm instructions. Test works for both qemu-ppc64 and qemu-ppc64le. Based on the test case written by John Platts posted at [1] References: [1]: https://gitlab.com/qemu-project/qemu/-/issues/15

Re: [PATCH] migration/xbzrle: Use __attribute__((target)) for avx512

2023-05-02 Thread Juan Quintela
Richard Henderson wrote: > Use the attribute, which is supported by clang, instead of > the #pragma, which is not supported and, for some reason, > also not detected by the meson probe, so we fail by -Werror. > > Signed-off-by: Richard Henderson Reviewed-by: Juan Quintela

Re: [PATCH v2 2/4] ppc: spapr: cleanup h_enter_nested() with helper routines.

2023-05-02 Thread Harsh Prateek Bora
On 5/2/23 12:11, Nicholas Piggin wrote: On Tue May 2, 2023 at 4:13 PM AEST, Harsh Prateek Bora wrote: On 5/2/23 10:19, Nicholas Piggin wrote: On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: @@ -1607,49 +1680,15 @@ static target_ulong h_enter_nested(PowerPCCPU *cpu,

Re: [PATCH] async: avoid use-after-free on re-entrancy guard

2023-05-02 Thread Thomas Huth
On 01/05/2023 16.19, Alexander Bulekov wrote: A BH callback can free the BH, causing a use-after-free in aio_bh_call. Fix that by keeping a local copy of the re-entrancy guard pointer. Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58513 Fixes: 9c86c97f12 ("async: Add an optional

Re: [PATCH v3] meson: Pass -j option to sphinx

2023-05-02 Thread Daniel P . Berrangé
On Sat, Apr 29, 2023 at 02:33:17PM +0200, Paolo Bonzini wrote: > On 4/28/23 17:01, Fabiano Rosas wrote: > > Also make sure our plugins support parallelism and report it properly > > to sphinx. Particularly, implement the merge_domaindata method in > > DBusDomain that is used to merge in data from o

Re: [PATCH v2 2/4] ppc: spapr: cleanup h_enter_nested() with helper routines.

2023-05-02 Thread Nicholas Piggin
On Tue May 2, 2023 at 5:36 PM AEST, Harsh Prateek Bora wrote: > > > On 5/2/23 12:11, Nicholas Piggin wrote: > > On Tue May 2, 2023 at 4:13 PM AEST, Harsh Prateek Bora wrote: > >> On 5/2/23 10:19, Nicholas Piggin wrote: > >>> On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: > @@

Re: [PATCH] qemu/int128: Re-shuffle Int128Alias members

2023-05-02 Thread Alex Bennée
Richard Henderson writes: > Clang 14, with --enable-tcg-interpreter errors with > > include/qemu/int128.h:487:16: error: alignment of field 'i' (128 bits) > does not match the alignment of the first field in transparent union; > transparent_union attribute ignored [-Werror,-Wignored-attribu

Re: [RESEND PATCH v6 1/8] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register

2023-05-02 Thread Michael S. Tsirkin
On Thu, Mar 02, 2023 at 01:37:02PM +, Jonathan Cameron wrote: > This register in AER should be both writeable and should > have a default value with a couple of the errors masked > including the Uncorrectable Internal Error used by CXL for > it's error reporting. > > Signed-off-by: Jonathan Ca

Re: [PATCH 1/2] tcg: ppc64: Fix mask generation for vextractdm

2023-05-02 Thread Alex Bennée
Shivaprasad G Bhat writes: > In function do_extractm() the mask is calculated as > dup_const(1 << (element_width - 1)). '1' being signed int > works fine for MO_8,16,32. For MO_64, on PPC64 host > this ends up becoming 0 on compilation. The vextractdm > uses MO_64, and it ends up having mask as

Re: [PATCH v7 1/1] arm/kvm: add support for MTE

2023-05-02 Thread Cornelia Huck
On Mon, May 01 2023, Richard Henderson wrote: > On 4/28/23 18:50, Juan Quintela wrote: >> Pardon my ignorance here, but to try to help with migration. How is >> this mte tag stored? >> - 1 array of 8bits per page of memory >> - 1 array of 64bits per page of memory >> - whatever >> >> Lets asume

[PATCH v2 00/12] simpletrace: refactor and general improvements

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal I wanted to use simpletrace.py for an internal project, so I tried to update and polish the code. Some of the commits resolve specific issues, while some are more subjective. I've tried to divide it into commits so we can discuss the individual changes, and I'm ready to pull th

[PATCH v2 07/12] simpletrace: Improved error handling on struct unpack

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Changed to raise exception to be handled centrally. This also allows for easier unpacking, as errors has been filtered out. Signed-off-by:

[PATCH v2 05/12] simpletrace: Changed Analyzer class to become context-manager

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method (not

[PATCH v2 04/12] simpletrace: update code for Python 3.11

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simpletrace.py b/scripts/simpletrace.

[PATCH v2 01/12] simpletrace: Improve parsing of sys.argv; fix files never closed.

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for. The two input files were opened, but never explicitly closed. File usage changed to use `with` statement to take care of this. At the same time, ownersh

[PATCH v2 09/12] simpletrace: Refactor to separate responsibilities

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal NOTE: `process` changes function signature Moved event_mapping and event_id_to_name down one level in the function call-stack to keep variable instantiation and usage closer (`process` and `run` has no use of the variables; `read_trace_records` does). Instead of passing event_

[PATCH v2 06/12] simpletrace: Simplify construction of tracing methods

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's arguments li

[PATCH v2 03/12] simpletrace: changed naming of edict and idtoname to improve readability

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 34 +- 1 f

[PATCH v2 08/12] simpletrace: define exception and add handling

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 22 ++

[PATCH v2 11/12] scripts/analyse-locks-simpletrace.py: changed iteritems() to items()

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal Python 3 removed `dict.iteritems()` in favor of `dict.items()`. This means the script curerntly doesn't work on Python 3. Signed-off-by: Mads Ynddal --- scripts/analyse-locks-simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/analyse-lo

[PATCH v2 02/12] simpletrace: Annotate magic constants from QEMU code

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal It wasn't clear where the constants and structs came from, so I added comments to help. Signed-off-by: Mads Ynddal --- scripts/simpletrace.py | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py ind

[PATCH v2 12/12] scripts/analyse-locks-simpletrace.py: reflect changes to process in simpletrace.py

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal The signature of `process` in simpletrace.py has changed to not take filepaths as the two first arguments, but rather a file-like object. We change the code here to reflect that. Signed-off-by: Mads Ynddal --- scripts/analyse-locks-simpletrace.py | 3 ++- 1 file changed, 2 in

[PATCH v2 10/12] MAINTAINERS: add maintainer of simpletrace.py

2023-05-02 Thread Mads Ynddal
From: Mads Ynddal In my work to refactor simpletrace.py, I noticed that there's no maintainer of it, and has the status of "odd fixes". I'm using it from time to time, so I'd like to maintain the script. I've added myself as reviewer under "Tracing" to be informed of changes that might affect si

Re: [PATCH v2 2/3] pci: pci_add_option_rom(): refactor: use g_autofree for path variable

2023-05-02 Thread David Hildenbrand
On 25.04.23 18:14, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pci.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 1/3] pci: pci_add_option_rom(): improve style

2023-05-02 Thread David Hildenbrand
On 25.04.23 18:14, Vladimir Sementsov-Ogievskiy wrote: Fix over-80 lines and missing curly brackets for if-operators, which are required by QEMU coding style. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pci.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions

Re: [PATCH v11 06/13] tests/qtest: Adjust and document query-cpu-model-expansion test for arm

2023-05-02 Thread Peter Maydell
On Fri, 28 Apr 2023 at 08:45, Richard Henderson wrote: > > On 4/27/23 14:16, Fabiano Rosas wrote: > > Richard Henderson writes: > > > >> On 4/26/23 19:00, Fabiano Rosas wrote: > >>> We're about to move the 32-bit CPUs under CONFIG_TCG, so adjust the > >>> query-cpu-model-expansion test to check a

Re: [PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-05-02 Thread Michael S. Tsirkin
On Wed, Apr 26, 2023 at 11:00:46PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 26.04.23 07:43, Michael S. Tsirkin wrote: > > On Tue, Apr 25, 2023 at 07:14:34PM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > > > On incoming migration we have the following sequence to load option > > > ROM: >

Re: [PATCH v2] migration: Handle block device inactivation failures better

2023-05-02 Thread Kevin Wolf
Hi Eric, you asked me for a review downstream, but since you would have to bring back any problem to upstream anyway, let's discuss it here. For the start, let me state that (a) I don't fully understand why this patch fixes things and (b) I hate this function. More below. Am 14.04.2023 um 17:33 h

Re: [PATCH v11 00/13] target/arm: Allow CONFIG_TCG=n builds

2023-05-02 Thread Peter Maydell
On Wed, 26 Apr 2023 at 19:00, Fabiano Rosas wrote: > > Hi, > > Some minor changes: > > - new patch to move a test under CONFIG_TCG (broken on master); > - new patch to document the unsupported CPU test (Philippe); > - changed the test skip message when no KVM or TCG are present (Igor). Applied to

Re: [PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-05-02 Thread Vladimir Sementsov-Ogievskiy
On 02.05.23 12:48, Michael S. Tsirkin wrote: On Wed, Apr 26, 2023 at 11:00:46PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 26.04.23 07:43, Michael S. Tsirkin wrote: On Tue, Apr 25, 2023 at 07:14:34PM +0300, Vladimir Sementsov-Ogievskiy wrote: On incoming migration we have the following sequ

Re: [PATCH v2] hw/net: npcm7xx_emc: set MAC in register space

2023-05-02 Thread Peter Maydell
On Tue, 25 Apr 2023 at 21:49, Patrick Venture wrote: > > > > On Thu, Oct 6, 2022 at 6:18 AM Peter Maydell wrote: >> >> On Mon, 3 Oct 2022 at 18:38, Patrick Venture wrote: >> > >> > The MAC address set from Qemu wasn't being saved into the register space. >> > >> > Reviewed-by: Hao Wu >> > Signe

Re: QMP (without OOB) function running in thread different from the main thread as part of aio_poll

2023-05-02 Thread Fiona Ebner
Am 28.04.23 um 18:54 schrieb Juan Quintela: > Kevin Wolf wrote: >> Am 28.04.2023 um 10:38 hat Juan Quintela geschrieben: >>> Kevin Wolf wrote: > I am perhaps a bit ingenuous here, but it is there a way to convince > qemu that snapshot_save_job_bh *HAS* to run on the main thread?

Re: [PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-05-02 Thread Juan Quintela
"Michael S. Tsirkin" wrote: >> > CC pbonzini,dgilbert,quintela,armbru : guys, is poking at runstate_check >> > like >> > this the right way to figure out we are not going to use the >> > device locally before incoming migration will overwrite ROM contents? >> >> RUN_STATE_INMIGRATE is set in th

Re: [PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-05-02 Thread Vladimir Sementsov-Ogievskiy
On 02.05.23 13:11, Juan Quintela wrote: "Michael S. Tsirkin" wrote: CC pbonzini,dgilbert,quintela,armbru : guys, is poking at runstate_check like this the right way to figure out we are not going to use the device locally before incoming migration will overwrite ROM contents? RUN_STATE_INMIG

Re: [PATCH] hw/arm/bcm2835_property: Implement "get command line" message

2023-05-02 Thread Peter Maydell
On Tue, 25 Apr 2023 at 11:34, Daniel Bertalan wrote: > > This query copies the kernel command line into the message buffer. It > was previously stubbed out to return empty, this commit makes it reflect > the arguments specified with `-append`. > > I observed the following peculiarities on my Pi 3B

Re: [PATCH v7 1/1] arm/kvm: add support for MTE

2023-05-02 Thread Juan Quintela
Cornelia Huck wrote: > On Mon, May 01 2023, Richard Henderson wrote: > >> On 4/28/23 18:50, Juan Quintela wrote: >>> Pardon my ignorance here, but to try to help with migration. How is >>> this mte tag stored? >>> - 1 array of 8bits per page of memory >>> - 1 array of 64bits per page of memory >

[PULL 2/3] tests/qtest: Restrict tpm-tis-i2c-test to CONFIG_TCG

2023-05-02 Thread Thomas Huth
From: Fabiano Rosas The test set -accel tcg, so restrict it to when TCG is present. Signed-off-by: Fabiano Rosas Message-Id: <20230426180013.14814-13-faro...@suse.de> Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 3 ++- 1 fi

[PULL 0/3] Various fixes

2023-05-02 Thread Thomas Huth
Hi Richard! The following changes since commit 7c18f2d663521f1b31b821a13358ce38075eaf7d: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-04-29 23:07:17 +0100) are available in the Git repository at: https://gitlab.com/thuth/qemu.git tags/pull-request-2023-05

[PULL 3/3] async: avoid use-after-free on re-entrancy guard

2023-05-02 Thread Thomas Huth
From: Alexander Bulekov A BH callback can free the BH, causing a use-after-free in aio_bh_call. Fix that by keeping a local copy of the re-entrancy guard pointer. Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58513 Fixes: 9c86c97f12 ("async: Add an optional reentrancy guard to t

[PULL 1/3] tests/qtest: Disable the spice test of readconfig-test on FreeBSD

2023-05-02 Thread Thomas Huth
The spice test is currently hanging on FreeBSD. It likely was never working before, since in the past, our configure script was failing to detect this feature due to a bug in the spice package there (it just got enabled recently by the commit https://cgit.freebsd.org/ports/commit/?id=cf16b1c9063351

Re: [PATCH v2 2/4] ppc: spapr: cleanup h_enter_nested() with helper routines.

2023-05-02 Thread Harsh Prateek Bora
On 5/2/23 14:09, Nicholas Piggin wrote: On Tue May 2, 2023 at 5:36 PM AEST, Harsh Prateek Bora wrote: On 5/2/23 12:11, Nicholas Piggin wrote: On Tue May 2, 2023 at 4:13 PM AEST, Harsh Prateek Bora wrote: On 5/2/23 10:19, Nicholas Piggin wrote: On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh

Re: [PATCH v3 00/10] Deprecate/rename singlestep command line option, monitor interfaces

2023-05-02 Thread Peter Maydell
On Mon, 17 Apr 2023 at 17:40, Peter Maydell wrote: > > The command line option '-singlestep' and its HMP equivalent > the 'singlestep' command are very confusingly named, because > they have nothing to do with single-stepping the guest (either > via the gdb stub or by emulation of guest CPU archit

Re: [PATCH] docs/about/deprecated.rst: Add "since 7.1" tag to dtb-kaslr-seed deprecation

2023-05-02 Thread Peter Maydell
On Thu, 20 Apr 2023 at 13:22, Peter Maydell wrote: > > In commit 5242876f37ca we deprecated the dtb-kaslr-seed property of > the virt board, but forgot the "since n.n" tag in the documentation > of this in deprecated.rst. > > This deprecation note first appeared in the 7.1 release, so > retrospect

Re: QMP (without OOB) function running in thread different from the main thread as part of aio_poll

2023-05-02 Thread Fiona Ebner
Am 02.05.23 um 12:03 schrieb Fiona Ebner: > Am 28.04.23 um 18:54 schrieb Juan Quintela: >> Kevin Wolf wrote: >>> Am 28.04.2023 um 10:38 hat Juan Quintela geschrieben: Kevin Wolf wrote: >> I am perhaps a bit ingenuous here, but it is there a way to convince >> qemu that snapshot_save_

Re: [PATCH] hw/net/msf2-emac: Don't modify descriptor in-place in emac_store_desc()

2023-05-02 Thread Peter Maydell
On Mon, 24 Apr 2023 at 17:27, Thomas Huth wrote: > > On 24/04/2023 17.19, Peter Maydell wrote: > > The msf2-emac ethernet controller has functions emac_load_desc() and > > emac_store_desc() which read and write the in-memory descriptor > > blocks and handle conversion between guest and host endian

Re: [PATCH 0/3] hw/arm: Fix raspi, aspeed bootloaders on big-endian hosts

2023-05-02 Thread Peter Maydell
On Mon, 24 Apr 2023 at 16:27, Peter Maydell wrote: > > Both the raspi and aspeed boards load their secondary CPU bootloader > code in a way that only works on little-endian hosts. This patchset > fixes that by making them both use the write_bootloader() function > in boot.c, which gets endianness-

Re: [PATCH] hw/intc/allwinner-a10-pic: Don't use set_bit()/clear_bit()

2023-05-02 Thread Peter Maydell
On Mon, 24 Apr 2023 at 16:28, Peter Maydell wrote: > > The Allwinner PIC model uses set_bit() and clear_bit() to update the > values in its irq_pending[] array when an interrupt arrives. However > it is using these functions wrongly: they work on an array of type > 'long', and it is passing an ar

Re: [PATCH] qemu/int128: Re-shuffle Int128Alias members

2023-05-02 Thread Richard Henderson
On 5/2/23 09:44, Alex Bennée wrote: Richard Henderson writes: Clang 14, with --enable-tcg-interpreter errors with include/qemu/int128.h:487:16: error: alignment of field 'i' (128 bits) does not match the alignment of the first field in transparent union; transparent_union attribute ign

Re: QMP (without OOB) function running in thread different from the main thread as part of aio_poll

2023-05-02 Thread Juan Quintela
Fiona Ebner wrote: > Am 28.04.23 um 18:54 schrieb Juan Quintela: >> Kevin Wolf wrote: >>> Am 28.04.2023 um 10:38 hat Juan Quintela geschrieben: Kevin Wolf wrote: >> I am perhaps a bit ingenuous here, but it is there a way to convince >> qemu that snapshot_save_job_bh *HAS* to run on

Re: [PATCH] migration/xbzrle: Use __attribute__((target)) for avx512

2023-05-02 Thread Richard Henderson
On 5/2/23 08:11, Juan Quintela wrote: Richard Henderson wrote: Use the attribute, which is supported by clang, instead of the #pragma, which is not supported and, for some reason, also not detected by the meson probe, so we fail by -Werror. Signed-off-by: Richard Henderson Reviewed-by: Juan

Re: [PATCH 0/2] target/arm: Load correct half of 64-bit fields

2023-05-02 Thread Peter Maydell
On Mon, 24 Apr 2023 at 16:39, Peter Maydell wrote: > > This patchset fixes a bug where on a big-endian 64-bit host the > guest would crash immediately when it did an ERET. This happens > because when we load the new PC value from CPUARMState::esr_el[2] > we do a 32-bit load even though the struct

Re: [PATCH 0/2] arm: allwinner: fix endianness bugs in sdhost and sun8i-emac

2023-05-02 Thread Peter Maydell
On Mon, 24 Apr 2023 at 17:50, Peter Maydell wrote: > > This patchset fixes bugs in the sd controller and ethernet controller > devices used in the orangepi-pc board model. The bug is the same in > both cases: we read and write a descriptor struct from guest memory > without byte-swapping it, so th

Re: QMP (without OOB) function running in thread different from the main thread as part of aio_poll

2023-05-02 Thread Juan Quintela
Fiona Ebner wrote: > Am 02.05.23 um 12:03 schrieb Fiona Ebner: >> Am 28.04.23 um 18:54 schrieb Juan Quintela: >>> Kevin Wolf wrote: Am 28.04.2023 um 10:38 hat Juan Quintela geschrieben: > Kevin Wolf wrote: >>> I am perhaps a bit ingenuous here, but it is there a way to convince

Re: [PULL 00/21] Migration 20230428 patches

2023-05-02 Thread Juan Quintela
Richard Henderson wrote: > On 4/28/23 20:11, Juan Quintela wrote: >> The following changes since commit 05d50ba2d4668d43a835c5a502efdec9b92646e6: >>Merge tag 'migration-20230427-pull-request' of >> https://gitlab.com/juan.quintela/qemu into staging (2023-04-28 >> 08:35:06 +0100) >> are availab

Re: [PATCH] linux-user: Fix mips fp64 executables loading

2023-05-02 Thread Laurent Vivier
Le 04/04/2023 à 07:21, Daniil Kovalev a écrit : If a program requires fr1, we should set the FR bit of CP0 control status register and add F64 hardware flag. The corresponding `else if` branch statement is copied from the linux kernel sources (see `arch_check_elf` function in linux/arch/mips/kern

Re: [PATCH v3 00/10] Deprecate/rename singlestep command line option, monitor interfaces

2023-05-02 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 17 Apr 2023 at 17:40, Peter Maydell wrote: >> >> The command line option '-singlestep' and its HMP equivalent >> the 'singlestep' command are very confusingly named, because >> they have nothing to do with single-stepping the guest (either >> via the gdb stub or b

Re: [PULL 00/21] Migration 20230428 patches

2023-05-02 Thread Peter Maydell
On Tue, 2 May 2023 at 11:39, Juan Quintela wrote: > Richard, once that we are here, one of the problem that we are having is > that the test is exiting with an abort, so we have no clue what is > happening. Is there a way to get a backtrace, or at least the number This has been consistently an i

Re: [PATCH 1/2] tcg: ppc64: Fix mask generation for vextractdm

2023-05-02 Thread Richard Henderson
On 4/13/23 20:01, Shivaprasad G Bhat wrote: In function do_extractm() the mask is calculated as dup_const(1 << (element_width - 1)). '1' being signed int works fine for MO_8,16,32. For MO_64, on PPC64 host this ends up becoming 0 on compilation. The vextractdm uses MO_64, and it ends up having ma

[PATCH] tests/avocado/virtio-gpu: Fix the URLs of the test_virtio_vga_virgl test

2023-05-02 Thread Thomas Huth
The URLs here are not valid anymore - looks like the assets got moved into the pub/archive/ subfolder instead. Signed-off-by: Thomas Huth --- tests/avocado/virtio-gpu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/avocado/virtio-gpu.py b/tests/avocado/virtio-gpu

Re: [PATCH v7 1/1] arm/kvm: add support for MTE

2023-05-02 Thread Richard Henderson
On 5/2/23 10:03, Cornelia Huck wrote: Has anyone been able to access a real system with MTE? (All the systems where I had hoped that MTE would be available didn't have MTE in the end so far, so I'd be interested to hear if anybody else already got to play with one.) Honestly, I don't want to even

Re: [PATCH RFC v2 2/9] target/loongarch: Define some kvm_arch interfaces

2023-05-02 Thread Richard Henderson
On 4/27/23 08:26, Tianrui Zhao wrote: Define some functions in target/loongarch/kvm.c, such as kvm_arch_put_registers, kvm_arch_get_registers and kvm_arch_handle_exit, etc. which are needed by kvm/kvm-all.c. Now the most functions has no content and they will be implemented in the next patches.

Re: [PATCH RFC v2 3/9] target/loongarch: Supplement vcpu env initial when vcpu reset

2023-05-02 Thread Richard Henderson
On 4/27/23 08:26, Tianrui Zhao wrote: Supplement vcpu env initial when vcpu reset, including init vcpu mp_state value to KVM_MP_STATE_RUNNABLE and init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index. Signed-off-by: Tianrui Zhao --- target/loongarch/cpu.c | 3 +++ target/loongarch/cpu.h | 2 ++ 2 f

Re: [PATCH] hw/arm/bcm2835_property: Implement "get command line" message

2023-05-02 Thread Daniel Bertalan
Hi Peter, Thank you for merging the patch. On Tuesday, May 2nd, 2023 at 12:15, Peter Maydell wrote: > > Are there any particularly interesting bits of guest software > that try to read this property ? We plan to use it in the AArch64 port of SerenityOS temporarily, while we are in the process

Re: [PATCH v3] Hexagon (target/hexagon) Additional instructions handled by idef-parser

2023-05-02 Thread Anton Johansson via
On 5/1/23 22:31, Taylor Simpson wrote: Changes in v3 Fix bugs exposed by dpmpyss_rnd_s0 instruction Set correct size/signedness for constants Test cases added to tests/tcg/hexagon/misc.c Changes in v2 Fix bug in imm_print identified in clang build Currently, idef

[PULL 00/12] tcg patch queue

2023-05-02 Thread Richard Henderson
The following changes since commit 7c18f2d663521f1b31b821a13358ce38075eaf7d: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-04-29 23:07:17 +0100) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230502

[PULL 04/12] qemu/host-utils.h: Add clz and ctz functions for lower-bit integers

2023-05-02 Thread Richard Henderson
From: Kiran Ostrolenk This is for use in the RISC-V vclz and vctz instructions (implemented in proceeding commit). Signed-off-by: Kiran Ostrolenk Reviewed-by: Richard Henderson Message-Id: <20230428144757.57530-11-lawrence.hun...@codethink.co.uk> Signed-off-by: Richard Henderson --- include/

[PULL 11/12] tcg/mips: Conditionalize tcg_out_exts_i32_i64

2023-05-02 Thread Richard Henderson
Since TCG_TYPE_I32 values are kept sign-extended in registers, we need not extend if the register matches. This is already relied upon by comparisons. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 4 +++- 1 file changed, 3 insertions(+), 1

[PULL 08/12] migration/xbzrle: Use __attribute__((target)) for avx512

2023-05-02 Thread Richard Henderson
Use the attribute, which is supported by clang, instead of the #pragma, which is not supported and, for some reason, also not detected by the meson probe, so we fail by -Werror. Signed-off-by: Richard Henderson Reviewed-by: Juan Quintela Message-Id: <20230501210555.289806-1-richard.hender...@lin

[PULL 06/12] tcg: Add tcg_gen_gvec_rotrs

2023-05-02 Thread Richard Henderson
From: Nazar Kazakov Add tcg expander and helper functions for rotate right vector with scalar operand. Signed-off-by: Nazar Kazakov Message-Id: <20230428144757.57530-10-lawrence.hun...@codethink.co.uk> [rth: Split out of larger patch; mask rotation count.] Signed-off-by: Richard Henderson ---

[PULL 03/12] qemu/bitops.h: Limit rotate amounts

2023-05-02 Thread Richard Henderson
From: Dickon Hood Rotates have been fixed up to only allow for reasonable rotate amounts (ie, no rotates >7 on an 8b value etc.) This fixes a problem with riscv vector rotate instructions. Signed-off-by: Dickon Hood Reviewed-by: Richard Henderson Message-Id: <20230428144757.57530-9-lawrence.h

[PULL 02/12] accel/tcg: Uncache the host address for instruction fetch when tlb size < 1

2023-05-02 Thread Richard Henderson
From: Weiwei Li When PMP entry overlap part of the page, we'll set the tlb_size to 1, which will make the address in tlb entry set with TLB_INVALID_MASK, and the next access will again go through tlb_fill.However, this way will not work in tb_gen_code() => get_page_addr_code_hostp(): the TLB host

[PULL 01/12] softmmu: Tidy dirtylimit_dirty_ring_full_time

2023-05-02 Thread Richard Henderson
Drop inline marker: let compiler decide. Change return type to uint64_t: this matches the computation in the return statement and the local variable assignment in the caller. Rename local to dirty_ring_size_MB to fix typo. Simplify conversion to MiB via qemu_target_page_bits and right shift. Rev

[PULL 05/12] tcg: Add tcg_gen_gvec_andcs

2023-05-02 Thread Richard Henderson
From: Nazar Kazakov Add tcg expander and helper functions for and-compliment vector with scalar operand. Signed-off-by: Nazar Kazakov Message-Id: <20230428144757.57530-10-lawrence.hun...@codethink.co.uk> [rth: Split out of larger patch.] Signed-off-by: Richard Henderson --- accel/tcg/tcg-runt

[PULL 07/12] qemu/int128: Re-shuffle Int128Alias members

2023-05-02 Thread Richard Henderson
Clang 14, with --enable-tcg-interpreter errors with include/qemu/int128.h:487:16: error: alignment of field 'i' (128 bits) does not match the alignment of the first field in transparent union; transparent_union attribute ignored [-Werror,-Wignored-attributes] __int128_t i; ^

[PULL 12/12] tcg: Introduce tcg_out_movext2

2023-05-02 Thread Richard Henderson
This is common code in most qemu_{ld,st} slow paths, moving two registers when there may be overlap between sources and destinations. At present, this is only used by 32-bit hosts for 64-bit data, but will shortly be used for more than that. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Rich

[PULL 09/12] accel/tcg: Add cpu_ld*_code_mmu

2023-05-02 Thread Richard Henderson
At least RISC-V has the need to be able to perform a read using execute permissions, outside of translation. Add helpers to facilitate this. Signed-off-by: Richard Henderson Acked-by: Alistair Francis Reviewed-by: Weiwei Li Tested-by: Daniel Henrique Barboza Message-Id: <20230325105429.1142530

[PULL 10/12] tcg/loongarch64: Conditionalize tcg_out_exts_i32_i64

2023-05-02 Thread Richard Henderson
Since TCG_TYPE_I32 values are kept sign-extended in registers, via ".w" instructions, we need not extend if the register matches. This is already relied upon by comparisons. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 4 +++- 1 fil

Re: [PATCH RFC v2 4/9] target/loongarch: Implement kvm get/set registers

2023-05-02 Thread Richard Henderson
On 4/27/23 08:26, Tianrui Zhao wrote: Implement kvm_arch_get/set_registers interfaces, many regs can be get/set in the function, such as core regs, csr regs, fpu regs, mp state, etc. Signed-off-by: Tianrui Zhao --- meson.build | 1 + target/loongarch/kvm.c| 356 ++

Re: [PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-05-02 Thread Michael S. Tsirkin
On Tue, May 02, 2023 at 12:11:38PM +0200, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > >> > CC pbonzini,dgilbert,quintela,armbru : guys, is poking at runstate_check > >> > like > >> > this the right way to figure out we are not going to use the > >> > device locally before incoming mig

Re: [PATCH RFC v2 5/9] target/loongarch: Implement kvm_arch_init function

2023-05-02 Thread Richard Henderson
On 4/27/23 08:26, Tianrui Zhao wrote: Implement the kvm_arch_init of loongarch, in the function, the KVM_CAP_MP_STATE cap is checked by kvm ioctl. Signed-off-by: Tianrui Zhao --- target/loongarch/kvm.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Richard Henderson r~

Re: [PATCH RFC v2 6/9] target/loongarch: Implement kvm_arch_init_vcpu

2023-05-02 Thread Richard Henderson
On 4/27/23 08:26, Tianrui Zhao wrote: +static void kvm_loongarch_vm_stage_change(void *opaque, bool running, Typo: state +uint64_t counter_value; I know naming is hard, but this is so generic it is difficult to determine what it does. Perhaps kvm_state_counter

[PATCH v2] vhost-user: send SET_STATUS 0 after GET_VRING_BASE

2023-05-02 Thread Stefan Hajnoczi
Setting the VIRTIO Device Status Field to 0 resets the device. The device's state is lost, including the vring configuration. vhost-user.c currently sends SET_STATUS 0 before GET_VRING_BASE. This risks confusion about the lifetime of the vhost-user state (e.g. vring last_avail_idx) across VIRTIO d

Re: [PATCH] async: avoid use-after-free on re-entrancy guard

2023-05-02 Thread Stefan Hajnoczi
On Mon, May 01, 2023 at 10:19:56AM -0400, Alexander Bulekov wrote: > A BH callback can free the BH, causing a use-after-free in aio_bh_call. > Fix that by keeping a local copy of the re-entrancy guard pointer. > > Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58513 > Fixes: 9c86c9

Re: [PATCH] linux-user: Fix mips fp64 executables loading

2023-05-02 Thread Michael Tokarev
04.04.2023 08:21, Daniil Kovalev Wrote: If a program requires fr1, we should set the FR bit of CP0 control status register and add F64 hardware flag. The corresponding `else if` branch statement is copied from the linux kernel sources (see `arch_check_elf` function in linux/arch/mips/kernel/elf.c

Re: [PATCH] hw/arm/bcm2835_property: Implement "get command line" message

2023-05-02 Thread Peter Maydell
On Tue, 2 May 2023 at 12:10, Daniel Bertalan wrote: > > Hi Peter, > > Thank you for merging the patch. > > On Tuesday, May 2nd, 2023 at 12:15, Peter Maydell > wrote: > > > > Are there any particularly interesting bits of guest software > > that try to read this property ? > > We plan to use it i

Re: [PULL 00/18] testing and doc updates

2023-05-02 Thread Peter Maydell
On Thu, 27 Apr 2023 at 16:47, Alex Bennée wrote: > > The following changes since commit 1eb95e1baef852d0971a1dd62a3293cd68f1ec35: > > Merge tag 'migration-20230426-pull-request' of > https://gitlab.com/juan.quintela/qemu into staging (2023-04-27 10:47:14 +0100) > > are available in the Git repo

Re: [PATCH v20 01/21] s390x/cpu topology: add s390 specifics to CPU topology

2023-05-02 Thread Cédric Le Goater
On 4/25/23 18:14, Pierre Morel wrote: S390 adds two new SMP levels, drawers and books to the CPU topology. The S390 CPU have specific topology features like dedication and entitlement to give to the guest indications on the host vCPUs scheduling and help the guest take the best decisions on the s

[PULL 08/35] tests/qtest: Fix tests when no KVM or TCG are present

2023-05-02 Thread Peter Maydell
From: Fabiano Rosas It is possible to have a build with both TCG and KVM disabled due to Xen requiring the i386 and x86_64 binaries to be present in an aarch64 host. If we build with --disable-tcg on the aarch64 host, we will end-up with a QEMU binary (x86) that does not support TCG nor KVM. Sk

[PULL 18/35] accel/tcg: Use one_insn_per_tb global instead of old singlestep global

2023-05-02 Thread Peter Maydell
The only place left that looks at the old 'singlestep' global variable is the TCG curr_cflags() function. Replace the old global with a new 'one_insn_per_tb' which is defined in tcg-all.c and declared in accel/tcg/internal.h. This keeps it restricted to the TCG code, unlike 'singlestep' which was

[PULL 11/35] arm/Kconfig: Do not build TCG-only boards on a KVM-only build

2023-05-02 Thread Peter Maydell
From: Fabiano Rosas Move all the CONFIG_FOO=y from default.mak into "default y if TCG" statements in Kconfig. That way they won't be selected when CONFIG_TCG=n. I'm leaving CONFIG_ARM_VIRT in default.mak because it allows us to keep the two default.mak files not empty and keep aarch64-default.ma

[PULL 01/35] target/arm: Move cortex sysregs into a separate file

2023-05-02 Thread Peter Maydell
From: Fabiano Rosas The file cpu_tcg.c is about to be moved into the tcg/ directory, so move the register definitions into a new file. Also move the function declaration to the more appropriate cpregs.h. Reviewed-by: Richard Henderson Signed-off-by: Fabiano Rosas Reviewed-by: Philippe Mathieu

[PULL 09/35] tests/avocado: Pass parameters to migration test

2023-05-02 Thread Peter Maydell
From: Fabiano Rosas The migration tests are currently broken for an aarch64 host because the tests pass no 'machine' and 'cpu' options on the QEMU command line. Add a separate class to each architecture so that we can specify 'machine' and 'cpu' options instead of relying on defaults. Add a ski

[PULL 12/35] tests/qtest: Restrict tpm-tis-i2c-test to CONFIG_TCG

2023-05-02 Thread Peter Maydell
From: Fabiano Rosas The test set -accel tcg, so restrict it to when TCG is present. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-id: 20230426180013.14814-13-faro...@suse.de Signed-off-by: Peter Maydell --- tests/qtest/meson.build | 3 ++- 1 fi

[PULL 19/35] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'

2023-05-02 Thread Peter Maydell
The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command line argument -one-insn-per-tb, so we ca

[PULL 02/35] target/arm: Remove dead code from cpu_max_set_sve_max_vq

2023-05-02 Thread Peter Maydell
From: Fabiano Rosas The sve-max-vq property has been removed from the -cpu max used with KVM, so code under kvm_enabled in cpu_max_set_sve_max_vq is not reachable. Fixes: 0baa21be49 ("target/arm: Make KVM -cpu max exactly like -cpu host") Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard

[PULL 22/35] accel/tcg: Report one-insn-per-tb in 'info jit', not 'info status'

2023-05-02 Thread Peter Maydell
Currently we report whether the TCG accelerator is in 'one-insn-per-tb' mode in the 'info status' output. This is a pretty minor piece of TCG specific information, and we want to deprecate the 'singlestep' field of the associated QMP command. Move the 'one-insn-per-tb' reporting to 'info jit'. W

[PULL 17/35] softmmu: Don't use 'singlestep' global in QMP and HMP commands

2023-05-02 Thread Peter Maydell
The HMP 'singlestep' command, the QMP 'query-status' command and the HMP 'info status' command (which is just wrapping the QMP command implementation) look at the 'singlestep' global variable. Make them access the new TCG accelerator 'one-insn-per-tb' property instead. This leaves the HMP and QMP

[PULL 32/35] target/arm: Define and use new load_cpu_field_low32()

2023-05-02 Thread Peter Maydell
In several places in the 32-bit Arm translate.c, we try to use load_cpu_field() to load from a CPUARMState field into a TCGv_i32 where the field is actually 64-bit. This works on little-endian hosts, but gives the wrong half of the register on big-endian. Add a new load_cpu_field_low32() which loa

[PULL 26/35] docs/about/deprecated.rst: Add "since 7.1" tag to dtb-kaslr-seed deprecation

2023-05-02 Thread Peter Maydell
In commit 5242876f37ca we deprecated the dtb-kaslr-seed property of the virt board, but forgot the "since n.n" tag in the documentation of this in deprecated.rst. This deprecation note first appeared in the 7.1 release, so retrospectively add the correct "since 7.1" annotation to it. Signed-off-b

[PULL 28/35] hw/arm/boot: Make write_bootloader() public as arm_write_bootloader()

2023-05-02 Thread Peter Maydell
From: Cédric Le Goater The arm boot.c code includes a utility function write_bootloader() which assists in writing a boot-code fragment into guest memory, including handling endianness and fixing it up with entry point addresses and similar things. This is useful not just for the boot.c code but

  1   2   3   >