[PULL 05/30] qapi tests: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for tests/qapi-schema/qapi-schema-test.json. Said

[PULL 10/30] qapi block: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/block*.json. Said commit explains the

[PULL 04/30] qapi: Start to elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
In QAPI, absent optional members are distinct from any present value. We thus represent an optional schema member FOO as two C members: a FOO with the member's type, and a bool has_FOO. Likewise for function arguments. However, has_FOO is actually redundant for a pointer-valued FOO, which can be

[PULL 29/30] qapi qga: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qga/qapi-schema.json. Said commit explains the

[PULL 21/30] qapi replay: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/replay.json. Said commit explains the

[PULL 00/30] QAPI patches patches for 2022-12-14

2022-12-13 Thread Markus Armbruster
The following changes since commit ea3a008d2d9ced9c4f93871c823baee237047f93: Update VERSION for v7.2.0-rc4 (2022-12-06 19:53:34 -0500) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pull-qapi-2022-12-14 for you to fetch changes up to

[PATCH 2/2] include: Include headers where needed

2022-12-13 Thread Markus Armbruster
A number of headers neglect to include everything they need. They compile only if the headers they need are already included from elsewhere. Fix that. Signed-off-by: Markus Armbruster --- include/exec/plugin-gen.h | 1 + include/hw/acpi/erst.h | 3 +++

[PULL 20/30] qapi qdev qom: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/qdev.json and qapi/qom.json. Said commit

[PULL 08/30] blockdev: Clean up abuse of DriveBackup member format

2022-12-13 Thread Markus Armbruster
drive-backup argument @format defaults to the format of the source unless @mode is "existing". drive_backup_prepare() implements this by copying the source's @format_name to DriveBackup member @format. It leaves @has_format false, violating the "has_format == !!format" invariant. Unclean. Falls

[PULL 12/30] qapi crypto: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/crypto.json. Said commit explains the

[PULL 28/30] qapi virtio: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/virtio.json. Said commit explains the

[PULL 13/30] qapi dump: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/dump.json. Said commit explains the

[PULL 06/30] qapi acpi: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/acpi.py. Said commit explains the

[PULL 16/30] qapi migration: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/migration.json. Said commit explains the

Re: [PATCH-for-8.0] coroutine: Add missing include

2022-12-13 Thread Philippe Mathieu-Daudé
Cc'ing Markus On 25/11/22 18:55, Philippe Mathieu-Daudé wrote: qemu_co_mutex_assert_locked() calls qatomic_read(), which is declared in . This fixes when refactoring: In file included from include/qemu/osdep.h:113, from ../../util/error-report.c:13:

Re: [PATCH v3 4/8] target/i386/intel-pt: print special message for INTEL_PT_ADDR_RANGES_NUM

2022-12-13 Thread Chenyi Qiang
On 12/13/2022 8:09 PM, Xiaoyao Li wrote: > On 12/9/2022 2:43 PM, Chenyi Qiang wrote: >> >> >> On 12/8/2022 2:25 PM, Xiaoyao Li wrote: >>> Bit[2:0] of CPUID.14H_01H:EAX stands as a whole for the number of INTEL >>> PT ADDR RANGES. For unsupported value that exceeds what KVM reports, >>> report

[PATCH] hw/cxl/device: Add Flex Bus Port DVSEC

2022-12-13 Thread Ira Weiny
void hdm_decoder_commit(CXLType3Dev *ct3d, int which) --- base-commit: e11b57108b0cb746bb9f3887054f34a2f818ed79 change-id: 20221213-ira-flexbus-port-ce526de8111d Best regards, -- Ira Weiny

Re: [PATCH v10 6/9] KVM: Unmap existing mappings when change the memory attributes

2022-12-13 Thread Huang, Kai
On Fri, 2022-12-02 at 14:13 +0800, Chao Peng wrote: >   > - /* flags is currently not used. */ > + /* 'flags' is currently not used. */ >   if (attrs->flags) >   return -EINVAL; Unintended code change.

Re: [PATCH v10 1/9] mm: Introduce memfd_restricted system call to create restricted user memory

