Yu-hsin Wang has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/64653?usp=email )
Change subject: fastmodel: correct CPSR information for checking currEL
......................................................................
fastmodel: correct CPSR information for checking currEL
In the previous CL[1], currEL wouldn't access CPSR through TC. For
passing correct CPSR to currEL, we need to update the way to call currEL
in fastmodel. Same story happens to isSecure. So this change also update
isSecure to reuse the CPSR value from TC.
1: https://gem5-review.googlesource.com/c/public/gem5/+/53624
Change-Id: Ieffac55057e4870cd96139fc309ad0b138d607de
---
M src/arch/arm/fastmodel/CortexA76/thread_context.cc
M src/arch/arm/utility.cc
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/arch/arm/fastmodel/CortexA76/thread_context.cc
b/src/arch/arm/fastmodel/CortexA76/thread_context.cc
index 672f3b7..443795a 100644
--- a/src/arch/arm/fastmodel/CortexA76/thread_context.cc
+++ b/src/arch/arm/fastmodel/CortexA76/thread_context.cc
@@ -51,7 +51,8 @@
{
// Determine what memory spaces are currently active.
Iris::CanonicalMsn in_msn;
- switch (ArmISA::currEL(this)) {
+ ArmISA::CPSR cpsr = readMiscRegNoEffect(ArmISA::MISCREG_CPSR);
+ switch (ArmISA::currEL(cpsr)) {
case ArmISA::EL3:
in_msn = Iris::SecureMonitorMsn;
break;
diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc
index eb2a9f5..bdd26e4 100644
--- a/src/arch/arm/utility.cc
+++ b/src/arch/arm/utility.cc
@@ -74,7 +74,7 @@
isSecure(ThreadContext *tc)
{
CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
- if (ArmSystem::haveEL(tc, EL3) && !cpsr.width && currEL(tc) == EL3)
+ if (ArmSystem::haveEL(tc, EL3) && !cpsr.width && currEL(cpsr) == EL3)
return true;
if (ArmSystem::haveEL(tc, EL3) && cpsr.width && cpsr.mode == MODE_MON)
return true;
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/64653?usp=email
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: Ieffac55057e4870cd96139fc309ad0b138d607de
Gerrit-Change-Number: 64653
Gerrit-PatchSet: 1
Gerrit-Owner: Yu-hsin Wang <yuhsi...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org