[PULL 37/53] build-sys: drop ntddscsi.h check

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau The header has been part of MinGW-w64 since the introduction of the project (2007). While on MinGW(32), the legacy project, it was imported in 2014 from w32api-3.17 (commit e4803e0da2). According to build-platform.rst and our CI coverage, we only support building with Min

[PULL 31/53] include: move os_*() to os-foo.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau For consistency with other os_ functions that do not have POSIX implementation, declare an inline function for the stub in os-win32.h. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-27-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini ---

[PULL 40/53] thread-posix: remove the posix semaphore support

2022-04-18 Thread Paolo Bonzini
From: "Longpeng(Mike)" POSIX specifies an absolute time for sem_timedwait(), it would be affected if the system time is changing, but there is not a relative time or monotonic clock version of sem_timedwait, so we cannot gain from POSIX semaphore any more. An alternative way is to use sem_trywai

[PULL 34/53] Move fcntl_setfl() to oslib-posix

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau It is only implemented for POSIX anyway. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-30-marcandre.lur...@redhat.com> [Add braces around if statements. - Paolo] Signed-off-by: Paolo Bonzini --- include/qemu/cutils

[PULL 41/53] thread-posix: use monotonic clock for QemuCond and QemuSemaphore

2022-04-18 Thread Paolo Bonzini
From: "Longpeng(Mike)" Use CLOCK_MONOTONIC, so the timeout isn't affected by changes to the system time. It depends on the pthread_condattr_setclock(), while some systems(e.g. mac os) does not support it, so the behavior won't change in these systems. Signed-off-by: Longpeng(Mike) Message-Id: <

[PULL 24/53] include: move coroutine IO functions to coroutine.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-20-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu-common.h| 23 --- include/qemu/coroutine.h | 23 +++ 2 files changed, 23 insert

[PULL 47/53] hw: hyperv: Initial commit for Synthetic Debugging device

2022-04-18 Thread Paolo Bonzini
From: Jon Doron Signed-off-by: Jon Doron Reviewed-by: Emanuele Giuseppe Esposito Message-Id: <20220216102500.692781-5-ari...@gmail.com> Signed-off-by: Paolo Bonzini --- hw/hyperv/Kconfig | 5 + hw/hyperv/meson.build | 1 + hw/hyperv/syndbg.c| 402 ++

[PULL 16/53] Replace qemu_real_host_page variables with inlined functions

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Replace the global variables with inlined helper functions. getpagesize() is very likely annotated with a "const" function attribute (at least with glibc), and thus optimization should apply even better. This avoids the need for a constructor initialization too. Signed

[PULL 29/53] include: move progress API to qemu-progress.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-25-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu-common.h| 4 include/qemu/qemu-progress.h | 8 qemu-img.c | 1 + util/qemu-progress

[PULL 39/53] whpx: Added support for breakpoints and stepping

2022-04-18 Thread Paolo Bonzini
From: Ivan Shcherbakov Below is the updated version of the patch adding debugging support to WHPX. It incorporates feedback from Alex Bennée and Peter Maydell regarding not changing the emulation logic depending on the gdb connection status. Instead of checking for an active gdb connection to de

[PULL 32/53] include: move page_size_init() to include/hw/core/cpu.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-28-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/hw/core/cpu.h | 2 ++ include/qemu-common.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/co

[PULL 28/53] include: move target page bits declaration to page-vary.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Since the implementation unit is page-vary.c. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-24-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/exec/page-vary.h | 18 ++ include

[PULL 20/53] error-report: use error_printf() for program prefix

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau For consistency with other calls in the function, let's use error_printf(). (it will use stderr since !monitor_cur()) Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-16-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- util/error-report

[PULL 21/53] include: move TFR to osdep.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau The macro requires EINTR, which has its header included in osdep.h. (Not sure what TFR stands for, perhaps "Test For Retry". Rename it ?) Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-17-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini -

[PULL 23/53] include: move qemu_pipe() to osdep.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-19-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu-common.h | 4 include/qemu/osdep.h | 4 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/q

[PULL 27/53] include: move cpu_exec* declarations to cpu-common.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-23-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/exec/cpu-common.h | 3 +++ include/qemu-common.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc

