OSDN Git Service

qmiga/qemu.git
16 months agotarget/arm: Diagnose incorrect usage of arm_is_secure subroutines
Richard Henderson [Mon, 27 Feb 2023 22:58:31 +0000 (12:58 -1000)]
target/arm: Diagnose incorrect usage of arm_is_secure subroutines

In several places we use arm_is_secure_below_el3 and
arm_is_el3_or_mon separately from arm_is_secure.
These functions make no sense for m-profile, and
would indicate prior incorrect feature testing.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227225832.816605-4-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Stub arm_hcr_el2_eff for m-profile
Richard Henderson [Mon, 27 Feb 2023 22:58:30 +0000 (12:58 -1000)]
target/arm: Stub arm_hcr_el2_eff for m-profile

M-profile doesn't have HCR_EL2.  While we could test features
before each call, zero is a generally safe return value to
disable the code in the caller.  This test is required to
avoid an assert in arm_is_secure_below_el3.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227225832.816605-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Handle m-profile in arm_is_secure
Richard Henderson [Mon, 27 Feb 2023 22:58:29 +0000 (12:58 -1000)]
target/arm: Handle m-profile in arm_is_secure

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1421
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227225832.816605-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Implement gdbstub m-profile systemreg and secext
Richard Henderson [Mon, 27 Feb 2023 21:33:29 +0000 (11:33 -1000)]
target/arm: Implement gdbstub m-profile systemreg and secext

The upstream gdb xml only implements {MSP,PSP}{,_NS,S}, but
go ahead and implement the other system registers as well.

