[PATCH] configure: Add 'mkdir build' check

2023-02-04 Thread Dinah Baum
QEMU configure script goes into an infinite error printing loop when in read only directory due to 'build' dir never being created. Checking if 'mkdir dir' succeeds and if the directory is writeable prevents this error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/321 Signed-off-by: D

Re: [PATCH] KVM: dirty ring: check if vcpu is created before dirty_ring_reap_one

2023-02-04 Thread Weinan Liu
Sorry, this patch is wrong. kvm_dirty_ring_reap_locked holds slots_lock, which may result in deadlock at the moment when modifying memory_region. I am finding a better way to get known the finishing of all vcpus' creations before waking reaper up. > -原始邮件-发件人:"Weinan Liu" 发送时间:2023-02-

Re: [PATCH] KVM: dirty ring: check if vcpu is created before dirty_ring_reap_one

2023-02-04 Thread Weinan Liu
Sorry, this patch is wrong. kvm_dirty_ring_reap_locked holds slots_lock, which may result in deadlock at the moment when modifying memory_region. I am finding a better way to get known the finishing of all vcpus' creations before waking reaper up. > -原始邮件-发件人:"Weinan Liu" 发送时间:2023-02-

[PATCH v2] KVM: dirty ring: check if vcpu is created before dirty_ring_reap_one

2023-02-04 Thread Weinan Liu
Failed to assert '(dirty_gfns && ring_size)' in kvm_dirty_ring_reap_one if the vcpu has not been finished to create yet. This bug occasionally occurs when I open 200+ qemu instances on my 16G 6-cores x86 machine. And it must be triggered if inserting a 'sleep(10)' into kvm_vcpu_thread_fn as below--

[PATCH] linux-user: add support for xtensa FDPIC

2023-02-04 Thread Max Filippov
Define xtensa-specific info_is_fdpic and fill in FDPIC-specific registers in the xtensa version of init_thread. Signed-off-by: Max Filippov --- include/elf.h| 1 + linux-user/elfload.c | 16 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/elf.h b/

[PATCH 10/10] docs/fuzz: remove mentions of fork-based fuzzing

2023-02-04 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- docs/devel/fuzzing.rst | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/docs/devel/fuzzing.rst b/docs/devel/fuzzing.rst index 715330c856..3bfcb33fc4 100644 --- a/docs/devel/fuzzing.rst +++ b/docs/devel/fuzzing.rst @@

[PATCH 00/10] Retire Fork-Based Fuzzing

2023-02-04 Thread Alexander Bulekov
Hello, This series removes fork-based fuzzing. How does fork-based fuzzing work? * A single parent process initializes QEMU * We identify the devices we wish to fuzz (fuzzer-dependent) * Use QTest to PCI enumerate the devices * After that we start a fork-server which forks the process and execu

[PATCH 03/10] fuzz/generic-fuzz: use reboots instead of forks to reset state

2023-02-04 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/generic_fuzz.c | 106 +++- 1 file changed, 23 insertions(+), 83 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c index 7326f6840b..c2e5642150 100644 --- a/tests/qtest/fuzz

[PATCH 05/10] fuzz/virtio-scsi: remove fork-based fuzzer

2023-02-04 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/virtio_scsi_fuzz.c | 51 - 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/tests/qtest/fuzz/virtio_scsi_fuzz.c b/tests/qtest/fuzz/virtio_scsi_fuzz.c index b3220ef6cb..8b26e951ae 100644 --- a/tests/qt

[PATCH 07/10] fuzz/virtio-blk: remove fork-based fuzzer

2023-02-04 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/virtio_blk_fuzz.c | 51 -- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/tests/qtest/fuzz/virtio_blk_fuzz.c b/tests/qtest/fuzz/virtio_blk_fuzz.c index a9fb9ecf6c..82575a11d9 100644 --- a/tests/qtes

[PATCH 09/10] fuzz: remove fork-fuzzing scaffolding

