[PATCH for 8.0 3/8] cryptodev: Introduce cryptodev alg type in QAPI

2022-11-10 Thread zhenwei pi
Introduce cryptodev alg type in cryptodev.json, then apply this to related codes, and drop 'enum CryptoDevBackendAlgType'. There are two options: 1, { 'enum': 'QCryptodevBackendAlgType', 'prefix': 'CRYPTODEV_BACKEND_ALG', 'data': ['sym', 'asym']} Then we can keep 'CRYPTODEV_BACKEND_ALG_SYM' an

[PATCH for 8.0 5/8] cryptodev: Introduce 'query-cryptodev' QMP command

2022-11-10 Thread zhenwei pi
Now we have a QMP command to query crypto devices: virsh qemu-monitor-command vm '{"execute": "query-cryptodev"}' | jq { "return": [ { "service": [ "akcipher", "mac", "hash", "cipher" ], "id": "cryptodev1", "client": [ {

Re: [PATCH v3] qapi/qom: Memory backend property prealloc-threads doc fix

2022-11-10 Thread Markus Armbruster
Gavin Shan writes: > Hi Zhenyu, > > On 11/11/22 11:05 AM, Zhenyu Zhang wrote: >> Commit ffac16fab3 "hostmem: introduce "prealloc-threads" property" >> (v5.0.0) changed the default number of threads from number of CPUs >> to 1. This was deemed a regression, and fixed in commit f8d426a685 >> "host

Re: [PATCH v3 0/2] Fix the virtio features negotiation flaw

2022-11-10 Thread Hyman Huang
在 2022/11/11 2:53, Michael S. Tsirkin 写道: On Sun, Oct 30, 2022 at 09:52:37PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) v3: -rebase on master -code clean on [PATCH v2 1/2]: keep the commit self-consistent and do not modify the logic of saving acked_features. Just abstrac

[PATCH for 8.0 4/8] cryptodev: Introduce server type in QAPI

2022-11-10 Thread zhenwei pi
Introduce cryptodev service type in cryptodev.json, then apply this to related codes. Now we can remove VIRTIO_CRYPTO_SERVICE_xxx dependence from QEMU cryptodev. Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c| 8 backends/cryptodev-lkcf.c | 2 +- backends/cryptod

[PATCH for 8.0 8/8] hmp: add cryptodev info command

2022-11-10 Thread zhenwei pi
Example of this command: # virsh qemu-monitor-command vm --hmp info cryptodev cryptodev1: service=[akcipher|mac|hash|cipher] queue 0: type=builtin cryptodev0: service=[akcipher] queue 0: type=lkcf Signed-off-by: zhenwei pi --- hmp-commands-info.hx | 14 ++ include/monitor/h

[PATCH for 8.0 6/8] cryptodev: Support statistics

2022-11-10 Thread zhenwei pi
Introduce cryptodev statistics in QAPI, and record OPS/Bandwidth for each crypto device. Example of this feature: virsh qemu-monitor-command vm '{"execute": "query-cryptodev"}' | jq { "return": [ { "service": [ "akcipher", "mac", "hash", "cipher" ]

[PATCH for 8.0 7/8] cryptodev-builtin: Detect akcipher capability

2022-11-10 Thread zhenwei pi
Rather than exposing akcipher service/RSA algorithm to virtio crypto device unconditionally, detect akcipher capability from akcipher crypto framework. This avoids unsuccessful requests. Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c | 25 + 1 file changed, 21

[PATCH for 8.0 0/8] Refactor cryptodev

2022-11-10 Thread zhenwei pi
The main changes in this series: - introduce cryptodev.json to describe the attributes of crypto device, then drop duplicated type declare, remove some virtio related dependence. - add statistics: OPS and bandwidth. - add QMP command: query-cryptodev - add HMP info command: cryptodev - misc fix:

[PATCH for 8.0 2/8] cryptodev: Remove 'name' & 'model' fields

2022-11-10 Thread zhenwei pi
We have already used qapi to generate crypto device types, this allows to convert type to a string 'model', so the 'model' field is not needed. And the 'name' field is not used by any backend driver, drop it. Signed-off-by: zhenwei pi --- backends/cryptodev-builtin.c| 3 +-- backends/crypt

[PATCH for 8.0 1/8] cryptodev: Introduce cryptodev.json

2022-11-10 Thread zhenwei pi
Introduce QCryptodevBackendType in cryptodev.json, also apply this to related codes. Then we can drop 'enum CryptoDevBackendOptionsType'. Signed-off-by: zhenwei pi --- MAINTAINERS | 1 + backends/cryptodev-builtin.c| 2 +- backends/cryptodev-lkcf.c | 2 +- backen

Re: [PATCH for-7.2] Fix several typos in documentation (found by codespell)

2022-11-10 Thread Ani Sinha
On Fri, Nov 11, 2022 at 10:59 AM Ani Sinha wrote: > > On Fri, Nov 11, 2022 at 12:38 AM Stefan Weil wrote: > > > > Those typos are in files which are used to generate the QEMU manual. > > > > Signed-off-by: Stefan Weil > > For acpi-bits.rst, > Reviewed-by: Ani Sinha > > > --- > > > > I did not f

Re: [PATCH v3 1/2] hw/nvme: fix incorrect use of errp/local_err

2022-11-10 Thread Markus Armbruster
Klaus Jensen writes: > On Nov 11 07:36, Markus Armbruster wrote: >> Klaus Jensen writes: >> >> > From: Klaus Jensen >> > >> > Remove an unnecessary local Error value in nvme_realize(). In the >> > process, change nvme_check_constraints() into returning a bool. >> > >> > Finally, removing the l

Re: [PATCH v3 1/2] hw/nvme: fix incorrect use of errp/local_err

2022-11-10 Thread Klaus Jensen
On Nov 11 07:55, Markus Armbruster wrote: > Klaus Jensen writes: > > > On Nov 11 07:36, Markus Armbruster wrote: > >> Klaus Jensen writes: > >> > >> > From: Klaus Jensen > >> > > >> > Remove an unnecessary local Error value in nvme_realize(). In the > >> > process, change nvme_check_constraint

Re: [PATCH v6 01/10] vdpa: Use v->shadow_vqs_enabled in vhost_vdpa_svqs_start & stop

2022-11-10 Thread Jason Wang
在 2022/11/10 20:54, Eugenio Perez Martin 写道: On Thu, Nov 10, 2022 at 6:22 AM Jason Wang wrote: On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: This function used to trust in v->shadow_vqs != NULL to know if it must start svq or not. This is not going to be valid anymore, as qemu is goi

Re: [PATCH v2] migration: check magic value for deciding the mapping of channels

2022-11-10 Thread manish.mishra
On 11/11/22 4:17 am, Peter Xu wrote: On Thu, Nov 10, 2022 at 05:59:45PM +0530, manish.mishra wrote: Hi Everyone, Just a gentle reminder for review. :) Hi, Manish, I've got a slightly busy week, sorry! If Daniel and Juan won't have time to look at it I'll have a closer look at it next Monday

Re: [PATCH v6 05/10] vdpa: move SVQ vring features check to net/

2022-11-10 Thread Jason Wang
在 2022/11/10 21:09, Eugenio Perez Martin 写道: On Thu, Nov 10, 2022 at 6:40 AM Jason Wang wrote: 在 2022/11/9 01:07, Eugenio Pérez 写道: The next patches will start control SVQ if possible. However, we don't know if that will be possible at qemu boot anymore. If I was not wrong, there's no dev

[PATCH for-8.0 v3 01/45] meson: Move CONFIG_TCG_INTERPRETER to config_host

2022-11-10 Thread Richard Henderson
Like CONFIG_TCG, the enabled method of execution is a host property not a guest property. This exposes the define to compile-once files. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/m

[PATCH for-8.0 v3 06/45] tcg: Remove TCG_TARGET_STACK_GROWSUP

2022-11-10 Thread Richard Henderson
The hppa host code has been removed since 2013; this should have been deleted at the same time. Fixes: 802b5081233a ("tcg-hppa: Remove tcg backend") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 1 - tcg/arm/tcg-target.h | 1 - tcg/tcg

[PATCH for-8.0 v3 36/45] include/qemu/int128: Use Int128 structure for TCI

2022-11-10 Thread Richard Henderson
We are about to allow passing Int128 to/from tcg helper functions, but libffi doesn't support __int128_t, so use the structure. In order for atomic128.h to continue working, we must provide a mechanism to frob between real __int128_t and the structure. Provide a new union, Int128Alias, for this.

[PATCH for-8.0 v3 22/45] tci: MAX_OPC_PARAM_IARGS is no longer used

2022-11-10 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/tci.c| 1 - tcg/tci/tcg-target.c.inc | 4 2 files changed, 5 deletions(-) diff --git a/tcg/tci.c b/tcg/tci.c index bdfac83492..05a24163d3 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" -#inclu

[PATCH for-8.0 v3 12/45] tcg: Allocate TCGTemp pairs in host memory order

2022-11-10 Thread Richard Henderson
Allocate the first of a pair at the lower address, and the second of a pair at the higher address. This will make it easier to find the beginning of the larger memory block. Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 4 ++-- tcg/tcg.c | 58 ++

[PATCH for-8.0 v3 24/45] tcg: Use output_pref wrapper function

2022-11-10 Thread Richard Henderson
We will shortly have the possibility of more that two outputs, though only for calls (for which preferences are moot). Avoid direct references to op->output_pref[] when possible. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 5 + tcg/tcg.c | 34 ++

[PATCH for-8.0 v3 33/45] tcg: Add TCG_CALL_{RET,ARG}_BY_REF

2022-11-10 Thread Richard Henderson
These will be used by some hosts, both 32 and 64-bit, to pass and return i128. Not yet used, because allocation is not yet enabled. Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 3 + tcg/tcg.c | 135 - 2 files changed, 135 inser

[PATCH for-8.0 v3 39/45] tcg/tci: Add TCG_TARGET_CALL_{RET,ARG}_I128

2022-11-10 Thread Richard Henderson
Fill in the parameters for libffi for Int128. Adjust the interpreter to allow for 16-byte return values. Adjust tcg_out_call to record the return value length. Call parameters are no longer all the same size, so we cannot reuse the same call_slots array for every function. Compute it each time now

[PATCH for-8.0 v3 16/45] tcg: Replace TCG_TARGET_CALL_ALIGN_ARGS with TCG_TARGET_CALL_ARG_I64

2022-11-10 Thread Richard Henderson
For 32-bit hosts when TCG_TARGET_CALL_ALIGN_ARGS was set, use TCG_CALL_ARG_EVEN. For 64-bit hosts, TCG_TARGET_CALL_ALIGN_ARGS was silently ignored, so always use TCG_CALL_ARG_NORMAL. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 +-

[PATCH for-8.0 v3 25/45] tcg: Reorg function calls

2022-11-10 Thread Richard Henderson
Pre-compute the function call layout for each helper at startup. Drop TCG_CALL_DUMMY_ARG, as we no longer need to leave gaps in the op->args[] array. This allows several places to stop checking for NULL TCGTemp, to which TCG_CALL_DUMMY_ARG mapped. For tcg_gen_callN, loop over the arguments once.

Re: [PATCH v6 07/10] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap

2022-11-10 Thread Jason Wang
在 2022/11/10 21:22, Eugenio Perez Martin 写道: On Thu, Nov 10, 2022 at 6:51 AM Jason Wang wrote: On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: So the caller can choose which ASID is destined. No need to update the batch functions as they will always be called from memory listener updat

[PATCH for-8.0 v3 07/45] accel/tcg: Set cflags_next_tb in cpu_common_initfn

2022-11-10 Thread Richard Henderson
While we initialize this value in cpu_common_reset, that isn't called during startup, so set it as well in init. This fixes -singlestep versus the very first TB. Fixes: 04f5b647ed07 ("accel/tcg: Handle -singlestep in curr_cflags") Signed-off-by: Richard Henderson --- hw/core/cpu-common.c | 1 +

[PATCH for-8.0 v3 04/45] tcg/s390x: Use register pair allocation for div and mulu2

2022-11-10 Thread Richard Henderson
Previously we hard-coded R2 and R3. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-con-set.h | 4 ++-- tcg/s390x/tcg-target-con-str.h | 8 +-- tcg/s390x/tcg-target.c.inc | 43 +- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a

[PATCH for-8.0 v3 08/45] target/sparc: Avoid TCGV_{LOW,HIGH}

2022-11-10 Thread Richard Henderson
Use the official extend/extract functions instead of routines that will shortly be internal to tcg. Cc: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/target/sparc/translat

[PATCH for-8.0 v3 40/45] tcg: Add TCG_TARGET_CALL_{RET,ARG}_I128

2022-11-10 Thread Richard Henderson
Fill in the parameters for the host ABI for Int128 for those backends which require no extra modification. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 ++ tcg/arm/tcg-target.h | 2 ++ tcg/loongarch64/tcg-target.h | 2 ++ tcg/mips/tcg-target.h| 2 ++ tcg/

[PATCH for-8.0 v3 23/45] tcg: Vary the allocation size for TCGOp

2022-11-10 Thread Richard Henderson
We have been allocating a worst case number of arguments to support calls. Instead, allow the size to vary. By default leave space for 4 args, to maximize reuse, but allow calls to increase the number of args to 32. Signed-off-by: Richard Henderson --- include/exec/helper-head.h | 2 -- includ

[PATCH for-8.0 v3 28/45] tcg: Add TCGHelperInfo argument to tcg_out_call

2022-11-10 Thread Richard Henderson
This eliminates an ifdef for TCI, and will be required for expanding the call for TCGv_i128. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c| 12 ++-- tcg/aarch64/tcg-target.c.inc | 12 +--- tcg/arm/tcg-target.c.inc

[PATCH for-8.0 v3 15/45] tcg: Introduce TCGCallReturnKind and TCGCallArgumentKind

2022-11-10 Thread Richard Henderson
Prepare to replace a bunch of separate ifdefs with a consistent way to describe the abi of a function call. Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index 2c06b5116a..f5747

[PATCH for-8.0 v3 31/45] tcg: Allocate objects contiguously in temp_allocate_frame

2022-11-10 Thread Richard Henderson
When allocating a temp to the stack frame, consider the base type and allocate all parts at once. Signed-off-by: Richard Henderson --- tcg/tcg.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 11948256f2..3eabb6ef4d

Re: [PATCH v6 09/10] vdpa: Add listener_shadow_vq to vhost_vdpa

2022-11-10 Thread Jason Wang
在 2022/11/10 21:47, Eugenio Perez Martin 写道: On Thu, Nov 10, 2022 at 7:01 AM Jason Wang wrote: On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: The memory listener that thells the device how to convert GPA to qemu's va is registered against CVQ vhost_vdpa. This series try to map the memo

[PATCH for-8.0 v3 42/45] tcg: Add basic data movement for TCGv_i128

2022-11-10 Thread Richard Henderson
Add code generation functions for data movement between TCGv_i128 (mov) and to/from TCGv_i64 (concat, extract). Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 4 tcg/tcg-internal.h | 13 + tcg/tcg-op.c | 20 3 files changed, 37 insert

Re: [PATCH v2 18/19] tests/qtest: virtio-9p-test: Adapt the case for win32

2022-11-10 Thread Thomas Huth
On 11/11/2022 05.22, Bin Meng wrote: From: Guohuai Shi Windows does not provide the getuid() API. Let's create a local one and return a fixed value 0 as the uid for testing. Co-developed-by: Xuzhou Cheng Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- Changes in v2: - Move getuid()

[PATCH for-8.0 v3 02/45] tcg: Tidy tcg_reg_alloc_op

2022-11-10 Thread Richard Henderson
Replace goto allocate_in_reg with a boolean. Remove o_preferred_regs which isn't used, except to copy. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 45 + 1 file changed, 21 insertions(+), 24 deletions(-) diff -

[PATCH for-8.0 v3 27/45] tcg/aarch64: Merge tcg_out_callr into tcg_out_call

2022-11-10 Thread Richard Henderson
There is only one use, and BLR is perhaps even more self-documentary than CALLR. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 344b63e20

[PATCH for-8.0 v3 19/45] accel/tcg/plugin: Don't search for the function pointer index

2022-11-10 Thread Richard Henderson
The function pointer is immediately after the output and input operands; no need to search. Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-ge

[PATCH for-8.0 v3 11/45] tcg: Simplify calls to temp_sync vs mem_coherent

2022-11-10 Thread Richard Henderson
The first thing that temp_sync does is check mem_coherent, so there's no need for the caller to do so. Signed-off-by: Richard Henderson --- tcg/tcg.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index a82c291369..583677a1c4 100644 --- a/tcg/tc

[PATCH for-8.0 v3 38/45] tcg/tci: Fix big-endian return register ordering

2022-11-10 Thread Richard Henderson
We expect the backend to require register pairs in host-endian ordering, thus for big-endian the first register of a pair contains the high part. We were forcing R0 to contain the low part for calls. Signed-off-by: Richard Henderson --- tcg/tci.c | 21 +++-- 1 file changed, 11 in

Re: [PATCH] libdecnumber/dpd/decimal64: Fix compiler warning from Clang 15

2022-11-10 Thread Thomas Huth
On 10/11/2022 21.00, Philippe Mathieu-Daudé wrote: On 10/11/22 14:11, Thomas Huth wrote: Clang 15 from Fedora 37 complains:   ../libdecnumber/dpd/decimal64.c:620:8: error: variable 'n' set but   not used [-Werror,-Wunused-but-set-variable]     Int  n; /* output bunch counter

[PATCH for-8.0 v3 44/45] tcg: Add tcg_gen_{non}atomic_cmpxchg_i128

2022-11-10 Thread Richard Henderson
This will allow targets to avoid rolling their own. Signed-off-by: Richard Henderson --- accel/tcg/tcg-runtime.h | 11 + include/tcg/tcg-op.h | 5 +++ tcg/tcg-op.c | 85 +++ accel/tcg/atomic_common.c.inc | 45 ++

[PATCH for-8.0 v3 21/45] accel/tcg/plugin: Use copy_op in append_{udata, mem}_cb

2022-11-10 Thread Richard Henderson
Better to re-use the existing function for copying ops. Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 77e6823d6b..a6aaacd053 100644 --- a/accel

[PATCH for-8.0 v3 10/45] tcg: Add temp_subindex to TCGTemp

2022-11-10 Thread Richard Henderson
Record the location of a TCGTemp within a larger object. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 + tcg/tcg.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index d207bc47be..afa18986b1

<    1   2   3