Since there is significant overlap between the two, implement
them with common code.  The only exception is the systemreg
view of CONTROL, which merges the banked bits as per MRS.

Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-15-richard.henderson@linaro.org
[rth: Substatial rewrite using enumerator and shared code.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Export arm_v7m_get_sp_ptr
David Reiss [Mon, 27 Feb 2023 21:33:28 +0000 (11:33 -1000)]
target/arm: Export arm_v7m_get_sp_ptr

Allow the function to be used outside of m_helper.c.
Move to be outside of ifndef CONFIG_USER_ONLY block.
Rename from get_v7m_sp_ptr.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-14-richard.henderson@linaro.org
[rth: Split out of a larger patch]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Export arm_v7m_mrs_control
David Reiss [Mon, 27 Feb 2023 21:33:27 +0000 (11:33 -1000)]
target/arm: Export arm_v7m_mrs_control

Allow the function to be used outside of m_helper.c.
Rename with an "arm_" prefix.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-13-richard.henderson@linaro.org
[rth: Split out of a larger patch]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Implement gdbstub pauth extension
Richard Henderson [Mon, 27 Feb 2023 21:33:26 +0000 (11:33 -1000)]
target/arm: Implement gdbstub pauth extension

The extension is primarily defined by the Linux kernel NT_ARM_PAC_MASK
ptrace register set.

The original gdb feature consists of two masks, data and code, which are
used to mask out the authentication code within a pointer.  Following
discussion with Luis Machado, add two more masks in order to support
pointers within the high half of the address space (i.e. TTBR1 vs TTBR0).

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1105
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-12-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Create pauth_ptr_mask
Richard Henderson [Mon, 27 Feb 2023 21:33:25 +0000 (11:33 -1000)]
target/arm: Create pauth_ptr_mask

Keep the logic for pauth within pauth_helper.c, and expose
a helper function for use with the gdbstub pac extension.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-11-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Simplify iteration over bit widths
Richard Henderson [Mon, 27 Feb 2023 21:33:24 +0000 (11:33 -1000)]
target/arm: Simplify iteration over bit widths

Order suf[] by the log8 of the width.
Use ARRAY_SIZE instead of hard-coding 128.

This changes the order of the union definitions,
but retains the order of the union-of-union members.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-10-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Add name argument to output_vector_union_type
Richard Henderson [Mon, 27 Feb 2023 21:33:23 +0000 (11:33 -1000)]
target/arm: Add name argument to output_vector_union_type

This will make the function usable between SVE and SME.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-9-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Fix svep width in arm_gen_dynamic_svereg_xml
Richard Henderson [Mon, 27 Feb 2023 21:33:22 +0000 (11:33 -1000)]
target/arm: Fix svep width in arm_gen_dynamic_svereg_xml

Define svep based on the size of the predicates,
not the primary vector registers.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-8-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Hoist pred_width in arm_gen_dynamic_svereg_xml
Richard Henderson [Mon, 27 Feb 2023 21:33:21 +0000 (11:33 -1000)]
target/arm: Hoist pred_width in arm_gen_dynamic_svereg_xml

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-7-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Simplify register counting in arm_gen_dynamic_svereg_xml
Richard Henderson [Mon, 27 Feb 2023 21:33:20 +0000 (11:33 -1000)]
target/arm: Simplify register counting in arm_gen_dynamic_svereg_xml

Rather than increment base_reg and num, compute num from the change
to base_reg at the end.  Clean up some nearby comments.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Split out output_vector_union_type
Richard Henderson [Mon, 27 Feb 2023 21:33:19 +0000 (11:33 -1000)]
target/arm: Split out output_vector_union_type

Create a subroutine for creating the union of unions
of the various type sizes that a vector may contain.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-5-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Move arm_gen_dynamic_svereg_xml to gdbstub64.c
Richard Henderson [Mon, 27 Feb 2023 21:33:18 +0000 (11:33 -1000)]
target/arm: Move arm_gen_dynamic_svereg_xml to gdbstub64.c

The function is only used for aarch64, so move it to the
file that has the other aarch64 gdbstub stuff.  Move the
declaration to internals.h.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-4-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Unexport arm_gen_dynamic_sysreg_xml
Richard Henderson [Mon, 27 Feb 2023 21:33:17 +0000 (11:33 -1000)]
target/arm: Unexport arm_gen_dynamic_sysreg_xml

This function is not used outside gdbstub.c.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/arm: Normalize aarch64 gdbstub get/set function names
Richard Henderson [Mon, 27 Feb 2023 21:33:16 +0000 (11:33 -1000)]
target/arm: Normalize aarch64 gdbstub get/set function names

Make the form of the function names between fp and sve the same:
  - arm_gdb_*_svereg -> aarch64_gdb_*_sve_reg.
  - aarch64_fpu_gdb_*_reg -> aarch64_gdb_*_fpu_reg.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227213329.793795-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agoMerge tag 'pull-tcg-20230305' of https://gitlab.com/rth7680/qemu into staging
Peter Maydell [Mon, 6 Mar 2023 10:20:04 +0000 (10:20 +0000)]
Merge tag 'pull-tcg-20230305' of https://gitlab.com/rth7680/qemu into staging

tcg: Merge two sequential labels
accel/tcg: Retain prot flags from tlb_fill
accel/tcg: Honor TLB_DISCARD_WRITE in atomic_mmu_lookup
accel/tcg: Honor TLB_WATCHPOINTS in atomic_mmu_lookup
target/sparc: Use tlb_set_page_full
include/qemu/cpuid: Introduce xgetbv_low
tcg/i386: Mark Win64 call-saved vector regs as reserved
tcg: Decode the operand to INDEX_op_mb in dumps

Portion of the target/ patchset which eliminates use of tcg_temp_free*
Portion of the target/ patchset which eliminates use of tcg_const*

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmQFNegdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV9WsQf+Ljs3WA5lvMPlpaSn
# Li35ay/A1f2cU6FYspl81su4/c7Ft9Q8rkPF4K1n1rwuvqR91G25WTQIrw8NFPXZ
# VU9GNGQc1qIVYO/hAH3fvgDmPxUF+tJDgT/BTNc1ldy6/v7QM3GWcEy8+O3H9S+K
# uj6vIuWke0ukq6ZGmSAZnXEaJFq3HU26mcP4KxDxfIUcezMtDVp6QevqzVxM65aa
# pUDh3qtsLGOxIYwthvu6avMQXORBhSB75awCuYH4QPJRpr3ahigcGsCr2gdVAQ8p
# R7BbpUUdK5Huos971oouJrt5FwwbVgGEx78eF27sl0H8QMoNhsfyn6PcN8nPENLJ
# MZYd+w==
# =8goQ
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 06 Mar 2023 00:38:00 GMT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-tcg-20230305' of https://gitlab.com/rth7680/qemu: (84 commits)
  target/xtensa: Avoid tcg_const_i32
  target/xtensa: Split constant in bit shift
  target/xtensa: Use tcg_gen_subfi_i32 in translate_sll
  target/xtensa: Avoid tcg_const_i32 in translate_l32r
  target/xtensa: Tidy translate_clamps
  target/xtensa: Tidy translate_bb
  target/sparc: Avoid tcg_const_{tl,i32}
  target/s390x: Split out gen_ri2
  target/riscv: Avoid tcg_const_*
  target/microblaze: Avoid tcg_const_* throughout
  target/i386: Simplify POPF
  target/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op
  target/hexagon/idef-parser: Use gen_tmp for gen_rvalue_pred
  target/hexagon/idef-parser: Use gen_tmp for gen_pred_assign
  target/hexagon/idef-parser: Use gen_tmp for LPCFG
  target/hexagon: Use tcg_constant_* for gen_constant_from_imm
  docs/devel/tcg-ops: Drop recommendation to free temps
  tracing: remove transform.py
  include/exec/gen-icount: Drop tcg_temp_free in gen_tb_start
  target/tricore: Drop tcg_temp_free
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotarget/xtensa: Avoid tcg_const_i32
Richard Henderson [Sun, 26 Feb 2023 23:21:36 +0000 (13:21 -1000)]
target/xtensa: Avoid tcg_const_i32

All remaining uses are strictly read-only.

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Split constant in bit shift
Richard Henderson [Sun, 26 Feb 2023 23:21:14 +0000 (13:21 -1000)]
target/xtensa: Split constant in bit shift

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Use tcg_gen_subfi_i32 in translate_sll
Richard Henderson [Sun, 26 Feb 2023 23:19:46 +0000 (13:19 -1000)]
target/xtensa: Use tcg_gen_subfi_i32 in translate_sll

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Avoid tcg_const_i32 in translate_l32r
Richard Henderson [Sun, 26 Feb 2023 23:19:01 +0000 (13:19 -1000)]
target/xtensa: Avoid tcg_const_i32 in translate_l32r

Use addi on the addition side and tcg_constant_i32 on the other.

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Tidy translate_clamps
Richard Henderson [Sun, 26 Feb 2023 22:58:20 +0000 (12:58 -1000)]
target/xtensa: Tidy translate_clamps

All writes to arg[0].out; use tcg_constant_i32.

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Tidy translate_bb
Richard Henderson [Sun, 26 Feb 2023 22:56:56 +0000 (12:56 -1000)]
target/xtensa: Tidy translate_bb

Replace ifdefs with C, tcg_const_i32 with tcg_constant_i32.
We only need a single temporary for this.

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Avoid tcg_const_{tl,i32}
Richard Henderson [Sun, 26 Feb 2023 21:15:00 +0000 (11:15 -1000)]
target/sparc: Avoid tcg_const_{tl,i32}

All remaining uses are strictly read-only.

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/s390x: Split out gen_ri2
Richard Henderson [Mon, 27 Feb 2023 03:55:31 +0000 (17:55 -1000)]
target/s390x: Split out gen_ri2

Use tcg_constant_i64.  Adjust in2_mri2_* to allocate a new
temporary for the output, using gen_ri2 for the address.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/riscv: Avoid tcg_const_*
Richard Henderson [Sun, 26 Feb 2023 19:15:34 +0000 (09:15 -1000)]
target/riscv: Avoid tcg_const_*

All uses are strictly read-only.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/microblaze: Avoid tcg_const_* throughout
Richard Henderson [Sun, 26 Feb 2023 01:42:20 +0000 (15:42 -1000)]
target/microblaze: Avoid tcg_const_* throughout

All uses are strictly read-only.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/i386: Simplify POPF
Richard Henderson [Sat, 25 Feb 2023 23:24:35 +0000 (13:24 -1000)]
target/i386: Simplify POPF

Compute the eflags write mask separately, leaving one call
to the helper.  Use tcg_constant_i32.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op
Richard Henderson [Mon, 27 Feb 2023 03:12:05 +0000 (17:12 -1000)]
target/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op

We already have a temporary, res, which we can use for the intermediate
shift result.  Simplify the constant to -1 instead of 0xf*f.
This was the last use of gen_tmp_value, so remove it.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon/idef-parser: Use gen_tmp for gen_rvalue_pred
Richard Henderson [Mon, 27 Feb 2023 03:00:35 +0000 (17:00 -1000)]
target/hexagon/idef-parser: Use gen_tmp for gen_rvalue_pred

The allocation is immediately followed by either tcg_gen_mov_i32
or gen_read_preg (which contains tcg_gen_mov_i32), so the zero
initialization is immediately discarded.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon/idef-parser: Use gen_tmp for gen_pred_assign
Richard Henderson [Mon, 27 Feb 2023 02:58:38 +0000 (16:58 -1000)]
target/hexagon/idef-parser: Use gen_tmp for gen_pred_assign

The allocation is immediately followed by tcg_gen_mov_i32,
so the initial assignment of zero is discarded.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon/idef-parser: Use gen_tmp for LPCFG
Richard Henderson [Mon, 27 Feb 2023 02:44:05 +0000 (16:44 -1000)]
target/hexagon/idef-parser: Use gen_tmp for LPCFG

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.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon: Use tcg_constant_* for gen_constant_from_imm
Richard Henderson [Mon, 27 Feb 2023 02:19:36 +0000 (16:19 -1000)]
target/hexagon: Use tcg_constant_* for gen_constant_from_imm

Rename from gen_tmp_value_from_imm to match gen_constant vs gen_tmp.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agodocs/devel/tcg-ops: Drop recommendation to free temps
Richard Henderson [Sat, 25 Feb 2023 08:48:05 +0000 (22:48 -1000)]
docs/devel/tcg-ops: Drop recommendation to free temps

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotracing: remove transform.py
Richard Henderson [Sat, 25 Feb 2023 09:41:12 +0000 (23:41 -1000)]
tracing: remove transform.py

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")
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoinclude/exec/gen-icount: Drop tcg_temp_free in gen_tb_start
Richard Henderson [Sat, 25 Feb 2023 08:10:35 +0000 (22:10 -1000)]
include/exec/gen-icount: Drop tcg_temp_free in gen_tb_start

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/tricore: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 07:50:24 +0000 (21:50 -1000)]
target/tricore: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/mips: Fix trans_mult_acc return
Richard Henderson [Sat, 25 Feb 2023 05:35:02 +0000 (19:35 -1000)]
target/mips: Fix trans_mult_acc return

