arch-power: Fix process initialization

During process initialization, special purpose registers
should either be explicitly set or cleared. These contain
flag bits which might have unforseen side effects on the
execution of a program.

Change-Id: If7c5af9a93283a53717cc8cbba4bf373a7e40560
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40945
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Sandipan Das
2021-02-06 17:39:59 +05:30
committed by Boris Shingarov
parent 480effb522
commit 6b37a7e02c

View File

@@ -338,6 +338,10 @@ PowerProcess::argsInit(int pageSize)
//Set the stack pointer register
tc->setIntReg(StackPointerReg, stack_min);
//Reset the special-purpose registers
for (int i = 0; i < NumIntSpecialRegs; i++)
tc->setIntReg(NumIntArchRegs + i, 0);
//Set the machine status for a typical userspace
Msr msr = 0;
msr.sf = is64bit;