[PULL 26/53] include: move C/util-related declarations to cutils.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-22-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/dma/xlnx_dpdma.c| 2 +- hw/usb/ccid-card-passthru.c| 2 +- hw/usb/dev-smartcard-reader.c | 2 +- hw/usb/redirect.

[PULL 12/53] Replace TARGET_WORDS_BIGENDIAN

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Convert the TARGET_WORDS_BIGENDIAN macro, similarly to what was done with HOST_BIG_ENDIAN. The new TARGET_BIG_ENDIAN macro is either 0 or 1, and thus should always be defined to prevent misuse. Signed-off-by: Marc-André Lureau Suggested-by: Halil Pasic Reviewed-by: Rich

[PULL 19/53] util: rename qemu-error.c to match its header name

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau The header name is more appropriate. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-15-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- util/{qemu-error.c => error-report.c} | 0 util/meson.build

[PULL 18/53] error-report: replace deprecated g_get_current_time() with glib >= 2.62

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau According to GLib API: g_get_current_time has been deprecated since version 2.62 and should not be used in newly-written code. GTimeVal is not year-2038-safe. Use g_get_real_time() instead. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-14-marcandre

[PULL 17/53] qga: replace deprecated g_get_current_time()

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau According to GLib API: g_get_current_time has been deprecated since version 2.62 and should not be used in newly-written code. GTimeVal is not year-2038-safe. Use g_get_real_time() instead. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-13-marcandre

[PULL 25/53] include: move dump_in_progress() to runstate.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Along with other state tracking functions. Rename it for consistency. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-21-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- dump/dump.c | 4 ++-- include/qemu-common.h | 4

[PULL 07/53] meson: add util dependency for oslib-posix on freebsd

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau kinfo_getproc() requires it. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-3-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- util/meson.build | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/meson.build

[PULL 22/53] include: move qemu_write_full() declaration to osdep.h

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Closer to other IO functions. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-18-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu-common.h | 3 --- include/qemu/osdep.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletio

[PULL 13/53] osdep: poison {HOST,TARGET}_WORDS_BIGENDIAN

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Suggested-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-9-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 12 +

[PULL 10/53] char: move qemu_openpty_raw from util/ to char/

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau It is only needed by char-pty. Fix the code style while at it. Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-6-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- chardev/char-pty.c| 111 + chardev/m

[PULL 11/53] Replace config-time define HOST_WORDS_BIGENDIAN

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad usage, if the config header wasn't included before. Th

[PULL 15/53] tests: replace free_all() usage with g_auto

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Use more idiomatic glib/auto-style code. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-11-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- tests/unit/check-qobject.c | 127 -

[PULL 08/53] meson: remove unneeded py3

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-4-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- tests/meson.build | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 1d05109eb4..4f691e8465

[PULL for-7.1 00/53] Misc pull request for QEMU 7.1

2022-04-18 Thread Paolo Bonzini
The following changes since commit f53faa70bb63cc0c8e2fd0752b7ad2c8a79616ba: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-04-05 16:14:28 +0100) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fetch c

[PULL 09/53] meson: remove test-qdev-global-props dependency on testqapi

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20220323155743.1585078-5-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- tests/unit/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/meson.build b/tests/unit/meson.buil

[PULL 14/53] include/qapi: add g_autoptr support for qobject types

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau Need wrappers for qobject_unref() calls, which is a macro. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-10-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include/qapi

[PULL 06/53] meson: use chardev_ss dependencies

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau chardev subsystem/library doesn't use gnutls. Use the dedicated chardev_ss.dependencies() instead. Looking at history, it was added in commit 3eacf70bb5a83e ("meson: Propagate gnutls dependency") because crypto/tlscreds.h included GnuTLS. This was cleaned-up later by comm

[PULL 02/53] qtest: replace gettimeofday with GTimer

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau glib provides a convenience helper to measure elapsed time. It isn't subject to wall-clock time changes. Note that this changes the initial OPENED time, which used to print the current time. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier Message-Id: <2022

[PULL 03/53] qga: replace qemu_gettimeofday() with g_get_real_time()

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau GLib g_get_real_time() is an alternative to gettimeofday() which allows to simplify our code. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth Message-Id: <20220307070401.171986-4-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bo

