[PATCH 42/70] target/ppc: Rewrite trans_ADDG6S

2023-02-26 Thread Richard Henderson
Compute all carry bits in parallel instead of a loop. Signed-off-by: Richard Henderson --- target/ppc/translate/fixedpoint-impl.c.inc | 44 +++--- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/target/ppc/translate/fixedpoint-impl.c.inc

[PATCH v4 18/31] tcg: Change default temp lifetime to TEMP_TB

2023-02-26 Thread Richard Henderson
Guest front-ends now get temps that span the lifetime of the translation block by default, which avoids accidentally using the temp across branches and invalidating the data. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 8 1 file

[PATCH v2 51/76] target/riscv: Drop ftemp_new

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record temps for later freeing. Replace the few uses with tcg_temp_new_i64. Reviewed-by: Weiwei Li Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/riscv/translate.c | 24

[PATCH 59/70] target/tricore: Use setcondi instead of explicit allocation

2023-02-26 Thread Richard Henderson
This removes the only use of temp. Signed-off-by: Richard Henderson --- target/tricore/translate.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index d5129f22f5..6b7b876808 100644 ---

[PATCH 39/70] target/ppc: Avoid tcg_const_* in vsx-impl.c.inc

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/vsx-impl.c.inc | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc index

[PATCH 46/70] target/rx: Use tcg_gen_abs_i32

2023-02-26 Thread Richard Henderson
Remove the local definition of rx_abs. Signed-off-by: Richard Henderson --- target/rx/translate.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 6624414739..998e6e0b7e 100644 --- a/target/rx/translate.c +++

[PATCH 70/70] tcg: Drop tcg_const_*

2023-02-26 Thread Richard Henderson
These functions are no longer used. Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 4 include/tcg/tcg.h| 6 -- tcg/tcg.c| 16 3 files changed, 26 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index

[PATCH v2 43/76] target/mips: Drop tcg_temp_free from translate_addr_const.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/translate_addr_const.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/target/mips/tcg/translate_addr_const.c b/target/mips/tcg/translate_addr_const.c index

[PATCH 06/70] target/arm: Improve trans_BFCI

2023-02-26 Thread Richard Henderson
Reorg temporary usage so that we can use tcg_constant_i32. tcg_gen_deposit_i32 already has a width == 32 special case, so remove the check here. Signed-off-by: Richard Henderson --- target/arm/translate.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git

[PATCH v2 59/76] target/s390x: Drop free_compare

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Remove the g1 and g2 members of DisasCompare, as they were used to track which temps needed to be freed. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 46 +--- 1 file changed, 1

[PATCH 49/70] target/rx: Avoid tcg_const_i32

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/rx/translate.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 6b218d5d5e..70fad98e93 100644 ---

[PATCH v4 24/31] target/hppa: Don't use tcg_temp_local_new

2023-02-26 Thread Richard Henderson
This wasn't actually used at all, just some unused macro re-definitions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index

[PATCH 22/70] target/i386: Simplify POPF

2023-02-26 Thread Richard Henderson
Compute the eflags write mask separately, leaving one call to the helper. Use tcg_constant_i32. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 55 - 1 file changed, 11 insertions(+), 44 deletions(-) diff --git

[PATCH 41/70] target/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/power8-pmu-regs.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/power8-pmu-regs.c.inc b/target/ppc/power8-pmu-regs.c.inc index 42f2cd04a1..d900e13cad 100644 ---

[PATCH v4 11/31] tcg: Add tcg_gen_movi_ptr

2023-02-26 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 839d91c0c7..66b1461caa 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -1285,6

[PATCH 09/70] target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn

2023-02-26 Thread Richard Henderson
It is easy enough to use mov instead of or-with-zero and relying on the optimizer to fold away the or. Use an array for the output, rather than separate tcg_res{l,h} variables. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 41 +++--- 1 file

[PATCH v2 76/76] docs/devel/tcg-ops: Drop recommendation to free temps

2023-02-26 Thread Richard Henderson
Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- docs/devel/tcg-ops.rst | 4 1 file changed, 4 deletions(-) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 561c416574..f3f451b77f 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst

[PATCH v2 71/76] target/xtensa: Drop reset_sar_tracker

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Remove sar_m32_allocated, as sar_m32 non-null is equivalent. Reviewed-by: Max Filippov Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git

[PATCH 17/70] target/hexagon/idef-parser: Use gen_tmp for gen_pred_assign