2022-12-13 Thread Huang, Kai
> > memfd_restricted() itself is implemented as a shim layer on top of real > memory file systems (currently tmpfs). Pages in restrictedmem are marked > as unmovable and unevictable, this is required for current confidential > usage. But in future this might be changed. > > I didn't dig full

Re: [PATCH v1 14/24] vfio-user: get and set IRQs

2022-12-13 Thread John Johnson
> On Dec 13, 2022, at 8:39 AM, Cédric Le Goater wrote: > > On 11/9/22 00:13, John Johnson wrote: >> >> + >> +/* must send all valid FDs or all invalid FDs in single msg */ > > why is that ? > This has to do with how VFIO sends FDs to the kernel. The ioctl() i/f has an

Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation

2022-12-13 Thread Paolo Bonzini
Il mar 13 dic 2022, 01:59 David Woodhouse ha scritto: > There was *also* a call to xen_emulated_machine_init() added to > pc_init1() by the 'pc_piix: handle XEN_EMULATE backend init' patch. > I've dropped that for now; once we are ready to hook up the xenbus and > PV drivers, that seems like it

[PATCH 5/8] plugins: implement QPP callbacks

2022-12-13 Thread Andrew Fasano
From: Elysia Witham Plugins are able to use API functions which are explained in to create and run their own callbacks and register functions on another plugin's callbacks. Signed-off-by: Elysia Witham Signed-off-by: Andrew Fasano --- include/qemu/qemu-plugin.h | 46 +++

[PATCH 2/8] plugins: version 2, require unique plugin names

2022-12-13 Thread Andrew Fasano
From: Elysia Witham In order for the QPP API to resolve interactions between plugins, plugins must export their own names which cannot match any other loaded plugins. Signed-off-by: Elysia Witham Signed-off-by: Andrew Fasano --- include/qemu/qemu-plugin.h | 2 +- plugins/core.c

[PATCH 1/5] io: Add support for MSG_PEEK for socket channel

2022-12-13 Thread Peter Xu
From: "manish.mishra" MSG_PEEK reads from the peek of channel, The data is treated as unread and the next read shall still return this data. This support is currently added only for socket class. Extra parameter 'flags' is added to io_readv calls to pass extra read flags like MSG_PEEK.

[PATCH 6/8] plugins: implement QPP import function

2022-12-13 Thread Andrew Fasano
From: Elysia Witham Plugins can export functions or import functions from other plugins using their name and the function name. This is also described in . Signed-off-by: Elysia Witham Signed-off-by: Andrew Fasano --- include/qemu/qemu-plugin.h | 10 ++ plugins/api.c

[PATCH 7/8] include/qemu: added macro for QPP import function

2022-12-13 Thread Andrew Fasano
From: Elysia Witham Plugins can use this macro in a header file which can be included by both the exporting and importing plugins. The macro will either use qemu_plugin_import_function to import the function or just define it if the plugin is the same one that exports it. If importing a

[PATCH 0/8] Inter-plugin interactions with QPP

2022-12-13 Thread Andrew Fasano
Hello, This is a series of patches expanding the TCG plugin system to add what we're calling the "QEMU Plugin-to-Plugin (QPP)" interface that allows for interactions between TCG plugins. This is a follow up to the Sept 1 2022 RFC "Support interactions between TCG plugins." The goal of this

[PATCH 5/5] migration: Postpone postcopy preempt channel to be after main

2022-12-13 Thread Peter Xu
Postcopy with preempt-mode enabled needs two channels to communicate. The order of channel establishment is not guaranteed. It can happen that the dest QEMU got the preempt channel connection request before the main channel is established, then the migration may make no progress even during

[PATCH 1/8] docs/devel: describe QPP API

2022-12-13 Thread Andrew Fasano
From: Elysia Witham The new QPP API allows plugin-to-plugin interaction for creating and using callbacks as well as importing and exporting functions. The new test plugins qpp_srv and qpp_client demonstrate how plugins use the new API. Signed-off-by: Elysia Witham Signed-off-by: Andrew Fasano

[PATCH 2/5] migration: check magic value for deciding the mapping of channels