2023-02-04 Thread Alexander Bulekov
Fork-fuzzing provides a few pros, but our implementation prevents us from using fuzzers other than libFuzzer, and may be causing issues such as coverage-failure builds on OSS-Fuzz. It is not a great long-term solution as it depends on internal implementation details of libFuzzer (which is no longer

[PATCH 08/10] fuzz/i440fx: remove fork-based fuzzer

2023-02-04 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/i440fx_fuzz.c | 27 +-- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/tests/qtest/fuzz/i440fx_fuzz.c b/tests/qtest/fuzz/i440fx_fuzz.c index b17fc725df..5d6a703481 100644 --- a/tests/qtest/fuzz/i440fx_fuz

[PATCH 04/10] fuzz/generic-fuzz: add a limit on DMA bytes written

2023-02-04 Thread Alexander Bulekov
As we have repplaced fork-based fuzzing, with reboots - we can no longer use a timeout+exit() to avoid slow inputs. Libfuzzer has its own timer that it uses to catch slow inputs, however these timeouts are usually seconds-minutes long: more than enough to bog-down the fuzzing process. However, I fo

[PATCH 02/10] fuzz: add fuzz_reboot API

2023-02-04 Thread Alexander Bulekov
As we are converting most fuzzers to rely on reboots to reset state, introduce an API to make sure reboots are invoked in a consistent manner. Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/fuzz.c | 6 ++ tests/qtest/fuzz/fuzz.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)

[PATCH 06/10] fuzz/virtio-net: remove fork-based fuzzer

2023-02-04 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/virtio_net_fuzz.c | 54 +++--- 1 file changed, 5 insertions(+), 49 deletions(-) diff --git a/tests/qtest/fuzz/virtio_net_fuzz.c b/tests/qtest/fuzz/virtio_net_fuzz.c index c2c15f07f0..d245ee66a1 100644 --- a/tests/qtes

[PATCH 01/10] hw/sparse-mem: clear memory on reset

2023-02-04 Thread Alexander Bulekov
We use sparse-mem for fuzzing. For long-running fuzzing processes, we eventually end up with many allocated sparse-mem pages. To avoid this, clear the allocated pages on system-reset. Signed-off-by: Alexander Bulekov --- hw/mem/sparse-mem.c | 13 - 1 file changed, 12 insertions(+), 1

[PATCH v6 4/4] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded

2023-02-04 Thread Alexander Bulekov
This protects devices from bh->mmio reentrancy issues. Reviewed-by: Darren Kenny Reviewed-by: Stefan Hajnoczi Signed-off-by: Alexander Bulekov --- hw/9pfs/xen-9p-backend.c| 4 +++- hw/block/dataplane/virtio-blk.c | 3 ++- hw/block/dataplane/xen-block.c | 5 +++-- hw/char/virtio-serial

[PATCH v6 3/4] checkpatch: add qemu_bh_new/aio_bh_new checks

2023-02-04 Thread Alexander Bulekov
Advise authors to use the _guarded versions of the APIs, instead. Reviewed-by: Darren Kenny Signed-off-by: Alexander Bulekov --- scripts/checkpatch.pl | 8 1 file changed, 8 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6ecabfb2b5..fbb71c70f8 100755 --

[PATCH v6 2/4] async: Add an optional reentrancy guard to the BH API

2023-02-04 Thread Alexander Bulekov
Devices can pass their MemoryReentrancyGuard (from their DeviceState), when creating new BHes. Then, the async API will toggle the guard before/after calling the BH call-back. This prevents bh->mmio reentrancy issues. Reviewed-by: Darren Kenny Signed-off-by: Alexander Bulekov --- docs/devel/mul

[PATCH v6 1/4] memory: prevent dma-reentracy issues

2023-02-04 Thread Alexander Bulekov
Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. This flag is set/checked prior to calling a device's MemoryRegion handlers, and set when device code initiates DMA. The purpose of this flag is to prevent two types of DMA-based reentrancy issues: 1.) mmio -> dma -> mmio cas

[PATCH v6 0/4] memory: prevent dma-reentracy issues

2023-02-04 Thread Alexander Bulekov
These patches aim to solve two types of DMA-reentrancy issues: 1.) mmio -> dma -> mmio case To solve this, we track whether the device is engaged in io by checking/setting a reentrancy-guard within APIs used for MMIO access. 2.) bh -> dma write -> mmio case This case is trickier, since we don

Re: [PULL 00/11] Net patches

2023-02-04 Thread Laurent Vivier
On 2/4/23 15:57, Peter Maydell wrote: On Thu, 2 Feb 2023 at 06:21, Jason Wang wrote: The following changes since commit 13356edb87506c148b163b8c7eb0695647d00c2a: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-01-24 09:45:33 +) are available in t

