target/i386: Fix test for paging enabled
commit03a60ae9cac546d05b076676491ed1606f9d9066
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 2 Nov 2022 09:12:32 +0000 (2 20:12 +1100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 2 Nov 2022 11:35:16 +0000 (2 12:35 +0100)
treef93e2c71360faac4783d80626e5a774be90b049c
parenteff3de52f265df39c6fc668415ad317ec1f24051
target/i386: Fix test for paging enabled

If CR0.PG is unset, pg_mode will be zero, but it will also be zero
for non-PAE/non-PSE page tables with CR0.WP=0.  Restore the
correct test for paging enabled.

Fixes: 98281984a37 ("target/i386: Add MMU_PHYS_IDX and MMU_NESTED_IDX")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1269
Reported-by: Andreas Gustafsson <gson@gson.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221102091232.1092552-1-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/sysemu/excp_helper.c