Re: [PULL 0/5] tcg patch queue

2023-01-20 Thread Ilya Leoshkevich
> >    accel/tcg: Split out cpu_exec_{setjmp,loop} (2023-01-16 10:14:12 > > -1000) > > > > > > - Reorg cpu_tb_exec around setjmp. > > - Use __attribute__((target)) for buffer_is_zero. > > - Add perfmap a

[PATCH v4 2/3] accel/tcg: Add debuginfo support

2023-01-12 Thread Ilya Leoshkevich
Add libdw-based functions for loading and querying debuginfo. Load debuginfo from the system and the linux-user loaders. This is useful for the upcoming perf support, which can then put human-readable guest symbols instead of raw guest PCs into perfmap and jitdump files. Signed-off-by: Ilya

[PATCH v4 0/3] tcg: add perfmap and jitdump

2023-01-12 Thread Ilya Leoshkevich
and Linux kernel - it's not fast, but it works. * Minor const correctness and style improvements. Ilya Leoshkevich (3): linux-user: Clean up when exiting due to a signal accel/tcg: Add debuginfo support tcg: add perfmap and jitdump accel/tcg/debuginfo.c | 96 ++ accel/tcg/de

[PATCH v4 3/3] tcg: add perfmap and jitdump

2023-01-12 Thread Ilya Leoshkevich
perf report or perf record -k 1 qemu-x86_64 -jitdump ./a.out DEBUGINFOD_URLS= perf inject -j -i perf.data -o perf.data.jitted perf report -i perf.data.jitted Co-developed-by: Vanderson M. do Rosario Co-developed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- accel/tcg

[PATCH v4 1/3] linux-user: Clean up when exiting due to a signal

2023-01-12 Thread Ilya Leoshkevich
When exiting due to an exit() syscall, qemu-user calls preexit_cleanup(), but this is currently not the case when exiting due to a signal. This leads to various buffers not being flushed (e.g., for gprof, for gcov, and for the upcoming perf support). Add the missing call. Signed-off-by: Ilya

Re: [PATCH v3 3/3] tcg: add perfmap and jitdump

2023-01-11 Thread Ilya Leoshkevich
On Wed, 2023-01-11 at 02:47 +0100, Ilya Leoshkevich wrote: > Add ability to dump /tmp/perf-.map and jit-.dump. > The first one allows the perf tool to map samples to each individual > translation block. The second one adds the ability to resolve symbol > names, line numbers and inspec

[PATCH v3 3/3] tcg: add perfmap and jitdump

2023-01-10 Thread Ilya Leoshkevich
perf report or perf record -k 1 qemu-x86_64 -jitdump ./a.out DEBUGINFOD_URLS= perf inject -j -i perf.data -o perf.data.jitted perf report -i perf.data.jitted Co-developed-by: Vanderson M. do Rosario Co-developed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- accel/tcg

[PATCH v3 2/3] accel/tcg: Add debuginfo support

2023-01-10 Thread Ilya Leoshkevich
Add libdw-based functions for loading and querying debuginfo. Load debuginfo from the system and the linux-user loaders. This is useful for the upcoming perf support, which can then put human-readable guest symbols instead of raw guest PCs into perfmap and jitdump files. Signed-off-by: Ilya

[PATCH v3 1/3] linux-user: Clean up when exiting due to a signal

2023-01-10 Thread Ilya Leoshkevich
When exiting due to an exit() syscall, qemu-user calls preexit_cleanup(), but this is currently not the case when exiting due to a signal. This leads to various buffers not being flushed (e.g., for gprof, for gcov, and for the upcoming perf support). Add the missing call. Signed-off-by: Ilya

[PATCH v3 0/3] tcg: add perfmap and jitdump

2023-01-10 Thread Ilya Leoshkevich
qemu-system-x86_64 and Linux kernel - it's not fast, but it works. * Minor const correctness and style improvements. Ilya Leoshkevich (3): linux-user: Clean up when exiting due to a signal accel/tcg: Add debuginfo support tcg: add perfmap and jitdump accel/tcg/debuginfo.c

PING: [PATCH v2 0/1] tcg: add perfmap and jitdump

