Re: Question about pending patch for AVR_GPIO.

2022-09-11 Thread Michael Rolnik
Hi Heecheol Yang. I suggest rebasing your patch to the master. Regards, Michael Rolnik On Sun, Sep 11, 2022 at 7:47 PM Hee-cheol Yang wrote: > Hello. > > First of all, I am very sorry for my late response for following > patchworks for AVR gpio.: > >- https://patchew.org/QEMU/2021031316544

[PATCH v2 4/6] vhost-net: vhost-user: update vhost_net_virtqueue_restart()

2022-09-11 Thread Kangjie Xu
Update vhost_net_virtqueue_restart() for vhost-user scenario. In order to reuse some functions, we process the idx for vhost-user case. It is because vhost_get_vq_index behave differently in vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 3 +++ 1 file c

[PATCH v2 5/6] virtio-net: vhost-user: update queue_reset and queue_enable

2022-09-11 Thread Kangjie Xu
Update virtio_net_queue_reset() and virtio_net_queue_enable() for vhost-user scenario. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/virtio-net.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 6ab796b399.

[PATCH v2 3/6] vhost-net: vhost-user: update vhost_net_virtqueue_reset()

2022-09-11 Thread Kangjie Xu
Update vhost_net_virtqueue_reset() for vhost-user scenario. In order to reuse some functions, we process the idx for vhost-user scenario because vhost_get_vq_index behave differently for vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 3 +++ 1 file chang

[PATCH v2 6/6] vhost: vhost-user: enable vq reset feature

2022-09-11 Thread Kangjie Xu
Add virtqueue reset feature for vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 8b80942e7c..ad319faee8 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c

[PATCH v2 0/6] Support VIRTIO_F_RING_RESET for vhost-user in virtio pci-modern

2022-09-11 Thread Kangjie Xu
This patch set is based on the patch set that supports VIRTIO_F_RING_RESET for vhost-kernel: https://lore.kernel.org/qemu-devel/cover.1662916759.git.kangjie...@linux.alibaba.com/ The virtio queue reset function has already been defined in the virtio spec 1.2. The relevant virtio spec informa

[PATCH v2 2/6] vhost-user: add op to enable or disable a single vring

2022-09-11 Thread Kangjie Xu
There is only vhost_set_dev_enable op in VhostOps. Thus, we introduce the interface vhost_set_vring_enable to set the enable status for a single vring. Resetting a single vq will rely on this interface. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost-user.c|

[PATCH v2 1/6] net: virtio: rename vhost_set_vring_enable to vhost_set_dev_enable

2022-09-11 Thread Kangjie Xu
Previously, vhost_set_vring_enable will enable/disable all vrings in a device, which causes ambiguity. So we rename it to vhost_set_dev_enable. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- backends/cryptodev-vhost.c| 12 ++-- hw/net/vhost_net-stub.c | 2 +-

[PATCH 29/37] target/i386: reimplement 0x0f 0xc2, 0xc4-0xc6, add AVX

2022-09-11 Thread Paolo Bonzini
Nothing special going on here, for once. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 5 +++ target/i386/tcg/emit.c.inc | 76 target/i386/tcg/translate.c | 1 + 3 files changed, 82 insertions(+) diff --git a/target/i386/tcg/de

[PATCH 35/37] tests/tcg: extend SSE tests to AVX

2022-09-11 Thread Paolo Bonzini
Extracted from a patch by Paul Brook . Signed-off-by: Paolo Bonzini --- tests/tcg/i386/Makefile.target | 2 +- tests/tcg/i386/test-avx.c | 201 ++--- tests/tcg/i386/test-avx.py | 3 +- 3 files changed, 112 insertions(+), 94 deletions(-) diff --git a/test

[PATCH 26/37] target/i386: reimplement 0x0f 0x3a, add AVX

2022-09-11 Thread Paolo Bonzini
The more complicated operations here are insertions and extractions. Otherwise, there are just more entries than usual because the PS/PD/SS/SD variations are encoded in the opcode rater than in the prefixes. These three-byte opcodes also include AVX new instructions, whose implementation in the he

[PATCH 34/37] target/i386: implement VLDMXCSR/VSTMXCSR

