[PULL 00/20] tcg patch queue

2022-09-01 Thread Richard Henderson
-20220901 for you to fetch changes up to 20011be2e30b8aa8ef1fc258485f00c688703deb: target/riscv: Make translator stop before the end of a page (2022-09-01 07:43:08 +0100) Respect PROT_EXEC in user-only mode. Fix s390x, i386 and riscv

[PULL 10/20] accel/tcg: Make tb_htable_lookup static

2022-09-01 Thread Richard Henderson
The function is not used outside of cpu-exec.c. Move it and its subroutines up in the file, before the first use. Reviewed-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 3 - accel/tcg/cpu-exec.c

[PULL 1/4] target/avr: Support probe argument to tlb_fill

2022-09-01 Thread Richard Henderson
While there are no target-specific nonfaulting probes, generic code may grow some uses at some point. Note that the attrs argument was incorrect -- it should have been MEMTXATTRS_UNSPECIFIED. Just use the simpler interface. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson

[PULL 4/4] target/avr: Disable interrupts when env->skip set

2022-09-01 Thread Richard Henderson
This bit is not saved across interrupts, so we must delay delivering the interrupt until the skip has been processed. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1118 Reviewed-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson ---

[PULL 08/20] accel/tcg: Properly implement get_page_addr_code for user-only

2022-09-01 Thread Richard Henderson
The current implementation is a no-op, simply returning addr. This is incorrect, because we ought to be checking the page permissions for execution. Make get_page_addr_code inline for both implementations. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Acked-by: Alistair Francis

[PATCH v3 00/23] target/i386: make SSE helpers generic in the vector size

2022-09-01 Thread Paolo Bonzini
This is the first half of Paul's series from last April, reorganized so that there is no need for YMM_ONLY and SHIFT == 2 does not appear yet. This means that it is independent of Paul's implementation of AVX decoding. This generally uses loops that apply the same code for all of MMX/SSE/AVX,

[PATCH] docs: clarify absence of set_features in vhost-user

2022-09-01 Thread Alyssa Ross
The previous wording was (at least to me) ambiguous about whether a backend should enable features immediately after they were set using VHOST_USER_SET_PROTOCOL_FEATURES, or wait for support for protocol features to be acknowledged if it hasn't been yet before enabling those features. This patch

[PATCH] target/i386: rewrite destructive 3DNow operations

2022-09-01 Thread Paolo Bonzini
Remove use of the MOVE macro, since it will be purged from MMX/SSE as well. Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index

[PATCH v3 17/23] i386: reimplement AVX comparison helpers

2022-09-01 Thread Paolo Bonzini
From: Paul Brook AVX includes an additional set of comparison predicates, some of which our softfloat implementation does not expose as separate functions. Rewrite the helpers in terms of floatN_compare for future extensibility. Signed-off-by: Paul Brook Reviewed-by: Richard Henderson

[PATCH v3 14/23] i386: Misc integer AVX helper prep

2022-09-01 Thread Paolo Bonzini
From: Paul Brook More preparatory work for AVX support in various integer vector helpers No functional changes to existing helpers. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-13-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini ---

Re: [PATCH v3 07/23] i386: check SSE table flags instead of hardcoding opcodes

2022-09-01 Thread Richard Henderson
On 9/1/22 08:48, Paolo Bonzini wrote: Put more flags to work to avoid hardcoding lists of opcodes. The op7 case for SSE_OPF_CMP is included for homogeneity and because AVX needs it, but it is never used by SSE or MMX. Extracted from a patch by Paul Brook. Signed-off-by: Paolo Bonzini ---

Re: [PATCH 33/51] tests/qtest: {ahci, ide}-test: Use relative path for temporary files

2022-09-01 Thread Marc-André Lureau
On Wed, Aug 24, 2022 at 2:55 PM Bin Meng wrote: > From: Bin Meng > > These test cases uses "blkdebug:path/to/config:path/to/image" for > testing. On Windows, absolute file paths contain the delimiter ':' > which causes the blkdebug filename parser fail to parse filenames. > > hmm.. maybe it

Re: [PATCH v5 12/18] dump/dump: Add section string table support

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:11 +, Janosch Frank wrote: > As sections don't have a type like the notes do we need another way to > determine their contents. The string table allows us to assign each > section an identification string which architectures can then use to > tag their sections with. >

