]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
13 months agoMerge tag '20230316-xtensa' of https://github.com/OSLL/qemu-xtensa into staging
Peter Maydell [Fri, 17 Mar 2023 14:21:38 +0000 (14:21 +0000)]
Merge tag '20230316-xtensa' of https://github.com/OSLL/qemu-xtensa into staging

target/xtensa updates for v8.0:

- enable testing big-endian xtensa cores

# -----BEGIN PGP SIGNATURE-----
#
# iQJHBAABCgAxFiEEK2eFS5jlMn3N6xfYUfnMkfg/oEQFAmQTd6gTHGpjbXZia2Jj
# QGdtYWlsLmNvbQAKCRBR+cyR+D+gRCowEACpQULqjxkpd23bd5uYQYsuJRzbSblF
# 6xux3IK5kD2y8vjzVegTs1XdZNhNzLRfEOijy+DxP1+5S6jRoACRkv0zKaBigbfA
# C7pLTxKGXk4OLA1sEdAXZ8jTBxDNQG542kF/PSPUHLxbJyb+lH+4707vb/kgQQdz
# nhCVfK75hqW2leohWsEES1jPxazyqu5PLMr9zPa0yfhbUU3g1AgTzFHAVrocP5mN
# QKsaSwP5fwnF2ozTRM7MhHJj9iLlX0IYxeAcA22kUhr6kaAmL4SQdpwiREbCgOts
# XE2Hpo+W5WQRw1B94au0spMZwYGDhFeApLhHRAI6hpLlOyTzC1bHV0yetHEWxLI4
# yPO4gCrkM+bIC5ErywTaCrTfCbaJkmMsz7epFLpawAfEtBTysfOzQEdVYcDKA7DO
# uP1qvW3moIOFLJl+s8c5RQzuSP2kB7Ziox92p6bG9o4XM5Wp0SQU201xKuWkwoC2
# VLsd04IopaDQZdMkErqv9+moebI3w3s9zebbzjDicBA+JfgeOltEWp8tIMAXDTx6
# Rk+A6qh7VW73AACwP10GOtC2bslFCokgsuDuabFDC1w6bhWxgBv2bNk+8WJgR8Oe
# BQKZgtH5XmnpTVZCrpgLQhJBWO+shVLm6sOy+wkTKuOwksn/ADd+q2QwAvKKWU6J
# o+E0K5KnN3p4Qw==
# =v5XD
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 16 Mar 2023 20:10:16 GMT
# gpg:                using RSA key 2B67854B98E5327DCDEB17D851F9CC91F83FA044
# gpg:                issuer "jcmvbkbc@gmail.com"
# gpg: Good signature from "Max Filippov <filippov@cadence.com>" [unknown]
# gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>" [full]
# gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>" [full]
# Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044

* tag '20230316-xtensa' of https://github.com/OSLL/qemu-xtensa:
  tests/tcg/xtensa: allow testing big-endian cores
  tests/tcg/xtensa: add linker.ld to CLEANFILES

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agoMerge tag 'migration-20230316-pull-request' of https://gitlab.com/juan.quintela/qemu...
Peter Maydell [Thu, 16 Mar 2023 20:09:08 +0000 (20:09 +0000)]
Merge tag 'migration-20230316-pull-request' of https://gitlab.com/juan.quintela/qemu into staging

Migration Pull request

Hi

This is just fixes for migration.
- Fix rdma (dave)
- Remove unused variable (Zhijian)
- Fix AVX512 and XBZRLE (Matheus)
- Fix migration preempt (Peter)
- Fix populate_vfio_info (Steve)
- Fix multifd send trace (Wei)

Please apply.

Later, Juan.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmQTMa0ACgkQ9IfvGFhy
# 1yMKCBAAyHcE4TO3NrFpG87nGbLhr1zjXkLEKGuAA/E6NKKrf+OrSV2Wq0aBEO/B
# +yAAiXEPsjheh7gwS8FkgAgIj6PwRTtlKae/Tr0JtraukxYT4qzubkaw3X2VjEwf
# uJ8/I+BZOLBUxlZHYoyDP4CWX7elEMlzKdcShcpJCLTgLjxFXjQ9lZwQBgu51cF2
# YitYRDMsVMr77y20eTqCUrLPcSgTM+8h3PtdyDRH2D+KF1IEkjGmSuF8lBc2WiN+
# BiuW6RlaLjhQiBuWNbkrjdulArnim9qhIT5didJuE7p9L50WFSqZs3EV7a4fJjUl
# 1TWJ4k/fzcYf5GF1ypVBrZ1WWCsyJe/fd8ZddGyz9Xpu6Ml7BevVA+0oGeBDYaDB
# T7o2TrHzz2vYCl20jwPbUeafjN8MppBdtHaJ2pP0nA3cPZHPziU2BE9D2/AUxMib
# ICrNe+nVqXUKqx8qZrRPzIBsnoAgmhkNC/k8T7VEhfmm+s6C+xEE0eyhE299TYJn
# ETpQCqiDPCDlkC8iL3OAd8Nn8kucT7EL7qcV2PcpWxgKPc7mCCNIHdpfpM2aZduJ
# 0S/m19ICS8PSWSjFpSK2/vKLOyjA1PKA869iXFD+OOPb8jY5piTYOrj1gowkRjMx
# JOOVDX04lBxbgUVaZnC+iLuh/ZlMRFv2GFAHIk66XDsmUOzRddI=
# =Lwbm
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 16 Mar 2023 15:11:41 GMT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* tag 'migration-20230316-pull-request' of https://gitlab.com/juan.quintela/qemu:
  migration: fix populate_vfio_info
  migration/multifd: correct multifd_send_thread to trace the flags
  migration/rdma: Remove deprecated variable rdma_return_path
  migration/xbzrle: fix out-of-bounds write with axv512
  migration/xbzrle: use ctz64 to avoid undefined result
  migration/rdma: Fix return-path case
  migration: Wait on preempt channel in preempt thread

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agoMerge tag 'seabios-1.16.2-20230316-pull-request' of https://gitlab.com/kraxel/qemu...
Peter Maydell [Thu, 16 Mar 2023 20:08:48 +0000 (20:08 +0000)]
Merge tag 'seabios-1.16.2-20230316-pull-request' of https://gitlab.com/kraxel/qemu into staging