2022-09-11 Thread Paolo Bonzini
These are exactly the same as the non-VEX version, but one has to be careful that only VEX.L=0 is allowed. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 25 + target/i386/tcg/emit.c.inc | 20 2 files changed, 45 insertions(

[PATCH 33/37] target/i386: Enable AVX cpuid bits when using TCG

2022-09-11 Thread Paolo Bonzini
From: Paul Brook Include AVX, AVX2 and VAES in the guest cpuid features supported by TCG. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-40-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff -

[PATCH 21/37] target/i386: reimplement 0x0f 0xd8-0xdf, 0xe8-0xef, 0xf8-0xff, add AVX

2022-09-11 Thread Paolo Bonzini
These are more simple integer instructions present in both MMX and SSE/AVX, with no holes that were later occupied by newer instructions. Simple, non-saturating operations are implemented using gvec; apart from this, there is not much to talk about. Signed-off-by: Paolo Bonzini --- target/i386/

[PATCH 36/37] target/i386: move 3DNow completely out of gen_sse

2022-09-11 Thread Paolo Bonzini
Everything else has been converted to the new decoder, so separate the part that survives. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 104 +++- 1 file changed, 68 insertions(+), 36 deletions(-) diff --git a/target/i386/tcg/translate.c b/target

[PATCH 32/37] target/i386: implement XSAVE and XRSTOR of AVX registers

2022-09-11 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target/i386/tcg/fpu_helper.c | 84 ++-- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 230907bc5c..1be620257e 100644 --- a/target/i386/tcg/fpu_helper.

[PATCH 24/37] target/i386: reimplement 0x0f 0x70-0x77, add AVX

2022-09-11 Thread Paolo Bonzini
This includes shifts by immediate, which use bits 3-5 of the ModRM byte as an opcode extension. With the exception of 128-bit shifts, they are implemented using gvec. This also covers VZEROALL and VZEROUPPER, which use the same opcode as EMMS. If we were wanting to optimize out gen_clear_ymmh th

[PATCH 20/37] target/i386: reimplement 0x0f 0x60-0x6f, add AVX

2022-09-11 Thread Paolo Bonzini
These are both MMX and SSE/AVX instructions, except for vmovdqu. In both cases the inputs and output is in s->ptr{0,1,2}, so the only difference between MMX, SSE, and AVX is which helper to call. PCMPGT, MOVD and MOVQ are implemented using gvec. The amount of macro magic for generating functions

[PATCH 28/37] target/i386: reimplement 0x0f 0x38, add AVX

2022-09-11 Thread Paolo Bonzini
There are several special cases here: 1) extending moves have different widths for the helpers vs. for the memory loads, and the width for memory loads depends on VEX.L too. This is represented by X86_SPECIAL_AVXExtMov. 2) some instructions, such as variable-width shifts, select the vector elemen

[PATCH 31/37] target/i386: reimplement 0x0f 0x28-0x2f, add AVX

2022-09-11 Thread Paolo Bonzini
Here the code is a bit uglier due to the truncation and extension of registers to and from 32-bit. Otherwise there is nothing special going on. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 54 ++ target/i386/tcg/emit.c.inc | 120

[PATCH 13/37] target/i386: remove scalar VEX instructions from old decoder

2022-09-11 Thread Paolo Bonzini
This is all dead code, since the VEX prefix goes straight to the new decoder. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 243 1 file changed, 243 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 7e

[PATCH 23/37] target/i386: reimplement 0x0f 0x78-0x7f, add AVX

2022-09-11 Thread Paolo Bonzini
These are a mixed match, including the first two horizontal (66 and F2 only) operations, more moves, and SSE4a extract/insert. Because SSE4a is pretty rare, I chose to leave the helper as they are, but it is possible to unify them by loading index and length from the source XMM register. Signed-o

[PATCH 27/37] target/i386: Use tcg gvec ops for pmovmskb

2022-09-11 Thread Paolo Bonzini
From: Richard Henderson As pmovmskb is used by strlen et al, this is the third highest overhead sse operation at %0.8. Signed-off-by: Richard Henderson [Reorganize to generate code for any vector size. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/tcg/emit.c.inc | 65 +

[PATCH 30/37] target/i386: reimplement 0x0f 0x10-0x17, add AVX

2022-09-11 Thread Paolo Bonzini
These are mostly moves, and yet are a total pain. The main issue is that: 1) some instructions are selected by mod==11 (register operand) vs. mod=00/01/10 (memory operand) 2) stores to memory are two-operand operations, while the 3-register and load-from-memory versions operate on the entire con

[PATCH 22/37] target/i386: reimplement 0x0f 0x50-0x5f, add AVX