Success from trans_* subroutines should be true.

Fixes: 5fa38eedbd ("target/mips: Convert Vr54xx MACC* opcodes to decodetree")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/mips: Drop tcg_temp_free from mips16e_translate.c.inc
Richard Henderson [Sat, 25 Feb 2023 05:21:28 +0000 (19:21 -1000)]
target/mips: Drop tcg_temp_free from mips16e_translate.c.inc

Translators are no longer required to free tcg temporaries.

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/i386: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 04:56:08 +0000 (18:56 -1000)]
target/i386: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 08:02:33 +0000 (22:02 -1000)]
target/xtensa: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Drop reset_sar_tracker
Richard Henderson [Sat, 25 Feb 2023 07:53:49 +0000 (21:53 -1000)]
target/xtensa: Drop reset_sar_tracker

Translators are no longer required to free tcg temporaries.
Remove sar_m32_allocated, as sar_m32 non-null is equivalent.

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 07:37:17 +0000 (21:37 -1000)]
target/sparc: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Drop free_compare
Richard Henderson [Sat, 25 Feb 2023 07:32:54 +0000 (21:32 -1000)]
target/sparc: Drop free_compare

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.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Remove egress label in disas_sparc_context
Richard Henderson [Sat, 25 Feb 2023 07:29:17 +0000 (21:29 -1000)]
target/sparc: Remove egress label in disas_sparc_context

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Drop get_temp_i32
Richard Henderson [Sat, 25 Feb 2023 07:26:59 +0000 (21:26 -1000)]
target/sparc: Drop get_temp_i32

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_i32.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Drop get_temp_tl
Richard Henderson [Sat, 25 Feb 2023 07:24:23 +0000 (21:24 -1000)]
target/sparc: Drop get_temp_tl

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: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sh4: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 07:21:32 +0000 (21:21 -1000)]
target/sh4: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/rx: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 06:31:26 +0000 (20:31 -1000)]
target/rx: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/riscv: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 06:28:43 +0000 (20:28 -1000)]
target/riscv: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/riscv: Drop temp_new
Richard Henderson [Sat, 25 Feb 2023 06:27:57 +0000 (20:27 -1000)]
target/riscv: Drop temp_new

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 <liweiwei@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/riscv: Drop ftemp_new
Richard Henderson [Sat, 25 Feb 2023 06:25:02 +0000 (20:25 -1000)]
target/riscv: Drop ftemp_new

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 <liweiwei@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 06:16:38 +0000 (20:16 -1000)]
target/ppc: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/openrisc: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 05:52:13 +0000 (19:52 -1000)]
target/openrisc: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/nios2: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 05:50:43 +0000 (19:50 -1000)]
target/nios2: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/microblaze: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 05:19:12 +0000 (19:19 -1000)]
target/microblaze: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/m68k: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 05:16:49 +0000 (19:16 -1000)]
target/m68k: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/m68k: Drop free_cond
Richard Henderson [Sat, 25 Feb 2023 05:12:09 +0000 (19:12 -1000)]
target/m68k: Drop free_cond

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.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/m68k: Drop mark_to_release
Richard Henderson [Sat, 25 Feb 2023 05:09:19 +0000 (19:09 -1000)]
target/m68k: Drop mark_to_release