2023-02-26 Thread Richard Henderson
The allocation is immediately followed by tcg_gen_mov_i32, so the initial assignment of zero is discarded. Signed-off-by: Richard Henderson --- target/hexagon/idef-parser/parser-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 04/70] target/arm: Consistently use ARMFPRounding during translation

2023-02-26 Thread Richard Henderson
In preparation for extracting new helpers, ensure that the rounding mode is represented as ARMFPRounding and not FloatRoundMode. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 16 target/arm/translate-sve.c | 18 +- target/arm/translate-vfp.c

[PATCH 40/70] target/ppc: Avoid tcg_const_* in fp-impl.c.inc

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/fp-impl.c.inc | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/target/ppc/translate/fp-impl.c.inc b/target/ppc/translate/fp-impl.c.inc index

[PATCH 28/70] target/m68k: Avoid tcg_const_* throughout

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 158 1 file changed, 77 insertions(+), 81 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 3d97aaf578..e16c608ef8

[PATCH 37/70] target/ppc: Avoid tcg_const_* in vmx-impl.c.inc

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc index

[PATCH v4 01/31] tcg: Adjust TCGContext.temps_in_use check

2023-02-26 Thread Richard Henderson
Change the temps_in_use check to use assert not fprintf. Move the assert for double-free before the check for count, since that is the more immediate problem. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 12 +--- 1 file changed, 5 insertions(+),

[PATCH 67/70] target/xtensa: Avoid tcg_const_i32

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index f906ba7ed5..0cf3075649 100644 ---

[PATCH v2 67/76] target/sparc: Remove egress label in disas_sparc_context

2023-02-26 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/sparc/translate.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index bdf464f802..560fb32e28 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c

[PATCH 25/70] target/m68k: Use tcg_constant_i32 in gen_ea_mode

2023-02-26 Thread Richard Henderson
Return a constant for an immediate input. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 7a87811427..7435e51acc 100644 --- a/target/m68k/translate.c +++

[PATCH v4 30/31] tcg: Remove tcg_temp_local_new_*, tcg_const_local_*

2023-02-26 Thread Richard Henderson
These symbols are now unused. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 2 -- include/tcg/tcg.h| 28 tcg/tcg.c| 16 3 files changed, 46 deletions(-) diff --git

[PATCH v4 08/31] tcg: Remove TEMP_NORMAL

2023-02-26 Thread Richard Henderson
TEMP_NORMAL is a subset of TEMP_EBB. Promote single basic block temps to single extended basic block. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 -- tcg/tcg.c | 19 +++ 2 files changed, 3 insertions(+), 18

[PATCH v2 30/76] target/i386: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 41 target/i386/tcg/decode-new.c.inc | 15 target/i386/tcg/emit.c.inc | 6 - 3 files changed, 62

[PATCH 11/70] target/arm: Avoid tcg_const_ptr in handle_rev

2023-02-26 Thread Richard Henderson
Here it is not trivial to notice first initialization, so explicitly zero the temps. Use an array for the output, rather than separate tcg_rd/tcg_rd_hi variables. Fixes a bug by adding a missing clear_vec_high. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 26

[PATCH 16/70] target/hexagon/idef-parser: Use gen_tmp for LPCFG

2023-02-26 Thread Richard Henderson
The GET_USR_FIELD macro initializes the output, so the initial assignment of zero is discarded. This is the only use of get_tmp_value outside of parser-helper.c, so make it static. Signed-off-by: Richard Henderson --- target/hexagon/idef-parser/parser-helpers.h | 6 --

[PATCH 64/70] target/xtensa: Avoid tcg_const_i32 in translate_l32r

2023-02-26 Thread Richard Henderson
Use addi on the addition side and tcg_constant_i32 on the other. Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index d727f9ffd8..41b84082de 100644 ---

[PATCH v4 29/31] exec/gen-icount: Don't use tcg_temp_local_new_i32

2023-02-26 Thread Richard Henderson
Since tcg_temp_new_i32 is now identical, use that. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/gen-icount.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h index

[PATCH 36/70] target/ppc: Avoid tcg_const_i64 in do_vcntmb

2023-02-26 Thread Richard Henderson
Compute both partial results separately and accumulate at the end, instead of accumulating in the middle. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git

[PATCH 51/70] target/s390x: Avoid tcg_const_i64

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 7969051ce9..32d61fc40d 100644 ---

[PATCH 34/70] target/ppc: Split out gen_vx_vmul10