2022-09-11 Thread Paolo Bonzini
These are mostly floating-point SSE operations. The odd ones out are MOVMSK and CVTxx2yy, the others are straightforward. Unary operations are a bit special in AVX because they have 2 operands for PD/PS operands (VEX. must be b), and 3 operands for SD/SS. They are handled using X86_OP_GRO

[PATCH 17/37] target/i386: provide 3-operand versions of unary scalar helpers

2022-09-11 Thread Paolo Bonzini
Compared to Paul's implementation, the new decoder will use a different approach to implement AVX's merging of dst with src1 on scalar operations. Adjust the old SSE decoder to be compatible with new-style helpers. The affected instructions are CVTSx2Sx, ROUNDSx, RSQRTSx, SQRTSx, RCPSx. Signed-o

[PATCH 12/37] target/i386: add scalar 0F 38 and 0F 3A instruction to new decoder

2022-09-11 Thread Paolo Bonzini
Because these are the only VEX instructions that QEMU supports, the new decoder is entered on the first byte of a valid VEX prefix, and VEX decoding only needs to be done in decode-new.c.inc. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 59 +++ target/i386/tcg/emit.c.

[PATCH 25/37] target/i386: reimplement 0x0f 0xd0-0xd7, 0xe0-0xe7, 0xf0-0xf7, add AVX

2022-09-11 Thread Paolo Bonzini
The more complicated ones here are d6-d7, e6-e7, f7. The others are trivial. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 39 + target/i386/tcg/emit.c.inc | 99 +--- target/i386/tcg/translate.c | 4 +- 3 files changed, 1

[PATCH 18/37] target/i386: implement additional AVX comparison operators

2022-09-11 Thread Paolo Bonzini
The new implementation of SSE will cover AVX from the get go, so include the 24 extra comparison operators that are only available with the VEX prefix. Based on a patch by Paul Brook . Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 38 targe

[PATCH 16/37] target/i386: support operand merging in binary scalar helpers

2022-09-11 Thread Paolo Bonzini
Compared to Paul's implementation, the new decoder will use a different approach to implement AVX's merging of dst with src1 on scalar operations. Adjust the helpers to provide this functionality. Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 16 1 file changed, 16 i

[PATCH 10/37] target/i386: validate VEX prefixes via the instructions' exception classes

2022-09-11 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 160 ++- target/i386/tcg/decode-new.h | 32 +++ target/i386/tcg/emit.c.inc | 34 ++- target/i386/tcg/translate.c | 17 ++-- 4 files changed, 232 insertions(+), 11 deletions(-)

[PATCH 15/37] target/i386: extend helpers to support VEX.V 3- and 4- operand encodings

2022-09-11 Thread Paolo Bonzini
Add to the helpers all the operands that are needed to implement AVX. Extracted from a patch by Paul Brook . Message-Id: <20220424220204.2493824-26-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 173 + target/i386/ops_sse_header.h

[PATCH 19/37] target/i386: Introduce 256-bit vector helpers

2022-09-11 Thread Paolo Bonzini
The new implementation of SSE will cover AVX from the get go, because all the work for the helper functions is already done. We just need to build them. Signed-off-by: Paolo Bonzini --- target/i386/helper.h | 2 ++ target/i386/ops_sse.h| 5 + target/i386/ops_sse_header.h | 4

[PATCH 14/37] target/i386: Prepare ops_sse_header.h for 256 bit AVX

2022-09-11 Thread Paolo Bonzini
From: Paul Brook Adjust all #ifdefs to match the ones in ops_sse.h. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-23-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/ops_sse_header.h | 114 +++ 1 file changed, 75 insertions(+), 39 del

[PATCH 09/37] target/i386: add AVX_EN hflag

2022-09-11 Thread Paolo Bonzini
From: Paul Brook Add a new hflag bit to determine whether AVX instructions are allowed Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-4-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h| 3 +++ target/i386/helper.c | 12 target/

[PATCH 08/37] target/i386: add CPUID feature checks to new decoder

2022-09-11 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 51 target/i386/tcg/decode-new.h | 20 + 2 files changed, 71 insertions(+) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc index 7f76051b2d..a9b8b

[PATCH 11/37] target/i386: validate SSE prefixes directly in the decoding table

2022-09-11 Thread Paolo Bonzini
Many SSE and AVX instructions are only valid with specific prefixes (none, 66, F3, F2). Introduce a direct way to encode this in the decoding table to avoid using decode groups too much. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 37 tar

