aboutsummaryrefslogtreecommitdiff
path: root/target/i386/tcg/system/excp_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'target/i386/tcg/system/excp_helper.c')
-rw-r--r--target/i386/tcg/system/excp_helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/i386/tcg/system/excp_helper.c b/target/i386/tcg/system/excp_helper.c
index 50040f6..f622b5d 100644
--- a/target/i386/tcg/system/excp_helper.c
+++ b/target/i386/tcg/system/excp_helper.c
@@ -592,7 +592,8 @@ static bool get_physical_address(CPUX86State *env, vaddr addr,
if (sext != 0 && sext != -1) {
*err = (TranslateFault){
.exception_index = EXCP0D_GPF,
- .cr2 = addr,
+ /* non-canonical #GP doesn't change CR2 */
+ .cr2 = env->cr[2],
};
return false;
}