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

2022-03-17 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 8380ea409f..dd1d965f88 100644 --- a/target/riscv/cpu.c +++

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

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

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

2022-03-17 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

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

2022-03-17 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 v9 11/14] target/riscv: rvk: add support for zksed/zksh extension

2022-03-17 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 --- target/riscv/crypto_helper.c| 28 target/riscv/helper.h | 3 ++

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

2022-03-17 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

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

2022-03-17 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 v9 10/14] target/riscv: rvk: add support for sha512 related instructions for RV64 in zknh extension

2022-03-17 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 --- target/riscv/insn32.decode | 5 +++ target/riscv/insn_trans/trans_rvk.c.inc | 53

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

2022-03-17 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 v9 07/14] target/riscv: rvk: add support for zkne/zknd extension in RV64

2022-03-17 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 v9 01/14] target/riscv: rvk: add cfg properties for zbk* and zk*

2022-03-17 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 dfcaa26251..8380ea409f

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

2022-03-17 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-v9 To test rvk

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

2022-03-17 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 ++

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

2022-03-17 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 v9 08/14] target/riscv: rvk: add support for sha256 related instructions in zknh extension

2022-03-17 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 +++

Re: [PATCH 3/3] spapr: Move nested KVM hypercalls under a TCG only config.

2022-03-17 Thread David Gibson
On Thu, Mar 17, 2022 at 02:20:49PM -0300, Fabiano Rosas wrote: > These are the spapr virtual hypervisor implementation of the nested > KVM API. They only make sense when running with TCG. > > Signed-off-by: Fabiano Rosas > --- > hw/ppc/spapr_hcall.c | 20 +--- > 1 file changed,

Re: Question about vmstate_register(), dc->vmsd and instance_id

2022-03-17 Thread David Gibson
On Thu, Mar 17, 2022 at 04:29:14PM +, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.mayd...@linaro.org) wrote: > > On Thu, 17 Mar 2022 at 14:03, Daniel Henrique Barboza > > wrote: > > > I've been looking into converting some vmstate_register() calls to use > > > dc->vmsd, > > >

Re: [PATCH 1/3] spapr: Ignore nested KVM hypercalls when not running TCG

2022-03-17 Thread David Gibson
On Thu, Mar 17, 2022 at 02:20:47PM -0300, Fabiano Rosas wrote: > It is possible that nested KVM hypercalls reach QEMU while we're > running KVM. The spapr virtual hypervisor implementation of the nested > KVM API only works when the L1 is running under TCG. So return > H_FUNCTION if we are under

RE: [PULL for-7.0 1/2] aio-posix: fix build failure io_uring 2.2

2022-03-17 Thread Wang, Haiyue
> -Original Message- > From: Daniel P. Berrangé > Sent: Friday, March 18, 2022 01:14 > To: Stefan Hajnoczi > Cc: qemu-devel@nongnu.org; Peter Maydell ; Fam > Zheng ; Paolo > Bonzini ; Wang, Haiyue ; > qemu-bl...@nongnu.org > Subject: Re: [PULL for-7.0 1/2] aio-posix: fix build failure

Re: [PATCH v4 6/7] target/riscv: cpu: Enable native debug feature

2022-03-17 Thread Alistair Francis
On Tue, Mar 15, 2022 at 5:02 PM Bin Meng wrote: > > From: Bin Meng > > Turn on native debug feature by default for all CPUs. > > Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Alistair > --- > > (no changes since v3) > > Changes in v3: > - enable debug feature by default for all CPUs

Re: [PATCH for-7.1] hw: Add compat machines for 7.1

2022-03-17 Thread wangyanan (Y)
On 2022/3/16 22:55, Cornelia Huck wrote: Add 7.1 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck --- hw/arm/virt.c | 9 - hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 14

Re: [PATCH v4 5/7] target/riscv: csr: Hook debug CSR read/write

2022-03-17 Thread Alistair Francis
On Tue, Mar 15, 2022 at 5:08 PM Bin Meng wrote: > > From: Bin Meng > > This adds debug CSR read/write support to the RISC-V CSR RW table. > > Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Alistair > --- > > Changes in v4: > - move riscv_trigger_init() call to riscv_cpu_reset() > >