Re: [PULL 00/22] Linux user for 8.0 patches

2023-02-04 Thread Peter Maydell
low sendmsg() without IOV (2023-02-03 22:55:12 +0100) > > > linux-user branch pull request 20230204 > > Implement execveat() > un-parent OBJECT(cpu) when closing thread > Revert fix for glibc >= 2.36 sys/mount.h > Fix/update strace > move target_flat.h to target subd

Re: [PATCH] hw/ppc/pegasos2: Fix a typo in a comment

2023-02-04 Thread Daniel Henrique Barboza
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel On 2/3/23 16:43, BALATON Zoltan wrote: Reported-by: Stefan Weil Signed-off-by: BALATON Zoltan --- hw/ppc/pegasos2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c in

Re: [PATCH] tcg: Init temp_subindex in liveness_pass_2

2023-02-04 Thread Philippe Mathieu-Daudé
On 3/2/23 23:59, Richard Henderson wrote: Correctly handle large types while lowering. Fixes: fac87bd2a49b ("tcg: Add temp_subindex to TCGTemp") Signed-off-by: Richard Henderson --- tcg/tcg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index fd557d55d3..bc60fd0f

Re: [PATCH 4/4] pcie: add trace-poing for power indicator transitions

2023-02-04 Thread Vladimir Sementsov-Ogievskiy
Oops, sorry. Both [4] patches are equal, except for this one has a typo in subject -- Best regards, Vladimir

[PATCH 3/4] pcie: drop unused PCIExpressIndicator

2023-02-04 Thread Vladimir Sementsov-Ogievskiy
The structure type is unused. Also, it's the only user of corresponding macros, so drop them too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/hw/pci/pcie.h | 8 include/hw/pci/pcie_regs.h | 5 - 2 files changed, 13 deletions(-) diff --git a/include/hw/pci/pcie.h b/

[PATCH 2/4] pcie_regs: drop duplicated indicator value macros