2023-01-03 Thread Ilya Leoshkevich
On Mon, 2022-11-14 at 17:13 +0100, Ilya Leoshkevich wrote: > v1: > https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg01824.html > https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg01073.html > > v1 -> v2: > * Use QEMU_LOCK_GUARD (Alex). > * Hand

Re: [PULL v2 07/14] accel/tcg: Use interval tree for user-only page tracking

2022-12-23 Thread Ilya Leoshkevich
On Tue, Dec 20, 2022 at 09:03:06PM -0800, Richard Henderson wrote: > Finish weaning user-only away from PageDesc. > > Using an interval tree to track page permissions means that > we can represent very large regions efficiently. > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/290 >

Re: [PATCH] tests/tcg/multiarch: add vma-pthread.c

2022-12-23 Thread Ilya Leoshkevich
On Fri, 2022-12-23 at 13:02 +0100, Ilya Leoshkevich wrote: > Add a test that locklessly changes and exercises page protection bits > from various threads. This helps catch race conditions in the VMA > handling. > > Signed-off-by: Ilya Leoshkevich > --- >  tests/tcg/mult

[PATCH] tests/tcg/multiarch: add vma-pthread.c

2022-12-23 Thread Ilya Leoshkevich
Add a test that locklessly changes and exercises page protection bits from various threads. This helps catch race conditions in the VMA handling. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 3 + tests/tcg/multiarch/munmap-pthread.c | 16 +-- tests/tcg/multiarch

[PATCH RFC v2 0/1] tests: add wasmtime testsuite

2022-12-21 Thread Ilya Leoshkevich
builds of the Docker image. * Add riscv64; bump Rust and Wasmtime versions. * Do not use docker.py; unfortunately this leads to reimplementing some of its features: docker command detection based on $(ENGINE) and injecting the current user into the image. * Disable core dumps. Best regards, Ilya

[PATCH RFC v2 1/1] tests: add wasmtime testsuite

2022-12-21 Thread Ilya Leoshkevich
ones earlier. To this end, this patch introduces Makefile targets that run stable wasmtime testsuite against qemu-{aarch64,riscv64,s390x,x86_64}. Signed-off-by: Ilya Leoshkevich --- Makefile | 1 + docs/devel/testing.rst | 9 +++ tests

Re: [RFC] gitlab: introduce s390x wasmtime job

2022-12-19 Thread Ilya Leoshkevich
On Fri, 2022-12-16 at 15:10 +, Alex Bennée wrote: > > Ilya Leoshkevich writes: > > > On Tue, 2022-07-05 at 15:40 +0100, Peter Maydell wrote: > > > On Tue, 5 Jul 2022 at 15:37, Ilya Leoshkevich > > > wrote: > > > > > > > &g

Re: [PATCH v2 27/27] target/s390x: Enable TARGET_TB_PCREL

2022-12-14 Thread Ilya Leoshkevich
ged, 68 insertions(+), 31 deletions(-) Reviewed-by: Ilya Leoshkevich

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

2022-12-13 Thread Ilya Leoshkevich
ed with testcase of tor browser when running hppa-linux guest on > x86-64 host. > > Signed-off-by: Helge Deller > > --- > v2: based on feedback from Ilya Leoshkevich > - rename can_passthrough_madv_dontneed() to can_passthrough_madvise() > - rephrase the comment about MADV_DONTNEED Thanks! Acked-by: Ilya Leoshkevich

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

2022-12-13 Thread Ilya Leoshkevich
tions(-) Reviewed-by: Ilya Leoshkevich

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

2022-12-13 Thread Ilya Leoshkevich
> assert in cpu_get_tb_cpu_state. > > Signed-off-by: Richard Henderson > --- > target/s390x/cpu.h | 20 ++-- > target/s390x/tcg/translate.c | 6 +- > 2 files changed, 15 insertions(+), 11 deletions(-) Reviewed-by: Ilya Leoshkevich

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

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

Re: [PATCH v4 00/27] tcg/s390x: misc patches

2022-12-13 Thread Ilya Leoshkevich
On Thu, Dec 08, 2022 at 08:05:03PM -0600, Richard Henderson wrote: > Based-on: 20221202053958.223890-1-richard.hender...@linaro.org > ("[PATCH for-8.0 v3 00/34] tcg misc patches") > > Changes from v3: > * Require z196 as minimum cpu -- 6 new patches removing checks. > * Tighten constraints on

