OSDN Git Service

qmiga/qemu.git
16 months agoMerge tag 'pull-tcg-20230313' of https://gitlab.com/rth7680/qemu into staging
Peter Maydell [Tue, 14 Mar 2023 10:09:15 +0000 (10:09 +0000)]
Merge tag 'pull-tcg-20230313' of https://gitlab.com/rth7680/qemu into staging

accel/tcg: Fix NB_MMU_MODES to 16
Balance of the target/ patchset which eliminates tcg_temp_free
Balance of the target/ patchset which eliminates tcg_const

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmQPcb0dHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV885AgAjDbg1soRBy0THf0X
# CVXmQ4yYyUKAonZBL8Abt9yX01BhLFqEsrju3HiaLNOM9DbwWQ4gdvSrtAZ/K2YG
# d6EvC+rJe79pr58MEEhqO4OO1ymp52amRHtEXva4vcKRNuM9WF5by/Hz2PsZyenG
# ysaLBdddooA9SJeL7xYBMpKWFgUm3C8NzfaRfCBVcG94er9u8RUi0kx+drmOLw0g
# vZ3Hekvi2I8Y5mWqvHeAIOsr8Md9PO3ezWxEteE4qsPNTTRfVD93oSGe9nNCYZTX
# wWU51Vfv9GB6hOylAfMRIeCmkjks/gqLOGElsh1MaVovNDTXS5IKV/HgaLaocJHV
# 2P81uQ==
# =FpIY
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 13 Mar 2023 18:55:57 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-20230313' of https://gitlab.com/rth7680/qemu: (91 commits)
  tcg: Drop tcg_const_*
  tcg: Drop tcg_const_*_vec
  target/tricore: Use min/max for saturate
  target/ppc: Avoid tcg_const_* in translate.c
  target/ppc: Fix gen_tlbsx_booke206
  target/ppc: Rewrite trans_ADDG6S
  target/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc
  target/ppc: Avoid tcg_const_* in fp-impl.c.inc
  target/ppc: Avoid tcg_const_* in vsx-impl.c.inc
  target/ppc: Avoid tcg_const_* in xxeval
  target/ppc: Avoid tcg_const_* in vmx-impl.c.inc
  target/ppc: Avoid tcg_const_i64 in do_vcntmb
  target/m68k: Use tcg_constant_i32 in gen_ea_mode
  target/arm: Avoid tcg_const_ptr in handle_rev
  target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn
  target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn
  target/arm: Avoid tcg_const_* in translate-mve.c
  target/arm: Avoid tcg_const_ptr in gen_sve_{ldr,str}
  target/arm: Improve trans_BFCI
  target/arm: Create gen_set_rmode, gen_restore_rmode
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agoMerge tag 'pull-request-2023-03-13' of https://gitlab.com/thuth/qemu into staging
Peter Maydell [Mon, 13 Mar 2023 17:09:32 +0000 (17:09 +0000)]
Merge tag 'pull-request-2023-03-13' of https://gitlab.com/thuth/qemu into staging

