qemu/target
Alexander Graf 8fa11a4df3 target/i386: Fix legacy page table walk
Commit b56617bbcb ("target/i386: Walk NPT in guest real mode") added
logic to run the page table walker even in real mode if we are in NPT
mode.  That function then determined whether real mode or paging is
active based on whether the pg_mode variable was 0.

Unfortunately pg_mode is 0 in two situations:

  1) Paging is disabled (real mode)
  2) Paging is in 2-level paging mode (32bit without PAE)

That means the walker now assumed that 2-level paging mode was real
mode, breaking NetBSD as well as Windows XP.

To fix that, this patch adds a new PG flag to pg_mode which indicates
whether paging is active at all and uses that to determine whether we
are in real mode or not.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2654
Fixes: b56617bbcb ("target/i386: Walk NPT in guest real mode")
Signed-off-by: Alexander Graf <graf@amazon.com>
Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Link: https://lore.kernel.org/r/20241106154329.67218-1-graf@amazon.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-11-07 16:54:02 +01:00
..
alpha target/alpha: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:56 +00:00
arm target/arm: Enable FEAT_CMOW for -cpu max 2024-11-05 10:10:00 +00:00
avr target/avr: Use explicit little-endian LD/ST API 2024-10-15 12:13:59 -03:00
hexagon target/hexagon: Use explicit little-endian LD/ST API 2024-10-15 11:55:09 -03:00
hppa target/hppa: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:54 +00:00
i386 target/i386: Fix legacy page table walk 2024-11-07 16:54:02 +01:00
loongarch target/loongarch: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:54 +00:00
m68k target/m68k: Initialize float_status fields in gdb set/get functions 2024-11-05 10:09:54 +00:00
microblaze Misc HW patch queue 2024-11-06 17:28:45 +00:00
mips target-arm queue: 2024-11-05 21:27:18 +00:00
openrisc target/openrisc: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:57 +00:00
ppc target-arm queue: 2024-11-05 21:27:18 +00:00
riscv target/riscv: Fix vcompress with rvv_ta_all_1s 2024-10-31 13:51:24 +10:00
rx target/rx: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:57 +00:00
s390x target/s390x: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:54 +00:00
sh4 license: Update deprecated SPDX tag LGPL-2.0+ to LGPL-2.0-or-later 2024-09-20 10:11:59 +03:00
sparc target/sparc: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:55 +00:00
tricore target/tricore: Use tcg_constant_tl() instead of tcg_gen_movi_tl() 2024-10-15 12:13:59 -03:00
xtensa target/xtensa: Explicitly set 2-NaN propagation rule 2024-11-05 10:09:55 +00:00
Kconfig target/cris: Remove the deprecated CRIS target 2024-09-13 20:11:13 +02:00
meson.build target/cris: Remove the deprecated CRIS target 2024-09-13 20:11:13 +02:00