[PULL 01/53] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-04-18 Thread Paolo Bonzini
From: Dov Murik Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP command. The value of the field is the base64-encoded unique ID of CPU0 (socket 0), which can be used to retrieve the signed CEK of the CPU from AMD's Key Distribution Service (KDS). Signed-off-by: Dov Murik

[PULL 05/53] oslib: drop qemu_gettimeofday()

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau No longer used after the previous patches. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier Reviewed-by: Stefan Weil Reviewed-by: Richard Henderson Message-Id: <20220307070401.171986-6-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini --- include

[PULL 04/53] Replace qemu_gettimeofday() with g_get_real_time()

2022-04-18 Thread Paolo Bonzini
From: Marc-André Lureau GLib g_get_real_time() is an alternative to gettimeofday() which allows to simplify our code. For semihosting, a few bits are lost on POSIX host, but this shouldn't be a big concern. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier Message-Id: <202203070704

Re: [PATCH] target/riscv: Support configuarable marchid, mvendorid, mipid CSR values

2022-04-18 Thread Anup Patel
On Tue, Apr 19, 2022 at 10:52 AM Alistair Francis wrote: > > On Fri, Apr 15, 2022 at 7:37 PM wrote: > > > > From: Frank Chang > > > > Allow user to set core's marchid, mvendorid, mipid CSRs through > > -cpu command line option. > > > > Signed-off-by: Frank Chang > > Reviewed-by: Jim Shu > > --

Re: [PATCH] target/riscv: Support configuarable marchid, mvendorid, mipid CSR values

2022-04-18 Thread Alistair Francis
On Fri, Apr 15, 2022 at 7:37 PM wrote: > > From: Frank Chang > > Allow user to set core's marchid, mvendorid, mipid CSRs through > -cpu command line option. > > Signed-off-by: Frank Chang > Reviewed-by: Jim Shu > --- > target/riscv/cpu.c | 4 > target/riscv/cpu.h | 4 > target/risc

Re: [PATCH qemu v7 02/14] target/riscv: rvv: Rename ambiguous esz

2022-04-18 Thread Alistair Francis
On Wed, Mar 30, 2022 at 8:30 PM ~eopxd wrote: > > From: eopXD > > No functional change intended in this commit. > > Signed-off-by: eop Chen > Reviewed-by: Frank Chang Reviewed-by: Alistair Francis Alistair > --- > target/riscv/vector_helper.c | 76 ++-- > 1

Re: [PATCH v2 1/6] hw/riscv: virt: Add a machine done notifier

2022-04-18 Thread Alistair Francis
On Sat, Apr 16, 2022 at 1:25 AM Andrew Bresticker wrote: > > Hi Alistair, > > On Wed, Apr 6, 2022 at 10:05 PM Alistair Francis > wrote: > > > > From: Alistair Francis > > > > Move the binary and device tree loading code to the machine done > > notifier. This allows us to prepare for editing the

Re: [PATCH qemu v7 01/14] target/riscv: rvv: Prune redundant ESZ, DSZ parameter passed

2022-04-18 Thread Alistair Francis
On Wed, Mar 30, 2022 at 8:50 PM ~eopxd wrote: > > From: eopXD > > No functional change intended in this commit. > > Signed-off-by: eop Chen > Reviewed-by: Frank Chang Reviewed-by: Alistair Francis Alistair > --- > target/riscv/vector_helper.c | 1132 +- > 1

Re: [PATCH] target/riscv/pmp: fix NAPOT range computation overflow

2022-04-18 Thread Alistair Francis
On Sat, Apr 9, 2022 at 2:25 AM Nicolas Pitre wrote: > > There is an overflow with the current code where a pmpaddr value of > 0x1fff is decoded as sa=0 and ea=0 whereas it should be sa=0 and > ea=0x. > > Fix that by simplifying the computation. There is in fact no need for > ctz64() no

Re: [RFC 00/18] vfio: Adopt iommufd