* One more fix for the migration qtest
* Remove the edk2 gitlab-CI job
* Improve the build-system-alpine CI job
* Fix emulation of the CHRL/CGHRL s390x instructions

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmQPLmgRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbUrlhAAsfqqK5UQodnUTfuu/XitdLaMc31Hbqrt
# aKbKvg/ejL2cMzNC0bTZU1Xv8lx09HEij27Fod5O2z73y25FZIn+7mz8POhSeK0k
# C07mrssaPUzM7OcnFmXrsQ6jRSDJEtMLSiYHly4UKjeokV7YAk9gxjrF2CVPOqg3
# YsZFrY6HZHX3H3Me2rtDKgwxzohfwpVKKZS7oO+yUfRgPdcK0jsIkpBKgQjTfNys
# CNtUH5ULC6IBdigiMAW66rNDetwkhoKyfuNcEmOCBR93v/kSDLJugnVcgJlxwwq+
# 8ULr4zBlf3MlmZ5xZlPdZ/7dxfdB2LhSALi476ebnVlHq8TIxsPOVJiJ8K3oqUxP
# OfrLhn7el/qozl+aUhfHtoWfYZ0NI/+qffgXFOca/zi5UyqmTXs5GBjZIEoYUsoW
# Vs9mXyoZelHYn0b3u2ClGMiZjPGACYSTVFQJevNKOTxm4gwGpFK7aH5pmkJpFsJW
# 582DXFIFk2Dj0flThAxYcZE2QlnDgglvIaKB5ZuaUyIZeugRMVbO1euqik6WzIFN
# tm8wxRmYi7ao388YXYQd/OFSaYuk5A2AG3cmfev4164z87rtCitOUHa8TPvA5oTL
# /xbJMymKq6yCQpEDEaWQox6Wk1jhEv/Zzg3iT0hv1aVPn79bnPJDmm0me6U1yDLl
# sLco473rMHI=
# =uugc
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 13 Mar 2023 14:08:40 GMT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2023-03-13' of https://gitlab.com/thuth/qemu:
  tests/tcg/s390x: Add C(G)HRL test
  target/s390x: Fix emulation of C(G)HRL
  gitlab-ci.d/buildtest: Rework the target list of build-system-alpine
  gitlab-ci: Remove job building EDK2 firmware binaries
  tests/migration: Tweek auto converge limits check

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotcg: Drop tcg_const_*
Richard Henderson [Mon, 27 Feb 2023 05:16:25 +0000 (19:16 -1000)]
tcg: Drop tcg_const_*

These functions are no longer used.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotcg: Drop tcg_const_*_vec
Richard Henderson [Sun, 26 Feb 2023 23:57:36 +0000 (13:57 -1000)]
tcg: Drop tcg_const_*_vec

Replace with tcg_constant_vec*.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/tricore: Use min/max for saturate
Richard Henderson [Sun, 26 Feb 2023 22:30:27 +0000 (12:30 -1000)]
target/tricore: Use min/max for saturate

Use tcg_constant_i32 for the bounds.

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

All remaining uses are strictly read-only.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Fix gen_tlbsx_booke206
Richard Henderson [Sun, 26 Feb 2023 19:08:09 +0000 (09:08 -1000)]
target/ppc: Fix gen_tlbsx_booke206

Fix incorrect read from rD.
Avoid adding 0 when rA == 0.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Rewrite trans_ADDG6S
Richard Henderson [Sun, 26 Feb 2023 18:45:26 +0000 (08:45 -1000)]
target/ppc: Rewrite trans_ADDG6S

Compute all carry bits in parallel instead of a loop.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc
Richard Henderson [Sun, 26 Feb 2023 19:11:11 +0000 (09:11 -1000)]
target/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc

All uses are strictly read-only.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Avoid tcg_const_* in fp-impl.c.inc
Richard Henderson [Sun, 26 Feb 2023 04:37:22 +0000 (18:37 -1000)]
target/ppc: Avoid tcg_const_* in fp-impl.c.inc

All uses are strictly read-only.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Avoid tcg_const_* in vsx-impl.c.inc
Richard Henderson [Sun, 26 Feb 2023 04:32:23 +0000 (18:32 -1000)]
target/ppc: Avoid tcg_const_* in vsx-impl.c.inc

All remaining uses are strictly read-only.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Avoid tcg_const_* in xxeval
Richard Henderson [Sun, 26 Feb 2023 04:32:04 +0000 (18:32 -1000)]
target/ppc: Avoid tcg_const_* in xxeval

Initialize a new temp instead of tcg_const_*.
Fix a pasto in a comment.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Avoid tcg_const_* in vmx-impl.c.inc
Richard Henderson [Sun, 26 Feb 2023 04:18:31 +0000 (18:18 -1000)]
target/ppc: Avoid tcg_const_* in vmx-impl.c.inc

All remaining uses are strictly read-only.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Avoid tcg_const_i64 in do_vcntmb
Richard Henderson [Sun, 26 Feb 2023 04:17:50 +0000 (18:17 -1000)]
target/ppc: Avoid tcg_const_i64 in do_vcntmb

