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

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

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

2023-05-01 Thread Thomas Huth
On 28/04/2023 19.45, Fabiano Rosas wrote: Markus Armbruster writes: Fabiano Rosas writes: Save a bit of build time by passing the number of jobs option to sphinx. We cannot use the -j option from make because meson does not support setting build time parameters for custom targets. Use npro

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

2023-05-01 Thread Harsh Prateek Bora
Hi Nick, On 5/2/23 10:36, Nicholas Piggin wrote: On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: Currently, in spapr_exit_nested(), it does a lot of register state restoring from ptregs/hvstate after mapping each of those before restoring the L1 host state. This patch breaks dow

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

2023-05-01 Thread Harsh Prateek Bora
On 5/2/23 10:19, Nicholas Piggin wrote: On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: h_enter_nested() currently does a lot of register specific operations which should be abstracted logically to simplify the code for better readability. This patch breaks down relevant block

Re: [PATCH] tests/9p: fix potential leak in v9fs_rreaddir()

2023-05-01 Thread Greg Kurz
On Sat, 29 Apr 2023 15:20:12 +0200 Christian Schoenebeck wrote: > On Saturday, April 29, 2023 2:04:30 PM CEST Greg Kurz wrote: > > Hi Christian ! > > Hi there, it's been a while! :) > > > On Sat, 29 Apr 2023 11:25:33 +0200 > > Christian Schoenebeck wrote: > > > > > Free allocated directory en

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

2023-05-01 Thread Nicholas Piggin
On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: > Currently, in spapr_exit_nested(), it does a lot of register state > restoring from ptregs/hvstate after mapping each of those before > restoring the L1 host state. This patch breaks down those set of ops > to respective helper routi

Re: [PATCH v2 1/4] ppc: spapr: cleanup cr get/store in [h_enter|spapr_exit]_nested with helpers.

2023-05-01 Thread Harsh Prateek Bora
On 5/2/23 10:07, Nicholas Piggin wrote: On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: The bits in cr reg are grouped into eight 4-bit fields represented by env->crf[8] and the related calculations should be abstracted to keep the calling routines simpler to read. This is a s

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

2023-05-01 Thread Nicholas Piggin
On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: > h_enter_nested() currently does a lot of register specific operations > which should be abstracted logically to simplify the code for better > readability. This patch breaks down relevant blocks into respective > helper routines to m

Re: [PATCH v2 1/4] ppc: spapr: cleanup cr get/store in [h_enter|spapr_exit]_nested with helpers.

