Re: [PATCH v1] migration: refactor migration_completion

2023-07-17 Thread Isaku Yamahata
On Fri, Jul 14, 2023 at 08:48:23PM +0800, Wei Wang wrote: > Current migration_completion function is a bit long. Refactor the long > implementation into different subfunctions: > - migration_completion_precopy: completion code related to precopy > - migration_completion_postcopy: completion code

Re: [PATCH 0/6] linux-user: brk() syscall fixes and armhf static binary fix

2023-07-17 Thread Helge Deller
On 7/18/23 05:03, Song Gao wrote: Hi,  Helge Could you see the following bugs: https://gitlab.com/qemu-project/qemu/-/issues/1707 This issue is also caused by  the commit  86f04735ac. I don't have access to such a box (and on an arm64 debian porterbox I get unmet build dependencies, e.g. for

Re: [PATCH 6/6] linux-user: Fix qemu-arm to run static armhf binaries

2023-07-17 Thread Michael Tokarev
18.07.2023 00:35, Helge Deller wrote: qemu-user crashes immediately when running static binaries on the armhf architecture. The problem is the memory layout where the executable is loaded before the interpreter library, in which case the reserved brk region clashes with the interpreter code and

Re: [PATCH 0/6] linux-user: brk() syscall fixes and armhf static binary fix

2023-07-17 Thread Song Gao
Hi,  Helge Could you see the following bugs: https://gitlab.com/qemu-project/qemu/-/issues/1707 This issue is also caused by  the commit  86f04735ac. Thanks. Song Gao 在 2023/7/18 上午5:35, Helge Deller 写道: Commit 86f04735ac ("linux-user: Fix brk() to release pages") introduced the possibility

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

2023-07-17 Thread LIU Zhiwei
On 2023/7/18 8:43, Weiwei Li wrote: On 2023/7/17 23:13, Rob Bradford wrote: On Thu, 2023-07-06 at 21:22 +0800, Weiwei Li wrote: 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

Re: [PATCH] vnc,ps2: fix the PS/2 mouse work badly when connect VNC

2023-07-17 Thread Gao,Shiyuan
> Hi > > On Mon, Jul 17, 2023 at 5:43 PM Gao,Shiyuan wrote: > > > > Hi > > > > > > On Mon, Jul 17, 2023 at 4:53 PM Gao,Shiyuan > > wrote: > > > > > > > > > > > > > > > > > > So move the guest mouse pointer to (0, 0) of the screen when > > connect > > > > the > > > > > > > > VNC, and then move

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

2023-07-17 Thread Yong Huang
On Thu, Jul 13, 2023 at 8:44 PM Markus Armbruster wrote: > ~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

Re: [PATCH] target/riscv/cpu.c: check priv_ver before auto-enable zca/zcd/zcf

2023-07-17 Thread LIU Zhiwei
On 2023/7/17 23:41, Daniel Henrique Barboza wrote: Commit bd30559568 made changes in how we're checking and disabling extensions based on env->priv_ver. One of the changes was to move the extension disablement code to the end of realize(), being able to disable extensions after we've

[PATCH] accel/tcg: Fix guest instruction address in output assembly log

2023-07-17 Thread Matt Borgerson
If CF_PCREL is enabled, generated host assembly logging (command line option `-d out_asm`) may incorrectly report guest instruction virtual addresses as page offsets instead of absolute addresses. This patch corrects the reported guest address. Signed-off-by: Matt Borgerson ---

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

2023-07-17 Thread Weiwei Li
On 2023/7/17 23:13, Rob Bradford wrote: On Thu, 2023-07-06 at 21:22 +0800, Weiwei Li wrote: 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

Re: [PATCH] target/riscv/cpu.c: check priv_ver before auto-enable zca/zcd/zcf

2023-07-17 Thread Weiwei Li
On 2023/7/17 23:41, Daniel Henrique Barboza wrote: Commit bd30559568 made changes in how we're checking and disabling extensions based on env->priv_ver. One of the changes was to move the extension disablement code to the end of realize(), being able to disable extensions after we've

Re: [PATCH for-8.2 0/2] target/riscv: add zicntr and zihpm flags

2023-07-17 Thread Daniel Henrique Barboza
On 7/17/23 19:33, Conor Dooley wrote: Hey, On Mon, Jul 17, 2023 at 06:54:17PM -0300, Daniel Henrique Barboza wrote: Hi, I decided to include flags for both timer/counter extensions to make it easier for us later on when dealing with the RVA22 profile (which includes both). The features

Re: [PATCH for-8.2 0/2] target/riscv: add zicntr and zihpm flags

2023-07-17 Thread Conor Dooley
Hey, On Mon, Jul 17, 2023 at 06:54:17PM -0300, Daniel Henrique Barboza wrote: > Hi, > > I decided to include flags for both timer/counter extensions to make it > easier for us later on when dealing with the RVA22 profile (which > includes both). > > The features were already implemented by