Compute both partial results separately and accumulate
at the end, instead of accumulating in the middle.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/m68k: Use tcg_constant_i32 in gen_ea_mode
Richard Henderson [Sun, 26 Feb 2023 00:12:24 +0000 (14:12 -1000)]
target/m68k: Use tcg_constant_i32 in gen_ea_mode

Return a constant for an immediate input.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Avoid tcg_const_ptr in handle_rev
Richard Henderson [Sat, 25 Feb 2023 22:29:41 +0000 (12:29 -1000)]
target/arm: Avoid tcg_const_ptr in handle_rev

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.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn
Richard Henderson [Sat, 25 Feb 2023 22:24:07 +0000 (12:24 -1000)]
target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn

It is easy enough to use mov instead of or-with-zero
and relying on the optimizer to fold away the or.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Avoid tcg_const_ptr in disas_simd_zip_trn
Richard Henderson [Sat, 25 Feb 2023 22:05:00 +0000 (12:05 -1000)]
target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn

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.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Avoid tcg_const_* in translate-mve.c
Richard Henderson [Sat, 25 Feb 2023 21:32:36 +0000 (11:32 -1000)]
target/arm: Avoid tcg_const_* in translate-mve.c

All uses are in the context of an accumulator conditionally
having a zero input.  Split the rda variable to rda_{i,o},
and set rda_i to tcg_constant_foo(0) when required.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Avoid tcg_const_ptr in gen_sve_{ldr,str}
Richard Henderson [Sat, 25 Feb 2023 21:22:38 +0000 (11:22 -1000)]
target/arm: Avoid tcg_const_ptr in gen_sve_{ldr,str}

This hides the implicit initialization of a variable.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Improve trans_BFCI
Richard Henderson [Sat, 25 Feb 2023 21:19:48 +0000 (11:19 -1000)]
target/arm: Improve trans_BFCI

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.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Create gen_set_rmode, gen_restore_rmode
Richard Henderson [Sat, 25 Feb 2023 21:06:53 +0000 (11:06 -1000)]
target/arm: Create gen_set_rmode, gen_restore_rmode

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.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Consistently use ARMFPRounding during translation
Richard Henderson [Sat, 25 Feb 2023 20:52:58 +0000 (10:52 -1000)]
target/arm: Consistently use ARMFPRounding during translation

In preparation for extracting new helpers, ensure that
the rounding mode is represented as ARMFPRounding and
not FloatRoundMode.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Improve arm_rmode_to_sf
Richard Henderson [Sat, 25 Feb 2023 20:48:08 +0000 (10:48 -1000)]
target/arm: Improve arm_rmode_to_sf

Use proper enumeration types for input and output.
Use a const array to perform the mapping, with an
assert that the input is valid.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Handle FPROUNDING_ODD in arm_rmode_to_sf
Richard Henderson [Sat, 25 Feb 2023 20:28:05 +0000 (10:28 -1000)]
target/arm: Handle FPROUNDING_ODD in arm_rmode_to_sf

While this enumerator has been present since the first commit,
it isn't ever used.  The first actual use of round-to-odd came
with SVE, which currently uses float_round_to_odd instead of
the arm-specific enumerator.

Amusingly, the comment about unhandled TIEAWAY has been
out of date since the initial commit of translate-a64.c.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Use rmode >= 0 for need_rmode
Richard Henderson [Sat, 25 Feb 2023 19:48:58 +0000 (09:48 -1000)]
target/arm: Use rmode >= 0 for need_rmode

Initialize rmode to -1 instead of keeping two variables.
This is already used elsewhere in translate-a64.c.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotcg: Replace tcg_const_i64 in tcg-op.c
Richard Henderson [Sun, 26 Feb 2023 23:58:13 +0000 (13:58 -1000)]
tcg: Replace tcg_const_i64 in tcg-op.c