Translators are no longer required to free tcg temporaries,
therefore there's no need to record temps for later freeing.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/loongarch: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 05:06:42 +0000 (19:06 -1000)]
target/loongarch: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/loongarch: Drop temp_new
Richard Henderson [Sat, 25 Feb 2023 05:05:39 +0000 (19:05 -1000)]
target/loongarch: Drop temp_new

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 <gaosong@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hppa: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 04:52:25 +0000 (18:52 -1000)]
target/hppa: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon/idef-parser: Drop HexValue.is_manual
Richard Henderson [Sat, 25 Feb 2023 04:48:00 +0000 (18:48 -1000)]
target/hexagon/idef-parser: Drop HexValue.is_manual

This field is no longer used.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon/idef-parser: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 04:40:56 +0000 (18:40 -1000)]
target/hexagon/idef-parser: Drop tcg_temp_free

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.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon: Drop tcg_temp_free from gen_tcg_funcs.py
Richard Henderson [Sat, 25 Feb 2023 04:33:03 +0000 (18:33 -1000)]
target/hexagon: Drop tcg_temp_free from gen_tcg_funcs.py

Translators are no longer required to free tcg temporaries.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon: Drop tcg_temp_free from C code
Richard Henderson [Sat, 25 Feb 2023 04:27:22 +0000 (18:27 -1000)]
target/hexagon: Drop tcg_temp_free from C code