Re: [PATCH v4 27/27] tcg/s390x: Avoid the constant pool in tcg_out_movi

2022-12-13 Thread Ilya Leoshkevich
On Thu, Dec 08, 2022 at 08:05:30PM -0600, Richard Henderson wrote: > Load constants in no more than two insns, which turns > out to be faster than using the constant pool. > > Suggested-by: Ilya Leoshkevich > Signed-off-by: Richard Henderson > --- > tcg/s390x/

Re: [PATCH v4 26/27] tcg/s390x: Cleanup tcg_out_movi

2022-12-13 Thread Ilya Leoshkevich
> 1 file changed, 16 insertions(+), 36 deletions(-) Reviewed-by: Ilya Leoshkevich

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

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

Re: [PATCH v4 18/27] tcg/s390x: Tighten constraints for and_i64

2022-12-12 Thread Ilya Leoshkevich
On Thu, Dec 08, 2022 at 08:05:21PM -0600, Richard Henderson wrote: > Let the register allocator handle such immediates by matching > only what one insn can achieve. > > Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 17/27] tcg/s390x: Tighten constraints for or_i64 and xor_i64

2022-12-12 Thread Ilya Leoshkevich
> Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 16/27] tcg/s390x: Issue XILF directly for xor_i32

2022-12-12 Thread Ilya Leoshkevich
On Thu, Dec 08, 2022 at 08:05:19PM -0600, Richard Henderson wrote: > There is only one instruction that is applicable > to a 32-bit immediate xor. > > Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 10/27] tcg/s390x: Remove DISTINCT_OPERANDS facility check

2022-12-12 Thread Ilya Leoshkevich
for avoiding the distinct-operands insn. > > Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 08/27] tcg/s390x: Check for load-on-condition facility at startup

2022-12-12 Thread Ilya Leoshkevich
96), SLES 12 (z196) and Ubuntu 16.04 (zEC12). > > Check for facility number 45, which will be the consilidated check > for several facilities. > > Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 07/27] tcg/s390x: Check for general-instruction-extension facility at startup

2022-12-12 Thread Ilya Leoshkevich
cg-target.c.inc | 100 - > 2 files changed, 49 insertions(+), 61 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 06/27] tcg/s390x: Check for extended-immediate facility at startup

2022-12-12 Thread Ilya Leoshkevich
cg-target.c.inc | 231 +++-- > 2 files changed, 72 insertions(+), 163 deletions(-) Reviewed-by: Ilya Leoshkevich

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

2022-12-12 Thread Ilya Leoshkevich
On Mon, Dec 12, 2022 at 10:49:24PM +0100, Helge Deller wrote: > On 12/12/22 22:16, Ilya Leoshkevich wrote: > > On Mon, Dec 12, 2022 at 08:00:45AM +0100, Helge Deller wrote: > > > Both parameters have a different value on the parisc platform, so first > > > translate t

Re: [PATCH v4 05/27] tcg/s390x: Check for long-displacement facility at startup

2022-12-12 Thread Ilya Leoshkevich
| 6 -- > tcg/s390x/tcg-target.c.inc | 15 +++ > 2 files changed, 19 insertions(+), 2 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 04/27] tcg/s390x: Remove USE_LONG_BRANCHES

2022-12-12 Thread Ilya Leoshkevich
> 1 file changed, 9 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v4 03/27] tcg/s390x: Always set TCG_TARGET_HAS_direct_jump

2022-12-12 Thread Ilya Leoshkevich
tcg-target.c.inc | 48 +++--- > 2 files changed, 10 insertions(+), 40 deletions(-) Reviewed-by: Ilya Leoshkevich

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

2022-12-12 Thread Ilya Leoshkevich
en); > + } > } > } > mmap_unlock(); > Nit: maybe rename can_passthrough_madv_dontneed() to can_passthrough(), since now it's used not only for MADV_DONTNEED? With the MADV_DONTNEED comment change: Acked-by: Ilya Leoshkevich

Re: [PATCH v3 02/13] tcg/s390x: Remove TCG_REG_TB