2023-02-26 Thread Richard Henderson
Move the body out of this large macro. Use tcg_constant_i64. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 95 +++-- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/target/ppc/translate/vmx-impl.c.inc

[PATCH 26/70] target/m68k: Avoid tcg_const_i32 when modified

2023-02-26 Thread Richard Henderson
In several instances, a temp is initialized with a for use as a constant, and then subsequently used as an unrelated temp. Split them. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git

[PATCH 53/70] target/sh4: Avoid tcg_const_i32

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/sh4/translate.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 70a45c26e8..97da8bce48 100644 ---

[PATCH v2 00/76] tcg: Drop tcg_temp_free from translators

2023-02-26 Thread Richard Henderson
Based-on: 20230225085945.1798188-1-richard.hender...@linaro.org ("[PATCH v3 00/30] tcg: Simplify temporary usage") In the above patch set, we changed the lifetime of the temps allocated by the guest translators, and eliminated their reuse, so that we have the best chance of reducing their

[PATCH 45/70] target/riscv: Avoid tcg_const_*

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/riscv/translate.c | 4 ++-- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/insn_trans/trans_rvzfh.c.inc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git

[PATCH 48/70] target/rx: Avoid tcg_const_i32 when new temp needed

2023-02-26 Thread Richard Henderson
These three cases use a constant as first input, and then overwrite the temp in the output. Separate them. Signed-off-by: Richard Henderson --- target/rx/translate.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c

[PATCH v4 25/31] target/i386: Don't use tcg_temp_local_new

2023-02-26 Thread Richard Henderson
Since tcg_temp_new is now identical, use that. In some cases we can avoid a copy from A0 or T0. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git

[PATCH 05/70] target/arm: Create gen_set_rmode, gen_restore_rmode

2023-02-26 Thread Richard Henderson
Split out common subroutines for handing rounding mode changes during translation. Use tcg_constant_i32 and tcg_temp_new_i32 instead of tcg_const_i32. Signed-off-by: Richard Henderson --- target/arm/translate.h | 17 ++ target/arm/translate-a64.c | 47

[PATCH v2 75/76] tcg: Create tcg/tcg-temp-internal.h

2023-02-26 Thread Richard Henderson
Move the tcg_temp_free_* and tcg_temp_ebb_new_* declarations and inlines to the new header. These are private to the implementation, and will prevent tcg_temp_free_* from creaping back into the guest front ends. Signed-off-by: Richard Henderson --- include/tcg/tcg-temp-internal.h | 83

[PATCH 20/70] target/hppa: Avoid tcg_const_i64 in trans_fid_f

2023-02-26 Thread Richard Henderson
Use a C test instead of a pre-processor test for the id. Use tcg_constant_i64 instead of tcg_const_i64. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/target/hppa/translate.c

[PATCH 03/70] target/arm: Improve arm_rmode_to_sf

2023-02-26 Thread Richard Henderson
Use proper enumeration types for input and output. Use a const array to perform the mapping, with an assert that the input is valid. Signed-off-by: Richard Henderson --- target/arm/internals.h | 12 +--- target/arm/translate-mve.c | 2 +- target/arm/vfp_helper.c| 33

[PATCH v2 20/76] target/avr: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/avr/translate.c | 228 - 1 file changed, 228 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index 4f8112c3e6..b9506a8d86

[PATCH v2 44/76] target/mips: Drop tcg_temp_free from tx79_translate.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/tx79_translate.c | 41 1 file changed, 41 deletions(-) diff --git a/target/mips/tcg/tx79_translate.c b/target/mips/tcg/tx79_translate.c index

[PATCH v4 16/31] accel/tcg/plugin: Tidy plugin_gen_disable_mem_helpers

2023-02-26 Thread Richard Henderson
Here we are creating a temp whose value needs to be replaced, but always storing NULL into CPUState.plugin_mem_cbs. Use tcg_constant_ptr(0) explicitly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 8 ++-- 1 file changed, 2 insertions(+),

[PATCH 12/70] target/avr: Avoid use of tcg_const_i32 in SBIC, SBIS

2023-02-26 Thread Richard Henderson
The use of separate data/port variables is existing practice elsewhere, e.g. SBI, CBI. Signed-off-by: Richard Henderson --- target/avr/translate.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index

[PATCH v2 27/76] target/hexagon/idef-parser: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. This removes gen_rvalue_free, gen_rvalue_free_manual and free_variables, whose only purpose was to emit tcg_temp_free. Signed-off-by: Richard Henderson --- target/hexagon/idef-parser/README.rst | 8 --