Translators are no longer required to free tcg temporaries.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/cris: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 04:22:12 +0000 (18:22 -1000)]
target/cris: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/cris: Drop addr from dec10_ind_move_m_pr
Richard Henderson [Sat, 25 Feb 2023 04:20:56 +0000 (18:20 -1000)]
target/cris: Drop addr from dec10_ind_move_m_pr

This variable is not used, only allocated and freed.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/cris: Drop cris_alu_m_free_temps
Richard Henderson [Sat, 25 Feb 2023 04:18:10 +0000 (18:18 -1000)]
target/cris: Drop cris_alu_m_free_temps

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/cris: Drop cris_alu_free_temps
Richard Henderson [Sat, 25 Feb 2023 04:14:58 +0000 (18:14 -1000)]
target/cris: Drop cris_alu_free_temps

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/avr: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 04:12:28 +0000 (18:12 -1000)]
target/avr: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/avr: Drop R from trans_COM
Richard Henderson [Sat, 25 Feb 2023 04:11:32 +0000 (18:11 -1000)]
target/avr: Drop R from trans_COM

This variable is not used, only allocated and freed.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/avr: Drop DisasContext.free_skip_var0
Richard Henderson [Sat, 25 Feb 2023 04:05:08 +0000 (18:05 -1000)]
target/avr: Drop DisasContext.free_skip_var0

