Re: [PATCH v2 1/4] softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping

2023-07-06 Thread David Hildenbrand
On 06.07.23 15:20, Juan Quintela wrote: David Hildenbrand wrote: On 06.07.23 10:10, Juan Quintela wrote: David Hildenbrand wrote: ram_block_discard_range() cannot possibly do the right thing in MAP_PRIVATE file mappings in the general case. To achieve the documented semantics, we also have

Re: [PATCH v5 1/2] migration: switchover-hold parameter

2023-07-06 Thread Avihai Horon
On 06/07/2023 15:43, Peter Xu wrote: External email: Use caution opening links or attachments Add a new migration parameter switchover-hold which can block src qemu migration from switching over to dest from running. One can set this flag to true so src qemu will keep iterating the VM data,

Re: [PATCH v5 1/2] migration: switchover-hold parameter

2023-07-06 Thread Markus Armbruster
Peter Xu writes: > Add a new migration parameter switchover-hold which can block src qemu > migration from switching over to dest from running. > > One can set this flag to true so src qemu will keep iterating the VM data, > not switching over to dest even if it can. > > It means now live

Re: [PATCH v5 1/2] migration: switchover-hold parameter

2023-07-06 Thread Peter Xu
Hi, Markus, On Thu, Jul 06, 2023 at 03:38:13PM +0200, Markus Armbruster wrote: > Peter Xu writes: > > > Add a new migration parameter switchover-hold which can block src qemu > > migration from switching over to dest from running. > > > > One can set this flag to true so src qemu will keep

Re: [PATCH QEMU v7 2/9] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2023-07-06 Thread Markus Armbruster
~hyman writes: > From: Hyman Huang(黄勇) > > Introduce "x-vcpu-dirty-limit-period" migration experimental > parameter, which is in the range of 1 to 1000ms and used to > make dirtyrate calculation period configurable. > > Currently with the "x-vcpu-dirty-limit-period" varies, the > total time of

Re: [PATCH] qemu_cleanup: begin drained section after vm_shutdown()

2023-07-06 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH QEMU v7 8/9] migration: Extend query-migrate to provide dirty page limit info

2023-07-06 Thread Markus Armbruster
~hyman writes: > From: Hyman Huang(黄勇) > > Extend query-migrate to provide throttle time and estimated > ring full time with dirty-limit capability enabled, through which > we can observe if dirty limit take effect during live migration. > > Signed-off-by: Hyman Huang(黄勇) > Reviewed-by: Markus

[PATCH] hw/arm/virt-acpi-build.c: Add missing header

2023-07-06 Thread Peng Liang
virt-acpi-build.c uses warn_report. However, it doesn't include qemu/error-report.h directly, it include qemu/error-report.h via trace.h if we enable log trace backend. But if we disable the log trace backend (e.g., --enable-trace-backends=nop), then virt-acpi-build.c will not include

Re: [PATCH] tb-maint: Document #ifdef..else..endif correctly

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 15:43, Richard W.M. Jones wrote: It was hard to tell from the comments whether the code applied to user mode (CONFIG_USER_ONLY) or system mode. Fix the comments on the #else and #endif directives to be clearer. Signed-off-by: Richard W.M. Jones --- accel/tcg/tb-maint.c | 4 ++--

[PATCH 1/2] accel/tcg: Split out cpu_exec_longjmp_cleanup

2023-07-06 Thread Richard Henderson
Share the setjmp cleanup between cpu_exec_step_atomic and cpu_exec_setjmp. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 43 +++ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c

Re: [PULL 07/11] tests/tcg/aarch64: Add testcases for IC IVAU and dual-mapped code

2023-07-06 Thread Peter Maydell
On Thu, 6 Jul 2023 at 13:45, John Högberg wrote: > > > That is enough to get it to build, but then in the CI the test > > consistently fails: > > > > https://gitlab.com/pm215/qemu/-/jobs/4606447875 > > > > TEST icivau on aarch64 > > make[1]: *** [Makefile:178: run-icivau] Error 1 > > > > I'm

Re: [PATCH v2 7/7] migration: Provide explicit error message for file shutdowns

2023-07-06 Thread Fabiano Rosas
Peter Xu writes: > On Wed, Jul 05, 2023 at 07:05:13PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > Provide an explicit reason for qemu_file_shutdown()s, which can be >> > displayed in query-migrate when used. >> > >> >> Can we consider this to cover the TODO: >> >> * TODO:

[PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Jean-Philippe Brucker
Arm TF-A fails to boot via semihosting following a recent change to the MMU code. Semihosting attempts to read parameters passed by TF-A in secure RAM via cpu_memory_rw_debug(). While performing the S1 translation, we call S1_ptw_translate() on the page table descriptor address, with an MMU index

Re: [PATCH 1/2] migration: factor out "resume_requested" in qmp_migrate()

2023-07-06 Thread Laszlo Ersek
On 7/6/23 15:28, Michael Tokarev wrote: > 06.07.2023 13:29, Laszlo Ersek пишет: >> It cuts back on those awkward, duplicated !(has_resume && resume) >> expressions. >> >> Cc: Juan Quintela (maintainer:Migration) >> Cc: Leonardo Bras (reviewer:Migration) >> Cc: Peter Xu (reviewer:Migration) >>

Re: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask()

2023-07-06 Thread Jean-Philippe Brucker
On Wed, Jul 05, 2023 at 03:16:31PM +0200, Eric Auger wrote: > >>> diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index > >>> 1eaf81bab5..0d9f7196fe 100644 > >>> --- a/hw/virtio/virtio-iommu.c > >>> +++ b/hw/virtio/virtio-iommu.c > >>> @@ -1101,29 +1101,24 @@ static int > >>>

Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask

2023-07-06 Thread Peter Xu
On Thu, Jul 06, 2023 at 01:55:47AM -0300, Leonardo Bras wrote: > When trying to migrate a machine type pc-q35-6.0 or lower, with this > cmdline options, > > -device > driver=pcie-root-port,port=18,chassis=19,id=pcie-root-port18,bus=pcie.0,addr=0x12 > \ > -device >

Re: [PATCH] xen-block: Avoid leaks on new error path

2023-07-06 Thread Paul Durrant
On 04/07/2023 18:18, Anthony PERARD wrote: From: Anthony PERARD Commit 189829399070 ("xen-block: Use specific blockdev driver") introduced a new error path, without taking care of allocated resources. So only allocate the qdicts after the error check, and free both `filename` and `driver`

Re: [PATCH v9 14/20] target/riscv/kvm.c: add multi-letter extension KVM properties

2023-07-06 Thread Daniel Henrique Barboza
On 7/6/23 09:14, Andrew Jones wrote: On Thu, Jul 06, 2023 at 07:17:32AM -0300, Daniel Henrique Barboza wrote: Let's add KVM user properties for the multi-letter extensions that KVM currently supports: zicbom, zicboz, zihintpause, zbb, ssaia, sstc, svinval and svpbmt. As with MISA

Re: [PATCH v3] target/ppc: Machine check on invalid real address access on POWER9/10

2023-07-06 Thread Cédric Le Goater
On 7/6/23 13:43, BALATON Zoltan wrote: On Thu, 6 Jul 2023, Cédric Le Goater wrote: On 7/6/23 09:32, Nicholas Piggin wrote: On Mon Jul 3, 2023 at 10:03 PM AEST, Nicholas Piggin wrote: ppc currently silently accepts invalid real address access. Catch these and turn them into machine checks on

Re: [PATCH 2/3] qemu-img: map: report compressed data blocks

2023-07-06 Thread Andrey Drobyshev
On 6/21/23 21:12, Denis V. Lunev wrote: > On 6/7/23 17:26, Andrey Drobyshev wrote: >> Right now "qemu-img map" reports compressed blocks as containing data >> but having no host offset.  This is not very informative.  Instead, >> let's add another boolean field named "compressed" in case JSON

Re: [PATCH 1/2] migration: factor out "resume_requested" in qmp_migrate()

2023-07-06 Thread Michael Tokarev
06.07.2023 13:29, Laszlo Ersek пишет: It cuts back on those awkward, duplicated !(has_resume && resume) expressions. Cc: Juan Quintela (maintainer:Migration) Cc: Leonardo Bras (reviewer:Migration) Cc: Peter Xu (reviewer:Migration) Cc: qemu-triv...@nongnu.org Bugzilla:

Re: [PATCH v5 1/2] migration: switchover-hold parameter

2023-07-06 Thread Peter Xu
On Thu, Jul 06, 2023 at 04:29:22PM +0300, Avihai Horon wrote: > > diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c > > index 9885d7c9f7..c3b3860f00 100644 > > --- a/migration/migration-hmp-cmds.c > > +++ b/migration/migration-hmp-cmds.c > > @@ -338,6 +338,9 @@ void

Re: [PATCH QEMU v7 3/9] qapi/migration: Introduce vcpu-dirty-limit parameters

2023-07-06 Thread Markus Armbruster
~hyman writes: > From: Hyman Huang(黄勇) > > Introduce "vcpu-dirty-limit" migration parameter used > to limit dirty page rate during live migration. > > "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are > two dirty-limit-related migration parameters, which can > be set before and during live

Re: [PATCH] hw/arm/virt-acpi-build.c: Add missing header

2023-07-06 Thread Peng Liang
I'm not sure whether the error has already been fixed by others or not. If so, please just ignore this patch. On 07/06/2023 23:08, Peng Liang wrote: virt-acpi-build.c uses warn_report. However, it doesn't include qemu/error-report.h directly, it include qemu/error-report.h via trace.h if we

Re: [PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Peter Maydell
On Thu, 6 Jul 2023 at 16:25, Jean-Philippe Brucker wrote: > > On Thu, Jul 06, 2023 at 03:28:32PM +0100, Peter Maydell wrote: > > On Thu, 6 Jul 2023 at 15:12, Jean-Philippe Brucker > > wrote: > > > > > > Arm TF-A fails to boot via semihosting following a recent change to the > > > MMU code.

Re: [PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Jean-Philippe Brucker
On Thu, Jul 06, 2023 at 04:42:02PM +0100, Peter Maydell wrote: > > > Do you have a repro case for this bug? Did it work > > > before commit fe4a5472ccd6 ? > > > > Yes I bisected to fe4a5472ccd6 by trying to run TF-A, following > > instructions here: > >

Re: [PATCH] hw/arm/virt-acpi-build.c: Add missing header

2023-07-06 Thread Ani Sinha
> On 06-Jul-2023, at 8:38 PM, Peng Liang wrote: > > virt-acpi-build.c uses warn_report. However, it doesn't include > qemu/error-report.h directly, it include qemu/error-report.h via trace.h > if we enable log trace backend. But if we disable the log trace backend > (e.g.,

[PATCH v2 0/3] qemu-img: map: implement support for compressed clusters

2023-07-06 Thread Andrey Drobyshev via
v1 --> v2: * Add vmdk format to the 1st commit. Tweak commit message accordingly; * Make "compressed" field in MapEntry optional. v1: https://lists.nongnu.org/archive/html/qemu-block/2023-06/msg00184.html Andrey Drobyshev (3): block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()

Re: [RFC PATCH] docs/interop: define STANDALONE protocol feature for vhost-user

2023-07-06 Thread Michael S. Tsirkin
On Tue, Jul 04, 2023 at 01:36:00PM +0100, Alex Bennée wrote: > Currently QEMU has to know some details about the back-end to be able > to setup the guest. While various parts of the setup can be delegated > to the backend (for example config handling) this is a very piecemeal > approach. > This

Re: [PATCH 1/4] QGA VSS: Add wrapper to send log to debugger and stderr

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 12:58, Konstantin Kostiuk wrote: On Thu, Jul 6, 2023 at 1:01 PM Philippe Mathieu-Daudé > wrote: On 6/7/23 09:54, Konstantin Kostiuk wrote: > Hi Philippe, > > On Wed, Jul 5, 2023 at 11:35 PM Philippe Mathieu-Daudé >

Re: [PULL v2 00/14] target-arm queue

2023-07-06 Thread Richard Henderson
200) are available in the Git repository at: https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230706 for you to fetch changes up to c41077235168140cdd4a34fce9bd95c3d30efe9c: target/arm: Avoid over-length shift in arm_cpu_sve_finalize() error case (2023-07-06 13:36

Re: [PATCH v2 7/7] migration: Provide explicit error message for file shutdowns

2023-07-06 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Jul 06, 2023 at 10:50:34AM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Wed, Jul 05, 2023 at 07:05:13PM -0300, Fabiano Rosas wrote: >> >> Peter Xu writes: >> >> >> >> > Provide an explicit reason for qemu_file_shutdown()s, which can be >> >> >

Re: [PATCH 2/2] target/arm: Define neoverse-v1

2023-07-06 Thread Peter Maydell
On Wed, 5 Jul 2023 at 15:09, Richard Henderson wrote: > > On 7/4/23 15:06, Peter Maydell wrote: > > If you're checking the values against the TRM, note that the > > summary tables differ from the register description in the TRM > > for ID_AA64DFR0_EL1, ID_AA64ZFR0_EL1 and ID_PFR0_EL1: we > >

Re: [PATCH 2/3] qemu-img: map: report compressed data blocks

2023-07-06 Thread Denis V. Lunev
On 7/6/23 15:10, Andrey Drobyshev wrote: On 6/21/23 21:12, Denis V. Lunev wrote: On 6/7/23 17:26, Andrey Drobyshev wrote: Right now "qemu-img map" reports compressed blocks as containing data but having no host offset.  This is not very informative.  Instead, let's add another boolean field

[PATCH v2 3/3] qemu-iotests: update expected tests output to contain "compressed" field

2023-07-06 Thread Andrey Drobyshev via
The previous commit adds "compressed" boolean field to JSON output of "qemu-img map" command. Let's tweak expected tests output accordingly. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/122.out| 84 tests/qemu-iotests/154.out| 194

[PATCH v2 2/3] qemu-img: map: report compressed data blocks

2023-07-06 Thread Andrey Drobyshev via
Right now "qemu-img map" reports compressed blocks as containing data but having no host offset. This is not very informative. Instead, let's add another boolean field named "compressed" in case JSON output mode is specified. This is achieved by utilizing new allocation status flag

Re: [RFC PATCH] docs/interop: define STANDALONE protocol feature for vhost-user

2023-07-06 Thread Alex Bennée
Alex Bennée writes: > Currently QEMU has to know some details about the back-end to be able > to setup the guest. While various parts of the setup can be delegated > to the backend (for example config handling) this is a very piecemeal > approach. > > This patch suggests a new feature flag

[PATCH v2 1/3] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()

2023-07-06 Thread Andrey Drobyshev via
Functions qcow2_get_host_offset(), get_cluster_offset(), vmdk_co_block_status() explicitly report compressed cluster types when data is compressed. However, this information is never passed further. Let's make use of it by adding new BDRV_BLOCK_COMPRESSED flag for bdrv_block_status(), so that

Re: [PATCH] hw/arm/virt-acpi-build.c: Add missing header

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 17:08, Peng Liang wrote: virt-acpi-build.c uses warn_report. However, it doesn't include qemu/error-report.h directly, it include qemu/error-report.h via trace.h if we enable log trace backend. But if we disable the log trace backend (e.g., --enable-trace-backends=nop), then

[PATCH] chore: rename `tricore_feature` to `is_tricore_feature_enabled`

2023-07-06 Thread Rui Chen
While upgrading capstone to v5 , there was some name clash with the tricore_feature in capstone (which was introduced in this PR ), thus rename tricore_feature to

[PATCH] tb-maint: Document #ifdef..else..endif correctly

2023-07-06 Thread Richard W.M. Jones
It was hard to tell from the comments whether the code applied to user mode (CONFIG_USER_ONLY) or system mode. Fix the comments on the #else and #endif directives to be clearer. Signed-off-by: Richard W.M. Jones --- accel/tcg/tb-maint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH v2 6/7] qemufile: Always return a verbose error

2023-07-06 Thread Fabiano Rosas
Peter Xu writes: > On Wed, Jul 05, 2023 at 06:54:37PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > There're a lot of cases where we only have an errno set in last_error but >> > without a detailed error description. When this happens, try to generate >> > an error contains the

Re: [PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Peter Maydell
On Thu, 6 Jul 2023 at 15:12, Jean-Philippe Brucker wrote: > > Arm TF-A fails to boot via semihosting following a recent change to the > MMU code. Semihosting attempts to read parameters passed by TF-A in > secure RAM via cpu_memory_rw_debug(). While performing the S1 > translation, we call

Re: [PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Jean-Philippe Brucker
On Thu, Jul 06, 2023 at 03:28:32PM +0100, Peter Maydell wrote: > On Thu, 6 Jul 2023 at 15:12, Jean-Philippe Brucker > wrote: > > > > Arm TF-A fails to boot via semihosting following a recent change to the > > MMU code. Semihosting attempts to read parameters passed by TF-A in > > secure RAM via

Re: [PATCH v2 7/7] migration: Provide explicit error message for file shutdowns

2023-07-06 Thread Peter Xu
On Thu, Jul 06, 2023 at 10:50:34AM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Wed, Jul 05, 2023 at 07:05:13PM -0300, Fabiano Rosas wrote: > >> Peter Xu writes: > >> > >> > Provide an explicit reason for qemu_file_shutdown()s, which can be > >> > displayed in query-migrate when

Re: [PATCH 1/2] migration: factor out "resume_requested" in qmp_migrate()

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 12:29, Laszlo Ersek wrote: It cuts back on those awkward, duplicated !(has_resume && resume) expressions. Cc: Juan Quintela (maintainer:Migration) Cc: Leonardo Bras (reviewer:Migration) Cc: Peter Xu (reviewer:Migration) Cc: qemu-triv...@nongnu.org Bugzilla:

Re: [PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Peter Maydell
On Thu, 6 Jul 2023 at 17:21, Peter Maydell wrote: > > On Thu, 6 Jul 2023 at 17:10, Jean-Philippe Brucker > wrote: > > > > On Thu, Jul 06, 2023 at 04:42:02PM +0100, Peter Maydell wrote: > > > > > Do you have a repro case for this bug? Did it work > > > > > before commit fe4a5472ccd6 ? > > > > > >

Re: [PULL 07/11] tests/tcg/aarch64: Add testcases for IC IVAU and dual-mapped code

2023-07-06 Thread Peter Maydell
On Wed, 5 Jul 2023 at 10:25, Philippe Mathieu-Daudé wrote: > > Cc'ing John. > > On 5/7/23 06:53, Richard Henderson wrote: > > On 7/4/23 18:36, Peter Maydell wrote: > >> +int main(int argc, char **argv) > >> +{ > >> +const char *shm_name = "qemu-test-tcg-aarch64-icivau"; > >> +int fd; > >>

Re: [PATCH v4 1/2] migration: switchover-hold parameter

2023-07-06 Thread Peter Xu
On Thu, Jul 06, 2023 at 11:40:04AM +0300, Avihai Horon wrote: > This only handles the QMP case, but we forgot to handle the HMP case. > I was testing it and got the following assert: > >   (qemu) migrate_set_parameter switchover-hold on >   qemu-system-x86_64:

Re: [PULL 07/11] tests/tcg/aarch64: Add testcases for IC IVAU and dual-mapped code

2023-07-06 Thread John Högberg
> That is enough to get it to build, but then in the CI the test > consistently fails: > > https://gitlab.com/pm215/qemu/-/jobs/4606447875 > > TEST icivau on aarch64 > make[1]: *** [Makefile:178: run-icivau] Error 1 > > I'm going to drop this patch from the pullreq until we > can figure out what's

Re: [PATCH] target/riscv: Fix LMUL check to use minimum SEW

2023-07-06 Thread Weiwei Li
On 2023/7/6 18:44, Rob Bradford wrote: The previous check was failing with: ELEN = 64 SEW = 16 and LMUL = 1/8 (encoded as 5) which is a valid combination. Fix the check to correctly match the specification by using minimum SEW rather than the active SEW. From the specification: "In

Re: [PATCH v5 1/2] migration: switchover-hold parameter

2023-07-06 Thread Avihai Horon
On 06/07/2023 16:44, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Jul 06, 2023 at 04:29:22PM +0300, Avihai Horon wrote: diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 9885d7c9f7..c3b3860f00 100644 ---

Re: [PATCH QEMU v7 4/9] migration: Introduce dirty-limit capability

2023-07-06 Thread Markus Armbruster
~hyman writes: > From: Hyman Huang(黄勇) > > Introduce migration dirty-limit capability, which can > be turned on before live migration and limit dirty > page rate durty live migration. > > Introduce migrate_dirty_limit function to help check > if dirty-limit capability enabled during live

Re: [PATCH 2/2] migration: unexport migrate_fd_error()

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 12:29, Laszlo Ersek wrote: The only migrate_fd_error() call sites are in "migration/migration.c", which is also where we define migrate_fd_error(). Make the function static, and remove its declaration from "migration/migration.h". Cc: Juan Quintela (maintainer:Migration) Cc: Leonardo

[PULL 01/14] target/arm: Add raw_writes ops for register whose write induce TLB maintenance

2023-07-06 Thread Peter Maydell
From: Eric Auger Some registers whose 'cooked' writefns induce TLB maintenance do not have raw_writefn ops defined. If only the writefn ops is set (ie. no raw_writefn is provided), it is assumed the cooked also work as the raw one. For those registers it is not obvious the tlb_flush works on KVM

[PULL 10/14] hw: arm: allwinner-sramc: Set class_size

2023-07-06 Thread Peter Maydell
From: Akihiko Odaki AwSRAMCClass is larger than SysBusDeviceClass so the class size must be advertised accordingly. Fixes: 05def917e1 ("hw: arm: allwinner-sramc: Add SRAM Controller support for R40") Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard

[PULL 08/14] tests/qtest: xlnx-canfd-test: Fix code coverity issues

2023-07-06 Thread Peter Maydell
From: Vikram Garhwal Following are done to fix the coverity issues: 1. Change read_data to fix the CID 1512899: Out-of-bounds access (OVERRUN) 2. Fix match_rx_tx_data to fix CID 1512900: Logically dead code (DEADCODE) 3. Replace rand() in generate_random_data() with g_rand_int() Signed-off-by:

[PULL 14/14] target/arm: Avoid over-length shift in arm_cpu_sve_finalize() error case

2023-07-06 Thread Peter Maydell
If you build QEMU with the clang sanitizer enabled, you can see it fire when running the arm-cpu-features test: $ QTEST_QEMU_BINARY=./build/arm-clang/qemu-system-aarch64 ./build/arm-clang/tests/qtest/arm-cpu-features [...] ../../target/arm/cpu64.c:125:19: runtime error: shift exponent 64 is too

[PULL 13/14] target/arm: Define neoverse-v1

2023-07-06 Thread Peter Maydell
Now that we have implemented support for FEAT_LSE2, we can define a CPU model for the Neoverse-V1, and enable it for the virt and sbsa-ref boards. Signed-off-by: Peter Maydell Message-id: 20230704130647.2842917-3-peter.mayd...@linaro.org Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson

[PULL 02/14] hw/arm/sbsa-ref: use XHCI to replace EHCI

2023-07-06 Thread Peter Maydell
From: Yuquan Wang The current sbsa-ref cannot use EHCI controller which is only able to do 32-bit DMA, since sbsa-ref doesn't have RAM below 4GB. Hence, this uses XHCI to provide a usb controller with 64-bit DMA capablity instead of EHCI. We bump the platform version to 0.3 with this change.

[PULL v2 00/14] target-arm queue

2023-07-06 Thread Peter Maydell
ory at: https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230706 for you to fetch changes up to c41077235168140cdd4a34fce9bd95c3d30efe9c: target/arm: Avoid over-length shift in arm_cpu_sve_finalize() error case (2023-07-06 13:36:51 +0

[PULL 06/14] target/arm: Fix SME full tile indexing

2023-07-06 Thread Peter Maydell
From: Richard Henderson For the outer product set of insns, which take an entire matrix tile as output, the argument is not a combined tile+column. Therefore using get_tile_rowcol was incorrect, as we extracted the tile number from itself. The test case relies only on assembler support for SME,

[PULL 07/14] target/arm: Handle IC IVAU to improve compatibility with JITs

2023-07-06 Thread Peter Maydell
From: John Högberg Unlike architectures with precise self-modifying code semantics (e.g. x86) ARM processors do not maintain coherency for instruction execution and memory, requiring an instruction synchronization barrier on every core that will execute the new code, and on many models also the

[PULL 03/14] tests/tcg/aarch64/sysregs.c: Use S syntax for id_aa64zfr0_el1 and id_aa64smfr0_el1

2023-07-06 Thread Peter Maydell
Some assemblers will complain about attempts to access id_aa64zfr0_el1 and id_aa64smfr0_el1 by name if the test binary isn't built for the right processor type: /tmp/ccASXpLo.s:782: Error: selected processor does not support system register name 'id_aa64zfr0_el1' /tmp/ccASXpLo.s:829: Error:

[PULL 12/14] target/arm: Suppress more TCG unimplemented features in ID registers

2023-07-06 Thread Peter Maydell
We already squash the ID register field for FEAT_SPE (the Statistical Profiling Extension) because TCG does not implement it and if we advertise it to the guest the guest will crash trying to look at non-existent system registers. Do the same for some other features which a real hardware

[PULL 09/14] target/arm: gdbstub: Guard M-profile code with CONFIG_TCG

2023-07-06 Thread Peter Maydell
From: Fabiano Rosas This code is only relevant when TCG is present in the build. Building with --disable-tcg --enable-xen on an x86 host we get: $ ../configure --target-list=x86_64-softmmu,aarch64-softmmu --disable-tcg --enable-xen $ make -j$(nproc) ...

[PULL 05/14] target/arm: Dump ZA[] when active

2023-07-06 Thread Peter Maydell
From: Richard Henderson Always print each matrix row whole, one per line, so that we get the entire matrix in the proper shape. Signed-off-by: Richard Henderson Message-id: 20230622151201.1578522-3-richard.hender...@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell ---

[PULL 11/14] target/xtensa: Assert that interrupt level is within bounds

2023-07-06 Thread Peter Maydell
In handle_interrupt() we use level as an index into the interrupt_vector[] array. This is safe because we have checked it against env->config->nlevel, but Coverity can't see that (and it is only true because each CPU config sets its XCHAL_NUM_INTLEVELS to something less than MAX_NLEVELS), so it

Re: [PATCH v2 2/4] virtio-mem: Skip most of virtio_mem_unplug_all() without plugged memory

2023-07-06 Thread Juan Quintela
David Hildenbrand wrote: > On 06.07.23 10:15, Juan Quintela wrote: >> David Hildenbrand wrote: >>> Already when starting QEMU we perform one system reset that ends up >>> triggering virtio_mem_unplug_all() with no actual memory plugged yet. >>> That, in turn will trigger

[PULL 04/14] target/arm: Avoid splitting Zregs across lines in dump

2023-07-06 Thread Peter Maydell
From: Richard Henderson Allow the line length to extend to 548 columns. While annoyingly wide, it's still less confusing than the continuations we print. Also, the default VL used by Linux (and max for A64FX) uses only 140 columns. Signed-off-by: Richard Henderson Message-id:

Re: [PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Peter Maydell
On Thu, 6 Jul 2023 at 17:10, Jean-Philippe Brucker wrote: > > On Thu, Jul 06, 2023 at 04:42:02PM +0100, Peter Maydell wrote: > > > > Do you have a repro case for this bug? Did it work > > > > before commit fe4a5472ccd6 ? > > > > > > Yes I bisected to fe4a5472ccd6 by trying to run TF-A, following

Re: [PATCH] hw/arm/virt-acpi-build.c: Add missing header

2023-07-06 Thread Michael Tokarev
06.07.2023 18:08, Peng Liang wrote: virt-acpi-build.c uses warn_report. However, it doesn't include qemu/error-report.h directly, it include qemu/error-report.h via trace.h if we enable log trace backend. But if we disable the log trace backend (e.g., --enable-trace-backends=nop), then

Re: [PATCH 0/2] migration: trivialities

2023-07-06 Thread Michael Tokarev
06.07.2023 13:29, Laszlo Ersek wrote: SSIA; originally for RHBZ#2018404 (hence the links in the commit messages). Cc: Juan Quintela (maintainer:Migration) Cc: Leonardo Bras (reviewer:Migration) Cc: Peter Xu (reviewer:Migration) Cc: qemu-triv...@nongnu.org Laszlo Ersek (2): migration:

Re: [RFC PATCH-for-8.1] accel: Remove HAX accelerator

2023-07-06 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > HAX is deprecated since commits 73741fda6c ("MAINTAINERS: Abort > HAXM maintenance") and 90c167a1da ("docs/about/deprecated: Mark > HAXM in QEMU as deprecated"), released in v8.0.0. > > Per the QEMU deprecation policy, we shouldn't remove it before > QEMU release

[PATCH v5 2/2] qtest/migration: Use switchover-hold to speedup

2023-07-06 Thread Peter Xu
This solution is heavily based on Daniel's original approach here, but hopefully a cleaner way to impl: https://lore.kernel.org/r/20230601161347.1803440-11-berra...@redhat.com The difference is we use the switchover-hold flag rather than tuning bw+downtime to guide test convergence, comparing to

[PATCH v5 1/2] migration: switchover-hold parameter

2023-07-06 Thread Peter Xu
Add a new migration parameter switchover-hold which can block src qemu migration from switching over to dest from running. One can set this flag to true so src qemu will keep iterating the VM data, not switching over to dest even if it can. It means now live migration works somehow like COLO; we

[PATCH v5 0/2] migration: switchover-hold flag

2023-07-06 Thread Peter Xu
This v5 patchset is based on master. Since I'm not sure how long this series will take for review, we could probably apply Dan's previous patch 10 first, then when I repost I can provide a revert patch when needed. v5: - Fix HMP set the new bit [Avihai] A new flag "switchover-hold" is added to

[PATCH] qemu_cleanup: begin drained section after vm_shutdown()

2023-07-06 Thread Fiona Ebner
in order to avoid requests being stuck in a BlockBackend's request queue during cleanup. Having such requests can lead to a deadlock [0] with a virtio-scsi-pci device using iothread that's busy with IO when initiating a shutdown with QMP 'quit'. There is a race where such a queued request can

Re: [PATCH v2 0/4] virtio-mem: Support "x-ignore-shared" migration

2023-07-06 Thread Michael S. Tsirkin
On Thu, Jul 06, 2023 at 09:56:05AM +0200, David Hildenbrand wrote: > If there is no further feedback, I'll queue this myself shortly. > > Stumbling over "x-ignore-shared" migration support for virtio-mem on > my todo list, I remember talking to Dave G. a while ago about how >

Re: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask()

2023-07-06 Thread Eric Auger
Hi Jean, On 7/6/23 16:35, Jean-Philippe Brucker wrote: > On Wed, Jul 05, 2023 at 03:16:31PM +0200, Eric Auger wrote: > diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index > 1eaf81bab5..0d9f7196fe 100644 > --- a/hw/virtio/virtio-iommu.c > +++

[PATCH 0/2] accel/tcg: Fix race condition in tb create/invalidate

2023-07-06 Thread Richard Henderson
Thanks for the test case, Richard WMJ. Using the fedora rawhide kernel-core-6.5.0-0.rc0.20230703gita901a3568fd2.8.fc39.x86_64.rpm I was able to reproduce the problem within 30 iterations. I'm now at 650 iterations and counting. r~ Richard Henderson (2): accel/tcg: Split out

[PATCH 2/2] accel/tcg: Always lock pages before translation

2023-07-06 Thread Richard Henderson
We had done this for user-mode by invoking page_protect within the translator loop. Extend this to handle system mode as well. Move page locking out of tb_link_page. Reported-by: Liren Wei Reported-by: Richard W.M. Jones Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 30

Re: [PATCH v9 14/20] target/riscv/kvm.c: add multi-letter extension KVM properties

2023-07-06 Thread Andrew Jones
On Thu, Jul 06, 2023 at 07:17:32AM -0300, Daniel Henrique Barboza wrote: > Let's add KVM user properties for the multi-letter extensions that KVM > currently supports: zicbom, zicboz, zihintpause, zbb, ssaia, sstc, > svinval and svpbmt. > > As with MISA extensions, we're using the KVMCPUConfig

Re: [PATCH v2 1/4] softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping

2023-07-06 Thread Juan Quintela
David Hildenbrand wrote: > On 06.07.23 10:10, Juan Quintela wrote: >> David Hildenbrand wrote: >>> ram_block_discard_range() cannot possibly do the right thing in >>> MAP_PRIVATE file mappings in the general case. >>> >>> To achieve the documented semantics, we also have to punch a hole into >>>

Re: [PATCH v2] i386/xen: consistent locking around Xen singleshot timers

2023-07-06 Thread Paul Durrant
On 04/07/2023 16:51, David Woodhouse wrote: From: David Woodhouse Coverity points out (CID 1507534, 1507968) that we sometimes access env->xen_singleshot_timer_ns under the protection of env->xen_timers_lock and sometimes not. This isn't always an issue. There are two modes for the timers; if

Re: [PATCH] target/arm: Fix ptw parameters in S1_ptw_translate() for debug contexts

2023-07-06 Thread Marcin Juszkiewicz
W dniu 6.07.2023 o 17:25, Jean-Philippe Brucker pisze: (Note that there is an issue with TF-A missing ENABLE_FEAT_FGT for qemu at the moment, which prevents booting Linux with -cpu max. I'll send the fix to TF-A after this, but this reproducer should at least boot edk2.) Which reminds me that

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

2023-07-06 Thread Peter Xu
On Fri, Jun 30, 2023 at 06:29:00PM -0300, Fabiano Rosas wrote: > 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

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

2023-07-06 Thread Peter Xu
On Fri, Jun 30, 2023 at 06:28:57PM -0300, Fabiano Rosas wrote: > 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 Reviewed-by: Peter Xu -- Peter Xu

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

2023-07-06 Thread Peter Xu
On Fri, Jun 30, 2023 at 06:28:59PM -0300, Fabiano Rosas wrote: > 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 Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask()

2023-07-06 Thread Michael S. Tsirkin
On Wed, Jul 05, 2023 at 03:16:31PM +0200, Eric Auger wrote: > Hi Zhenghong, > > On 7/5/23 10:17, Duan, Zhenzhong wrote: > > > >> -Original Message- > >> From: Duan, Zhenzhong > >> Sent: Wednesday, July 5, 2023 12:56 PM > >> Subject: RE: [PATCH 2/2] virtio-iommu: Rework the trace in > >>

Re: [PATCH] migration/calc-dirty-rate: millisecond precision period

2023-07-06 Thread Peter Xu
On Thu, Jun 29, 2023 at 11:59:03AM +0300, Andrei Gudkov wrote: > Introduces alternative argument calc-time-ms, which is the > the same as calc-time but accepts millisecond value. > Millisecond precision allows to make predictions whether > migration will succeed or not. To do this, calculate dirty

[PATCH 2/2] i386: Fix MCE support for AMD hosts

2023-07-06 Thread John Allen
For the most part, AMD hosts can use the same MCE injection code as Intel but, there are instances where the qemu implementation is Intel specific. First, MCE deliviery works differently on AMD and does not support broadcast. Second, kvm_mce_inject generates MCEs that include a number of Intel

[PATCH 0/2] Fix MCE handling on AMD hosts

2023-07-06 Thread John Allen
In the event that a guest process attempts to access memory that has been poisoned in response to a deferred uncorrected MCE, an AMD system will currently generate a SIGBUS error which will result in the entire guest being shutdown. Ideally, we only want to kill the guest process that accessed

[PATCH 1/2] i386: Add support for SUCCOR feature

2023-07-06 Thread John Allen
Add cpuid bit definition for the SUCCOR feature. This cpuid bit is required to be exposed to guests to allow them to handle machine check exceptions on AMD hosts. Reported-by: William Roche Signed-off-by: John Allen --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 4 2 files changed, 5

Re: [RFC PATCH 0/6] Enable vdpa net migration with features depending on CVQ

2023-07-06 Thread Michael S. Tsirkin
On Thu, Jul 06, 2023 at 09:12:21PM +0200, Eugenio Pérez wrote: > At this moment the migration of net features that depends on CVQ is not > possible, as there is no reliable way to restore the device state like mac > address, number of enabled queues, etc to the destination. This is mainly >

Re: [PATCH 1/2] i386: Add support for SUCCOR feature

2023-07-06 Thread Moger, Babu
Hi John, Thanks for the patches. Few comments below. On 7/6/23 14:40, John Allen wrote: > Add cpuid bit definition for the SUCCOR feature. This cpuid bit is required to > be exposed to guests to allow them to handle machine check exceptions on AMD > hosts. > > Reported-by: William Roche >

Re: [PATCH v3] target/ppc: Machine check on invalid real address access on POWER9/10

2023-07-06 Thread Daniel Henrique Barboza
On 7/6/23 04:32, Nicholas Piggin wrote: On Mon Jul 3, 2023 at 10:03 PM AEST, Nicholas Piggin wrote: ppc currently silently accepts invalid real address access. Catch these and turn them into machine checks on POWER9/10 machines. Would there be any objections to merging this and the

Re: Emulation of 'System OFF' mode in ARM nRF51 SoCs

2023-07-06 Thread Chris Laplante
Hi Peter, > > > > Working on adding this now. One question - if the CPU is off (via > > arm_set_cpu_off), will the 'DETECT' IRQ I add to nrf51_gpio.c still fire? > > > Yes. The only thing that turning the CPU off affects is > the CPU -- all the rest of the devices in the system > continue to

Re: [PATCH] virtio-gpu: do not replace surface when scanout is disabled

2023-07-06 Thread Kim, Dongwon
On 7/4/2023 8:12 AM, Marc-André Lureau wrote: Hi On Wed, Jun 28, 2023 at 12:32 AM Dongwon Kim wrote: Surface is replaced with a place holder whenever the surface res is unreferenced by the guest message. With this logic, there is very frequent switching between guest display and

Re: [PATCH v2 7/7] migration: Provide explicit error message for file shutdowns

2023-07-06 Thread Peter Xu
On Thu, Jul 06, 2023 at 02:33:42PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Jul 06, 2023 at 10:50:34AM -0300, Fabiano Rosas wrote: > >> Peter Xu writes: > >> > >> > On Wed, Jul 05, 2023 at 07:05:13PM -0300, Fabiano Rosas wrote: > >> >> Peter Xu writes: > >> >> > >> >> >

  1   2   3   >