2022-12-08 Thread Ilya Leoshkevich
On Tue, 2022-12-06 at 18:42 -0600, Richard Henderson wrote: > On 12/6/22 16:22, Richard Henderson wrote: > > > Wouldn't it be worth keeping XILF/XIFH here? > > > > I don't know.  It's difficult for me to guess whether a dependency > > chain like > > > > val -> xor -> xor > > > > (3 insns

Re: [PATCH v3 02/13] tcg/s390x: Remove TCG_REG_TB

2022-12-07 Thread Ilya Leoshkevich
On Tue, 2022-12-06 at 16:22 -0600, Richard Henderson wrote: > On 12/6/22 13:29, Ilya Leoshkevich wrote: > > On Thu, Dec 01, 2022 at 10:51:49PM -0800, Richard Henderson wrote: > > > This reverts 829e1376d940 ("tcg/s390: Introduce TCG_REG_TB"), and > > > se

Re: [PATCH v3 02/13] tcg/s390x: Remove TCG_REG_TB

2022-12-07 Thread Ilya Leoshkevich
On Wed, 2022-12-07 at 08:55 -0600, Richard Henderson wrote: > On 12/7/22 01:45, Thomas Huth wrote: > > On 06/12/2022 23.22, Richard Henderson wrote: > > > On 12/6/22 13:29, Ilya Leoshkevich wrote: > > > > This change doesn't seem to affect that, but what is the >

Re: [PATCH v3 13/13] tcg/s390x: Implement ctpop operation

2022-12-06 Thread Ilya Leoshkevich
- > tcg/s390x/tcg-target.h | 5 ++-- > tcg/s390x/tcg-target.c.inc | 51 ++ > 2 files changed, 54 insertions(+), 2 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 12/13] tcg/s390x: Use tgen_movcond_int in tgen_clz

2022-12-06 Thread Ilya Leoshkevich
390x/tcg-target.c.inc | 26 +++--- > 2 files changed, 12 insertions(+), 15 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 11/13] tcg/s390x: Support SELGR instruction in movcond

2022-12-06 Thread Ilya Leoshkevich
n > --- > tcg/s390x/tcg-target.c.inc | 21 + > 1 file changed, 21 insertions(+) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 10/13] tcg/s390x: Generalize movcond implementation

2022-12-06 Thread Ilya Leoshkevich
chard Henderson > --- > tcg/s390x/tcg-target-con-set.h | 3 +- > tcg/s390x/tcg-target.c.inc | 78 ++ > 2 files changed, 61 insertions(+), 20 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 09/13] tcg/s390x: Create tgen_cmp2 to simplify movcond

2022-12-06 Thread Ilya Leoshkevich
-target.c.inc | 25 + > 1 file changed, 17 insertions(+), 8 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 08/13] tcg/s390x: Support MIE3 logical operations

2022-12-06 Thread Ilya Leoshkevich
> tcg/s390x/tcg-target.c.inc | 100 + > 3 files changed, 114 insertions(+), 12 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 07/13] tcg/s390x: Support MIE2 MGRK instruction

2022-12-06 Thread Ilya Leoshkevich
tcg-target.c.inc | 8 > 3 files changed, 10 insertions(+), 1 deletion(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 06/13] tcg/s390x: Support MIE2 multiply single instructions

2022-12-06 Thread Ilya Leoshkevich
target.c.inc | 34 -- > 3 files changed, 26 insertions(+), 10 deletions(-) Reviewed-by: Ilya Leoshkevich I have one small suggestion, see below. > diff --git a/tcg/s390x/tcg-target-con-set.h b/tcg/s390x/tcg-target-con-set.h > index 00ba727b70..33a82e3286 10064

Re: [PATCH v3 05/13] tcg/s390x: Distinguish RIE formats

2022-12-06 Thread Ilya Leoshkevich
s(+), 21 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 04/13] tcg/s390x: Distinguish RRF-a and RRF-c formats

2022-12-06 Thread Ilya Leoshkevich
insertions(+), 25 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 03/13] tcg/s390x: Use LARL+AGHI for odd addresses

2022-12-06 Thread Ilya Leoshkevich
On Thu, Dec 01, 2022 at 10:51:50PM -0800, Richard Henderson wrote: > Add one instead of dropping odd addresses to the constant pool. > > Signed-off-by: Richard Henderson > --- > tcg/s390x/tcg-target.c.inc | 15 --- > 1 file changed, 8 insertions(+), 7 deletions(-)

