qemu/target/i386
Richard Henderson b5e0d5d22f target/i386: Fix 32-bit wrapping of pc/eip computation
In 32-bit mode, pc = eip + cs_base is also 32-bit, and must wrap.
Failure to do so results in incorrect memory exceptions to the guest.
Before 732d548732, this was implicitly done via truncation to
target_ulong but only in qemu-system-i386, not qemu-system-x86_64.

To fix this, we must add conditional zero-extensions.
Since we have to test for 32 vs 64-bit anyway, note that cs_base
is always zero in 64-bit mode.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2022
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20231212172510.103305-1-richard.henderson@linaro.org>
2023-12-12 13:35:08 -08:00
..
hvf target/i386/hvf: Rename 'X86CPU *x86_cpu' variable as 'cpu' 2023-11-07 12:13:27 +01:00
kvm i386/sev: Avoid SEV-ES crash due to missing MSR_EFER_LMA bit 2023-12-06 14:34:11 -05:00
nvmm
tcg target/i386: Fix 32-bit wrapping of pc/eip computation 2023-12-12 13:35:08 -08:00
whpx
arch_dump.c
arch_memory_mapping.c
cpu-dump.c
cpu-internal.h
cpu-param.h
cpu-qom.h target: Move ArchCPUClass definition to 'cpu.h' 2023-11-07 13:08:48 +01:00
cpu-sysemu.c
cpu.c target/i386/cpu: Improve error message for property "vendor" 2023-11-17 10:07:52 +01:00
cpu.h target/i386: Fix 32-bit wrapping of pc/eip computation 2023-12-12 13:35:08 -08:00
gdbstub.c
helper.c
helper.h
host-cpu.c
host-cpu.h
Kconfig
machine.c
meson.build
monitor.c target/i386/monitor: synchronize cpu state for lapic info 2023-11-07 12:13:27 +01:00
ops_sse.h
sev-sysemu-stub.c
sev.c
sev.h
svm.h
trace-events
trace.h
xsave_helper.c