[PULL 13/20] accel/tcg: Document the faulting lookup in tb_lookup_cmp

2022-09-01 Thread Richard Henderson
It was non-obvious to me why we can raise an exception in the middle of a comparison function, but it works. While nearby, use TARGET_PAGE_ALIGN instead of open-coding. Acked-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 11 ++- 1 file changed, 10

[PULL 14/20] accel/tcg: Remove translator_ldsw

2022-09-01 Thread Richard Henderson
The only user can easily use translator_lduw and adjust the type to signed during the return. Reviewed-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/exec/translator.h | 1 - target/i386/tcg/translate.c | 2 +- 2

Re: [PATCH v4 0/4] Enable unix socket support on Windows

2022-09-01 Thread Marc-André Lureau
Hi On Thu, Sep 1, 2022 at 10:13 AM Bin Meng wrote: > > Hi, > > On Tue, Aug 2, 2022 at 3:52 PM Bin Meng wrote: > > > > Support for the unix socket has existed both in BSD and Linux for the > > longest time, but not on Windows. Since Windows 10 build 17063 [1], > > the native support for the unix

[PATCH v3 05/23] i386: Rework sse_op_table6/7

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Add a flags field each row in sse_op_table6 and sse_op_table7. Initially this is only used as a replacement for the magic SSE41_SPECIAL pointer. The other flags are mostly relevant for the AVX implementation but can be applied to SSE as well. Signed-off-by: Paul Brook

Re: [PATCH 04/51] semihosting/arm-compat-semi: Avoid using hardcoded /tmp

2022-09-01 Thread Bin Meng
On Wed, Aug 31, 2022 at 8:59 PM Marc-André Lureau wrote: > > Hi > > On Wed, Aug 24, 2022 at 1:54 PM Bin Meng wrote: >> >> From: Bin Meng >> >> Use g_get_tmp_dir() to get the directory to use for temporary files. >> >> Signed-off-by: Bin Meng >> --- >> >> semihosting/arm-compat-semi.c | 3 ++-

[PATCH v3 09/23] i386: Add size suffix to vector FP helpers

2022-09-01 Thread Paolo Bonzini
For AVX we're going to need both 128 bit (xmm) and 256 bit (ymm) variants of floating point helpers. Add the register type suffix to the existing *PS and *PD helpers (SS and SD variants are only valid on 128 bit vectors) No functional changes. Signed-off-by: Paul Brook Message-Id:

[PATCH v3 10/23] i386: do not cast gen_helper_* function pointers

2022-09-01 Thread Paolo Bonzini
Use a union to store the various possible kinds of function pointers, and access the correct one based on the flags. SSEOpHelper_table6 and SSEOpHelper_table7 right now only have one case, but this would change with AVX's 3- and 4-argument operations. Use unions there too, to keep the code more

Re: [PATCH v3 23/23] i386: AVX+AES helpers prep

2022-09-01 Thread Richard Henderson
On 9/1/22 08:48, Paolo Bonzini wrote: From: Paul Brook Make the AES vector helpers AVX ready No functional changes to existing helpers Signed-off-by: Paul Brook Message-Id:<20220424220204.2493824-22-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 41

[PATCH v2 01/10] qapi: fix example of query-ballon command

2022-09-01 Thread Victor Toso
Example output has an extra ',' delimiter. Fix it. Problem was noticed when trying to load the example into python's json library. Signed-off-by: Victor Toso --- qapi/machine.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index

[PATCH] qio: fix command spawn RDONLY/WRONLY

2022-09-01 Thread marcandre . lureau
From: Marc-André Lureau The in/out handling is inverted, although nothing seemed to notice that yet. Signed-off-by: Marc-André Lureau --- io/channel-command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/channel-command.c b/io/channel-command.c index

[PATCH] tests: mark io-command test as skipped if socat is missing

2022-09-01 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/unit/test-io-channel-command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/test-io-channel-command.c b/tests/unit/test-io-channel-command.c index 99056e07c0..aa09c559cd 100644 ---

[PATCH] io/command: implement portable spawn