2022-12-13 Thread Peter Xu
From: "manish.mishra" Current logic assumes that channel connections on the destination side are always established in the same order as the source and the first one will always be the main channel followed by the multifid or post-copy preemption channel. This may not be always true, as even if

[PATCH 8/8] tests: build and run QPP tests

2022-12-13 Thread Andrew Fasano
From: Elysia Witham These test plugins demonstrate the QPP API changes by exporting and importing functions and creating and registering callbacks. These tests are integrated into the `make check-tcg` tests. Signed-off-by: Elysia Witham Signed-off-by: Andrew Fasano --- tests/Makefile.include

[PATCH 3/8] plugins: add id_to_plugin_name

2022-12-13 Thread Andrew Fasano
From: Elysia Witham Plugins will pass their unique id when creating callbacks to ensure they are associated with the correct plugin. This internal function resolves those ids to the declared names. Signed-off-by: Elysia Witham Signed-off-by: Andrew Fasano --- plugins/core.c | 12

[PATCH 4/8] plugins: add core API functions for QPP callbacks

2022-12-13 Thread Andrew Fasano
From: Elysia Witham Plugin callbacks and their registered functions are stored in a separate struct which is accessible from the plugin's ctx. In order for plugins to use another plugin's callbacks, we have internal functions that resolve a plugin's name to its ctx and find a target plugin.

[PATCH 3/5] migration: Rework multi-channel checks on URI

2022-12-13 Thread Peter Xu
The whole idea of multi-channel checks was not properly done, IMHO. Currently we check multi-channel in a lot of places, but actually that's not needed because we only need to check it right after we get the URI and that should be it. If the URI check succeeded, we should never need to check it

Re: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32()

2022-12-13 Thread Peter Maydell
On Tue, 13 Dec 2022 at 18:11, BALATON Zoltan wrote: > I can't remember the details but I think I've had no tswap in sam460ex > first but that did not work and had to add it but I've probably looked at > other examples and did not really understand why this was needed. I tested > on x86_64 so not

[PATCH v4 25/27] tcg: Move ffi_cif pointer into TCGHelperInfo

2022-12-13 Thread Richard Henderson
Instead of requiring a separate hash table lookup, put a pointer to the CIF into TCGHelperInfo. Signed-off-by: Richard Henderson Message-Id: <2022074101.2069454-27-richard.hender...@linaro.org> [PMD: Split from bigger patch] Signed-off-by: Philippe Mathieu-Daudé Message-Id:

[PATCH 4/5] migration: Add a semaphore to count PONGs

2022-12-13 Thread Peter Xu
This is mostly useless, but useful for us to know whether the main channel is correctly established without changing the migration protocol. Signed-off-by: Peter Xu --- migration/migration.c | 3 +++ migration/migration.h | 6 ++ 2 files changed, 9 insertions(+) diff --git

[PATCH 0/5] migration: Fix disorder of channel creations

2022-12-13 Thread Peter Xu
Based-on: <20221011215559.602584-1-pet...@redhat.com> This whole set is based on the whole set of preempt-full mode being applied first here: https://lore.kernel.org/r/20221011215559.602584-1-pet...@redhat.com I also picked up the latest version from Manish on fixing multifd counterpart of the

[PATCH v4 22/27] tcg: Reorg function calls

2022-12-13 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 v4 26/27] tcg/aarch64: Merge tcg_out_callr into tcg_out_call

2022-12-13 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

[PATCH v4 03/27] tcg: Remove check_regs

2022-12-13 Thread Richard Henderson
We now check the consistency of reg_to_temp[] with each update, so the utility of checking consistency at the end of each opcode is minimal. In addition, the form of this check is quite expensive, consuming 10% of a checking-enabled build. Signed-off-by: Richard Henderson --- tcg/tcg.c | 76

[PATCH v4 21/27] tcg: Use output_pref wrapper function

2022-12-13 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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 5 + tcg/tcg.c

[PATCH v2] linux-user: Fix /proc/cpuinfo output for sparc and hppa