2023-02-04 Thread Vladimir Sementsov-Ogievskiy
We already have indicator values in include/standard-headers/linux/pci_regs.h , no reason to reinvent them in include/hw/pci/pcie_regs.h. (and we already have usage of PCI_EXP_SLTCTL_PWR_IND_BLINK and PCI_EXP_SLTCTL_PWR_IND_OFF in hw/pci/pcie.c, so let's be consistent) Signed-off-by: Vladimir Seme

[PATCH 4/4] pcie: add trace-poing for power indicator transitions

2023-02-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pcie.c | 20 hw/pci/trace-events | 3 +++ 2 files changed, 23 insertions(+) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index ccdb2377e1..1a19368994 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -28,6 +28,7 @@

[PATCH 4/4] pcie: add trace-point for power indicator transitions

2023-02-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pcie.c | 20 hw/pci/trace-events | 3 +++ 2 files changed, 23 insertions(+) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index ccdb2377e1..1a19368994 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -28,6 +28,7 @@

[PATCH 1/4] pcie: pcie_cap_slot_write_config(): use correct macro

2023-02-04 Thread Vladimir Sementsov-Ogievskiy
PCI_EXP_SLTCTL_PIC_OFF is a value, and PCI_EXP_SLTCTL_PIC is a mask. Happily PCI_EXP_SLTCTL_PIC_OFF is a maximum value for this mask and is equal to the mask itself. Still the code looks like a bug. Let's make it more reader-friendly. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pcie.c

[PATCH 0/4] pcie: cleanup code and add trace point

2023-02-04 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is tiny code cleanup + on trace point to track power indicator changes (which may help to analyze "Hot-unplug failed: guest is busy (power indicator blinking)" error message). Vladimir Sementsov-Ogievskiy (4): pcie: pcie_cap_slot_write_config(): use correct macro pcie_regs: drop

Re: [PULL 0/1] M68k next patches

2023-02-04 Thread Peter Maydell
On Wed, 1 Feb 2023 at 09:54, Laurent Vivier wrote: > > The following changes since commit 13356edb87506c148b163b8c7eb0695647d00c2a: > > Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into > staging (2023-01-24 09:45:33 +) > > are available in the Git repository at: > >

Re: pixman_blt on aarch64

2023-02-04 Thread BALATON Zoltan
This has just bounced, I hoped to still be able to post after moderation but now I'm resending it after subscribing to the pixman list. Meanwhile I've found this ticket as well: https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/71 See the rest of the message below. Looks like this is

[PULL 10/40] include/qemu/int128: Use Int128 structure for TCI

2023-02-04 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.

[PULL 36/40] target/s390x: Implement CC_OP_NZ in gen_op_calc_cc

2023-02-04 Thread Richard Henderson
This case is trivial to implement inline. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 9ea28b3e52..ac5bd98f04 100644 --- a

[PULL 33/40] target/s390x: Use Int128 for returning float128

2023-02-04 Thread Richard Henderson
Acked-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- v2: Remove extraneous return_low128. --- target/s390x/helper.h| 22 +++--- target/s390x/tcg/insn-data.h.inc | 20 ++--- target/s390x/tcg/fpu_helper.c| 29

[PULL 01/40] accel/tcg: Test CPUJumpCache in tb_jmp_cache_clear_page

2023-02-04 Thread Richard Henderson
From: Eric Auger After commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization before registration"), it looks the CPUJumpCache pointer can be NULL. This causes a SIGSEV when running debug-wp-migration kvm unit test. At the first place it should be clarified why this TCG code is called with K

[PULL 30/40] target/s390x: Use Int128 for return from CKSM

2023-02-04 Thread Richard Henderson
Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/helper.h | 2 +- target/s390x/tcg/mem_helper.c | 7 +++ target/s390x/tcg/translate.c | 6 -- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/s3

[PULL 00/40] tcg patch queue

2023-02-04 Thread Richard Henderson
The following changes since commit 579510e196a544b42bd8bca9cc61688d4d1211ac: Merge tag 'pull-monitor-2023-02-03-v2' of https://repo.or.cz/qemu/armbru into staging (2023-02-04 10:19:55 +) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tc

[PULL 02/40] tcg: Init temp_subindex in liveness_pass_2

2023-02-04 Thread Richard Henderson
Correctly handle large types while lowering. Fixes: fac87bd2a49b ("tcg: Add temp_subindex to TCGTemp") Signed-off-by: Richard Henderson --- tcg/tcg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index fd557d55d3..bc60fd0fe8 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -

[PULL 13/40] tcg/tci: Add TCG_TARGET_CALL_{RET,ARG}_I128

2023-02-04 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

[PULL 31/40] target/s390x: Use Int128 for return from TRE

2023-02-04 Thread Richard Henderson
Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/helper.h | 2 +- target/s390x/tcg/mem_helper.c | 7 +++ target/s390x/tcg/translate.c | 7 +-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/target/s

[PULL 40/40] tcg/aarch64: Fix patching of LDR in tb_target_set_jmp_target

2023-02-04 Thread Richard Henderson
'offset' should be bits [23:5] of LDR instruction, rather than [4:0]. Fixes: d59d83a1c388 ("tcg/aarch64: Reorg goto_tb implementation") Reviewed-by: Zenghui Yu Reported-by: Zenghui Yu Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 de

[PULL 03/40] tcg: Define TCG_TYPE_I128 and related helper macros

2023-02-04 Thread Richard Henderson
Begin staging in support for TCGv_i128 with Int128. Define the type enumerator, the typedef, and the helper-head.h macros. This cannot yet be used, because you can't allocate temporaries of this new type. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Hender

[PULL 26/40] tests/tcg/s390x: Add cdsg.c

2023-02-04 Thread Richard Henderson
From: Ilya Leoshkevich Add a simple test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230201133257.3223115-1-...@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/s390x/cdsg.c | 93 + tests/tcg/s390x/Makefile.targe

[PULL 16/40] tcg: Add basic data movement for TCGv_i128

2023-02-04 Thread Richard Henderson
Add code generation functions for data movement between TCGv_i128 (mov) and to/from TCGv_i64 (concat, extract). Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 4 tcg/tcg-internal.h | 13 + tcg/tcg-op.

[PULL 39/40] target/i386: Inline cmpxchg16b

2023-02-04 Thread Richard Henderson
Use tcg_gen_atomic_cmpxchg_i128 for the atomic case, and tcg_gen_qemu_ld/st_i128 otherwise. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/helper.h | 4 --- target/i386/tcg/mem_helper.c | 69 target/i386/tcg/tra

[PULL 08/40] tcg: Introduce tcg_target_call_oarg_reg

2023-02-04 Thread Richard Henderson
Replace the flat array tcg_target_call_oarg_regs[] with a function call including the TCGCallReturnKind. Extend the set of registers for ARM to r0-r3 to match the ABI: https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#result-return Reviewed-by: Alex Bennée Reviewed-by: Daniel

[PULL 11/40] tcg/i386: Add TCG_TARGET_CALL_{RET,ARG}_I128

2023-02-04 Thread Richard Henderson
Fill in the parameters for the host ABI for Int128. Adjust tcg_target_call_oarg_reg for _WIN64, and tcg_out_call for i386 sysv. Allow TCG_TYPE_V128 stores without AVX enabled. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.h | 10 ++ tcg/i386/tcg-

[PULL 14/40] tcg: Add TCG_TARGET_CALL_{RET,ARG}_I128

2023-02-04 Thread Richard Henderson
Fill in the parameters for the host ABI for Int128 for those backends which require no extra modification. Reviewed-by: Alex Bennée Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 ++ tcg/arm/tcg-target.h | 2 ++ tcg/loongarch6

[PULL 21/40] target/arm: Use tcg_gen_atomic_cmpxchg_i128 for CASP

2023-02-04 Thread Richard Henderson
Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20221112042555.2622152-3-richard.hender...@linaro.org> --- target/arm/helper-a64.h| 2 -- target/arm/helper-a64.c| 43 --- target/arm/translate-a64.c | 61 +++

[PULL 04/40] tcg: Handle dh_typecode_i128 with TCG_CALL_{RET, ARG}_NORMAL

2023-02-04 Thread Richard Henderson
Many hosts pass and return 128-bit quantities like sequential 64-bit quantities. Treat this just like we currently break down 64-bit quantities for a 32-bit host. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tcg.c | 37 + 1 file changed,

[PULL 17/40] tcg: Add guest load/store primitives for TCGv_i128

2023-02-04 Thread Richard Henderson
These are not yet considering atomicity of the 16-byte value; this is a direct replacement for the current target code which uses a pair of 8-byte operations. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 10 +++ include/tcg/tcg-op.h| 2 + accel/

[PULL 12/40] tcg/tci: Fix big-endian return register ordering

2023-02-04 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. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson -

[PULL 15/40] tcg: Add temp allocation for TCGv_i128

2023-02-04 Thread Richard Henderson
This enables allocation of i128. The type is not yet usable, as we have not yet added data movement ops. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 32 + tcg/tcg.c | 60 +

[PULL 35/40] target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG

2023-02-04 Thread Richard Henderson
Acked-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/helper.h| 2 -- target/s390x/tcg/insn-data.h.inc | 2 +- target/s390x/tcg/mem_helper.c| 52 -- target/s390x/tcg/translate.c | 55 +++- 4 file

[PULL 37/40] target/i386: Split out gen_cmpxchg8b, gen_cmpxchg16b

2023-02-04 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 48 - 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 7e0b2a709a..a82131d635

[PULL 09/40] tcg: Add TCG_CALL_RET_BY_VEC

2023-02-04 Thread Richard Henderson
This will be used by _WIN64 to return i128. Not yet used, because allocation is not yet enabled. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 1 + tcg/tcg.c | 19 +++ 2 files changed, 20 insertions(+) diff --git a/tcg/tcg-interna

[PULL 38/40] target/i386: Inline cmpxchg8b

2023-02-04 Thread Richard Henderson
Use tcg_gen_atomic_cmpxchg_i64 for the atomic case, and tcg_gen_nonatomic_cmpxchg_i64 otherwise. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/helper.h | 2 -- target/i386/tcg/mem_helper.c | 57 ---

[PULL 20/40] target/arm: Use tcg_gen_atomic_cmpxchg_i128 for STXP

2023-02-04 Thread Richard Henderson
Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20221112042555.2622152-2-richard.hender...@linaro.org> --- target/arm/helper-a64.h| 6 --- target/arm/helper-a64.c| 104 - target/arm/translate-a64.c | 60 -

[PULL 19/40] tcg: Split out tcg_gen_nonatomic_cmpxchg_i{32,64}

2023-02-04 Thread Richard Henderson
Normally this is automatically handled by the CF_PARALLEL checks with in tcg_gen_atomic_cmpxchg_i{32,64}, but x86 has a special case of !PREFIX_LOCK where it always wants the non-atomic version. Split these out so that x86 does not have to roll its own. Reviewed-by: Alex Bennée Signed-off-by: Ri

[PULL 18/40] tcg: Add tcg_gen_{non}atomic_cmpxchg_i128

2023-02-04 Thread Richard Henderson
This will allow targets to avoid rolling their own. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/tcg-runtime.h | 11 + include/tcg/tcg-op.h | 5 +++ tcg/tcg-op.c | 85 +++

[PULL 25/40] tests/tcg/s390x: Add long-double.c

2023-02-04 Thread Richard Henderson
Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tests/tcg/s390x/long-double.c | 24 tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 25 insertions(+) create mode 100644 tests/tcg/s390x/long-double.c diff --

[PULL 07/40] tcg: Add TCG_CALL_{RET,ARG}_BY_REF

2023-02-04 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. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 3 + tcg/tcg.c | 135 -

[PULL 05/40] tcg: Allocate objects contiguously in temp_allocate_frame

2023-02-04 Thread Richard Henderson
When allocating a temp to the stack frame, consider the base type and allocate all parts at once. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tcg.c | 34 ++ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c

[PULL 22/40] target/ppc: Use tcg_gen_atomic_cmpxchg_i128 for STQCX

2023-02-04 Thread Richard Henderson
Note that the previous direct reference to reserve_val, - tcg_gen_ld_i64(t1, cpu_env, (ctx->le_mode -? offsetof(CPUPPCState, reserve_val2) -: offsetof(CPUPPCState, reserve_val))); was incorrect because all references should have go

[PULL 34/40] target/s390x: Use Int128 for passing float128

2023-02-04 Thread Richard Henderson
Acked-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- v2: Fix SPEC_in1_x1. --- target/s390x/helper.h| 32 ++-- target/s390x/tcg/insn-data.h.inc | 30 +-- target/s390x/tcg/fpu_helper.c| 88 ++--

[PULL 23/40] tests/tcg/s390x: Add div.c

2023-02-04 Thread Richard Henderson
From: Ilya Leoshkevich Add a basic test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <2022110300.2539919-1-...@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/s390x/div.c | 40 + tests/tcg/s390x/Makefile.target

[PULL 29/40] target/s390x: Use Int128 for return from CLST

2023-02-04 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Acked-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/helper.h | 2 +- target/s390x/tcg/mem_helper.c | 11 --- target/s390x/tcg/translate.c | 8 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git

[PULL 28/40] target/s390x: Use a single return for helper_divs64/u64

2023-02-04 Thread Richard Henderson
Pack the quotient and remainder into a single Int128. Use the divu128 primitive to remove the cpu_abort on 32-bit hosts. Reviewed-by: Philippe Mathieu-Daudé Acked-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- v2: Extended div test case to cover these insns. --- target/s390x/helper.

[PULL 27/40] target/s390x: Use a single return for helper_divs32/u32

2023-02-04 Thread Richard Henderson
Pack the quotient and remainder into a single uint64_t. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- v2: Fix operand ordering; use tcg_extr32_i64. --- target/s390x/helper.h | 2 +- target/s390x/tcg/int_helper.c | 26 ++

[PULL 06/40] tcg: Introduce tcg_out_addi_ptr

2023-02-04 Thread Richard Henderson
Implement the function for arm, i386, and s390x, which will use it. Add stubs for all other backends. Reviewed-by: Alex Bennée Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/tcg.c| 2 ++ tcg/aarch64/tcg-target.c.inc | 7 +++ tcg/

[PULL 24/40] tests/tcg/s390x: Add clst.c

2023-02-04 Thread Richard Henderson
From: Ilya Leoshkevich Add a basic test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20221025213008.2209006-2-...@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/s390x/clst.c | 82 + tests/tcg/s390x/Makefile.target

[PULL 32/40] target/s390x: Copy wout_x1 to wout_x1_P

2023-02-04 Thread Richard Henderson
Make a copy of wout_x1 before modifying it, as wout_x1_P emphasizing that it operates on the out/out2 pair. The insns that use x1_P are data movement that will not change to Int128. Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390

[PATCH] KVM: dirty ring: check if vcpu is created before dirty_ring_reap_one

2023-02-04 Thread Weinan Liu
From: Weinan Liu Failed to assert '(dirty_gfns && ring_size)' in kvm_dirty_ring_reap_one if the vcpu has not been finished to create yet. This bug occasionally occurs when I open 200+ qemu instances on my 16G 6-cores x86 machine. And it must be triggered if inserting a 'sleep(10)' into kvm_vcpu_t

[PULL 16/22] linux-user: Fix /proc/cpuinfo output for hppa

2023-02-04 Thread Laurent Vivier
From: Helge Deller The hppa architectures provides 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.

[PULL 03/22] linux-user/strace: Add output for execveat() syscall

2023-02-04 Thread Laurent Vivier
From: Drew DeVault Signed-off-by: Drew DeVault Message-Id: <20221104081015.706009-1-...@cmpwn.com> Suggested-by: Helge Deller [PMD: Split of bigger patch] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier Message-Id: <20221104173632.1052-4-phi...@linaro.org> Signed-off-by: Lau

[PULL 02/22] linux-user/strace: Extract print_execve_argv() from print_execve()

2023-02-04 Thread Laurent Vivier
From: Drew DeVault In order to add print_execveat() which re-use common code from print_execve(), extract print_execve_argv() from it. Signed-off-by: Drew DeVault Message-Id: <20221104081015.706009-1-...@cmpwn.com> [PMD: Split of bigger patch, filled description, fixed style] Signed-off-by: Phi

[PULL 17/22] linux-user: Improve strace output of personality() and sysinfo()

2023-02-04 Thread Laurent Vivier
From: Helge Deller Make the strace look nicer for those two syscalls. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: Signed-off-by: Laurent Vivier --- linux-user/strace.list | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PULL 12/22] linux-user: Add strace output for clock_getres_time64() and futex_time64()