2022-09-01 Thread marcandre . lureau
From: Marc-André Lureau Using GLib spawn API is both simpler and portable. Signed-off-by: Marc-André Lureau --- io/channel-command.c | 115 --- 1 file changed, 21 insertions(+), 94 deletions(-) diff --git a/io/channel-command.c b/io/channel-command.c

Re: [PATCH 41/51] tests/qtest: migration-test: Kill "to" after migration is canceled

2022-09-01 Thread Marc-André Lureau
Hi On Wed, Aug 24, 2022 at 10:56 PM Dr. David Alan Gilbert wrote: > * Bin Meng (bmeng...@gmail.com) wrote: > > From: Xuzhou Cheng > > > > Make sure QEMU process "to" is killed before launching another target > > for migration in the test_multifd_tcp_cancel case. > > > > Signed-off-by: Xuzhou

[PULL 17/20] target/s390x: Make translator stop before the end of a page

2022-09-01 Thread Richard Henderson
From: Ilya Leoshkevich Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id:

[PULL 12/20] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp

2022-09-01 Thread Richard Henderson
Simplify the implementation of get_page_addr_code_hostp by reusing the existing probe_access infrastructure. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 76 -- 1 file changed, 26

[PATCH v3 08/23] i386: isolate MMX code more

2022-09-01 Thread Paolo Bonzini
Extracted from a patch by Paul Brook . Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 52 +++-- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/target/i386/tcg/translate.c

[PATCH v3 15/23] i386: Destructive vector helpers for AVX

2022-09-01 Thread Paolo Bonzini
From: Paul Brook These helpers need to take special care to avoid overwriting source values before the wole result has been calculated. Currently they use a dummy Reg typed variable to store the result then assign the whole register. This will cause 128 bit operations to corrupt the upper half

[PATCH v3 22/23] i386: AVX pclmulqdq prep

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Make the pclmulqdq helper AVX ready Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-21-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 29 ++--- 1 file changed, 22 insertions(+), 7

Re: [PATCH] target/i386: rewrite destructive 3DNow operations

2022-09-01 Thread Richard Henderson
On 9/1/22 08:11, Paolo Bonzini wrote: Remove use of the MOVE macro, since it will be purged from MMX/SSE as well. Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) Reviewed-by: Richard Henderson