[PATCH 06/37] target/i386: add ALU load/writeback core

2022-09-11 Thread Paolo Bonzini
Add generic code generation that takes care of preparing operands around calls to decode.e.gen in a table-driven manner, so that ALU operations need not take care of that. Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 20 +++- target/i386/tcg/decode-new.h | 1 + targ

[RFC PATCH 00/37] target/i386: new decoder + AVX implementation

2022-09-11 Thread Paolo Bonzini
This series fleshes out more of the prototype table-driven decoder and uses it to implement SSE and AVX. As expected, there's a lot more lines here than in Paul's version (roughly twice as much), but in my opinion it is a price worth paying for future maintainability and for easier code review. N

[PATCH 02/37] target/i386: make ldo/sto operations consistent with ldq

2022-09-11 Thread Paolo Bonzini
ldq takes a pointer to the first byte to load the 64-bit word in; ldo takes a pointer to the first byte of the ZMMReg. Make them consistent, which will be useful in the new SSE decoder's load/writeback routines. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 44 +

[PATCH 3/4] tests/tcg: refine MMX support in SSE tests

2022-09-11 Thread Paolo Bonzini
Extend the support to memory operands, and skip MMX instructions that were introduced in SSE times, because they are now covered in test-mmx. Signed-off-by: Paolo Bonzini --- tests/tcg/i386/test-avx.py | 32 ++-- 1 file changed, 26 insertions(+), 6 deletions(-) diff

[PATCH 04/37] target/i386: introduce insn_get_addr

2022-09-11 Thread Paolo Bonzini
The "O" operand type in the Intel SDM needs to load an 8- to 64-bit unsigned value, while insn_get is limited to 32 bits. Extract the code out of disas_insn and into a separate function. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 36 ++-- 1 fi

[PATCH 07/37] target/i386: add CPUID[EAX=7, ECX=0].ECX to DisasContext

2022-09-11 Thread Paolo Bonzini
TCG will shortly implement VAES instructions, so add the relevant feature word to the DisasContext. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 7e9920e29c..a92ef

[PATCH 03/37] target/i386: REPZ and REPNZ are mutually exclusive

2022-09-11 Thread Paolo Bonzini
The later prefix wins if both are present, make it show in s->prefix too. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 9a85010dcd..f8fd93dae0 100644 --- a/target/

[PATCH 05/37] target/i386: add core of new i386 decoder

2022-09-11 Thread Paolo Bonzini
The new decoder is based on three principles: - use mostly table-driven decoding, using tables derived as much as possible from the Intel manual. Centralizing the decode the operands makes it more homogeneous, for example all immediates are signed. All modrm handling is in one function, an

[PATCH 01/37] target/i386: Define XMMReg and access macros, align ZMM registers

2022-09-11 Thread Paolo Bonzini
From: Richard Henderson This will be used for emission and endian adjustments of gvec operations. Signed-off-by: Richard Henderson Message-Id: <2022083722.1697758-2-richard.hender...@linaro.org> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 56 --

[PATCH 1/4] tests/tcg: i386: fix typos in 3DNow! instructions

2022-09-11 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/tcg/i386/x86.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/i386/x86.csv b/tests/tcg/i386/x86.csv index d5d0c17f1b..c43bf42dd3 100644 --- a/tests/tcg/i386/x86.csv +++ b/tests/tcg/i386/x86.csv @@ -1469,16 +1469,16 @@ "P

[PATCH 4/4] tests/tcg: remove old SSE tests

2022-09-11 Thread Paolo Bonzini
The new testsuite is much more comprehensive, so remove the old one; it is also buggy (the pinsrw test uses incorrect constraints, with = instead of +, and the golden output for the fxsave tests differs depending on how the C library uses SSE and AVX instructions). Signed-off-by: Paolo Bonzini --

[PATCH 2/4] tests/tcg: i386: add MMX and 3DNow! tests

2022-09-11 Thread Paolo Bonzini
Adjust the test-avx.py generator to produce tests specifically for MMX and 3DNow. Using a separate generator introduces some code duplication, but is a simpler approach because of test-avx's extra complexity to support 3- and 4-operand AVX instructions. If needed, a common library can be introduc

[PATCH 0/4] target/i386: More SIMD tests