2023-02-04 Thread Laurent Vivier
From: Helge Deller Add the two syscalls to strace output to avoid "Unknown syscall" message. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20230115113517.25143-1-del...@gmx.de> Signed-off-by: Laurent Vivier --- linux-user/strace.list | 6 ++ 1 file changed, 6 inser

[PULL 19/22] linux-user: Show 4th argument of rt_sigprocmask() in strace

2023-02-04 Thread Laurent Vivier
From: Helge Deller Add output for the missing 4th parameter (size_t sigsetsize). Signed-off-by: Helge Deller Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: Signed-off-by: Laurent Vivier --- linux-user/strace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PULL 06/22] linux-user: Add missing MAP_HUGETLB and MAP_STACK flags in strace

2023-02-04 Thread Laurent Vivier
From: Helge Deller Add two missing mmap flags. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: Signed-off-by: Laurent Vivier --- linux-user/strace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/strace.c b/linux-user/strace.c index 7bccb4f0c067..50272

[PULL 15/22] linux-user: Fix SO_ERROR return code of getsockopt()

2023-02-04 Thread Laurent Vivier
From: Helge Deller Add translation for the host error return code of: getsockopt(19, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [4]) = 0 This fixes the testsuite of the cockpit debian package with a hppa-linux guest on a x86-64 host. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson R

