Sandipan Das has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/40945 )

Change subject: arch-power: Fix process initialization
......................................................................

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 <sandi...@linux.ibm.com>
---
M src/arch/power/process.cc
1 file changed, 4 insertions(+), 0 deletions(-)



diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc
index 735b3d9..ea1972d 100644
--- a/src/arch/power/process.cc
+++ b/src/arch/power/process.cc
@@ -332,6 +332,10 @@
     //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;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40945
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If7c5af9a93283a53717cc8cbba4bf373a7e40560
Gerrit-Change-Number: 40945
Gerrit-PatchSet: 1
Gerrit-Owner: Sandipan Das <sandi...@linux.ibm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to