Re: [PATCH v3 02/13] tcg/s390x: Remove TCG_REG_TB

2022-12-06 Thread Ilya Leoshkevich
- > 2 files changed, 23 insertions(+), 155 deletions(-) Reviewed-by: Ilya Leoshkevich I have a few questions/ideas for the future below. > diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h > index 22d70d431b..645f522058 100644 > --- a/tcg/s390x/tcg-target.h > ++

Re: [PATCH v3 29/34] tcg: Reorg function calls

2022-12-06 Thread Ilya Leoshkevich
On Tue, 2022-12-06 at 09:49 -0600, Richard Henderson wrote: > On 12/6/22 09:28, Ilya Leoshkevich wrote: > > > +    switch (TCG_TARGET_CALL_ARG_I64) { > > > +    case TCG_CALL_ARG_EVEN: > > > > On a s390x host with gcc-11.0.1-0.3.1.ibm.fc34.s390

Re: [PATCH v3 01/13] tcg/s390x: Use register pair allocation for div and mulu2

2022-12-06 Thread Ilya Leoshkevich
target.c.inc | 43 +- > 3 files changed, 35 insertions(+), 20 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 29/34] tcg: Reorg function calls

2022-12-06 Thread Ilya Leoshkevich
On Thu, Dec 01, 2022 at 09:39:53PM -0800, Richard Henderson wrote: > Pre-compute the function call layout for each helper at startup. > Drop TCG_CALL_DUMMY_ARG, as we no longer need to leave gaps > in the op->args[] array. This allows several places to stop > checking for NULL TCGTemp, to which

Re: [PATCH for-8.0] target/s390x: The MVCP and MVCS instructions are not privileged

2022-12-06 Thread Ilya Leoshkevich
g/mem_helper.c    | 16 >  target/s390x/tcg/translate.c |  6 -- >  4 files changed, 20 insertions(+), 10 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v2 for-8.0] target/s390x/tcg: Fix and improve the SACF instruction

2022-12-02 Thread Ilya Leoshkevich
upposed to generate a special operation exception. > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/655 > Signed-off-by: Thomas Huth > --- >  target/s390x/tcg/insn-data.h.inc | 2 +- >  target/s390x/tcg/cc_helper.c | 7 +++ >  2 files changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH-for-8.0 1/2] target/s390x: Replace TCGv by TCGv_i64 in op_mov2e()

2022-12-01 Thread Ilya Leoshkevich
(DisasContext *s, > DisasOps *o) >  static DisasJumpType op_mov2e(DisasContext *s, DisasOps *o) >  { > int b2 = get_field(s, b2); > -    TCGv ar1 = tcg_temp_new_i64(); > +    TCGv_i64 ar1 = tcg_temp_new_i64(); >   >      o->out = o->in2; > o->g_out = o-&

Re: [PATCH 25/26] tcg: Introduce tcg_temp_is_normal_*

2022-11-30 Thread Ilya Leoshkevich
ude/tcg/tcg.h| 15 +++ > 2 files changed, 17 insertions(+) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 24/26] tcg: Introduce tcg_temp_ebb_new_*

2022-11-30 Thread Ilya Leoshkevich
case TEMP_EBB: > case TEMP_LOCAL: > break; > default: > @@ -1063,7 +1055,7 @@ void tcg_temp_free_internal(TCGTemp *ts) > ts->temp_allocated = 0; > > idx = temp_idx(ts); > -k = ts->base_type + (ts->kind == TEMP_NORMAL ? 0 :

Re: [PATCH 23/26] tcg: Pass TCGTempKind to tcg_temp_new_internal

2022-11-30 Thread Ilya Leoshkevich
s(+), 12 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 22/26] target/s390x: Pass original r2 register to BCR

2022-11-30 Thread Ilya Leoshkevich
cg/translate.c | 10 ++ > target/s390x/tcg/insn-data.def | 2 +- > 2 files changed, 11 insertions(+), 1 deletion(-) Reviewed-by: Ilya Leoshkevich

[PATCH 2/2] tests/tcg/s390x: Add per.S