Re: [PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32

2022-09-01 Thread Marc-André Lureau
Hi On Wed, Aug 24, 2022 at 2:03 PM Bin Meng wrote: > From: Bin Meng > > On Windows, the MinGW provided mkstemp() API opens the file with > exclusive access, denying other processes to read/write the file. > Such behavior prevents the QEMU executable from opening the file, > (e.g.: CreateFile

[PING PATCH v2] linux-user: Passthrough MADV_DONTNEED for certain file mappings

2022-09-01 Thread Ilya Leoshkevich
On Mon, 2022-07-25 at 14:50 +0200, Ilya Leoshkevich wrote: > This is a follow-up for commit 892a4f6a750a ("linux-user: Add partial > support for MADV_DONTNEED"), which added passthrough for anonymous > mappings. File mappings can be handled in a similar manner. > > In order to do that, mark

Re: [PATCH v5 13/18] dump/dump: Add arch section support

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:11 +, Janosch Frank wrote: > Add hooks which architectures can use to add arbitrary data to custom > sections. > > Signed-off-by: Janosch Frank > --- > dump/dump.c| 120 ++--- > include/sysemu/dump-arch.h | 3 + > 2

Re: [PATCH v5 15/18] s390x: Add protected dump cap

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:11 +, Janosch Frank wrote: > Add a protected dump capability for later feature checking. > > Signed-off-by: Janosch Frank > Reviewed-by: Steffen Eiden Reviewed-by: Janis Schoetterl-Glausch

Re: [PATCH v5 17/18] s390x: Add KVM PV dump interface

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:11 +, Janosch Frank wrote: > Let's add a few bits of code which hide the new KVM PV dump API from > us via new functions. > > Signed-off-by: Janosch Frank Reviewed-by: Janis Schoetterl-Glausch

[PATCH] hw/pci-bridge: Fix brace Werror with clang 6.0.0

2022-09-01 Thread Chenyi Qiang
Two warnings are: /hw/pci-bridge/cxl_downstream.c:101:51: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] dvsec = (uint8_t *)&(CXLDVSECPortExtensions){ 0 }; ^

Re: [PATCH] qio: fix command spawn RDONLY/WRONLY

2022-09-01 Thread Marc-André Lureau
Hi On Thu, Sep 1, 2022 at 2:32 PM Daniel P. Berrangé wrote: > On Thu, Sep 01, 2022 at 02:11:20PM +0400, marcandre.lur...@redhat.com > wrote: > > From: Marc-André Lureau > > > > The in/out handling is inverted, although nothing seemed to notice that > yet. > > On the contrary, it is correct,

[PULL 3/4] target/avr: Only execute one interrupt at a time

2022-09-01 Thread Richard Henderson
We cannot deliver two interrupts simultaneously; the first interrupt handler must execute first. Reviewed-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/avr/helper.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git

[PATCH v3 13/23] i386: Rewrite simple integer vector helpers

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Rewrite the "simple" vector integer helpers in preperation for AVX support. While the current code is able to use the same prototype for unary (a = F(b)) and binary (a = F(b, c)) operations, future changes will cause them to diverge. No functional changes to existing helpers

[PATCH v3 04/23] i386: Rework sse_op_table1

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Add a flags field each row in sse_op_table1. Initially this is only used as a replacement for the magic SSE_SPECIAL and SSE_DUMMY pointers, the other flags are mostly relevant for the AVX implementation but can be applied to SSE as well. Signed-off-by: Paul Brook Message-Id:

[PATCH v3 19/23] i386: Destructive FP helpers for AVX

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Perpare the horizontal atithmetic vector helpers for AVX These currently use a dummy Reg typed variable to store the result then assign the whole register. This will cause 128 bit operations to corrupt the upper half of the register, so replace it with explicit temporaries and

[PATCH v3 18/23] i386: Dot product AVX helper prep

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Make the dpps and dppd helpers AVX-ready I can't see any obvious reason why dppd shouldn't work on 256 bit ymm registers, but both AMD and Intel agree that it's xmm only. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-17-p...@nowt.org> Reviewed-by: Richard

[PATCH v2 07/10] qapi: fix example of MEM_UNPLUG_ERROR event

2022-09-01 Thread Victor Toso
Example output was missing ',' delimiter. Fix it. Problem was noticed when trying to load the example into python's json library. Signed-off-by: Victor Toso --- qapi/machine.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index

[PATCH v2 04/10] qapi: fix example of BLOCK_JOB_READY event

2022-09-01 Thread Victor Toso
Example output is missing ',' delimiter. Fix it. Problem was noticed when trying to load the example into python's json library. Signed-off-by: Victor Toso --- qapi/block-core.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

Re: [PATCH 38/51] tests/qtest: {ahci, ide}-test: Open file in binary mode

2022-09-01 Thread Marc-André Lureau
Hi On Wed, Aug 24, 2022 at 3:08 PM Bin Meng wrote: > From: Xuzhou Cheng > > By default Windows opens file in text mode, while a POSIX compliant > implementation treats text files and binary files the same. > > The fopen() 'mode' string can include the letter 'b' to indicate > binary mode shall

Re: [PATCH v5 16/18] s390x: Introduce PV query interface

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:11 +, Janosch Frank wrote: > Introduce an interface over which we can get information about UV data. > > Signed-off-by: Janosch Frank > Reviewed-by: Steffen Eiden With the below fixed: Reviewed-by: Janis Schoetterl-Glausch > --- > hw/s390x/pv.c | 61

Re: [PATCH v1 15/25] Deprecate 32 bit big-endian MIPS

2022-09-01 Thread Alex Bennée
Thomas Huth writes: > On 26/08/2022 19.21, Alex Bennée wrote: >> - * - MIPS >> + * - MIPS (LE only) > > I'd replace "LE" with "little endian" - not everybody might know that > abbreviation. >> +''' >> + >> +A Debian 10 ("Buster") moved into LTS the big endian 32 bit

Re: [PATCH] qio: fix command spawn RDONLY/WRONLY

2022-09-01 Thread Daniel P . Berrangé
On Thu, Sep 01, 2022 at 02:11:20PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > The in/out handling is inverted, although nothing seemed to notice that yet. On the contrary, it is correct, and the unit tests validate this. > Signed-off-by: Marc-André Lureau > --- >

[PULL 09/20] accel/tcg: Unlock mmap_lock after longjmp

2022-09-01 Thread Richard Henderson
The mmap_lock is held around tb_gen_code. While the comment is correct that the lock is dropped when tb_gen_code runs out of memory, the lock is *not* dropped when an exception is raised reading code for translation. Acked-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya

[PULL 2/4] target/avr: Call avr_cpu_do_interrupt directly

2022-09-01 Thread Richard Henderson
There is no need to go through cc->tcg_ops when we know what value that must have. Reviewed-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/avr/helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PULL 06/20] tests/tcg/i386: Move smc_code2 to an executable section