2022-12-13 Thread Helge Deller
The sparc and hppa architectures provide an own output for the emulated /proc/cpuinfo file. Some userspace applications count (even if that's not the recommended way) the number of lines which start with "processor:" and assume that this number then reflects the number of online CPUs. Since those

[PATCH v4 23/27] tcg: Convert typecode_to_ffi from array to function

2022-12-13 Thread Richard Henderson
From: Philippe Mathieu-Daudé In the unlikely case of invalid typecode mask, the function will abort instead of returning a NULL pointer. Signed-off-by: Richard Henderson Message-Id: <2022074101.2069454-27-richard.hender...@linaro.org> [PMD: Split from bigger patch] Signed-off-by: Philippe

[PATCH v4 09/27] tcg: Simplify calls to temp_sync vs mem_coherent

2022-12-13 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 0f58013a5a..36a33a122c 100644 ---

[PATCH v4 20/27] tcg: Vary the allocation size for TCGOp

2022-12-13 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 --

[PATCH v4 17/27] accel/tcg/plugin: Don't search for the function pointer index

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

[PATCH v4 05/27] accel/tcg: Set cflags_next_tb in cpu_common_initfn

2022-12-13 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 v4 19/27] accel/tcg/plugin: Use copy_op in append_{udata, mem}_cb

2022-12-13 Thread Richard Henderson
Better to re-use the existing function for copying ops. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- Cc: Alex Bennée --- accel/tcg/plugin-gen.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/accel/tcg/plugin-gen.c

[PATCH v4 00/27] tcg misc patches

2022-12-13 Thread Richard Henderson
For v4, I've sorted some of the reviewed patches to the beginning of the queue and omitted them; this was not possible for all. This set begins with the first patch that is missing review. I've not tested this set separately, so in case it doesn't apply, the entire tree is

[PATCH v4 13/27] tcg: Introduce TCGCallReturnKind and TCGCallArgumentKind

2022-12-13 Thread Richard Henderson
Prepare to replace a bunch of separate ifdefs with a consistent way to describe the ABI of a function call. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tcg/tcg-internal.h

[PATCH v4 07/27] tcg: Move TCG_{LOW,HIGH} to tcg-internal.h

2022-12-13 Thread Richard Henderson
Move the error-generating fallback from tcg-op.c, and replace "_link_error" with modern QEMU_ERROR markup. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 33 + include/tcg/tcg.h| 12

[PATCH v4 24/27] tcg: Factor init_ffi_layouts() out of tcg_context_init()

2022-12-13 Thread Richard Henderson
From: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <2022074101.2069454-27-richard.hender...@linaro.org> [PMD: Split from bigger patch] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221122180804.938-3-phi...@linaro.org> --- tcg/tcg.c | 83

[PATCH v4 14/27] tcg: Replace TCG_TARGET_CALL_ALIGN_ARGS with TCG_TARGET_CALL_ARG_I64

2022-12-13 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 v4 10/27] tcg: Allocate TCGTemp pairs in host memory order

2022-12-13 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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 4 ++-- tcg/tcg.c

[PATCH v4 16/27] tcg: Use TCG_CALL_ARG_EVEN for TCI special case

2022-12-13 Thread Richard Henderson
Change 32-bit tci TCG_TARGET_CALL_ARG_I32 to TCG_CALL_ARG_EVEN, to force 32-bit values to be aligned to 64-bit. With a small reorg to the argument processing loop, this neatly replaces an ifdef for CONFIG_TCG_INTERPRETER. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson ---

[PATCH v4 18/27] accel/tcg/plugin: Avoid duplicate copy in copy_call

2022-12-13 Thread Richard Henderson
We copied all of the arguments in copy_op_nocheck. We only need to replace the one argument that we change. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- Cc: Alex Bennée --- accel/tcg/plugin-gen.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH v4 15/27] tcg: Replace TCG_TARGET_EXTEND_ARGS with TCG_TARGET_CALL_ARG_I32

2022-12-13 Thread Richard Henderson
For 64-bit hosts that had TCG_TARGET_EXTEND_ARGS, set TCG_TARGET_CALL_ARG_I32 to TCG_CALL_ARG_EXTEND. Otherwise, use TCG_CALL_ARG_NORMAL. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 1 + tcg/arm/tcg-target.h | 1 +