Translators are no longer required to free tcg temporaries,
therefore there's no need to record for later freeing.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator.h
Richard Henderson [Sat, 25 Feb 2023 04:02:13 +0000 (18:02 -1000)]
target/arm: Drop tcg_temp_free from translator.h

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator-vfp.c
Richard Henderson [Sat, 25 Feb 2023 04:01:37 +0000 (18:01 -1000)]
target/arm: Drop tcg_temp_free from translator-vfp.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator-sve.c
Richard Henderson [Sat, 25 Feb 2023 03:56:09 +0000 (17:56 -1000)]
target/arm: Drop tcg_temp_free from translator-sve.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator-sme.c
Richard Henderson [Sat, 25 Feb 2023 03:51:25 +0000 (17:51 -1000)]
target/arm: Drop tcg_temp_free from translator-sme.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator-neon.c
Richard Henderson [Sat, 25 Feb 2023 03:50:17 +0000 (17:50 -1000)]
target/arm: Drop tcg_temp_free from translator-neon.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator-mve.c
Richard Henderson [Sat, 25 Feb 2023 03:46:06 +0000 (17:46 -1000)]
target/arm: Drop tcg_temp_free from translator-mve.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator-m-nocp.c
Richard Henderson [Sat, 25 Feb 2023 03:41:07 +0000 (17:41 -1000)]
target/arm: Drop tcg_temp_free from translator-m-nocp.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator-a64.c
Richard Henderson [Sat, 25 Feb 2023 03:31:26 +0000 (17:31 -1000)]
target/arm: Drop tcg_temp_free from translator-a64.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop new_tmp_a64_zero
Richard Henderson [Sat, 25 Feb 2023 03:18:52 +0000 (17:18 -1000)]
target/arm: Drop new_tmp_a64_zero

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).

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop new_tmp_a64
Richard Henderson [Sat, 25 Feb 2023 03:14:47 +0000 (17:14 -1000)]
target/arm: Drop new_tmp_a64

This is now a simple wrapper for tcg_temp_new_i64.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop DisasContext.tmp_a64
Richard Henderson [Sat, 25 Feb 2023 03:10:42 +0000 (17:10 -1000)]
target/arm: Drop DisasContext.tmp_a64

Translators are no longer required to free tcg temporaries,
therefore there's no need to record temps for later freeing.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Drop tcg_temp_free from translator.c
Richard Henderson [Sat, 25 Feb 2023 03:05:26 +0000 (17:05 -1000)]
target/arm: Drop tcg_temp_free from translator.c

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Remove value_global from DisasCompare
Richard Henderson [Sat, 25 Feb 2023 02:55:14 +0000 (16:55 -1000)]
target/arm: Remove value_global from DisasCompare

This field was only used to avoid freeing globals.
Since we no longer free any temps, this is dead.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Remove arm_free_cc, a64_free_cc
Richard Henderson [Sat, 25 Feb 2023 02:52:26 +0000 (16:52 -1000)]
target/arm: Remove arm_free_cc, a64_free_cc

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/alpha: Drop tcg_temp_free
Richard Henderson [Sat, 25 Feb 2023 02:48:51 +0000 (16:48 -1000)]
target/alpha: Drop tcg_temp_free