[PATCH v2 58/76] target/s390x: Use tcg_constant_* in translate_vx.c.inc

2023-02-26 Thread Richard Henderson
In most cases, this is a simple local allocate and free replaced by tcg_constant_*. In three cases, a variable temp was initialized with a constant value -- reorg to localize the constant. In gen_acc, this fixes a leak. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich

[PATCH v2 41/76] target/mips: Drop tcg_temp_free from nanomips_translate.c.inc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/nanomips_translate.c.inc | 127 ++- 1 file changed, 10 insertions(+), 117 deletions(-) diff --git a/target/mips/tcg/nanomips_translate.c.inc

[PATCH 33/70] target/mips: Avoid tcg_const_* throughout

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 4 +- target/mips/tcg/translate.c | 56 +++ target/mips/tcg/tx79_translate.c | 4 +- target/mips/tcg/micromips_translate.c.inc

[PATCH v4 27/31] target/ppc: Don't use tcg_temp_local_new

2023-02-26 Thread Richard Henderson
Since tcg_temp_new is now identical, use that. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/ppc/translate.c | 6 +++--- target/ppc/translate/spe-impl.c.inc | 8 target/ppc/translate/vmx-impl.c.inc | 4 ++-- 3 files changed, 9

[PATCH v2 42/76] target/mips: Drop tcg_temp_free from octeon_translate.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/octeon_translate.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/target/mips/tcg/octeon_translate.c b/target/mips/tcg/octeon_translate.c index

[PATCH v2 74/76] tracing: remove transform.py

2023-02-26 Thread Richard Henderson
This file, and a couple of uses, got left behind when the tcg stuff was removed from tracetool. Fixes: 126d4123c50a ("tracing: excise the tcg related from tracetool") Signed-off-by: Richard Henderson --- meson.build| 1 - scripts/tracetool/__init__.py | 23 -

[PATCH 07/70] target/arm: Avoid tcg_const_ptr in gen_sve_{ldr,str}

2023-02-26 Thread Richard Henderson
This hides the implicit initialization of a variable. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 3ca60fb36b..92ab290106 100644 ---

[PATCH 32/70] target/mips: Avoid tcg_const_tl in gen_r6_ld

2023-02-26 Thread Richard Henderson
Allocate a separate temp for modification. Signed-off-by: Richard Henderson --- target/mips/tcg/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 5c5660da5a..bec0a26c83 100644 ---

[PATCH v4 17/31] tcg: Don't re-use TEMP_TB temporaries

2023-02-26 Thread Richard Henderson
Reusing TEMP_TB interferes with detecting whether the temp can be adjusted to TEMP_EBB. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- tcg/tcg.c | 101 -- 2 files changed, 53 insertions(+), 50 deletions(-) diff --git

[PATCH 21/70] target/hppa: Avoid use of tcg_const_i32 throughout

2023-02-26 Thread Richard Henderson
All uses were read-write, so replace with a new allocation and initialization. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index

[PATCH v2 72/76] target/xtensa: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Reviewed-by: Max Filippov Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 107 -- 1 file changed, 107 deletions(-) diff --git a/target/xtensa/translate.c

[PATCH v4 14/31] tcg: Use tcg_constant_ptr in do_dup

2023-02-26 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index a10d406bba..877b0b659b 100644 ---

[PATCH v2 29/76] target/hppa: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 93 + 1 file changed, 1 insertion(+), 92 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index

[PATCH v4 07/31] tcg: Add liveness_pass_0

2023-02-26 Thread Richard Henderson
Attempt to reduce the lifetime of TEMP_TB. Signed-off-by: Richard Henderson --- tcg/tcg.c | 70 +++ 1 file changed, 70 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 7ee935701a..6646770268 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@

[PATCH v2 46/76] target/mips: Drop tcg_temp_free from vr54xx_translate.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/vr54xx_translate.c | 4 1 file changed, 4 deletions(-) diff --git a/target/mips/tcg/vr54xx_translate.c b/target/mips/tcg/vr54xx_translate.c index a7d241e4e7..804672f84c 100644

[PATCH v2 52/76] target/riscv: Drop temp_new

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record temps for later freeing. Replace the few uses with tcg_temp_new. Reviewed-by: Weiwei Li Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/riscv/translate.c

