You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/target/i386/tcg
Mark Cave-Ayland 0f1d6606c2 target/i386: fix TB exit logic in gen_movl_seg() when writing to SS
Before commit e54ef98c8a ("target/i386: do not trigger IRQ shadow for LSS"), any
write to SS in gen_movl_seg() would cause a TB exit. The changes introduced by
this commit were intended to restrict the DISAS_EOB_INHIBIT_IRQ exit to the case
where inhibit_irq is true, but missed that a DISAS_EOB_NEXT exit can still be
required when writing to SS and inhibit_irq is false.

Comparing the PE(s) && !VM86(s) section with the logic in x86_update_hflags(), we
can see that the DISAS_EOB_NEXT exit is still required for the !CODE32 case when
writing to SS in gen_movl_seg() because any change to the SS flags can affect
hflags. Similarly we can see that the existing CODE32 case is still correct since
a change to any of DS, ES and SS can affect hflags. Finally for the
gen_op_movl_seg_real() case an explicit TB exit is not needed because the segment
register selector does not affect hflags.

Update the logic in gen_movl_seg() so that a write to SS with inhibit_irq set to
false where PE(s) && !VM86(s) will generate a DISAS_EOB_NEXT exit along with the
inline comment. This has the effect of allowing Win98SE to boot in QEMU once
again.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: e54ef98c8a ("target/i386: do not trigger IRQ shadow for LSS")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2987
Link: https://lore.kernel.org/r/20250611130315.383151-1-mark.cave-ayland@ilande.co.uk
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 weeks ago
..
system include: Remove 'exec/exec-all.h' 2 months ago
user include: Remove 'exec/exec-all.h' 2 months ago
access.c include: Remove 'exec/exec-all.h' 2 months ago
access.h target/i386: Add tcg/access.[ch] 1 year ago
bpt_helper.c
cc_helper.c target/i386: use compiler builtin to compute PF 8 months ago
cc_helper_template.h.inc target/i386: tcg: use cout to commonize add/adc/sub/sbb cases 2 months ago
decode-new.c.inc target/i386: ignore misplaced REX prefixes 2 months ago
decode-new.h target/i386: convert CMPXCHG8B/CMPXCHG16B to new decoder 8 months ago
emit.c.inc target/i386: do not trigger IRQ shadow for LSS 2 months ago
excp_helper.c include: Remove 'exec/exec-all.h' 2 months ago
fpu_helper.c target/i386: Wire up MXCSR.DE and FPUS.DE correctly 3 weeks ago
helper-tcg.h target/i386/tcg/helper-tcg: fix file references in comments 1 month ago
int_helper.c include: Remove 'exec/exec-all.h' 2 months ago
mem_helper.c include: Remove 'exec/exec-all.h' 2 months ago
meson.build include: Rename sysemu/ -> system/ 6 months ago
misc_helper.c exec: Declare tlb_flush*() in 'exec/cputlb.h' 4 months ago
mpx_helper.c include: Remove 'exec/exec-all.h' 2 months ago
ops_sse_header.h.inc
seg_helper.c target/i386: implement TSS trap bit 2 months ago
seg_helper.h target/i386: Restrict cpu_mmu_index_kernel() to TCG 2 months ago
tcg-cpu.c target/i386: Fill in TCGCPUOps.pointer_wrap 1 month ago
tcg-cpu.h target/i386: Remove AccelCPUClass::cpu_class_init need 2 months ago
tcg-stub.c
translate.c target/i386: fix TB exit logic in gen_movl_seg() when writing to SS 2 weeks ago