[PATCH v4 02/27] tcg: Centralize updates to reg_to_temp

2022-12-13 Thread Richard Henderson
Create two new functions, set_temp_val_{reg,nonreg}. Assert that the reg_to_temp mapping is correct before any changes are made. Signed-off-by: Richard Henderson --- tcg/tcg.c | 159 +- 1 file changed, 85 insertions(+), 74 deletions(-) diff

[PATCH v4 12/27] tcg: Introduce tcg_type_size

2022-12-13 Thread Richard Henderson
Add a helper function for computing the size of a type. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 16 tcg/tcg.c | 27 --- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git

[PATCH v4 06/27] target/sparc: Avoid TCGV_{LOW,HIGH}

2022-12-13 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

[PATCH v4 08/27] tcg: Add temp_subindex to TCGTemp

2022-12-13 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

[PATCH v4 11/27] tcg: Move TCG_TYPE_COUNT outside enum

2022-12-13 Thread Richard Henderson
The count is not itself an enumerator. Move it outside to prevent the compiler from considering it with -Wswitch-enum. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v4 27/27] tcg: Add TCGHelperInfo argument to tcg_out_call

2022-12-13 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 v4 01/27] tcg: Fix tcg_reg_alloc_dup*

2022-12-13 Thread Richard Henderson
The assignment to mem_coherent should be done with any modification, not simply with a newly allocated register. Signed-off-by: Richard Henderson --- tcg/tcg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 05d2b70ab7..371908b34b 100644 ---

[PATCH v4 04/27] tcg: Introduce paired register allocation

2022-12-13 Thread Richard Henderson
There are several instances where we need to be able to allocate a pair of registers to related inputs/outputs. Add 'p' and 'm' register constraints for this, in order to be able to allocate the even/odd register first or second. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +

Re: [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard

2022-12-13 Thread Stefan Hajnoczi
On Mon, Dec 12, 2022 at 05:09:47PM -0500, Jon Maloy wrote: > We add three new configuration flags, LIBCACARD, USB_SMARTCARD_PASSTHRU > and USB_SMARTCARD_EMULATED in order to improve configurability of these > functionalities. > > Signed-off-by: Jon Maloy > > --- > v2: Added a LIBACARD flag,

Re: [PATCH v5 1/2] io: Add support for MSG_PEEK for socket channel

2022-12-13 Thread Peter Xu
On Wed, Nov 23, 2022 at 05:27:34PM +, manish.mishra wrote: > MSG_PEEK reads from the peek of channel, The data is treated as > unread and the next read shall still return this data. This > support is currently added only for socket class. Extra parameter > 'flags' is added to io_readv calls to

Re: [PATCH v2 2/5] Support format or cache specific out file

2022-12-13 Thread Nir Soffer
On Tue, Dec 13, 2022 at 8:09 PM Hanna Reitz wrote: > > On 13.12.22 16:56, Nir Soffer wrote: > > On Mon, Dec 12, 2022 at 12:38 PM Hanna Reitz wrote: > >> On 28.11.22 15:15, Nir Soffer wrote: > >>> Extend the test finder to find tests with format (*.out.qcow2) or cache > >>> specific

Re: [PATCH] linux-user: Enhance /proc/cpuinfo output for sparc, hppa and m68k

2022-12-13 Thread Helge Deller
On 12/13/22 20:31, Laurent Vivier wrote: Le 13/12/2022 à 17:10, Helge Deller a écrit : The sparc, hppa and m68k architectures provide an own output for the emulated /proc/cpuinfo file. Some userspace applications count (even if that's not the recommended way) the number of lines which start

Re: [PATCH] linux-user: Enhance /proc/cpuinfo output for sparc, hppa and m68k

2022-12-13 Thread Laurent Vivier
Le 13/12/2022 à 17:10, Helge Deller a écrit : The sparc, hppa and m68k architectures provide an own output for the emulated /proc/cpuinfo file. Some userspace applications count (even if that's not the recommended way) the number of lines which start with "processor:" and assume that this

Re: [PATCH v2] qga-win: choose the right libpcre version to include in MSI package

2022-12-13 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk Tested-by: Konstantin Kostiuk On Tue, Dec 13, 2022 at 5:13 PM Andrey Drobyshev < andrey.drobys...@virtuozzo.com> wrote: > According to GLib changelog [1], since version 2.73.2 GLib is using > libpcre2 instead of libpcre. As a result, qemu-ga MSI installation >

[PATCH 6/6] target/arm: cleanup cpu includes

2022-12-13 Thread Fabiano Rosas
From: Claudio Fontana Remove some unused headers. Signed-off-by: Claudio Fontana Acked-by: Richard Henderson [added back some includes that are still needed at this point] Signed-off-by: Fabiano Rosas --- Originally from https://lore.kernel.org/r/20210416162824.25131-1-cfont...@suse.de

[PATCH 5/6] target/arm: Remove unused includes from helper.c

2022-12-13 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- This was extracted from the following patch in the series https://lore.kernel.org/r/20210416162824.25131-1-cfont...@suse.de [RFC v14 37/80] target/arm: move exception code out of tcg/helper.c --- target/arm/helper.c | 7 --- 1 file changed, 7 deletions(-)

[PATCH 4/6] target/arm: Remove unused includes from m_helper.c

2022-12-13 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- This was extracted from the following patch in the series https://lore.kernel.org/r/20210416162824.25131-1-cfont...@suse.de [RFC v14 08/80] target/arm: tcg: split m_helper user-only and sysemu-only parts --- target/arm/m_helper.c | 16 1 file

[PATCH 2/6] target/arm: Fix checkpatch space errors in helper.c

2022-12-13 Thread Fabiano Rosas
Fix the following: ERROR: spaces required around that '|' (ctx:VxV) ERROR: space required before the open parenthesis '(' ERROR: spaces required around that '+' (ctx:VxB) ERROR: space prohibited between function name and open parenthesis '(' (the last two still have some occurrences in macros

[PATCH 1/6] target/arm: Fix checkpatch comment style warnings in helper.c

2022-12-13 Thread Fabiano Rosas
Fix these: WARNING: Block comments use a leading /* on a separate line WARNING: Block comments use * on subsequent lines WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Fabiano Rosas --- This is roughly a combination of the following patches from

[PATCH 0/6] target/arm: general cleanups

2022-12-13 Thread Fabiano Rosas
Hi folks, I'm splitting this big series from Claudio from last year into more manageable chunks (at least for me): https://lore.kernel.org/r/20210416162824.25131-1-cfont...@suse.de This is the first chunk with only the most trivial patches that make sense even without the kvm/tcg and

[PATCH 3/6] target/arm: Fix checkpatch brace errors in helper.c

2022-12-13 Thread Fabiano Rosas
Fix this: ERROR: braces {} are necessary for all arms of this statement Signed-off-by: Fabiano Rosas --- target/arm/helper.c | 67 - 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index

Re: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32()

2022-12-13 Thread Cédric Le Goater
On 12/13/22 18:23, Peter Maydell wrote: On Tue, 13 Dec 2022 at 16:53, Cédric Le Goater wrote: On 12/13/22 17:27, Richard Henderson wrote: On 12/13/22 10:21, Peter Maydell wrote: It does seem odd, though. We have a value in host endianness (the EPAPR_MAGIC constant, which is host-endian by

Re: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32()

2022-12-13 Thread BALATON Zoltan
On Tue, 13 Dec 2022, Peter Maydell wrote: On Tue, 13 Dec 2022 at 16:53, Cédric Le Goater wrote: On 12/13/22 17:27, Richard Henderson wrote: On 12/13/22 10:21, Peter Maydell wrote: It does seem odd, though. We have a value in host endianness (the EPAPR_MAGIC constant, which is host-endian by

Re: [PATCH v2 2/5] Support format or cache specific out file

2022-12-13 Thread Hanna Reitz
On 13.12.22 16:56, Nir Soffer wrote: On Mon, Dec 12, 2022 at 12:38 PM Hanna Reitz wrote: On 28.11.22 15:15, Nir Soffer wrote: Extend the test finder to find tests with format (*.out.qcow2) or cache specific (*.out.nocache) out file. This worked before only for the numbered tests. ---

Re: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32()

2022-12-13 Thread Edgar E. Iglesias
On Tue, Dec 13, 2022 at 05:23:06PM +, Peter Maydell wrote: > On Tue, 13 Dec 2022 at 16:53, Cédric Le Goater wrote: > > > > On 12/13/22 17:27, Richard Henderson wrote: > > > On 12/13/22 10:21, Peter Maydell wrote: > > >> It does seem odd, though. We have a value in host endianness > > >> (the

Re: [PATCH v13 4/7] s390x/cpu_topology: CPU topology migration

2022-12-13 Thread Pierre Morel
On 12/13/22 14:26, Christian Borntraeger wrote: Am 08.12.22 um 10:44 schrieb Pierre Morel: The migration can only take place if both source and destination of the migration both use or both do not use the CPU topology facility. We indicate a change in topology during migration postload for

Re: [PATCH v13 0/7] s390x: CPU Topology

2022-12-13 Thread Pierre Morel
On 12/13/22 16:31, Janis Schoetterl-Glausch wrote: On Tue, 2022-12-13 at 16:12 +0100, Christian Borntraeger wrote: Am 13.12.22 um 14:50 schrieb Christian Borntraeger: Am 12.12.22 um 11:01 schrieb Pierre Morel: On 12/9/22 15:45, Cédric Le Goater wrote: On 12/8/22 10:44, Pierre Morel

Re: [PATCH v13 0/7] s390x: CPU Topology

2022-12-13 Thread Pierre Morel
On 12/13/22 14:41, Christian Borntraeger wrote: Am 12.12.22 um 11:17 schrieb Thomas Huth: On 12/12/2022 11.10, Pierre Morel wrote: On 12/12/22 10:07, Thomas Huth wrote: On 12/12/2022 09.51, Pierre Morel wrote: On 12/9/22 14:32, Thomas Huth wrote: On 08/12/2022 10.44, Pierre Morel

Re: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32()

2022-12-13 Thread Peter Maydell
On Tue, 13 Dec 2022 at 16:53, Cédric Le Goater wrote: > > On 12/13/22 17:27, Richard Henderson wrote: > > On 12/13/22 10:21, Peter Maydell wrote: > >> It does seem odd, though. We have a value in host endianness > >> (the EPAPR_MAGIC constant, which is host-endian by virtue of > >> being a C

Re: [PATCH v2] linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise()

2022-12-13 Thread Ilya Leoshkevich
On Tue, Dec 13, 2022 at 06:03:09PM +0100, Helge Deller wrote: > Both parameters have a different value on the parisc platform, so first > translate the target value into a host value for usage in the native > madvise() syscall. > > Those parameters are often used by security sensitive

Re: [PATCH v2 19/27] target/s390x: Introduce help_goto_indirect

2022-12-13 Thread Ilya Leoshkevich
On Sun, Dec 11, 2022 at 09:27:54AM -0600, Richard Henderson wrote: > Add a small helper to handle unconditional indirect jumps. > > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/translate.c | 19 ++- > 1 file changed, 10 insertions(+), 9 deletions(-) Reviewed-by:

Re: [PATCH v2 14/27] target/s390x: Assert masking of psw.addr in cpu_get_tb_cpu_state

2022-12-13 Thread Ilya Leoshkevich
On Sun, Dec 11, 2022 at 09:27:49AM -0600, Richard Henderson wrote: > When changing modes via SAM, we raise a specification exception if the > new PC is out of range. The masking in s390x_tr_init_disas_context > was too late to be correct, but may be removed. Add a debugging > assert in

[PATCH v2] linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise()

2022-12-13 Thread Helge Deller
Both parameters have a different value on the parisc platform, so first translate the target value into a host value for usage in the native madvise() syscall. Those parameters are often used by security sensitive applications (e.g. tor browser, boringssl, ...) which expect the call to return a

Re: [PATCH v4 25/27] tcg/s390x: Tighten constraints for 64-bit compare

2022-12-13 Thread Ilya Leoshkevich
On Tue, Dec 13, 2022 at 10:43:07AM -0600, Richard Henderson wrote: > On 12/13/22 10:25, Ilya Leoshkevich wrote: > > On Thu, Dec 08, 2022 at 08:05:28PM -0600, Richard Henderson wrote: > > > Give 64-bit comparison second operand a signed 33-bit immediate. > > > This is the smallest superset of

Re: [RFC PATCH-for-8.0 0/3] hw/ppc: Remove tswap() calls

2022-12-13 Thread Cédric Le Goater
On 12/13/22 13:52, Philippe Mathieu-Daudé wrote: Hi, I am trying to remove the tswap() API from system emulation and replace it by more meaningful calls, because tswap depends on the host endianness, and this detail should be irrelevant from the system emulation PoV. In this RFC series I'm

Re: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32()

2022-12-13 Thread Cédric Le Goater
On 12/13/22 17:27, Richard Henderson wrote: On 12/13/22 10:21, Peter Maydell wrote: On Tue, 13 Dec 2022 at 16:14, Richard Henderson wrote: On 12/13/22 10:10, Philippe Mathieu-Daudé wrote: On 13/12/22 17:00, Richard Henderson wrote: On 12/13/22 06:52, Philippe Mathieu-Daudé wrote: Assuming

Re: QEMU function trace

2022-12-13 Thread Alex Bennée
wanghw364 writes: > Hi all, > > Does qemu-system-riscv64 have any plugin or tools that can support target > program function trace feature? > > It seems there is no such feature under > link:https://gitlab.com/qemu-project/qemu/-/blob/master/docs/devel/tcg-plugins.rst > > > For example, we

Re: [PATCH v4 25/27] tcg/s390x: Tighten constraints for 64-bit compare

2022-12-13 Thread Richard Henderson
On 12/13/22 10:25, Ilya Leoshkevich wrote: On Thu, Dec 08, 2022 at 08:05:28PM -0600, Richard Henderson wrote: Give 64-bit comparison second operand a signed 33-bit immediate. This is the smallest superset of uint32_t and int32_t, as used by CLGFI and CGFI respectively. The rest of the 33-bit

Re: [PATCH-for-8.0 4/4] hw/ppc/spapr_ovec: Avoid target_ulong spapr_ovec_parse_vector()

2022-12-13 Thread Harsh Prateek Bora
On 12/13/22 18:05, Philippe Mathieu-Daudé wrote: spapr_ovec.c is a device, but it uses target_ulong which is target specific. The hwaddr type (declared in "exec/hwaddr.h") better fits hardware addresses. Change spapr_ovec_parse_vector() to take a hwaddr argument, allowing the removal of

Re: [PATCH v1 14/24] vfio-user: get and set IRQs

2022-12-13 Thread Cédric Le Goater
On 11/9/22 00:13, John Johnson wrote: Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.c | 7 ++- hw/vfio/user-protocol.h | 25 + hw/vfio/user.c | 135

Re: Single system binary & Dynamic machine model (KVM developers conference call 2022-12-13)

2022-12-13 Thread Peter Maydell
On Tue, 13 Dec 2022 at 16:34, Felipe Franciosi wrote: > > > > On 13 Dec 2022, at 14:08, Philippe Mathieu-Daudé wrote: > > > > We moved the call here: > > > > https://teams.microsoft.com/_#/pre-join-calling/19:meeting_MjU2NDhkOGYtOGY5ZC00MzRjLWJjNjgtYWI2ODQxZGExMWNj@thread.v2 > > Just wondering:

Re: Single system binary & Dynamic machine model (KVM developers conference call 2022-12-13)

2022-12-13 Thread Alex Bennée
Juan Quintela writes: > Philippe Mathieu-Daudé wrote: >> On 12/12/22 00:41, Philippe Mathieu-Daudé wrote: >>> Hi, >>> In the last years we had few discussions on "simplifying" QEMU >>> (system emulation / virtualization), in particular for the >>> "management layer". >>> Some of us are

  1   2   3   >