update seabios to 1.16.2

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmQS8cMACgkQTLbY7tPo
# cTjbEBAAkM1vhtNYOSKEHVBzSvJjkdV5wr3+WBaglLOpH9H30pRoGLGP8RpF9pUA
# 6fib7/gKNvTtQSCCp31aiK9M6zi3KV51VFcPFoiZfsAwGwuWHDnYGAa2GXssFya+
# kCzErlMFUfJM64rX+/VRktMMfMIV+dNPyWaJyD44Hzds+EpoHfdyZlxlOyBqJ3ju
# eV2CVutXtfUQ4H5eG7feWjPfv+ih4TeC9dPlQuU/nAd8HBt4gDjBhf7zy4pz5De5
# teUJYNuLYLZZxiD4sUw/OqZ9C9j5JBaIz4wZBsiHRSa6d7M+su+QQPGg3CIqFtqo
# Q9m/ITD+B1tgB6k928q6IPZkMVSqKeflEQHPDcDiEYJ4TNQ2h5r/QdCGQoGXdPJ4
# /fmyovZ/9pxCs3BecRXytrYyT4R4HY7DsjxnTMyMgnRiuj9BlJgYJDiJCQyN9DDW
# mHO1AWD+UrKy1k9MzAx9t3GFDeUga997g9jPfLjbJRJwagbHWLbTAB1QEK8E6lZ1
# V5LKX/DYfrw9A1XWFuDCx0L4FJ43dtEGzBBwcoZd01Kpe9va9QS56cdKadGlrPv+
# WYeX+js+1ufSFYagoH6QfFgaShgq+CaXEzDccBJRdFqDqWh8ah6zaHTQRRvjn/33
# brT/XAVBGsLCjZ2Soa2oTd9OBL+pFDbyU+uVcY2ahGGMeSJZH8k=
# =0SRX
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 16 Mar 2023 10:38:59 GMT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'seabios-1.16.2-20230316-pull-request' of https://gitlab.com/kraxel/qemu:
  update seabios binaries to 1.16.2
  update seabios submodule to 1.16.2

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agomigration: fix populate_vfio_info
Steve Sistare [Tue, 7 Feb 2023 18:47:03 +0000 (10:47 -0800)]
migration: fix populate_vfio_info

Include CONFIG_DEVICES so that populate_vfio_info is instantiated for
CONFIG_VFIO.  Without it, the 'info migrate' command never returns
info about vfio.

Fixes: 43bd0bf30f ("migration: Move populate_vfio_info() into a separate file")
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
13 months agomigration/multifd: correct multifd_send_thread to trace the flags
Wei Wang [Thu, 9 Mar 2023 10:29:56 +0000 (18:29 +0800)]
migration/multifd: correct multifd_send_thread to trace the flags

The p->flags could be updated via the send_prepare callback, e.g. OR-ed
with MULTIFD_FLAG_ZLIB via zlib_send_prepare. Assign p->flags to the
local "flags" before the send_prepare callback could only get partial of
p->flags. Fix it by moving the assignment of p->flags to the local flags
after the callback, so that the correct flags can be traced.

Fixes: ab7cbb0b9a3b ("multifd: Make no compression operations into its own structure")
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
13 months agomigration/rdma: Remove deprecated variable rdma_return_path
Li Zhijian [Thu, 16 Mar 2023 09:55:00 +0000 (10:55 +0100)]
migration/rdma: Remove deprecated variable rdma_return_path

It's no longer needed since commit
44bcfd45e98 ("migration/rdma: destination: create the return patch after the first accept")

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
13 months agomigration/xbzrle: fix out-of-bounds write with axv512
Matheus Tavares Bernardino [Mon, 13 Mar 2023 18:58:20 +0000 (15:58 -0300)]
migration/xbzrle: fix out-of-bounds write with axv512

xbzrle_encode_buffer_avx512() checks for overflows too scarcely in its
outer loop, causing out-of-bounds writes:

$ ../configure --target-list=aarch64-softmmu --enable-sanitizers --enable-avx512bw
$ make tests/unit/test-xbzrle && ./tests/unit/test-xbzrle

==5518==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62100000b100 at pc 0x561109a7714d bp 0x7ffed712a440 sp 0x7ffed712a430
WRITE of size 1 at 0x62100000b100 thread T0
    #0 0x561109a7714c in uleb128_encode_small ../util/cutils.c:831
    #1 0x561109b67f6a in xbzrle_encode_buffer_avx512 ../migration/xbzrle.c:275
    #2 0x5611099a7428 in test_encode_decode_overflow ../tests/unit/test-xbzrle.c:153
    #3 0x7fb2fb65a58d  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x7a58d)
    #4 0x7fb2fb65a333  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x7a333)
    #5 0x7fb2fb65aa79 in g_test_run_suite (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x7aa79)
    #6 0x7fb2fb65aa94 in g_test_run (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x7aa94)
    #7 0x5611099a3a23 in main ../tests/unit/test-xbzrle.c:218
    #8 0x7fb2fa78c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
    #9 0x5611099a608d in _start (/qemu/build/tests/unit/test-xbzrle+0x28408d)

