During process initialization, special purpose registers,
represented as misc 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>
//Set the stack pointer register
tc->setIntReg(StackPointerReg, stack_min);
+ //Reset the special-purpose registers
+ for (int i = 0; i < NumMiscRegs; i++)
+ tc->setMiscRegNoEffect(i, 0);
+
//Set the machine status for a typical userspace
Msr msr = 0;
msr.sf = is64bit;