2022-09-01 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to put this code into a section that is both writable and executable. Note that this test did not run on hardware beforehand either. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson

Re: [PATCH v1 12/16] qapi: fix example of blockdev-add command

2022-09-01 Thread Victor Toso
Hi, First of all, I'm happy that this patch got us into this discussion. On Wed, Aug 31, 2022 at 04:53:49PM +0200, Markus Armbruster wrote: > Victor Toso writes: > > > Hi, > > > > On Wed, Aug 31, 2022 at 03:16:54PM +0200, Markus Armbruster wrote: > >> Cc: Kevin for an improved chance of getting

[PATCH v3 12/23] i386: Rewrite vector shift helper

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Rewrite the vector shift helpers in preperation for AVX support (3 operand form and 256 bit vectors). For now keep the existing two operand interface. No functional changes to existing helpers. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-11-p...@nowt.org>

[PATCH v3 21/23] i386: Rewrite blendv helpers

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Rewrite the blendv helpers so that they can easily be extended to support the AVX encodings, which make all 4 arguments explicit. No functional changes to the existing helpers Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-20-p...@nowt.org> Reviewed-by: Richard

Re: [PATCH v5 18/18] s390x: pv: Add dump support

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:11 +, Janosch Frank wrote: > Sometimes dumping a guest from the outside is the only way to get the > data that is needed. This can be the case if a dumping mechanism like > KDUMP hasn't been configured or data needs to be fetched at a specific > point. Dumping a

[PATCH v2] target/sh4: Fix TB_FLAG_UNALIGN

2022-09-01 Thread Richard Henderson
The value previously chosen overlaps GUSA_MASK. Rename all DELAY_SLOT_* and GUSA_* defines to emphasize that they are included in TB_FLAGs. Add aliases for the FPSCR and SR bits that are included in TB_FLAGS, so that we don't accidentally reassign those bits. Fixes: 4da06fb3062 ("target/sh4:

Re: [PATCH v4 0/4] Enable unix socket support on Windows

2022-09-01 Thread Bin Meng
Hi, On Tue, Aug 2, 2022 at 3:52 PM Bin Meng wrote: > > Support for the unix socket has existed both in BSD and Linux for the > longest time, but not on Windows. Since Windows 10 build 17063 [1], > the native support for the unix socket has come to Windows. Starting > this build, two Win32

[PULL 04/20] linux-user: Honor PT_GNU_STACK

2022-09-01 Thread Richard Henderson
Map the stack executable if required by default or on demand. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/elf.h| 1 + linux-user/qemu.h| 1 + linux-user/elfload.c | 19 ++- 3 files changed, 20 insertions(+),

[PULL 16/20] accel/tcg: Add fast path for translator_ld*

2022-09-01 Thread Richard Henderson
Cache the translation from guest to host address, so we may use direct loads when we hit on the primary translation page. Look up the second translation page only once, during translation. This obviates another lookup of the second page within tb_gen_code after translation. Fixes a bug in that

[PULL 15/20] accel/tcg: Add pc and host_pc params to gen_intermediate_code

2022-09-01 Thread Richard Henderson
Pass these along to translator_loop -- pc may be used instead of tb->pc, and host_pc is currently unused. Adjust all targets at one time. Acked-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 1

[PATCH v3 06/23] i386: Move 3DNOW decoder

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Handle 3DNOW instructions early to avoid complicating the MMX/SSE logic. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-25-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 30