0x62100000b100 is located 0 bytes to the right of 4096-byte region [0x62100000a100,0x62100000b100)
allocated by thread T0 here:
    #0 0x7fb2fb823a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
    #1 0x7fb2fb637ef0 in g_malloc0 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x57ef0)

Fix that by performing the overflow check in the inner loop, instead.

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
13 months agomigration/xbzrle: use ctz64 to avoid undefined result
Matheus Tavares Bernardino [Mon, 13 Mar 2023 18:58:19 +0000 (15:58 -0300)]
migration/xbzrle: use ctz64 to avoid undefined result

__builtin_ctzll() produces undefined results when the argument is 0.
This can be seen through test-xbzrle, which produces the following
warning:

../migration/xbzrle.c:265: runtime error: passing zero to ctz(), which is not a valid argument

Replace __builtin_ctzll() with our ctz64() wrapper which properly
handles 0.

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
13 months agomigration/rdma: Fix return-path case
Dr. David Alan Gilbert [Tue, 14 Mar 2023 17:15:58 +0000 (17:15 +0000)]
migration/rdma: Fix return-path case

The RDMA code has return-path handling code, but it's only enabled
if postcopy is enabled; if the 'return-path' migration capability
is enabled, the return path is NOT setup but the core migration
code still tries to use it and breaks.

Enable the RDMA return path if either postcopy or the return-path
capability is enabled.

bz: https://bugzilla.redhat.com/show_bug.cgi?id=2063615

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
13 months agomigration: Wait on preempt channel in preempt thread
Peter Xu [Tue, 14 Mar 2023 20:54:29 +0000 (16:54 -0400)]
migration: Wait on preempt channel in preempt thread

QEMU main thread will wait until dest preempt channel established during
processing the LISTEN command (within the whole postcopy PACKAGED data), by
waiting on the semaphore postcopy_qemufile_dst_done.

That's racy, because it's possible that the dest QEMU main thread hasn't
yet accept()ed the new connection when processing the LISTEN event.  The
sem_wait() will yield the main thread without being able to run anything
else including the accept() of the new socket, which can cause deadlock
within the main thread.

To avoid the race, move the "wait channel" from main thread to the preempt
thread right at the start.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 5655aab079 ("migration: Postpone postcopy preempt channel to be after main")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
13 months agoupdate seabios binaries to 1.16.2
Gerd Hoffmann [Thu, 16 Mar 2023 10:04:18 +0000 (11:04 +0100)]
update seabios binaries to 1.16.2

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 months agoupdate seabios submodule to 1.16.2
Gerd Hoffmann [Thu, 16 Mar 2023 09:59:35 +0000 (10:59 +0100)]
update seabios submodule to 1.16.2

git shortlog rel-1.16.1..rel-1.16.2
-----------------------------------

David Woodhouse (1):
      xen: require Xen info structure at 0x1000 to detect Xen

Qi Zhou (1):
      usb: fix wrong init of keyboard/mouse's if first interface is not boot protocol

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 months agoMerge tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu into staging
Peter Maydell [Wed, 15 Mar 2023 17:20:04 +0000 (17:20 +0000)]
Merge tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu into staging

Miscellaneous fixes

 * Avoid memory leak in TLS GSource usage
 * Avoid sending key releases for lang1/lang2 keys in ps2 keyboard
 * Add missing key name constants for F13-F24 keys

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE2vOm/bJrYpEtDo4/vobrtBUQT98FAmQQn/gACgkQvobrtBUQ
# T9+BxRAAl1aOI2rHW27vnwX4xGJX4y4ENA4GAWrnGfya+Ewcoze544W3jwT8b94b
# KDY62P+NMrlxWMjYlDb8if+TYjXc5orlJFBl94zmbaIS7vajnYmprqP3ipCHD/rw
# J5sTOrE8j4+Q+SRQliSwozS+vFm74BoghSLNUBretjxoxZymkUtqKFC88eUFIXsZ
# prGpBVm9g22NWQ94YwJg4iqkAGm0iDjzNsDxHkYhg4yoAsfU800aoKZuSJft6Pfc
# PTQ+x2Y0rxoQ+YuFyf7/uGK7w7awguMkeIn/Nalz3LcxzB+BFPby+P8Srp6WABD5
# N8COb38L5XtN4UffiK1//lxdLFmbO6NVMOaE1yUcG6CAOZNC4eZLIIEDEbvGWOm5
# f2h/YRK59F4HEbYazimEMxqa2SKBGV7j2nvqUEERyNo++U6WLR2toZPlRYP0EWgK
# YuLNGKr4XwNZXmAUO36YglMCowXHUwQdITU+gZt4QIcrjEEAeG9U3pspwyfGcYQl
# 3zd/xzeHGJQHzXNBnyRX0OQamE1et+UGqGauFYAVKFcHHq5VIe5W3BDBLj57DvQn
# T+tZBA92esPl9/qHx0zFfSfiSDHvs67obHPp4LcrNENUXtJOVoqOxpAUtQ9aBX8J
# jhPpkqBrMHtpyjMSM9xyjstro8pD47Kt6t930Sp9fh7fOjO0awE=
# =lL/5
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 14 Mar 2023 16:25:28 GMT
# gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu:
  io/channel-tls: plug memory leakage on GSource
  ps2: Don't send key release event for Lang1, Lang2 keys
  Add qemu qcode support for keys F13 to F24

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Peter Maydell [Wed, 15 Mar 2023 17:19:41 +0000 (17:19 +0000)]
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