These three instances got missed in previous conversion.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/tricore: Avoid tcg_const_i32
Richard Henderson [Sun, 26 Feb 2023 22:36:01 +0000 (12:36 -1000)]
target/tricore: Avoid tcg_const_i32

All remaining 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/tricore: Drop some temp initialization
Richard Henderson [Sun, 26 Feb 2023 22:35:42 +0000 (12:35 -1000)]
target/tricore: Drop some temp initialization

The temp variables here are always set afterward;
the initialization with a constant was discarded.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/tricore: Use setcondi instead of explicit allocation
Richard Henderson [Sun, 26 Feb 2023 22:32:01 +0000 (12:32 -1000)]
target/tricore: Use setcondi instead of explicit allocation

This removes the only use of temp.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/tricore: Rename t_off10 and use tcg_constant_i32
Richard Henderson [Sun, 26 Feb 2023 22:28:18 +0000 (12:28 -1000)]
target/tricore: Rename t_off10 and use tcg_constant_i32

While temp3 could simply be initialized with tcg_constant_i32,
the renaming makes the purpose clearer.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/tricore: Split t_n as constant from temp as variable
Richard Henderson [Sun, 26 Feb 2023 22:23:18 +0000 (12:23 -1000)]
target/tricore: Split t_n as constant from temp as variable

As required, allocate temp separately.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotcg/sparc: Avoid tcg_const_tl in gen_edge
Richard Henderson [Sun, 26 Feb 2023 21:14:48 +0000 (11:14 -1000)]
tcg/sparc: Avoid tcg_const_tl in gen_edge

Push tcg_constant_tl into the shift argument directly.
Since t1 no longer exists as a temp, replace with lo1,
whose last use was just above.

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

All remaining 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/sh4: Avoid tcg_const_i32 for TAS.B
Richard Henderson [Sun, 26 Feb 2023 20:52:48 +0000 (10:52 -1000)]
target/sh4: Avoid tcg_const_i32 for TAS.B

Since we're assigning to cpu_sr_t in the end,
use that as the intermediate temp as well.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/s390x: Avoid tcg_const_i64
Richard Henderson [Sun, 26 Feb 2023 20:43:27 +0000 (10:43 -1000)]
target/s390x: Avoid tcg_const_i64

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/rx: Avoid tcg_const_i32
Richard Henderson [Sun, 26 Feb 2023 20:13:07 +0000 (10:13 -1000)]
target/rx: Avoid tcg_const_i32

All remaining 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/rx: Avoid tcg_const_i32 when new temp needed
Richard Henderson [Sun, 26 Feb 2023 20:12:45 +0000 (10:12 -1000)]
target/rx: Avoid tcg_const_i32 when new temp needed

These three cases use a constant as first input, and
then overwrite the temp in the output.  Separate them.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/rx: Use cpu_psw_z as temp in flags computation
Richard Henderson [Sun, 26 Feb 2023 20:09:44 +0000 (10:09 -1000)]
target/rx: Use cpu_psw_z as temp in flags computation

Since PSW_Z = PSW_S, we can move that assignment to the end
and use PSW_Z as a temporary while computing PSW_O.
Use tcg_constant_i32 instead of tcg_const_i32.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/rx: Use tcg_gen_abs_i32
Richard Henderson [Sun, 26 Feb 2023 20:03:02 +0000 (10:03 -1000)]
target/rx: Use tcg_gen_abs_i32

Remove the local definition of rx_abs.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Avoid tcg_const_i64 in do_vector_shift_quad
Richard Henderson [Sun, 26 Feb 2023 04:16:43 +0000 (18:16 -1000)]
target/ppc: Avoid tcg_const_i64 in do_vector_shift_quad

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Split out gen_vx_vmul10
Richard Henderson [Sun, 26 Feb 2023 04:01:07 +0000 (18:01 -1000)]
target/ppc: Split out gen_vx_vmul10

Move the body out of this large macro.
Use tcg_constant_i64.

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

