[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

[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 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 ++

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 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

[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 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 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 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 -

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 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 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 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

[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 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 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 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 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 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 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 +

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 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.

[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 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 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 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 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 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 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 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 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

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

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 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 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 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

[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

[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 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 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 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 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 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

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

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

[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] Add missing pixman dependecy

2022-11-10 Thread Miroslav Rezanina
On Wed, Nov 9, 2022 at 5:14 PM Philippe Mathieu-Daudé wrote: > > Hi Mirek, > > On 9/11/22 16:34, mreza...@redhat.com wrote: > > From: Miroslav Rezanina > > > > Commit cfead31326 'acpi: pc: vga: use AcpiDevAmlIf interface to build VGA > > device descriptors' added > > a new file - acpi-vga.c. Thi

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

2022-11-10 Thread Klaus Jensen
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 local Error value also fixes a bug

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

2022-11-10 Thread Markus Armbruster
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 local Error value also fixes a bug where an error > returned from nvme_init_subsys() would b

Re: [PATCH v1 0/4] Support native debug icount trigger

2022-11-10 Thread Alistair Francis
On Thu, Oct 13, 2022 at 4:34 PM LIU Zhiwei wrote: > > icount trigger set an instruction count. After one instruction retired, > the count will be decreased by 1. If the count decreased to 0, the icount > trigger will fire. > > icount trigger is needed by single step ptrace system call and the nati

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 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 fix memory_region_init_resizeable_ram. That might be done after 7.2. > > Ste

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

2022-11-10 Thread Gavin Shan
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 "hostmem: default the amount of prealloc-

[PATCH v2 12/19] hw/9pfs: Disable unsupported flags and features for Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi Some flags and features are not supported on Windows, like mknod, readlink, file mode, etc. Update the codes for Windows. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- Changes in v2: - Use precise platform check in ifdefs to avoid automatically opting-out other f

[PATCH v2 00/19] At present there is no Windows support for 9p file system.

2022-11-10 Thread Bin Meng
This series adds initial Windows support for 9p file system. 'local' file system backend driver is supported on Windows, including open, read, write, close, rename, remove, etc. All security models are supported. The mapped (mapped-xattr) security model is implemented using NTFS Alternate Data Str

[PATCH v2 09/19] hw/9pfs: Support getting current directory offset for Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi On Windows 'struct dirent' does not have current directory offset. Update qemu_dirent_off() to support Windows. While we are here, add a build time check to error out if a new host does not implement this helper. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- Chang

[PATCH v2 19/19] meson.build: Turn on virtfs for Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi Enable virtfs configuration option for Windows host. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- (no changes since v1) meson.build | 10 +- fsdev/meson.build | 1 + hw/9pfs/meson.build | 8 +--- 3 files changed, 11 insertions(+), 8 delet

[PATCH v2 10/19] hw/9pfs: Add a helper qemu_stat_rdev()

2022-11-10 Thread Bin Meng
As Windows host does not have stat->st_rdev field, we use the first 3 characters of the root path to build a device id. Add a helper qemu_stat_rdev() to use it to avoid direct access to stat->st_rdev. Co-developed-by: Guohuai Shi Signed-off-by: Bin Meng --- Changes in v2: - new patch: "hw/9pf

[PATCH v2 13/19] hw/9pfs: Update v9fs_set_fd_limit() for Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi Use _getmaxstdio() to set the fd limit on Windows. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- Changes in v2: - new patch: "hw/9pfs: Update v9fs_set_fd_limit() for Windows" hw/9pfs/9p.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions

[PATCH v2 01/19] qemu/xattr.h: Exclude for Windows

2022-11-10 Thread Bin Meng
Windows does not have . Signed-off-by: Bin Meng --- (no changes since v1) include/qemu/xattr.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/qemu/xattr.h b/include/qemu/xattr.h index f1d0f7be74..b08a934acc 100644 --- a/include/qemu/xattr.h +++ b/include/qemu/xa

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

2022-11-10 Thread Bin Meng
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() to virtio-9p-client.h tests/qtest/li

[PATCH v2 11/19] hw/9pfs: Add a helper qemu_stat_blksize()

2022-11-10 Thread Bin Meng
As Windows host does not have stat->st_blksize field, we use the one we calculated in init_win32_root_directory(). Add a helper qemu_stat_blksize() and use it to avoid direct access to stat->st_blksize. Co-developed-by: Guohuai Shi Signed-off-by: Bin Meng --- Changes in v2: - new patch: "hw/9

[PATCH v2 06/19] hw/9pfs: Add missing definitions for Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi Some definitions currently used by the 9pfs codes are only available on POSIX platforms. Let's add our own ones in preparation to adding 9pfs support for Windows. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- Changes in v2: - Add S_IFLNK related macros to support s

[PATCH v2 17/19] hw/9pfs: Update synth fs driver for Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi Adapt synth fs driver for Windows in preparation to running qtest 9p testing on Windows. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- (no changes since v1) hw/9pfs/9p-synth.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/9p-synth

[PATCH v2 07/19] hw/9pfs: Implement Windows specific utilities functions for 9pfs

2022-11-10 Thread Bin Meng
From: Guohuai Shi Windows POSIX API and MinGW library do not provide the NO_FOLLOW flag, and do not allow opening a directory by POSIX open(). This causes all xxx_at() functions cannot work directly. However, we can provide Windows handle based functions to emulate xxx_at() functions (e.g.: opena

[PATCH v2 15/19] hw/9pfs: Translate Windows errno to Linux value

2022-11-10 Thread Bin Meng
From: Guohuai Shi Some of Windows error numbers have different value from Linux ones. For example, ENOTEMPTY is defined to 39 in Linux, but is defined to 41 in Windows. So deleting a directory from a Linux guest on top of QEMU from a Windows host complains: # rmdir tmp rmdir: 'tmp': Unknown

[PATCH v2 14/19] hw/9pfs: Add Linux error number definition

2022-11-10 Thread Bin Meng
From: Guohuai Shi When using 9p2000.L protocol, the errno should use the Linux errno. Currently magic numbers with comments are used. Replace these with macros for future expansion. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- Changes in v2: - Use a more compact solution in the swi

[PATCH v2 16/19] fsdev: Disable proxy fs driver on Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi We don't plan to support 'proxy' file system driver for 9pfs on Windows. Disable it for Windows build. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- (no changes since v1) fsdev/qemu-fsdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fsdev/qemu-fsdev.c b

[PATCH v2 02/19] hw/9pfs: Drop unnecessary *xattr wrapper API declarations

2022-11-10 Thread Bin Meng
These are not used anywhere in the source tree. Drop them. Signed-off-by: Bin Meng --- (no changes since v1) hw/9pfs/9p-util.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index c3526144c9..ccfc8b1cb3 100644 --- a/hw/9pfs/9p-util.h +++ b

[PATCH v2 03/19] hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper

2022-11-10 Thread Bin Meng
xxxat() APIs are only available on POSIX platforms. For future extension to Windows, let's replace the direct call to xxxat() APIs with a wrapper. Signed-off-by: Bin Meng --- (no changes since v1) hw/9pfs/9p-util.h | 15 +++ hw/9pfs/9p-local.c | 32

[PATCH v2 04/19] osdep.h: Introduce a QEMU file descriptor type

2022-11-10 Thread Bin Meng
Introduce a new QemuFd_t type to represent a file descriptor for different platforms. On POSIX platforms, this is a file descriptor On Windows, this is a file handle. Signed-off-by: Bin Meng --- Changes in v2: - Change to introduce QemuFd_t in osdep.h include/qemu/osdep.h | 26 +++

[PATCH v2 08/19] hw/9pfs: Update the local fs driver to support Windows

2022-11-10 Thread Bin Meng
From: Guohuai Shi Update the 9p 'local' file system driver to support Windows, including open, read, write, close, rename, remove, etc. All security models are supported. The mapped (mapped-xattr) security model is implemented using NTFS Alternate Data Stream (ADS) so the 9p export path shall be

[PATCH v2 05/19] hw/9pfs: Update 9pfs to use the new QemuFd_t type

2022-11-10 Thread Bin Meng
With this new QemuFd_t type, it significantly reduces the number of deviated code paths when adding Windows support. Signed-off-by: Bin Meng --- Changes in v2: - Use the new QemuFd_t type hw/9pfs/9p-local.h | 6 +- hw/9pfs/9p-util.h| 26 +++--- hw/9pfs/9p-local.c | 174

Re: biosbits test failing on origin/master

2022-11-10 Thread Ani Sinha
On Thu, Nov 10, 2022 at 11:37 PM John Snow wrote: > > Hiya, on today's origin/master > (2ccad61746ca7de5dd3e25146062264387e43bd4) I'm finding that "make > check-avocado" is failing on the new biosbits test on my local > development machine: > > (001/193) tests/avocado/acpi-bits.py:AcpiBitsTest.te

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

2022-11-10 Thread Zhenyu Zhang
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 "hostmem: default the amount of prealloc-threads to smp-cpus". Except the documentation remained

Re: [PULL 00/11] Hexagon bug fixes and performance improvement

2022-11-10 Thread Stefan Hajnoczi
Hi Taylor, QEMU is frozen for the 7.2 release cycle. Only bug fixes can be merged as the tree is being stabilized. You can find the release schedule here: https://wiki.qemu.org/Planning/7.2 Please resend with only the bug fixes needed for the 7.2 release. Thanks! Stefan

Re: [PATCH v1 4/4] target/riscv: Add itrigger_enabled field to CPURISCVState

2022-11-10 Thread Alistair Francis
On Thu, Nov 10, 2022 at 3:35 PM Richard Henderson wrote: > > On 11/10/22 13:15, LIU Zhiwei wrote: > >>> +static int debug_post_load(void *opaque, int version_id) > >>> +{ > >>> +RISCVCPU *cpu = opaque; > >>> +CPURISCVState *env = &cpu->env; > >>> + > >>> +if (icount_enabled()) { > >>>

[PULL 11/11] Hexagon (target/hexagon) Use direct block chaining for tight loops

2022-11-10 Thread Taylor Simpson
Direct block chaining is documented here https://qemu.readthedocs.io/en/latest/devel/tcg.html#direct-block-chaining Hexagon inner loops end with the endloop0 instruction To go back to the beginning of the loop, this instructions writes to PC from register SA0 (start address 0). To use direct bloc

[PULL 06/11] Hexagon (target/hexagon) Remove next_PC from runtime state

2022-11-10 Thread Taylor Simpson
The imported files don't properly mark all CONDEXEC instructions, so we add some logic to hex_common.py to add the attribute. Acked-by: Richard Henderson Signed-off-by: Taylor Simpson Message-Id: <20221108162906.3166-7-tsimp...@quicinc.com> --- target/hexagon/cpu.h| 1 - target

[PULL 00/11] Hexagon bug fixes and performance improvement

2022-11-10 Thread Taylor Simpson
The following changes since commit 2ccad61746ca7de5dd3e25146062264387e43bd4: Merge tag 'pull-tcg-20221109' of https://gitlab.com/rth7680/qemu into staging (2022-11-09 13:26:45 -0500) are available in the Git repository at: https://github.com/quic/qemu tags/pull-hex-20221110

[PULL 05/11] Hexagon (target/hexagon) Remove PC from the runtime state

2022-11-10 Thread Taylor Simpson
Add pc field to Packet structure For helpers that need PC, pass an extra argument Remove slot arg from conditional jump helpers On a trap0, copy pkt->pc into hex_gpr[HEX_REG_PC] Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson Message-Id: <20221108162906.3166-6-tsimp...@quicinc.com>

[PULL 08/11] Hexagon (target/hexagon) Add overrides for compound compare and jump

2022-11-10 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson Message-Id: <20221108162906.3166-9-tsimp...@quicinc.com> --- target/hexagon/gen_tcg.h | 177 +++ target/hexagon/genptr.c | 90 2 files changed, 267 insertions(+) diff --git a/tar

[PULL 02/11] Hexagon (target/hexagon) Fix predicated assignment to .tmp and .cur

2022-11-10 Thread Taylor Simpson
Here are example instructions with a predicated .tmp/.cur assignment if (p1) v12.tmp = vmem(r7 + #0) if (p0) v12.cur = vmem(r9 + #0) The .tmp/.cur indicates that references to v12 in the same packet take the result of the load. However, when the predicate is false, the value at the start o

[PULL 01/11] Hexagon (target/hexagon) Add pkt and insn to DisasContext

2022-11-10 Thread Taylor Simpson
This enables us to reduce the number of parameters to many functions In particular, the generated functions previously took all 3 as arguments Not only does this simplify the code, it improves the translation time Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson Message-Id: <2022110

[PULL 03/11] Hexagon (target/hexagon) Add overrides for S2_asr_r_r_sat/S2_asl_r_r_sat

2022-11-10 Thread Taylor Simpson
These instructions will not be generated by idef-parser, so we override them manually. Test cases added to tests/tcg/hexagon/usr.c Co-authored-by: Matheus Tavares Bernardino Signed-off-by: Matheus Tavares Bernardino Signed-off-by: Taylor Simpson Reviewed-by: Richard Henderson Message-Id: <202

[PULL 07/11] Hexagon (target/hexagon) Add overrides for direct call instructions

2022-11-10 Thread Taylor Simpson
Add overrides for J2_call J2_callt J2_callf Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson Message-Id: <20221108162906.3166-8-tsimp...@quicinc.com> --- target/hexagon/gen_tcg.h | 8 ++ target/hexagon/genptr.c | 55 2 files

[PULL 10/11] Hexagon (target/hexagon) Use direct block chaining for direct jump/branch

2022-11-10 Thread Taylor Simpson
Direct block chaining is documented here https://qemu.readthedocs.io/en/latest/devel/tcg.html#direct-block-chaining Recall that Hexagon allows packets with multiple jumps where only the first one with a true predicate will actually jump. We can use tcg_gen_goto_tb/tcg_gen_exit_tb when the packet

[PULL 04/11] Hexagon (target/hexagon) Only use branch_taken when packet has multi cof

2022-11-10 Thread Taylor Simpson
When a packet has more than one change-of-flow instruction, only the first one to branch is considered. We use the branch_taken variable to keep track of this. However, when there is a single cof instruction, we don't need the same amount of bookkeeping. We add the pkt_has_multi_cof member to th

[PULL 09/11] Hexagon (target/hexagon) Add overrides for various forms of jump

2022-11-10 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson Message-Id: <20221108162906.3166-10-tsimp...@quicinc.com> --- target/hexagon/gen_tcg.h | 201 +++ target/hexagon/genptr.c | 43 + 2 files changed, 244 insertions(+) diff --git a/target/hex

Re: [PATCH] hw/sd/sdhci: reset data count in sdhci_buff_access_is_sequential()

2022-11-10 Thread Bin Meng
On Fri, Nov 11, 2022 at 2:51 AM Mauro Matteo Cascella wrote: > > On Wed, Nov 9, 2022 at 5:19 PM Bin Meng wrote: > > > > On Wed, Nov 9, 2022 at 6:10 PM Mauro Matteo Cascella > > wrote: > > > > > > On Wed, Nov 9, 2022 at 10:45 AM Siqi Chen wrote: > > > > > > > > Hi, > > > > > > > > >This reproduc

Re: [PATCH] chardev/char-win-stdio: Pass Ctrl+C to guest with a multiplexed monitor

2022-11-10 Thread Bin Meng
On Wed, Oct 26, 2022 at 3:39 PM Marc-André Lureau wrote: > > On Tue, Oct 25, 2022 at 6:15 PM Bin Meng wrote: > > > > At present when pressing Ctrl+C from a guest running on QEMU Windows > > with a multiplexed monitor, e.g.: -serial mon:stdio, QEMU executable > > just exits. This behavior is incon

Re: [PATCH v3 0/7] memory: prevent dma-reentracy issues

2022-11-10 Thread Peter Maydell
On Thu, 10 Nov 2022 at 20:51, Stefan Hajnoczi wrote: > > Preventing this class of bugs is important but QEMU is currently > frozen for the 7.2 release. I'm a little concerned about regressions > in a patch series that changes core device emulation code. > > I'll review the series on Monday and if

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

2022-11-10 Thread Peter Xu
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 (holiday tomorrow). -- Peter Xu

Re: should ioapic_service really be modelling cpu writes?

2022-11-10 Thread Peter Xu
Hi, Alex, On Thu, Nov 10, 2022 at 05:55:51PM +, Alex Bennée wrote: > > Alex Bennée writes: > > > Hi, > > > > I've been trying to remove current_cpu hacks from our hw/ emulation and > > replace them with an explicit cpu_index derived from MemTxAttrs. So far > > this has been going mostly ok

[PATCH v3 0/2] hw/nvme: errp fixes

2022-11-10 Thread Klaus Jensen
From: Klaus Jensen Fix a couple of invalid errp usages. v3: - reword the commit message in patch 1 - fix an embarrassing bug in patch 2 Klaus Jensen (2): hw/nvme: fix incorrect use of errp/local_err hw/nvme: cleanup error reporting in nvme_init_pci() hw/nvme/ctrl.c | 71

[PATCH v3 2/2] hw/nvme: cleanup error reporting in nvme_init_pci()

2022-11-10 Thread Klaus Jensen
From: Klaus Jensen Replace the local Error variable with errp and ERRP_GUARD() and change the return value to bool. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index

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

2022-11-10 Thread Klaus Jensen
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 local Error value also fixes a bug where an error returned from nvme_init_subsys() would be lost. Reviewed-by: Philippe Math

Re: [PATCH v2 2/2] hw/nvme: cleanup error reporting in nvme_init_pci()

2022-11-10 Thread Klaus Jensen
On Nov 10 11:00, Markus Armbruster wrote: > Klaus Jensen writes: > > > From: Klaus Jensen > > > > Replace the local Error variable with errp and ERRP_GUARD() and change > > the return value to bool. > > > > Reviewed-by: Markus Armbruster > > Signed-off-by: Klaus Jensen > > --- > > hw/nvme/ctr

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

2022-11-10 Thread Klaus Jensen
On Nov 10 10:59, Philippe Mathieu-Daudé wrote: > On 10/11/22 07:23, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Make nvme_check_constraints() return a bool and fix an invalid error > > propagation where the actual error is thrown away in favor of an unused > > local Error value. > > > > S

  1   2   3   >