xemu/tests
Paolo Bonzini c45d10f655 target/i386: fix ADOX followed by ADCX
When ADCX is followed by ADOX or vice versa, the second instruction's
carry comes from EFLAGS and the condition codes use the CC_OP_ADCOX
operation.  Retrieving the carry from EFLAGS is handled by this bit
of gen_ADCOX:

        tcg_gen_extract_tl(carry_in, cpu_cc_src,
            ctz32(cc_op == CC_OP_ADCX ? CC_C : CC_O), 1);

Unfortunately, in this case cc_op has been overwritten by the previous
"if" statement to CC_OP_ADCOX.  This works by chance when the first
instruction is ADCX; however, if the first instruction is ADOX,
ADCX will incorrectly take its carry from OF instead of CF.

Fix by moving the computation of the new cc_op at the end of the function.
The included exhaustive test case fails without this patch and passes
afterwards.

Because ADCX/ADOX need not be invoked through the VEX prefix, this
regression bisects to commit 16fc5726a6 ("target/i386: reimplement
0x0f 0x38, add AVX", 2022-10-18).  However, the mistake happened a
little earlier, when BMI instructions were rewritten using the new
decoder framework.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1471
Reported-by: Paul Jolly <https://gitlab.com/myitcv>
Fixes: 1d0b926150 ("target/i386: move scalar 0F 38 and 0F 3A instruction to new decoder", 2022-10-18)
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 60c7dd22e1383754d5f150bc9f7c2785c662a7b6)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2023-03-29 10:20:04 +03:00
..
avocado tests/avocado: use new rootfs for orangepi test 2022-11-23 10:58:48 +01:00
bench test/crypto: Add test suite for crypto akcipher 2022-05-26 11:41:54 +01:00
data tests: acpi: x86: update expected DSDT after moving PRQx fields in _SB scope 2022-11-22 05:19:00 -05:00
decode
docker tests/docker: allow user to override check target 2022-11-22 09:49:03 +00:00
fp meson: remove dead assignments 2022-09-01 07:42:37 +02:00
guest-debug tests/guest-debug: better handle gdb crashes 2022-04-20 16:04:20 +01:00
image-fuzzer
include
keys
lcitool ci: replace x86_64 macos-11 with aarch64 macos-12 2022-11-17 09:58:11 +01:00
migration tests/migration: remove the unused local variable 2022-10-11 12:37:12 +02:00
multiboot
perf/block/qcow2
plugin tests/plugins: add instruction matching to libinsn.so 2022-02-09 12:08:42 +00:00
qapi-schema meson: remove dead assignments 2022-09-01 07:42:37 +02:00
qemu-iotests tests/stream-under-throttle: New test 2022-11-14 11:31:52 +01:00
qtest * Fix potential undefined behavior in cleanup of migration-test 2022-12-04 11:07:46 -05:00
rocker
tcg target/i386: fix ADOX followed by ADCX 2023-03-29 10:20:04 +03:00
tsan
uefi-test-tools
unit pci,pc,virtio: features, tests, fixes, cleanups 2022-11-07 18:43:56 -05:00
vm tests/vm: use -o IdentitiesOnly=yes for ssh 2022-10-31 20:37:59 +00:00
vmstate-static-checker-data
check-block.sh tests/qemu-iotests: Move the bash and sanitizer checks to meson.build 2022-04-20 09:46:54 +02:00
dbus-vmstate-daemon.sh
Makefile.include configure: move tests/tcg/Makefile.prereqs to root build directory 2022-10-06 11:53:40 +01:00
meson.build meson: create have_vhost_* variables 2022-05-07 07:46:58 +02:00
requirements.txt tests: install "qemu" namespace package into venv 2022-06-06 09:26:54 +02:00
test-qht-par.c
vhost-user-bridge.c tests: vhost-user-bridge: Avoid using hardcoded /tmp 2022-09-27 20:51:20 +02:00