All remaining 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/mips: Avoid tcg_const_tl in gen_r6_ld
Richard Henderson [Sun, 26 Feb 2023 03:46:36 +0000 (17:46 -1000)]
target/mips: Avoid tcg_const_tl in gen_r6_ld

Allocate a separate temp for modification.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/mips: Split out gen_lxr
Richard Henderson [Sun, 26 Feb 2023 03:40:49 +0000 (17:40 -1000)]
target/mips: Split out gen_lxr

Common subroutine for LDR and LWR.
Use tcg_constant_tl of ~1 instead of tcg_const_tl of 0x..fe.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/mips: Split out gen_lxl
Richard Henderson [Sun, 26 Feb 2023 03:28:36 +0000 (17:28 -1000)]
target/mips: Split out gen_lxl

Common subroutine for LDL and LWL.
Use tcg_constant_tl instead of tcg_const_tl and t2.

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

All remaining 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/m68k: Avoid tcg_const_i32 in bfop_reg
Richard Henderson [Sun, 26 Feb 2023 01:37:18 +0000 (15:37 -1000)]
target/m68k: Avoid tcg_const_i32 in bfop_reg

Tidy up the whole function, hoisting is_bfffo as a common test
for whether tlen and tofs needed. Use tcg_constant_i32, and load
a separate temporary for mask.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/m68k: Avoid tcg_const_i32 when modified
Richard Henderson [Sun, 26 Feb 2023 01:05:31 +0000 (15:05 -1000)]
target/m68k: Avoid tcg_const_i32 when modified

In several instances, a temp is initialized with a
for use as a constant, and then subsequently used
as an unrelated temp.  Split them.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/i386: Avoid use of tcg_const_* throughout
Richard Henderson [Sat, 25 Feb 2023 23:26:02 +0000 (13:26 -1000)]
target/i386: Avoid use of tcg_const_* throughout

All uses are strictly read-only.  Most of the obviously so,
as direct arguments to gen_helper_*.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hppa: Avoid use of tcg_const_i32 throughout
Richard Henderson [Sat, 25 Feb 2023 23:05:46 +0000 (13:05 -1000)]
target/hppa: Avoid use of tcg_const_i32 throughout

All uses were read-write, so replace with a new
allocation and initialization.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hppa: Avoid tcg_const_i64 in trans_fid_f
Richard Henderson [Sat, 25 Feb 2023 23:01:12 +0000 (13:01 -1000)]
target/hppa: Avoid tcg_const_i64 in trans_fid_f

Use a C test instead of a pre-processor test for the id.
Use tcg_constant_i64 instead of tcg_const_i64.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/cris: Avoid use of tcg_const_i32 throughout
Richard Henderson [Sat, 25 Feb 2023 22:44:04 +0000 (12:44 -1000)]
target/cris: Avoid use of tcg_const_i32 throughout

All remaining 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/avr: Avoid use of tcg_const_i32 throughout
Richard Henderson [Sat, 25 Feb 2023 22:39:04 +0000 (12:39 -1000)]
target/avr: Avoid use of tcg_const_i32 throughout

All remaining 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/avr: Avoid use of tcg_const_i32 in SBIC, SBIS
Richard Henderson [Sat, 25 Feb 2023 22:38:14 +0000 (12:38 -1000)]
target/avr: Avoid use of tcg_const_i32 in SBIC, SBIS