small bug fixes

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmQRo3EUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroO7wwgAp2IGW9TDAElFgPZ3n8XyoJ6Lnr6i
# Le3L+fQbYuy6uCU7zkboWgFqqNRLkd1nxHPkRgxb5oJ8pnXLCrdG+2d9UDgfMFqZ
# 3ankE+De70j7f7r0M5Ifmfyf7QHhNhnbuguoovi6S9bdJ5aO2nZmsm/T41Bth/uU
# SKx+SCVMzpPGLJv0iZishw2seZj0h9QBgyitsE8MdLjnhe5KD4XOWs4+E263pb6L
# G6ai7T++vQSRqCQ8YVBr7Az41vkvzuqkybAXFTl/QLd2rVQROAqoOpn+wPq4cH46
# xf6LscXqE9lrWr/UJnDPNiyKmsY5baLyB6Ri/rQn8VvTyfyHC9JtDoDclQ==
# =mnvI
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 15 Mar 2023 10:52:33 GMT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  vl: defuse PID file path resolve error
  hw/intc/ioapic: Update KVM routes before redelivering IRQ, on RTE update
  docs/devel: clarify further the semantics of RMW operations
  Fix build without CONFIG_XEN_EMU

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agotests/tcg/xtensa: allow testing big-endian cores
Max Filippov [Sat, 2 Oct 2021 05:01:52 +0000 (22:01 -0700)]
tests/tcg/xtensa: allow testing big-endian cores

Don't disable all big-endian tests, instead check whether $(CORE) is
supported by the configured $(QEMU) and enable tests if it is.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
13 months agotests/tcg/xtensa: add linker.ld to CLEANFILES
Max Filippov [Tue, 14 Mar 2023 21:52:19 +0000 (14:52 -0700)]
tests/tcg/xtensa: add linker.ld to CLEANFILES

Linker script for xtensa tests must be preprocessed for a specific
target, remove it as a part of make clean.

Fixes: be5cac175a ("tests/tcg/xtensa: enable system tests")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
13 months agovl: defuse PID file path resolve error
Fiona Ebner [Mon, 31 Oct 2022 09:47:16 +0000 (10:47 +0100)]
vl: defuse PID file path resolve error

Commit 85c4bf8aa6 ("vl: Unlink absolute PID file path") introduced a
critical error when the PID file path cannot be resolved. Before this
commit, it was possible to invoke QEMU when the PID file was a file
created with mkstemp that was already unlinked at the time of the
invocation. There might be other similar scenarios.

It should not be a critical error when the PID file unlink notifier
can't be registered, because the path can't be resolved. If the file
is already gone from QEMU's perspective, silently ignore the error.
Otherwise, only print a warning.

Fixes: 85c4bf8aa6 ("vl: Unlink absolute PID file path")
Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20221031094716.39786-1-f.ebner@proxmox.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 months agohw/intc/ioapic: Update KVM routes before redelivering IRQ, on RTE update
David Woodhouse [Wed, 8 Mar 2023 11:19:50 +0000 (11:19 +0000)]
hw/intc/ioapic: Update KVM routes before redelivering IRQ, on RTE update

A Linux guest will perform IRQ migration after the IRQ has happened,
updating the RTE to point to the new destination CPU and then unmasking
the interrupt.

However, when the guest updates the RTE, ioapic_mem_write() calls
ioapic_service(), which redelivers the pending level interrupt via
kvm_set_irq(), *before* calling ioapic_update_kvm_routes() which sets
the new target CPU.

Thus, the IRQ which is supposed to go to the new target CPU is instead
misdelivered to the previous target. An example where the guest kernel
is attempting to migrate from CPU#2 to CPU#0 shows:

