[PATCH 0/3] migration: some small cleanups

2024-01-16 Thread peterx
From: Peter Xu I found three tiny little patches lying around probably for a long time, sending it out before deleting the branch. Review welcomed, thanks. Peter Xu (3): migration: Make threshold_size an uint64_t migration: Drop unnecessary check in ram's pending_exact() analyze-migration

[PATCH 3/3] analyze-migration.py: Remove trick on parsing ramblocks

2024-01-16 Thread peterx
From: Peter Xu RAM_SAVE_FLAG_MEM_SIZE contains the total length of ramblock idstr to know whether scanning of ramblocks is complete. Drop the trick. Signed-off-by: Peter Xu --- scripts/analyze-migration.py | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts

Re: [PATCH v2 2/2] hw/pflash: implement update buffer for block writes

2024-01-16 Thread Peter Xu
On Tue, Jan 16, 2024 at 05:08:28PM +0100, Philippe Mathieu-Daudé wrote: > On 12/1/24 17:54, Peter Maydell wrote: > > On Mon, 8 Jan 2024 at 13:06, Philippe Mathieu-Daudé > > wrote: > > > > > > Hi Gerd, > > > > > > On 8/1/24 13:53, Philippe Mathieu-Daudé wrote: > > > > From: Gerd Hoffmann > > >

Re: [PULL 16/22] gdbstub: expose api to find registers

2024-01-16 Thread Akihiko Odaki
On 2024/01/16 19:48, Alex Bennée wrote: Expose an internal API to QEMU to return all the registers for a vCPU. The list containing the details required to called gdb_read_register(). Based-on: <20231025093128.33116-15-akihiko.od...@daynix.com> Cc: Akihiko Odaki Message-Id: <20240103173349.39852

Re: Re: [PATCH] tests/docker: Add sqlite3 module to openSUSE Leap container