The use of separate data/port variables is existing
practice elsewhere, e.g. SBI, CBI.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoinclude/exec: Remove guards around `NB_MMU_MODES`
Anton Johansson [Mon, 6 Mar 2023 17:52:30 +0000 (18:52 +0100)]
include/exec: Remove guards around `NB_MMU_MODES`

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-24-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/xtensa: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:29 +0000 (18:52 +0100)]
target/xtensa: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-23-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/tricore: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:28 +0000 (18:52 +0100)]
target/tricore: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-22-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sparc: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:27 +0000 (18:52 +0100)]
target/sparc: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-21-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/sh4: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:26 +0000 (18:52 +0100)]
target/sh4: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-20-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/s390x: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:25 +0000 (18:52 +0100)]
target/s390x: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-19-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/rx: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:24 +0000 (18:52 +0100)]
target/rx: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-18-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/riscv: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:23 +0000 (18:52 +0100)]
target/riscv: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-17-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/ppc: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:22 +0000 (18:52 +0100)]
target/ppc: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-16-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/openrisc: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:21 +0000 (18:52 +0100)]
target/openrisc: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-15-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/nios2: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:20 +0000 (18:52 +0100)]
target/nios2: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-14-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/mips: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:19 +0000 (18:52 +0100)]
target/mips: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-13-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/microblaze: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:18 +0000 (18:52 +0100)]
target/microblaze: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-12-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/m68k: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:17 +0000 (18:52 +0100)]
target/m68k: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-11-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/loongarch: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:16 +0000 (18:52 +0100)]
target/loongarch: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-10-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/i386: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:15 +0000 (18:52 +0100)]
target/i386: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-9-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hppa: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:14 +0000 (18:52 +0100)]
target/hppa: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-8-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/hexagon: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:13 +0000 (18:52 +0100)]
target/hexagon: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-7-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/cris: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:12 +0000 (18:52 +0100)]
target/cris: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-6-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/avr: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:11 +0000 (18:52 +0100)]
target/avr: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-5-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/arm: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:10 +0000 (18:52 +0100)]
target/arm: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-4-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/alpha: Remove `NB_MMU_MODES` define
Anton Johansson [Mon, 6 Mar 2023 17:52:09 +0000 (18:52 +0100)]
target/alpha: Remove `NB_MMU_MODES` define

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-3-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoinclude/exec: Set default `NB_MMU_MODES` to 16
Anton Johansson [Mon, 6 Mar 2023 17:52:08 +0000 (18:52 +0100)]
include/exec: Set default `NB_MMU_MODES` to 16

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230306175230.7110-2-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agoMerge tag 'win-socket-pull-request' of https://gitlab.com/marcandre.lureau/qemu into...
Peter Maydell [Mon, 13 Mar 2023 13:44:17 +0000 (13:44 +0000)]
Merge tag 'win-socket-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging

QMP command to import win32 sockets

# -----BEGIN PGP SIGNATURE-----
#
# iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmQPDQ0cHG1hcmNhbmRy
# ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5eTUD/41+bodkctP9wtNQT5g
# 4P2XQysa9dhxIaQuPT48J5bN0velOAv+p+e9jNMojVPHogACRGkjJUGrh2AhaWJO
# bpqB5teNz3pbTLAHNrqiJdUrJDI0WSqBN2q7WgfbzvHMugBqul13n6UG/cVWH8D3
# pDX3miBl9Cv3zUDFzPjHH3eR/MHz+6wXmuzUGQdWqyGBoLwqgWA3Bqh39BDVOeJf
# 03Kq3TbJSP096EjGGrq1pTYDIIv9AKzUWgn8tT8S73sD3J0BN28Gl5HirXDx8e/4
# 2WtW/XLYKjqoUl7RmXOjfOarCV+kxzdoYCAUYfyH6DLWrkXc41L5ugFdyxxQ66Sh
# +on7hKCBzPEOPEXmlm6HlMj3bK4C/GI6mIoaZgCrsvj9xlehhQNtwpndAwAR8esH
# perQ6q+jPdoQnBvOBgC3amckS1kYdbQivTILkoopumw/q4waG5reyA4rshbhm/bs
# U33ZRzob0XyRWqvWAcq9hnWB5gvQCcppeJlu60gocnX5wdZOjbnsBXw3l+r2osIh
# izJbxwM6xmz9oHh50nhDCn42JrNdSnZJdJ/XA/lrOkTHQ6kbZO7v86Y/mKQz+Vyx
# Uyhb8/y8gKrUkZlGCEMvQVcyvOA8vneX8WhfZUm6w5MWWCNKfCrEl6UGmFkPAL0m
# +sUYIhN5PSxWSQU5MWogXtQEPA==
# =/Y/7
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 13 Mar 2023 11:46:21 GMT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'win-socket-pull-request' of https://gitlab.com/marcandre.lureau/qemu: (25 commits)
  monitor: restrict command getfd to POSIX hosts
  qtest: enable vnc-display test on win32
  libqtest: make qtest_qmp_add_client work on win32
  qmp: add 'get-win32-socket'
  monitor: release the lock before calling close()
  qmp: 'add_client' actually expects sockets
  osdep: implement qemu_socketpair() for win32
  tests/docker: fix a win32 error due to portability
  char: do not double-close fd when failing to add client
  tests: fix path separator, use g_build_filename()
  win32: replace closesocket() with close() wrapper
  os-posix: remove useless ioctlsocket() define
  win32: avoid mixing SOCKET and file descriptor space
  slirp: open-code qemu_socket_(un)select()
  slirp: unregister the win32 SOCKET
  main-loop: remove qemu_fd_register(), win32/slirp/socket specific
  aio/win32: aio_set_fd_handler() only supports SOCKET
  aio: make aio_set_fd_poll() static to aio-posix.c
  win32/socket: introduce qemu_socket_unselect() helper
  win32/socket: introduce qemu_socket_select() helper
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16 months agotcg: Create tcg/tcg-temp-internal.h
Richard Henderson [Sat, 25 Feb 2023 08:45:43 +0000 (22:45 -1000)]
tcg: Create tcg/tcg-temp-internal.h

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 creeping
back into the guest front ends.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
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>
16 months agotarget/s390x: Remove g_out, g_out2, g_in1, g_in2 from DisasContext
Richard Henderson [Sat, 25 Feb 2023 07:17:51 +0000 (21:17 -1000)]
target/s390x: Remove g_out, g_out2, g_in1, g_in2 from DisasContext