xenstore_read tx 0 path control/platform-feature-xs_reset_watches
ioapic_set_irq vector: 11 level: 1
ioapic_set_remote_irr set remote irr for pin 11
ioapic_service: trigger KVM IRQ 11
[    0.523627] The affinity mask was 0-3 and the handler is on 2
ioapic_mem_write ioapic mem write addr 0x0 regsel: 0x27 size 0x4 val 0x26
ioapic_update_kvm_routes: update KVM route for IRQ 11: fee02000 8021
ioapic_mem_write ioapic mem write addr 0x10 regsel: 0x26 size 0x4 val 0x18021
xenstore_reset_watches
ioapic_set_irq vector: 11 level: 1
ioapic_mem_read ioapic mem read addr 0x10 regsel: 0x26 size 0x4 retval 0x1c021
[    0.524569] ioapic_ack_level IRQ 11 moveit = 1
ioapic_eoi_broadcast EOI broadcast for vector 33
ioapic_clear_remote_irr clear remote irr for pin 11 vector 33
ioapic_mem_write ioapic mem write addr 0x0 regsel: 0x26 size 0x4 val 0x26
ioapic_mem_read ioapic mem read addr 0x10 regsel: 0x26 size 0x4 retval 0x18021
[    0.525235] ioapic_finish_move IRQ 11 calls irq_move_masked_irq()
[    0.526147] irq_do_set_affinity for IRQ 11, 0
[    0.526732] ioapic_set_affinity for IRQ 11, 0
[    0.527330] ioapic_setup_msg_from_msi for IRQ11 target 0
ioapic_mem_write ioapic mem write addr 0x0 regsel: 0x26 size 0x4 val 0x27
ioapic_mem_write ioapic mem write addr 0x10 regsel: 0x27 size 0x4 val 0x0
ioapic_mem_write ioapic mem write addr 0x0 regsel: 0x27 size 0x4 val 0x26
ioapic_mem_write ioapic mem write addr 0x10 regsel: 0x26 size 0x4 val 0x18021
[    0.527623] ioapic_set_affinity returns 0
[    0.527623] ioapic_finish_move IRQ 11 calls unmask_ioapic_irq()
ioapic_mem_write ioapic mem write addr 0x0 regsel: 0x26 size 0x4 val 0x26
ioapic_mem_write ioapic mem write addr 0x10 regsel: 0x26 size 0x4 val 0x8021
ioapic_set_remote_irr set remote irr for pin 11
ioapic_service: trigger KVM IRQ 11
ioapic_update_kvm_routes: update KVM route for IRQ 11: fee00000 8021
[    0.529571] The affinity mask was 0 and the handler is on 2
[    xenstore_watch path memory/target token FFFFFFFF92847D40

There are no other code paths in ioapic_mem_write() which need the KVM
IRQ routing table to be updated, so just shift the call from the end
of the function to happen right before the call to ioapic_service()
and thus deliver the re-enabled IRQ to the right place.

Alternative fixes might have been just to remove the part in
ioapic_service() which delivers the IRQ via kvm_set_irq() because
surely delivering as MSI ought to work just fine anyway in all cases?
That code lacks a comment justifying its existence.

Or maybe in the specific case shown in the above log, it would have
sufficed for ioapic_update_kvm_routes() to update the route *even*
when the IRQ is masked. It's not like it's actually going to get
triggered unless QEMU deliberately does so, anyway? But that only
works because the target CPU happens to be in the high word of the
RTE; if something in the *low* word (vector, perhaps) was changed
at the same time as the unmask, we'd still trigger with stale data.

Fixes: 15eafc2e602f "kvm: x86: add support for KVM_CAP_SPLIT_IRQCHIP"
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20230308111952.2728440-2-dwmw2@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 months agodocs/devel: clarify further the semantics of RMW operations
Paolo Bonzini [Thu, 9 Mar 2023 11:42:38 +0000 (12:42 +0100)]
docs/devel: clarify further the semantics of RMW operations

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 months agoFix build without CONFIG_XEN_EMU
Miroslav Rezanina [Wed, 8 Mar 2023 13:05:57 +0000 (08:05 -0500)]
Fix build without CONFIG_XEN_EMU

Upstream commit ddf0fd9ae1 "hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback"
added kvm_xen_maybe_deassert_callback usage to target/i386/kvm/kvm.c file without
conditional preprocessing check. This breaks any build not using CONFIG_XEN_EMU.

Protect call by conditional preprocessing to allow build without CONFIG_XEN_EMU.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <20230308130557.2420-1-mrezanin@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 months agoUpdate version for v8.0.0-rc0 release
Peter Maydell [Tue, 14 Mar 2023 19:25:05 +0000 (19:25 +0000)]
Update version for v8.0.0-rc0 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agoMerge tag 'display-pull-request' of https://gitlab.com/marcandre.lureau/qemu into...
Peter Maydell [Tue, 14 Mar 2023 14:28:58 +0000 (14:28 +0000)]
Merge tag 'display-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging

ui: dbus & misc fixes

v2:
- fix crash spotted by avocado VNC test

# -----BEGIN PGP SIGNATURE-----
#
# iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmQPgRIcHG1hcmNhbmRy
# ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5QDFEACef6cbSlTtQji1hV+x
# FM2ESPn0tgg9YVmtjsC1zqcdOEKsbs+2SQxBSs6tvQGwX5CgtnmyEsH5/Y4+TU64
# r6dvGAhokEkhiyHwnC+DFw0ajYAaDK96RfJ02tPQ58lrBTyioKZH9K/3mB6pMFEG
# aroE1Z3SQqqMnP+zsQ64nYuJrTXnv9iFejIxnuou+LyXdxmwLWAl5e47eZYaTmrh
# RrJYbCyHbiL5bx6mOmAL1XlO9jJD4o0FrqRWFn4zz1T+w4FvUC/uX52XwRn1G/Hk
# oHNnJBt95czCQ3S43xX0VTVrT9vLAptQzQc45KfegRL3XqPLgTgn4eocBQCYLmHZ
# jKnUsE9VjBNCbkIzgfN9RP/zEklD/3lAHzrW5US7q7oTTYksyxN+pmvfrYbUvKWP
# Oq/EQtpv66R06hjpxD76ime4+Y8WN7I3F/fJS8jl2QDy5I/2IzFSIOD9Rt5PGbky
# xsIdr7QPzlN4ZKpnsRCNeEPwcR/kiv4grIF7jBAxxz3k5UENtIVSJkHBEEQjMy8O
# +ZCvnHsbjPGxFtnlNTvtGsR2hiKYRCJSG/C4YQryTDWoScomlF6UWxzbapjs9CRW
# /GR+98Z2QfwOtRRRteRRt9UFdC/T0DquxnRyJxa5N4VxMiWzmhtCOzmn4oc1THbG
# 5UqDhRNSWEJn9iIvKca5ahSWLw==
# =Rjcs
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 13 Mar 2023 20:01:22 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 'display-pull-request' of https://gitlab.com/marcandre.lureau/qemu:
  ui/dbus: restrict opengl to gbm-enabled config
  ui/dbus: do not require opengl & gbm
  ui: introduce egl_init()
  ui/sdl: try to instantiate the matching opengl renderer
  ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment
  ui/egl: print EGL error, helping debugging
  ui/shader: fix #version directive must occur on first line
  ui/sdl: get the GL context from the window
  ui: set cursor position upon listener registration
  ui: set cursor upon listener registration
  ui: keep current cursor with QemuConsole
  ui: rename cursor_{get->ref}, return it
  ui: rename cursor_{put->unref}
  meson: ensure dbus-display generated code is built before other units
  ui/dbus: set mouse is-absolute during console creation
  audio/dbus: there are no sender for p2p mode
  ui/dbus: unregister clipboard on connection close
  ui/dbus: initialize cursor_fb

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agoMerge tag 'pull-riscv-to-apply-20230314' of https://github.com/alistair23/qemu into...
Peter Maydell [Tue, 14 Mar 2023 14:28:47 +0000 (14:28 +0000)]
Merge tag 'pull-riscv-to-apply-20230314' of https://github.com/alistair23/qemu into staging

Seventh RISC-V PR for 8.0

* Fix slli_uw decoding
* Fix incorrect register name in disassembler for fmv,fabs,fneg instructions

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEE9sSsRtSTSGjTuM6PIeENKd+XcFQFAmQQFj4ACgkQIeENKd+X
# cFTDowgAhgganhgtSIKwCzQsfSh9P1KOnftmeRLtGQEC36YeJQc6CyqrgwOWCbBy
# +IEs/0/mXT0g70xaisQT2BKR9J6kevb1aHf790J13MmdFZmkpzTmS5SCQCHgUVjG
# SlFf2d2sIoLeBcZYorQSTZdRHjKG3KQ1y0dFWfaqYYwHVqko67fQhKTcqfu3Sn/l
# SKLeD3hz8iDc2Dh8HMls945rpQxATVTj5+/Fi8p0VL1194XK9dXRW4dpACZYJJEv
# T3u+tK5GUgLVXfxlXLxbk4yw4DtNofU0gaQNAfd2i6E9TImhstrvGDojt2pGrY8Y
# crLkAAxsOH8xNWYZdD5tcFrDZDrPvw==
# =oElO
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 14 Mar 2023 06:37:50 GMT
# gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
# gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
# Primary key fingerprint: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054

* tag 'pull-riscv-to-apply-20230314' of https://github.com/alistair23/qemu:
  Fix incorrect register name in disassembler for fmv,fabs,fneg instructions
  disas/riscv: Fix slli_uw decoding

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agoMerge tag 'trivial-branch-for-8.0-pull-request' of https://gitlab.com/laurent_vivier...
Peter Maydell [Tue, 14 Mar 2023 14:28:35 +0000 (14:28 +0000)]
Merge tag 'trivial-branch-for-8.0-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging

trivial branch pull request 20230314

Update MAINTAINER file
Fix typo in qemu-options.hx

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmQQe1ESHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748qpwP/i6k8Jhy9YIN9J/+V/XE6i/KM5ce29zZ
# 8wV7s7/SRobVCFeD4L44Yb4eyyh+XGPrVPosjkloAhM36lfq+2DBWT7A+qjU8PoG
# 3jiRi/pSn+Nc+BtZgKOEWc3FNGjCCBJMXWKOf0XC5djwujth1AEh+VKXyly0GaQx
# 5DY50/VyGCYskBDy2Pv1jUHAiCHBprDOKtxGaM8wB0XIajnAE2znT1NIVOfzWHO1
# HqoWT/Mery2jN1/80rAstPyQX4tYo4C1wXFf3kwfjJibM3Vwd8XOpYTUmeGFGCZ5
# DttPzi3gS7ZkEPQsPMKuNt8ayag62NeOgnoRlsjNsWwnqHkVb1QxN5liA1ZgOWtj
# xbsQk1Ko2YUfG1a/W3hq4AgTZRiuSe2/H4K4sV5kMwVgCNci0OL7a1oNP6JloQm+
# MGRr/nP9GwwnZyyF4CLHW5pGntly0T4C2Ij+AytstBL4QbuzxJJx7FugGrRxdiE8
# +odpUGo+21TxR3kLq9W4xrEwz/A5VNnpUdLFGHK6iuNjNdHNa+7umtHwB9YLHbjP
# V9XQv60+nnbVoTUYx+/IrZy4mwB3M853kjNMbOQrlX94PBlEXlk1Ro6PKGSJrzcT
# xSLVfsJynsU/8CjfJttXsNEYDk6DcdBvw/aj14QM96Flcfwal+jy8YnIIguPQp3Z
# /ORSiS2uSWvp
# =75ca
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 14 Mar 2023 13:49:05 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'trivial-branch-for-8.0-pull-request' of https://gitlab.com/laurent_vivier/qemu:
  MAINTAINERS: Remove CXL maintainer Ben Widawsky
  MAINTAINERS: update my email address for the clock framework
  qemu-options.hx: remove stray quote

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 months agoMAINTAINERS: Remove CXL maintainer Ben Widawsky
Markus Armbruster [Mon, 20 Feb 2023 21:24:37 +0000 (22:24 +0100)]
MAINTAINERS: Remove CXL maintainer Ben Widawsky

Ben is no longer with intel.  He told me he expected to get back to
CXL, but it's not happening as quickly as he'd like, and that it's
best to remove him as maintainer.  So let's do that.

Thank you for serving as maintainer, Ben!

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230220212437.1462314-1-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
13 months agoMAINTAINERS: update my email address for the clock framework
Damien Hedde [Mon, 13 Feb 2023 10:53:06 +0000 (10:53 +0000)]
MAINTAINERS: update my email address for the clock framework

Also update mailmap

Signed-off-by: Damien Hedde <damien.hedde@dahe.fr>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Message-Id: <20230213105227.2357-1-damien.hedde@dahe.fr>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
13 months agoio/channel-tls: plug memory leakage on GSource
Matheus Tavares Bernardino [Mon, 6 Mar 2023 23:15:21 +0000 (20:15 -0300)]
io/channel-tls: plug memory leakage on GSource

This leakage can be seen through test-io-channel-tls:

$ ../configure --target-list=aarch64-softmmu --enable-sanitizers
$ make ./tests/unit/test-io-channel-tls
$ ./tests/unit/test-io-channel-tls

Indirect leak of 104 byte(s) in 1 object(s) allocated from:
    #0 0x7f81d1725808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f81d135ae98 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x57e98)
    #2 0x55616c5d4c1b in object_new_with_propv ../qom/object.c:795
    #3 0x55616c5d4a83 in object_new_with_props ../qom/object.c:768
    #4 0x55616c5c5415 in test_tls_creds_create ../tests/unit/test-io-channel-tls.c:70
    #5 0x55616c5c5a6b in test_io_channel_tls ../tests/unit/test-io-channel-tls.c:158
    #6 0x7f81d137d58d  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x7a58d)

Indirect leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f81d1725a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
    #1 0x7f81d1472a20 in gnutls_dh_params_init (/lib/x86_64-linux-gnu/libgnutls.so.30+0x46a20)
    #2 0x55616c6485ff in qcrypto_tls_creds_x509_load ../crypto/tlscredsx509.c:634
    #3 0x55616c648ba2 in qcrypto_tls_creds_x509_complete ../crypto/tlscredsx509.c:694
    #4 0x55616c5e1fea in user_creatable_complete ../qom/object_interfaces.c:28
    #5 0x55616c5d4c8c in object_new_with_propv ../qom/object.c:807
    #6 0x55616c5d4a83 in object_new_with_props ../qom/object.c:768
    #7 0x55616c5c5415 in test_tls_creds_create ../tests/unit/test-io-channel-tls.c:70
    #8 0x55616c5c5a6b in test_io_channel_tls ../tests/unit/test-io-channel-tls.c:158
    #9 0x7f81d137d58d  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x7a58d)

...

SUMMARY: AddressSanitizer: 49143 byte(s) leaked in 184 allocation(s).

The docs for `g_source_add_child_source(source, child_source)` says
"source will hold a reference on child_source while child_source is
attached to it." Therefore, we should unreference the child source at
`qio_channel_tls_read_watch()` after attaching it to `source`. With this
change, ./tests/unit/test-io-channel-tls shows no leakages.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agops2: Don't send key release event for Lang1, Lang2 keys
Ross Lagerwall [Mon, 27 Feb 2023 17:33:08 +0000 (17:33 +0000)]
ps2: Don't send key release event for Lang1, Lang2 keys

The scancodes for the Lang1 and Lang2 keys (i.e. Hangeul, Hanja) are
special since they already have the 0x80 bit set which is commonly used
to indicate a key release in AT set 1. Reportedly, real hardware does
not send a key release scancode. So, skip sending a release for these
keys. This ensures that Windows behaves correctly and interprets it as a
single keypress rather than two consecutive keypresses.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoAdd qemu qcode support for keys F13 to F24
Willem van de Velde [Wed, 1 Mar 2023 12:52:11 +0000 (13:52 +0100)]
Add qemu qcode support for keys F13 to F24

To be able to use the function keys F13 to F24 these should be defined in de keycodemapdb and added to the qapi.
The keycodemapdb is updated in its own repository, this patch enables the use of those keys within qemu.

Signed-off-by: Willem van de Velde <williamvdvelde@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 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>
13 months agoFix incorrect register name in disassembler for fmv,fabs,fneg instructions
Mikhail Tyutin [Fri, 10 Mar 2023 18:58:45 +0000 (21:58 +0300)]
Fix incorrect register name in disassembler for fmv,fabs,fneg instructions

Fix incorrect register name in RISC-V disassembler for fmv,fabs,fneg instructions

Signed-off-by: Mikhail Tyutin <m.tyutin@yadro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <3454991f-7f64-24c3-9a36-f5fa2cc389e1@yadro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
13 months agodisas/riscv: Fix slli_uw decoding
Ivan Klokov [Mon, 27 Feb 2023 09:02:28 +0000 (12:02 +0300)]
disas/riscv: Fix slli_uw decoding

The decoding of the slli_uw currently contains decoding
error: shamt part of opcode has six bits, not five.

Fixes 3de1fb71("target/riscv: update disas.c for xnor/orn/andn and slli.uw")

Signed-off-by: Ivan Klokov <ivan.klokov@syntacore.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230227090228.17117-1-ivan.klokov@syntacore.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
13 months agoui/dbus: restrict opengl to gbm-enabled config
Marc-André Lureau [Tue, 10 Jan 2023 13:10:01 +0000 (17:10 +0400)]
ui/dbus: restrict opengl to gbm-enabled config

We can enable EGL later for non-GBM hosts.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/dbus: do not require opengl & gbm
Marc-André Lureau [Thu, 11 Aug 2022 14:25:16 +0000 (18:25 +0400)]
ui/dbus: do not require opengl & gbm

Allow to build & use the DBus display without 3d/GPU acceleration support.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui: introduce egl_init()
Marc-André Lureau [Tue, 14 Feb 2023 12:11:24 +0000 (16:11 +0400)]
ui: introduce egl_init()

Future patches will introduce EGL support on win32 (too late for 8.0
though). Having a common place for EGL initialization and error handling
will make it simpler.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/sdl: try to instantiate the matching opengl renderer
Marc-André Lureau [Wed, 15 Feb 2023 14:29:29 +0000 (18:29 +0400)]
ui/sdl: try to instantiate the matching opengl renderer

-display sdl,gl=es didn't actually use OpenGL ES.

Using OpenGL ES allows to use ANGLE, which works generally better than
Windows/OEM OpenGL driver.

(note: users can still bypass the QEMU choice with SDL_RENDER_DRIVER
environment variable)

(note: for some reason, specifying a driver disables batching and
breaks rendering, so enable it explicitly)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment
Marc-André Lureau [Wed, 15 Feb 2023 14:27:46 +0000 (18:27 +0400)]
ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment

Enable SDL logging when QEMU_ENABLE_SDL_LOGGING variable is set, as
suggested by Sam Lantinga, upstream SDL maintainer.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/egl: print EGL error, helping debugging
Marc-André Lureau [Tue, 14 Feb 2023 11:46:58 +0000 (15:46 +0400)]
ui/egl: print EGL error, helping debugging

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
13 months agoui/shader: fix #version directive must occur on first line
Marc-André Lureau [Tue, 14 Feb 2023 10:33:47 +0000 (14:33 +0400)]
ui/shader: fix #version directive must occur on first line

ANGLE fails to compile shaders otherwise.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/sdl: get the GL context from the window
Marc-André Lureau [Tue, 24 Jan 2023 13:47:18 +0000 (17:47 +0400)]
ui/sdl: get the GL context from the window

There is no guarantee to have a current GL context here. The current
code seems to rely on the renderer using a GL backend, and to set a
current GL context. But this is not always the case, for example if the
renderer backend is DirectX.

This change is enough to fix using virgl with sdl2 on win32, on my setup.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui: set cursor position upon listener registration
Marc-André Lureau [Tue, 17 Jan 2023 11:40:58 +0000 (15:40 +0400)]
ui: set cursor position upon listener registration

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui: set cursor upon listener registration
Marc-André Lureau [Tue, 17 Jan 2023 11:34:45 +0000 (15:34 +0400)]
ui: set cursor upon listener registration

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui: keep current cursor with QemuConsole
Marc-André Lureau [Tue, 17 Jan 2023 11:24:40 +0000 (15:24 +0400)]
ui: keep current cursor with QemuConsole

Keeping the current cursor around is useful, not only for VNC, but for
other displays. Let's move it down, see the following patches for other
usages.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui: rename cursor_{get->ref}, return it
Marc-André Lureau [Tue, 17 Jan 2023 11:10:13 +0000 (15:10 +0400)]
ui: rename cursor_{get->ref}, return it

The naming is more conventional in QEMU code, and allows to simplify
some code by changing the API design, so it returns the input parameter,
instead of void.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui: rename cursor_{put->unref}
Marc-André Lureau [Tue, 17 Jan 2023 11:07:02 +0000 (15:07 +0400)]
ui: rename cursor_{put->unref}

The naming is more conventional in QEMU.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agomeson: ensure dbus-display generated code is built before other units
Marc-André Lureau [Thu, 11 Aug 2022 11:59:40 +0000 (15:59 +0400)]
meson: ensure dbus-display generated code is built before other units

It's simply by luck that dbus-display header is built first before the
other units using it.

With sourceset, I can't find an easier way out than declaring an extra
dependency for dbus-display1 generate code.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/dbus: set mouse is-absolute during console creation
Marc-André Lureau [Tue, 15 Nov 2022 13:47:40 +0000 (17:47 +0400)]
ui/dbus: set mouse is-absolute during console creation

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
13 months agoaudio/dbus: there are no sender for p2p mode
Marc-André Lureau [Tue, 15 Nov 2022 12:19:43 +0000 (16:19 +0400)]
audio/dbus: there are no sender for p2p mode

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/dbus: unregister clipboard on connection close
Marc-André Lureau [Tue, 15 Nov 2022 12:12:13 +0000 (16:12 +0400)]
ui/dbus: unregister clipboard on connection close

Fixes unregistration with p2p connections, since they don't have an
associated name owner.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoui/dbus: initialize cursor_fb
Marc-André Lureau [Tue, 14 Feb 2023 15:15:09 +0000 (19:15 +0400)]
ui/dbus: initialize cursor_fb

Or else, we may randomly destroy some textures..

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
13 months agoqemu-options.hx: remove stray quote
John Snow [Thu, 2 Feb 2023 22:31:21 +0000 (17:31 -0500)]
qemu-options.hx: remove stray quote

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230202223121.252073-1-jsnow@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>