2022-04-18 Thread Nicolin Chen
On Sun, Apr 17, 2022 at 12:30:40PM +0200, Eric Auger wrote: > >> - More tests > > I did a quick test on my ARM64 platform, using "iommu=smmuv3" > > string. The behaviors are different between using default and > > using legacy "iommufd=off". > > > > The legacy pathway exits the VM with: > > vf

Re: [PATCH] chardev: avoid use-after-free when client disconnect

2022-04-18 Thread Hogan Wang via
> Hi > > On Mon, Mar 28, 2022 at 12:22 PM Hogan Wang via wrote: > > IOWatchPoll object did not hold the @ioc and @src objects reference, > > then io_watch_poll_prepare execute in IO thread, if IOWatchPoll > > removed by mian thread, io_watch_poll_prepare may execute at last > > chance and access

Re: [PATCH] hw/riscv: virt: fix DT property mmu-type when CPU mmu option is disabled

2022-04-18 Thread Alistair Francis
On Fri, Apr 15, 2022 at 1:56 AM Niklas Cassel via wrote: > > The device tree property "mmu-type" is currently exported as either > "riscv,sv32" or "riscv,sv48". > > However, the riscv cpu device tree binding [1] has a specific value > "riscv,none" for a HART without a MMU. > > Set the device tree

[PATCH v11 12/14] target/riscv: rvk: add CSR support for Zkr

2022-04-18 Thread Weiwei Li
- add SEED CSR which must be accessed with a read-write instruction: A read-only instruction such as CSRRS/CSRRC with rs1=x0 or CSRRSI/CSRRCI with uimm=0 will raise an illegal instruction exception. - add USEED, SSEED fields for MSECCFG CSR Co-authored-by: Ruibo Lu Co-authored-by: Zewen Ye

Re: XIVE VFIO kernel resample failure in INTx mode under heavy load

2022-04-18 Thread Alexey Kardashevskiy
On 14/04/2022 22:31, Cédric Le Goater wrote: Hello Alexey, Thanks for taking over. On 4/13/22 06:56, Alexey Kardashevskiy wrote: On 3/17/22 06:16, Cédric Le Goater wrote: Timothy, On 3/16/22 17:29, Cédric Le Goater wrote: Hello, I've been struggling for some time with what is looki

[PATCH v11 14/14] target/riscv: rvk: expose zbk* and zk* properties

2022-04-18 Thread Weiwei Li
Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 13 + 1 file changed, 13 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 365bdd5fe5..973dd5ea47 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/c

[PATCH v11 10/14] target/riscv: rvk: add support for sha512 related instructions for RV64 in zknh extension

2022-04-18 Thread Weiwei Li
- add sha512sum0, sha512sig0, sha512sum1 and sha512sig1 instructions Co-authored-by: Zewen Ye Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 5 +++ target/riscv/insn_trans/tran

[PATCH v11 13/14] disas/riscv.c: rvk: add disas support for Zbk* and Zk* instructions

2022-04-18 Thread Weiwei Li
Co-authored-by: Ruibo Lu Co-authored-by: Zewen Ye Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Alistair Francis --- disas/riscv.c | 173 +- 1 file changed, 172 insertions(+), 1 deletion(-) diff --git a/disas/riscv.c b/disa

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