These fields are no longer read, so remove them and the writes.

Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/s390x: Remove assert vs g_in2
Richard Henderson [Sat, 25 Feb 2023 07:15:20 +0000 (21:15 -1000)]
target/s390x: Remove assert vs g_in2

These were trying to determine if o->in2 was available for
use as a temporary.  It's better to just allocate a new one.

Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/s390x: Drop tcg_temp_free from translate.c
Richard Henderson [Sat, 25 Feb 2023 06:58:59 +0000 (20:58 -1000)]
target/s390x: Drop tcg_temp_free from translate.c

Translators are no longer required to free tcg temporaries.

Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/s390x: Drop tcg_temp_free from translate_vx.c.inc
Richard Henderson [Sat, 25 Feb 2023 06:55:53 +0000 (20:55 -1000)]
target/s390x: Drop tcg_temp_free from translate_vx.c.inc

Translators are no longer required to free tcg temporaries.

Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agotarget/s390x: Drop free_compare
Richard Henderson [Sat, 25 Feb 2023 06:39:19 +0000 (20:39 -1000)]
target/s390x: 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.

Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
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 translate.c
Richard Henderson [Sat, 25 Feb 2023 05:49:17 +0000 (19:49 -1000)]
target/mips: Drop tcg_temp_free from translate.c

Translators are no longer required to free tcg temporaries.

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 vr54xx_translate.c
Richard Henderson [Sat, 25 Feb 2023 05:36:03 +0000 (19:36 -1000)]
target/mips: Drop tcg_temp_free from vr54xx_translate.c

Translators are no longer required to free tcg temporaries.

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 tx79_translate.c
Richard Henderson [Sat, 25 Feb 2023 05:33:18 +0000 (19:33 -1000)]
target/mips: Drop tcg_temp_free from tx79_translate.c

Translators are no longer required to free tcg temporaries.

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 translate_addr_const.c
Richard Henderson [Sat, 25 Feb 2023 05:30:25 +0000 (19:30 -1000)]
target/mips: Drop tcg_temp_free from translate_addr_const.c

Translators are no longer required to free tcg temporaries.

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 octeon_translate.c
Richard Henderson [Sat, 25 Feb 2023 05:29:25 +0000 (19:29 -1000)]
target/mips: Drop tcg_temp_free from octeon_translate.c

