qemu/target
Mark Cave-Ayland 7653b44534 target/i386/translate.c: always write 32-bits for SGDT and SIDT
The various Intel CPU manuals claim that SGDT and SIDT can write either 24-bits
or 32-bits depending upon the operand size, but this is incorrect. Not only do
the Intel CPU manuals give contradictory information between processor
revisions, but this information doesn't even match real-life behaviour.

In fact, tests on real hardware show that the CPU always writes 32-bits for SGDT
and SIDT, and this behaviour is required for at least OS/2 Warp and WFW 3.11 with
Win32s to function correctly. Remove the masking applied due to the operand size
for SGDT and SIDT so that the TCG behaviour matches the behaviour on real
hardware.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2198

--
MCA: Whilst I don't have a copy of OS/2 Warp handy, I've confirmed that this
patch fixes the issue in WFW 3.11 with Win32s. For more technical information I
highly recommend the excellent write-up at
https://www.os2museum.com/wp/sgdtsidt-fiction-and-reality/.
Message-ID: <20240419195147.434894-1-mark.cave-ayland@ilande.co.uk>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-04-23 17:35:26 +02:00
..
alpha target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:16 +01:00
arm KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
avr target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:17 +01:00
cris target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:17 +01:00
hexagon target/hexagon: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:17 +01:00
hppa target/hppa: Use insn_start from DisasContextBase 2024-04-09 07:45:09 -10:00
i386 target/i386/translate.c: always write 32-bits for SGDT and SIDT 2024-04-23 17:35:26 +02:00
loongarch KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
m68k target/m68k: Map FPU exceptions to FPSR register 2024-04-09 07:43:31 -10:00
microblaze target/microblaze: Use insn_start from DisasContextBase 2024-04-09 07:45:09 -10:00
mips KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
nios2 target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:24 +01:00
openrisc target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:24 +01:00
ppc KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
riscv KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
rx target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:24 +01:00
s390x KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
sh4 target/sh4: add missing CHECK_NOT_DELAY_SLOT 2024-04-09 07:43:31 -10:00
sparc target/sparc: Use GET_ASI_CODE for ASI_KERNELTXT and ASI_USERTXT 2024-04-12 14:48:01 -07:00
tricore target/tricore/helper: Use correct string format in cpu_tlb_fill() 2024-03-26 14:24:06 +01:00
xtensa target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:25 +01:00
Kconfig hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00
meson.build target: Make qemu_target_page_mask() available for *-user 2024-01-29 21:04:10 +10:00
target-common.c target: Make qemu_target_page_mask() available for *-user 2024-01-29 21:04:10 +10:00