Re: [PULL 0/6] Coverity patch queue

2022-04-26 Thread Richard Henderson
/rth7680/qemu.git tags/pull-tcg-20220426 for you to fetch changes up to dee3fcfbb399a0e4ccedbf737b5b0b7f56ecd398: softfloat: Use FloatRelation for fracN_cmp (2022-04-26 20:01:55 -0700) Fix s390x ICMH cc computation. Minor

[PATCH] target/arm: Use field names for accessing DBGWCRn

2022-04-26 Thread Richard Henderson
While defining these names, use the correct field width of 5 not 4 for DBGWCR.MASK. This typo prevented setting a watchpoint larger than 32k. Reported-by: Chris Howard Signed-off-by: Richard Henderson --- target/arm/internals.h| 12 target/arm/debug_helper.c | 10 +-

Re: Possible bug when setting aarch64 watchpoints

2022-04-26 Thread Richard Henderson
On 4/24/22 04:40, Chris Howard wrote: Hi, I’m new to qemu (and even bug-reporting) so apologies in advance… The MASK field in DBGWCRx_EL1 is **5** bits wide [28:24]. In target/arm/kvm64.c I found the line: wp.wcr = deposit32(wp.wcr, 24, 4, bits); // ie **4** bits instead of

[PULL 5/6] softfloat: Use FloatRelation within partsN_compare

2022-04-26 Thread Richard Henderson
As the return type is FloatRelation, it's clearer to use the type for 'cmp' within the function. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20220401132240.79730-3-richard.hender...@linaro.org> --- fpu/softfloat-parts.c.inc | 11 +++ 1 file changed, 7

[PULL 1/6] accel/tcg: Assert mmu_idx in range before use in cputlb

2022-04-26 Thread Richard Henderson
Coverity reports out-of-bound accesses within cputlb.c. This should be a false positive due to how the index is decoded from MemOpIdx. To be fair, nothing is checking the correct bounds during encoding either. Assert index in range before use, both to catch user errors and to pacify static

[PULL 6/6] softfloat: Use FloatRelation for fracN_cmp

2022-04-26 Thread Richard Henderson
Since the caller, partsN_compare, is now exclusively using FloatRelation, it's clearer to use it here too. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20220401132240.79730-4-richard.hender...@linaro.org> --- fpu/softfloat.c | 12 +++- 1 file changed, 7

[PULL 4/6] softfloat: Fix declaration of partsN_compare

2022-04-26 Thread Richard Henderson
The declaration used 'int', while the definition used 'FloatRelation'. This should have resulted in a compiler error, but mysteriously didn't. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20220401132240.79730-2-richard.hender...@linaro.org> --- fpu/softfloat.c | 8

[PULL 3/6] target/i386: Suppress coverity warning on fsave/frstor

2022-04-26 Thread Richard Henderson
Coverity warns that 14 << data32 may overflow with respect to the target_ulong to which it is subsequently added. We know this wasn't true because data32 is in [1,2], but the suggested fix is perfectly fine. Fixes: Coverity CID 1487135, 1487256 Signed-off-by: Richard Henderson Reviewed-by:

[PULL 2/6] target/s390x: Fix the accumulation of ccm in op_icm

2022-04-26 Thread Richard Henderson
Coverity rightly reports that 0xff << pos can overflow. This would affect the ICMH instruction. Fixes: Coverity CID 1487161 Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth Message-Id: <20220401193659.332079-1-richard.hender...@linaro.org> ---

[PULL 0/6] Coverity patch queue

2022-04-26 Thread Richard Henderson
The following changes since commit a72d9008092e39c2c37e47a91bae4e170d0f1b33: Merge tag 'pull-nbd-2022-04-26' of https://repo.or.cz/qemu/ericb into staging (2022-04-26 14:39:09 -0700) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20220426 for you

[PATCH qemu] spapr_pci: Disable IRQFD resampling on XIVE

2022-04-26 Thread Alexey Kardashevskiy
VFIO-PCI has an "KVM_IRQFD_FLAG_RESAMPLE" optimization for INTx EOI handling when KVM can unmask PCI INTx (level triggered interrupt) without switching to the userspace (==QEMU). Unfortunately XIVE does not support level interrupts, QEMU emulates them and therefore there is no existing code path

Re: [PATCH 0/7] vhost-vdpa multiqueue fixes

2022-04-26 Thread Jason Wang
在 2022/3/30 14:33, Si-Wei Liu 写道: Hi, This patch series attempt to fix a few issues in vhost-vdpa multiqueue functionality. Patch #1 is the formal submission for RFC patch in: https://lore.kernel.org/qemu-devel/c3e931ee-1a1b-9c2f-2f59-cb4395c23...@oracle.com/ Patch #2 and #3 were taken

[PATCH] target/arm: Enable SCTLR_EL1.BT0 for aarch64-linux-user

2022-04-26 Thread Richard Henderson
This controls whether the PACI{A,B}SP instructions trap with BTYPE=3 (indirect branch from register other than x16/x17). The linux kernel sets this in bti_enable(). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/998 Signed-off-by: Richard Henderson --- target/arm/cpu.c