2022-09-11 Thread Paolo Bonzini
This series adds more tests for MMX and 3DNow, including a specific execuatble because the SSE tests in test-avx are not able to pick the right input parameters for MMn registers. Unfortunately there are a couple typos in the 3DNow! instructions that seem to be very widespread; the source of the t

[PATCH 2/2] target/i386: cmpxchg only overwrites ZF

2022-09-11 Thread Paolo Bonzini
Do not set all the flags, they are untouched other than ZF. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 0e9237d627..488a617d14 100644 --

[PATCH 0/2] target/i386: two fixes for cmpxchg

2022-09-11 Thread Paolo Bonzini
The first was found by test-x86_64, the second by inspection. I will shortly work on adding golden output for the tests in tests/tcg/i386, so that we check more than "QEMU does not crash". Paolo Paolo Bonzini (2): target/i386: fix cmpxchg with 32-bit register destination target/i386: cmpxch

[PATCH 1/2] target/i386: fix cmpxchg with 32-bit register destination

2022-09-11 Thread Paolo Bonzini
Unlike the memory case, where "the destination operand receives a write cycle without regard to the result of the comparison", rm must not be touched altogether if the write fails, including not zero-extending it on 64-bit processors. This is not how the movcond currently works, because it is alwa

[PATCH v3 5/5] serial: Allow unaligned i/o access

2022-09-11 Thread Arwed Meyer
Unaligned i/o access on serial UART works on real PCs. This is used for example by FreeDOS CTMouse driver. Without this it can't reset and detect serial mice. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/77 Signed-off-by: Arwed Meyer --- hw/char/serial.c | 3 +++ 1 file changed, 3 ins

[PATCH v3 2/5] chardev: src buffer const for write functions

2022-09-11 Thread Arwed Meyer
Make source buffers const for char be write functions. This allows using buffers returned by fifo as buf parameter and source buffer should not be changed by write functions anyway. Signed-off-by: Arwed Meyer Reviewed-by: Marc-André Lureau --- chardev/char.c | 4 ++-- include/chardev/c

[PATCH v3 1/5] msmouse: Handle mouse reset

2022-09-11 Thread Arwed Meyer
Detect mouse reset via RTS or DTR line: Don't send or process anything while in reset. When coming out of reset, send ID sequence first thing. This allows msmouse to be detected by common mouse drivers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/77 Signed-off-by: Arwed Meyer --- cha

[PATCH v2 00/12] linux-user: Add more syscalls, enhance tracing & logging enhancements

2022-09-11 Thread Helge Deller
Here is a bunch of patches for linux-user. Most of them add missing syscalls and enhance the tracing/logging. Some of the patches are target-hppa specific. I've tested those on productive hppa debian buildd servers (running qemu-user). Thanks! Helge Changes to v1: - Dropped the faccessat2() sysc

Re: [PATCH v2 1/5] msmouse: Handle mouse reset

2022-09-11 Thread Peter Maydell
On Sun, 11 Sept 2022 at 18:14, Arwed Meyer wrote: > > Am 08.09.22 um 23:11 schrieb Peter Maydell: > > On Thu, 8 Sept 2022 at 18:43, Arwed Meyer wrote: > >> > >> Detect mouse reset via RTS or DTR line: > >> Don't send or process anything while in reset. > >> When coming out of reset, send ID seque

[PATCH v2 01/12] linux-user: Add missing signals in strace output

2022-09-11 Thread Helge Deller
Some of the guest signal numbers are currently not converted to their representative names in the strace output, e.g. SIGVTALRM. This patch introduces a smart way to generate and keep in sync the host-to-guest and guest-to-host signal conversion tables for usage in the qemu signal and strace code.

[PATCH v2 04/12] linux-user: Log failing executable in EXCP_DUMP()

2022-09-11 Thread Helge Deller
Enhance the EXCP_DUMP() macro to print out the failing program too. During debugging it's sometimes hard to track down the actual failing program if you are e.g. building a whole debian package. Signed-off-by: Helge Deller --- linux-user/cpu_loop-common.h | 2 ++ 1 file changed, 2 insertions(+)

[PATCH v3 3/5] msmouse: Use fifo8 instead of array

2022-09-11 Thread Arwed Meyer
Make use of fifo8 functions instead of implementing own fifo code. This makes the code more readable and reduces risk of bugs. Signed-off-by: Arwed Meyer Reviewed-by: Marc-André Lureau --- chardev/msmouse.c | 47 +-- 1 file changed, 25 insertions(+),