2023-05-01 Thread Nicholas Piggin
On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote: > The bits in cr reg are grouped into eight 4-bit fields represented > by env->crf[8] and the related calculations should be abstracted to > keep the calling routines simpler to read. This is a step towards > cleaning up the [h_enter|s

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

2023-05-01 Thread Richard Henderson
Use the attribute, which is supported by clang, instead of the #pragma, which is not supported and, for some reason, also not detected by the meson probe, so we fail by -Werror. Signed-off-by: Richard Henderson --- migration/xbzrle.c | 9 - meson.build| 5 + 2 files changed,

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

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

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

2023-05-01 Thread Taylor Simpson
Changes in v3 Fix bugs exposed by dpmpyss_rnd_s0 instruction Set correct size/signedness for constants Test cases added to tests/tcg/hexagon/misc.c Changes in v2 Fix bug in imm_print identified in clang build Currently, idef-parser skips all floating point instructions

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

2023-05-01 Thread Stefan Hajnoczi
On Fri, Apr 21, 2023 at 01:30:48PM +0800, Yajun Wu wrote: > > On 4/20/2023 9:07 PM, Stefan Hajnoczi wrote: > > > > Setting the VIRTIO Device Status Field to 0 resets the device. The > > device's state is lost, including the vring configuration. > > > > vhost-user.c currently sends SET_STATUS 0 b

Re: [PATCH 00/10] tracing: remove dynamic vcpu state

2023-05-01 Thread Stefan Hajnoczi
On Thu, Apr 20, 2023 at 03:59:59PM +0100, Alex Bennée wrote: > The references dynamic vcpu tracing support was removed when the > original TCG trace points where removed. However there was still a > legacy of dynamic trace state to track this in cpu.h and extra hash > variables to track TBs. While

Re: [PATCH v3 09/19] tcg: Add andcs and rotrs tcg gvec ops

2023-05-01 Thread Richard Henderson
On 4/28/23 15:47, Lawrence Hunter wrote: From: Nazar Kazakov This commit adds helper functions and tcg operation definitions for the andcs and rotrs instructions Signed-off-by: Nazar Kazakov --- accel/tcg/tcg-runtime-gvec.c | 11 +++ accel/tcg/tcg-runtime.h | 1 + include/t

Re: [PATCH v3 08/19] qemu/bitops.h: Limit rotate amounts

2023-05-01 Thread Richard Henderson
On 4/28/23 15:47, Lawrence Hunter wrote: From: Dickon Hood Rotates have been fixed up to only allow for reasonable rotate amounts (ie, no rotates >7 on an 8b value etc.) This fixes a problem with riscv vector rotate instructions. Signed-off-by: Dickon Hood Reviewed-by: Richard Henderson ---

Re: [PATCH v3 10/19] qemu/host-utils.h: Add clz and ctz functions for lower-bit integers

2023-05-01 Thread Richard Henderson
On 4/28/23 15:47, Lawrence Hunter wrote: From: Kiran Ostrolenk This is for use in the RISC-V vclz and vctz instructions (implemented in proceeding commit). Signed-off-by: Kiran Ostrolenk Reviewed-by: Richard Henderson --- include/qemu/host-utils.h | 54 +++

Re: [RFC PATCH v3 00/20] configure: create a python venv and ensure meson, sphinx

2023-05-01 Thread John Snow
On Mon, Apr 24, 2023, 4:02 PM John Snow wrote: > GitLab CI: https://gitlab.com/jsnow/qemu/-/pipelines/846869409 >(All green, except Python self-tests, see below) > > This patch series creates a mandatory python virtual environment > ("venv") during configure time and uses it to ensure

Re: [PATCH 20/20] block: Mark bdrv_refresh_limits() and callers GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:58PM +0200, Kevin Wolf wrote: > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_refresh_limits() need to hold a reader lock for the graph because > it accesses the children list of a node. > > Signed-off-by: Kevin Wolf > --- > include/block/bloc

Re: [PATCH 19/20] block: Mark bdrv_recurse_can_replace() and callers GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:57PM +0200, Kevin Wolf wrote: > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_recurse_can_replace() need to hold a reader lock for the graph > because it accesses the children list of a node. > > Signed-off-by: Kevin Wolf > --- > include/block

Re: [PATCH 18/20] block: Mark bdrv_query_block_graph_info() and callers GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:56PM +0200, Kevin Wolf wrote: > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_query_block_graph_info() need to hold a reader lock for the graph > because it accesses the children list of a node. > > Signed-off-by: Kevin Wolf > --- > include/bl

Re: [PATCH 17/20] block: Mark bdrv_query_bds_stats() and callers GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:55PM +0200, Kevin Wolf wrote: > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_query_bds_stats() need to hold a reader lock for the graph because > it accesses the children list of a node. > > Signed-off-by: Kevin Wolf > --- > block/qapi.c | 6

Re: [PATCH 16/20] block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:54PM +0200, Kevin Wolf wrote: > From: Emanuele Giuseppe Esposito > > This adds GRAPH_RDLOCK annotations to declare that callers of amend > callbacks in BlockDriver need to hold a reader lock for the graph. > > Signed-off-by: Emanuele Giuseppe Esposito > Signed-off-

Re: [PATCH 15/20] block: Mark bdrv_co_debug_event() GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:53PM +0200, Kevin Wolf wrote: > From: Emanuele Giuseppe Esposito > > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_co_debug_event() need to hold a reader lock for the graph. > > Unfortunately we cannot use a co_wrapper_bdrv_rdlock, because the

Re: [PATCH 14/20] block: Mark bdrv_co_get_info() and callers GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:52PM +0200, Kevin Wolf wrote: > From: Emanuele Giuseppe Esposito > > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_co_get_info() need to hold a reader lock for the graph. > > Signed-off-by: Emanuele Giuseppe Esposito > Signed-off-by: Kevin Wo

Re: [PATCH 13/20] block: Mark bdrv_co_get_allocated_file_size() and callers GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:51PM +0200, Kevin Wolf wrote: > @@ -5778,6 +5779,7 @@ int64_t coroutine_fn > bdrv_co_get_allocated_file_size(BlockDriverState *bs) > { > BlockDriver *drv = bs->drv; > IO_CODE(); > +assert_bdrv_graph_readable(); Is there a need for runtime assertions in

Re: [PATCH 12/20] mirror: Take graph lock for accessing a node's parent list

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:50PM +0200, Kevin Wolf wrote: > This adds GRAPH_RDLOCK annotations to declare that functions accessing > the parent list of a node need to hold a reader lock for the graph. As > it happens, they already do. > > Signed-off-by: Kevin Wolf > --- > block/mirror.c | 2 +-

Re: [PATCH 11/20] vhdx: Take graph lock for accessing a node's parent list

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:49PM +0200, Kevin Wolf wrote: > This adds GRAPH_RDLOCK annotations to declare that functions accessing > the parent list of a node need to hold a reader lock for the graph. As > it happens, they already do. > > Signed-off-by: Kevin Wolf > --- > block/vhdx.c | 9

Re: [PATCH 10/20] nbd: Mark nbd_co_do_establish_connection() and callers GRAPH_RDLOCK

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:48PM +0200, Kevin Wolf wrote: > From: Emanuele Giuseppe Esposito > > This adds GRAPH_RDLOCK annotations to declare that callers of > nbd_co_do_establish_connection() need to hold a reader lock for the > graph. > > Signed-off-by: Emanuele Giuseppe Esposito > Signed-

Re: [RFC PATCH v4 00/44] Add LoongArch LSX instructions

2023-05-01 Thread Richard Henderson
On 4/25/23 08:02, Song Gao wrote: Hi, This series adds LoongArch LSX instructions, Since the LoongArch Vol2 is not open, So we use 'RFC' title. I'm not sure when the manual will be open. After these patches are reviewed, how about merging them? About test: V2 we use RISU test the LoongArch LSX

Re: [RFC PATCH v4 41/44] target/loongarch: Implement vld vst

2023-05-01 Thread Richard Henderson
On 4/25/23 08:02, Song Gao wrote: +tcg_gen_qemu_ld_i128(val, addr, ctx->mem_idx, MO_128); You need MO_128 | MO_TE, here and elsewhere. This will make things correct for big-endian hosts. Otherwise, Reviewed-by: Richard Henderson r~

Re: [RFC PATCH v4 37/44] target/loongarch: Implement vbitsel vset

2023-05-01 Thread Richard Henderson
On 4/25/23 08:02, Song Gao wrote: This patch includes: - VBITSEL.V; - VBITSELI.B; - VSET{EQZ/NEZ}.V; - VSETANYEQZ.{B/H/W/D}; - VSETALLNEZ.{B/H/W/D}. Signed-off-by: Song Gao --- target/loongarch/disas.c| 20 ++ target/loongarch/helper.h | 11 +++ targ

Re: [RFC PATCH v4 34/44] target/loongarch: Implement LSX fpu fcvt instructions

2023-05-01 Thread Richard Henderson
On 4/25/23 08:02, Song Gao wrote: This patch includes: - VFCVT{L/H}.{S.H/D.S}; - VFCVT.{H.S/S.D}; - VFRINT[{RNE/RZ/RP/RM}].{S/D}; - VFTINT[{RNE/RZ/RP/RM}].{W.S/L.D}; - VFTINT[RZ].{WU.S/LU.D}; - VFTINT[{RNE/RZ/RP/RM}].W.D; - VFTINT[{RNE/RZ/RP/RM}]{L/H}.L.S; - VFFINT.{S.W/D.L}[U]; - VFFINT.S.L, VFF

Re: [RFC PATCH v4 30/44] target/loongarch: Implement vpcnt

2023-05-01 Thread Richard Henderson
On 4/25/23 08:02, Song Gao wrote: This patch includes: - VPCNT.{B/H/W/D}. Signed-off-by: Song Gao --- target/loongarch/disas.c| 5 + target/loongarch/helper.h | 5 + target/loongarch/insn_trans/trans_lsx.c.inc | 5 + target/loongarch/insn

Re: [RFC PATCH v4 14/44] target/loongarch: Implement vmul/vmuh/vmulw{ev/od}

2023-05-01 Thread Richard Henderson
On 4/25/23 08:02, Song Gao wrote: This patch includes: - VMUL.{B/H/W/D}; - VMUH.{B/H/W/D}[U]; - VMULW{EV/OD}.{H.B/W.H/D.W/Q.D}[U]; - VMULW{EV/OD}.{H.BU.B/W.HU.H/D.WU.W/Q.DU.D}. Signed-off-by: Song Gao --- target/loongarch/disas.c| 38 ++ target/loongarch/helper.h

Re: [RFC PATCH v4 01/44] target/loongarch: Add LSX data type VReg

2023-05-01 Thread Richard Henderson
On 4/25/23 08:02, Song Gao wrote: Signed-off-by: Song Gao --- linux-user/loongarch64/signal.c | 4 +- target/loongarch/cpu.c | 2 +- target/loongarch/cpu.h | 21 - target/loongarch/gdbstub.c | 4 +- target/loongarch/internals.h| 22 + target/lo

Re: [PATCH v6 2/3] qga: Add `merged` variant to GuestExecCaptureOutputMode

2023-05-01 Thread Daniel Xu
Hi Konstantin, On Mon, Apr 3, 2023, at 8:56 AM, Konstantin Kostiuk wrote: > Hi Daniel, > > I will merge this series after the 8.0 release. > > Best Regards, > Konstantin Kostiuk. > Sorry to bug again, but 8.0 is out now right? Does this need a rebase or is it good to go? Thanks, Daniel [...]

[PATCH] block: compile out assert_bdrv_graph_readable() by default

2023-05-01 Thread Stefan Hajnoczi
reader_count() is a performance bottleneck because the global aio_context_list_lock mutex causes thread contention. Put this debugging assertion behind a new ./configure --enable-debug-graph-lock option and disable it by default. The --enable-debug-graph-lock option is also enabled by the more gen

Re: [PATCH v2 3/5] hw/display/virtio-gpu-virgl: define callbacks in realize function

2023-05-01 Thread Gurchetan Singh
On Sun, Apr 30, 2023 at 2:48 PM Bernhard Beschow wrote: > > > Am 28. April 2023 16:48:21 UTC schrieb Gurchetan Singh < > gurchetansi...@chromium.org>: > >From: Gurchetan Singh > > > >This reduces the amount of renderer backend specific needed to > >be exposed to the GL device. We only need one

Re: [PATCH v4 2/3] target/riscv: Reuse tb->flags.FS

2023-05-01 Thread Richard Henderson
On 5/1/23 15:00, Mayuresh Chitale wrote: When misa.F is 0 tb->flags.FS field is unused and can be used to save the current state of smstateen0.FCSR check which is needed by the floating point translation routines. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li --- target/riscv/cpu_help

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

2023-05-01 Thread Taylor Simpson
> -Original Message- > From: Taylor Simpson > Sent: Friday, April 28, 2023 3:53 PM > To: a...@rev.ng; qemu-devel@nongnu.org > Cc: richard.hender...@linaro.org; phi...@linaro.org; a...@rev.ng; Brian Cain > ; Matheus Bernardino (QUIC) > > Subject: RE: [PATCH v2] Hexagon (target/hexagon) Ad

Re: [PATCH 09/20] nbd: Remove nbd_co_flush() wrapper function

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:47PM +0200, Kevin Wolf wrote: > The only thing nbd_co_flush() does is calling nbd_client_co_flush(). > Just use that function directly in the BlockDriver definitions and > remove the wrapper. > > Signed-off-by: Kevin Wolf > --- > block/nbd.c | 11 +++ > 1 fi

Re: [PATCH 08/20] block: .bdrv_open is non-coroutine and unlocked

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:46PM +0200, Kevin Wolf wrote: > Drivers were a bit confused about whether .bdrv_open can run in a > coroutine and whether or not it holds a graph lock. > > It cannot keep a graph lock from the caller across the whole function > because it both changes the graph (requi

Re: [PATCH v2 1/2] linux-user: Add new flag VERIFY_NONE

2023-05-01 Thread Laurent Vivier
Le 22/04/2023 à 12:03, Thomas Weißschuh a écrit : This can be used to validate that an address range is mapped but without being readable or writable. It will be used by an updated implementation of mincore(). Signed-off-by: Thomas Weißschuh --- linux-user/qemu.h | 1 + 1 file changed, 1 in

Re: [PATCH v2 2/2] linux-user: Don't require PROT_READ for mincore

2023-05-01 Thread Laurent Vivier
Le 22/04/2023 à 12:03, Thomas Weißschuh a écrit : The kernel does not require PROT_READ for addresses passed to mincore. For example the fincore(1) tool from util-linux uses PROT_NONE and currently does not work under qemu-user. Example (with fincore(1) from util-linux 2.38): $ fincore /proc/se

Re: [PATCH v2 2/2] linux-user: Don't require PROT_READ for mincore

2023-05-01 Thread Laurent Vivier
Le 22/04/2023 à 12:03, Thomas Weißschuh a écrit : The kernel does not require PROT_READ for addresses passed to mincore. For example the fincore(1) tool from util-linux uses PROT_NONE and currently does not work under qemu-user. Example (with fincore(1) from util-linux 2.38): $ fincore /proc/se

Re: [PATCH v2 1/2] linux-user: Add new flag VERIFY_NONE

2023-05-01 Thread Laurent Vivier
Le 22/04/2023 à 12:03, Thomas Weißschuh a écrit : This can be used to validate that an address range is mapped but without being readable or writable. It will be used by an updated implementation of mincore(). Signed-off-by: Thomas Weißschuh --- linux-user/qemu.h | 1 + 1 file changed, 1 in

Re: [PATCH] linux-user/main: Use list_cpus() instead of cpu_list()

2023-05-01 Thread Laurent Vivier
Le 24/04/2023 à 14:21, Thomas Huth a écrit : This way we can get rid of the if'deffery and the XXX comment here (it's repeated in the list_cpus() function anyway). Signed-off-by: Thomas Huth --- linux-user/main.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/linux-u

Re: [PATCH 07/20] graph-lock: Fix GRAPH_RDLOCK_GUARD*() to be reader lock

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:45PM +0200, Kevin Wolf wrote: > GRAPH_RDLOCK_GUARD() and GRAPH_RDLOCK_GUARD_MAINLOOP() only take a > reader lock for the graph, so the correct annotation for them to use is > TSA_ASSERT_SHARED rather than TSA_ASSERT. > > Signed-off-by: Kevin Wolf > --- > include/blo

Re: [PATCH 2/2] linux-user: Add open_tree() syscall

2023-05-01 Thread Laurent Vivier
Le 24/04/2023 à 17:34, Thomas Weißschuh a écrit : Signed-off-by: Thomas Weißschuh --- linux-user/syscall.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 95e370130cee..140bd2c36e0f 100644 --- a/linux-user/sysca

Re: [PATCH 06/20] graph-lock: Add GRAPH_UNLOCKED(_PTR)

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:44PM +0200, Kevin Wolf wrote: > For some function, parts of their interface is that are called without > holding the graph lock. Add a new macro to document this. > > The macro expands to TSA_EXCLUDES(), which is a relatively weak check > because it passes in cases wh

Re: [PATCH 05/20] test-bdrv-drain: Don't modify the graph in coroutines

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:43PM +0200, Kevin Wolf wrote: > test-bdrv-drain contains a few test cases that are run both in coroutine > and non-coroutine context. Running the entire code including the setup > and shutdown in coroutines is incorrect because graph modifications can > generally not h

Re: [PATCH 04/20] block: Don't call no_coroutine_fns in qmp_block_resize()

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:42PM +0200, Kevin Wolf wrote: > This QMP handler runs in a coroutine, so it must use the corresponding > no_co_wrappers instead. > > Signed-off-by: Kevin Wolf > --- > blockdev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnocz

Re: [PATCH 03/20] block: bdrv/blk_co_unref() for calls in coroutine context

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:41PM +0200, Kevin Wolf wrote: > These functions must not be called in coroutine context, because they > need write access to the graph. > > Signed-off-by: Kevin Wolf > --- > include/block/block-global-state.h | 3 ++- > include/sysemu/block-backend-global-

Re: [PATCH 1/2] linux-user: Add move_mount() syscall

2023-05-01 Thread Laurent Vivier
Le 24/04/2023 à 17:34, Thomas Weißschuh a écrit : Signed-off-by: Thomas Weißschuh --- linux-user/syscall.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 69f740ff98c8..95e370130cee 100644 --- a/linux-user/sysc

Re: [PATCH 02/20] block: Consistently call bdrv_activate() outside coroutine

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:40PM +0200, Kevin Wolf wrote: > Migration code can call bdrv_activate() in coroutine context, whereas > other callers call it outside of coroutines. As it calls other code that > is not supposed to run in coroutines, standardise on running outside of > coroutines. > >

Re: [PATCH 01/20] qcow2: Don't call bdrv_getlength() in coroutine_fns

2023-05-01 Thread Stefan Hajnoczi
On Tue, Apr 25, 2023 at 07:31:39PM +0200, Kevin Wolf wrote: > There is a bdrv_co_getlength() now, which should be used in coroutine > context. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.h | 4 +++- > block/qcow2-refcount.c | 2 +- > block/qcow2.c | 19 +

Re: [PATCH 2/2] linux-user: Add open_tree() syscall

2023-05-01 Thread Laurent Vivier
Le 24/04/2023 à 17:34, Thomas Weißschuh a écrit : Signed-off-by: Thomas Weißschuh --- linux-user/syscall.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 95e370130cee..140bd2c36e0f 100644 --- a/linux-user/sysca

Re: [PATCH] test-aio-multithread: simplify test_multi_co_schedule

2023-05-01 Thread Stefan Hajnoczi
On Fri, Apr 28, 2023 at 01:19:41PM +0200, Paolo Bonzini wrote: > Instead of using qatomic_mb_{read,set} mindlessly, just use a per-coroutine > flag that requires no synchronization. > > Signed-off-by: Paolo Bonzini > --- > tests/unit/test-aio-multithread.c | 18 -- > 1 file chang

Re: [PATCH 1/2] linux-user: Add move_mount() syscall

2023-05-01 Thread Laurent Vivier
Le 24/04/2023 à 17:34, Thomas Weißschuh a écrit : Signed-off-by: Thomas Weißschuh --- linux-user/syscall.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 69f740ff98c8..95e370130cee 100644 --- a/linux-user/sysc

Re: [PATCH v4 04/20] virtio-scsi: stop using aio_disable_external() during unplug

2023-05-01 Thread Stefan Hajnoczi
On Fri, Apr 28, 2023 at 04:22:55PM +0200, Kevin Wolf wrote: > Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > > This patch is part of an effort to remove the aio_disable_external() > > API because it does not fit in a multi-queue block layer world where > > many AioContexts may be submitt

Re: [PATCH] linux-user: report ENOTTY for unknown ioctls

2023-05-01 Thread Laurent Vivier
Le 26/04/2023 à 09:06, Thomas Weißschuh a écrit : The correct error number for unknown ioctls is ENOTTY. ENOSYS would mean that the ioctl() syscall itself is not implemented, which is very improbable and unexpected for userspace. ENOTTY means "Inappropriate ioctl for device". This is what the k

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

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

Re: [PULL 07/13] async: Add an optional reentrancy guard to the BH API

2023-05-01 Thread Alexander Bulekov
On 230428 1143, Thomas Huth wrote: > From: Alexander Bulekov > > Devices can pass their MemoryReentrancyGuard (from their DeviceState), > when creating new BHes. Then, the async API will toggle the guard > before/after calling the BH call-back. This prevents bh->mmio reentrancy > issues. > > S

[PATCH 0/8] migration: Add precopy initial data capability and VFIO precopy support

2023-05-01 Thread Avihai Horon
Hello everyone, This series adds a new migration capability called "precopy initial data". The purpose of this capability is to reduce migration downtime in cases where loading of migration data in the destination can take a lot of time, such as with VFIO migration data. The series then moves to

[PATCH 5/8] tests: Add migration precopy initial data capability test

2023-05-01 Thread Avihai Horon
Add migration precopy initial data capability test. The test runs without migration users that support this capability, but is still useful to make sure it didn't break anything. Signed-off-by: Avihai Horon --- tests/qtest/migration-test.c | 23 +++ 1 file changed, 23 inserti

[PATCH 6/8] vfio/migration: Refactor vfio_save_block() to return saved data size

2023-05-01 Thread Avihai Horon
Refactor vfio_save_block() to return the size of saved data on success and -errno on error. This will be used in next patch to implement VFIO migration pre-copy support. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/migration.c | 17 + 1 file changed, 9

[PATCH 4/8] migration: Enable precopy initial data capability

2023-05-01 Thread Avihai Horon
Now that precopy initial data logic has been implemented, enable the capability. Signed-off-by: Avihai Horon --- migration/options.c | 4 1 file changed, 4 deletions(-) diff --git a/migration/options.c b/migration/options.c index c4ef0c60c7..77a570f866 100644 --- a/migration/options.c +++

[PATCH 8/8] vfio/migration: Add support for precopy initial data capability

2023-05-01 Thread Avihai Horon
Loading of a VFIO device's data can take a substantial amount of time as the device may need to allocate resources, prepare internal data structures, etc. This can increase migration downtime, especially for VFIO devices with a lot of resources. To solve this, VFIO migration uAPI defines "initial

[PATCH 7/8] vfio/migration: Add VFIO migration pre-copy support

2023-05-01 Thread Avihai Horon
Pre-copy support allows the VFIO device data to be transferred while the VM is running. This helps to accommodate VFIO devices that have a large amount of data that needs to be transferred, and it can reduce migration downtime. Pre-copy support is optional in VFIO migration protocol v2. Implement

[PATCH 1/8] migration: Add precopy initial data capability

2023-05-01 Thread Avihai Horon
Migration downtime estimation is calculated based on bandwidth and remaining migration data. This assumes that loading of migration data in the destination takes a negligible amount of time and that downtime depends only on network speed. While this may be true for RAM, it's not necessarily true f

[PATCH 2/8] migration: Add precopy initial data handshake

2023-05-01 Thread Avihai Horon
Add precopy initial data handshake between source and destination upon migration setup. The purpose of the handshake is to notify the destination that precopy initial data is used and which migration users (i.e., SaveStateEntry) are going to use it. The handshake is done in two levels. First, a ge

[PATCH 3/8] migration: Add precopy initial data loaded ACK functionality

2023-05-01 Thread Avihai Horon
Add the core functionality of precopy initial data, which allows the destination to ACK that initial data has been loaded and the source to wait for this ACK before completing the migration. A new return path command MIG_RP_MSG_INITIAL_DATA_LOADED_ACK is added. It is sent by the destination after

[PATCH v4 0/3] Smstateen FCSR

2023-05-01 Thread Mayuresh Chitale
Patch 4 and 5 of the smstateen series need to be re-submitted with changes described in the email below. https://lists.nongnu.org/archive/html/qemu-riscv/2022-11/msg00155.html Hence splitting the patch 4 of the original series into three and re-submitting along with the original patch 5. Changes i

[PATCH v4 3/3] target/riscv: smstateen knobs

2023-05-01 Thread Mayuresh Chitale
Add knobs to allow users to enable smstateen and also export it via the ISA extension string. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.c b/ta

[PATCH v4 1/3] target/riscv: smstateen check for fcsr

2023-05-01 Thread Mayuresh Chitale
If smstateen is implemented and smtateen0.fcsr is clear and misa.F is off then the floating point operations must return illegal instruction exception or virtual instruction trap, if relevant. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li --- target/riscv/csr.c | 15 +++ 1

[PATCH v4 2/3] target/riscv: Reuse tb->flags.FS

2023-05-01 Thread Mayuresh Chitale
When misa.F is 0 tb->flags.FS field is unused and can be used to save the current state of smstateen0.FCSR check which is needed by the floating point translation routines. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li --- target/riscv/cpu_helper.c | 6 ++ target/risc

Re: [PATCH] test-aio-multithread: do not use mb_read/mb_set for simple flags

2023-05-01 Thread Stefan Hajnoczi
On Fri, Apr 28, 2023 at 01:12:48PM +0200, Paolo Bonzini wrote: > The remaining use of mb_read/mb_set is just to force a thread to exit > eventually. It does not order two memory accesses and therefore can be > just read/set. > > Signed-off-by: Paolo Bonzini > --- > tests/unit/test-aio-multithre

Re: [PULL 00/17] Block patches

2023-05-01 Thread Stefan Hajnoczi
On Sat, Apr 29, 2023 at 11:05:06PM +0100, Richard Henderson wrote: > On 4/28/23 13:39, Stefan Hajnoczi wrote: > > The following changes since commit 05d50ba2d4668d43a835c5a502efdec9b92646e6: > > > >Merge tag 'migration-20230427-pull-request' of > > https://gitlab.com/juan.quintela/qemu into s

Re: [PATCH] target/i386: Fix exception classes for SSE/AVX instructions.

2023-05-01 Thread Ricky Zhou
On Fri, Apr 14, 2023 at 8:19 AM Philippe Mathieu-Daudé wrote: > Having this patch split in 2 (documentation first, logical change then) > would ease code review. > > > There is one functional change: > > > > Before this change, MOVNTPS and MOVNTPD were labeled as Exception Class > > 4 (only requi

[PATCH v2 3/3] target/i386: Fix exception classes for MOVNTPS/MOVNTPD.

2023-05-01 Thread Ricky Zhou
Before this change, MOVNTPS and MOVNTPD were labeled as Exception Class 4 (only requiring alignment for legacy SSE instructions). This changes them to Exception Class 1 (always requiring memory alignment), as documented in the Intel manual. --- target/i386/tcg/decode-new.c.inc | 5 +++-- 1 file ch

[PATCH v2 1/3] target/i386: Fix and add some comments next to SSE/AVX instructions.

2023-05-01 Thread Ricky Zhou
Adds some comments describing what instructions correspond to decoding table entries and fixes some existing comments which named the wrong instruction. --- target/i386/tcg/decode-new.c.inc | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/target/i386/t

[PATCH v2 2/3] target/i386: Fix exception classes for SSE/AVX instructions.

2023-05-01 Thread Ricky Zhou
Fix the exception classes for some SSE/AVX instructions to match what is documented in the Intel manual. These changes are expected to have no functional effect on the behavior that qemu implements (primarily >= 16-byte memory alignment checks). For instance, since qemu does not implement the AC f

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

2023-05-01 Thread Richard Henderson
On 4/28/23 18:50, Juan Quintela wrote: Pardon my ignorance here, but to try to help with migration. How is this mte tag stored? - 1 array of 8bits per page of memory - 1 array of 64bits per page of memory - whatever Lets asume that it is 1 byte per page. For the explanation it don't matter, onl

Re: [PATCH] call_rcu: stop using mb_set/mb_read

2023-05-01 Thread Richard Henderson
On 4/30/23 12:25, Paolo Bonzini wrote: Use a store-release when enqueuing a new call_rcu, and a load-acquire when dequeuing; and read the tail after checking that node->next is consistent, which is the standard message passing pattern and it is clearer than mb_read/mb_set. Signed-off-by: Paolo B

Re: [PATCH] tb-maint: do not use mb_read/mb_set

2023-05-01 Thread Richard Henderson
On 4/30/23 12:25, Paolo Bonzini wrote: The load side can use a relaxed load, which will surely happen before the work item is run by async_safe_run_on_cpu() or before double-checking under mmap_lock. The store side can use an atomic RMW operation. Signed-off-by: Paolo Bonzini --- accel/tcg/tb

Re: [PATCH v3 06/57] tcg/i386: Generalize multi-part load overlap test

2023-05-01 Thread Richard Henderson
On 4/29/23 14:01, Philippe Mathieu-Daudé wrote: On 24/4/23 07:40, Richard Henderson wrote: Test for both base and index; use datahi as a temporary, overwritten by the final load.  Always perform the loads in ascending order, so that any (user-only) fault sees the correct address. Signed-off-by:

[PATCH 3/5] ebpf: Added declaration/initialization routines.

2023-05-01 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id/name. It would require for future qmp commands that may require specific eBPF blob. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c | 54 ebpf/ebpf.h | 31 +++ ebpf

[PATCH 4/5] qmp: Added new command to retrieve eBPF blob.

2023-05-01 Thread Andrew Melnychenko
Added command "request-ebpf". This command returns eBPF program encoded base64. The program taken from the skeleton and essentially is an ELF object that can be loaded in the future with libbpf. Signed-off-by: Andrew Melnychenko --- monitor/qmp-cmds.c | 16 qapi/misc.json |

[PATCH 5/5] ebpf: Updated eBPF program and skeleton.

2023-05-01 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1469 --- tools/ebpf/rss.bpf.c|2 +- 2 files changed, 741 insertions(+), 730 d

[PATCH 1/5] ebpf: Added eBPF initialization by fds and map update.

2023-05-01 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 +++ ebpf/ebpf_rss.c | 120 +

[PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds.

2023-05-01 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 96 +++-

[PATCH 0/5] eBPF RSS through QMP support.

2023-05-01 Thread Andrew Melnychenko
This series of patches provides the ability to retrieve eBPF program through qmp, so management application may load bpf blob with proper capabilities. Now, virtio-net devices can accept eBPF programs and maps through properties as external file descriptors. Access to the eBPF map is direct throug

Re: [PATCH v3 54/57] tcg/ppc: Remove unused constraints A, B, C, D

2023-05-01 Thread Richard Henderson
On 4/29/23 13:29, Philippe Mathieu-Daudé wrote: On 24/4/23 07:41, Richard Henderson wrote: These constraints have not been used for quite some time. Fixes: 77b73de67632 ("Use rem/div[u]_i32 drop div[u]2_i32") Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson ---   tcg/ppc/