qemu-e2k/include/exec
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
..
user
address-spaces.h
confidential-guest-support.h confidential guest support: Introduce cgs "ready" flag 2021-02-08 16:57:38 +11:00
cpu_ldst.h include/exec: fix softmmu version of TARGET_ABI_FMT_lx 2022-02-09 13:29:38 +00:00
cpu-all.h exec/cpu: Make host pages variables / macros 'target agnostic' 2022-01-27 12:08:56 +01:00
cpu-common.h exec/cpu: Make host pages variables / macros 'target agnostic' 2022-01-27 12:08:56 +01:00
cpu-defs.h exec/cpu-defs: Remove TCG backends dependency 2021-02-05 10:24:14 -10:00
cputlb.h
exec-all.h exec/exec-all: Move 'qemu/log.h' include in units requiring it 2022-02-21 10:18:06 +01:00
gdbstub.h gdbstub: Remove unused gdb_get_float32() and gdb_get_float64() 2021-02-15 09:38:47 +00:00
gen-icount.h accel/tcg: introduce CF_NOIRQ 2021-11-29 15:12:37 +00:00
helper-gen.h tracing: excise the tcg related from tracetool 2022-02-09 12:08:42 +00:00
helper-head.h tcg: Remove dh_alias indirection for dh_typecode 2022-02-28 08:04:06 -10:00
helper-proto.h tracing: remove the trace-tcg includes from the build 2022-02-09 12:08:42 +00:00
helper-tcg.h tracing: remove the trace-tcg includes from the build 2022-02-09 12:08:42 +00:00
hwaddr.h
ioport.h
log.h tcg: Introduce tcg_splitwx_to_{rx,rw} 2021-01-07 05:09:41 -10:00
memattrs.h
memop.h exec/memop: Adding signed quad and octo defines 2022-01-08 15:46:10 +10:00
memopidx.h tcg: Split out MemOpIdx to exec/memopidx.h 2021-10-05 16:53:17 -07:00
memory_ldst_cached.h.inc exec/memory_ldst_cached: Use correct type size 2021-05-26 08:35:51 -07:00
memory_ldst_phys.h.inc exec/memory_ldst_phys: Use correct type sizes 2021-05-26 08:35:51 -07:00
memory_ldst.h.inc exec/memory_ldst: Use correct type sizes 2021-05-26 08:35:51 -07:00
memory-internal.h
memory.h exec/memory: Extract address_space_set() from dma_memory_set() 2022-01-20 09:09:37 +01:00
page-vary.h exec: Build page-vary-common.c with -fno-lto 2021-03-23 19:36:47 -06:00
plugin-gen.h plugins: try and make plugin_insn_append more ergonomic 2021-11-04 10:32:01 +00:00
poison.h configure: Poison all current target-specific #defines 2021-05-14 12:32:17 +02:00
ram_addr.h memory: introduce total_dirty_pages to stat dirty pages 2021-11-01 22:56:44 +01:00
ramblock.h exec/ramblock: Add missing includes 2022-02-21 10:18:06 +01:00
ramlist.h qapi: introduce x-query-ramblock QMP command 2021-11-02 15:55:14 +00:00
softmmu-semi.h
target_page.h
translate-all.h accel/tcg: Clear PAGE_WRITE before translation 2021-09-14 12:00:20 -07:00
translator.h accel/tcg: Clear PAGE_WRITE before translation 2021-09-14 12:00:20 -07:00