[PATCH v3 20/23] i386: Misc AVX helper prep

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Fixup various vector helpers that either trivially exten to 256 bit, or don't have 256 bit variants. No functional changes to existing helpers Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-19-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo

[PATCH v3 23/23] i386: AVX+AES helpers prep

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Make the AES vector helpers AVX ready No functional changes to existing helpers Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-22-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 41 ++--- 1 file

Re: [PATCH v3 12/23] i386: Rewrite vector shift helper

2022-09-01 Thread Richard Henderson
On 9/1/22 08:48, Paolo Bonzini wrote: From: Paul Brook Rewrite the vector shift helpers in preperation for AVX support (3 operand form and 256 bit vectors). For now keep the existing two operand interface. No functional changes to existing helpers. Signed-off-by: Paul Brook Message-Id:

Re: [Qemu-devel] [RFC PATCH] Add qemu .clang-format

2022-09-01 Thread Daniel P . Berrangé
On Thu, Sep 01, 2022 at 09:08:33AM +0800, Wang, Lei wrote: > On 8/31/2022 6:39 PM, Daniel P. Berrangé wrote: > > On Wed, Aug 31, 2022 at 05:18:34PM +0800, Wang, Lei wrote: > > > > > > > > > On 8/31/2022 4:49 PM, Daniel P. Berrangé wrote: > > > > On Wed, Aug 31, 2022 at 02:23:51PM +0800, Wang,

[PATCH v2 02/10] qapi: fix example of query-vnc command

2022-09-01 Thread Victor Toso
Example output has an extra ',' delimiter in member "websocket" and it lacks it in "family" member. Fix it. Problem was noticed when trying to load the example into python's json library. Signed-off-by: Victor Toso --- qapi/ui.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v2 00/10] qapi examples fixes, simplified version

2022-09-01 Thread Victor Toso
Hi, This is the follow up from v1. I've dropped a few patches that need further discussion. I plan to revisit those when submiting the generator again at a later time. v1: https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04525.html Changes in v2: * Dropped "qapi: fix example of

[PATCH v2 09/10] qapi: fix example of query-hotpluggable-cpus command

2022-09-01 Thread Victor Toso
The example return type has the wrong member name. Fix it. Problem was noticed when using the example as a test case for Go bindings. Signed-off-by: Victor Toso --- qapi/machine.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json

[PATCH v2 10/10] qapi: fix examples of events missing timestamp

2022-09-01 Thread Victor Toso
I've used real timestamp and changing them one by one so they would not be all equal. Problem was noticed when using the example as a test case for Go bindings. Signed-off-by: Victor Toso --- qapi/migration.json | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-)

[PATCH v2 08/10] qapi: fix examples of blockdev-add with qcow2

2022-09-01 Thread Victor Toso
The examples use "qcow2" driver with the wrong member name for BlockdevRef alternate type. This patch changes all wrong member names from "file" to "data-file" which is the correct member name in BlockdevOptionsQcow2 for the BlockdevRef field. Problem was noticed when using the example as a test

[PULL 01/20] linux-user/arm: Mark the commpage executable

2022-09-01 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to mark the commpage executable. We had been placing the commpage outside of reserved_va, which was incorrect and lead to an abort. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson ---

[PULL 07/20] accel/tcg: Introduce is_same_page()

2022-09-01 Thread Richard Henderson
From: Ilya Leoshkevich Introduce a function that checks whether a given address is on the same page as where disassembly started. Having it improves readability of the following patches. Reviewed-by: Alistair Francis Signed-off-by: Ilya Leoshkevich Message-Id:

[PULL 19/20] target/riscv: Add MAX_INSN_LEN and insn_len

2022-09-01 Thread Richard Henderson
These will be useful in properly ending the TB. Reviewed-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/riscv/translate.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git

[PULL 05/20] linux-user: Clear translations on mprotect()

2022-09-01 Thread Richard Henderson
From: Ilya Leoshkevich Currently it's possible to execute pages that do not have PAGE_EXEC if there is an existing translation block. Fix by invalidating TBs that touch the affected pages. Signed-off-by: Ilya Leoshkevich Message-Id: <20220817150506.592862-2-...@linux.ibm.com> Signed-off-by:

