qemu-e2k/include
Richard Henderson 8929906e21 tcg: Remove dh_alias indirection for dh_typecode
The dh_alias redirect is intended to handle TCG types as distinguished
from C types.  TCG does not distinguish signed int from unsigned int,
because they are the same size.  However, we need to retain this
distinction for dh_typecode, lest we fail to extend abi types properly
for the host call parameters.

This bug was detected when running the 'arm' emulator on an s390
system. The s390 uses TCG_TARGET_EXTEND_ARGS which triggers code
in tcg_gen_callN to extend 32 bit values to 64 bits; the incorrect
sign data in the typemask for each argument caused the values to be
extended as unsigned values.

This simple program exhibits the problem:

	static volatile int num = -9;
	static volatile int den = -5;
	int main(void)
	{
		int quo = num / den;
		printf("num %d den %d quo %d\n", num, den, quo);
		exit(0);
	}

When run on the broken qemu, this results in:

	num -9 den -5 quo 0

The correct result is:

	num -9 den -5 quo 1

Fixes: 7319d83a73 ("tcg: Combine dh_is_64bit and dh_is_signed to dh_typecode")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/876
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-02-28 08:04:06 -10:00
..
authz
block hw/nvme: add support for zoned random write area 2022-02-14 08:58:29 +01:00
chardev ui/dbus: add chardev backend & interface 2021-12-21 10:50:22 +04:00
crypto
disas target/riscv: setup everything for rv64 to support rv128 execution 2022-01-08 15:46:10 +10:00
exec tcg: Remove dh_alias indirection for dh_typecode 2022-02-28 08:04:06 -10:00
fpu softfloat: Add float64r32 arithmetic routines 2021-12-17 17:57:15 +01:00
hw hw/tricore: Remove unused and incorrect header 2022-02-21 10:36:50 +01:00
io
libdecnumber libdecnumber: Introduce decNumberIntegralToInt128 2021-11-09 10:32:52 +11:00
migration Fixed a QEMU hang when guest poweroff in COLO mode 2021-12-15 10:31:42 +01:00
monitor
net Revert "virtio-net: add support for configure interrupt" 2022-01-10 16:00:54 -05:00
qapi
qemu include: Move hardware version declarations to new qemu/hw-version.h 2022-02-21 13:30:20 +00:00
qom monitor: Fix find_device_state() for IDs containing slashes 2021-11-10 06:14:51 +01:00
scsi
semihosting
standard-headers linux-headers: Update headers to v5.17-rc1 2022-02-17 17:21:45 +00:00
sysemu rtc: Move RTC function prototypes to their own header 2022-01-28 14:29:46 +00:00
tcg exec/memop: Adding signedness to quad definitions 2022-01-08 15:46:10 +10:00
ui ui: avoid warnings about directdb on Alpine / musl libc 2022-01-18 16:42:41 +00:00
user common-user: Move safe-syscall.* from linux-user 2021-12-20 10:12:24 -08:00
elf.h elf: Add machine type value for LoongArch 2021-12-21 13:17:06 -08:00
glib-compat.h docs/devel: more documentation on the use of suffixes 2022-01-18 16:42:42 +00:00
qemu-common.h rtc: Move RTC function prototypes to their own header 2022-01-28 14:29:46 +00:00
qemu-io.h