From: Andreas Sandberg Date: Wed, 9 Jan 2019 14:51:33 +0000 (+0000) Subject: sim-se: Correctly calculate next PC in clone X-Git-Tag: v19.0.0.0~1284 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=13daa2e0620e71a1c11f94d1f8a864f73a52b94d;p=gem5.git sim-se: Correctly calculate next PC in clone The clone syscall doesn't propagate all state in the PCState object when calculating the return PC of a newly created process. Instead of creating a new PCState object from the next PC address, copy the old PC and advance it. Change-Id: Ice53831920bcb5d198865169ed2cca8d06e37cfe Signed-off-by: Andreas Sandberg Cc: Giacomo Travaglini Cc: Javier Setoain Cc: Brandon Potter Reviewed-on: https://gem5-review.googlesource.com/c/15417 Reviewed-by: Jason Lowe-Power Maintainer: Brandon Potter --- diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 1ff046033..8480c7e94 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1402,7 +1402,9 @@ cloneFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc) ctc->setIntReg(TheISA::SyscallPseudoReturnReg, 1); #endif - ctc->pcState(tc->nextInstAddr()); + TheISA::PCState cpc = tc->pcState(); + cpc.advance(); + ctc->pcState(cpc); ctc->activate(); return cp->pid();