Message ID | 7f73b830a03e6aa603d044c8642972e9eefcd3b2.1464153942.git.riku.voipio@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/linux-user/main.c b/linux-user/main.c index 1f604a7..aa6b414 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2983,6 +2983,13 @@ void cpu_loop(CPUMBState *env) env->regs[10], 0, 0); env->regs[3] = ret; + /* All syscall exits result in guest r14 being equal to the + * PC we return to, because the kernel syscall exit "rtbd" does + * this. (This is true even for sigreturn(); note that r14 is + * not a userspace-usable register, as the kernel may clobber it + * at any point.) + */ + env->regs[14] = env->sregs[SR_PC]; break; case EXCP_HW_EXCP: env->regs[17] = env->sregs[SR_PC] + 4;