Translators are no longer required to free tcg temporaries.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoaccel/tcg: Remove translator_loop_temp_check
Richard Henderson [Sat, 25 Feb 2023 02:32:11 +0000 (16:32 -1000)]
accel/tcg: Remove translator_loop_temp_check

Finish removing tcg temp free accounting interfaces.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotcg: Remove tcg_check_temp_count, tcg_clear_temp_count
Richard Henderson [Sat, 25 Feb 2023 02:15:18 +0000 (16:15 -1000)]
tcg: Remove tcg_check_temp_count, tcg_clear_temp_count

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.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotcg: Decode the operand to INDEX_op_mb in dumps
Richard Henderson [Fri, 19 Feb 2021 01:05:55 +0000 (17:05 -0800)]
tcg: Decode the operand to INDEX_op_mb in dumps

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotcg/i386: Mark Win64 call-saved vector regs as reserved
Richard Henderson [Mon, 7 Nov 2022 21:39:26 +0000 (08:39 +1100)]
tcg/i386: Mark Win64 call-saved vector regs as reserved

While we do not include these in tcg_target_reg_alloc_order,
and therefore they ought never be allocated, it seems safer
to mark them reserved as well.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoinclude/qemu/cpuid: Introduce xgetbv_low
Richard Henderson [Tue, 25 Oct 2022 08:40:48 +0000 (18:40 +1000)]
include/qemu/cpuid: Introduce xgetbv_low

Replace the two uses of asm to expand xgetbv with an inline function.
Since one of the two has been using the mnemonic, assume that the
comment about "older versions of the assember" is obsolete, as even
that is 4 years old.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoaccel/tcg: Trigger watchpoints from atomic_mmu_lookup
Richard Henderson [Thu, 23 Feb 2023 08:41:01 +0000 (22:41 -1000)]
accel/tcg: Trigger watchpoints from atomic_mmu_lookup

Fixes a bug in that we weren't reporting these changes.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agosoftmmu: Check watchpoints for read+write at once
Richard Henderson [Thu, 23 Feb 2023 08:16:51 +0000 (22:16 -1000)]
softmmu: Check watchpoints for read+write at once

Atomic operations are read-modify-write, and we'd like to
be able to test both read and write with one call.  This is
easy enough, with BP_MEM_READ | BP_MEM_WRITE.

Add BP_HIT_SHIFT to make it easy to set BP_WATCHPOINT_HIT_*.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoaccel/tcg: Honor TLB_DISCARD_WRITE in atomic_mmu_lookup
Richard Henderson [Thu, 23 Feb 2023 09:05:01 +0000 (23:05 -1000)]
accel/tcg: Honor TLB_DISCARD_WRITE in atomic_mmu_lookup

Using an atomic write or read-write insn on ROM is basically
a happens-never case.  Handle it via stop-the-world, which
will generate non-atomic serial code, where we can correctly
ignore the write while producing the correct read result.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoaccel/tcg: Retain prot flags from tlb_fill
Richard Henderson [Thu, 23 Feb 2023 03:08:51 +0000 (17:08 -1000)]
accel/tcg: Retain prot flags from tlb_fill

While changes are made to prot within tlb_set_page_full, they are
an implementation detail of softmmu.  Retain the original for any
target use of probe_access_full.

Fixes: 4047368938f6 ("accel/tcg: Introduce tlb_set_page_full")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Use tlb_set_page_full
Richard Henderson [Thu, 23 Feb 2023 00:31:40 +0000 (14:31 -1000)]
target/sparc: Use tlb_set_page_full

Pass CPUTLBEntryFull to get_physical_address instead
of a collection of pointers.

Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotcg: Merge two sequential labels
Richard Henderson [Fri, 3 Mar 2023 22:22:02 +0000 (14:22 -0800)]
tcg: Merge two sequential labels

Remove the first label and redirect all uses to the second.

Tested-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>