Re: [PATCH v5] hostmem-file: add offset option

2023-04-03 Thread Markus Armbruster
Alexander Graf writes: > Add an option for hostmem-file to start the memory object at an offset > into the target file. This is useful if multiple memory objects reside > inside the same target file, such as a device node. > > In particular, it's useful to map guest memory directly into /dev/mem

Re: an issue for device hot-unplug

2023-04-03 Thread Jinpu Wang
Hi Yu, On Mon, Apr 3, 2023 at 6:59 PM Yu Zhang wrote: > > Dear Laurent, > > Thank you for your quick reply. We used qemu-7.1, but it is reproducible with > qemu from v6.2 to the recent v8.0 release candidates. > I found that it's introduced by the commit 9323f892b39 (between v6.2.0-rc2 > and v

Re: [PATCH v6 00/25] target/riscv: MSTATUS_SUM + cleanups

2023-04-03 Thread Wu, Fei
On 3/25/2023 6:54 PM, Richard Henderson wrote: > This builds on Fei and Zhiwei's SUM and TB_FLAGS changes. > > * Reclaim 5 TB_FLAGS bits, since we nearly ran out. > > * Using cpu_mmu_index(env, true) is insufficient to implement > HLVX properly. While that chooses the correct mmu_idx, it

Re: [PATCH v8] audio/pwaudio.c: Add Pipewire audio backend for QEMU

2023-04-03 Thread Volker Rümelin
Hi Dorinda, Hi Volker, Filling a buffer with zeros to produce silence still wrong for unsigned samples. For example, a 0 in SPA_AUDIO_FORMAT_U8 format maps to -1.0 in SPA_AUDIO_FORMAT_F32. This is a bug. On a buffer underrun, the buffer filled with silence is dr

Re: [PATCH] vfio/migration: Skip log_sync during migration SETUP state

2023-04-03 Thread Avihai Horon
On 04/04/2023 0:36, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 3 Apr 2023 22:36:42 +0200 Cédric Le Goater wrote: On 4/3/23 15:00, Avihai Horon wrote: Currently, VFIO log_sync can be issued while migration is in SETUP state. However, doing this

Re: [RFC PATCH v2 18/44] target/loongarch: Implement vsat

