From: Sandipan Das Date: Sat, 6 Feb 2021 12:09:59 +0000 (+0530) Subject: arch-power: Fix process initialization X-Git-Tag: develop-gem5-snapshot~6 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=326ddb5e688b05b8a95582117ddda2027d0f7b84;p=gem5.git arch-power: Fix process initialization 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 --- diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc index 735b3d9de..ea1972de3 100644 --- a/src/arch/power/process.cc +++ b/src/arch/power/process.cc @@ -332,6 +332,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 < NumMiscRegs; i++) + tc->setMiscRegNoEffect(i, 0); + //Set the machine status for a typical userspace Msr msr = 0; msr.sf = is64bit;