2022-11-30 Thread Ilya Leoshkevich
Add a small test to avoid regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/per.S | 55 + 2 files changed, 56 insertions(+) create mode 100644 tests/tcg/s390x/per.S diff --git a/tests/tcg

[PATCH 1/2] target/s390x: Fix successful-branch PER events

2022-11-30 Thread Ilya Leoshkevich
The branching code sets per_perc_atmid, but afterwards it does goto_tb/exit_tb, so per_check_exception() added by translate_one() is not reached. Fix by raising PER exception in per_branch(). Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/misc_helper.c | 1 + 1 file changed, 1 insertion

Re: [PATCH 21/26] target/s390x: Remove PER check from use_goto_tb

2022-11-30 Thread Ilya Leoshkevich
,$0x4 goto_tb $0x1 exit_tb $0x7f73fc000401 /* check per_perc_atmid */ call per_check_exception,$0x0,$0,env set_label $L0 exit_tb $0x7f73fc000403 I will post the proposed fix and the test itself shortly. That said, the patch makes sense to me and does not make things worse, so: Reviewed-by: Ilya Leoshkevich

Re: [PATCH 20/26] target/s390x: Split per_breaking_event from per_branch_*

2022-11-30 Thread Ilya Leoshkevich
t; 1 file changed, 4 insertions(+), 3 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 19/26] target/s390x: Simplify help_branch

2022-11-30 Thread Ilya Leoshkevich
tions(+), 110 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 17/26] target/s390x: Introduce help_goto_indirect

2022-11-30 Thread Ilya Leoshkevich
tions(-) Reviewed-by: Ilya Leoshkevich

[PATCH v3] tests/tcg/s390x: Add cdsg.c

2022-11-29 Thread Ilya Leoshkevich
Add a simple test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- Sorry, I just realized that in v2 that I sent the iteration count was not increased. For v3 I've decided to bump it further to 1m, since it's still fast enough: $ time -p ./qemu-s390x ./tests/tcg/s390x-linux-user

[PATCH v2] tests/tcg/s390x: Add cdsg.c

2022-11-29 Thread Ilya Leoshkevich
Add a simple test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 4 ++ tests/tcg/s390x/cdsg.c | 84 + 2 files changed, 88 insertions(+) create mode 100644 tests/tcg/s390x/cdsg.c diff --git a/tests/tcg

Re: [PATCH] tests/tcg/s390x: Add cdsg.c

2022-11-29 Thread Ilya Leoshkevich
On Tue, Nov 29, 2022 at 09:54:13AM +0100, David Hildenbrand wrote: > On 29.11.22 00:48, Ilya Leoshkevich wrote: > > Add a simple test to prevent regressions. > > > > Signed-off-by: Ilya Leoshkevich > > --- > > tests/tcg/s390x/Makefile.target | 4 ++ > >

[PATCH] tests/tcg/s390x: Add sam.S

2022-11-28 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/sam.S | 67 + 2 files changed, 68 insertions(+) create mode 100644 tests/tcg/s390x/sam.S diff --git a/tests

Re: [PATCH 12/26] target/s390x: Move masking of psw.addr to cpu_get_tb_cpu_state

2022-11-28 Thread Ilya Leoshkevich
On Sat, Nov 05, 2022 at 09:27:07AM +1100, Richard Henderson wrote: > On 11/4/22 00:42, Ilya Leoshkevich wrote: > > On Wed, Oct 05, 2022 at 08:44:07PM -0700, Richard Henderson wrote: > > > Masking after the fact in s390x_tr_init_disas_context > > > provides incorre

[PATCH] tests/tcg/s390x: Add cdsg.c

2022-11-28 Thread Ilya Leoshkevich
Add a simple test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 4 ++ tests/tcg/s390x/cdsg.c | 73 + 2 files changed, 77 insertions(+) create mode 100644 tests/tcg/s390x/cdsg.c diff --git a/tests/tcg

Re: [PATCH for-8.0 v2 13/13] target/s390x: Implement CC_OP_NZ in gen_op_calc_cc

2022-11-28 Thread Ilya Leoshkevich
On Fri, Nov 11, 2022 at 06:08:20PM +1000, Richard Henderson wrote: > This case is trivial to implement inline. > > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/translate.c | 3 +++ > 1 file changed, 3 insertions(+) Acked-by: Ilya Leoshkevich