Re: qemu questions about x86

2022-04-26 Thread Wei Li
Dear 项晨东 On Sat, Apr 23, 2022 at 3:57 PM 项晨东 wrote: > Dear qemu developers: > hello~ I'm Xiang Chen dong, a student from Tsinghua University. recently I > am trying to accomplish new X86 feature named user-interrupts which can > view here >

Re: [PATCH qemu 1/9] target/riscv: rvv: Add mask agnostic for vv instructions

2022-04-26 Thread eop Chen
> Weiwei Li 於 2022年4月27日 上午11:27 寫道: > > > > 在 2022/4/27 上午10:07, eop Chen 写道: >> >> >>> >>> 在 2022/4/27 上午2:20, eop Chen 写道: > Weiwei Li mailto:liwei...@iscas.ac.cn>> 於 > 2022年4月26日 下午4:47 寫道: > 在 2022/3/17 下午3:26, ~eopxd 写道: >> From: Yueh-Ting (eop) Chen >>

Re: [PATCH qemu 1/9] target/riscv: rvv: Add mask agnostic for vv instructions

2022-04-26 Thread Weiwei Li
在 2022/4/27 上午10:07, eop Chen 写道: 在 2022/4/27 上午2:20, eop Chen 写道: Weiwei Li mailto:liwei...@iscas.ac.cn>> 於 2022年4月26日 下午4:47 寫道: 在 2022/3/17 下午3:26, ~eopxd 写道: From: Yueh-Ting (eop) Chen This is the first commit regarding the mask agnostic behavior. Added option 'rvv_ma_all_1s' to

Re: [PATCH v4 4/6] vduse-blk: implements vduse-blk export

2022-04-26 Thread Yongji Xie
On Wed, Apr 27, 2022 at 1:03 AM Kevin Wolf wrote: > > Am 06.04.2022 um 09:59 hat Xie Yongji geschrieben: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new command-line syntax

Re: [PATCH 0/3] softfloat: FloatRelation cleanups

2022-04-26 Thread Richard Henderson
On 4/1/22 06:22, Richard Henderson wrote: Make consistent use of FloatRelation throughout the implementation of the float compare functions. I don't yet know if this actually solves Coverity issues, but they all look a bit cleaner, I think. r~ Richard Henderson (3): softfloat: Fix

Re: [PATCH] accel/tcg: Assert mmu_idx in range before use in cputlb

2022-04-26 Thread Richard Henderson
On 4/1/22 10:08, Richard Henderson wrote: Coverity reports out-of-bound accesses within cputlb.c. This should be a false positive due to how the index is decoded from MemOpIdx. To be fair, nothing is checking the correct bounds during encoding either. Assert index in range before use, both to

Re: [PATCH] target/i386: Suppress coverity warning on fsave/frstor

2022-04-26 Thread Richard Henderson
On 4/1/22 11:46, Richard Henderson wrote: Coverity warns that 14 << data32 may overflow with respect to the target_ulong to which it is subsequently added. We know this wasn't true because data32 is in [1,2], but the suggested fix is perfectly fine. Fixes: Coverity CID 1487135, 1487256

Re: [PATCH] target/s390x: Fix the accumulation of ccm in op_icm

2022-04-26 Thread Richard Henderson
On 4/1/22 12:36, Richard Henderson wrote: Coverity rightly reports that 0xff << pos can overflow. This would affect the ICMH instruction. Fixes: Coverity CID 1487161 Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2] linux-user: Clean up arg_start/arg_end confusion

2022-04-26 Thread Richard Henderson
We had two sets of variables: arg_start/arg_end, and arg_strings/env_strings. In linuxload.c, we set the first pair to the bounds of the argv strings, but in elfload.c, we set the first pair to the bounds of the argv pointers and the second pair to the bounds of the argv strings. Remove

[PATCH] 9pfs: local: Do not follow symlink in _nofollow

2022-04-26 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- hw/9pfs/9p-local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index d42ce6d8b82..def8afdb4d6 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -365,7 +365,7 @@ static int

Re: [PATCH v2 2/5] migration: Add 64bit variable array data type

