target/i386: only include bits in pg_mode if they are not ignored
commit991ec97625e1281ba22bd81426a7226a76baf60a
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Feb 2022 14:42:06 +0000 (25 15:42 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 15 Mar 2022 10:26:20 +0000 (15 11:26 +0100)
treed30558e13ba3207b9f2b7a6886c43d89e512b4fc
parentdef4c5570c44cc775c47e6d8503e4d12868f53aa
target/i386: only include bits in pg_mode if they are not ignored

LA57/PKE/PKS is only relevant in 64-bit mode, and NXE is only relevant if
PAE is in use.  Since there is code that checks PG_MODE_LA57 to determine
the canonicality of addresses, make sure that the bit is not set by
mistake in 32-bit mode.  While it would not be a problem because 32-bit
addresses by definition fit in both 48-bit and 57-bit address spaces,
it is nicer if get_pg_mode() actually returns whether a feature is enabled,
and it allows a few simplifications in the page table walker.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/sysemu/excp_helper.c