[PATCH 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-08 Thread Ilya Leoshkevich
Both the report() function as well as the initial gdbstub test sequence are copy-pasted into ~10 files with slight modifications. This indicates that they are indeed generic, so factor them out. While at it, add a few newlines to make the formatting closer to PEP-8. Signed-off-by: Ilya

[PATCH 1/3] linux-user: Allow gdbstub to ignore page protection

2024-01-08 Thread Ilya Leoshkevich
-debugging with ptrace(POKE), which will break if QEMU itself is being debugged - a much more severe limitation. Signed-off-by: Ilya Leoshkevich --- cpu-target.c | 55 ++-- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/cpu-target.c b

[PATCH 0/3] linux-user: Allow gdbstub to ignore page protection

2024-01-08 Thread Ilya Leoshkevich
ves differently from gdbserver in that it doesn't allow reading non-readable pages. This series improves the situation by using the same mechanism as gdbserver: /proc/self/mem. If /proc is not mounted, we fall back to the today's implementation. Best regards, Ilya Ilya Leoshkevich (3): linux-user: Al

[PATCH 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-08 Thread Ilya Leoshkevich
Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 9 +- tests/tcg/multiarch/gdbstub/prot-none.py | 22 ++ tests/tcg/multiarch/prot-none.c | 38

Re: [PATCH] tests/tcg: Don't #include in aarch64/system/vtimer.c

2024-01-08 Thread Ilya Leoshkevich
On Mon, 2024-01-08 at 13:56 +0100, Philippe Mathieu-Daudé wrote: > Hi Ilya, > > On 8/1/24 13:50, Ilya Leoshkevich wrote: > > make check-tcg fails on Fedora with: > > > > vtimer.c:9:10: fatal error: inttypes.h: No such file or > > directory > >

[PATCH] tests/tcg: Don't #include in aarch64/system/vtimer.c

2024-01-08 Thread Ilya Leoshkevich
by using stdint.h instead. The test does not require anything from inttypes.h anyway. Signed-off-by: Ilya Leoshkevich --- tests/tcg/aarch64/system/vtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tcg/aarch64/system/vtimer.c b/tests/tcg/aarch64/system/vtimer.c index

Re: [PATCH v2 08/43] qtest: bump npcm7xx_pwn-test timeout to 5 minutes

2024-01-08 Thread Ilya Leoshkevich
On Wed, 2024-01-03 at 17:33 +, Alex Bennée wrote: > From: Daniel P. Berrangé > > The npcm7xx_pwn-test takes 3 & 1/2 minutes in a --enable-debug build. > Bumping to 5 minutes will give more headroom. > > Signed-off-by: Daniel P. Berrangé > Reviewed-by: Thomas Huth > Message-ID:

Re: [PATCH RFC] linux-user: Allow gdbstub to ignore page protection

2023-12-21 Thread Ilya Leoshkevich
On Thu, Dec 21, 2023 at 10:33:51AM +1100, Richard Henderson wrote: > On 12/16/23 10:24, Ilya Leoshkevich wrote: > > @@ -377,22 +379,42 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, > > flags = page_get_flags(page); > > if (!(flags & PAGE_VALID))

[PATCH RFC] linux-user: Allow gdbstub to ignore page protection

2023-12-15 Thread Ilya Leoshkevich
-off-by: Ilya Leoshkevich --- cpu-target.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 508013e23d2..8dd7342705b 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -27,6 +27,7 @@ #include "migration/vmst

[PATCH v4 2/4] tcg: Make tb_cflags() usable from target-agnostic code

2023-12-11 Thread Ilya Leoshkevich
Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson --- include/exec/exec-all.h | 6 -- include

[PATCH v4 4/4] accel/tcg: Move perf and debuginfo support to tcg

2023-12-11 Thread Ilya Leoshkevich
tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard

[PATCH v4 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2023-12-11 Thread Ilya Leoshkevich
Preparation for moving perf.c to tcg/. This affects only profiling guest code, which has code in a non-0 based segment, e.g., 16-bit code, which is not particularly important. Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Bennée Reviewed-by: Richard

[PATCH v4 1/4] accel/tcg: Make use of qemu_target_page_mask() in perf.c

2023-12-11 Thread Ilya Leoshkevich
Stop using TARGET_PAGE_MASK in order to make perf.c more target-agnostic. Signed-off-by: Ilya Leoshkevich --- accel/tcg/perf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/tcg/perf.c b/accel/tcg/perf.c index cd1aa99a7ee..ba75c1bbe45 100644 --- a/accel/tcg/perf.c

[PATCH v4 0/4] accel/tcg: Move perf and debuginfo support to tcg

2023-12-11 Thread Ilya Leoshkevich
one time. Best regards, Ilya [1] https://lists.gnu.org/archive/html/qemu-devel/2023-06/msg06510.html Ilya Leoshkevich (4): accel/tcg: Make use of qemu_target_page_mask() in perf.c tcg: Make tb_cflags() usable from target-agnostic code accel/tcg: Remove #ifdef TARGET_I386 from perf.c

Re: [PATCH v3 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2023-12-08 Thread Ilya Leoshkevich
On Fri, 2023-12-08 at 09:53 +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > Preparation for moving perf.c to tcg/. > > > > This affects only profiling guest code, which has code in a non-0 > > based > > segment, e.g., 16-bit code, which is not

[PATCH v3 4/4] accel/tcg: Move perf and debuginfo support to tcg

2023-12-07 Thread Ilya Leoshkevich
tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich --- accel/tcg

[PATCH v3 0/4] accel/tcg: Move perf and debuginfo support to tcg

2023-12-07 Thread Ilya Leoshkevich
e_mask() hunk to patch 1. Fix typos. Hi, This series is a follow-up to discussion in [1]; the goal is to build perf and debuginfo support only one time. Best regards, Ilya [1] https://lists.gnu.org/archive/html/qemu-devel/2023-06/msg06510.html Ilya Leoshkevich (4): target

[PATCH v3 2/4] tcg: Make tb_cflags() usable from target-agnostic code

2023-12-07 Thread Ilya Leoshkevich
Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich --- include/exec/exec-all.h | 6 -- include/exec/translation-block.h | 6

[PATCH v3 1/4] target: Make qemu_target_page_mask() available for *-user

2023-12-07 Thread Ilya Leoshkevich
Currently qemu_target_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as well. Make use of it in perf.c. Signed-off-by: Ilya Leoshkevich --- accel/tcg/perf.c | 3 ++- system/physmem.c | 5 - target/meson.build | 2

[PATCH v3 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2023-12-07 Thread Ilya Leoshkevich
Preparation for moving perf.c to tcg/. This affects only profiling guest code, which has code in a non-0 based segment, e.g., 16-bit code, which is not particularly important. Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- accel/tcg/perf.c | 4 1 file changed, 4

Re: [PATCH 2/6] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to QEMU_BQL_LOCK_GUARD

2023-11-30 Thread Ilya Leoshkevich
Auto *qemu_bql_auto_lock(const char *file, >          int line) The padding is not correct anymore. Other than this: Acked-by: Ilya Leoshkevich

[PATCH v2 5/5] tests/tcg/s390x: Test ADD LOGICAL WITH CARRY

2023-11-06 Thread Ilya Leoshkevich
Add a test that tries different combinations of ADD LOGICAL WITH CARRY instructions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/add-logical-with-carry.c | 156 +++ 2 files changed, 157 insertions(+) create mode

[PATCH v2 1/5] target/s390x: Fix CLC corrupting cc_src

2023-11-06 Thread Ilya Leoshkevich
5 Cc: qemu-sta...@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 4bae1509f50..a0d6a2a3

[PATCH v2 2/5] tests/tcg/s390x: Test CLC with inaccessible second operand

2023-11-06 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/clc.c | 48 + 2 files changed, 49 insertions(+) create mode 100644 tests/tcg/s390x/clc.c diff --git a/tests/tcg/s390x

[PATCH v2 3/5] target/s390x: Fix LAALG not updating cc_src

2023-11-06 Thread Ilya Leoshkevich
("target/s390x: Use atomic operations for LOAD AND OP") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/insn-data.h.inc | 2 +- target/s390x/tcg/translate.c | 19 +-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v2 0/5] target/s390x: CC fixes

2023-11-06 Thread Ilya Leoshkevich
hen reviewing the code. Patches 2, 4 and 5 are tests. Best regards, Ilya [1] https://gitlab.com/qemu-project/qemu/-/issues/1865#note_1545060658 Ilya Leoshkevich (5): target/s390x: Fix CLC corrupting cc_src tests/tcg/s390x: Test CLC with inaccessible second operand target/s390x: Fix LA

[PATCH v2 4/5] tests/tcg/s390x: Test LAALG with negative cc_src

2023-11-06 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/laalg.c | 27 +++ 2 files changed, 28 insertions(+) create mode 100644 tests/tcg/s390x/laalg.c diff --git a/tests/tcg/s390x

Re: [PATCH 2/4] tests/tcg/s390x: Test CLC with inaccessible second operand

2023-11-06 Thread Ilya Leoshkevich
On Tue, 2023-10-31 at 15:53 -0700, Richard Henderson wrote: > On 10/30/23 22:32, Ilya Leoshkevich wrote: > > +int main(void) > > +{ > > +    register unsigned long r0 asm("r0"); > > +    unsigned long mem = 42, rhs = 500; > > +    struct sigaction act;

Re: [PATCH 0/4] target/s390x: CC fixes

2023-11-03 Thread Ilya Leoshkevich
On Tue, 2023-10-31 at 09:38 +0100, David Hildenbrand wrote: > On 31.10.23 06:32, Ilya Leoshkevich wrote: > > Hi, > > > > This series fixes two issues with updating CC. David was suggesting > > a > > bigger rewrite [1], but I did not dare do this (yet). Instead

[PATCH 4/4] tests/tcg/s390x: Test LAALG with negative cc_src

2023-10-30 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/laalg.c | 27 +++ 2 files changed, 28 insertions(+) create mode 100644 tests/tcg/s390x/laalg.c diff --git a/tests/tcg/s390x

[PATCH 1/4] target/s390x: Fix CLC corrupting cc_src

2023-10-30 Thread Ilya Leoshkevich
5 Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 4bae1509f50..a0d6a2a35dd 100644 --- a/target/s390x/tcg/transla

[PATCH 0/4] target/s390x: CC fixes

2023-10-30 Thread Ilya Leoshkevich
. Best regards, Ilya [1] https://gitlab.com/qemu-project/qemu/-/issues/1865#note_1545060658 Ilya Leoshkevich (4): target/s390x: Fix CLC corrupting cc_src tests/tcg/s390x: Test CLC with inaccessible second operand target/s390x: Fix LAALG not updating cc_src tests/tcg/s390x: Test LAALG

[PATCH 3/4] target/s390x: Fix LAALG not updating cc_src

2023-10-30 Thread Ilya Leoshkevich
LOAD AND OP") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index a0d6a2a35dd..db386ea94d8 100644 --- a/target

[PATCH 2/4] tests/tcg/s390x: Test CLC with inaccessible second operand

2023-10-30 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/clc.c | 48 + 2 files changed, 49 insertions(+) create mode 100644 tests/tcg/s390x/clc.c diff --git a/tests/tcg/s390x

Re: [risu PATCH 0/4] Add support for s390x to RISU

2023-09-04 Thread Ilya Leoshkevich
On Mon, 2023-09-04 at 16:00 +0200, Thomas Huth wrote: >  Hi Peter! > > Here are some patches that add basic support for s390x to RISU. > It's still quite limited, e.g. no support for load/store memory > operations yet, but the basics with simple 16-bit or 32-bit > instructions work already fine.

Re: [risu PATCH 2/4] s390x: Add simple s390x.risu file

2023-09-04 Thread Ilya Leoshkevich
+++ >  1 file changed, 48 insertions(+) >  create mode 100644 s390x.risu Can this be somehow automatically derived from target/s390x/tcg/insn-data.h.inc? Acked-by: Ilya Leoshkevich

Re: [risu PATCH 1/4] s390x: Add basic s390x support to the C code

2023-09-04 Thread Ilya Leoshkevich
x.c >  create mode 100644 test_s390x.S Looks really interesting! I was doing similar qemu-system-s390x testing with a bunch of ad-hoc scripts, and there are quite a few unresolved problems still, especially in the error handling area. Acked-by: Ilya Leoshkevich I have one small question (see b

Re: [PATCH 0/6] linux-user: Rewrite open_self_maps

2023-08-17 Thread Ilya Leoshkevich
t; linux-user/syscall.c | 194 + > util/selfmap.c | 12 +-- > 5 files changed, 131 insertions(+), 122 deletions(-) > > -- > 2.34.1 As expected, this improved the situation with mappings on ppc64le. Handling the errors from read_self_maps() is also a nice addition. Reviewed-by: Ilya Leoshkevich

Re: [PATCH 3/3] tests/tcg/s390x: Test VSTRS

2023-08-17 Thread Ilya Leoshkevich
On Thu, Aug 17, 2023 at 11:37:29AM +0200, Claudio Fontana wrote: > On 8/5/23 01:03, Ilya Leoshkevich wrote: > > Add a small test to prevent regressions. > > > > Signed-off-by: Ilya Leoshkevich > > Something seems off in the wiring of the make check target? > &g

Re: [PATCH 4/9] tests: remove test-gdbstub.py

2023-08-16 Thread Ilya Leoshkevich
On Wed, 2023-08-16 at 13:33 +0100, Alex Bennée wrote: > > Ilya Leoshkevich writes: > > > On Tue, 2023-08-15 at 15:51 +0100, Alex Bennée wrote: > > > This isn't directly called by our CI and because it doesn't run > > > via > > > our run-test.py scr

Re: [PATCH 7/9] gdbstub: remove unused user_ctx field

2023-08-16 Thread Ilya Leoshkevich
On Tue, 2023-08-15 at 15:51 +0100, Alex Bennée wrote: > This was always NULL so drop it. > > Signed-off-by: Alex Bennée > --- >  gdbstub/gdbstub.c | 16 >  1 file changed, 8 insertions(+), 8 deletions(-) Acked-by: Ilya Leoshkevich

Re: [PATCH 5/9] tests/tcg: clean-up gdb confirm/pagination settings

2023-08-16 Thread Ilya Leoshkevich
4 >  tests/tcg/s390x/gdbstub/test-svc.py   | 4 >  10 files changed, 2 insertions(+), 33 deletions(-) Acked-by: Ilya Leoshkevich

Re: [PATCH 4/9] tests: remove test-gdbstub.py

2023-08-16 Thread Ilya Leoshkevich
comment in tcg/multiarch/gdbstub/memory.py it would be mapped to a normal break anyway. Acked-by: Ilya Leoshkevich

[PATCH 0/3] Fix the build on CentOS 7

2023-08-10 Thread Ilya Leoshkevich
Hi, I know that CentOS 7 is not tested anymore, but unfortunately it's the only ppc64le system that I have, so I had to fix a few build issues that crept in since the testing stopped. The fixes are simple and may be helpful to people in the same situation. Best regards, Ilya Ilya Leoshkevich (3

[PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG

2023-08-10 Thread Ilya Leoshkevich
Building QEMU on CentOS 7 fails, because there SOL_ALG is not defined. There already exists #if defined(SOL_ALG) in do_setsockopt(); add it to target_to_host_cmsg() as well. Fixes: 27404b6c15c1 ("linux-user: Implement SOL_ALG encryption support") Signed-off-by: Ilya Leoshkevich ---

[PATCH 3/3] linux-user: Fix the build on systems without MADV_{KEEP, WIPE}ONFORK

2023-08-10 Thread Ilya Leoshkevich
CentOS 7 does not define MADV_KEEPONFORK and MADV_WIPEONFORK. Use definitions provided by the QEMU's copy of linux/mman.h. Fixes: 4530deb1 ("linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise()") Signed-off-by: Ilya Leoshkevich --- linux-user/mmap.c | 1

Re: [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE

2023-08-10 Thread Ilya Leoshkevich
On Fri, 2023-08-11 at 00:03 +0200, Helge Deller wrote: > On 8/10/23 23:51, Ilya Leoshkevich wrote: > > CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition > > provided > > by the QEMU's copy of linux/mman.h. > > > > Fixes: 4b840f96096d

[PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE

2023-08-10 Thread Ilya Leoshkevich
CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition provided by the QEMU's copy of linux/mman.h. Fixes: 4b840f96096d ("linux-user: Populate more bits in mmap_flags_tbl") Signed-off-by: Ilya Leoshkevich --- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --g

Re: [PATCH for-8.1 v10 10/14] util/selfmap: Rewrite using qemu/interval-tree.h

2023-08-10 Thread Ilya Leoshkevich
On Mon, 2023-08-07 at 11:17 -0700, Richard Henderson wrote: > On 8/7/23 09:37, Richard Henderson wrote: > > We will want to be able to search the set of mappings. > > For this patch, the two users iterate the tree in order. > > > > Signed-off-by: Richard Henderson > > --- > >  

Re: [PATCH for-8.1] tests/tcg: Disable filename test for info proc mappings

2023-08-09 Thread Ilya Leoshkevich
>   >   >  def main(): I'll try to find a way to check host/guest page sizes in Python for 8.2. I think it's fine to disable the check for 8.1. Acked-by: Ilya Leoshkevich

Re: [PATCH v2 0/3] linux-user, configure: fix CPU canonicalization

2023-08-08 Thread Ilya Leoshkevich
s390/host-signal.h >  delete mode 100644 linux-user/include/host/x32/host-signal.h Now it works, thanks! Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich

Re: [PATCH 1/2] target/s390x: Use a 16-bit immediate in VREP

2023-08-08 Thread Ilya Leoshkevich
On Mon, 2023-08-07 at 20:27 +0300, Michael Tokarev wrote: > > On 07.08.23 19:02, Ilya Leoshkevich wrote: > ..>> None that I know of, but I thought this was still nice to have, > and at > > > the same time small enough to not cause any trouble. > > Ilya, do you hav

Re: [PATCH RFC 1/1] tcg: Always pass the full write size to notdirty_write()

2023-08-08 Thread Ilya Leoshkevich
On Mon, 2023-08-07 at 11:21 -0700, Richard Henderson wrote: > On 8/7/23 06:56, Ilya Leoshkevich wrote: > > One of notdirty_write()'s responsibilities is detecting self- > > modifying > > code. Some functions pass the full size of a write to it, some pass > > 1. > &g

Re: [PATCH 2/3] linux-user: cleanup unused linux-user/include/host directories

2023-08-07 Thread Ilya Leoshkevich
On Mon, 2023-08-07 at 11:48 +0200, Paolo Bonzini wrote: > Alpha and 31-bit s390 lack the assembly fragment to handle signals > occurring at the same time as system calls, so they cannot run > linux-user emulation anymore.  Drop the host-signal.h files for > them. > > Signed-off-by: Paolo Bonzini

Re: [PATCH 1/2] target/s390x: Use a 16-bit immediate in VREP

2023-08-07 Thread Ilya Leoshkevich
On Mon, 2023-08-07 at 19:00 +0200, David Hildenbrand wrote: > On 07.08.23 18:34, Ilya Leoshkevich wrote: > > Unlike most other instructions that contain an immediate element > > index, > > VREP's one is 16-bit, and not 4-bit. The code uses only 8 bits, so > > using

[PATCH 2/2] tests/tcg/s390x: Test VREP

2023-08-07 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/vrep.c | 81 + 2 files changed, 82 insertions(+) create mode 100644 tests/tcg/s390x/vrep.c diff --git a/tests/tcg/s390x

[PATCH 1/2] target/s390x: Use a 16-bit immediate in VREP

2023-08-07 Thread Ilya Leoshkevich
x/tcg: Implement VECTOR REPLICATE") Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate_vx.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/translate_vx.c.inc index f8df121d3d3..a6d840d4065 100644 --

Re: [PATCH 1/2] target/s390x: Define TARGET_HAS_PRECISE_SMC

2023-08-07 Thread Ilya Leoshkevich
On Mon, 2023-08-07 at 17:31 +0200, David Hildenbrand wrote: > On 07.08.23 13:48, Ilya Leoshkevich wrote: > > PoP (Sequence of Storage References -> Instruction Fetching) says: > > > > ... if a store that is conceptually earlier is > > made by the sam

[PATCH RFC 0/1] tcg: Always pass the full write size to notdirty_write()

2023-08-07 Thread Ilya Leoshkevich
ger though. In helper_vstl(), probe_write_access() does not lead to cpu_loop_exit_noexc() - which I think it should, but cpu_stq_be_data_ra() still does, masking the issue. Best regards, Ilya [1] https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg01081.html Ilya Leoshkevich (1): tcg: Always pass the

[PATCH RFC 1/1] tcg: Always pass the full write size to notdirty_write()

2023-08-07 Thread Ilya Leoshkevich
. It's still worth improving this, because there may still be user-visible adverse effects in other helpers. Signed-off-by: Ilya Leoshkevich --- accel/tcg/cputlb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index d68fa6867ce

[PATCH v2] linux-user: Emulate the Anonymous: keyword in /proc/self/smaps

2023-08-07 Thread Ilya Leoshkevich
-anonymous. Signed-off-by: Ilya Leoshkevich --- v1: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg00848.html v1 -> v2: Fix a build issue when TARGET_VSYSCALL_PAGE is set. linux-user/syscall.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/linux-u

[PATCH 1/2] target/s390x: Define TARGET_HAS_PRECISE_SMC

2023-08-07 Thread Ilya Leoshkevich
ady has support for this in the common code; enable it for s390x. Signed-off-by: Ilya Leoshkevich --- target/s390x/cpu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index eb5b65b7d3a..304029e57cf 100644 --- a/target/s390x/cpu.h +++ b/target/s3

[PATCH 2/2] tests/tcg/s390x: Test precise self-modifying code handling

2023-08-07 Thread Ilya Leoshkevich
Add small softmmu and user tests to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/precise-smc-softmmu.S | 63 + tests/tcg/s390x/precise-smc-user.c

Re: [PATCH 2/3] target/s390x: Fix the "ignored match" case in VSTRS

2023-08-07 Thread Ilya Leoshkevich
On Sat, 2023-08-05 at 10:02 +0200, David Hildenbrand wrote: > On 05.08.23 01:03, Ilya Leoshkevich wrote: > > Currently the emulation of VSTRS recognizes partial matches in > > presence > > of \0 in the haystack, which, according to PoP, is not correct: > > >

Re: [PATCH 3/3] tests/tcg/s390x: Test VSTRS

2023-08-07 Thread Ilya Leoshkevich
On Sun, 2023-08-06 at 13:05 +0200, Claudio Fontana wrote: > On 8/5/23 01:03, Ilya Leoshkevich wrote: > > Add a small test to prevent regressions. > > > > Signed-off-by: Ilya Leoshkevich > > --- > >  tests/tcg/s390x/Makefile.target |  1 + > >

[PATCH 0/3] target/s390x: Fix the "ignored match" case in VSTRS

2023-08-04 Thread Ilya Leoshkevich
/5adad06d911c46079d4388001b22ab61 [2] https://gist.github.com/iii-i/c425800e75796eae65660491ac511356 Ilya Leoshkevich (3): linux-user/elfload: Enable vxe2 on s390x target/s390x: Fix the "ignored match" case in VSTRS tests/tcg/s390x: Test VSTRS linux-user/elfload.c

[PATCH 1/2] target/s390x: Fix VSTL with a large length

2023-08-04 Thread Ilya Leoshkevich
The length is always truncated to 16 bytes. Do not probe more than that. Cc: qemu-sta...@nongnu.org Fixes: 0e0a5b49ad58 ("s390x/tcg: Implement VECTOR STORE WITH LENGTH") Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/vec_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH 2/2] tests/tcg/s390x: Test VSTL

2023-08-04 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/vstl.c | 37 + 2 files changed, 38 insertions(+) create mode 100644 tests/tcg/s390x/vstl.c diff --git a/tests/tcg/s390x

[PATCH] target/s390x: Check reserved bits of VFMIN/VFMAX's M5

2023-08-04 Thread Ilya Leoshkevich
VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set. Cc: qemu-sta...@nongnu.org Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate_vx.c.inc | 2 +- 1 file changed, 1

[PATCH] linux-user: Emulate the Anonymous: keyword in /proc/self/smaps

2023-08-04 Thread Ilya Leoshkevich
-anonymous. Signed-off-by: Ilya Leoshkevich --- linux-user/syscall.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 95727a816ad..150be661dba 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8078,7 +8078,7

[PATCH 2/3] target/s390x: Fix the "ignored match" case in VSTRS

2023-08-04 Thread Ilya Leoshkevich
at it, fold a number of explicitly handled special cases into the generic logic. Cc: qemu-sta...@nongnu.org Reported-by: Claudio Fontana Closes: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg00633.html Fixes: 1d706f314191 ("target/s390x: vxeh2: vector string search") Signed-of

[PATCH 1/3] linux-user/elfload: Enable vxe2 on s390x

2023-08-04 Thread Ilya Leoshkevich
The vxe2 hwcap is not set for programs running in linux-user, but is set by a Linux kernel running in softmmu. Add it to the former. Signed-off-by: Ilya Leoshkevich --- linux-user/elfload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index

[PATCH 3/3] tests/tcg/s390x: Test VSTRS

2023-08-04 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/vxeh2_vstrs.c | 88 + 2 files changed, 89 insertions(+) create mode 100644 tests/tcg/s390x/vxeh2_vstrs.c diff --git a/tests

Re: Issue with s390 TCG and libc __strstr_arch13

2023-08-04 Thread Ilya Leoshkevich
On Fri, 2023-08-04 at 11:58 +0200, Claudio Fontana wrote: > On 8/4/23 11:20, Thomas Huth wrote: > > On 04/08/2023 11.00, Claudio Fontana wrote: > > > Hi, > > > > > > On 7/21/23 11:08, Claudio Fontana wrote: > > > > > > > > Hello Cornelia, Richard, > > > > > > > > I had some strange behavior in

Re: [PATCH] gdbstub: use 0 ("any process") on packets with no PID

2023-08-01 Thread Ilya Leoshkevich
ng to the invalid usage > of > "PID 1" by qemu-hexagon and a subsequent "E22" reply. Did you mean "Hg"? > Signed-off-by: Matheus Tavares Bernardino > --- >  gdbstub/gdbstub.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) The change looks good to me. Thanks for looking into this and sorry for the breakage. Acked-by: Ilya Leoshkevich

Re: [PATCH] target/s390x: Move trans_exc_code update to do_program_interrupt

2023-07-31 Thread Ilya Leoshkevich
On Mon, 2023-07-31 at 07:55 -0700, Richard Henderson wrote: > On 7/31/23 01:26, Ilya Leoshkevich wrote: > > > > +    case PGM_PROTECTION: > > > > +    case PGM_TRANS_SPEC: > > > > +    assert(env->int_pgm_code == env->tlb_fill_exc

Re: [PATCH] target/s390x: Move trans_exc_code update to do_program_interrupt

2023-07-31 Thread Ilya Leoshkevich
xception Identification on Translation-Specification Exceptions (PGM_TRANS_SPEC)? I re-read the 0xA8 documentation a few times, but could not find it. It's also interesting what the kernel was attempting when it got PGM_TRANS_SPEC and recovered from it. Maybe something else is wrong? Other than the POp question: Reviewed-by: Ilya Leoshkevich > > I wasn't sure where to look for the full specification of exception > effects, but this did > solve the kernel fault. > > > r~

Re: [PATCH 3/3] tests/tcg: Add -fno-stack-protector

2023-07-31 Thread Ilya Leoshkevich
gt;  tests/tcg/x86_64/Makefile.softmmu-target  | 2 +- >  15 files changed, 16 insertions(+), 16 deletions(-) Acked-by: Ilya Leoshkevich

[PATCH v4 02/14] target/s390x: Fix CLM with M3=0

2023-07-24 Thread Ilya Leoshkevich
Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/mem_helper.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index f417fb1183c..84103251b97 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -667

[PATCH v4 11/14] tests/tcg/s390x: Test ICM

2023-07-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/icm.S | 32 + 2 files changed, 33 insertions(+) create mode 100644 tests/tcg/s390x

[PATCH v4 08/14] tests/tcg/s390x: Test CKSM

2023-07-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/cksm.S | 29 + 2 files changed, 30 insertions(+) create mode 100644 tests/tcg/s390x/cksm.S diff --git a/tests

[PATCH v4 03/14] target/s390x: Fix CONVERT TO LOGICAL/FIXED with out-of-range inputs

2023-07-24 Thread Ilya Leoshkevich
lpers") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/fpu_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/s390x/tcg/fpu_helper.c b/target/s390x/tcg/fpu_helper.c index 4b7fa58af3e..3d941ed2

[PATCH v4 12/14] tests/tcg/s390x: Test MC

2023-07-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/mc.S| 56 + 2 files changed, 57 insertions(+) create mode 100644 tests/tcg/s390x/mc.S

[PATCH v4 00/14] target/s390x: Miscellaneous TCG fixes, part 2

2023-07-24 Thread Ilya Leoshkevich
chard has already fixed, but I thought it would be helpful to have it anyway. Best regards, Ilya Ilya Leoshkevich (14): target/s390x: Make CKSM raise an exception if R2 is odd target/s390x: Fix CLM with M3=0 target/s390x: Fix CONVERT TO LOGICAL/FIXED with out-of-range inputs target/s390x

[PATCH v4 04/14] target/s390x: Fix ICM with M3=0

2023-07-24 Thread Ilya Leoshkevich
Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index d6e8acee995..244e61ad2eb 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c

[PATCH v4 10/14] tests/tcg/s390x: Test CLM

2023-07-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/clm.S | 29 + 2 files changed, 30 insertions(+) create mode 100644 tests/tcg/s390x

[PATCH v4 13/14] tests/tcg/s390x: Test STPQ

2023-07-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/stpq.S | 20 2 files changed, 21 insertions(+) create mode 100644 tests/tcg/s390x/stpq.S

[PATCH v4 05/14] target/s390x: Make MC raise specification exception when class >= 16

2023-07-24 Thread Ilya Leoshkevich
MC requires bit positions 8-11 (upper 4 bits of class) to be zeros, otherwise it must raise a specification exception. Cc: qemu-sta...@nongnu.org Fixes: 20d143e2cab8 ("s390x/tcg: Implement MONITOR CALL") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-of

[PATCH v4 01/14] target/s390x: Make CKSM raise an exception if R2 is odd

2023-07-24 Thread Ilya Leoshkevich
R2 designates an even-odd register pair; the instruction should raise a specification exception when R2 is not even. Cc: qemu-sta...@nongnu.org Fixes: e023e832d0ac ("s390x: translate engine for s390x CPU") Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/insn-data.h.inc | 2 +- ta

[PATCH v4 09/14] tests/tcg/s390x: Test CLGEBR and CGEBRA

2023-07-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 5 + tests/tcg/s390x/cgebra.c| 32 tests/tcg/s390x/clgebr.c| 32 3 files

[PATCH v4 14/14] tests/tcg/s390x: Test VCKSM

2023-07-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/vcksm.c | 31 +++ tests/tcg/s390x/vx.h| 2 ++ 3 files changed, 34 insertions(+) create

[PATCH v4 06/14] tcg/{i386, s390x}: Add earlyclobber to the op_add2's first output

2023-07-24 Thread Ilya Leoshkevich
%r12d, %ebx Introduce a new C_N1_O1_I4 constraint, and make sure that earlyclobber of aliased outputs is honored. Cc: qemu-sta...@nongnu.org Fixes: 82790a870992 ("tcg: Add markup for output requires new register") Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich ---

[PATCH v4 07/14] target/s390x: Fix assertion failure in VFMIN/VFMAX with type 13

2023-07-24 Thread Ilya Leoshkevich
ildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate_vx.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/translate_vx.c.inc index 43dfbfd03f6..f8df121d3d3 100644 --

[PATCH v3 09/14] tests/tcg/s390x: Test CLGEBR and CGEBRA

2023-07-19 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 5 + tests/tcg/s390x/cgebra.c| 32 tests/tcg/s390x/clgebr.c| 32 3 files

[PATCH v3 07/14] target/s390x: Fix assertion failure in VFMIN/VFMAX with type 13

2023-07-19 Thread Ilya Leoshkevich
ildenbrand Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate_vx.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/translate_vx.c.inc index 43dfbfd03f6..f8df121d3d3 100644 --- a/target/s390x/tcg/translat

[PATCH v3 12/14] tests/tcg/s390x: Test MC

2023-07-19 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/mc.S| 56 + 2 files changed, 57 insertions(+) create mode 100644 tests/tcg/s390x/mc.S

[PATCH v3 00/14] target/s390x: Miscellaneous TCG fixes, part 2

2023-07-19 Thread Ilya Leoshkevich
efully I got the fixes right. 13/14 is a test for an issue that Richard has already fixed, but I thought it would be helpful to have it anyway. Best regards, Ilya Ilya Leoshkevich (14): target/s390x: Make CKSM raise an exception if R2 is odd target/s390x: Fix CLM with M3=0 target/s390x: Fix C

[PATCH v3 06/14] tcg/{i386, s390x}: Add earlyclobber to the op_add2's first output

2023-07-19 Thread Ilya Leoshkevich
%r12d, %ebx Introduce a new C_N1_O1_I4 constraint, and make sure that earlyclobber of aliased outputs is honored. Cc: qemu-sta...@nongnu.org Fixes: 82790a870992 ("tcg: Add markup for output requires new register") Signed-off-by: Ilya Leoshkevich --- tcg/i386/tcg-target-con-

[PATCH v3 10/14] tests/tcg/s390x: Test CLM

2023-07-19 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/clm.S | 29 + 2 files changed, 30 insertions(+) create mode 100644 tests/tcg/s390x

[PATCH v3 08/14] tests/tcg/s390x: Test CKSM

2023-07-19 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/cksm.S | 29 + 2 files changed, 30 insertions(+) create mode 100644 tests/tcg/s390x/cksm.S diff --git a/tests

<    1   2   3   4   5   6   7   8   9   10   >