2023-04-03 Thread Richard Henderson
On 4/3/23 19:11, gaosong wrote: 在 2023/4/4 上午4:13, Richard Henderson 写道: On 4/3/23 05:55, gaosong wrote: Hi, Richard 在 2023/4/1 下午1:03, Richard Henderson 写道: On 3/27/23 20:06, Song Gao wrote: +static void gen_vsat_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) +{ +    TCGv_vec t1; + 

Re: [PATCH v6 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread liweiwei
On 2023/4/4 11:12, LIU Zhiwei wrote: On 2023/4/4 10:06, Weiwei Li wrote: Add a base pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. We can get pc-relative address from following formula:    real_pc = (old)env->pc + diff, whe

Re: [RFC PATCH v2 44/44] target/loongarch: Use {set/get}_gpr replace to cpu_fpr

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: Introduce set_fpr() and get_fpr() and remove cpu_fpr. Signed-off-by: Song Gao --- .../loongarch/insn_trans/trans_farith.c.inc | 72 +++ target/loongarch/insn_trans/trans_fcmp.c.inc | 12 ++-- .../loongarch/insn_trans/trans_fmemory.c.inc |

Re: [RFC PATCH v2 43/44] target/loongarch: Implement vldi

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: +static bool trans_vldi(DisasContext *ctx, arg_vldi *a) +{ +int sel, vece; +uint64_t value; +CHECK_SXE; + +sel = (a->imm >> 12) & 0x1; + +if (sel) { +/* VSETI.D */ +value = vldi_get_value(ctx, a->imm); +vece = MO_64; +

Re: [PATCH v6 3/6] target/riscv: Fix target address to update badaddr

2023-04-03 Thread liweiwei
On 2023/4/4 11:06, LIU Zhiwei wrote: On 2023/4/4 10:06, Weiwei Li wrote: Compute the target address before storing it into badaddr when mis-aligned exception is triggered. Use a target_pc temp to store the target address to avoid the confusing operation that udpate target address into cpu_pc

Re: [RFC PATCH v2 42/44] target/loongarch: Implement vld vst

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: +void HELPER(vld_b)(CPULoongArchState *env, uint32_t vd, target_ulong addr) +{ +int i; +VReg *Vd = &(env->fpr[vd].vreg); +#if !defined(CONFIG_USER_ONLY) +MemOpIdx oi = make_memop_idx(MO_TE | MO_UNALN, cpu_mmu_index(env, false)); + +for (i = 0; i <

Re: [PATCH v6 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread LIU Zhiwei
On 2023/4/4 11:12, LIU Zhiwei wrote: On 2023/4/4 10:06, Weiwei Li wrote: Add a base pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. We can get pc-relative address from following formula:    real_pc = (old)env->pc + diff, whe

Re: [PATCH v6 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread LIU Zhiwei
On 2023/4/4 10:06, Weiwei Li wrote: Add a base pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. We can get pc-relative address from following formula: real_pc = (old)env->pc + diff, where diff = target_pc - ctx->pc_save. Use

Re: [PATCH v6 3/6] target/riscv: Fix target address to update badaddr

2023-04-03 Thread LIU Zhiwei
On 2023/4/4 10:06, Weiwei Li wrote: Compute the target address before storing it into badaddr when mis-aligned exception is triggered. Use a target_pc temp to store the target address to avoid the confusing operation that udpate target address into cpu_pc before misalign check, then update it i

Re: [PATCH v6 6/6] target/riscv: Add pointer mask support for instruction fetch

2023-04-03 Thread LIU Zhiwei
On 2023/4/4 10:06, Weiwei Li wrote: Transform the fetch address in cpu_get_tb_cpu_state() when pointer mask for instruction is enabled. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson --- target/riscv/cpu.h| 1 + target/riscv/cpu_helper.c | 2

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread LIU Zhiwei
On 2023/4/4 10:13, liweiwei wrote: On 2023/4/4 09:58, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc:

Re: [edk2-devel] On integrating LoongArch EDK2 firmware into QEMU build process

2023-04-03 Thread Chao Li
在 2023/4/3 19:04, Gerd Hoffmann 写道: On Mon, Apr 03, 2023 at 10:29:52AM +, Michael Brown wrote: On 03/04/2023 11:13, Chao Li wrote: This problem is because the gcc-12 does not yet to support the option 'mno-explicit-reloc', this option is used to open the new reloaction type for LoongArch,

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread liweiwei
On 2023/4/4 09:58, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc:     real_pc = (old)env->pc + target_

Re: [RFC PATCH v2 18/44] target/loongarch: Implement vsat

2023-04-03 Thread gaosong
在 2023/4/4 上午4:13, Richard Henderson 写道: On 4/3/23 05:55, gaosong wrote: Hi, Richard 在 2023/4/1 下午1:03, Richard Henderson 写道: On 3/27/23 20:06, Song Gao wrote: +static void gen_vsat_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) +{ +    TCGv_vec t1; +    int64_t max  = (1l << imm) -

[PATCH v6 1/6] target/riscv: Fix pointer mask transformation for vector address

2023-04-03 Thread Weiwei Li
actual_address = (requested_address & ~mpmmask) | mpmbase. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Daniel Henrique Barboza Reviewed-by: LIU Zhiwei --- target/riscv/vector_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/vecto

[PATCH v6 0/6] target/riscv: Fix pointer mask related support

2023-04-03 Thread Weiwei Li
This patchset tries to fix some problem in current implementation for pointer mask, and add support for pointer mask of instruction fetch. The port is available here: https://github.com/plctlab/plct-qemu/tree/plct-pm-fix-v6 v2: * drop some error patchs * Add patch 2 and 3 to fix the new problems

[PATCH v6 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread Weiwei Li
Add a base pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. We can get pc-relative address from following formula: real_pc = (old)env->pc + diff, where diff = target_pc - ctx->pc_save. Use gen_get_target_pc to compute target addr

[PATCH v6 5/6] target/riscv: Enable PC-relative translation in system mode

2023-04-03 Thread Weiwei Li
Enable PC-relative translation in system mode by setting CF_PCREL field of tcg_cflags in riscv_cpu_realize(). Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: LIU Zhiwei Reviewed-by: Richard Henderson --- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v6 6/6] target/riscv: Add pointer mask support for instruction fetch

2023-04-03 Thread Weiwei Li
Transform the fetch address in cpu_get_tb_cpu_state() when pointer mask for instruction is enabled. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson --- target/riscv/cpu.h| 1 + target/riscv/cpu_helper.c | 20 +++- target/riscv/csr.c

[PATCH v6 2/6] target/riscv: Update cur_pmmask/base when xl changes

2023-04-03 Thread Weiwei Li
write_mstatus() can only change current xl when in debug mode. And we need update cur_pmmask/base in this case. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: LIU Zhiwei --- target/riscv/csr.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/targe

[PATCH v6 3/6] target/riscv: Fix target address to update badaddr

2023-04-03 Thread Weiwei Li
Compute the target address before storing it into badaddr when mis-aligned exception is triggered. Use a target_pc temp to store the target address to avoid the confusing operation that udpate target address into cpu_pc before misalign check, then update it into badaddr and restore cpu_pc to curren

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread LIU Zhiwei
On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc: real_pc = (old)env->pc + target_pc(from tb) - ctx->save_pc Use gen_get_

Re: [RFC PATCH v2 41/44] target/loongarch: Implement vilvl vilvh vextrins vshuf

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: +void HELPER(vshuf_b)(CPULoongArchState *env, + uint32_t vd, uint32_t vj, uint32_t vk, uint32_t va) +{ +int i, m, k; +VReg temp; +VReg *Vd = &(env->fpr[vd].vreg); +VReg *Vj = &(env->fpr[vj].vreg); +VReg *Vk = &(env->fpr[vk]

[PATCH qemu v2] sev/i386: Fix error reporting

2023-04-03 Thread Alexey Kardashevskiy
c9f5aaa6bce8 ("sev: Add Error ** to sev_kvm_init()") converted error_report() to error_setg(), however it missed one error_report() and other 2 changes added error_report() after conversion. The result is the caller - kvm_init() - crashes in error_report_err as local_err is NULL. Follow the patter

[PATCH v2 1/3] qapi/machine-target: refactor machine-target

2023-04-03 Thread Dinah Baum
Moved architecture agnostic data types to their own file to avoid "attempt to use poisoned TARGET_*" error that results when including qapi header with commands that aren't defined for all architectures. Required to implement enabling `query-cpu-model-expansion` on all architectures Signed-off-by:

[PATCH v2 2/3] cpu, qapi, target/arm, i386, s390x: Generalize query-cpu-model-expansion

2023-04-03 Thread Dinah Baum
This patch enables 'query-cpu-model-expansion' on all architectures. Only architectures that implement the command will return results, others will return an error message as before. This patch lays the groundwork for parsing a -cpu cpu,help option as specified in https://gitlab.com/qemu-project/q

[PATCH v2 3/3] cpu, qdict, vl: Enable printing options for CPU type

2023-04-03 Thread Dinah Baum
Change parsing of -cpu argument to allow -cpu cpu,help to print options for the CPU type similar to how the '-device' option works. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1480 Signed-off-by: Dinah Baum --- cpu.c | 41 +++

[RESEND PATCH v2 0/3] Enable -cpu ,help

2023-04-03 Thread Dinah Baum
Part 1 is a refactor/code motion patch for qapi/machine target required for setup of Part 2 which enables query-cpu-model-expansion on all architectures Part 3 implements the ',help' feature Limitations: Currently only 'FULL' expansion queries are implemented since that's the only type enabled o

Re: [RFC PATCH v2 40/44] target/loongarch: Implement vreplve vpack vpick

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: +static bool trans_vbsll_v(DisasContext *ctx, arg_vv_i *a) +{ +int ofs; +TCGv_i64 desthigh, destlow, high, low, t; + +CHECK_SXE; + +desthigh = tcg_temp_new_i64(); +destlow = tcg_temp_new_i64(); +high = tcg_temp_new_i64(); +low = tcg_te

Re: [RFC PATCH v2 39/44] target/loongarch: Implement vinsgr2vr vpickve2gr vreplgr2vr

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: This patch includes: - VINSGR2VR.{B/H/W/D}; - VPICKVE2GR.{B/H/W/D}[U]; - VREPLGR2VR.{B/H/W/D}. Signed-off-by: Song Gao --- target/loongarch/disas.c| 33 ++ target/loongarch/insn_trans/trans_lsx.c.inc | 110 targe

Re: [RFC PATCH v2 38/44] target/loongarch: Implement vbitsel vset

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: +static void gen_vbitseli(unsigned vece, TCGv_vec a, TCGv_vec b, int64_t imm) +{ +TCGv_vec t; + +t = tcg_temp_new_vec_matching(a); +tcg_gen_dupi_vec(vece, t, imm); tcg_constant_vec_matching. +void HELPER(vseteqz_v)(CPULoongArchState *env, uint32_t

Re: [RFC PATCH v2 37/44] target/loongarch: Implement vfcmp

2023-04-03 Thread Richard Henderson
On 3/27/23 20:06, Song Gao wrote: +static uint64_t vfcmp_common(CPULoongArchState *env, + FloatRelation cmp, uint32_t flags) +{ +bool ret; + +switch (cmp) { +case float_relation_less: +ret = (flags & FCMP_LT); +break; +case float_relatio

[PATCH v2 for 8.0?] nbd/server: Request TCP_NODELAY

2023-04-03 Thread Eric Blake
Nagle's algorithm adds latency in order to reduce network packet overhead on small packets. But when we are already using corking to merge smaller packets into transactional requests, the extra delay from TCP defaults just gets in the way (see recent commit bd2cd4a4). For reference, qemu as an NB

Re: [PATCH] MAINTAINERS: Add Eugenio Pérez as vhost-shadow-virtqueue reviewer

2023-04-03 Thread Jason Wang
On Fri, Mar 31, 2023 at 11:04 PM Eugenio Pérez wrote: > > I'd like to be notified on SVQ patches and review them. > > Signed-off-by: Eugenio Pérez Acked-by: Jason Wang Thanks > --- > MAINTAINERS | 4 > 1 file changed, 4 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index ef

[PATCH] block/nfs: avoid BDRV_POLL_WHILE() in nfs_co_get_allocated_file_size()

2023-04-03 Thread Stefan Hajnoczi
Commit 82618d7bc341 ("block: Convert bdrv_get_allocated_file_size() to co_wrapper") made nfs_get_allocated_file_size() a coroutine. The coroutine still uses BDRV_POLL_WHILE() to wait for the NFS RPC to complete. Take it a step further and yield the coroutine until the RPC completes. This avoids th

[PATCH v5] hostmem-file: add offset option

2023-04-03 Thread Alexander Graf
Add an option for hostmem-file to start the memory object at an offset into the target file. This is useful if multiple memory objects reside inside the same target file, such as a device node. In particular, it's useful to map guest memory directly into /dev/mem for experimentation. To make this

Re: [PATCH v4] hostmem-file: add offset option

2023-04-03 Thread Alexander Graf
On 03.04.23 09:13, David Hildenbrand wrote: On 01.04.23 19:47, Stefan Hajnoczi wrote: On Sat, Apr 01, 2023 at 12:42:57PM +, Alexander Graf wrote: Add an option for hostmem-file to start the memory object at an offset into the target file. This is useful if multiple memory objects reside

Re: [PATCH] vfio/migration: Skip log_sync during migration SETUP state

2023-04-03 Thread Alex Williamson
On Mon, 3 Apr 2023 22:36:42 +0200 Cédric Le Goater wrote: > On 4/3/23 15:00, Avihai Horon wrote: > > Currently, VFIO log_sync can be issued while migration is in SETUP > > state. However, doing this log_sync is at best redundant and at worst > > can fail. > > > > Redundant -- all RAM is marked d

Re: [PATCH RESEND 2/2] migration/ram.c: Fix migration with compress enabled

2023-04-03 Thread Peter Xu
On Sun, Apr 02, 2023 at 05:48:38PM +, Lukas Straub wrote: > Since ec6f3ab9, migration with compress enabled was broken, because > the compress threads use a dummy QEMUFile which just acts as a > buffer and that commit accidentally changed it to use the outgoing > migration channel instead. Sor

Re: [PATCH RESEND 1/2] qtest/migration-test.c: Add test with compress enabled

2023-04-03 Thread Peter Xu
On Sun, Apr 02, 2023 at 05:47:45PM +, Lukas Straub wrote: > There has never been a test for migration with compress enabled. > > Add a suitable test, testing with compress-wait-thread = false > too. > > iterations = 2 is intentional, so it also tests that no invalid > thread state is left ove

Re: [RFC QEMU PATCH 08/18] virtio-gpu: Initialize Venus

2023-04-03 Thread Dmitry Osipenko
On 3/24/23 16:22, Huang Rui wrote: > On Thu, Mar 16, 2023 at 07:14:47AM +0800, Dmitry Osipenko wrote: >> On 3/13/23 18:55, Huang Rui wrote: >>> On Mon, Mar 13, 2023 at 01:51:03AM +0800, Dmitry Osipenko wrote: On 3/12/23 12:22, Huang Rui wrote: > From: Antonio Caggiano > > Request

Re: [PATCH v2 04/10] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'

2023-04-03 Thread Warner Losh
On Mon, Apr 3, 2023 at 12:35 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 4/3/23 07:46, Peter Maydell wrote: > > The '-singlestep' option is confusing, because it doesn't actually > > have anything to do with single-stepping the CPU. What it does do > > is force TCG emulation t

Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event

2023-04-03 Thread Philippe Mathieu-Daudé
On 3/4/23 20:29, Stefan Hajnoczi wrote: Only report a transport reset event to the guest after the SCSIDevice has been unrealized by qdev_simple_device_unplug_cb(). qdev_simple_device_unplug_cb() sets the SCSIDevice's qdev.realized field to false so that scsi_device_find/get() no longer see it.

Re: [PATCH v2 05/10] bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'

2023-04-03 Thread Warner Losh
On Mon, Apr 3, 2023 at 8:46 AM Peter Maydell wrote: > The '-singlestep' option is confusing, because it doesn't actually > have anything to do with single-stepping the CPU. What it does do > is force TCG emulation to put one guest instruction in each TB, > which can be useful in some situations.

Re: [PATCH] vfio/migration: Skip log_sync during migration SETUP state

2023-04-03 Thread Cédric Le Goater
On 4/3/23 15:00, Avihai Horon wrote: Currently, VFIO log_sync can be issued while migration is in SETUP state. However, doing this log_sync is at best redundant and at worst can fail. Redundant -- all RAM is marked dirty in migration SETUP state and is transferred only after migration is set to

Re: [PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-04-03 Thread Bernhard Beschow
Am 3. April 2023 12:27:14 UTC schrieb Jason Andryuk : >On Mon, Apr 3, 2023 at 5:33 AM Anthony PERARD >wrote: >> >> On Sat, Apr 01, 2023 at 10:36:45PM +, Bernhard Beschow wrote: >> > >> > >> > Am 30. März 2023 13:00:25 UTC schrieb Anthony PERARD >> > : >> > >On Sun, Mar 12, 2023 at 01:02:1

Re: [PATCH v10] audio/pwaudio.c: Add Pipewire audio backend for QEMU

2023-04-03 Thread Dorinda Bassey
Hi Volker, Marc. I have spent a significant amount of time revising the patchset and I'm eager to see them included in the project. I understand that reviewing the patches can be a time-consuming process and I appreciate the effort you've put into providing feedback and guiding me through the revi

[PATCH v10] audio/pwaudio.c: Add Pipewire audio backend for QEMU

2023-04-03 Thread Dorinda Bassey
This commit adds a new audiodev backend to allow QEMU to use Pipewire as both an audio sink and source. This backend is available on most systems Add Pipewire entry points for QEMU Pipewire audio backend Add wrappers for QEMU Pipewire audio backend in qpw_pcm_ops() qpw_write function returns the c

Re: [RFC PATCH v2 18/44] target/loongarch: Implement vsat

2023-04-03 Thread Richard Henderson
On 4/3/23 05:55, gaosong wrote: Hi, Richard 在 2023/4/1 下午1:03, Richard Henderson 写道: On 3/27/23 20:06, Song Gao wrote: +static void gen_vsat_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) +{ +    TCGv_vec t1; +    int64_t max  = (1l << imm) - 1; This needed 1ull, but better to just us

Re: [PATCH v2] hostmem-file: add offset option

2023-04-03 Thread Alexander Graf
On 03.04.23 08:28, Markus Armbruster wrote: Alexander Graf writes: Add an option for hostmem-file to start the memory object at an offset into the target file. This is useful if multiple memory objects reside inside the same target file, such as a device node. In particular, it's useful to

Re: [RFC PATCH v1 00/26] migration: File based migration with multifd and fixed-ram

2023-04-03 Thread Peter Xu
Hi, Claudio, Thanks for the context. On Mon, Apr 03, 2023 at 09:47:26AM +0200, Claudio Fontana wrote: > Hi, not sure if what is asked here is context in terms of the previous > upstream discussions or our specific requirement we are trying to bring > upstream. > > In terms of the specific require

Re: [PATCH v2 09/10] qapi/run-state.json: Fix missing newline at end of file

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: The run-state.json file is missing a trailing newline; add it. Signed-off-by: Peter Maydell --- Noticed this because my editor wanted to add the newline when I touched the file for the following patch... --- qapi/run-state.json | 2 +- 1 file changed, 1 i

Re: [PATCH v2 08/10] hmp: Report 'one-insn-per-tb', not 'single step mode', in 'info status' output

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: The HMP 'info status' output includes "(single step mode)" when we are running with TCG one-insn-per-tb enabled. Change this text to "(one insn per TB)" to match the new command line option names. We don't need to have a deprecation/transition plan for this,

Re: [PATCH v2 07/10] hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep'

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: The 'singlestep' HMP command is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new HMP

Re: [PATCH v2 06/10] Document that -singlestep command line option is deprecated

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: Document that the -singlestep command line option is now deprecated, as it is replaced by either the TCG accelerator property 'one-insn-per-tb' for system emulation or the new '-one-insn-per-tb' option for usermode emulation, and remove the only use of the de

Re: [PATCH v2 05/10] bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command

[PATCH v4 1/2] arm: move KVM breakpoints helpers

2023-04-03 Thread francesco . cagnin
From: Francesco Cagnin These helpers will be also used for HVF. Aside from reformatting a couple of comments for 'checkpatch.pl' and updating meson to compile 'hyp_gdbstub.c', this is just code motion. Signed-off-by: Francesco Cagnin Reviewed-by: Alex Bennée Reviewed-by: Peter Maydell --- ta

[PATCH v4 2/2] hvf: implement guest debugging on Apple Silicon hosts

2023-04-03 Thread francesco . cagnin
From: Francesco Cagnin Support is added for single-stepping, software breakpoints, hardware breakpoints and watchpoints. The code has been structured like the KVM counterpart (and many parts are basically identical). Guests can be debugged through the gdbstub. While guest debugging is enabled,

[PATCH v4 0/2] Add gdbstub support to HVF

2023-04-03 Thread francesco . cagnin
From: Francesco Cagnin This patch series aims to add gdbstub support to HVF (the 'QEMU accelerator on macOS that employs Hypervisor.framework') on Apple Silicon hosts. The proposed implementation, structured like the KVM counterpart, handles single-stepping, software breakpoints, hardware breakp

Re: [PATCH] tests/qtest/migration-test: Disable migration/multifd/tcp/plain/cancel

2023-04-03 Thread Peter Maydell
On Wed, 22 Mar 2023 at 20:15, Peter Maydell wrote: > > On Tue, 7 Mar 2023 at 09:53, Peter Maydell wrote: > > > > On Sat, 4 Mar 2023 at 15:39, Peter Maydell wrote: > > > > > > On Thu, 2 Mar 2023 at 17:22, Peter Maydell > > > wrote: > > > > > > > > migration-test has been flaky for a long time,

Re: [PATCH v2 04/10] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command

[PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref()

2023-04-03 Thread Stefan Hajnoczi
These functions must be called with the AioContext acquired: /* Callers must hold exp->ctx lock */ void blk_exp_ref(BlockExport *exp) ... /* Callers must hold exp->ctx lock */ void blk_exp_unref(BlockExport *exp) Signed-off-by: Stefan Hajnoczi --- block/export/fuse.c | 4 1 file

Re: [PATCH v2 03/10] tcg: Use one-insn-per-tb accelerator property in curr_cflags()

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: uint32_t curr_cflags(CPUState *cpu) { uint32_t cflags = cpu->tcg_cflags; +TCGState *tcgstate = TCG_STATE(current_accel()); As mentioned against the cover, this is a very hot path. We should try for something less expensive. Perhaps as simple

[PATCH 05/13] block/export: wait for vhost-user-blk requests when draining

2023-04-03 Thread Stefan Hajnoczi
Each vhost-user-blk request runs in a coroutine. When the BlockBackend enters a drained section we need to enter a quiescent state. Currently any in-flight requests race with bdrv_drained_begin() because it is unaware of vhost-user-blk requests. When blk_co_preadv/pwritev()/etc returns it wakes th

[PATCH 01/13] virtio-scsi: avoid race between unplug and transport event

2023-04-03 Thread Stefan Hajnoczi
Only report a transport reset event to the guest after the SCSIDevice has been unrealized by qdev_simple_device_unplug_cb(). qdev_simple_device_unplug_cb() sets the SCSIDevice's qdev.realized field to false so that scsi_device_find/get() no longer see it. scsi_target_emulate_report_luns() also ne

[PATCH 03/13] block/export: only acquire AioContext once for vhost_user_server_stop()

2023-04-03 Thread Stefan Hajnoczi
vhost_user_server_stop() uses AIO_WAIT_WHILE(). AIO_WAIT_WHILE() requires that AioContext is only acquired once. Since blk_exp_request_shutdown() already acquires the AioContext it shouldn't be acquired again in vhost_user_server_stop(). Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server

[PATCH 07/13] virtio: do not set is_external=true on host notifiers

2023-04-03 Thread Stefan Hajnoczi
Host notifiers trigger virtqueue processing. There are critical sections when new I/O requests must not be submitted because they would cause interference. In the past this was solved using aio_set_event_notifiers() is_external=true argument, which disables fd monitoring between aio_disable/enable

[PATCH 13/13] aio: remove aio_disable_external() API

2023-04-03 Thread Stefan Hajnoczi
All callers now pass is_external=false to aio_set_fd_handler() and aio_set_event_notifier(). The aio_disable_external() API that temporarily disables fd handlers that were registered is_external=true is therefore dead code. Remove aio_disable_external(), aio_enable_external(), and the is_external

[PATCH 00/13] block: remove aio_disable_external() API

2023-04-03 Thread Stefan Hajnoczi
The aio_disable_external() API temporarily suspends file descriptor monitoring in the event loop. The block layer uses this to prevent new I/O requests being submitted from the guest and elsewhere between bdrv_drained_begin() and bdrv_drained_end(). While the block layer still needs to prevent new

[PATCH 12/13] block/fuse: do not set is_external=true on FUSE fd

2023-04-03 Thread Stefan Hajnoczi
This is part of ongoing work to remove the aio_disable_external() API. Use BlockDevOps .drained_begin/end/poll() instead of aio_set_fd_handler(is_external=true). As a side-effect the FUSE export now follows AioContext changes like the other export types. Signed-off-by: Stefan Hajnoczi --- bloc

[PATCH 08/13] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore

2023-04-03 Thread Stefan Hajnoczi
There is no need to suspend activity between aio_disable_external() and aio_enable_external(), which is mainly used for the block layer's drain operation. This is part of ongoing work to remove the aio_disable_external() API. Signed-off-by: Stefan Hajnoczi --- hw/i386/kvm/xen_xenstore.c | 2 +-

[PATCH 06/13] block/export: stop using is_external in vhost-user-blk server

2023-04-03 Thread Stefan Hajnoczi
vhost-user activity must be suspended during bdrv_drained_begin/end(). This prevents new requests from interfering with whatever is happening in the drained section. Previously this was done using aio_set_fd_handler()'s is_external argument. In a multi-queue block layer world the aio_disable_exter

[PATCH 09/13] hw/xen: do not set is_external=true on evtchn fds

2023-04-03 Thread Stefan Hajnoczi
is_external=true suspends fd handlers between aio_disable_external() and aio_enable_external(). The block layer's drain operation uses this mechanism to prevent new I/O from sneaking in between bdrv_drained_begin() and bdrv_drained_end(). The xen-block device actually works fine with is_external=f

[PATCH 04/13] util/vhost-user-server: rename refcount to in_flight counter

2023-04-03 Thread Stefan Hajnoczi
The VuServer object has a refcount field and ref/unref APIs. The name is confusing because it's actually an in-flight request counter instead of a refcount. Normally a refcount destroys the object upon reaching zero. The VuServer counter is used to wake up the vhost-user coroutine when there are n

[PATCH 10/13] block/export: rewrite vduse-blk drain code

2023-04-03 Thread Stefan Hajnoczi
vduse_blk_detach_ctx() waits for in-flight requests using AIO_WAIT_WHILE(). This is not allowed according to a comment in bdrv_set_aio_context_commit(): /* * Take the old AioContex when detaching it from bs. * At this point, new_context lock is already acquired, and we are now * also ta

[PATCH 02/13] virtio-scsi: stop using aio_disable_external() during unplug

2023-04-03 Thread Stefan Hajnoczi
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 submitting requests to the same disk. The SCSI emulation code is already in good shape to stop using aio_disable_external(). It was only

Re: [PATCH v4] hostmem-file: add offset option

2023-04-03 Thread David Hildenbrand
On 03.04.23 17:49, Peter Xu wrote: On Mon, Apr 03, 2023 at 09:13:29AM +0200, David Hildenbrand wrote: On 01.04.23 19:47, Stefan Hajnoczi wrote: On Sat, Apr 01, 2023 at 12:42:57PM +, Alexander Graf wrote: Add an option for hostmem-file to start the memory object at an offset into the target

Re: [PATCH v2 02/10] softmmu: Don't use 'singlestep' global in QMP and HMP commands

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: The HMP 'singlestep' command, the QMP 'query-status' command and the HMP 'info status' command (which is just wrapping the QMP command implementation) look at the 'singlestep' global variable. Make them access the new TCG accelerator 'one-insn-per-tb' propert

Re: [PATCH v2 01/10] make one-insn-per-tb an accel option

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: This commit adds 'one-insn-per-tb' as a property on the TCG accelerator object, so you can enable it with -accel tcg,one-insn-per-tb=on It has the same behaviour as the existing '-singlestep' command line option. We use a different name because 'singles

Re: [PATCH] target/mips: tcg: detect out-of-bounds accesses to cpu_gpr and cpu_gpr_hi

2023-04-03 Thread Richard Henderson
On 4/3/23 10:29, Paolo Bonzini wrote: In some cases (for example gen_compute_branch_nm in nanomips_translate.c.inc) registers can be unused on some paths and a negative value is passed in that case: gen_compute_branch_nm(ctx, OPC_BPOSGE32, 4, -1, -2, imm <

Re: [PATCH 04/11] qemu-options: finesse the recommendations around -blockdev

2023-04-03 Thread Markus Armbruster
Thomas Huth writes: > On 03/04/2023 16.55, Markus Armbruster wrote: >> Alex Bennée writes: >> >>> Markus Armbruster writes: >>> Alex Bennée writes: > ... >>> I was under the impression things like -hda wouldn't work say on an Arm >>> machine because you don't know what sort of interface

Re: [PATCH v2 07/10] hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep'

2023-04-03 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > The 'singlestep' HMP command is confusing, because it doesn't > actually have anything to do with single-stepping the CPU. What it > does do is force TCG emulation to put one guest instruction in each > TB, which can be useful in some situations.

[PATCH] target/mips: tcg: detect out-of-bounds accesses to cpu_gpr and cpu_gpr_hi

2023-04-03 Thread Paolo Bonzini
In some cases (for example gen_compute_branch_nm in nanomips_translate.c.inc) registers can be unused on some paths and a negative value is passed in that case: gen_compute_branch_nm(ctx, OPC_BPOSGE32, 4, -1, -2, imm << 1); To avoid an out of bounds access in

Re: [PATCH] MAINTAINERS: Remove and change David Gilbert maintainer entries

2023-04-03 Thread Markus Armbruster
"Dr. David Alan Gilbert (git)" writes: > From: "Dr. David Alan Gilbert" > > I'm leaving Red Hat next week, so clean up the maintainer entries. > > 'virtiofs' is just the device code now, so is pretty small, and > Stefan is still a maintainer there. > > 'migration' still has Juan. > > For 'HMP' I

Re: [PATCH] acpi: pcihp: make pending delete expire in 5sec

2023-04-03 Thread Michael S. Tsirkin
On Mon, Apr 03, 2023 at 06:16:18PM +0200, Igor Mammedov wrote: > with Q35 using ACPI PCI hotplug by default, user's request to unplug > device is ignored when it's issued before guest OS has been booted. > And any additional attempt to request device hot-unplug afterwards > results in following err

Re: [PATCH v19 13/21] docs/s390x/cpu topology: document s390x cpu topology

2023-04-03 Thread Pierre Morel
On 4/3/23 19:00, Cédric Le Goater wrote: On 4/3/23 18:28, Pierre Morel wrote: Add some basic examples for the definition of cpu topology in s390x. Signed-off-by: Pierre Morel ---   MAINTAINERS    |   2 +   docs/devel/index-internals.rst |   1 +   docs/devel/s390-cpu-t

Re: [PATCH for 8.1 v2 5/6] vdpa: move CVQ isolation check to net_init_vhost_vdpa

2023-04-03 Thread Eugenio Perez Martin
On Mon, Apr 3, 2023 at 7:32 AM Jason Wang wrote: > > On Fri, Mar 31, 2023 at 6:12 PM Eugenio Perez Martin > wrote: > > > > On Fri, Mar 31, 2023 at 10:00 AM Jason Wang wrote: > > > > > > > > > 在 2023/3/30 18:42, Eugenio Perez Martin 写道: > > > > On Thu, Mar 30, 2023 at 8:23 AM Jason Wang wrote: >

Re: [PATCH v7 3/4] qemu-iotests: test zone append operation

2023-04-03 Thread Stefan Hajnoczi
On Thu, Mar 23, 2023 at 01:19:06PM +0800, Sam Li wrote: > The patch tests zone append writes by reporting the zone wp after > the completion of the call. "zap -p" option can print the sector > offset value after completion, which should be the start sector > where the append write begins. > > Sign

Re: [PATCH v7 4/4] block: add some trace events for zone append

2023-04-03 Thread Stefan Hajnoczi
On Thu, Mar 23, 2023 at 01:19:07PM +0800, Sam Li wrote: > Signed-off-by: Sam Li > Reviewed-by: Dmitry Fomichev > --- > block/file-posix.c | 3 +++ > block/trace-events | 2 ++ > 2 files changed, 5 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v7 2/4] block: introduce zone append write for zoned devices

2023-04-03 Thread Stefan Hajnoczi
On Thu, Mar 23, 2023 at 01:19:05PM +0800, Sam Li wrote: > diff --git a/block/io.c b/block/io.c > index 5dbf1e50f2..fe9cabaaf6 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -3152,6 +3152,27 @@ out: > return co.ret; > } > > +int coroutine_fn bdrv_co_zone_append(BlockDriverState *bs, int64

Re: [PATCH v7 1/4] file-posix: add tracking of the zone write pointers

2023-04-03 Thread Stefan Hajnoczi
On Thu, Mar 23, 2023 at 01:19:04PM +0800, Sam Li wrote: > Since Linux doesn't have a user API to issue zone append operations to > zoned devices from user space, the file-posix driver is modified to add > zone append emulation using regular writes. To do this, the file-posix > driver tracks the wp

Re: [PATCH v19 13/21] docs/s390x/cpu topology: document s390x cpu topology

2023-04-03 Thread Cédric Le Goater
On 4/3/23 18:28, Pierre Morel wrote: Add some basic examples for the definition of cpu topology in s390x. Signed-off-by: Pierre Morel --- MAINTAINERS| 2 + docs/devel/index-internals.rst | 1 + docs/devel/s390-cpu-topology.rst | 161 +++ do

Re: an issue for device hot-unplug

2023-04-03 Thread Yu Zhang
Dear Laurent, Thank you for your quick reply. We used qemu-7.1, but it is reproducible with qemu from v6.2 to the recent v8.0 release candidates. I found that it's introduced by the commit 9323f892b39 (between v6.2.0-rc2 and v6.2.0-rc3). If it doesn't break anything else, it suffices to remove t

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

2023-04-03 Thread Richard Henderson
On 4/3/23 07:46, Peter Maydell wrote: * I have written patch 3 on the assumption that curr_cflags() is not such a hot codepath that we can't afford to have a QOM cast macro in it; the alternative would be to keep it using a global variable but make the global be restricted to ac

Re: [PATCH v2 2/5] apic: add support for x2APIC mode

2023-04-03 Thread Bui Quang Minh
On 4/3/23 17:27, David Woodhouse wrote: On Wed, 2023-03-29 at 22:30 +0700, Bui Quang Minh wrote: I do some more testing on my hardware, your point is correct when dest == 0x, the interrupt is delivered to all APICs regardless of their mode. To be precisely, it only broadcasts to CPU

  1   2   3   >