Re: [PATCH 4/6] linux-user: Fix signed math overflow in brk() syscall

2023-07-17 Thread Philippe Mathieu-Daudé
On 17/7/23 23:35, Helge Deller wrote: Fix the math overflow when calculating the new_malloc_size. new_host_brk_page and brk_page are unsigned integers. If userspace reduces the heap, new_host_brk_page is lower than brk_page which results in a huge positive number (but should actually be

[PATCH for-8.2 2/2] target/riscv/cpu.c: add zihpm extension flag

2023-07-17 Thread Daniel Henrique Barboza
zihpm is the Hardware Performance Counters extension described in chapter 12 of the unprivileged spec. It describes support for 29 unprivileged performance counters, hpmcounter3-hpmcounter21. As with zicntr, QEMU already implements zihpm before it was even an extension. zihpm is also part of the

[PATCH for-8.2 0/2] target/riscv: add zicntr and zihpm flags

2023-07-17 Thread Daniel Henrique Barboza
Hi, I decided to include flags for both timer/counter extensions to make it easier for us later on when dealing with the RVA22 profile (which includes both). The features were already implemented by Atish Patra some time ago, but back then these 2 extensions weren't introduced yet. This means

[PATCH for-8.2 1/2] target/riscv/cpu.c: add zicntr extension flag

2023-07-17 Thread Daniel Henrique Barboza
zicntr is the Base Counters and Timers extension described in chapter 12 of the unprivileged spec. It describes support for RDCYCLE, RDTIME and RDINSTRET. QEMU already implements it way before it was a discrete extension. zicntr is part of the RVA22 profile, so let's add it to QEMU to make the

Thoughts on implementing SEGGER RTT

2023-07-17 Thread Chris Laplante
Hi all, SEGGER RTT (https://wiki.segger.com/RTT) is a software debug mechanism which, among other things, exposes convenient virtual terminals. It is implemented as ring buffers in RAM. There is a control block with a fixed ID so it can be located by the RTT viewer (which runs on your PC, for

Re: [PATCH 0/6] linux-user: brk() syscall fixes and armhf static binary fix

2023-07-17 Thread Philippe Mathieu-Daudé
On 17/7/23 23:35, Helge Deller wrote: Commit 86f04735ac ("linux-user: Fix brk() to release pages") introduced the possibility for userspace applications to reduce memory footprint by calling brk() with a lower address and free up memory. This change introduced some failures for applications with

Re: [PATCH-for-8.1] i386/xen: fix off-by-one in xen_evtchn_set_gsi()

2023-07-17 Thread Philippe Mathieu-Daudé
Hi David, On 4/7/23 17:12, Woodhouse, David via wrote: Coverity points out (CID 1508128) a bounds checking error. We need to check for gsi >= IOAPIC_NUM_PINS, not just greater-than. Also fix up an assert() that has the same problem, that Coverity didn't see. Signed-off-by: David Woodhouse

[PATCH 2/6] linux-user: Fix qemu brk() to not zero bytes on current page

2023-07-17 Thread Helge Deller
The qemu brk() implementation is too aggressive and cleans remaining bytes on the current page above the last brk address. But some existing applications are buggy and read or write to bytes above their current heap address. On a phyiscal machine this does not trigger any runtime errors (as long

[PATCH 5/6] linux-user: Fix strace output for old_mmap

2023-07-17 Thread Helge Deller
The old_mmap syscall (e.g. on i386) hands over the parameters in a struct. Adjust the strace output to print the correct values. Signed-off-by: Helge Deller Reported-by: John Reiser Closes: https://gitlab.com/qemu-project/qemu/-/issues/1760 --- linux-user/strace.c | 49

[PATCH 3/6] linux-user: Prohibit brk() to to shrink below initial heap address

2023-07-17 Thread Helge Deller
Since commit 86f04735ac ("linux-user: Fix brk() to release pages") it's possible for userspace applications to reduce memory footprint by calling brk() with a lower address and free up memory. Before that guest heap memory never was unmapped. But the Linux kernel prohibits to reduce brk() below

[PATCH 4/6] linux-user: Fix signed math overflow in brk() syscall

2023-07-17 Thread Helge Deller
Fix the math overflow when calculating the new_malloc_size. new_host_brk_page and brk_page are unsigned integers. If userspace reduces the heap, new_host_brk_page is lower than brk_page which results in a huge positive number (but should actually be negative). Fix it by adding a proper check and

[PATCH 0/6] linux-user: brk() syscall fixes and armhf static binary fix

2023-07-17 Thread Helge Deller
Commit 86f04735ac ("linux-user: Fix brk() to release pages") introduced the possibility for userspace applications to reduce memory footprint by calling brk() with a lower address and free up memory. This change introduced some failures for applications with errors like - accesing bytes above the

[PATCH 1/6] Revert "linux-user: Make sure initial brk(0) is page-aligned"

2023-07-17 Thread Helge Deller
This reverts commit d28b3c90cfad1a7e211ae2bce36ecb9071086129. It just hides the real bug, and even the Linux kernel may return page-unaligned addresses. Signed-off-by: Helge Deller Tested-by: Markus F.X.J. Oberhumer --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH for-8.1 v2 0/2] target/mips: Avoid shift by negative number in page_table_walk_refill()

2023-07-17 Thread Philippe Mathieu-Daudé
This is a respin of Peter's patch, but - pass already-evaluated values to walk_directory() instead of an assert(), - check 'ptew > 1' instead of directory/leaf_shift == -1, - use unsigned type Since v1: walk_directory() doesn't have to rely on the to sanitize the input values. Peter,

[PATCH for-8.1 v2 1/2] target/mips: Pass directory/leaf shift values to walk_directory()

2023-07-17 Thread Philippe Mathieu-Daudé
We already evaluated directory_shift and leaf_shift in page_table_walk_refill(), no need to do that again: pass as argument. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/sysemu/tlb_helper.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git

[PATCH 6/6] linux-user: Fix qemu-arm to run static armhf binaries

2023-07-17 Thread Helge Deller
qemu-user crashes immediately when running static binaries on the armhf architecture. The problem is the memory layout where the executable is loaded before the interpreter library, in which case the reserved brk region clashes with the interpreter code and is released before qemu tries to start

[PATCH for-8.1 v2 2/2] target/mips: Avoid shift by negative number in page_table_walk_refill()

2023-07-17 Thread Philippe Mathieu-Daudé
Coverity points out that in page_table_walk_refill() we can shift by a negative number, which is undefined behaviour (CID 1452918, 1452920, 1452922). We already catch the negative directory_shift and leaf_shift as being a "bail out early" case, but not until we've already used them to calculated

Re: [PATCH v2] block: Fix pad_request's request restriction

2023-07-17 Thread Stefan Hajnoczi
On Fri, Jul 14, 2023 at 10:59:38AM +0200, Hanna Czenczek wrote: > bdrv_pad_request() relies on requests' lengths not to exceed SIZE_MAX, > which bdrv_check_qiov_request() does not guarantee. > > bdrv_check_request32() however will guarantee this, and both of > bdrv_pad_request()'s callers

Re: [PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-17 Thread Denis V. Lunev
On 7/17/23 21:04, Eric Blake wrote: On Mon, Jul 17, 2023 at 04:55:41PM +0200, Denis V. Lunev wrote: Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d Author: Hanna Reitz Date: Wed May 8 23:18:18 2019 +0200 qemu-nbd: Do not close stderr has introduced an interesting regression.

[PATCH 6/5] qemu-nbd: make verbose bool and local variable in main()

2023-07-17 Thread Denis V. Lunev
Pass 'verbose' to nbd_client_thread() inside NbdClientOpts which looks a little bit cleaner and make it bool as it is used as bool actually. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy --- qemu-nbd.c | 8 +--- 1 file changed, 5 insertions(+), 3

Re: Reducing vdpa migration downtime because of memory pin / maps

2023-07-17 Thread Si-Wei Liu
Hey, I am now back from the break. Sorry for the delayed response, please see in line. On 7/9/2023 11:04 PM, Eugenio Perez Martin wrote: On Sat, Jul 8, 2023 at 11:14 AM Si-Wei Liu wrote: On 7/5/2023 10:46 PM, Eugenio Perez Martin wrote: On Thu, Jul 6, 2023 at 2:13 AM Si-Wei Liu wrote:

Re: [PATCH] hw/char/escc: Implement loopback mode

2023-07-17 Thread Mark Cave-Ayland
On 16/07/2023 16:35, Thomas Huth wrote: The firmware of the m68k next-cube machine uses the loopback mode for self-testing the hardware and currently fails during this step. By implementing the loopback mode, we can make the firmware pass to the next step. Signed-off-by: Thomas Huth ---

Re: [PATCH v2] target/sparc: Handle FPRS correctly on big-endian hosts

2023-07-17 Thread Mark Cave-Ayland
On 17/07/2023 11:35, Peter Maydell wrote: In CPUSparcState we define the fprs field as uint64_t. However we then refer to it in translate.c via a TCGv_i32 which we set up with tcg_global_mem_new_ptr(). This means that on a big-endian host when the guest does something to writo te the FPRS

Re: [PATCH] target/i386: Check CR0.TS before enter_mmx

2023-07-17 Thread Matt Borgerson
Thanks Paolo! On Fri, Jul 14, 2023 at 7:28 AM Paolo Bonzini wrote: > > Queued, thanks. > > Paolo >

Re: [PATCH v2] plugins: Set final instruction count in plugin_gen_tb_end

2023-07-17 Thread Matt Borgerson
Thanks Alex! On Mon, Jul 17, 2023 at 8:34 AM Alex Bennée wrote: > > > Alex Bennée writes: > > > Matt Borgerson writes: > > > >> Translation logic may partially decode an instruction, then abort and > >> remove the instruction from the TB. This can happen for example when an > >> instruction

Re: [PULL for-8.1 0/1] Block patches

2023-07-17 Thread Richard Henderson
On 7/17/23 15:37, Stefan Hajnoczi wrote: The following changes since commit ed8ad9728a9c0eec34db9dff61dfa2f1dd625637: Merge tag 'pull-tpm-2023-07-14-1' ofhttps://github.com/stefanberger/qemu-tpm into staging (2023-07-15 14:54:04 +0100) are available in the Git repository at:

Re: [PULL 0/7] target-arm queue

2023-07-17 Thread Richard Henderson
+0100) are available in the Git repository at: https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230717 for you to fetch changes up to c2c1c4a35c7c2b1a4140b0942b9797c857e476a4: hw/nvram: Avoid unnecessary Xilinx eFuse backstore write (2023-07-17 11:05:52 +0100

Re: [PULL 00/19] UI & audio patches

2023-07-17 Thread Richard Henderson
On 7/17/23 13:45, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The following changes since commit ed8ad9728a9c0eec34db9dff61dfa2f1dd625637: Merge tag 'pull-tpm-2023-07-14-1' ofhttps://github.com/stefanberger/qemu-tpm into staging (2023-07-15 14:54:04 +0100) are available in

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

2023-07-17 Thread Peter Xu
On Tue, Jul 11, 2023 at 03:38:18PM +0300, gudkov.and...@huawei.com wrote: > On Thu, Jul 06, 2023 at 03:23:43PM -0400, Peter Xu wrote: > > 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

Re: [PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-17 Thread Eric Blake
On Mon, Jul 17, 2023 at 04:55:41PM +0200, Denis V. Lunev wrote: > Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d > Author: Hanna Reitz > Date: Wed May 8 23:18:18 2019 +0200 > qemu-nbd: Do not close stderr > has introduced an interesting regression. Original behavior of > ssh

Re: [PATCH for-8.1] accel/tcg: Take mmap_lock in load_atomic16_or_exit

2023-07-17 Thread Alex Bennée
Richard Henderson writes: > On 7/17/23 11:40, Alex Bennée wrote: >> Richard Henderson writes: >> >>> For user-only, the probe for page writability may race with another >>> thread's mprotect. Take the mmap_lock around the operation. This >>> is still faster than the start/end_exclusive

Re: [PATCH 1/5] qemu-nbd: pass structure into nbd_client_thread instead of plain char*

2023-07-17 Thread Eric Blake
On Mon, Jul 17, 2023 at 04:55:40PM +0200, Denis V. Lunev wrote: > We are going to pass additional flag inside next patch. > > Signed-off-by: Denis V. Lunev > CC: Eric Blake > CC: Vladimir Sementsov-Ogievskiy > CC: > --- > qemu-nbd.c | 19 +-- > 1 file changed, 13

Re: [PATCH v2] hw/ide/piix: properly initialize the BMIBA register

2023-07-17 Thread Bernhard Beschow
Am 17. Juli 2023 11:03:38 UTC schrieb Olaf Hering : >Mon, 17 Jul 2023 08:46:16 + Bernhard Beschow : > >> The PIIX fix alone just fixes the syptom, not the underlying problem. The >> underlying problem is that the BAR isn't deactivated, and with the PIIX >> patch it will stay at address

Re: [PATCH qemu 1/2] dump: Pass DumpState to write_ functions

2023-07-17 Thread Marc-André Lureau
On Mon, Jul 17, 2023 at 9:55 PM Stephen Brennan < stephen.s.bren...@oracle.com> wrote: > For the next patch, we need a reference to DumpState when writing data. > > Signed-off-by: Stephen Brennan > Reviewed-by: Marc-André Lureau > --- > dump/dump.c | 40

Re: [PATCH v2] target/sparc: Handle FPRS correctly on big-endian hosts

2023-07-17 Thread Richard Henderson
On 7/17/23 11:35, Peter Maydell wrote: In CPUSparcState we define the fprs field as uint64_t. However we then refer to it in translate.c via a TCGv_i32 which we set up with tcg_global_mem_new_ptr(). This means that on a big-endian host when the guest does something to writo te the FPRS

[PATCH v2 01/12] qtest: bump min meson timeout to 60 seconds

2023-07-17 Thread Daniel P . Berrangé
Even some of the relatively fast qtests can sometimes hit the 30 second timeout in GitLab CI under high parallelism/load conditions. Bump the min to 60 seconds to give a higher margin for reliability. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 9

[PATCH v2 09/12] qtest: bump qos-test timeout to 2 minutes

2023-07-17 Thread Daniel P . Berrangé
The qos-test takes just under 1 minute in a --enable-debug build. Bumping to 2 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index

[PATCH v2 07/12] qtest: bump prom-env-test timeout to 3 minutes

2023-07-17 Thread Daniel P . Berrangé
The prom-env-test takes about 1 + 1/2 minutes in a --enable-debug build. Bumping to 3 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index

[PATCH v2 12/12] mtest2make: stop disabling meson test timeouts

2023-07-17 Thread Daniel P . Berrangé
The mtest2make.py script passes the arg '-t 0' to 'meson test' which disables all test timeouts. This is a major source of pain when running in GitLab CI and a test gets stuck. It will stall until GitLab kills the CI job. This leaves us with little easily consumable information about the stalled

[PATCH v2 11/12] qtest: bump bios-table-test timeout to 9 minutes

2023-07-17 Thread Daniel P . Berrangé
This is reliably hitting the current 2 minute timeout in GitLab CI, and for the TCI job, it even hits a 6 minute timeout. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 08/12] qtest: bump boot-serial-test timeout to 3 minutes

2023-07-17 Thread Daniel P . Berrangé
The boot-serial-test takes about 1 + 1/2 minutes in a --enable-debug build. Bumping to 3 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index

[PATCH v2 05/12] qtest: bump test-hmp timeout to 4 minutes

2023-07-17 Thread Daniel P . Berrangé
The npcm7xx_pwn-test takes just under 3 minutes in a --enable-debug build. Bumping to 4 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/meson.build

[PATCH v2 02/12] qtest: bump migration-test timeout to 5 minutes

2023-07-17 Thread Daniel P . Berrangé
The migration test should take between 1 min 30 and 2 mins on reasonably modern hardware. The test is not especially compute bound, rather its running time is dominated by the guest RAM size relative to the bandwidth cap, which forces each iteration to take at least 30 seconds. None the less under

[PATCH v2 06/12] qtest: bump pxe-test timeout to 3 minutes

2023-07-17 Thread Daniel P . Berrangé
The pxe-test takes about 1 + 1/2 minutes in a --enable-debug build. Bumping to 3 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index

[PATCH v2 10/12] qtest: bump aspeed_smc-test timeout to 4 minutes

2023-07-17 Thread Daniel P . Berrangé
On a reasonably old laptop this test takes 2 minutes 20 seconds with the arm emulator. Raising the timeout to 4 minutes gives greater headroom for slowdown. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v2 04/12] qtest: bump npcm7xx_pwn-test timeout to 5 minutes

2023-07-17 Thread Daniel P . Berrangé
The npcm7xx_pwn-test takes 3 & 1/2 minutes in a --enable-debug build. Bumping to 5 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build

[PATCH v2 03/12] qtest: bump qom-test timeout to 15 minutes

2023-07-17 Thread Daniel P . Berrangé
The qom-test is periodically hitting the 5 minute timeout when running on the aarch64 emulator under GitLab CI. With an --enable-debug build it can take over 10 minutes for arm/aarch64 targets. Setting timeout to 15 minutes gives enough headroom to hopefully make it reliable. Reviewed-by: Thomas

[PATCH v2 00/12] tests: enable meson test timeouts to improve debuggability

2023-07-17 Thread Daniel P . Berrangé
Perhaps the most painful of all the GitLab CI failures we see are the enforced job timeouts: "ERROR: Job failed: execution took longer than 1h15m0s seconds" https://gitlab.com/qemu-project/qemu/-/jobs/4387047648 when that hits the CI log shows what has *already* run, but figuring out what

Re: [PATCH for-8.1] accel/tcg: Take mmap_lock in load_atomic16_or_exit

2023-07-17 Thread Richard Henderson
On 7/17/23 11:40, Alex Bennée wrote: Richard Henderson writes: For user-only, the probe for page writability may race with another thread's mprotect. Take the mmap_lock around the operation. This is still faster than the start/end_exclusive fallback. Did we have a bug report or

Re: [PATCH for-8.1] accel/tcg: Take mmap_lock in load_atomic16_or_exit

2023-07-17 Thread Richard Henderson
On 7/17/23 11:12, Peter Maydell wrote: On Sun, 16 Jul 2023 at 18:03, Richard Henderson wrote: For user-only, the probe for page writability may race with another thread's mprotect. Take the mmap_lock around the operation. This is still faster than the start/end_exclusive fallback. Remove

Re: [PATCH for-8.1] target/mips: Avoid shift by negative number in page_table_walk_refill()

2023-07-17 Thread Philippe Mathieu-Daudé
On 17/7/23 18:29, Peter Maydell wrote: Coverity points out that in page_table_walk_refill() we can shift by a negative number, which is undefined behaviour (CID 1452918, 1452920, 1452922). We already catch the negative directory_shift and leaf_shift as being a "bail out early" case, but not

Re: [PATCH] i386/xen: fix off-by-one in xen_evtchn_set_gsi()

2023-07-17 Thread Peter Maydell
On Tue, 4 Jul 2023 at 16:13, Woodhouse, David wrote: > > Coverity points out (CID 1508128) a bounds checking error. We need to check > for gsi >= IOAPIC_NUM_PINS, not just greater-than. > > Also fix up an assert() that has the same problem, that Coverity didn't see. > > Signed-off-by: David

Re: [PATCH for-8.1 v2] hw/virtio-iommu: Fix potential OOB access in virtio_iommu_handle_command()

2023-07-17 Thread Eric Auger
Hi Philippe, On 7/17/23 19:26, Philippe Mathieu-Daudé wrote: > On 17/7/23 18:21, Eric Auger wrote: >> In the virtio_iommu_handle_command() when a PROBE request is handled, >> output_size takes a value greater than the tail size and on a subsequent >> iteration we can get a stack out-of-band

Re: [PATCH] target/riscv/cpu.c: check priv_ver before auto-enable zca/zcd/zcf

2023-07-17 Thread Conor Dooley
On Mon, Jul 17, 2023 at 12:41:41PM -0300, Daniel Henrique Barboza wrote: > Commit bd30559568 made changes in how we're checking and disabling > extensions based on env->priv_ver. One of the changes was to move the > extension disablement code to the end of realize(), being able to > disable

Re: [PATCH for-8.1 v2] hw/virtio-iommu: Fix potential OOB access in virtio_iommu_handle_command()

2023-07-17 Thread Philippe Mathieu-Daudé
On 17/7/23 18:21, Eric Auger wrote: In the virtio_iommu_handle_command() when a PROBE request is handled, output_size takes a value greater than the tail size and on a subsequent iteration we can get a stack out-of-band access. Initialize the output_size on each iteration. A backtrace would be

Re: [PATCH v7 8/8] parallels: Add data_off check

2023-07-17 Thread Denis V. Lunev
On 7/1/23 12:07, Alexander Ivanov wrote: data_off field of the parallels image header can be corrupted. Check if this field greater than the header + BAT size and less than file size. Change checking code in parallels_open() accordingly. Signed-off-by: Alexander Ivanov This patch requires a

[RFC PATCH 17/17] hw/cxl: Add tunneled command support to mailbox for switch cci.

2023-07-17 Thread Jonathan Cameron via
Allow a switch CCI to perform basic tunneling (which is transported in real hardware via PCIe VDM) to downstream devices. Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_device.h | 1 + hw/cxl/cxl-mailbox-utils.c | 92 + hw/mem/cxl_type3.c |

[RFC PATCH 16/17] hw/cxl: Implement Physical Ports status retrieval

2023-07-17 Thread Jonathan Cameron via
Signed-of-by: Jonathan Cameron --- hw/cxl/cxl-mailbox-utils.c | 87 ++ 1 file changed, 87 insertions(+) diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c index 9c1020d9ab..4cddd6eae1 100644 --- a/hw/cxl/cxl-mailbox-utils.c +++

[RFC PATCH 15/17] hw/cxl: Add a switch mailbox CCI function.

2023-07-17 Thread Jonathan Cameron via
CXL switch CCIs were added in CXL r3.0. They are a PCI function, identified by class code that provides a CXL mailbox (identical to that previously defined for CXL type 3 memory devices) over which various FM-API commands may be used. Whilst the intent of this feature is enable switch control from

[RFC PATCH 13/17] HACK: hw/i386/pc: Add Aspeed i2c controller + MCTP with ACPI tables

2023-07-17 Thread Jonathan Cameron via
CXL devices provide a standard Fabric Management API - FM-API. See CXL specification r3.0 from https://www.computeexpresslink.org In many real setups that will be used by a separate host from the one actually using the CXL devices (BMC or similar) but it is helpful to be able to use the main CXL

[RFC PATCH 14/17] docs: cxl: Add example commandline for MCTP CXL CCIs

2023-07-17 Thread Jonathan Cameron via
A lot more needed here on what these are for and what can be done with them. Signed-off-by: Jonathan Cameron --- docs/system/devices/cxl.rst | 27 +++ 1 file changed, 27 insertions(+) diff --git a/docs/system/devices/cxl.rst b/docs/system/devices/cxl.rst index

[RFC PATCH 12/17] HACK: hw/arm/virt: Add ACPI support for aspeed-i2c / mctp

2023-07-17 Thread Jonathan Cameron via
Enable this for FM-API testing for CXL devices via MCTP over I2C Example DSDT block: Device (MCTP) { Name (_HID, "PRP0001") // _HID: Hardware ID Name (_DSD, Package (0x02) // _DSD: Device-Specific Data { ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties

[RFC PATCH 11/17] HACK: arm/virt: Add aspeed-i2c controller and MCTP EP to enable MCTP testing

2023-07-17 Thread Jonathan Cameron via
As the only I2C emulation in QEMU that supports being both a master and a slave, suitable for MCTP over i2c is aspeed-i2c add this controller to the arm virt model and hook up our new i2c_mctp_cxl_fmapi device. The current Linux driver for aspeed-i2c has a hard requirement on a reset controller.

[RFC PATCH 10/17] misc/i2c_mctp_cxl: Initial device emulation

2023-07-17 Thread Jonathan Cameron via
The CCI and Fabric Manager APIs are used to configure CXL switches and devices. DMTF has defined an MCTP binding specification to carry these messages. The end goal of this work is to hook this up to emulated CXL switches and devices to allow control of the configuration. Signed-off-by: Jonathan

[RFC PATCH 09/17] i2c/mctp: Allow receiving messages to dest eid 0

2023-07-17 Thread Jonathan Cameron via
From: Matt Johnston The Null Destination ID, 0, is used for MCTP control messages when addressing by physical ID. That is used for Get Endpoint ID and Set Endpoint ID when querying/assigning an EID to an endpoint. Signed-off-by: Matt Johnston Signed-off-by: Jonathan Cameron --- hw/i2c/mctp.c

[RFC PATCH 08/17] hw/i2c: add mctp core

2023-07-17 Thread Jonathan Cameron via
From: Klaus Jensen Add an abstract MCTP over I2C endpoint model. This implements MCTP control message handling as well as handling the actual I2C transport (packetization). Devices are intended to derive from this and implement the class methods. Parts of this implementation is inspired by

Re: [PULL 46/66] virtio-iommu: Fix 64kB host page size VFIO device assignment

2023-07-17 Thread Eric Auger
On 7/17/23 19:07, Peter Maydell wrote: > On Mon, 17 Jul 2023 at 17:56, Eric Auger wrote: >> >> Hi Peter, >> On 7/17/23 12:50, Peter Maydell wrote: >>> On Tue, 11 Jul 2023 at 00:04, Michael S. Tsirkin wrote: From: Eric Auger When running on a 64kB page size host and protecting

[RFC PATCH 07/17] hw/acpi/aml-build: add function for i2c slave device serial bus description

2023-07-17 Thread Jonathan Cameron via
Needed for later patches that add MCTP over I2C support to both x86 and ARM boards. Signed-off-by: Jonathan Cameron --- include/hw/acpi/aml-build.h | 1 + hw/acpi/aml-build.c | 17 + 2 files changed, 18 insertions(+) diff --git a/include/hw/acpi/aml-build.h

[RFC PATCH 06/17] cxl/mbox: Generalize the CCI command processing

2023-07-17 Thread Jonathan Cameron via
By moving the parts of the mailbox command handling that are CCI type specific out to the caller, make the main handling code generic. Rename it to cxl_process_cci_message() to reflect this new generality. Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_device.h | 5 -

[RFC PATCH 05/17] cxl/mbox: Pull the CCI definition out of the CXLDeviceState

2023-07-17 Thread Jonathan Cameron via
Enables having multiple CCIs per devices. Each CCI (mailbox) has it's own state and command list, so they can't share a single structure. Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_device.h | 48 ++- hw/cxl/cxl-device-utils.c | 31 +---

[RFC PATCH 04/17] hw/mbox: Split mailbox command payload into separate input and output

2023-07-17 Thread Jonathan Cameron via
New CCI types that will be supported shortly do not have a single buffer used in both directions. As such, split it up. For CXL mailboxes the two pointers will be aliases of the same memory so all callbacks must allow for that. Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_device.h |

[RFC PATCH 03/17] cxl/mbox: Pull the payload out of struct cxl_cmd and make instances constant

2023-07-17 Thread Jonathan Cameron via
Putting the pointer in the structure for command handling puts a single variable element inside an otherwise constant structure. Move it out as a directly passed variable and take the cxl_cmd structures constant. Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_device.h | 6 +-

[RFC PATCH 02/17] hw/cxl/mailbox: Enable mulitple mailbox command sets

2023-07-17 Thread Jonathan Cameron via
Until now, we have supported only a single set of comamnds. To allow introduction of switch CCI functions, we need to be able to pick between different sets for a given mailbox instance. This patch should make not functional changes, but enable them in the following patches. Signed-off-by:

[RFC PATCH 00/17] hw/cxl: hw/cxl: Generic CCI emulation support

2023-07-17 Thread Jonathan Cameron via
Includes addition of I2C-MCTP CCIs and tunnelling via switch-cci. Base for this series messy, so I'd suggest the tree at https://gitlab.com/jic23/qemu cxl-2023-07-17 which includes this series in the middle. RFC for various reasons: 1 - I have some specification issues to figure out / query. 2 -

[RFC PATCH 01/17] hw/pci-bridge/cxl_upstream: Move defintion of device to header.

2023-07-17 Thread Jonathan Cameron via
To avoid repitition of switch upstream port specific data in the CXLDeviceState structure it will be necessary to call access the switch USP specific from mailbox callbacks. Hence move it to a header so it is no longer an opaque structure. Signed-off-by: Jonathan Cameron ---

Re: [PULL 46/66] virtio-iommu: Fix 64kB host page size VFIO device assignment

2023-07-17 Thread Peter Maydell
On Mon, 17 Jul 2023 at 17:56, Eric Auger wrote: > > > Hi Peter, > On 7/17/23 12:50, Peter Maydell wrote: > > On Tue, 11 Jul 2023 at 00:04, Michael S. Tsirkin wrote: > >> From: Eric Auger > >> > >> When running on a 64kB page size host and protecting a VFIO device > >> with the virtio-iommu,

Re: [PULL 46/66] virtio-iommu: Fix 64kB host page size VFIO device assignment

2023-07-17 Thread Eric Auger
On 7/17/23 13:51, Michael S. Tsirkin wrote: > On Mon, Jul 17, 2023 at 11:50:54AM +0100, Peter Maydell wrote: >> On Tue, 11 Jul 2023 at 00:04, Michael S. Tsirkin wrote: >>> From: Eric Auger >>> >>> When running on a 64kB page size host and protecting a VFIO device >>> with the virtio-iommu,

Re: [PULL 46/66] virtio-iommu: Fix 64kB host page size VFIO device assignment

2023-07-17 Thread Eric Auger
Hi Peter, On 7/17/23 12:50, Peter Maydell wrote: > On Tue, 11 Jul 2023 at 00:04, Michael S. Tsirkin wrote: >> From: Eric Auger >> >> When running on a 64kB page size host and protecting a VFIO device >> with the virtio-iommu, qemu crashes with this kind of message: >> >> qemu-kvm: virtio-iommu

Re: [PATCH v2 2/3] Add virtio-sound-pci device

2023-07-17 Thread Alex Bennée
Manos Pitsidianakis writes: > This patch adds a PCI wrapper device for the virtio-sound device. > > To test this, you'll need a >=5.13 kernel compiled with > CONFIG_SND_VIRTIO=y, which at the time of writing most distros have off > by default. > > Use with following flags in the invocation: >

Re: [PATCH v7 7/8] parallels: Use bdrv_co_getlength() in parallels_check_outside_image()

2023-07-17 Thread Denis V. Lunev
On 7/1/23 12:07, Alexander Ivanov wrote: bdrv_co_getlength() should be used in coroutine context. Replace bdrv_getlength() by bdrv_co_getlength() in parallels_check_outside_image(). Signed-off-by: Alexander Ivanov --- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH v7 6/8] parallels: Image repairing in parallels_open()

2023-07-17 Thread Denis V. Lunev
On 7/1/23 12:07, Alexander Ivanov wrote: Repair an image at opening if the image is unclean or out-of-image corruption was detected. Signed-off-by: Alexander Ivanov --- block/parallels.c | 70 +-- 1 file changed, 38 insertions(+), 32 deletions(-)

Re: [PATCH v2 1/3] Add virtio-sound device

2023-07-17 Thread Alex Bennée
Manos Pitsidianakis writes: > This patch adds an audio device implementing the recent virtio sound > spec (1.2). > > PCM functionality is implemented, and jack[0], chmaps[1] messages are > at the moment left unimplemented. > > PS2: This patch was based on a draft patch posted by OpenSynergy in

[PATCH qemu 0/2] dump: Only use the makedumpfile flattened format when necessary

2023-07-17 Thread Stephen Brennan
Hello, The dump-guest-memory monitor command supports kdump-zlib, as well as a few other compression options for the kdump format. However, the format it actually outputs is a variation on that format known as the "flattened format". The flattened format is essentially a sequence of records that

[PATCH qemu 2/2] dump: Only use the makedumpfile flattened format when necessary

2023-07-17 Thread Stephen Brennan
The flattened format is used by makedumpfile only when it is outputting a vmcore to a file which is not seekable. The flattened format functions essentially as a set of instructions of the form "seek to the given offset, then write the given bytes out". The flattened format can be reconstructed

Re: [PATCH v7 5/8] parallels: Add checking and repairing duplicate offsets in BAT

2023-07-17 Thread Denis V. Lunev
On 7/1/23 12:07, Alexander Ivanov wrote: Cluster offsets must be unique among all the BAT entries. Find duplicate offsets in the BAT and fix it by copying the content of the relevant cluster to a newly allocated cluster and set the new cluster offset to the duplicated entry. Add

[PATCH qemu 1/2] dump: Pass DumpState to write_ functions

2023-07-17 Thread Stephen Brennan
For the next patch, we need a reference to DumpState when writing data. Signed-off-by: Stephen Brennan --- dump/dump.c | 40 include/sysemu/dump.h | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dump/dump.c

Re: [PATCH v6 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-17 Thread Bui Quang Minh
On 7/17/23 17:47, Joao Martins wrote: +Peter, +Jason (intel-iommu maintainer/reviewer) On 15/07/2023 16:22, Bui Quang Minh wrote: As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Reviewed-by: Michael S. Tsirkin

  1   2   3   >