]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/i386: use separate MMU indexes for 32-bit accesses
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 2 Jan 2024 14:40:18 +0000 (15:40 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 21 Mar 2024 16:50:47 +0000 (19:50 +0300)
commit1ced8cd5413db0c11f1e0fe31c50c49ba863d7f8
tree7c9ef0e4163282259c6ce6481b24f1500f6f5122
parenta85b8ec8721af7a555804003d619ac8e03ed5337
target/i386: use separate MMU indexes for 32-bit accesses

Accesses from a 32-bit environment (32-bit code segment for instruction
accesses, EFER.LMA==0 for processor accesses) have to mask away the
upper 32 bits of the address.  While a bit wasteful, the easiest way
to do so is to use separate MMU indexes.  These days, QEMU anyway is
compiled with a fixed value for NB_MMU_MODES.  Split MMU_USER_IDX,
MMU_KSMAP_IDX and MMU_KNOSMAP_IDX in two.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 90f641531c782c873a05895f411c05fbbbef3c49)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: move changes for x86_cpu_mmu_index() to cpu_mmu_index() due to missing
 v8.2.0-1030-gace0c5fe59 "target/i386: Populate CPUClass.mmu_index")
target/i386/cpu.h
target/i386/tcg/sysemu/excp_helper.c