2022-04-26 Thread Atish Kumar Patra
On Tue, Apr 26, 2022 at 5:50 PM Richard Henderson wrote: > > On 4/26/22 16:08, Atish Patra wrote: > > +.num_offset = vmstate_offset_value(_state, _field_num, uint32_t),\ > ... > > } else if (field->flags & VMS_VARRAY_UINT32) { > > n_elems = *(uint32_t *)(opaque +

Re: [PATCH v2 1/5] hw/intc: Move mtimer/mtimecmp to aclint

2022-04-26 Thread Atish Kumar Patra
On Tue, Apr 26, 2022 at 5:50 PM Richard Henderson wrote: > > On 4/26/22 16:08, Atish Patra wrote: > > @@ -334,7 +334,6 @@ const VMStateDescription vmstate_riscv_cpu = { > > VMSTATE_UINTTL(env.mscratch, RISCVCPU), > > VMSTATE_UINT64(env.mfromhost, RISCVCPU), > >

Re: [PATCH v2 2/5] 9pfs: fix qemu_mknodat(S_IFSOCK) on macOS

2022-04-26 Thread Akihiko Odaki
On 2022/04/26 21:38, Greg Kurz wrote: On Tue, 26 Apr 2022 12:57:37 +0900 Akihiko Odaki wrote: On 2022/04/25 3:45, Christian Schoenebeck wrote: +} +err = chmod(addr.sun_path, mode); I'm not sure if it is fine to have a time window between bind() and chmod(). Do you have some

Re: [PATCH v2 41/43] target/loongarch: Add gdb support.

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 1 + configs/targets/loongarch64-softmmu.mak | 1 + gdb-xml/loongarch-base64.xml| 44 ++ gdb-xml/loongarch-fpu64.xml

Re: [PATCH v2 39/43] hw/loongarch: Add LoongArch load elf function.

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -525,8 +525,12 @@ static const MemoryRegionOps loongarch_qemu_ops = { static void do_cpu_reset(void *opaque) { LoongArchCPU *cpu = opaque; +CPULoongArchState *env = >env;

Re: [PATCH v2 37/43] hw/loongarch: Add some devices support for 3A5000.

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: 1.Add uart,virtio-net,vga and usb for 3A5000. 2.Add irq set and map for the pci host. Non pci device use irq 0-16, pci device use 16-64. 3.Add some unimplented device to emulate guest unused memory space. Signed-off-by: Xiaojuan Yang Signed-off-by: Song

PING: [PATCH] KVM: HWPoison: Fix memory address during remap

2022-04-26 Thread zhenwei pi
Hi, Paolo & Peter Could you please review this patch? On 4/20/22 14:45, zhenwei pi wrote: qemu exits during reset with log: qemu-system-x86_64: Could not remap addr: 1000@22001000 Currently, after MCE on RAM of a guest, qemu records a ram_addr only, remaps this address with a fixed

Re: [PATCH v2 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: This patch realize the EIOINTC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig| 3 + hw/intc/loongarch_extioi.c | 483 + hw/intc/meson.build

Re: [PATCH qemu 1/9] target/riscv: rvv: Add mask agnostic for vv instructions

2022-04-26 Thread eop Chen
> > 在 2022/4/27 上午2:20, eop Chen 写道: >> >>> Weiwei Li mailto:liwei...@iscas.ac.cn>> 於 2022年4月26日 >>> 下午4:47 寫道: >>> 在 2022/3/17 下午3:26, ~eopxd 写道: From: Yueh-Ting (eop) Chen This is the first commit regarding the mask agnostic behavior.

Re: [PATCH v2 33/43] hw/intc: Add LoongArch ls7a msi interrupt controller support(PCH-MSI)

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: +static void loongarch_msi_mem_write(void *opaque, hwaddr addr, +uint64_t val, unsigned size) +{ +LoongArchPCHMSI *s = LOONGARCH_PCH_MSI(opaque); +int irq_num = val & 0xff; + +

PING: [PATCH v2 0/2] qga: Support NVMe disk type and SMART

2022-04-26 Thread zhenwei pi
Hi, Markus & Michael Could you please give any hint about this patch? On 4/20/22 10:26, zhenwei pi wrote: v1 -> v2: - Update version from 7.0 to 7.1. v1: - Introduce NVMe type for command 'guest-get-disks'. - Introduce SMART, and implement NVMe SMART for command 'guest-get-disks'.

Re: [PATCH v2 31/43] hw/loongarch: Add LoongArch ipi interrupt support(IPI)

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 2 + hw/intc/Kconfig | 3 + hw/intc/loongarch_ipi.c | 166

Re: [PATCH v2 30/43] hw/loongarch: Add support loongson3 virt machine type.

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: Emulate a 3A5000 board use the new loongarch instruction. 3A5000 belongs to the Loongson3 series processors. The board consists of a 3A5000 cpu model and the virt bridge. The host 3A5000 board is really complicated and contains many functions.Now for the

Re: [PATCH v2 26/43] target/loongarch: Add LoongArch IOCSR instruction

2022-04-26 Thread Richard Henderson
On 4/25/22 02:10, Xiaojuan Yang wrote: This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c| 52 ++ target/loongarch/cpu.h| 25 +++ target/loongarch/disas.c

Re: [PATCH v2 18/26] io: make qio_channel_command_new_pid() static

2022-04-26 Thread Richard Henderson
On 4/26/22 02:27, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The function isn't used outside of qio_channel_command_new_spawn(), which is !win32-specific. Signed-off-by: Marc-André Lureau --- include/io/channel-command.h | 25 - io/channel-command.c

Re: [PATCH v2 17/26] Replace fcntl(0_NONBLOCK) with g_unix_set_fd_nonblocking()

2022-04-26 Thread Richard Henderson
On 4/26/22 02:27, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Suggested-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau --- net/tap-bsd.c | 4 ++-- net/tap-linux.c| 2 +- net/tap-solaris.c | 2 +-

Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-26 Thread liuyd.f...@fujitsu.com
[+cc qemu-trivial] On 4/14/22 8:19 PM, Vivek Goyal wrote: > On Wed, Apr 13, 2022 at 12:20:54PM +0800, Liu Yiding wrote: >> Refer to 26ec190964 virtiofsd: Do not use a thread pool by default >> >> Signed-off-by: Liu Yiding > Looks good. Our default used to be --thread-pool-size=64. But we changed

Re: [PATCH v2 14/26] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC)

2022-04-26 Thread Richard Henderson
On 4/26/22 02:27, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Suggested-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau --- os-posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Richard Henderson -if (pipe(fds) == -1) { +

Re: [PATCH v2 12/26] qga: replace pipe() with g_unix_open_pipe(CLOEXEC)

2022-04-26 Thread Richard Henderson
On 4/26/22 02:27, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Suggested-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau --- qga/commands-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index

Re: [PATCH v2 11/26] util: replace pipe()+cloexec with g_unix_open_pipe()

2022-04-26 Thread Richard Henderson
On 4/26/22 02:27, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Suggested-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau --- util/compatfd.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 10/26] Replace qemu_pipe() with g_unix_open_pipe()

2022-04-26 Thread Richard Henderson
On 4/26/22 02:26, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau GLib g_unix_open_pipe() is essentially like qemu_pipe(), available since 2.30. Signed-off-by: Marc-André Lureau --- include/qemu/osdep.h| 4 qemu-nbd.c | 5 +++--

Re: [PATCH qemu 1/9] target/riscv: rvv: Add mask agnostic for vv instructions

2022-04-26 Thread Weiwei Li
在 2022/4/27 上午2:20, eop Chen 写道: Weiwei Li mailto:liwei...@iscas.ac.cn>> 於 2022年4月26日 下午4:47 寫道: 在 2022/3/17 下午3:26, ~eopxd 写道: From: Yueh-Ting (eop) Chen This is the first commit regarding the mask agnostic behavior. Added option 'rvv_ma_all_1s' to enable the behavior, the option is

Re: [PATCH v2 09/26] block: move fcntl_setfl()

2022-04-26 Thread Richard Henderson
On 4/26/22 02:26, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau It is only used by block/file-posix.c, move it there. Signed-off-by: Marc-André Lureau --- include/sysemu/os-posix.h | 2 -- block/file-posix.c| 15 +++ util/oslib-posix.c| 15

Re: [PATCH v2 08/26] Use g_unix_set_fd_nonblocking()

2022-04-26 Thread Richard Henderson
On 4/26/22 02:26, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau API available since glib 2.30. It also preserves errno. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 2 +- util/event_notifier-posix.c | 6 ++ util/main-loop.c| 2 +- 3 files

Re: [PATCH v2 4/5] target/riscv: Add stimecmp support

2022-04-26 Thread Richard Henderson
On 4/26/22 16:08, Atish Patra wrote: +static RISCVException write_stimecmp(CPURISCVState *env, int csrno, +target_ulong val) +{ +RISCVCPU *cpu = env_archcpu(env); + +if (riscv_cpu_mxl(env) == MXL_RV32) { +uint64_t stimecmp_hi = env->stimecmp >>

Re: [PATCH v2 3/5] hw/intc: Support migration of aclint device

2022-04-26 Thread Richard Henderson
On 4/26/22 16:08, Atish Patra wrote: mtimecmp is part of ACLINT device now. This needs to preserved across migration. Signed-off-by: Atish Patra This must be squashed with patch 1. +.fields = (VMStateField[]) { +VMSTATE_VARRAY_UINT64(timecmp, RISCVAclintMTimerState, And

Re: [PATCH v2 1/5] hw/intc: Move mtimer/mtimecmp to aclint

2022-04-26 Thread Richard Henderson
On 4/26/22 16:08, Atish Patra wrote: @@ -334,7 +334,6 @@ const VMStateDescription vmstate_riscv_cpu = { VMSTATE_UINTTL(env.mscratch, RISCVCPU), VMSTATE_UINT64(env.mfromhost, RISCVCPU), VMSTATE_UINT64(env.mtohost, RISCVCPU), -VMSTATE_UINT64(env.timecmp,

Re: [PATCH v2 2/5] migration: Add 64bit variable array data type

2022-04-26 Thread Richard Henderson
On 4/26/22 16:08, Atish Patra wrote: +.num_offset = vmstate_offset_value(_state, _field_num, uint32_t),\ ... } else if (field->flags & VMS_VARRAY_UINT32) { n_elems = *(uint32_t *)(opaque + field->num_offset); +} else if (field->flags & VMS_VARRAY_UINT64) { +

Re: [PULL 00/13] NBD patches through 2022-04-26

2022-04-26 Thread Richard Henderson
On 4/26/22 13:15, Eric Blake wrote: The following changes since commit 80a172de5592b5c33aa6bc30da6f16c4ad1ae390: Merge tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2022-04-26 07:54:22 -0700) are available in the Git repository at:

Re: [RFC PATCH 6/7] target/ppc: Implemented pmxvf*ger*

2022-04-26 Thread Richard Henderson
On 4/26/22 05:50, Lucas Mateus Castro(alqotel) wrote: +_XX3_NO_P xa xb xt xmsk ymsk Don't create this... +@MMIRR_XX3_NO_P .. .. .. . . xmsk:4 \ +.. ... .. . . ... \ +_XX3_NO_P xb=%xx3_xb xt=%xx3_at just set pmsk=1

Re: [RFC PATCH 5/7] target/ppc: Implemented xvf16ger*

2022-04-26 Thread Richard Henderson
On 4/26/22 05:50, Lucas Mateus Castro(alqotel) wrote: +#define VSXGER16(NAME, ORIG_T, OR_EL) \ +void NAME(CPUPPCState *env, uint32_t a_r, uint32_t b_r, \ + uint32_t at_r, uint32_t mask, uint32_t packed_flags) \ +{

Re: [RFC PATCH 4/7] target/ppc: Implemented xvf*ger*

2022-04-26 Thread Richard Henderson
On 4/26/22 05:50, Lucas Mateus Castro(alqotel) wrote: +#define VSXGER(NAME, TYPE, EL) \ +void NAME(CPUPPCState *env, uint32_t a_r, uint32_t b_r, \ + uint32_t at_r, uint32_t mask, uint32_t packed_flags) \ +{

Re: [RFC PATCH 2/7] target/ppc: Implemented xvi*ger* instructions

2022-04-26 Thread Richard Henderson
On 4/26/22 05:50, Lucas Mateus Castro(alqotel) wrote: +%xx_at 23:3 !function=times_4 +@XX3_at .. ... .. . . ... xt=%xx_at xb=%xx_xb Hmm. Depends, I suppose on whether you want acc[0-7] or vsr[0-28] +/* + * Packed VSX Integer GER Flags + * 00

Re: [PATCH v10 7/7] multifd: Implement zero copy write in multifd migration (multifd-zero-copy)

2022-04-26 Thread Peter Xu
On Tue, Apr 26, 2022 at 08:06:56PM -0300, Leonardo Bras wrote: > Implement zero copy send on nocomp_send_write(), by making use of QIOChannel > writev + flags & flush interface. > > Change multifd_send_sync_main() so flush_zero_copy() can be called > after each iteration in order to make sure all

Re: [PATCH v10 6/7] multifd: Send header packet without flags if zero-copy-send is enabled

2022-04-26 Thread Peter Xu
On Tue, Apr 26, 2022 at 08:06:55PM -0300, Leonardo Bras wrote: > Since d48c3a0445 ("multifd: Use a single writev on the send side"), > sending the header packet and the memory pages happens in the same > writev, which can potentially make the migration faster. > > Using channel-socket as example,

Re: [RFC PATCH 3/4] net: slirp: add support for CFI-friendly timer API

2022-04-26 Thread Samuel Thibault
Paolo Bonzini, le mar. 12 avril 2022 14:13:36 +0200, a ecrit: > libslirp 4.7 introduces a CFI-friendly version of the .timer_new callback. > The new callback replaces the function pointer with an enum; invoking the > callback is done with a new function slirp_handle_timer. > > Support the new API

Re: [RFC PATCH 2/4] net: slirp: switch to slirp_new

2022-04-26 Thread Samuel Thibault
Paolo Bonzini, le mar. 12 avril 2022 14:13:35 +0200, a ecrit: > Replace slirp_init with slirp_new, so that a more recent cfg.version > can be specified. > > Signed-off-by: Paolo Bonzini Reviewed-by: Samuel Thibault > --- > net/slirp.c | 27 +-- > 1 file changed, 21

Re: [RFC PATCH 4/4] net: slirp: allow CFI with libslirp >= 4.7

2022-04-26 Thread Samuel Thibault
Paolo Bonzini, le mar. 12 avril 2022 14:13:37 +0200, a ecrit: > slirp 4.7 introduces a new CFI-friendly timer callback that does > not pass function pointers within libslirp as callbacks for timers. > Check the version number and, if it is new enough, allow using CFI > even with a system libslirp.

[PATCH v2 3/5] hw/intc: Support migration of aclint device

2022-04-26 Thread Atish Patra
mtimecmp is part of ACLINT device now. This needs to preserved across migration. Signed-off-by: Atish Patra --- hw/intc/riscv_aclint.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/intc/riscv_aclint.c b/hw/intc/riscv_aclint.c index 1bddb99bda47..0bbc5e65737e 100644 ---

[PATCH v2 0/5] Implement Sstc extension

2022-04-26 Thread Atish Patra
This series implements Sstc extension[1] which was ratified recently. The first patch is a prepartory patches while PATCH 2 adds stimecmp support while PATCH 3 adds vstimecmp support. This series is based on on top of upstream commit (faee5441a038). The series can also be found at

[PATCH v10 6/7] multifd: Send header packet without flags if zero-copy-send is enabled

2022-04-26 Thread Leonardo Bras
Since d48c3a0445 ("multifd: Use a single writev on the send side"), sending the header packet and the memory pages happens in the same writev, which can potentially make the migration faster. Using channel-socket as example, this works well with the default copying mechanism of sendmsg(), but

[PATCH v2 5/5] target/riscv: Add vstimecmp support

2022-04-26 Thread Atish Patra
vstimecmp CSR allows the guest OS or to program the next guest timer interrupt directly. Thus, hypervisor no longer need to inject the timer interrupt to the guest if vstimecmp is used. This was ratified as a part of the Sstc extension. Signed-off-by: Atish Patra --- target/riscv/cpu.h

[PATCH v2 2/5] migration: Add 64bit variable array data type

2022-04-26 Thread Atish Patra
unsigned 64bit variable array data type support is missing. Add the required code to support it. Signed-off-by: Atish Patra --- include/migration/vmstate.h | 11 +++ migration/vmstate.c | 2 ++ 2 files changed, 13 insertions(+) diff --git a/include/migration/vmstate.h

[PATCH v10 4/7] migration: Add migrate_use_tls() helper

2022-04-26 Thread Leonardo Bras
A lot of places check parameters.tls_creds in order to evaluate if TLS is in use, and sometimes call migrate_get_current() just for that test. Add new helper function migrate_use_tls() in order to simplify testing for TLS usage. Signed-off-by: Leonardo Bras Reviewed-by: Juan Quintela

Re: [RFC PATCH 1/4] net: slirp: introduce a wrapper struct for QemuTimer

2022-04-26 Thread Samuel Thibault
Paolo Bonzini, le mar. 12 avril 2022 14:13:34 +0200, a ecrit: > This struct will be extended in the next few patches to support the > new slirp_handle_timer() call. For that we need to store an additional > "int" for each SLIRP timer, in addition to the cb_opaque. > > Signed-off-by: Paolo

[PATCH v2 1/5] hw/intc: Move mtimer/mtimecmp to aclint

2022-04-26 Thread Atish Patra
Historically, The mtimer/mtimecmp has been part of the CPU because they are per hart entities. However, they actually belong to aclint which is a MMIO device. Move them to the ACLINT device. This also emulates the real hardware more closely. Signed-off-by: Atish Patra ---

Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend

2022-04-26 Thread Jason Gunthorpe
On Tue, Apr 26, 2022 at 02:59:31PM -0600, Alex Williamson wrote: > > The best you could do is make a dummy IOAS then attach the device, > > read the mappings, detatch, and then do your unmaps. > > Right, the same thing the kernel does currently. > > > I'm imagining something like

[PATCH v2 4/5] target/riscv: Add stimecmp support

2022-04-26 Thread Atish Patra
stimecmp allows the supervisor mode to update stimecmp CSR directly to program the next timer interrupt. This CSR is part of the Sstc extension which was ratified recently. Signed-off-by: Atish Patra --- target/riscv/cpu.c | 8 target/riscv/cpu.h | 5 ++

[PATCH v10 3/7] migration: Add zero-copy-send parameter for QMP/HMP for Linux

2022-04-26 Thread Leonardo Bras
Add property that allows zero-copy migration of memory pages on the sending side, and also includes a helper function migrate_use_zero_copy_send() to check if it's enabled. No code is introduced to actually do the migration, but it allow future implementations to enable/disable this feature. On

[PATCH v10 7/7] multifd: Implement zero copy write in multifd migration (multifd-zero-copy)

2022-04-26 Thread Leonardo Bras
Implement zero copy send on nocomp_send_write(), by making use of QIOChannel writev + flags & flush interface. Change multifd_send_sync_main() so flush_zero_copy() can be called after each iteration in order to make sure all dirty pages are sent before a new iteration is started. It will also

[PATCH v10 5/7] multifd: multifd_send_sync_main now returns negative on error

2022-04-26 Thread Leonardo Bras
Even though multifd_send_sync_main() currently emits error_reports, it's callers don't really check it before continuing. Change multifd_send_sync_main() to return -1 on error and 0 on success. Also change all it's callers to make use of this change and possibly fail earlier. (This change is

[PATCH v10 2/7] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-04-26 Thread Leonardo Bras
For CONFIG_LINUX, implement the new zero copy flag and the optional callback io_flush on QIOChannelSocket, but enables it only when MSG_ZEROCOPY feature is available in the host kernel, which is checked on qio_channel_socket_connect_sync() qio_channel_socket_flush() was implemented by counting

[PATCH v10 1/7] QIOChannel: Add flags on io_writev and introduce io_flush callback

2022-04-26 Thread Leonardo Bras
Add flags to io_writev and introduce io_flush as optional callback to QIOChannelClass, allowing the implementation of zero copy writes by subclasses. How to use them: - Write data using qio_channel_writev*(...,QIO_CHANNEL_WRITE_FLAG_ZERO_COPY), - Wait write completion with qio_channel_flush().

[PATCH v10 0/7] MSG_ZEROCOPY + multifd

2022-04-26 Thread Leonardo Bras
This patch series intends to enable MSG_ZEROCOPY in QIOChannel, and make use of it for multifd migration performance improvement, by reducing cpu usage. Patch #1 creates new callbacks for QIOChannel, allowing the implementation of zero copy writing. Patch #2 implements io_writev flags and

Re: [RFC PATCH 1/7] target/ppc: Implement xxm[tf]acc and xxsetaccz

2022-04-26 Thread Richard Henderson
On 4/26/22 05:50, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Implement the following PowerISA v3.1 instructions: xxmfacc: VSX Move From Accumulator xxmtacc: VSX Move To Accumulator xxsetaccz: VSX Set Accumulator to Zero The PowerISA 3.1 mentions that for the

Re: [PATCH v9 7/7] multifd: Implement zero copy write in multifd migration (multifd-zero-copy)

2022-04-26 Thread Leonardo Bras Soares Passos
Hello Peter, thanks for helping! On Tue, Apr 26, 2022 at 1:02 PM Peter Xu wrote: > > Leo, > > This patch looks mostly good to me, a few nitpicks below. > > On Mon, Apr 25, 2022 at 06:50:56PM -0300, Leonardo Bras wrote: [...] > > } > > + > > +/* > > + * When using zero-copy, it's

Re: [PATCH v9 6/7] multifd: Send header packet without flags if zero-copy-send is enabled

2022-04-26 Thread Leonardo Bras Soares Passos
Hello Daniel, thank you for the feedback! On Tue, Apr 26, 2022 at 5:11 AM Daniel P. Berrangé wrote: > > On Mon, Apr 25, 2022 at 06:50:55PM -0300, Leonardo Bras wrote: > > Since d48c3a0445 ("multifd: Use a single writev on the send side"), > > sending the header packet and the memory pages

Re: [PULL 00/68] nios2 patch queue

2022-04-26 Thread Richard Henderson
://gitlab.com/rth7680/qemu.git tags/pull-nios2-20220426 for you to fetch changes up to 7f176c5a0bcb70492f3b158a36311e75f1eb87d7: tests/tcg/nios2: Add test-shadow-1 (2022-04-26 08:17:10 -0700) Fix nios2-linux-user syscalls. Fix nios2-linux

Re: [PATCH v7 08/12] target/riscv: Add sscofpmf extension support

2022-04-26 Thread Atish Patra
On Mon, Apr 18, 2022 at 3:46 PM Alistair Francis wrote: > > On Sat, Apr 16, 2022 at 9:54 AM Atish Kumar Patra wrote: > > > > On Wed, Apr 13, 2022 at 12:08 AM Alistair Francis > > wrote: > > > > > > On Thu, Mar 31, 2022 at 10:19 AM Atish Patra wrote: > > > > > > > > The Sscofpmf ('Ss' for

Re: [PATCH 03/20] target/ppc: Substitute msr_pr macro with new M_MSR_PR macro

2022-04-26 Thread Richard Henderson
On 4/22/22 11:54, Víctor Colombo wrote: Suggested-by: Richard Henderson Signed-off-by: Víctor Colombo --- hw/ppc/pegasos2.c| 2 +- hw/ppc/spapr.c | 2 +- target/ppc/cpu.h | 3 ++- target/ppc/cpu_init.c| 4 ++-- target/ppc/excp_helper.c | 6 +++---

Re: [PATCH 02/20] target/ppc: Remove unused msr_* macros

2022-04-26 Thread Richard Henderson
On 4/22/22 11:54, Víctor Colombo wrote: Some msr_* macros are not used anywhere. Remove them as part of the work to remove all hidden usage of *env. Suggested-by: Richard Henderson Signed-off-by: Víctor Colombo --- target/ppc/cpu.h | 21 - 1 file changed, 21 deletions(-)

Re: [PATCH 01/20] target/ppc: Remove fpscr_* macros from cpu.h

2022-04-26 Thread Richard Henderson
On 4/22/22 11:54, Víctor Colombo wrote: fpscr_* defined macros are hiding the usage of *env behind them. Substitute the usage of these macros with `env->fpscr & FP_*` to make the code cleaner. Suggested-by: Richard Henderson Signed-off-by: Víctor Colombo --- target/ppc/cpu.c| 2 +-

Re: [RFC 15/18] vfio/iommufd: Implement iommufd backend

2022-04-26 Thread Alex Williamson
On Tue, 26 Apr 2022 16:27:03 -0300 Jason Gunthorpe wrote: > On Tue, Apr 26, 2022 at 12:45:41PM -0600, Alex Williamson wrote: > > On Tue, 26 Apr 2022 11:11:56 -0300 > > Jason Gunthorpe wrote: > > > > > On Tue, Apr 26, 2022 at 10:08:30PM +0800, Yi Liu wrote: > > > > > > > > I think it is

Re: [PATCH 00/20] target/ppc: Remove hidden usages of *env

2022-04-26 Thread Richard Henderson
On 4/22/22 11:54, Víctor Colombo wrote: By running the grep command `git grep -nr 'define \(fpscr\|msr\)_[a-z0-9]\+\>'` we can find multiple macros that use `env->fpscr` and `env->msr` but doesn't take *env as a parameter. Richard Henderson said [1] that these macros hiding the usage of *env

Re: [PATCH v2 02/26] Use QEMU_SANITIZE_ADDRESS

2022-04-26 Thread Richard Henderson
On 4/26/22 02:26, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/qtest/fdc-test.c| 2 +- util/coroutine-ucontext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 01/26] Use QEMU_SANITIZE_THREAD

2022-04-26 Thread Richard Henderson
On 4/26/22 02:26, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/qemu/atomic.h| 8 +--- subprojects/libvhost-user/include/compiler.h | 1 + 2 files changed, 6

Re: [PATCH 6/9] docs: move replay docs to docs/system/replay.rst

2022-04-26 Thread Richard Henderson
On 4/22/22 04:53, Pavel Dovgalyuk wrote: This patch adds replay description page, converting prior text from docs/replay.txt. The text was also updated and some sections were moved to devel part of the docs. Signed-off-by: Pavel Dovgalyuk --- docs/devel/replay.rst | 264

Re: [PATCH 5/9] docs: convert docs/devel/replay page to rst

2022-04-26 Thread Richard Henderson
On 4/22/22 04:53, Pavel Dovgalyuk wrote: This patch converts prior .txt replay devel documentation to .rst. Signed-off-by: Pavel Dovgalyuk --- docs/devel/index-tcg.rst |2 ++ docs/devel/replay.rst| 54 ++ docs/devel/replay.txt| 46

Re: [PATCH 4/9] replay: simplify async event processing

2022-04-26 Thread Richard Henderson
On 4/22/22 04:53, Pavel Dovgalyuk wrote: static Event *replay_read_event(void) { Event *event; +int event_kind = replay_state.data_kind - EVENT_ASYNC; Use the enum type. +/* Asynchronous events IDs */ + +enum ReplayAsyncEventKind { +REPLAY_ASYNC_EVENT_BH, +

Re: [PATCH 10/26] nbd: add missing coroutine_fn annotations

2022-04-26 Thread Eric Blake
On Fri, Apr 15, 2022 at 03:18:44PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > block/nbd.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) As elsewhere in this series, a non-empty commit body would be useful. Reviewed-by: Eric Blake > > diff --git

[PULL 10/13] nbd: move s->state under requests_lock

2022-04-26 Thread Eric Blake
From: Paolo Bonzini Remove the confusing, and most likely wrong, atomics. The only function that used to be somewhat in a hot path was nbd_client_connected(), but it is not anymore after the previous patches. The same logic is used both to check if a request had to be reissued and also in

[PULL 03/13] iotests/223: check new possibility of exporting bitmaps by node/name

2022-04-26 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Add simple test that new interface introduced in previous commit works. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20220314213226.362217-4-v.sementsov...@mail.ru> [eblake: Adjust S-o-b to Vladimir's new email, with permission] Reviewed-by: Eric

[PULL 07/13] nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection

2022-04-26 Thread Eric Blake
From: Paolo Bonzini Elevate s->in_flight early so that other incoming requests will wait on the CoQueue in nbd_co_send_request; restart them after getting back from nbd_reconnect_attempt. This could be after the reconnect timer or nbd_cancel_in_flight have cancelled the attempt, so there is no

[PULL 13/13] qemu-nbd: Pass max connections to blockdev layer

2022-04-26 Thread Eric Blake
The next patch wants to adjust whether the NBD server code advertises MULTI_CONN based on whether it is known if the server limits to exactly one client. For a server started by QMP, this information is obtained through nbd_server_start (which can support more than one export); but for qemu-nbd

[PULL 01/13] qapi: rename BlockDirtyBitmapMergeSource to BlockDirtyBitmapOrStr

2022-04-26 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Rename the type to be reused. Old name is "what is it for". To be natively reused for other needs, let's name it exactly "what is it". Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20220314213226.362217-2-v.sementsov...@mail.ru> [eblake: Adjust

[PULL 05/13] nbd: mark more coroutine_fns

2022-04-26 Thread Eric Blake
From: Paolo Bonzini Several coroutine functions in block/nbd.c are not marked as such. This patch adds a few more markers; it is not exhaustive, but it focuses especially on: - places that wake other coroutines, because aio_co_wake() has very different semantics inside a coroutine (queuing

[PULL 06/13] nbd: remove peppering of nbd_client_connected

2022-04-26 Thread Eric Blake
From: Paolo Bonzini It is unnecessary to check nbd_client_connected() because every time s->state is moved out of NBD_CLIENT_CONNECTED the socket is shut down and all coroutines are resumed. The only case where it was actually needed is when the NBD server disconnects and there is no

  1   2   3   4   5   >