Re: [PATCH v4 1/7] target/riscv: Add initial support for the Sdtrig extension

2022-03-17 Thread Alistair Francis
On Tue, Mar 15, 2022 at 5:20 PM Bin Meng wrote: > > From: Bin Meng > > This adds initial support for the Sdtrig extension via the Trigger > Module, as defined in the RISC-V Debug Specification [1]. > > Only "Address / Data Match" trigger (type 2) is implemented as of now, > which is mainly used

Re: [RFC PATCH v3 06/36] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2022-03-17 Thread Isaku Yamahata
On Thu, Mar 17, 2022 at 09:58:43PM +0800, Xiaoyao Li wrote: > diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c > index e3b94373b316..bed337e5ba18 100644 > --- a/target/i386/kvm/tdx.c > +++ b/target/i386/kvm/tdx.c > @@ -14,10 +14,77 @@ > #include "qemu/osdep.h" > #include

[PATCH v3] target/riscv: write back unmodified value for csrrc/csrrs with rs1 is not x0 but holding zero

2022-03-17 Thread Weiwei Li
For csrrs and csrrc, if rs1 specifies a register other than x0, holding a zero value, the instruction will still attempt to write the unmodified value back to the csr and will cause side effects Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang v3: * delete change to

Re: [RFC PATCH v3 05/36] i386/tdx: Implement tdx_kvm_init() to initialize TDX VM context

2022-03-17 Thread Isaku Yamahata
On Thu, Mar 17, 2022 at 09:58:42PM +0800, Xiaoyao Li wrote: > Introduce tdx_kvm_init() and invoke it in kvm_confidential_guest_init() > if it's a TDX VM. More initialization will be added later. > > Signed-off-by: Xiaoyao Li > --- > target/i386/kvm/kvm.c | 15 ++- >

[RFC PATCH-for-7.0] hw/i386/amd_iommu: Fix maybe-uninitialized error with GCC 12

2022-03-17 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Initialize 'oldlevel' early to avoid on Debian/sid: FAILED: libqemu-x86_64-softmmu.fa.p/hw_i386_amd_iommu.c.o In function 'pte_get_page_mask', inlined from 'amdvi_page_walk' at hw/i386/amd_iommu.c:945:25, inlined from 'amdvi_do_translate' at

[PATCH] hw/i2c: Enable an id for the pca954x devices

2022-03-17 Thread Patrick Venture
This allows the devices to be more readily found and specified. Without setting the id field, they can only be found by device type name, which doesn't let you specify the second of the same device type behind a bus. Tested: Verified that by default the device was findable with the id

[PATCH v4 13/18] iotests/149: Remove qemu_img_pipe() call

2022-03-17 Thread John Snow
qemu_img_pipe calls blank their output when the command being run is a 'create' call and the command succeeds. Thus, the normative output for this command in iotest 149 is to print a blank line. We can remove the logging from this invocation and use a checked invocation, but we still need to

[PATCH v4 16/18] iotests: replace qemu_img_log('create', ...) calls

2022-03-17 Thread John Snow
qemu_img_log() calls into qemu_img_pipe(), which always removes output for 'create' commands on success anyway. Replace all of these calls to the simpler qemu_img_create(...) which doesn't log, but raises a detailed exception object on failure instead. Blank lines are removed from output files

[PATCH v4 18/18] iotests: make qemu_img_log and img_info_log raise on error

2022-03-17 Thread John Snow
Add a `check: bool = True` parameter to both functions and make their qemu_img() invocations raise on error by default. users of img_info_log: 206, 207, 210, 211, 212, 213, 237, 242, 266, 274, 302 users of qemu_img_log: 044, 209, 274, 302, 304 iotests 242 and 266 need to use check=False for

[PATCH v4 10/18] iotests: add qemu_img_map() function

2022-03-17 Thread John Snow
Add a qemu_img_map() function by analogy with qemu_img_measure(), qemu_img_check(), and qemu_img_info() that all return JSON information. Replace calls to qemu_img_pipe('map', '--output=json', ...) with this new function, which provides better diagnostic information on failure. Note: The output

