Philippe Mathieu-Daudé [Tue, 21 Nov 2023 12:52:48 +0000 (13:52 +0100)]
meson: Allow building binary with no target-specific files in hw/
Allow building a qemu-system-foo binary with target-agnostic
only HW models.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <
20231121203129.67999-1-philmd@linaro.org>
Peter Maydell [Thu, 4 Jan 2024 19:55:19 +0000 (19:55 +0000)]
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* configure: use a native non-cross compiler for linux-user
* meson: cleanups
* target/i386: miscellaneous cleanups and optimizations
* target/i386: implement CMPccXADD
* target/i386: the sgx_epc_get_section stub is reachable
* esp: check for NULL result from scsi_device_find()
# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmWRImYUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroNd7AgAgcyJGiMfUkXqhefplpm06RDXQIa8
# FuoJqPb21lO75DQKfaFRAc4xGLagjJROMJGHMm9HvMu2VlwvOydkQlfFRspENxQ/
# 5XzGdb/X0A7HA/mwUfnMB1AZx0Vs32VI5IBSc6acc9fmgeZ84XQEoM3KBQHUik7X
# mSkE4eltR9gJ+4IaGo4voZtK+YoVD8nEcuqmnKihSPWizev0FsZ49aNMtaYa9qC/
# Xs3kiQd/zPibHDHJu0ulFsNZgxtUcvlLHTCf8gO4dHWxCFLXGubMush83McpRtNB
# Qoh6cTLH+PBXfrxMR3zmTZMNvo8Euls3s07Y8TkNP4vdIIE/kMeMDW1wJw==
# =mq30
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun 31 Dec 2023 08:12:22 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: (46 commits)
meson.build: report graphics backends separately
configure, meson: rename targetos to host_os
meson: rename config_all
meson: remove CONFIG_ALL
meson: remove config_targetos
meson: remove CONFIG_POSIX and CONFIG_WIN32 from config_targetos
meson: remove OS definitions from config_targetos
meson: always probe u2f and canokey if the option is enabled
meson: move subdirs to "Collect sources" section
meson: move config-host.h definitions together
meson: move CFI detection code with other compiler flags
meson: keep subprojects together
meson: move accelerator dependency checks together
meson: move option validation together
meson: move program checks together
meson: add more sections to main meson.build
configure: unify again the case arms in probe_target_compiler
configure: remove unnecessary subshell
Makefile: clean qemu-iotests output
meson: use version_compare() to compare version
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Peter Maydell [Thu, 4 Jan 2024 10:23:34 +0000 (10:23 +0000)]
Merge tag 'pull-
20231230' of https://gitlab.com/rth7680/qemu into staging
Mark VMStateField and VMStateDescription arrays const.
# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmWPOFsdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV8cCQgAnQjy3Ic1i225AElh
# 0Ph3Aiw6WT9pECLoKmyroxHbTGuaEJoIXeaOhMAnowCTBLoKRR3/Ooq0DGOW+l/Z
# f5PwWSkjkb+OcS+dj/kgQBu58/Gk5G8ogksqKQvci8k2okhjHmITSQDu0dtwzDZr
# jVGh3gmGoat73jQyD/nAwgWFawlLkklOMR/yvnFX7EJIBepRVbkMPayoKlB+6W07
# 1kqhSwoI0vQCjhJ3Q7Q0GC4rrHK3KUq7o/25yvICf4EgPKfsaym1wAjDhdKToixl
# 9T+ALZG8SiZZkBlb6l3QZ7pqtqavxYtPdZ2Gx/nMu0RRu4G33d5AVGHRrXj9qttW
# 5mL7ZQ==
# =uQ4C
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 29 Dec 2023 21:21:31 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-
20231230' of https://gitlab.com/rth7680/qemu: (71 commits)
docs: Constify VMstate in examples
tests/unit/test-vmstate: Constify VMState
util/fifo8: Constify VMState
replay: Constify VMState
system: Constify VMState
migration: Constify VMState
cpu-target: Constify VMState
backends: Constify VMState
audio: Constify VMState
hw/misc/macio: Constify VMState
hw/watchdog: Constify VMState
hw/virtio: Constify VMState
hw/vfio: Constify VMState
hw/usb: Constify VMState
hw/tpm: Constify VMState
hw/timer: Constify VMState
hw/ssi: Constify VMState
hw/sparc: Constify VMState
hw/sensor: Constify VMState
hw/sd: Constify VMState
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Alex Bennée [Fri, 22 Dec 2023 11:48:46 +0000 (11:48 +0000)]
meson.build: report graphics backends separately
To enable accelerated VirtIO GPUs for the guest we need the rendering
support on the host, which currently it's reported in the configuration
summary under the "dependencies" section. Add a graphics backend section
and report the status of the VirGL and Rutabaga support libraries.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <
20231222114846.
2850741-1-alex.bennee@linaro.org>
[Remove from dependencies as suggested by Philippe. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 3 Nov 2023 08:17:48 +0000 (09:17 +0100)]
configure, meson: rename targetos to host_os
This variable is about the host OS, not the target. It is used a lot
more since the Meson conversion, but the original sin dates back to 2003.
Time to fix it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 29 Sep 2023 09:40:03 +0000 (11:40 +0200)]
meson: rename config_all
config_all now lists only accelerators, rename it to indicate its actual
content.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 31 Aug 2023 09:18:24 +0000 (11:18 +0200)]
meson: remove CONFIG_ALL
CONFIG_ALL is tricky to use and was ported over to Meson from the
recursive processing of Makefile variables. Meson sourcesets
however have all_sources() and all_dependencies() methods that
remove the need for it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 30 Aug 2023 09:52:43 +0000 (11:52 +0200)]
meson: remove config_targetos
config_targetos is now empty and can be removed; its use in sourcesets
that do not involve target-specific files can be replaced with an empty
dictionary.
In fact, at this point *all* sourcesets that do not involve
target-specific files are just glorified mutable arrays. Enforce that
they never test for symbols in "when:" by computing the set of files
without "strict: false".
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 30 Aug 2023 09:29:54 +0000 (11:29 +0200)]
meson: remove CONFIG_POSIX and CONFIG_WIN32 from config_targetos
For consistency with other OSes, use if...endif for rules that are
target-independent.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 26 May 2023 10:20:39 +0000 (12:20 +0200)]
meson: remove OS definitions from config_targetos
CONFIG_DARWIN, CONFIG_LINUX and CONFIG_BSD are used in some rules, but
only CONFIG_LINUX has substantial use. Convert them all to if...endif.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 8 Sep 2023 10:10:27 +0000 (12:10 +0200)]
meson: always probe u2f and canokey if the option is enabled
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 3 Nov 2023 08:33:57 +0000 (09:33 +0100)]
meson: move subdirs to "Collect sources" section
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 8 Sep 2023 10:10:08 +0000 (12:10 +0200)]
meson: move config-host.h definitions together
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 10 May 2023 12:54:30 +0000 (14:54 +0200)]
meson: move CFI detection code with other compiler flags
Keep it together with the other compiler modes, and before dependencies.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 8 Sep 2023 10:09:22 +0000 (12:09 +0200)]
meson: keep subprojects together
And move away dependencies that are not subprojects anymore.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 8 Sep 2023 10:08:53 +0000 (12:08 +0200)]
meson: move accelerator dependency checks together
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Sat, 30 Dec 2023 17:42:30 +0000 (18:42 +0100)]
meson: move option validation together
Check options before compiler flags, because some compiler flags are
incompatible with modules.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 8 Sep 2023 10:06:57 +0000 (12:06 +0200)]
meson: move program checks together
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 8 Sep 2023 10:06:12 +0000 (12:06 +0200)]
meson: add more sections to main meson.build
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 3 Nov 2023 08:48:21 +0000 (09:48 +0100)]
configure: unify again the case arms in probe_target_compiler
Remove assignments that match the default, and group the
targets for debian-legacy-test-cross and debian-all-test-cross
into a single arm.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 3 Nov 2023 09:06:08 +0000 (10:06 +0100)]
configure: remove unnecessary subshell
Do not use a subshell to hide the shadowing of $config_host_mak.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 3 Nov 2023 09:00:04 +0000 (10:00 +0100)]
Makefile: clean qemu-iotests output
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 13 Dec 2023 10:33:41 +0000 (11:33 +0100)]
meson: use version_compare() to compare version
While a simple lexicographic comparison usually works, it is less
robust than a more specific algorithm designed to compare versions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 13 Dec 2023 10:30:50 +0000 (11:30 +0100)]
meson: remove unused variable
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 13 Dec 2023 10:30:09 +0000 (11:30 +0100)]
meson: fix type of "relocatable" option
Since the option is of boolean type, the default value should be a boolean
rather than a string.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Alexandra Diupina [Fri, 29 Dec 2023 15:26:47 +0000 (18:26 +0300)]
esp: check for NULL result from scsi_device_find()
Add a 'current_lun' check for a null value
to avoid null pointer dereferencing and
recover host if NULL return
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 4eb8606560 (esp: store lun coming from the MESSAGE OUT phase)
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
Message-ID: <
20231229152647.19699-1-adiupina@astralinux.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Tue, 1 Feb 2022 19:09:41 +0000 (20:09 +0100)]
target/i386: the sgx_epc_get_section stub is reachable
The sgx_epc_get_section stub is reachable from cpu_x86_cpuid. It
should not assert, instead it should just return true just like
the "real" sgx_epc_get_section does when SGX is disabled.
Reported-by: Vladimír Beneš <vbenes@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <
20220201190941.106001-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Tue, 10 Oct 2023 08:31:39 +0000 (10:31 +0200)]
target/i386: implement CMPccXADD
The main difficulty here is that a page fault when writing to the destination
must not overwrite the flags. Therefore, the flags computation must be
inlined instead of using gen_jcc1*.
For simplicity, I am using an unconditional cmpxchg operation, that becomes
a NOP if the comparison fails.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 11 Oct 2023 13:26:40 +0000 (15:26 +0200)]
target/i386: introduce flags writeback mechanism
ALU instructions can write to both memory and flags. If the CC_SRC*
and CC_DST locations have been written already when a memory access
causes a fault, the value in CC_SRC* and CC_DST might be interpreted
with the wrong CC_OP (the one that is in effect before the instruction.
Besides just using the wrong result for the flags, something like
subtracting -1 can have disastrous effects if the current CC_OP is
CC_OP_EFLAGS: this is because QEMU does not expect bits outside the ALU
flags to be set in CC_SRC, and env->eflags can end up set to all-ones.
In the case of the attached testcase, this sets IOPL to 3 and would
cause an assertion failure if SUB is moved to the new decoder.
This mechanism is not really needed for BMI instructions, which can
only write to a register, but put it to use anyway for cleanliness.
In the case of BZHI, the code has to be modified slightly to ensure
that decode->cc_src is written, otherwise the new assertions trigger.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 11 Oct 2023 09:28:46 +0000 (11:28 +0200)]
target/i386: adjust decoding of J operand
gen_jcc() has been changed to accept a relative offset since the
new decoder was written. Adjust the J operand, which is meant
to be used with jump instructions such as gen_jcc(), to not
include the program counter and to not truncate the result, as
both operations are now performed by common code.
The result is that J is now the same as the I operand.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 27 Oct 2023 02:22:25 +0000 (04:22 +0200)]
target/i386: move operand load and writeback out of gen_cmovcc1
Similar to gen_setcc1, make gen_cmovcc1 receive TCGv. This is more friendly
to simultaneous implementation in the old and the new decoder.
A small wart is that s->T0 of CMOV is currently the *second* argument (which
would ordinarily be in T1). Therefore, the condition has to be inverted in
order to overwrite s->T0 with cpu_regs[reg] if the MOV is not performed.
This only applies to the old decoder, and this code will go away soon.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 23 Oct 2023 06:52:36 +0000 (08:52 +0200)]
target/i386: prepare for implementation of STOS/SCAS in new decoder
Do not use gen_op, and pull the load from the accumulator into
disas_insn.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 23 Oct 2023 08:21:20 +0000 (10:21 +0200)]
target/i386: do not use s->tmp0 for jumps on ECX ==/!= 0
Create a new temporary, to ease the register allocator's work.
Creation of the temporary is pushed into gen_ext_tl, which
also allows NULL as the first parameter now.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 20 Oct 2023 07:32:06 +0000 (09:32 +0200)]
target/i386: do not use s->tmp4 for push
Just create a temporary for the occasion.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 11 Oct 2023 14:20:20 +0000 (16:20 +0200)]
target/i386: split eflags computation out of gen_compute_eflags
The new x86 decoder wants the gen_* functions to compute EFLAGS before
writeback, which can be an issue for instructions with a memory
destination such as ARPL or shifts.
Extract code to compute the EFLAGS without clobbering CC_SRC, in case
the memory write causes a fault. The flags writeback mechanism will
take care of copying the result to CC_SRC.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 19 Oct 2023 14:55:39 +0000 (16:55 +0200)]
target/i386: do not clobber T0 on string operations
The new decoder would rather have the operand in T0 when expanding SCAS, rather
than use R_EAX directly as gen_scas currently does. This makes SCAS more similar
to CMP and SUB, in that CC_DST = T0 - T1.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 21 Sep 2022 12:13:01 +0000 (14:13 +0200)]
target/i386: do not clobber A0 in POP translation
The new decoder likes to compute the address in A0 very early, so the
gen_lea_v_seg in gen_pop_T0 would clobber the address of the memory
operand. Instead use T0 since it is already available and will be
overwritten immediately after.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 19 Oct 2023 12:51:16 +0000 (14:51 +0200)]
target/i386: do not decode string source/destination into decode->mem
decode->mem is only used if one operand has has_ea == true. String
operations will not use decode->mem and will load A0 on their own, because
they are the only case of two memory operands in a single instruction.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 19 Oct 2023 13:40:54 +0000 (15:40 +0200)]
target/i386: add X86_SPECIALs for MOVSX and MOVZX
Usually the registers are just moved into s->T0 without much care for
their operand size. However, in some cases we can get more efficient
code if the operand fetching logic syncs with the emission function
on what is nicer.
All the current uses are mostly demonstrative and only reduce the code
in the emission functions, because the instructions do not support
memory operands. However the logic is generic and applies to several
more instructions such as MOVSXD (aka movslq), one-byte shift
instructions, multiplications, XLAT, and indirect calls/jumps.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 19 Oct 2023 21:14:34 +0000 (23:14 +0200)]
target/i386: rename zext0/zext2 and make them closer to the manual
X86_SPECIAL_ZExtOp0 and X86_SPECIAL_ZExtOp2 are poorly named; they are a hack
that is needed by scalar insertion and extraction instructions, and not really
related to zero extension: for PEXTR the zero extension is done by the generation
functions, for PINSR the high bits are not used at all and in fact are *not*
filled with zeroes when loaded into s->T1.
Rename the values to match the effect described in the manual, and explain
better in the comments.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 19 Oct 2023 16:25:40 +0000 (18:25 +0200)]
target/i386: avoid trunc and ext for MULX and RORX
Use _tl operations for 32-bit operands on 32-bit targets, and only go
through trunc and extu ops for 64-bit targets. While the trunc/ext
ops should be pretty much free after optimization, the optimizer also
does not like having the same temporary used in multiple EBBs.
Therefore it is nicer to not use tmpN* unless necessary.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 19 Oct 2023 12:22:53 +0000 (14:22 +0200)]
target/i386: reimplement check for validity of LOCK prefix
The previous check erroneously allowed CMP to be modified with LOCK.
Instead, tag explicitly the instructions that do support LOCK.
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 23 Oct 2023 07:58:48 +0000 (09:58 +0200)]
target/i386: document more deviations from the manual
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 25 Oct 2023 22:24:46 +0000 (00:24 +0200)]
target/i386: clean up cpu_cc_compute_all
cpu_cc_compute_all() has an argument that is always equal to CC_OP for historical
reasons (dating back to commit
a7812ae4123, "TCG variable type checking.", 2008-11-17,
which added the argument to helper_cc_compute_all). It does not make sense for the
argument to have any other value, so remove it and clean up some lines that are not
too long anymore.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 25 Oct 2023 18:38:16 +0000 (20:38 +0200)]
target/i386: remove unnecessary truncations
gen_lea_v_seg (called by gen_add_A0_ds_seg) already zeroes any
bits of s->A0 beyond s->aflag. It does so before summing the
segment base and, if not in 64-bit mode, also after summing it.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 25 Oct 2023 15:59:46 +0000 (17:59 +0200)]
target/i386: remove unnecessary arguments from raise_interrupt
is_int is always 1, and error_code is always zero.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 25 Oct 2023 11:13:13 +0000 (13:13 +0200)]
target/i386: speedup JO/SETO after MUL or IMUL
OF is equal to the carry flag, so use the same CCPrepare.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 27 Oct 2023 02:12:59 +0000 (04:12 +0200)]
target/i386: optimize computation of JL and JLE from flags
Take advantage of the fact that there can be no 1 bits between SF and OF.
If they were adjacent, you could sum SF and get a carry only if SF was
already set. Then the value of OF in the sum is the XOR of OF itself,
the carry (which is SF) and 0 (the value of the OF bit in the addend):
this is OF^SF exactly.
Because OF and SF are not adjacent, just place more 1 bits to the
left so that the carry propagates, which means summing CC_O - CC_S.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Richard Henderson [Thu, 21 Dec 2023 03:16:52 +0000 (14:16 +1100)]
docs: Constify VMstate in examples
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-72-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:51 +0000 (14:16 +1100)]
tests/unit/test-vmstate: Constify VMState
While const data in tests is not particularly important,
this makes a grep test clear across the tree.
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-71-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:50 +0000 (14:16 +1100)]
util/fifo8: Constify VMState
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-70-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:49 +0000 (14:16 +1100)]
replay: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-69-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:48 +0000 (14:16 +1100)]
system: Constify VMState
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-68-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:47 +0000 (14:16 +1100)]
migration: Constify VMState
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-67-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:46 +0000 (14:16 +1100)]
cpu-target: Constify VMState
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <
20231221031652.119827-66-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:45 +0000 (14:16 +1100)]
backends: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-65-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:44 +0000 (14:16 +1100)]
audio: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-64-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:43 +0000 (14:16 +1100)]
hw/misc/macio: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-63-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:42 +0000 (14:16 +1100)]
hw/watchdog: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-62-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:41 +0000 (14:16 +1100)]
hw/virtio: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-61-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:40 +0000 (14:16 +1100)]
hw/vfio: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <
20231221031652.119827-60-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:39 +0000 (14:16 +1100)]
hw/usb: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-59-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:38 +0000 (14:16 +1100)]
hw/tpm: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-58-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:37 +0000 (14:16 +1100)]
hw/timer: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-57-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:36 +0000 (14:16 +1100)]
hw/ssi: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-56-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:35 +0000 (14:16 +1100)]
hw/sparc: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-55-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:34 +0000 (14:16 +1100)]
hw/sensor: Constify VMState
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-54-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:33 +0000 (14:16 +1100)]
hw/sd: Constify VMState
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-53-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:32 +0000 (14:16 +1100)]
hw/scsi: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-52-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:31 +0000 (14:16 +1100)]
hw/s390x: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-51-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:30 +0000 (14:16 +1100)]
hw/rtc: Constify VMState
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-50-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:29 +0000 (14:16 +1100)]
hw/riscv: Constify VMState
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-49-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:28 +0000 (14:16 +1100)]
hw/ppc: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-48-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:27 +0000 (14:16 +1100)]
hw/pci-host: Constify VMState
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-47-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:26 +0000 (14:16 +1100)]
hw/pci-bridge: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-46-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:25 +0000 (14:16 +1100)]
hw/pci: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-45-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:24 +0000 (14:16 +1100)]
hw/openrisc: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-44-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:23 +0000 (14:16 +1100)]
hw/nvram: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-43-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:22 +0000 (14:16 +1100)]
hw/net: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-42-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:21 +0000 (14:16 +1100)]
hw/misc: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-41-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:20 +0000 (14:16 +1100)]
hw/m68k: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-40-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:19 +0000 (14:16 +1100)]
hw/loongarch: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <
20231221031652.119827-39-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:18 +0000 (14:16 +1100)]
hw/isa: Constify VMState
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-38-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:17 +0000 (14:16 +1100)]
hw/ipmi: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-37-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:16 +0000 (14:16 +1100)]
hw/ipack: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-36-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:15 +0000 (14:16 +1100)]
hw/intc: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-35-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:14 +0000 (14:16 +1100)]
hw/input: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-34-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:13 +0000 (14:16 +1100)]
hw/ide: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-33-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:12 +0000 (14:16 +1100)]
hw/i386: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <
20231221031652.119827-32-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:11 +0000 (14:16 +1100)]
hw/i2c: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-31-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:10 +0000 (14:16 +1100)]
hw/hyperv: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-30-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:09 +0000 (14:16 +1100)]
hw/gpio: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-29-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:08 +0000 (14:16 +1100)]
hw/dma: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-28-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:07 +0000 (14:16 +1100)]
hw/display: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-27-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:06 +0000 (14:16 +1100)]
hw/char: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-26-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:05 +0000 (14:16 +1100)]
hw/block: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-25-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:04 +0000 (14:16 +1100)]
hw/audio: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-24-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:03 +0000 (14:16 +1100)]
hw/adc: Constify VMState
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-23-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:02 +0000 (14:16 +1100)]
hw/acpi: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-22-richard.henderson@linaro.org>
Richard Henderson [Thu, 21 Dec 2023 03:16:01 +0000 (14:16 +1100)]
hw/9pfs: Constify VMState
Acked-by: Greg Kurz <groug@kaod.org>
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20231221031652.119827-21-richard.henderson@linaro.org>