2024-01-16 Thread Andrea Bolognani
On Wed, Jan 17, 2024 at 08:18:27AM +0100, Thomas Huth wrote: > On 17/01/2024 00.09, Fabiano Rosas wrote: > > Avocado needs sqlite3: > > > >Failed to load plugin from module "avocado.plugins.journal": > >ImportError("Module 'sqlite3' is not installed. > >Use: sudo zypper install python31

Re: [PATCH] coroutine-ucontext: Save fake stack for pooled coroutine

2024-01-16 Thread Akihiko Odaki
On 2024/01/16 17:42, Marc-André Lureau wrote: Hi On Mon, Jan 15, 2024 at 10:49 PM Stefan Hajnoczi wrote: On Fri, Jan 12, 2024 at 07:36:19PM +0900, Akihiko Odaki wrote: Coroutine may be pooled even after COROUTINE_TERMINATE if CONFIG_COROUTINE_POOL is enabled and fake stack should be saved in

Re: [PATCH v2] coroutine-ucontext: Save fake stack for pooled coroutine

2024-01-16 Thread Marc-André Lureau
Hi On Wed, Jan 17, 2024 at 11:26 AM Marc-André Lureau wrote: > > Hi > > On Wed, Jan 17, 2024 at 11:06 AM Akihiko Odaki > wrote: > > > > Coroutine may be pooled even after COROUTINE_TERMINATE if > > CONFIG_COROUTINE_POOL is enabled and fake stack should be saved in > > such a case to keep Addres

Re: [PATCH v2] coroutine-ucontext: Save fake stack for pooled coroutine

2024-01-16 Thread Marc-André Lureau
Hi On Wed, Jan 17, 2024 at 11:06 AM Akihiko Odaki wrote: > > Coroutine may be pooled even after COROUTINE_TERMINATE if > CONFIG_COROUTINE_POOL is enabled and fake stack should be saved in > such a case to keep AddressSanitizerUseAfterReturn working. Even worse, > I'm seeing stack corruption witho

Re: [PATCH] tests/docker: Add sqlite3 module to openSUSE Leap container

2024-01-16 Thread Thomas Huth
On 17/01/2024 00.09, Fabiano Rosas wrote: Avocado needs sqlite3: Failed to load plugin from module "avocado.plugins.journal": ImportError("Module 'sqlite3' is not installed. Use: sudo zypper install python311 to install it") Include the appropriate package in the dockerfile. From 'zy

Re: Error messages in the "avocado-system-opensuse" QEMU CI job

2024-01-16 Thread Philippe Mathieu-Daudé
On 16/1/24 16:31, Thomas Huth wrote:  Hi! I noticed that there are some error messages about a missing python module in the "avocado-system-opensuse" QEMU CI job:  https://gitlab.com/qemu-project/qemu/-/jobs/5911721890#L191 Anybody interested in fixing those? Fabiano is looking at it: h

Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended

2024-01-16 Thread Peter Xu
On Tue, Jan 16, 2024 at 03:37:33PM -0500, Steven Sistare wrote: > On 1/15/2024 2:33 AM, Peter Xu wrote: > > On Fri, Jan 12, 2024 at 07:05:10AM -0800, Steve Sistare wrote: > >> Allow cpr-reboot for vfio if the guest is in the suspended runstate. The > >> guest drivers' suspend methods flush outstan

Re: [PATCH] tests/docker: Add sqlite3 module to openSUSE Leap container

2024-01-16 Thread Philippe Mathieu-Daudé
Hi Fabiano, On 17/1/24 00:09, Fabiano Rosas wrote: Avocado needs sqlite3: Failed to load plugin from module "avocado.plugins.journal": ImportError("Module 'sqlite3' is not installed. Use: sudo zypper install python311 to install it") Include the appropriate package in the dockerfile.

[PATCH v2] coroutine-ucontext: Save fake stack for pooled coroutine

2024-01-16 Thread Akihiko Odaki
Coroutine may be pooled even after COROUTINE_TERMINATE if CONFIG_COROUTINE_POOL is enabled and fake stack should be saved in such a case to keep AddressSanitizerUseAfterReturn working. Even worse, I'm seeing stack corruption without fake stack being saved. Signed-off-by: Akihiko Odaki --- Changes

Re: [PATCH 2/2] i386/cpu: Mask with XCR0/XSS mask for FEAT_XSAVE_XCR0_HI and FEAT_XSAVE_XSS_HI leafs

2024-01-16 Thread Yang, Weijiang
On 1/15/2024 5:13 PM, Li, Xiaoyao wrote: The value of FEAT_XSAVE_XCR0_HI leaf and FEAT_XSAVE_XSS_HI leaf also need to be masked by XCR0 and XSS mask respectively, to make it logically correct. Fixes: 301e90675c3f ("target/i386: Enable support for XSAVES based features") Signed-off-by: Xiaoyao Li

Re: [PATCH 1/2] i386/cpu: Clear FEAT_XSAVE_XSS_LO/HI leafs when CPUID_EXT_XSAVE is not available

2024-01-16 Thread Yang, Weijiang
On 1/15/2024 5:13 PM, Li, Xiaoyao wrote: Leaf FEAT_XSAVE_XSS_LO and FEAT_XSAVE_XSS_HI also need to be cleared when CPUID_EXT_XSAVE is not set. Fixes: 301e90675c3f ("target/i386: Enable support for XSAVES based features") Signed-off-by: Xiaoyao Li --- target/i386/cpu.c | 2 ++ 1 file changed,

[PATCH v2] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM

2024-01-16 Thread Ani Sinha
By default, the timeout to receive any specified event from the QEMU VM is 60 seconds set by the python avocado test framework. Please see event_wait() and events_wait() in python/qemu/machine/machine.py. If the matching event is not triggered within that interval, an asyncio.TimeoutError is genera

Re: [PATCH] qdev: not add devices to bus in reverse order

2024-01-16 Thread Kai
On 1/9/24 17:52, kai.k...@windriver.com wrote: From: Kai Kang When this section of source codes were added via commit: * 02e2da45c4 Add common BusState it added devices to bus with LIST_INSERT_HEAD() which operated on the single direction list. It didn't have something like LIST_INSERT_TAIL()

Re: [PATCH v3 15/38] target/s390x: Improve general case of disas_jcc

2024-01-16 Thread Richard Henderson
On 1/17/24 09:19, Philippe Mathieu-Daudé wrote: +    case 0x4 | 0x1: /* cc == 1 || cc == 3 => (cc & 1) != 0 */ +    cond = TCG_COND_TSTNE; +    c->u.s32.b = tcg_constant_i32(1); Don't we need to AND?   c->u.s32.a = tcg_temp_new_i32();   tcg_gen_and

Re: [PATCH 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-16 Thread Eric Farman
On Tue, 2024-01-16 at 17:31 -0500, Matthew Rosato wrote: > ISM devices are sensitive to manipulation of the IOMMU, so the ISM > device > needs to be reset before the vfio-pci device is reset (triggering a > full > UNMAP).  In order to ensure this occurs, trigger ISM device resets > from > subsystem

Re: [PATCH V2 03/11] migration: convert to NotifierWithReturn

2024-01-16 Thread Peter Xu
On Tue, Jan 16, 2024 at 03:35:53PM -0500, Steven Sistare wrote: > On 1/15/2024 1:44 AM, Peter Xu wrote: > > On Fri, Jan 12, 2024 at 07:05:02AM -0800, Steve Sistare wrote: > >> Change all migration notifiers to type NotifierWithReturn, so notifiers > >> can return an error status in a future patch.

Re: [PATCH 2/3] s390x/pci: refresh fh before disabling aif

2024-01-16 Thread Eric Farman
On Tue, 2024-01-16 at 17:31 -0500, Matthew Rosato wrote: > Typically we refresh the host fh during CLP enable, however it's > possible > that the device goes through multiple reset events before the guest > performs another CLP enable.  Let's handle this for now by refreshing > the > host handle fr

Re: [PATCH 1/3] s390x/pci: avoid double enable/disable of aif

2024-01-16 Thread Eric Farman
On Tue, 2024-01-16 at 17:31 -0500, Matthew Rosato wrote: > Use a flag to keep track of whether AIF is currently enabled.  This > can be > used to avoid enabling/disabling AIF multiple times as well as to > determine > whether or not it should be disabled during reset processing. > > Fixes: d0bc709

Re: [PATCH 1/2] linux-user/riscv: vdso: fix call frame info in __vdso_rt_sigreturn

2024-01-16 Thread Richard Henderson
On 1/17/24 10:52, Vineet Gupta wrote: Ok it seems the issue is really subtle. With 8.2 trunk, the NOP needed before signal trampoline seems to be be factored into the unwind info for sigrestorer. 003c 0098 CIE   Version:   3   Augmentation:   

Re: [PATCH 1/2] linux-user/riscv: vdso: fix call frame info in __vdso_rt_sigreturn

2024-01-16 Thread Vineet Gupta
On 1/15/24 15:18, Richard Henderson wrote: > On 1/16/24 10:15, Vineet Gupta wrote: >> When testing gcc testsuite against QEMU v8.2 we found some additional >> failures vs. v8.1.2. >> >> | FAIL: gcc.dg/cleanup-10.c execution test >> | FAIL: gcc.dg/cleanup-11.c execution test >> | FAIL: gcc.dg/cle

Issue with PC updates.

2024-01-16 Thread Sid Manning
Hi Taylor, I ran into an issue when a packet, not executed out of ram (get_page_addr_code_hostp returns -1, see translate-all.c) contains a fault. This packet is an example: { p0 = cmp.eq(r6,#0x6) if (p0.new) jump:t pass memw(##0xf200) = r6 } The above packet should always jump t

[PATCH] tests/docker: Add sqlite3 module to openSUSE Leap container

2024-01-16 Thread Fabiano Rosas
Avocado needs sqlite3: Failed to load plugin from module "avocado.plugins.journal": ImportError("Module 'sqlite3' is not installed. Use: sudo zypper install python311 to install it") Include the appropriate package in the dockerfile. >From 'zypper info python311': "This package supplies

[PATCH 2/3] s390x/pci: refresh fh before disabling aif

2024-01-16 Thread Matthew Rosato
Typically we refresh the host fh during CLP enable, however it's possible that the device goes through multiple reset events before the guest performs another CLP enable. Let's handle this for now by refreshing the host handle from vfio before disabling aif. Fixes: 03451953c7 ("s390x/pci: reset I

[PATCH 0/3] s390x/pci: fix ISM reset

2024-01-16 Thread Matthew Rosato
Commit ef1535901a0 (re-)introduced an issue where passthrough ISM devices on s390x would enter an error state after reboot. This was previously fixed by 03451953c79e, using device reset callbacks, however the change in ef1535901a0 effectively triggers a cold reset of the pci bus before the device

[PATCH 1/3] s390x/pci: avoid double enable/disable of aif

2024-01-16 Thread Matthew Rosato
Use a flag to keep track of whether AIF is currently enabled. This can be used to avoid enabling/disabling AIF multiple times as well as to determine whether or not it should be disabled during reset processing. Fixes: d0bc7091c2 ("s390x/pci: enable adapter event notification for interpreted dev

[PATCH 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-16 Thread Matthew Rosato
ISM devices are sensitive to manipulation of the IOMMU, so the ISM device needs to be reset before the vfio-pci device is reset (triggering a full UNMAP). In order to ensure this occurs, trigger ISM device resets from subsystem_reset before triggering the PCI bus reset (which will also trigger vfi

Re: [PATCH v3 21/38] tcg/arm: Support TCG_COND_TST{EQ,NE}

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: Signed-off-by: Richard Henderson Message-Id: <20231028194522.245170-12-richard.hender...@linaro.org> [PMD: Split from bigger patch, part 2/2] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231108145244.72421-2-phi...@linaro.org> --- tcg/arm/tcg

Re: [PATCH v3 20/38] tcg/arm: Factor tcg_out_cmp() out

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: Signed-off-by: Richard Henderson Message-Id: <20231028194522.245170-12-richard.hender...@linaro.org> [PMD: Split from bigger patch, part 1/2] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231108145244.72421-1-phi...@linaro.org> --- tcg/arm/tcg

Re: [PATCH v3 15/38] target/s390x: Improve general case of disas_jcc

2024-01-16 Thread Philippe Mathieu-Daudé
Hi Richard, On 10/1/24 23:43, Richard Henderson wrote: Avoid code duplication by handling 7 of the 14 cases by inverting the test for the other 7 cases. Use TCG_COND_TSTNE for cc in {1,3}. Use (cc - 1) <= 1 for cc in {1,2}. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c |

Re: [PATCH] block/io: clear BDRV_BLOCK_RECURSE flag after recursing in bdrv_co_block_status

2024-01-16 Thread Stefan Hajnoczi
On Tue, Jan 16, 2024 at 04:48:39PM +0100, Fiona Ebner wrote: > Using fleecing backup like in [0] on a qcow2 image (with metadata > preallocation) can lead to the following assertion failure: > > > bdrv_co_do_block_status: Assertion `!(ret & BDRV_BLOCK_ZERO)' failed. > > In the reproducer [0], it

Re: [PATCH v3 12/38] target/m68k: Use TCG_COND_TST{EQ,NE} in gen_fcc_cond

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: Signed-off-by: Richard Henderson --- target/m68k/translate.c | 74 ++--- 1 file changed, 33 insertions(+), 41 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v3 09/38] target/alpha: Use TCG_COND_TST{EQ,NE} for BLB{C,S}

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: Signed-off-by: Richard Henderson Message-Id: <20231028194522.245170-33-richard.hender...@linaro.org> [PMD: Split from bigger patch, part 2/2] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231108205247.83234-2-phi...@linaro.org> --- target/alph

Re: [PATCH v3 07/38] tcg/optimize: Lower TCG_COND_TST{EQ,NE} if unsupported

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: After having performed other simplifications, lower any remaining test comparisons with AND. Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 2 ++ tcg/optimize.c | 60 +++--- tcg/tcg.c

Re: [PATCH v3 08/38] target/alpha: Pass immediate value to gen_bcond_internal()

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: Simplify gen_bcond() by passing an immediate value. Signed-off-by: Richard Henderson Message-Id: <20231028194522.245170-33-richard.hender...@linaro.org> [PMD: Split from bigger patch, part 1/2] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <202311

Re: [PATCH v3 36/38] tcg/s390x: Add TCG_CT_CONST_CMP

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:44, Richard Henderson wrote: Better constraint for tcg_out_cmp, based on the comparison. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-con-set.h | 6 +-- tcg/s390x/tcg-target-con-str.h | 1 + tcg/s390x/tcg-target.c.inc | 72 +-

Re: [PATCH v3 35/38] tcg/s390x: Split constraint A into J+U

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:44, Richard Henderson wrote: Signed 33-bit == signed 32-bit + unsigned 32-bit. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-con-set.h | 8 tcg/s390x/tcg-target-con-str.h | 2 +- tcg/s390x/tcg-target.c.inc | 36 +- 3

Re: [PATCH v3 31/38] tcg/ppc: Use cr0 in tcg_to_bc and tcg_to_isel

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:44, Richard Henderson wrote: Using cr0 means we could choose to use rc=1 to compute the condition. Adjust the tables and tcg_out_cmp that feeds them. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 68 1 file changed, 34

Re: [PATCH v3 13/38] target/sparc: Use TCG_COND_TSTEQ in gen_op_mulscc

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: Signed-off-by: Richard Henderson --- target/sparc/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v3 02/38] tcg: Introduce TCG_TARGET_HAS_tst

2024-01-16 Thread Philippe Mathieu-Daudé
On 10/1/24 23:43, Richard Henderson wrote: Define as 0 for all tcg backends. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 ++ tcg/arm/tcg-target.h | 2 ++ tcg/i386/tcg-target.h| 2 ++ tcg/loongarch64/tcg-target.h | 2 ++ tcg/mips/tcg-target.h

Re: [PATCH] accel: Do not set CPUState::can_do_io in non-TCG accels

2024-01-16 Thread Philippe Mathieu-Daudé
On 30/11/23 14:51, Richard Henderson wrote: On 11/29/23 14:50, Philippe Mathieu-Daudé wrote: 'can_do_io' is specific to TCG. Having it set in non-TCG code is confusing, so remove it from QTest / HVF / KVM. Signed-off-by: Philippe Mathieu-Daudé ---   accel/dummy-cpus.c    | 1 -   accel/hvf/

[PATCH v3 04/13] target/riscv/insn_trans/trans_rvbf16.c.inc: use cpu->cfg.vlenb

2024-01-16 Thread Daniel Henrique Barboza
Use ctx->cfg_ptr->vlenb instead of ctx->cfg_ptr->vlen / 8. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvbf16.c.inc | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvbf16.c

[PATCH v3 11/13] target/riscv: change vext_get_vlmax() arguments

2024-01-16 Thread Daniel Henrique Barboza
We'll re-use the logic froim vext_get_vlmax() in 2 other occurrences in the next patch, but first we need to make it independent of both 'cpu' and 'vtype'. To do that, add 'vlenb', 'vsew' and 'lmul' as parameters instead. Adapt the two existing callers. In cpu_get_tb_cpu_state(), rename 'sew' to '

[PATCH v3 13/13] target/riscv/cpu.c: remove cpu->cfg.vlen

2024-01-16 Thread Daniel Henrique Barboza
There is no need to keep both 'vlen' and 'vlenb'. All existing code that requires 'vlen' is retrieving it via 'vlenb << 3'. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/cpu.c | 8 +++- target/riscv/cpu_cfg.h | 1 - target/riscv/tcg/tcg-c

[PATCH v3 05/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb'

2024-01-16 Thread Daniel Henrique Barboza
Use s->cfg_ptr->vlenb instead of "s->cfg_ptr->vlen / 8" and "s->cfg_ptr->vlen >> 3". Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 140 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a

[PATCH v3 00/13] target/riscv: add 'cpu->cfg.vlenb', remove 'cpu->cfg.vlen'

2024-01-16 Thread Daniel Henrique Barboza
Hi, In this v3 the most significant change is with vext_get_vlmax() from cpu.h. The logic used in this function is also used in at least two other places, trans_vrgather_vi() and trans_vrgather_vx(), and we need to make changes in them to remove 'vlen' occurrences. Instead, we're adding an extra

[PATCH v3 06/13] target/riscv/insn_trans/trans_rvvk.c.inc: use 'vlenb'

2024-01-16 Thread Daniel Henrique Barboza
Use s->cfg_ptr->vlenb instead of s->cfg_ptr->vlen / 8. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvvk.c.inc | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvvk.c.inc

[PATCH v3 10/13] target/riscv/cpu.h: use 'vlenb' in vext_get_vlmax()

2024-01-16 Thread Daniel Henrique Barboza
Rename the existing 'sew' variable to 'vsew' for extra clarity. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 11df226a00..3af61e0f94 100644 --- a/target/r

[PATCH v3 12/13] trans_rvv.c.inc: use vext_get_vlmax() in trans_vrgather_v*()

2024-01-16 Thread Daniel Henrique Barboza
Use the helper instead of calculating vlmax by hand. Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvv.c.inc | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc ind

[PATCH v3 07/13] target/riscv/vector_helper.c: use 'vlenb'

2024-01-16 Thread Daniel Henrique Barboza
Use 'cpu->cfg.vlenb' instead of 'cpu->cfg.vlen >> 3'. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/vector_helper.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_

[PATCH v3 08/13] target/riscv/vector_helper.c: use vlenb in HELPER(vsetvl)

2024-01-16 Thread Daniel Henrique Barboza
Use the new 'vlenb' CPU config to validate fractional LMUL. The original comparison is done with 'vlen' and 'sew', both in bits. Adjust the shift to use vlenb. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/vector_helper.c | 11 +-- 1 file changed

[PATCH v3 03/13] target/riscv/gdbstub.c: use 'vlenb' instead of shifting 'vlen'

2024-01-16 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/gdbstub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 58b3ace0fe..5ab0abda19 100644 --- a/target/riscv/gdbstub.c +++ b/target

[PATCH v3 02/13] target/riscv/csr.c: use 'vlenb' instead of 'vlen'

2024-01-16 Thread Daniel Henrique Barboza
As a bonus, we're being more idiomatic using cpu->cfg.vlenb when reading CSR_VLENB. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/csr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index

[PATCH v3 01/13] target/riscv: add 'vlenb' field in cpu->cfg

2024-01-16 Thread Daniel Henrique Barboza
Our usage of 'vlenb' is overwhelming superior than the use of 'vlen'. We're using 'vlenb' most of the time, having to do 'vlen >> 3' or 'vlen / 8' in every instance. In hindsight we would be better if the 'vlenb' property was introduced instead of 'vlen'. That's not what happened, and now we can'

[PATCH v3 09/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MAXSZ()

2024-01-16 Thread Daniel Henrique Barboza
Calculate the maximum vector size possible, 'max_sz', which is the size in bytes 'vlenb' multiplied by the max value of LMUL (LMUL = 8, when s->lmul = 3). 'max_sz' is then shifted right by 'scale', expressed as '3 - s->lmul', which is clearer than doing 'scale = lmul - 3' and then using '-scale' i

Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended

2024-01-16 Thread Steven Sistare
On 1/16/2024 3:37 PM, Steven Sistare wrote: > On 1/15/2024 2:33 AM, Peter Xu wrote: >> On Fri, Jan 12, 2024 at 07:05:10AM -0800, Steve Sistare wrote: >>> Allow cpr-reboot for vfio if the guest is in the suspended runstate. The >>> guest drivers' suspend methods flush outstanding requests and re

Re: [PATCH v2 08/12] target/riscv/vector_helper.c: use vlenb in HELPER(vsetvl)

2024-01-16 Thread Daniel Henrique Barboza
On 1/15/24 19:57, Richard Henderson wrote: On 1/16/24 09:25, Daniel Henrique Barboza wrote: Use the new 'vlenb' CPU config to validate fractional LMUL. The original comparison is done with 'vlen' and 'sew', both in bits. Adjust the shift to use vlenb. Signed-off-by: Daniel Henrique Barboza

Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended

2024-01-16 Thread Steven Sistare
On 1/15/2024 2:33 AM, Peter Xu wrote: > On Fri, Jan 12, 2024 at 07:05:10AM -0800, Steve Sistare wrote: >> Allow cpr-reboot for vfio if the guest is in the suspended runstate. The >> guest drivers' suspend methods flush outstanding requests and re-initialize >> the devices, and thus there is no dev

Re: [PATCH V2 04/11] migration: remove migration_in_postcopy parameter

2024-01-16 Thread Steven Sistare
On 1/15/2024 1:48 AM, Peter Xu wrote: > On Fri, Jan 12, 2024 at 07:05:03AM -0800, Steve Sistare wrote: >> bool migration_in_incoming_postcopy(void) >> diff --git a/ui/spice-core.c b/ui/spice-core.c >> index b3cd229..e43a93f 100644 >> --- a/ui/spice-core.c >> +++ b/ui/spice-core.c >> @@ -580,7 +580

Re: [PATCH V2 00/11] allow cpr-reboot for vfio

2024-01-16 Thread Steven Sistare
On 1/12/2024 4:38 PM, Alex Williamson wrote: > On Fri, 12 Jan 2024 07:04:59 -0800 > Steve Sistare wrote: > >> Allow cpr-reboot for vfio if the guest is in the suspended runstate. The >> guest drivers' suspend methods flush outstanding requests and re-initialize >> the devices, and thus there is

Re: [PATCH V2 03/11] migration: convert to NotifierWithReturn

2024-01-16 Thread Steven Sistare
On 1/15/2024 1:44 AM, Peter Xu wrote: > On Fri, Jan 12, 2024 at 07:05:02AM -0800, Steve Sistare wrote: >> Change all migration notifiers to type NotifierWithReturn, so notifiers >> can return an error status in a future patch. For now, pass NULL for the >> notifier error parameter, and do not chec

Re: [PATCH V2 08/11] migration: refactor migrate_fd_connect failures

2024-01-16 Thread Steven Sistare
On 1/15/2024 2:37 AM, Peter Xu wrote: > On Fri, Jan 12, 2024 at 07:05:07AM -0800, Steve Sistare wrote: >> Move common code for the error path in migrate_fd_connect to a shared >> fail label. No functional change. >> >> Signed-off-by: Steve Sistare > > Reviewed-by: Peter Xu > > One nitpick belo

Re: [RFC PATCH v3 18/30] migration/multifd: Allow receiving pages without packets

2024-01-16 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Nov 27, 2023 at 05:26:00PM -0300, Fabiano Rosas wrote: >> Currently multifd does not need to have knowledge of pages on the >> receiving side because all the information needed is within the >> packets that come in the stream. >> >> We're about to add support to fixed-

Re: [PATCH v10 4/9] hw/fsi: Introduce IBM's FSI master

2024-01-16 Thread Ninad Palsule
Hello Cedric, [ clg: - move FSICFAMState object under FSIMasterState     - introduced fsi_master_init()     - reworked fsi_master_realize()     - dropped FSIBus definition ] Move the list down before my S-o-b. Done. Signed-off-by: Andrew Jeffery Reviewed-by: Joel Stanley

Re: [PATCH v10 7/9] hw/fsi: Added qtest

2024-01-16 Thread Ninad Palsule
Hi Cedric, On 1/12/24 10:02, Cédric Le Goater wrote: On 1/11/24 00:15, Ninad Palsule wrote: Added basic qtests for FSI model. Acked-by: Thomas Huth Signed-off-by: Cédric Le Goater Please remove mu S-o-b. Removed. Thanks for the review. Regards, Ninad

Re: [PATCH v10 8/9] hw/fsi: Added FSI documentation

2024-01-16 Thread Ninad Palsule
Hello Cedric, On 1/12/24 10:02, Cédric Le Goater wrote: On 1/11/24 00:15, Ninad Palsule wrote: Documentation for IBM FSI model. Signed-off-by: Cédric Le Goater Please remove mu S-o-b. Removed. Thanks for the review. Regards, Ninad

Re: [PATCH v10 9/9] hw/fsi: Update MAINTAINER list

2024-01-16 Thread Ninad Palsule
Hello Cedric, On 1/12/24 10:03, Cédric Le Goater wrote: On 1/11/24 00:15, Ninad Palsule wrote: Added maintainer for IBM FSI model Signed-off-by: Cédric Le Goater Please remove my S-o-b. Removed.   F: tests/qtest/isl_pmbus_vr-test.c   +FSI +M: Ninad Palsule and add me as Reviewer.

[PATCH 0/3] monitor: only run coroutine commands in qemu_aio_context

2024-01-16 Thread Stefan Hajnoczi
Several bugs have been reported related to how QMP commands are rescheduled in qemu_aio_context: - https://gitlab.com/qemu-project/qemu/-/issues/1933 - https://issues.redhat.com/browse/RHEL-17369 - https://bugzilla.redhat.com/show_bug.cgi?id=2215192 - https://bugzilla.redhat.com/show_bug.cgi?id=221

[PATCH 2/3] iotests: port 141 to Python for reliable QMP testing

2024-01-16 Thread Stefan Hajnoczi
The common.qemu bash functions allow tests to interact with the QMP monitor of a QEMU process. I spent two days trying to update 141 when the order of the test output changed, but found it would still fail occassionally because printf() and QMP events race with synchronous QMP communication. I gav

[PATCH 3/3] monitor: only run coroutine commands in qemu_aio_context

2024-01-16 Thread Stefan Hajnoczi
monitor_qmp_dispatcher_co() runs in the iohandler AioContext that is not polled during nested event loops. The coroutine currently reschedules itself in the main loop's qemu_aio_context AioContext, which is polled during nested event loops. One known problem is that QMP device-add calls drain_call_

[PATCH 1/3] iotests: add filter_qmp_generated_node_ids()

2024-01-16 Thread Stefan Hajnoczi
Add a filter function for QMP responses that contain QEMU's automatically generated node ids. The ids change between runs and must be masked in the reference output. The next commit will use this new function. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 7 +++ 1 file

Re: [PATCH] string-output-visitor: Fix (pseudo) struct handling

2024-01-16 Thread Stefan Hajnoczi
On Tue, Jan 09, 2024 at 07:17:17PM +0100, Kevin Wolf wrote: > Commit ff32bb53 tried to get minimal struct support into the string > output visitor by just making it return "". Unfortunately, it > forgot that the caller will still make more visitor calls for the > content of the struct. > > If the

Re: [RFC PATCH v3 15/30] io: Add a pwritev/preadv version that takes a discontiguous iovec

2024-01-16 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Nov 27, 2023 at 05:25:57PM -0300, Fabiano Rosas wrote: >> For the upcoming support to fixed-ram migration with multifd, we need >> to be able to accept an iovec array with non-contiguous data. >> >> Add a pwritev and preadv version that splits the array into contiguous

Re: [PATCH] tests/unit/test-qga: do not qualify executable paths

2024-01-16 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Wed, Jan 3, 2024 at 7:34 PM Philippe Mathieu-Daudé wrote: > On 3/1/24 17:51, Samuel Tardieu wrote: > > guest-exec invocation does not need the full path of the executable to > > execute. Using only the command names ensures correct execution of the > > test on

Re: Qemu setting "-cpu host" seems broken with Windows vms

2024-01-16 Thread Paolo Bonzini
On Fri, Dec 29, 2023 at 2:10 PM Stefan Hajnoczi wrote: > > First, performance: since some years ago, since prior to qemu 6.2 until > > latest 8.2, win10 and win11 vms always worked slower than expected. This > > could be noticed by comparing booting/starting times between vm and a > > bare metal i

Re: [PATCH v2 09/12] target/riscv/cpu.h: use 'vlenb' in vext_get_vlmax()

2024-01-16 Thread Daniel Henrique Barboza
On 1/15/24 20:14, Richard Henderson wrote: On 1/16/24 09:25, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza ---   target/riscv/cpu.h | 6 +-   1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 11df226a00..7304

Re: Possible race condition in aspeed ast2600 smp boot on TCG QEMU

2024-01-16 Thread Stephen Longfield
On Mon, Jan 15, 2024 at 12:36 AM Troy Lee wrote: > > Hi Stephen and Cedric, > > This issue haven't been found in real platform but sometime happens in > emulator, e.g. Simic. Do you have a workaround that you use in other simulators that we could also try using in QEMU? > > Adding Aspeed Enginee

Re: [PATCH] Fixed '-serial none' usage breaks following '-serial ...' usage

2024-01-16 Thread Daniel P . Berrangé
On Mon, Jan 15, 2024 at 04:14:30PM +, Peter Maydell wrote: > (I've cc'd a few people who might have opinions on possible > command-line compatibility breakage.) > > On Wed, 10 Jan 2024 at 14:38, Bohdan Kostiv wrote: > > > > Hello, > > > > I have faced an issue in using serial ports when I nee

Re: [PATCH] target/arm: Fix VNCR fault detection logic

2024-01-16 Thread Jonathan Cameron via
On Tue, 16 Jan 2024 16:56:05 + Peter Maydell wrote: > In arm_deliver_fault() we check for whether the fault is caused > by a data abort due to an access to a FEAT_NV2 sysreg in the > memory pointed to by the VNCR. Unfortunately part of the > condition checks the wrong argument to the function

Re: [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection

2024-01-16 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Wed, Jan 10, 2024 at 9:42 AM Peng Ji wrote: > ping ! > please review this patch : > https://patchew.org/QEMU/20231227071540.4035803-1-peng...@smartx.com/ > > thanks > > > > On Fri, Jan 5, 2024 at 9:47 PM Philippe Mathieu-Daudé > wrote: > >> On 27/12/23 08:15

[PATCH] target/arm: Fix VNCR fault detection logic

2024-01-16 Thread Peter Maydell
In arm_deliver_fault() we check for whether the fault is caused by a data abort due to an access to a FEAT_NV2 sysreg in the memory pointed to by the VNCR. Unfortunately part of the condition checks the wrong argument to the function, meaning that it would spuriously trigger, resulting in some inst

Re: [PATCH v3 00/14] hw/arm: Prefer arm_feature() over object_property_find()

2024-01-16 Thread Peter Maydell
On Tue, 16 Jan 2024 at 16:20, Philippe Mathieu-Daudé wrote: > > On 13/1/24 14:36, Peter Maydell wrote: > > On Wed, 10 Jan 2024 at 19:53, Philippe Mathieu-Daudé > > wrote: > >> > >> Since v2 [2]: > >> - Dropped "Simplify checking A64_MTE bit in FEATURE_ID register" > >> - Correct object_property_

[PATCH] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM

2024-01-16 Thread Ani Sinha
By default, the timeout to receive any specified event from the QEMU VM is 60 seconds set by the python avocado test framework. Please see event_wait() and events_wait() in python/qemu/machine/machine.py. If the matching event is not triggered within that interval, an asyncio.TimeoutError is genera

Re: [PATCH v7 10/16] i386/cpu: Introduce cluster-id to X86CPU

2024-01-16 Thread Xiaoyao Li
On 1/15/2024 11:18 PM, Zhao Liu wrote: Hi Xiaoyao, On Mon, Jan 15, 2024 at 03:45:58PM +0800, Xiaoyao Li wrote: Date: Mon, 15 Jan 2024 15:45:58 +0800 From: Xiaoyao Li Subject: Re: [PATCH v7 10/16] i386/cpu: Introduce cluster-id to X86CPU On 1/15/2024 1:59 PM, Zhao Liu wrote: (Also cc "machine

Re: [PATCH] hw/elf_ops: Ignore loadable segments with zero size

2024-01-16 Thread Richard Henderson
On 1/17/24 02:50, Bin Meng wrote: Some ELF files really do have segments of zero size, e.g.: Program Headers: Type Offset VirtAddr PhysAddr FileSizMemSiz Flags Align RISCV_ATTRIBUT 0x25b8 0x

Re: [PULL 00/10] Hppa fixes 8.2 patches

2024-01-16 Thread Peter Maydell
On Sat, 13 Jan 2024 at 05:59, wrote: > > From: Helge Deller > > The following changes since commit 7425b6277f12e82952cede1f531bfc689bf77fb1: > > Merge tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu into > staging (2023-12-27 05:15:32 -0500) > > are available in the Git reposito

Re: [PULL 00/20] Migration 20240116 patches

2024-01-16 Thread Peter Maydell
0) > > are available in the Git repository at: > > https://gitlab.com/peterx/qemu.git tags/migration-20240116-pull-request > > for you to fetch changes up to 44ce1b5d2fc77343f6a318cb3de613336a240048: > > migration/rdma: define htonll/ntoh

Re: [PATCH 14/33] hw/cpu/arm: Handle 'has_el2/3' properties once in MPCore parent

2024-01-16 Thread Philippe Mathieu-Daudé
On 12/1/24 22:33, Fabiano Rosas wrote: Philippe Mathieu-Daudé writes: Move the 'has_el2' and 'has_el3' properties to the abstract QOM parent. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/cpu/cortex_mpcore.h | 5 + hw/arm/exynos4210.c| 10 -- hw/arm/vexpre

Re: [PATCH v3 00/14] hw/arm: Prefer arm_feature() over object_property_find()

2024-01-16 Thread Philippe Mathieu-Daudé
On 13/1/24 14:36, Peter Maydell wrote: On Wed, 10 Jan 2024 at 19:53, Philippe Mathieu-Daudé wrote: Since v2 [2]: - Dropped "Simplify checking A64_MTE bit in FEATURE_ID register" - Correct object_property_get_bool() uses - Update ARM_FEATURE_AARCH64 && aa64_mte Since RFC [1]: - Split one patch

Re: [PATCH 0/4] esp-pci: fixes for Linux and MS-DOS

2024-01-16 Thread Philippe Mathieu-Daudé
On 12/1/24 14:15, Mark Cave-Ayland wrote: This series contains fixes for the esp-pci device (am53c974 or dc390) for a few issues spotted whilst testing the previous ESP series. Patches 1-3 are fixes for issues found by Helge/Guenter whilst testing the hppa C3700 machine with the amd53c974/dc390

Re: [PATCH v2 2/2] hw/pflash: implement update buffer for block writes

2024-01-16 Thread Peter Maydell
On Tue, 16 Jan 2024 at 16:08, Philippe Mathieu-Daudé wrote: > > On 12/1/24 17:54, Peter Maydell wrote: > > On Mon, 8 Jan 2024 at 13:06, Philippe Mathieu-Daudé > > wrote: > >> > >> Hi Gerd, > >> > >> On 8/1/24 13:53, Philippe Mathieu-Daudé wrote: > >>> From: Gerd Hoffmann > >>> > >>> Add an upda

Re: [PATCH v2 2/2] hw/pflash: implement update buffer for block writes

2024-01-16 Thread Philippe Mathieu-Daudé
On 12/1/24 17:54, Peter Maydell wrote: On Mon, 8 Jan 2024 at 13:06, Philippe Mathieu-Daudé wrote: Hi Gerd, On 8/1/24 13:53, Philippe Mathieu-Daudé wrote: From: Gerd Hoffmann Add an update buffer where all block updates are staged. Flush or discard updates properly, so we should never see h

Re: [PATCH RFC V2 04/37] arm/virt,target/arm: Machine init time change common to vCPU {cold|hot}-plug

2024-01-16 Thread Jonathan Cameron via
On Mon, 2 Oct 2023 17:12:43 +0100 Salil Mehta wrote: > Hi Gavin, > > > From: Gavin Shan > > Sent: Wednesday, September 27, 2023 7:29 AM > > To: Salil Mehta ; qemu-devel@nongnu.org; qemu- > > a...@nongnu.org > > Cc: m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron > > ; lpieral...@ker

Re: [PATCH] hw/arm/musicpal: Convert to qemu_add_kbd_event_handler()

2024-01-16 Thread Philippe Mathieu-Daudé
Cc'ing Gerd & Marc-André for UI. On 3/11/23 19:27, Peter Maydell wrote: Convert the musicpal key input device to use qemu_add_kbd_event_handler(). This lets us simplify it because we no longer need to track whether we're in the middle of a PS/2 multibyte key sequence. In the conversion we move

Re: [PATCH v2 04/19] qapi/schema: declare type for QAPISchemaObjectTypeMember.type

2024-01-16 Thread John Snow
On Mon, Jan 15, 2024 at 8:53 AM Markus Armbruster wrote: > > John Snow writes: > > > declare, but don't initialize the type of "type" to be QAPISchemaType - > > Declare > > > and allow the value to be initialized during check(). This creates a > > form of delayed initialization for QAPISchemaType

[PATCH] hw/elf_ops: Ignore loadable segments with zero size

2024-01-16 Thread Bin Meng
Some ELF files really do have segments of zero size, e.g.: Program Headers: Type Offset VirtAddr PhysAddr FileSizMemSiz Flags Align RISCV_ATTRIBUT 0x25b8 0x 0x

Re: [PATCH v2 03/19] qapi: create QAPISchemaDefinition

2024-01-16 Thread John Snow
On Tue, Jan 16, 2024 at 2:22 AM Markus Armbruster wrote: > > John Snow writes: > > > On Mon, Jan 15, 2024 at 8:16 AM Markus Armbruster wrote: > >> > >> John Snow writes: > >> > >> > Include entities don't have names, but we generally expect "entities" to > >> > have names. Reclassify all entiti

  1   2   3   >