[PATCH v4 17/18] iotests: remove qemu_img_pipe_and_status()

2022-03-17 Thread John Snow
With the exceptional 'create' calls removed in the prior commit, change qemu_img_log() and img_info_log() to call qemu_img() directly instead. For now, allow these calls to qemu-img to return non-zero on the basis that any unusual output will be logged anyway. The very next commit begins to

[PATCH v4 14/18] iotests: remove remaining calls to qemu_img_pipe()

2022-03-17 Thread John Snow
As part of moving all python iotest invocations of qemu-img onto a single qemu_img() implementation, remove a few lingering uses of qemu_img_pipe() from outside of iotests.py itself. Several cases here rely on the knowledge that qemu_img_pipe() suppresses *all* output on a successful case when

[PATCH v4 09/18] iotests/remove-bitmap-from-backing: use qemu_img_info()

2022-03-17 Thread John Snow
This removes two more usages of qemu_img_pipe() and replaces them with calls to qemu_img(), which provides better diagnostic information on failure. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/tests/remove-bitmap-from-backing | 6 +++--- 1 file changed, 3

[PATCH v4 15/18] iotests: use qemu_img() in has_working_luks()

2022-03-17 Thread John Snow
Admittedly a mostly lateral move, but qemu_img() is essentially the replacement for qemu_img_pipe_and_status(). It will give slightly better diagnostics on crash. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 18 +- 1 file changed, 9

[PATCH v4 06/18] iotests: add qemu_img_json()

2022-03-17 Thread John Snow
qemu_img_json() is a new helper built on top of qemu_img() that tries to pull a valid JSON document out of the stdout stream. In the event that the return code is negative (the program crashed), or the code is greater than zero and did not produce valid JSON output, the VerboseProcessError raised

[PATCH v4 11/18] iotests: change supports_quorum to use qemu_img

