]> git.ipfire.org Git - thirdparty/qemu.git/commit
target-i386: mmu: fix handling of noncanonical virtual addresses
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Nov 2021 13:47:46 +0000 (14:47 +0100)
committerMichael Roth <michael.roth@amd.com>
Tue, 14 Dec 2021 20:19:00 +0000 (14:19 -0600)
commit3488bb205de0537ba5364ee1ee09cb07a26a4bb0
tree5be541cc1cff9b9177fbe268d6cb454e994eccb7
parentcddfaf96ab2a6772dd87998af699f91ca15facfd
target-i386: mmu: fix handling of noncanonical virtual addresses

mmu_translate is supposed to return an error code for page faults; it is
not able to handle other exceptions.  The #GP case for noncanonical
virtual addresses is not handled correctly, and incorrectly raised as
a page fault with error code 1.  Since it cannot happen for nested
page tables, move it directly to handle_mmu_fault, even before the
invocation of mmu_translate.

Fixes: #676
Fixes: 661ff4879e ("target/i386: extract mmu_translate", 2021-05-11)
Cc: qemu-stable@nongnu.org
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit b04dc92e013d55c9ac8082caefff45dcfb1310e7)
Signed-off-by: Michael Roth <michael.roth@amd.com>
target/i386/tcg/sysemu/excp_helper.c