[PATCH v3 01/23] i386: do not use MOVL to move data between SSE registers

2022-09-01 Thread Paolo Bonzini
Write down explicitly the load/store sequence. Extracted from a patch by Paul Brook . Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c

[PATCH v3 02/23] i386: formatting fixes

2022-09-01 Thread Paolo Bonzini
Extracted from a patch by Paul Brook . Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 3237c1d8f9..25a2539d59

Re: [PATCH v3 15/23] i386: Destructive vector helpers for AVX

2022-09-01 Thread Richard Henderson
On 9/1/22 08:48, Paolo Bonzini wrote: From: Paul Brook These helpers need to take special care to avoid overwriting source values before the wole result has been calculated. Currently they use a dummy Reg typed variable to store the result then assign the whole register. This will cause 128

Re: [PATCH v3 10/23] i386: do not cast gen_helper_* function pointers

2022-09-01 Thread Richard Henderson
On 9/1/22 08:48, Paolo Bonzini wrote: #define OP(op, flags, a, b, c, d) \ -{flags, {a, b, c, d} } +{flags, {{.op = a}, {.op = b}, {.op = c}, {.op = d} } } It would have been handy to have uppercase macro args here, because .op looks like... struct SSEOpHelper_table1 {

[PATCH v2 03/10] qapi: fix example of query-dump-guest-memory-capability command

2022-09-01 Thread Victor Toso
Example output is missing closing curly brackets. Fix it. Problem was noticed when trying to load the example into python's json library. Signed-off-by: Victor Toso --- qapi/dump.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/dump.json b/qapi/dump.json index

Re: [PATCH v1 16/16] RFC: add a generator for qapi's examples

2022-09-01 Thread Victor Toso
Hi, On Wed, Aug 31, 2022 at 04:57:20PM +0200, Markus Armbruster wrote: > Victor Toso writes: > > > Hi, > > > > On Wed, Aug 31, 2022 at 02:01:54PM +0200, Markus Armbruster wrote: > >> Victor Toso writes: > >> > >> > The goal of this generator is to validate QAPI examples and transform > >> >

Re: [PATCH v5 06/18] dump: Rework dump_calculate_size function

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:10 +, Janosch Frank wrote: > dump_calculate_size() sums up all the sizes of the guest memory > blocks. Since we already have a function that calculates the size of a > single memory block (dump_get_memblock_size()) we can simply iterate > over the blocks and use the

Re: [PATCH v5 07/18] dump: Split elf header functions into prepare and write

2022-09-01 Thread Janis Schoetterl-Glausch
On Thu, 2022-08-11 at 12:11 +, Janosch Frank wrote: > Let's split the write from the modification of the elf header so we > can consolidate the write of the data in one function. > > Signed-off-by: Janosch Frank This is cosmetic only, right? Reviewed-by: Janis Schoetterl-Glausch

Re: [PATCH] tests: mark io-command test as skipped if socat is missing

2022-09-01 Thread Daniel P . Berrangé
On Thu, Sep 01, 2022 at 03:04:14PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Signed-off-by: Marc-André Lureau > --- > tests/unit/test-io-channel-command.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH 0/2] expose host-phys-bits to guest

2022-09-01 Thread Xiaoyao Li
On 8/31/2022 8:50 PM, Gerd Hoffmann wrote: When the guest (firmware specifically) knows how big the address space actually is it can be used better. Some more background: https://bugzilla.redhat.com/show_bug.cgi?id=2084533 QEMU enables host-phys-bits for "-cpu host/max" in

Re: [PATCH 03/51] block: Unify the get_tmp_filename() implementation

2022-09-01 Thread Bin Meng
Hi Marc-André, On Wed, Aug 31, 2022 at 8:54 PM Marc-André Lureau wrote: > > Hi Bin > > On Wed, Aug 24, 2022 at 1:42 PM Bin Meng wrote: >> >> From: Bin Meng >> >> At present get_tmp_filename() has platform specific implementations >> to get the directory to use for temporary files. Switch over

[PULL 20/20] target/riscv: Make translator stop before the end of a page

2022-09-01 Thread Richard Henderson
Right now the translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1155 Reviewed-by: Alistair Francis Acked-by: Ilya