2022-03-17 Thread John Snow
Similar to other recent changes: use the qemu_img() invocation that supports throwing loud, nasty exceptions when it fails for surprising reasons. (Why would "--help" ever fail? I don't know, but eliminating *all* calls to qemu-img that do not go through qemu_img() is my goal, so qemu_img_pipe()

[PATCH v4 01/18] python/utils: add add_visual_margin() text decoration utility

2022-03-17 Thread John Snow
>>> print(add_visual_margin(msg, width=72, name="Commit Message")) ┏━ Commit Message ━━ ┃ add_visual_margin() takes a chunk of text and wraps it in a visual ┃ container that force-wraps to a specified width. An optional title ┃ label may be

[PATCH v4 12/18] iotests: replace unchecked calls to qemu_img_pipe()

2022-03-17 Thread John Snow
qemu_img_pipe() discards the return code from qemu-img in favor of returning just its output. Some tests using this function don't save, log, or check the output either, though, which is unsafe. Replace all of these calls with a checked version. Tests affected are 194, 202, 203, 234, 262, and

[PATCH v4 07/18] iotests: use qemu_img_json() when applicable

2022-03-17 Thread John Snow
qemu_img_json() gives better diagnostic information on failure. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index

[PATCH v4 05/18] iotests: fortify compare_images() against crashes

2022-03-17 Thread John Snow
Fortify compare_images() to be more discerning about the status codes it receives. If qemu_img() returns an exit code that implies it didn't actually perform the comparison, treat that as an exceptional circumstance and force the caller to be aware of the peril. If a negative test is desired

[PATCH v4 02/18] python/utils: add VerboseProcessError

2022-03-17 Thread John Snow
This adds an Exception that extends the Python stdlib subprocess.CalledProcessError. The difference is that the str() method of this exception also adds the stdout/stderr logs. In effect, if this exception goes unhandled, Python will print the output in a visually distinct wrapper to the terminal

[PATCH v4 04/18] iotests: make qemu_img raise on non-zero rc by default

2022-03-17 Thread John Snow
re-write qemu_img() as a function that will by default raise a VerboseProcessException (extended from CalledProcessException) on non-zero return codes. This will produce a stack trace that will show the command line arguments and return code from the failed process run. Users that want something

[PATCH v4 03/18] iotests: Remove explicit checks for qemu_img() == 0

2022-03-17 Thread John Snow
qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/163

[PATCH v4 08/18] iotests: add qemu_img_info()

2022-03-17 Thread John Snow
Add qemu_img_info() by analogy with qemu_img_measure() and qemu_img_check(). Modify image_size() to use this function instead to take advantage of the better diagnostic information on failure provided (ultimately) by qemu_img(). Signed-off-by: John Snow Reviewed-by: Hanna Reitz ---

[PATCH v4 00/18] iotests: add enhanced debugging info to qemu-img failures

2022-03-17 Thread John Snow
Hiya! This series effectively replaces qemu_img_pipe_and_status() with a rewritten function named qemu_img() that raises an exception on non-zero return code by default. By the end of the series, every last invocation of the qemu-img binary ultimately goes through qemu_img(). The exception that

Re: [PATCH v3 0/2] target/riscv: Allow software access to MIP SEIP

2022-03-17 Thread Alistair Francis
On Thu, Mar 17, 2022 at 4:18 PM Alistair Francis wrote: > > From: Alistair Francis > > The RISC-V specification states that: > "Supervisor-level external interrupts are made pending based on the > logical-OR of the software-writable SEIP bit and the signal from the > external interrupt

Re: [PATCH-for-7.0 v2] block-qdict: Fix -Werror=maybe-uninitialized build failure

2022-03-17 Thread Philippe Mathieu-Daudé via
On Wed, Mar 16, 2022 at 3:52 PM Markus Armbruster wrote: > > Murilo Opsfelder Araújo writes: > > > Hi, Philippe. > > > > On Monday, March 14, 2022 10:47:11 AM -03 Philippe Mathieu-Daudé wrote: > >> On 11/3/22 23:16, Murilo Opsfelder Araujo wrote: > >> > Building QEMU on Fedora 37 (Rawhide

Re: [PULL 18/30] configure, meson: move guest-agent, tools to meson

2022-03-17 Thread Brad Smith
Trying out 7.0.0-rc0 I noticed after this commit that the guest agent does not build on the BSD's and macOS. From the configure scrip it went from..   elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then   guest_agent=yes to this in meson.build..

Re: [PATCH for-7.1 v6 44/51] target/nios2: Implement EIC interrupt processing

2022-03-17 Thread Richard Henderson
On 3/17/22 12:11, Peter Maydell wrote: +new_status &= ~R_CR_STATUS_CRS_MASK; We're missing the "copy status.CRS to status.PRS" part of taking an exception, I think ? Whoops, yes. r~

Re: [PATCH for-7.1 v6 41/51] target/nios2: Introduce shadow register sets

2022-03-17 Thread Richard Henderson
On 3/17/22 11:33, Peter Maydell wrote: The behaviour of r0 in the shadow register sets is definitely underspecified, but I really don't believe that r0 is a normal writeable register for everything except the crs=0 set, which is what you've implemented here. My best guess is: * registers are

Re: [PATCH v3 0/6] hw/arm: zynqmp: Add CRF and APU control to support PSCI

2022-03-17 Thread Edgar E. Iglesias
On Thu, Mar 17, 2022 at 8:15 PM Peter Maydell wrote: > On Wed, 16 Mar 2022 at 16:46, Edgar E. Iglesias > wrote: > > > > From: "Edgar E. Iglesias" > > > > This adds the necessary modeling to support some of our firmware > > tests at EL3 implementing PSCI (TBM). These are the test-cases > > that

Re: [PATCH v3 0/6] hw/arm: zynqmp: Add CRF and APU control to support PSCI

2022-03-17 Thread Peter Maydell
On Wed, 16 Mar 2022 at 16:46, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > This adds the necessary modeling to support some of our firmware > tests at EL3 implementing PSCI (TBM). These are the test-cases > that were previously relying on QEMU's builtin PSCI emulation. I wouldn't

Re: [PATCH for-7.1 v6 44/51] target/nios2: Implement EIC interrupt processing

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 05:51, Richard Henderson wrote: > > This is the cpu side of the operation. Register one irq line, > called EIC. Split out the rather different processing to a > separate function. > > Delay initialization of gpio irqs until realize. We need to > provide a window after

Re: [PATCH v3 0/1] Patch to adjust coroutine pool size adaptively

2022-03-17 Thread Maxim Levitsky
On Fri, 2022-01-28 at 17:36 +0900, Hiroki Narukawa wrote: > Resending patch with decreasing coroutine pool size on device remove > > We encountered random disk IO performance drop since qemu-5.0.0, and this > patch fixes it. > > Commit message in c740ad92 implied to adjust coroutine pool size

Re: [PATCH for-7.1 v6 41/51] target/nios2: Introduce shadow register sets

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 05:37, Richard Henderson wrote: > > Do not actually enable them so far, but add all of the > plumbing to address them. Do not enable them for user-only. > > Add an env->regs pointer that handles the indirection to > the current register set. The naming of the pointer

Re: [PATCH for-7.1 v6 43/51] target/nios2: Update helper_eret for shadow registers

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 05:56, Richard Henderson wrote: > > When CRS = 0, we restore from estatus; otherwise from sstatus. > Update for the new CRS. > > Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH] block/rbd: fix write zeroes with growing images

2022-03-17 Thread Peter Lieven
> Am 17.03.2022 um 17:26 schrieb Stefano Garzarella : > > Commit d24f80234b ("block/rbd: increase dynamically the image size") > added a workaround to support growing images (eg. qcow2), resizing > the image before write operations that exceed the current size. > > We recently added support

Re: [PULL for-7.0 0/2] Block patches

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 16:57, Stefan Hajnoczi wrote: > > The following changes since commit 1d60bb4b14601e38ed17384277aa4c30c57925d3: > > Merge tag 'pull-request-2022-03-15v2' of https://gitlab.com/thuth/qemu into > staging (2022-03-16 10:43:58 +) > > are available in the Git repository

Re: [PATCH for-7.1 v6 42/51] target/nios2: Implement rdprs, wrprs

2022-03-17 Thread Peter Maydell
On Thu, 17 Mar 2022 at 05:55, Richard Henderson wrote: > > Implement these out of line, so that tcg global temps > (aka the architectural registers) are synced back to > tcg storage as required. This makes sure that we get > the proper results when status.PRS == status.CRS. > > Signed-off-by:

[RFC PATCH v2 18/18] vdpa: Add x-cvq-svq

2022-03-17 Thread Eugenio Pérez
This isolates shadow cvq in its own group. Signed-off-by: Eugenio Pérez --- qapi/net.json| 8 ++- net/vhost-vdpa.c | 179 +++ 2 files changed, 171 insertions(+), 16 deletions(-) diff --git a/qapi/net.json b/qapi/net.json index

Re: [PATCH 14/14] iotests: make img_info_log() call qemu_img_log()

2022-03-17 Thread John Snow
On Thu, Mar 17, 2022 at 2:27 PM Hanna Reitz wrote: > > On 17.03.22 18:45, John Snow wrote: > > On Thu, Mar 17, 2022 at 1:00 PM John Snow wrote: > >> On Thu, Mar 17, 2022 at 11:39 AM Hanna Reitz wrote: > >>> On 09.03.22 04:54, John Snow wrote: > Add configurable filters to qemu_img_log(),

[RFC PATCH v2 17/18] vdpa: Add asid attribute to vdpa device

2022-03-17 Thread Eugenio Pérez
We can configure ASID per group, but we still use asid 0 for every vdpa device. Multiple asid support for cvq will be introduced in next patches. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 3 +++ hw/virtio/vhost-vdpa.c | 47 --

Re: [PATCH 14/14] iotests: make img_info_log() call qemu_img_log()

2022-03-17 Thread Hanna Reitz
On 17.03.22 18:45, John Snow wrote: On Thu, Mar 17, 2022 at 1:00 PM John Snow wrote: On Thu, Mar 17, 2022 at 11:39 AM Hanna Reitz wrote: On 09.03.22 04:54, John Snow wrote: Add configurable filters to qemu_img_log(), and re-write img_info_log() to call into qemu_img_log() with a custom

Re: [PATCH for-7.1] vfio/common: remove spurious tpm-crb-cmd misalignment warning

2022-03-17 Thread Alex Williamson
On Thu, 17 Mar 2022 15:34:53 +0100 Eric Auger wrote: > Hi Alex, > > On 3/17/22 3:23 PM, Alex Williamson wrote: > > On Thu, 17 Mar 2022 14:57:30 +0100 > > Eric Auger wrote: > > > >> Hi Alex, > >> > >> On 3/17/22 12:08 AM, Alex Williamson wrote: > >>> On Wed, 16 Mar 2022 21:29:51 +0100 > >>>

[RFC PATCH v2 11/18] vhost: Add vhost_iova_tree_find

2022-03-17 Thread Eugenio Pérez
Just a simple wrapper so we can find DMAMap entries based on iova Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-iova-tree.h | 2 ++ hw/virtio/vhost-iova-tree.c | 14 ++ 2 files changed, 16 insertions(+) diff --git a/hw/virtio/vhost-iova-tree.h b/hw/virtio/vhost-iova-tree.h

[RFC PATCH v2 16/18] vhost: Update kernel headers

2022-03-17 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- include/standard-headers/linux/vhost_types.h | 11 - linux-headers/linux/vhost.h | 25 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/include/standard-headers/linux/vhost_types.h

[RFC PATCH v2 14/18] vdpa: add NetClientState->start() callback

2022-03-17 Thread Eugenio Pérez
It allows to inject custom code on device success start, right before release lock. Signed-off-by: Eugenio Pérez --- include/net/net.h | 2 ++ hw/net/vhost_net.c | 4 2 files changed, 6 insertions(+) diff --git a/include/net/net.h b/include/net/net.h index 523136c7ac..2fc3002ab4 100644

[RFC PATCH v2 09/18] vhost: Add custom used buffer callback

2022-03-17 Thread Eugenio Pérez
The callback allows SVQ users to know the VirtQueue requests and responses. QEMU can use this to synchronize virtio device model state, allowing to migrate it with minimum changes to the migration code. In the case of networking, this will be used to inspect control virtqueue messages.

[RFC PATCH v2 07/18] virtio: Make virtqueue_alloc_element non-static

2022-03-17 Thread Eugenio Pérez
So SVQ can allocate elements using it Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio.h | 1 + hw/virtio/virtio.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index f095637058..6f4cccfd42 100644

[RFC PATCH v2 13/18] vhost: Add vhost_svq_inject

2022-03-17 Thread Eugenio Pérez
This allows qemu to inject packets to the device without guest's notice. This will be use to inject net CVQ messages to restore status in the destination Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 5 + hw/virtio/vhost-shadow-virtqueue.c | 177

[RFC PATCH v2 06/18] vdpa: Extract get geatures part from vhost_vdpa_get_max_queue_pairs

2022-03-17 Thread Eugenio Pérez
To know the device features is also needed for CVQ SVQ. Extract from vhost_vdpa_get_max_queue_pairs so we can reuse it. Report errno in case of failure getting them while we're at it. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 30 -- 1 file changed, 20

[RFC PATCH v2 15/18] vdpa: Add vhost_vdpa_start_control_svq

2022-03-17 Thread Eugenio Pérez
This will send CVQ commands in the destination machine, seting up everything o there is no guest-visible change. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 63 1 file changed, 63 insertions(+) diff --git a/net/vhost-vdpa.c

[RFC PATCH v2 08/18] vhost: Add SVQElement

2022-03-17 Thread Eugenio Pérez
This allows SVQ to add metadata to the different queue elements Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 8 -- hw/virtio/vhost-shadow-virtqueue.c | 42 -- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git

[RFC PATCH v2 10/18] vdpa: control virtqueue support on shadow virtqueue

2022-03-17 Thread Eugenio Pérez
Introduce the control virtqueue support for vDPA shadow virtqueue. This is needed for advanced networking features like multiqueue. To demonstrate command handling, VIRTIO_NET_F_CTROL_MACADDR is implemented. If vDPA device is started with SVQ support and virtio-net driver changes MAC, virtio-net

[RFC PATCH v2 03/18] vdpa: Fix index calculus at vhost_vdpa_svqs_start

2022-03-17 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index c5ed7a3779..9eeac8fa8e 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -1016,7 +1016,7 @@ static

[RFC PATCH v2 05/18] virtio-net: Expose ctrl virtqueue logic

2022-03-17 Thread Eugenio Pérez
This allows external vhost-net devices to modify the state of the VirtIO device model once vhost-vdpa device has acknowledge the control commands. Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio-net.h | 3 ++ hw/net/virtio-net.c| 82 -- 2

[RFC PATCH v2 12/18] vdpa: Add map/unmap operation callback to SVQ

2022-03-17 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 21 +++-- hw/virtio/vhost-shadow-virtqueue.c | 8 +++- hw/virtio/vhost-vdpa.c | 20 +++- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git

[RFC PATCH v2 00/18] Net Control VQ support with asid in vDPA SVQ

2022-03-17 Thread Eugenio Pérez
Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. Shadow VirtQueue (SVQ) already makes possible migration of virtqueue states, effectively intercepting them so qemu can track what regions of

[RFC PATCH v2 04/18] virtio-net: use g_memdup2() instead of unsafe g_memdup()

2022-03-17 Thread Eugenio Pérez
Fixing that literal checkpatch.pl because it will complain when we modify the file Signed-off-by: Eugenio Pérez --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 2087516253..cb505939b2 100644 ---

[RFC PATCH v2 02/18] vhost: move descriptor translation to vhost_svq_vring_write_descs

2022-03-17 Thread Eugenio Pérez
It's done for both in and out descriptors so it's better placed here. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c

[RFC PATCH v2 01/18] vdpa: Add x-svq to NetdevVhostVDPAOptions

2022-03-17 Thread Eugenio Pérez
Finally offering the possibility to enable SVQ from the command line. Signed-off-by: Eugenio Pérez --- qapi/net.json| 9 - net/vhost-vdpa.c | 48 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/qapi/net.json

Re: [PATCH-for-7.0] ui/cocoa: Respect left-command-key option

2022-03-17 Thread Philippe Mathieu-Daudé
On 17/3/22 16:29, Akihiko Odaki wrote: Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index cb6e7c41dc6..c4e5468f9e6 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -923,7 +923,8 @@ - (bool)

Re: [PATCH 14/14] iotests: make img_info_log() call qemu_img_log()

2022-03-17 Thread John Snow
On Thu, Mar 17, 2022 at 1:00 PM John Snow wrote: > > On Thu, Mar 17, 2022 at 11:39 AM Hanna Reitz wrote: > > > > On 09.03.22 04:54, John Snow wrote: > > > Add configurable filters to qemu_img_log(), and re-write img_info_log() > > > to call into qemu_img_log() with a custom filter instead. > > >

Re: [PATCH for-7.1 v6 39/51] target/nios2: Implement Misaligned destination exception

2022-03-17 Thread Richard Henderson
On 3/17/22 09:37, Peter Maydell wrote: The spec isn't clear about whether an unaligned-destination on an eret is handled as "do the eret (ie restore status), then take the exception when trying to set the new PC" or "take the exception immediately" (ie whether it's always a nested exception,

Re: [PATCH v21 3/7] net/vmnet: implement shared mode (vmnet-shared)

2022-03-17 Thread Vladislav Yaroshchuk
On Thu, Mar 17, 2022 at 6:40 PM Akihiko Odaki wrote: > On 2022/03/17 19:28, Vladislav Yaroshchuk wrote: > > Interaction with vmnet.framework in different modes > > differs only on configuration stage, so we can create > > common `send`, `receive`, etc. procedures and reuse them. > > > >

[PATCH v22 6/7] net/vmnet: update qemu-options.hx

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- qemu-options.hx | 25 + 1 file changed, 25 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 5ce0ada75e..ea00d0eeb6 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2743,6 +2743,25 @@ DEF("netdev", HAS_ARG,

[PATCH v22 7/7] net/vmnet: update hmp-commands.hx

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- hmp-commands.hx | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 8476277aa9..8f3d78f177 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1265,7 +1265,11 @@ ERST { .name

[PATCH v22 3/7] net/vmnet: implement shared mode (vmnet-shared)

2022-03-17 Thread Vladislav Yaroshchuk
Interaction with vmnet.framework in different modes differs only on configuration stage, so we can create common `send`, `receive`, etc. procedures and reuse them. Signed-off-by: Phillip Tennen Signed-off-by: Vladislav Yaroshchuk --- net/vmnet-common.m | 358

[PATCH v22 5/7] net/vmnet: implement bridged mode (vmnet-bridged)

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- net/vmnet-bridged.m | 137 ++-- 1 file changed, 132 insertions(+), 5 deletions(-) diff --git a/net/vmnet-bridged.m b/net/vmnet-bridged.m index 91c1a2f2c7..46d2282863 100644 --- a/net/vmnet-bridged.m +++

[PATCH v22 4/7] net/vmnet: implement host mode (vmnet-host)

2022-03-17 Thread Vladislav Yaroshchuk
Signed-off-by: Vladislav Yaroshchuk --- net/vmnet-host.c | 116 --- 1 file changed, 110 insertions(+), 6 deletions(-) diff --git a/net/vmnet-host.c b/net/vmnet-host.c index a461d507c5..05f8d78864 100644 --- a/net/vmnet-host.c +++ b/net/vmnet-host.c @@

[PATCH v22 2/7] net/vmnet: add vmnet backends to qapi/net

2022-03-17 Thread Vladislav Yaroshchuk
Create separate netdevs for each vmnet operating mode: - vmnet-host - vmnet-shared - vmnet-bridged Acked-by: Markus Armbruster Signed-off-by: Vladislav Yaroshchuk --- net/clients.h | 11 net/meson.build | 7 +++ net/net.c | 10 net/vmnet-bridged.m | 25

[PATCH v22 1/7] net/vmnet: add vmnet dependency and customizable option

2022-03-17 Thread Vladislav Yaroshchuk
vmnet.framework dependency is added with 'vmnet' option to enable or disable it. Default value is 'auto'. used vmnet features are available since macOS 11.0, but new backend can be built and work properly with subset of them on 10.15 too. Signed-off-by: Vladislav Yaroshchuk --- meson.build

[PATCH v22 0/7] Add vmnet.framework based network backend

2022-03-17 Thread Vladislav Yaroshchuk
macOS provides networking API for VMs called 'vmnet.framework': https://developer.apple.com/documentation/vmnet We can provide its support as the new QEMU network backends which represent three different vmnet.framework interface usage modes: * `vmnet-shared`: allows the guest to

[PATCH 3/3] spapr: Move nested KVM hypercalls under a TCG only config.

2022-03-17 Thread Fabiano Rosas
These are the spapr virtual hypervisor implementation of the nested KVM API. They only make sense when running with TCG. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_hcall.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/hw/ppc/spapr_hcall.c

[PATCH 0/3] spapr: Nested TCG is TCG only

2022-03-17 Thread Fabiano Rosas
In a KVM-only scenario that does not support nested KVM, a well written guest would never try to call nested KVM hypercalls. However, if a buggy or malicious guest calls the nested KVM API even without nested KVM support, the L0 would redirect the hypercalls into QEMU. Previously this would have

[PATCH 2/3] spapr: Move hypercall_register_softmmu

2022-03-17 Thread Fabiano Rosas
Need to move this because next patch will add calls to the functions that are below it. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_hcall.c | 50 ++-- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/hw/ppc/spapr_hcall.c

[PATCH 1/3] spapr: Ignore nested KVM hypercalls when not running TCG

2022-03-17 Thread Fabiano Rosas
It is possible that nested KVM hypercalls reach QEMU while we're running KVM. The spapr virtual hypervisor implementation of the nested KVM API only works when the L1 is running under TCG. So return H_FUNCTION if we are under KVM. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_hcall.c | 10

Re: [PATCH for-7.1 v6 26/51] target/nios2: Prevent writes to read-only or reserved control fields

2022-03-17 Thread Richard Henderson
On 3/17/22 08:49, Peter Maydell wrote: On Thu, 17 Mar 2022 at 05:53, Richard Henderson wrote: Create an array of masks which detail the writable and readonly bits for each control register. Apply them when writing to control registers, including the write to status during eret.

  1   2   3   >