[PATCH v2 37/76] target/mips: Drop tcg_temp_free from micromips_translate.c.inc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/micromips_translate.c.inc | 8 1 file changed, 8 deletions(-) diff --git a/target/mips/tcg/micromips_translate.c.inc b/target/mips/tcg/micromips_translate.c.inc index

[PATCH v2 60/76] target/s390x: Drop tcg_temp_free from translate_vx.c.inc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate_vx.c.inc | 143 1 file changed, 143 deletions(-) diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/translate_vx.c.inc

[PATCH v2 45/76] target/mips: Fix trans_mult_acc return

2023-02-26 Thread Richard Henderson
Success from trans_* subroutines should be true. Fixes: 5fa38eedbd ("target/mips: Convert Vr54xx MACC* opcodes to decodetree") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/mips/tcg/vr54xx_translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 36/76] target/microblaze: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 54 --- 1 file changed, 54 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index

[PATCH v2 21/76] target/cris: Drop cris_alu_free_temps

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/cris/translate.c | 20 1 file changed, 20 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index a959b27373..76db745fe2 100644 ---

[PATCH v2 04/76] target/arm: Remove arm_free_cc, a64_free_cc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/arm/translate.h | 1 - target/arm/translate-a64.c | 17 - target/arm/translate.c | 9 - 3 files changed, 4 insertions(+), 23 deletions(-) diff --git

[PATCH v2 19/76] target/avr: Drop R from trans_COM

2023-02-26 Thread Richard Henderson
This variable is not used, only allocated and freed. Signed-off-by: Richard Henderson --- target/avr/translate.c | 4 1 file changed, 4 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index e7f0e2bbe3..4f8112c3e6 100644 --- a/target/avr/translate.c +++

[PATCH v2 35/76] target/m68k: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 181 1 file changed, 181 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index d7237b6a99..3055d2d246

[PATCH v2 24/76] target/cris: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/cris/translate.c | 70 - target/cris/translate_v10.c.inc | 41 --- 2 files changed, 111 deletions(-) diff --git

[PATCH v2 32/76] target/loongarch: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Reviewed-by: Song Gao Signed-off-by: Richard Henderson --- target/loongarch/insn_trans/trans_arith.c.inc | 12 --- .../loongarch/insn_trans/trans_atomic.c.inc | 3 -- target/loongarch/insn_trans/trans_bit.c.inc | 12 ---

[PATCH v2 09/76] target/arm: Drop new_tmp_a64_zero

2023-02-26 Thread Richard Henderson
Only the use within cpu_reg requires a writable temp, so inline new_tmp_a64_zero there. All other uses are fine with a constant temp, so use tcg_constant_i64(0). Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 1 - target/arm/translate-a64.c | 41

[PATCH v2 07/76] target/arm: Drop DisasContext.tmp_a64

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record temps for later freeing. Signed-off-by: Richard Henderson --- target/arm/translate.h | 3 --- target/arm/translate-a64.c | 25 + 2 files changed, 1 insertion(+), 27

[PATCH v2 33/76] target/m68k: Drop mark_to_release

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record temps for later freeing. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 55 ++--- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git

[PATCH v2 39/76] target/mips: Drop tcg_temp_free from msa_translate.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/msa_translate.c | 9 - 1 file changed, 9 deletions(-) diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c index 1bcdbb1121..220cd3b048 100644 ---

[PATCH v2 03/76] target/alpha: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/alpha/translate.c | 70 1 file changed, 70 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index a0afdbb465..9d25e21164

[PATCH v2 38/76] target/mips: Drop tcg_temp_free from mips16e_translate.c.inc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/mips16e_translate.c.inc | 6 -- 1 file changed, 6 deletions(-) diff --git a/target/mips/tcg/mips16e_translate.c.inc b/target/mips/tcg/mips16e_translate.c.inc index

[PATCH v2 05/76] target/arm: Remove value_global from DisasCompare

2023-02-26 Thread Richard Henderson
This field was only used to avoid freeing globals. Since we no longer free any temps, this is dead. Signed-off-by: Richard Henderson --- target/arm/translate.h | 1 - target/arm/translate.c | 5 - 2 files changed, 6 deletions(-) diff --git a/target/arm/translate.h b/target/arm/translate.h

[PATCH v2 12/76] target/arm: Drop tcg_temp_free from translator-mve.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/arm/translate-mve.c | 52 -- 1 file changed, 52 deletions(-) diff --git a/target/arm/translate-mve.c b/target/arm/translate-mve.c index