[PATCH v3 4/5] msmouse: Add pnp data

2022-09-11 Thread Arwed Meyer
Make msmouse send serial pnp data. Enables you to see nice qemu device name in Win9x. Signed-off-by: Arwed Meyer Reviewed-by: Marc-André Lureau --- chardev/msmouse.c | 58 ++- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/chardev/msm

[PATCH v2 07/12] linux-user: Fix strace of chmod() if mode == 0

2022-09-11 Thread Helge Deller
If the mode parameter of chmod() is zero, this value isn't shown when stracing a program: chmod("filename",) This patch fixes it up to show the zero-value as well: chmod("filename",000) Signed-off-by: Helge Deller --- linux-user/strace.c | 5 + 1 file changed, 5 insertions(+) diff -

[PATCH v2 03/12] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls

2022-09-11 Thread Helge Deller
I noticed those were missing when running the glib2.0 testsuite. Add the syscalls including the strace output. Signed-off-by: Helge Deller --- linux-user/strace.c| 28 linux-user/strace.list | 9 + linux-user/syscall.c | 34

[PATCH v2 12/12] linux-user: Add parameters of getrandom() syscall for strace

2022-09-11 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index ad9ef94689..97d8ccadac 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -355,7 +355,7 @@ { TARGET_NR

[PATCH v2 10/12] linux-user: Show timespec on strace for futex()

2022-09-11 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 6f818212d5..b6b9abaea4 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3714,11 +3714,20 @@ print_futex

[PATCH v2 08/12] linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch

2022-09-11 Thread Helge Deller
On the parisc architecture the stack grows upwards. Move the TASK_UNMAPPED_BASE to high memory area as it's done by the kernel on physical machines. Signed-off-by: Helge Deller --- linux-user/mmap.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c ind

[PATCH v2 0/5] Make serial msmouse work

2022-09-11 Thread Arwed Meyer
This series of patches makes `-serial msmouse` work in practice. Tested with FreeDOS/CTMouse driver `ctmouse /V` which identifies a Logitech compatible 3 button mouse. It will probably run as well with any other compatible serial mouse driver on Windows 9x etc. Arwed Meyer (5): msmouse: Handle

[PATCH v2 06/12] linux-user/hppa: Dump IIR on register dump

2022-09-11 Thread Helge Deller
Include the IIR register (which holds the opcode of the failing instruction) when dumping the hppa registers. Signed-off-by: Helge Deller --- target/hppa/helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index e2758d8df

[PATCH v2 09/12] linux-user: Add strace for clock_nanosleep()

2022-09-11 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c| 15 +++ linux-user/strace.list | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 2f539845bb..6f818212d5 100644 --- a/linux-user/strace.c +++ b/linux-user/str

[PATCH v2 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-11 Thread Helge Deller
Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by: Helge Deller --- linux-user/strace.c| 53 ++ linux-user/strace.list | 4 2 files cha

[PATCH v2 11/12] linux-user: Add close_range() syscall

2022-09-11 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 12 2 files changed, 15 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 215d971b2a..ad9ef94689 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list

[PATCH v2 05/12] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info

2022-09-11 Thread Helge Deller
Enhance the hppa linux-user cpu_loop() to show more debugging info on hard errors. Signed-off-by: Helge Deller --- linux-user/hppa/cpu_loop.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 64263c3dc4..1ef3b46

Re: [PATCH v2 3/5] msmouse: Use fifo8 instead of array

2022-09-11 Thread Arwed Meyer
Am 11.09.22 um 08:12 schrieb Volker Rümelin: Am 08.09.22 um 19:31 schrieb Arwed Meyer: @@ -54,21 +60,15 @@ DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV,   static void msmouse_chr_accept_input(Chardev *chr)   {   MouseChardev *mouse = MOUSE_CHARDEV(chr); -    int len; +    uint32_t l

[PATCH v4 14/15] virtio-net: support queue_enable

2022-09-11 Thread Kangjie Xu
Support queue_enable in vhost-kernel scenario. It can be called when a vq reset operation has been performed and the vq is restared. It should be noted that we can restart the vq when the vhost has already started. When launching a new vhost device, the vhost is not started and all vqs are not ini

[PATCH v4 11/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-09-11 Thread Kangjie Xu
Introduce vhost_net_virtqueue_restart(), which can restart the specific virtqueue when the vhost net started running before. If it fails to restart the virtqueue, the device will be stopped. Here we do not reuse vhost_net_start_one() or vhost_dev_start() because they work at queue pair level. The

[PATCH v4 05/15] virtio: core: vq reset feature negotation support

2022-09-11 Thread Kangjie Xu
A a new command line parameter "queue_reset" is added. Meanwhile, the vq reset feature is disabled for pre-7.2 machines. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/core/machine.c | 4 +++- include/hw/virtio/virtio.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletion

[PATCH v4 12/15] virtio-net: introduce flush_or_purge_queued_packets()

2022-09-11 Thread Kangjie Xu
Introduce the fucntion flush_or_purge_queued_packets(), it will be used in device reset and virtqueue reset. Therefore, we extract the common logic as a new function. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/net/virtio-net.c | 17 +++-- 1 file

Re: [PATCH v2 3/5] msmouse: Use fifo8 instead of array

2022-09-11 Thread Arwed Meyer
Hi, Am 09.09.22 um 15:18 schrieb Marc-André Lureau: Hi On Thu, Sep 8, 2022 at 9:38 PM Arwed Meyer mailto:arwed.me...@gmx.de>> wrote: Make use of fifo8 functions instead of implementing own fifo code. This makes the code more readable and reduces risk of bugs. Signed-off-by: Arwed

[PATCH v4 10/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset()

2022-09-11 Thread Kangjie Xu
Introduce vhost_virtqueue_reset(), which can reset the specific virtqueue in the device. Then it will unmap vrings and the desc of the virtqueue. Here we do not reuse the vhost_net_stop_one() or vhost_dev_stop(), because they work at queue pair level. We do not use vhost_virtqueue_stop() because i

[PATCH v4 13/15] virtio-net: support queue reset

2022-09-11 Thread Kangjie Xu
From: Xuan Zhuo virtio-net and vhost-kernel implement queue reset. Queued packets in the corresponding queue pair are flushed or purged. For virtio-net, userspace datapath will be disabled later in __virtio_queue_reset(). It will set addr of vring to 0 and idx to 0. Thus, virtio_net_receive() an

[PATCH v4 09/15] vhost: expose vhost_virtqueue_stop()

2022-09-11 Thread Kangjie Xu
Expose vhost_virtqueue_stop(), we need to use it when resetting a virtqueue. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost.c | 8 include/hw/virtio/vhost.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/vir

[PATCH v4 03/15] virtio: introduce virtio_queue_reset()

2022-09-11 Thread Kangjie Xu
From: Xuan Zhuo Introduce a new interface function virtio_queue_reset() to implement reset for vq. Add a new callback to VirtioDeviceClass for queue reset operation for each child device. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio.c | 11 +++ include/h

[PATCH v4 00/15] Support VIRTIO_F_RING_RESET for virtio-net, vhost-net kernel in virtio pci-modern

2022-09-11 Thread Kangjie Xu
The virtio queue reset function has already been defined in the virtio spec 1.2. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 This patch set is to support this function in QEMU. It con

[PATCH v4 07/15] virtio-pci: support queue enable

2022-09-11 Thread Kangjie Xu
PCI devices support device specific vq enable. Based on this function, the driver can re-enable the virtqueue after the virtqueue is reset. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw

[PATCH v4 02/15] virtio: introduce __virtio_queue_reset()

2022-09-11 Thread Kangjie Xu
From: Xuan Zhuo Separate the logic of vq reset. This logic will be called directly later. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/vi

[PATCH v4 06/15] virtio-pci: support queue reset

2022-09-11 Thread Kangjie Xu
From: Xuan Zhuo PCI devices support vq reset. Based on this function, the driver can adjust the size of the ring, and quickly recycle the buffer in the ring. The migration of the virtio devices will not happen during a reset operation. This is becuase the global iothread lock is held. Migration

[PATCH v4 01/15] virtio: sync relevant definitions with linux

2022-09-11 Thread Kangjie Xu
From: Xuan Zhuo This is updated using scripts/update-linux-headers.sh. Added VIRTIO_F_RING_RESET, VIRTIO_PCI_COMMON_Q_RESET. It came from here: https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Add VIRTIO_PCI_COMMON_Q_NDATA, which comes from

[PATCH v4 08/15] vhost: expose vhost_virtqueue_start()

2022-09-11 Thread Kangjie Xu
Expose vhost_virtqueue_start(), we need to use it when restarting a virtqueue. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost.c | 8 include/hw/virtio/vhost.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/

[PATCH v4 15/15] vhost: vhost-kernel: enable vq reset feature

2022-09-11 Thread Kangjie Xu
Add virtqueue reset feature for vhost-kernel. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 1059aa45b4..97cdf9280b 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net

[PATCH v4 04/15] virtio: introduce virtio_queue_enable()

2022-09-11 Thread Kangjie Xu
Introduce the interface queue_enable() in VirtioDeviceClass and the fucntion virtio_queue_enable() in virtio, it can be called when VIRTIO_PCI_COMMON_Q_ENABLE is written and related virtqueue can be started. It only supports the devices of virtio 1 or later. The not-supported devices can only start

Re: [PATCH v2 1/5] msmouse: Handle mouse reset

2022-09-11 Thread Arwed Meyer
Am 08.09.22 um 23:11 schrieb Peter Maydell: On Thu, 8 Sept 2022 at 18:43, Arwed Meyer wrote: Detect mouse reset via RTS or DTR line: Don't send or process anything while in reset. When coming out of reset, send ID sequence first thing. This allows msmouse to be detected by common mouse drivers

Question about pending patch for AVR_GPIO.

2022-09-11 Thread Hee-cheol Yang
Hello. First of all, I am very sorry for my late response for following patchworks for AVR gpio.: * https://patchew.org/QEMU/20210313165445.2113938-1-f4...@amsat.org/ I couldn't check works for several years because of my personal reasons. If I or anyone want to continue these works, can I

Re: [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in

2022-09-11 Thread Thomas Huth
On 02/09/2022 19.34, Juan Quintela wrote: Signed-off-by: Juan Quintela --- tests/qtest/meson.build | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index e910cb32ca..67b3b678d3 100644 --- a/test

Re: [PATCH] block: introduce zone append write for zoned devices

2022-09-11 Thread Sam Li
Damien Le Moal 于2022年9月11日周日 16:36写道: > > On 2022/09/11 17:00, Sam Li wrote: > [...] > >>> @@ -1604,6 +1629,12 @@ static ssize_t > >>> handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf) > >>> (const char *)buf + offset, > >>> aiocb->aio_n

Re: [PATCH] block: introduce zone append write for zoned devices

2022-09-11 Thread Damien Le Moal
On 2022/09/11 17:00, Sam Li wrote: [...] >>> @@ -1604,6 +1629,12 @@ static ssize_t >>> handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf) >>> (const char *)buf + offset, >>> aiocb->aio_nbytes - offset, >>> aiocb->

Re: [PATCH] block: introduce zone append write for zoned devices

2022-09-11 Thread Sam Li
Sam Li 于2022年9月11日周日 16:00写道: > > Damien Le Moal 于2022年9月11日周日 14:06写道: > > > > On 2022/09/10 15:38, Sam Li wrote: > > > A zone append command is a write operation that specifies the first > > > logical block of a zone as the write position. When writing to a zoned > > > block device using zone a

Re: [PATCH] block: introduce zone append write for zoned devices

2022-09-11 Thread Sam Li
Damien Le Moal 于2022年9月11日周日 14:06写道: > > On 2022/09/10 15:38, Sam Li wrote: > > A zone append command is a write operation that specifies the first > > logical block of a zone as the write position. When writing to a zoned > > block device using zone append, the byte offset of the write is pointi

Re: [PATCH v9 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-09-11 Thread Sam Li
Damien Le Moal 于2022年9月11日周日 14:48写道: > > On 2022/09/11 15:33, Sam Li wrote: > > Damien Le Moal 于2022年9月11日周日 13:31写道: > [...] > >>> +/* > >>> + * zone management operations - Execute an operation on a zone > >>> + */ > >>> +static int coroutine_fn raw_co_zone_mgmt(BlockDriverState *bs, > >>> Bl

Re: [PATCH v9 5/7] config: add check to block layer

2022-09-11 Thread Damien Le Moal
On 2022/09/11 15:54, Sam Li wrote: > Damien Le Moal 于2022年9月11日周日 13:34写道: >> >> On 2022/09/10 14:27, Sam Li wrote: >>> Putting zoned/non-zoned BlockDrivers on top of each other is not >>> allowed. >>> >>> Signed-off-by: Sam Li >>> Reviewed-by: Stefan Hajnoczi >>> --- >>> block.c

  1   2   >