[PULL 18/20] target/i386: Make translator stop before the end of a page

2022-09-01 Thread Richard Henderson
From: Ilya Leoshkevich Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. An implementation, like the one arm and s390x have, would require an i386 length

[PATCH v3 03/23] i386: Add ZMM_OFFSET macro

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Add a convenience macro to get the address of an xmm_regs element within CPUX86State. This was originally going to be the basis of an implementation that broke operations into 128 bit chunks. I scrapped that idea, so this is now a purely cosmetic change. But I think a

[PATCH v3 11/23] i386: Add CHECK_NO_VEX

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Reject invalid VEX encodings on MMX instructions. Signed-off-by: Paul Brook Reviewed-by: Richard Henderson Message-Id: <20220424220204.2493824-7-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 26 ++ 1 file changed, 26

[PATCH v3 16/23] i386: Floating point arithmetic helper AVX prep

2022-09-01 Thread Paolo Bonzini
From: Paul Brook Prepare the "easy" floating point vector helpers for AVX No functional changes to existing helpers. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-16-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 138

[PATCH v2 06/10] qapi: fix example of DEVICE_UNPLUG_GUEST_ERROR event

2022-09-01 Thread Victor Toso
Example output is missing a ',' delimiter and it has an extra ending curly bracket. Fix it. Problem was noticed when trying to load the example into python's json library. Signed-off-by: Victor Toso --- qapi/qdev.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

Re: [PATCH 34/51] tests/qtest: bios-tables-test: Adapt the case for win32

2022-09-01 Thread Marc-André Lureau
On Wed, Aug 24, 2022 at 3:02 PM Bin Meng wrote: > From: Bin Meng > > Single quotes in the arguments (oem_id='CRASH ') are not removed in > the Windows environment before it is passed to the QEMU executable. > The space in the argument causes the "-acpitable" option parser to > think that all of

[PATCH v2 05/10] qapi: fix example of NIC_RX_FILTER_CHANGED event

2022-09-01 Thread Victor Toso
Example output has an extra ending curly bracket. Fix it. Problem was noticed when trying to load the example into python's json library. Signed-off-by: Victor Toso --- qapi/net.json | 1 - 1 file changed, 1 deletion(-) diff --git a/qapi/net.json b/qapi/net.json index 75ba2cb989..dd088c09c5

Re: [PATCH 1/2] tpm_emulator: Use latest tpm_ioctl.h from swtpm project

2022-09-01 Thread Stefan Berger
On 8/31/22 07:36, Marc-André Lureau wrote: On Fri, Aug 26, 2022 at 7:52 PM Stefan Berger > wrote: Use the latest tpm_ioctl.h from upstream swtpm project. Signed-off-by: Stefan Berger mailto:stef...@linux.ibm.com>> Reviewed-by: Marc-André Lureau

Re: [PATCH 0/2] expose host-phys-bits to guest

2022-09-01 Thread Gerd Hoffmann
On Thu, Sep 01, 2022 at 10:36:19PM +0800, Xiaoyao Li wrote: > On 9/1/2022 9:58 PM, Gerd Hoffmann wrote: > > > > Anyway, IMO, guest including guest firmware, should always consult from > > > CPUID leaf 0x8008 for physical address length. > > > > It simply can't for the reason outlined above.

[PATCH 12/42] hw/isa/piix3: Remove unused include

2022-09-01 Thread Bernhard Beschow
Ammends commit 988fb613215993dd0ce642b89ca8182c479d39dd. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 0117f896d2..b54ff1c948 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -31,7 +31,6 @@

[PATCH 33/42] hw/isa/piix4: Prefix pci_slot_get_pirq() with "piix4_"

2022-09-01 Thread Bernhard Beschow
Prefixing with "piix4_" makes the method distinguishable from its PIIX3 counterpart upon merging and also complies more with QEMU conventions. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix4.c

[PATCH 42/42] hw/i386/acpi-build: Resolve PIIX ISA bridge rather than ACPI controller

2022-09-01 Thread Bernhard Beschow
Resolving the PIIX ISA bridge rather than the PIIX ACPI controller mirrors the ICH9 code one line below. Signed-off-by: Bernhard Beschow --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index

  1   2   3   4   >