2022-04-18 Thread yangxiaojuan
On 2022/4/18 下午4:57, Mark Cave-Ayland wrote: On 18/04/2022 04:48, Richard Henderson wrote: On 4/15/22 02:40, Xiaojuan Yang wrote: + memory_region_init(&s->mmio[cpu], OBJECT(s), +   "loongarch_extioi", EXTIOI_SIZE); + +    memory_region_init_io(&s->mmio_nodetype[cpu

[PATCH v11 00/14] support subsets of scalar crypto extension

2022-04-18 Thread Weiwei Li
This patchset implements RISC-V scalar crypto extension v1.0.0 version instructions. Partial instructions are reused from B-extension. Specification: https://github.com/riscv/riscv-crypto The port is available here: https://github.com/plctlab/plct-qemu/tree/plct-k-upstream-v11 To test rvk impl

[PATCH v11 09/14] target/riscv: rvk: add support for sha512 related instructions for RV32 in zknh extension

2022-04-18 Thread Weiwei Li
- add sha512sum0r, sha512sig0l, sha512sum1r, sha512sig1l, sha512sig0h and sha512sig1h instructions Co-authored-by: Zewen Ye Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 6 +

[PATCH v11 06/14] target/riscv: rvk: add support for zknd/zkne extension in RV32

2022-04-18 Thread Weiwei Li
- add aes32esmi, aes32esi, aes32dsmi and aes32dsi instructions Co-authored-by: Zewen Ye Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/crypto_helper.c| 105 target/riscv

[PATCH v11 01/14] target/riscv: rvk: add cfg properties for zbk* and zk*

2022-04-18 Thread Weiwei Li
Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Acked-by: Alistair Francis --- target/riscv/cpu.c | 23 +++ target/riscv/cpu.h | 13 + 2 files changed, 36 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index faa41217d2..365bdd5fe5 10064

[PATCH v11 05/14] crypto: move sm4_sbox from target/arm

2022-04-18 Thread Weiwei Li
- share it between target/arm and target/riscv Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson --- crypto/meson.build | 1 + crypto/sm4.c | 49

[PATCH v11 08/14] target/riscv: rvk: add support for sha256 related instructions in zknh extension

2022-04-18 Thread Weiwei Li
- add sha256sig0, sha256sig1, sha256sum0 and sha256sum1 instructions Co-authored-by: Zewen Ye Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/insn32.decode | 5 +++ target/riscv/insn_trans/tran

[PATCH v11 11/14] target/riscv: rvk: add support for zksed/zksh extension

2022-04-18 Thread Weiwei Li
- add sm3p0, sm3p1, sm4ed and sm4ks instructions Co-authored-by: Ruibo Lu Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/crypto_helper.c| 28 target/riscv/helper.h

[PATCH v11 03/14] target/riscv: rvk: add support for zbkc extension

2022-04-18 Thread Weiwei Li
- reuse partial instructions of zbc extension, update extension check for them Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 3 ++- target/riscv/insn_trans/trans_rvb.c.inc | 4 +

[PATCH v11 07/14] target/riscv: rvk: add support for zkne/zknd extension in RV64

2022-04-18 Thread Weiwei Li
- add aes64dsm, aes64ds, aes64im, aes64es, aes64esm, aes64ks2, aes64ks1i instructions Co-authored-by: Ruibo Lu Co-authored-by: Zewen Ye Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson Acked-by: Alistair Francis --- target/riscv/crypto_helper.c

[PATCH v11 02/14] target/riscv: rvk: add support for zbkb extension

2022-04-18 Thread Weiwei Li
- reuse partial instructions of zbb extension, update extension check for them - add brev8, pack, packh, packw, unzip, zip instructions Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Acked-by: Alistair Francis Reviewed-by: Richard Henderson --- target/riscv/bitmanip_helper.c

[PATCH v11 04/14] target/riscv: rvk: add support for zbkx extension

2022-04-18 Thread Weiwei Li
- add xperm4 and xperm8 instructions Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Richard Henderson Acked-by: Alistair Francis --- target/riscv/bitmanip_helper.c | 27 + target/riscv/helper.h | 2 ++ target/riscv/insn3

Re: [RFC PATCH v3 2/5] ppc64: Fix semihosting on ppc64le

2022-04-18 Thread Richard Henderson
On 4/18/22 12:10, Leandro Lupori wrote: +static inline uint64_t sh_swap64(CPUArchState *env, uint64_t val) +{ +return msr_le ? val : tswap64(val); +} + +static inline uint32_t sh_swap32(CPUArchState *env, uint32_t val) +{ +return msr_le ? val : tswap32(val); +} That doesn't work -- tswa

Re: [PATCH 2/2] Use io_ring_register_ring_fd() to skip fd operations

2022-04-18 Thread olc
Thanks for noticing the problem. I've done that. Sam Damien Le Moal 于2022年4月19日周二 06:24写道: > On 2022/04/18 18:05, Sam Li wrote: > > fix code style issue. > > This patch must be squashed into the previous one. > > > > > Signed-off-by: Sam Li > > --- > > block/io_uring.c | 9 +++-- > > 1 fi

[PATCH v3] Use io_uring_register_ring_fd() to skip fd operations

2022-04-18 Thread Sam Li
Linux recently added a new io_uring(7) optimization API that QEMU doesn't take advantage of yet. The liburing library that QEMU uses has added a corresponding new API calling io_uring_register_ring_fd(). When this API is called after creating the ring, the io_uring_submit() library function passes

Re: [RFC PATCH v3 1/5] ppc64: Add semihosting support

2022-04-18 Thread Richard Henderson
On 4/18/22 12:10, Leandro Lupori wrote: Add semihosting support for PPC64. This implementation is based on the standard for ARM semihosting version 2.0, as implemented by QEMU and documented in https://github.com/ARM-software/abi-aa/releases The PPC64 specific differences are the following

Re: [PATCH 2/4] TCG support for AVX

2022-04-18 Thread Richard Henderson
On 4/18/22 12:45, Paul Brook wrote: Unfortunately the table driven decoding means that going from two to three operands tends to be a bit all or nothing just to get the thing to compile. Yes, gen_sse is awful. Which is why the previous attempt at AVX2 rewrote the decoder: https://lore.kernel

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

2022-04-18 Thread Alistair Francis
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 Privileged arch and Supervisor-level extensions, > > > and 'cofpmf' for Count Ov

Re: [RFC PATCH v3 3/5] tests/tcg/ppc64: Add basic softmmu test support

2022-04-18 Thread Daniel Henrique Barboza
On 4/18/22 17:27, Cédric Le Goater wrote: On 4/18/22 21:10, Leandro Lupori wrote: Add support to build and run the multiarch hello test, that simply prints a message and exits, through semihosting operations. The linker script was imported from https://github.com/legoater/pnv-test, that are

[PATCH v3 12/12] iotests: make qemu_io_log() check return codes by default

2022-04-18 Thread John Snow
Just like qemu_img_log(), upgrade qemu_io_log() to enforce a return code of zero by default. Tests that use qemu_io_log(): 242 245 255 274 303 307 nbd-reconnect-on-open Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py

[PATCH v3 03/12] iotests: Don't check qemu_io() output for specific error strings

2022-04-18 Thread John Snow
A forthcoming commit updates qemu_io() to raise an exception on non-zero return by default, and changes its return type. In preparation, simplify some calls to qemu_io() that assert that specific error message strings do not appear in qemu-io's output. Asserting that all of these calls return a st

[PATCH v3 10/12] iotests: remove qemu_io_pipe_and_status()

2022-04-18 Thread John Snow
I know we just added it, sorry. This is done in favor of qemu_io() which *also* returns the console output and status, but with more robust error handling on failure. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 3 --- 1 file cha

[PATCH v3 11/12] iotests: remove qemu_io_silent() and qemu_io_silent_check().

2022-04-18 Thread John Snow
Like qemu-img, qemu-io returning 0 should be the norm and not the exception. Remove all calls to qemu_io_silent that just assert the return code is zero (That's every last call, as it turns out), and replace them with a normal qemu_io() call. qemu_io_silent_check() appeared to have been unused alr

[PATCH v3 00/12] iotests: add enhanced debugging info to qemu-io failures

2022-04-18 Thread John Snow
GitLab: https://gitlab.com/jsnow/qemu/-/commits/iotests_qemu_io_diagnostics Howdy, This series does for qemu_io() what we've done for qemu_img() and makes it a function that checks the return code by default and raises an Exception when things do not go according to plan. This series removes qem

[PATCH v3 06/12] iotests: create generic qemu_tool() function

2022-04-18 Thread John Snow
reimplement qemu_img() in terms of qemu_tool() in preparation for doing the same with qemu_io(). Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-)

[PATCH v3 08/12] iotests/migration-permissions: use assertRaises() for qemu_io() negative test

2022-04-18 Thread John Snow
Modify this test to use assertRaises for its negative testing of qemu_io. If the exception raised does not match the one we tell it to expect, we get *that* exception unhandled. If we get no exception, we get a unittest assertion failure and the provided emsg printed to screen. If we get the Calle

[PATCH v3 05/12] iotests/040: Fix TestCommitWithFilters test

2022-04-18 Thread John Snow
Without this change, asserting that qemu_io always returns 0 causes this test to fail in a way we happened not to be catching previously: qemu.utils.VerboseProcessError: Command '('/home/jsnow/src/qemu/bin/git/tests/qemu-iotests/../../qemu-io', '--cache', 'writeback', '--aio', 'threads', '-f'

[PATCH v3 07/12] iotests: rebase qemu_io() on top of qemu_tool()

2022-04-18 Thread John Snow
Rework qemu_io() to be analogous to qemu_img(); a function that requires a return code of zero by default unless disabled explicitly. Tests that use qemu_io(): 030 040 041 044 055 056 093 124 129 132 136 148 149 151 152 163 165 205 209 219 236 245 248 254 255 257 260 264 280 298 300 302 304 image-

[PATCH v3 04/12] iotests/040: Don't check image pattern on zero-length image

2022-04-18 Thread John Snow
qemu-io fails on read/write beyond end-of-file on raw images, so skip these invocations when running the zero-length image tests. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/040 | 14 -- 1 file changed, 12 insertions(+), 2 deleti

[PATCH v3 09/12] iotests/image-fleecing: switch to qemu_io()

2022-04-18 Thread John Snow
This test expects failure ... but only sometimes. When? Why? It's for reads of a region not defined by a bitmap. Adjust the test to be more explicit about what it expects to fail and why. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/tests/im

[PATCH v3 01/12] iotests: replace calls to log(qemu_io(...)) with qemu_io_log()

2022-04-18 Thread John Snow
This makes these callsites a little simpler, but the real motivation is a forthcoming commit will change the return type of qemu_io(), so removing users of the return value now is helpful. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/242 | 6

[PATCH v3 02/12] iotests/163: Fix broken qemu-io invocation

2022-04-18 Thread John Snow
The 'read' commands to qemu-io were malformed, and this invocation only worked by coincidence because the error messages were identical. Oops. There's no point in checking the patterning of the reference image, so just check the empty image by itself instead. (Note: as of this commit, nothing act

Re: [RFC PATCH v3 3/5] tests/tcg/ppc64: Add basic softmmu test support

2022-04-18 Thread Cédric Le Goater
On 4/18/22 21:10, Leandro Lupori wrote: Add support to build and run the multiarch hello test, that simply prints a message and exits, through semihosting operations. The linker script was imported from https://github.com/legoater/pnv-test, that are the Microwatt tests adapted to use a PowerNV c

Re: [RFC PATCH v3 1/5] ppc64: Add semihosting support

2022-04-18 Thread Cédric Le Goater
On 4/18/22 21:10, Leandro Lupori wrote: Add semihosting support for PPC64. This implementation is based on the standard for ARM semihosting version 2.0, as implemented by QEMU and documented in https://github.com/ARM-software/abi-aa/releases The PPC64 specific differences are the following

Re: [PATCH 2/4] TCG support for AVX

2022-04-18 Thread Peter Maydell
On Mon, 18 Apr 2022 at 20:45, Paul Brook wrote: > > On Mon, 2022-04-18 at 20:33 +0100, Peter Maydell wrote: > > On Mon, 18 Apr 2022 at 18:48, Paul Brook wrote: > > > > > > Add TCG translation of guest AVX/AVX2 instructions > > > This comprises: > > > > > > > Massively too large for a single patch

Re: [PATCH 2/4] TCG support for AVX

2022-04-18 Thread Paul Brook
On Mon, 2022-04-18 at 20:33 +0100, Peter Maydell wrote: > On Mon, 18 Apr 2022 at 18:48, Paul Brook wrote: > > > > Add TCG translation of guest AVX/AVX2 instructions > > This comprises: > > > > Massively too large for a single patch, I'm afraid. This needs > to be split, probably into at least t

Re: [PATCH 2/4] TCG support for AVX

2022-04-18 Thread Peter Maydell
On Mon, 18 Apr 2022 at 18:48, Paul Brook wrote: > > Add TCG translation of guest AVX/AVX2 instructions > This comprises: > > * VEX encodings of most (all?) "legacy" SSE operations. > These typically add an extra source operand, and clear the unused half > of the destination register (SSE encod

[RFC PATCH v3 4/5] tests/tcg/ppc64: Add MMU test sources

2022-04-18 Thread Leandro Lupori
Add MMU test sources, from https://github.com/legoater/pnv-test, based on Microwatt tests but with some adaptations. In particular, the tests that check updates to RC bits were removed, because, apparently, Microwatt never updates RC bits, but just raise an exception when they must be updated, lea

[RFC PATCH v3 5/5] tests/tcg/ppc64: Build PowerNV and LE tests

2022-04-18 Thread Leandro Lupori
Each Microwatt/PowerNV test use its own head.S file and thus needs different build rules. Also add rules to build and run all tests in LE mode. Signed-off-by: Leandro Lupori --- tests/tcg/ppc64/Makefile.softmmu-rules | 34 +++ tests/tcg/ppc64/Makefile.softmmu-target | 121

[RFC PATCH v3 2/5] ppc64: Fix semihosting on ppc64le

2022-04-18 Thread Leandro Lupori
PPC64 CPUs can change its endian dynamically, so semihosting code must check its MSR at run time to determine if byte swapping is needed. Signed-off-by: Leandro Lupori --- include/exec/softmmu-semi.h | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/inc

[RFC PATCH v3 1/5] ppc64: Add semihosting support

2022-04-18 Thread Leandro Lupori
Add semihosting support for PPC64. This implementation is based on the standard for ARM semihosting version 2.0, as implemented by QEMU and documented in https://github.com/ARM-software/abi-aa/releases The PPC64 specific differences are the following: Semihosting Trap Instruction: sc 7 Opera

[RFC PATCH v3 3/5] tests/tcg/ppc64: Add basic softmmu test support

2022-04-18 Thread Leandro Lupori
Add support to build and run the multiarch hello test, that simply prints a message and exits, through semihosting operations. The linker script was imported from https://github.com/legoater/pnv-test, that are the Microwatt tests adapted to use a PowerNV console. Boot.S code was inspired on mmu/he

[RFC PATCH v3 0/5] Port PPC64/PowerNV MMU tests to QEMU

2022-04-18 Thread Leandro Lupori
Changes from v2: - Added semihosting support for ppc64 - Use semihosting calls to exit tests, instead of using Processor Attention instruction - Use semihosting calls for console output, instead of programming emulated serial hardware Leandro Lupori (5): ppc64: Add semihosting support ppc64: F

Re: [ANNOUNCE] QEMU 7.0.0-rc4 is now available

2022-04-18 Thread Stefan Weil
Am 13.04.22 um 02:44 schrieb Michael Roth: A note from the maintainer: rc4 contains three fixes for late-breaking security bugs. The plan is to make the final 7.0 release in a week's time on the 19th April, with no further changes, unless we discover some last-minute catastrophic pro

[PATCH 3/4] Enable all x86-64 cpu features in user mode

2022-04-18 Thread Paul Brook
We don't have any migration concerns for usermode emulation, so we may as well enable all available CPU features by default. Signed-off-by: Paul Brook --- linux-user/x86_64/target_elf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/x86_64/target_elf.h b/linux-use

[PATCH 1/4] Add AVX_EN hflag

2022-04-18 Thread Paul Brook
Add a new hflag bit to determine whether AVX instructions are allowed Signed-off-by: Paul Brook --- target/i386/cpu.h| 3 +++ target/i386/helper.c | 12 target/i386/tcg/fpu_helper.c | 1 + 3 files changed, 16 insertions(+) diff --git a/target/i386/cpu.h b/targ

[PATCH 0/3] AVX guest implementation

2022-04-18 Thread Paul Brook
Patch series to implement AXV/AVX2 guest support in TCG. All the system level code for this (cpid, xsave, wider registers, etc) already exists, we just need to implement the instruction translation. The majority of the new 256-bit operations operate on each 128-bit "lane" independently, so in the

[PATCH for-7.1 06/10] target/ppc: Implement mffscdrn[i] instructions

2022-04-18 Thread Víctor Colombo
Signed-off-by: Víctor Colombo --- target/ppc/insn32.decode | 5 + target/ppc/translate/fp-impl.c.inc | 35 ++ 2 files changed, 40 insertions(+) diff --git a/target/ppc/insn32.decode b/target/ppc/insn32.decode index 177aa49878..e16fad2853 100644 --- a/ta

  1   2   >