[PULL 09/22] linux-user: add more netlink protocol constants

2023-02-04 Thread Laurent Vivier
From: Letu Ren Currently, qemu strace only prints four protocol contants. This patch adds others listed in "linux/netlink.h". Signed-off-by: Letu Ren Message-Id: <20230101141105.12024-1-fantasq...@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 48 ++

[PULL 18/22] linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise()

2023-02-04 Thread Laurent Vivier
From: 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 th

[PULL 07/22] linux-user: un-parent OBJECT(cpu) when closing thread

2023-02-04 Thread Laurent Vivier
From: Richard Henderson This reinstates commit 52f0c1607671293afcdb2acc2f83e9bccbfa74bb: While forcing the CPU to unrealize by hand does trigger the clean-up code we never fully free resources because refcount never reaches zero. This is because QOM automatically added objects without an explici

[PULL 08/22] linux-user: fix strace build w/out munlockall

2023-02-04 Thread Laurent Vivier
From: Mike Frysinger Signed-off-by: Mike Frysinger Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230118090144.31155-1-vap...@gentoo.org> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linu

[PULL 22/22] linux-user: Allow sendmsg() without IOV

2023-02-04 Thread Laurent Vivier
From: Helge Deller Applications do call sendmsg() without any IOV, e.g.: sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=NULL, msg_iovlen=0, msg_control=[{cmsg_len=36, cmsg_level=SOL_ALG, cmsg_type=0x2}], msg_controllen=40, msg_flags=0}, MSG_MORE) = 0 sendmsg(4, {msg_n

[PULL 04/22] linux-user/syscall: Extract do_execve() from do_syscall1()

2023-02-04 Thread Laurent Vivier
From: Drew DeVault execve() is a particular case of execveat(). In order to add do_execveat(), first factor do_execve() out. Signed-off-by: Drew DeVault Message-Id: <20221104081015.706009-1-...@cmpwn.com> [PMD: Split of bigger patch, filled description, fixed style] Signed-off-by: Philippe Math

[PULL 20/22] linux-user: Enhance strace output for various syscalls

2023-02-04 Thread Laurent Vivier
From: Helge Deller Add appropriate strace printf formats for various Linux syscalls. Signed-off-by: Helge Deller Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Laurent Vivier --- linux-user/strace.list | 43 ++ 1 file changed, 23 inser

[PULL 05/22] linux-user/syscall: Implement execveat()

2023-02-04 Thread Laurent Vivier
From: Drew DeVault References: https://gitlab.com/qemu-project/qemu/-/issues/1007 Signed-off-by: Drew DeVault Reviewed-by: Laurent Vivier Message-Id: <20221104081015.706009-1-...@cmpwn.com> Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221104173632.1052-6-phi...@linaro.org> Signed-off-b

[PULL 11/22] Revert "linux-user: fix compat with glibc >= 2.36 sys/mount.h"

2023-02-04 Thread Laurent Vivier
From: Daniel P. Berrangé This reverts commit 3cd3df2a9584e6f753bb62a0028bd67124ab5532. glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a clash when both sys/mount.h annd linux/mount.h are included, and backported this to the 2.36 stable release too: https://sourceware.o

[PULL 10/22] Revert "linux-user: add more compat ioctl definitions"

2023-02-04 Thread Laurent Vivier
From: Daniel P. Berrangé This reverts commit c5495f4ecb0cdaaf2e9dddeb48f1689cdb520ca0. glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a clash when both sys/mount.h annd linux/mount.h are included, and backported this to the 2.36 stable release too: https://sourceware.o

[PULL 01/22] linux-user/strace: Constify struct flags

2023-02-04 Thread Laurent Vivier
From: Philippe Mathieu-Daudé print_flags() takes a const pointer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier Message-Id: <20221104173632.1052-2-phi...@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 40 1 fil

[PULL 21/22] linux-user: Implement SOL_ALG encryption support

2023-02-04 Thread Laurent Vivier
From: Helge Deller Add suport to handle SOL_ALG packets via sendmsg() and recvmsg(). This allows emulated userspace to use encryption functionality. Tested with the debian ell package with hppa guest on x86_64 host. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20221212

[PULL 00/22] Linux user for 8.0 patches

2023-02-04 Thread Laurent Vivier
x-user-for-8.0-pull-request for you to fetch changes up to 3f0744f98b07c6fd2ce9d5840726d0915b2ae7c1: linux-user: Allow sendmsg() without IOV (2023-02-03 22:55:12 +0100) linux-user branch pull request 20230204 Implement execveat()

[PULL 13/22] linux-user: Improve strace output of getgroups() and setgroups()

2023-02-04 Thread Laurent Vivier
From: Helge Deller Make the strace look nicer for those syscalls. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20230115210057.445132-1-del...@gmx.de> Signed-off-by: Laurent Vivier --- linux-user/strace.list | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PULL 14/22] linux-user: move target_flat.h to target subdirs

2023-02-04 Thread Laurent Vivier
From: Mike Frysinger This makes target_flat.h behave like every other target_xxx.h header. It also makes it actually work -- while the current header says adding a header to the target subdir overrides the common one, it doesn't. This is for two reasons: * meson.build adds -Ilinux-user before -Il

pixman_blt on aarch64

2023-02-04 Thread BALATON Zoltan
Hello, I'm trying to involve the pixman list in this thread on qemu-devel list started with subject "Display update issue on M1 Macs". See here: https://lists.nongnu.org/archive/html/qemu-devel/2023-02/msg01033.html We have found that on aarch64 Macs running macOS the pixman_blt and pixman_f

  1   2   >