[PATCH v2 02/76] accel/tcg: Remove translator_loop_temp_check

2023-02-26 Thread Richard Henderson
Finish removing tcg temp free accounting interfaces. Signed-off-by: Richard Henderson --- include/exec/translator.h | 2 -- accel/tcg/translator.c | 4 target/alpha/translate.c | 1 - target/arm/translate-a64.c | 2 -- target/arm/translate.c | 1 - target/ppc/translate.c | 2

[PATCH v2 31/76] target/loongarch: Drop temp_new

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record temps for later freeing. Replace the few uses with tcg_temp_new. Reviewed-by: Song Gao Signed-off-by: Richard Henderson --- target/loongarch/translate.h | 3 ---

[PATCH v2 34/76] target/m68k: Drop free_cond

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Remove the g1 and g2 members of DisasCompare, as they were used to track which temps needed to be freed. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 40 1 file changed, 40

[PATCH v2 18/76] target/avr: Drop DisasContext.free_skip_var0

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record for later freeing. Signed-off-by: Richard Henderson --- target/avr/translate.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c

[PATCH v2 11/76] target/arm: Drop tcg_temp_free from translator-m-nocp.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/arm/translate-m-nocp.c | 20 1 file changed, 20 deletions(-) diff --git a/target/arm/translate-m-nocp.c b/target/arm/translate-m-nocp.c index 5df7d46120..9a89aab785

[PATCH v2 08/76] target/arm: Drop new_tmp_a64

2023-02-26 Thread Richard Henderson
This is now a simple wrapper for tcg_temp_new_i64. Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 1 - target/arm/translate-a64.c | 45 +- target/arm/translate-sve.c | 20 - 3 files changed, 30 insertions(+), 36

[PATCH v2 10/76] target/arm: Drop tcg_temp_free from translator-a64.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 468 + 1 file changed, 11 insertions(+), 457 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index

[PATCH v2 26/76] target/hexagon: Drop tcg_temp_free from gen_tcg_funcs.py

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/hexagon/gen_tcg_funcs.py | 79 + 1 file changed, 1 insertion(+), 78 deletions(-) diff --git a/target/hexagon/gen_tcg_funcs.py

[PATCH v2 13/76] target/arm: Drop tcg_temp_free from translator-neon.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/arm/translate-neon.c | 131 +--- 1 file changed, 1 insertion(+), 130 deletions(-) diff --git a/target/arm/translate-neon.c b/target/arm/translate-neon.c index

[PATCH v2 01/76] tcg: Remove tcg_check_temp_count, tcg_clear_temp_count

2023-02-26 Thread Richard Henderson
Since all temps allocated by guest front-ends are now TEMP_TB, and we don't recycle TEMP_TB, there's no point in requiring that the front-ends free the temps at all. Begin by dropping the inner-most checks that all temps have been freed. Signed-off-by: Richard Henderson --- include/tcg/tcg.h

[PATCH] firmware: qemu_fw_cfg: make kobj_type structure constant

2023-02-26 Thread Thomas Weißschuh
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definition to prevent modification at runtime. Signed-off-by: Thomas Weißschuh --- drivers/firmware/qemu_fw_cfg.c | 2

[PATCH v2 3/4] kvm: Add helper kvm_dirty_ring_init()

2023-02-26 Thread Gavin Shan
Due to multiple capabilities associated with the dirty ring for different architectures: KVM_CAP_DIRTY_{LOG_RING, LOG_RING_ACQ_REL} for x86 and arm64 separately. There will be more to be done in order to support the dirty ring for arm64. Lets add helper kvm_dirty_ring_init() to enable the dirty

[PATCH v2 1/4] migration: Add last stage indicator to global dirty log synchronization

2023-02-26 Thread Gavin Shan
The global dirty log synchronization is used when KVM and dirty ring are enabled. There is a particularity for ARM64 where the backup bitmap is used to track dirty pages in non-running-vcpu situations. It means the dirty ring works with the combination of ring buffer and backup bitmap. The dirty

[PATCH v2 0/4] hw/arm/virt: Support dirty ring

2023-02-26 Thread Gavin Shan
This series intends to support dirty ring for live migration for arm64. The dirty ring use discrete buffer to track dirty pages. For arm64, the speciality is to use backup bitmap to track dirty pages when there is no-running-vcpu context. It's known that the backup bitmap needs to be synchronized

  1   2   >