Translators are no longer required to free tcg temporaries.

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 nanomips_translate.c.inc
Richard Henderson [Sat, 25 Feb 2023 05:27:45 +0000 (19:27 -1000)]
target/mips: Drop tcg_temp_free from nanomips_translate.c.inc

Translators are no longer required to free tcg temporaries.

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 mxu_translate.c
Richard Henderson [Sat, 25 Feb 2023 05:23:53 +0000 (19:23 -1000)]
target/mips: Drop tcg_temp_free from mxu_translate.c

Translators are no longer required to free tcg temporaries.

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 msa_translate.c
Richard Henderson [Sat, 25 Feb 2023 05:22:28 +0000 (19:22 -1000)]
target/mips: Drop tcg_temp_free from msa_translate.c

Translators are no longer required to free tcg temporaries.

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 micromips_translate.c.inc
Richard Henderson [Sat, 25 Feb 2023 05:20:36 +0000 (19:20 -1000)]
target/mips: Drop tcg_temp_free from micromips_translate.c.inc

Translators are no longer required to free tcg temporaries.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
16 months agomonitor: restrict command getfd to POSIX hosts
Marc-André Lureau [Thu, 2 Mar 2023 15:05:41 +0000 (19:05 +0400)]
monitor: restrict command getfd to POSIX hosts

Currently, the function will simply fail if ancillary fds are not
provided, for ex on unsupported platforms.

This changes the failure from:

    {"error": {"class": "GenericError", "desc": "No file descriptor
    supplied via SCM_RIGHTS"}}

to:

    {"error": {"class": "CommandNotFound", "desc": "The command getfd
    has not been found"}}

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
16 months agoqtest: enable vnc-display test on win32
Marc-André Lureau [Mon, 6 Mar 2023 12:27:50 +0000 (16:27 +0400)]
qtest: enable vnc-display test on win32

Now that qtest_qmp_add_client() works on win32, we can enable the VNC
test.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230306122751.2355515-11-marcandre.lureau@redhat.com>

16 months agolibqtest: make qtest_qmp_add_client work on win32
Marc-André Lureau [Mon, 6 Mar 2023 12:27:49 +0000 (16:27 +0400)]
libqtest: make qtest_qmp_add_client work on win32

Use the "get-win32-socket" function to pass an opened socket to QEMU,
instead of using "getfd", which relies on socket ancillary FD message
passing.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230306122751.2355515-10-marcandre.lureau@redhat.com>

16 months agoqmp: add 'get-win32-socket'
Marc-André Lureau [Mon, 6 Mar 2023 12:27:48 +0000 (16:27 +0400)]
qmp: add 'get-win32-socket'

A process with enough capabilities can duplicate a socket to QEMU. Add a
QMP command to import it and add it to the monitor fd list, so it can be
later used by other commands.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230306122751.2355515-9-marcandre.lureau@redhat.com>

16 months agomonitor: release the lock before calling close()
Marc-André Lureau [Mon, 6 Mar 2023 12:27:46 +0000 (16:27 +0400)]
monitor: release the lock before calling close()

As per comment, presumably to avoid syscall in critical section.

Fixes: 0210c3b39bef08 ("monitor: Use LOCK_GUARD macros")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230306122751.2355515-7-marcandre.lureau@redhat.com>

16 months agoqmp: 'add_client' actually expects sockets
Marc-André Lureau [Mon, 6 Mar 2023 12:27:45 +0000 (16:27 +0400)]
qmp: 'add_client' actually expects sockets

Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all
actually expect a socket kind or will fail in different ways at runtime.

Throw an error early if the given 'add_client' fd is not a socket, and
close it to avoid leaks.

This allows to replace the close() call with a more correct & portable
closesocket() version.

(this will allow importing sockets on Windows with a specialized command
in the following patch, while keeping the remaining monitor associated
sockets/add_client code & usage untouched)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230306122751.2355515-6-marcandre.lureau@redhat.com>