Re: [PATCH for-8.0 v2 12/13] target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG

2022-11-28 Thread Ilya Leoshkevich
late.c | 60 > target/s390x/tcg/insn-data.h.inc | 2 +- > 4 files changed, 38 insertions(+), 78 deletions(-) Acked-by: Ilya Leoshkevich I was wondering what assembly this would generate in parallel mode and wrote a small test. On my x86_64 machine it ended up being help

Re: [PATCH for-8.0 v2 11/13] target/s390x: Use Int128 for passing float128

2022-11-28 Thread Ilya Leoshkevich
s390x/tcg/translate.c | 76 ++- > target/s390x/tcg/insn-data.h.inc | 30 +-- > 4 files changed, 121 insertions(+), 105 deletions(-) Acked-by: Ilya Leoshkevich

Re: [PATCH for-8.0 v2 10/13] target/s390x: Use Int128 for returning float128

2022-11-28 Thread Ilya Leoshkevich
/fpu_helper.c| 29 +- > target/s390x/tcg/translate.c | 51 +--- > target/s390x/tcg/insn-data.h.inc | 20 ++--- > 4 files changed, 63 insertions(+), 59 deletions(-) Acked-by: Ilya Leoshkevich

Re: [PATCH for-8.0 v2 04/13] target/s390x: Use a single return for helper_divs32/u32

2022-11-28 Thread Ilya Leoshkevich
t/s390x/tcg/int_helper.c | 26 +- > target/s390x/tcg/translate.c | 8 > 3 files changed, 18 insertions(+), 18 deletions(-) Acked-by: Ilya Leoshkevich

[PATCH v2 1/1] tcg: add perfmap and jitdump

2022-11-14 Thread Ilya Leoshkevich
perf report or perf record -k 1 qemu-x86_64 -jitdump ./a.out perf inject -j -i perf.data -o perf.data.jitted perf report -i perf.data.jitted Co-developed-by: Vanderson M. do Rosario Co-developed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20221012051846.143205

Re: [PATCH] s390x: Fix spelling errors

2022-11-14 Thread Ilya Leoshkevich
lper.c | 2 +- > target/s390x/tcg/misc_helper.c | 2 +- > target/s390x/tcg/translate.c| 4 ++-- > target/s390x/tcg/translate_vx.c.inc | 6 +++--- > pc-bios/s390-ccw/start.S| 2 +- > 13 files changed, 19 insertions(+), 19 deletions(-) Reviewed-by: Ilya Leoshkevich

[PATCH v2 0/1] tcg: add perfmap and jitdump

2022-11-14 Thread Ilya Leoshkevich
emu-system-x86_64 and Linux kernel - it's not fast, but it works. * Minor const correctness and style improvements. Ilya Leoshkevich (1): tcg: add perfmap and jitdump accel/tcg/debuginfo.c | 99 +++ accel/tcg/debuginfo.h | 52 ++ accel/tcg/meson.build | 2 + accel/tcg/per

Re: [PATCH 18/26] target/s390x: Split per_branch

2022-11-03 Thread Ilya Leoshkevich
r_disp(s, dest, disp); > +gen_helper_per_branch(cpu_env, gbea, dest); > +tcg_temp_free_i64(dest); > } > #endif > } ... Nit: maybe use per_enabled(s) instead of testing the mask manually? Reviewed-by: Ilya Leoshkevich

Re: [PATCH 16/26] target/s390x: Disable conditional branch-to-next for PER

2022-11-03 Thread Ilya Leoshkevich
> > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/translate.c | 13 ++--- > 1 file changed, 6 insertions(+), 7 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 15/26] target/s390x: Introduce per_enabled

2022-11-03 Thread Ilya Leoshkevich
On Wed, Oct 05, 2022 at 08:44:10PM -0700, Richard Henderson wrote: > Hoist the test of FLAG_MASK_PER to a helper. > > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/translate.c | 23 --- > 1 file changed, 16 insertions(+), 7 deletions(-)

Re: [PATCH 14/26] target/s390x: Don't set gbea for user-only

2022-11-03 Thread Ilya Leoshkevich
On Wed, Oct 05, 2022 at 08:44:09PM -0700, Richard Henderson wrote: > The rest of the per_* functions have this ifdef; > this one seemed to be missing. > > Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich

Re: [PATCH 13/26] target/s390x: Add disp argument to update_psw_addr

2022-11-03 Thread Ilya Leoshkevich
On Wed, Oct 05, 2022 at 08:44:08PM -0700, Richard Henderson wrote: > Rename to update_psw_addr_disp at the same time. > > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/translate.c | 22 +++--- > 1 file changed, 11 insertions(+), 11 deletions(-)

Re: [PATCH 12/26] target/s390x: Move masking of psw.addr to cpu_get_tb_cpu_state

2022-11-03 Thread Ilya Leoshkevich
On Wed, Oct 05, 2022 at 08:44:07PM -0700, Richard Henderson wrote: > Masking after the fact in s390x_tr_init_disas_context > provides incorrect information to tb_lookup. > > Signed-off-by: Richard Henderson > --- > target/s390x/cpu.h | 13 +++-- > target/s390x/tcg/translate.c

Re: [PATCH 11/26] target/s390x: Use ilen instead in branches

2022-11-03 Thread Ilya Leoshkevich
On Wed, Oct 05, 2022 at 08:44:06PM -0700, Richard Henderson wrote: > Remove the remaining uses of pc_tmp, and remove the variable. > > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/translate.c | 13 +++-- > 1 file changed, 3 insertions(+), 10 deletions(-)

Re: [PATCH 10/26] target/s390x: Use gen_psw_addr_disp in op_sam

2022-11-03 Thread Ilya Leoshkevich
s(+), 12 deletions(-) Reviewed-by: Ilya Leoshkevich

[PATCH] tests/tcg/s390x: Add bal.S

2022-11-03 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/bal.S | 24 2 files changed, 25 insertions(+) create mode 100644 tests/tcg/s390x/bal.S diff --git a/tests/tcg

Re: [PATCH 09/26] target/s390x: Use gen_psw_addr_disp in save_link_info

2022-11-03 Thread Ilya Leoshkevich
d, 4 insertions(+), 2 deletions(-) I was a bit worried about this sequence and wrote a regression test. It did not find any issues, but I will post it here, might prove useful some day. Reviewed-by: Ilya Leoshkevich

Re: [PATCH 07/26] target/s390x: Remove pc argument to pc_to_link_into

2022-11-03 Thread Ilya Leoshkevich
On Wed, Oct 05, 2022 at 08:44:02PM -0700, Richard Henderson wrote: > All callers pass s->pc_tmp. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > target/s390x/tcg/translate.c | 10 ++ > 1 file changed, 6 insertions(+), 4 deletio

Re: [PATCH 06/26] target/s390x: Introduce gen_psw_addr_disp

2022-11-03 Thread Ilya Leoshkevich
ged, 46 insertions(+), 23 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 08/26] target/s390x: Use gen_psw_addr_disp in pc_to_link_info

2022-11-03 Thread Ilya Leoshkevich
g/translate.c | 21 - > 1 file changed, 12 insertions(+), 9 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 05/26] target/s390x: Change help_goto_direct to work on displacements

2022-11-03 Thread Ilya Leoshkevich
tions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 04/26] target/s390x: Use tcg_constant_* in translate_vx.c.inc

2022-11-03 Thread Ilya Leoshkevich
t; TCGv_i64 t1 = tcg_temp_new_i64(); > TCGv_i64 t2 = tcg_temp_new_i64(); > TCGv_i64 t3 = tcg_temp_new_i64(); This also fixes a leak, right? ... Reviewed-by: Ilya Leoshkevich

Re: [PATCH 03/26] target/s390x: Use tcg_constant_i32 for fpinst_extract_m34

2022-11-03 Thread Ilya Leoshkevich
> 1 file changed, 1 insertion(+), 25 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 02/26] target/s390x: Use tcg_constant_* for DisasCompare

2022-11-03 Thread Ilya Leoshkevich
-- > target/s390x/tcg/translate.c | 44 ++-- > 1 file changed, 22 insertions(+), 22 deletions(-) I did not check all the code paths in the consumer, but if there is a bug and a or b ends up being modified, one of the temp_readonly() assertions will catc

<    2   3   4   5   6   7   8   9   10   >