Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/53266 )
Change subject: arch-arm: Allow EL2 trapping of secure AA32 instructions
......................................................................
arch-arm: Allow EL2 trapping of secure AA32 instructions
With the introduction of FEAT_SEL2 we should allow trapping
to EL2 in secure mode. This is already implemented for AArch64
EL1. With this patch we are extending it to AArch32
Change-Id: I3551a93af7db0b1d2bdf0935c3a29e39e8db55f8
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
---
M src/arch/arm/utility.cc
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc
index 3cc4b43..d24f470 100644
--- a/src/arch/arm/utility.cc
+++ b/src/arch/arm/utility.cc
@@ -519,14 +519,12 @@
uint32_t opc2;
bool trap_to_hyp = false;
- const CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
const HCR hcr = tc->readMiscReg(MISCREG_HCR);
- const SCR scr = tc->readMiscReg(MISCREG_SCR);
const HDCR hdcr = tc->readMiscReg(MISCREG_HDCR);
const HSTR hstr = tc->readMiscReg(MISCREG_HSTR);
const HCPTR hcptr = tc->readMiscReg(MISCREG_HCPTR);
- if (!inSecureState(scr, cpsr) && (cpsr.mode != MODE_HYP)) {
+ if (EL2Enabled(tc) && (currEL(tc) < EL2)) {
mcrMrcIssExtract(iss, is_read, crm, rt, crn, opc1, opc2);
trap_to_hyp = ((uint32_t) hstr) & (1 << crn);
trap_to_hyp |= hdcr.tpm && (crn == 9) && (crm >= 12);
@@ -674,8 +672,6 @@
uint32_t opc1;
uint32_t opc2;
- const CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
- const SCR scr = tc->readMiscReg(MISCREG_SCR);
const HCR hcr = tc->readMiscReg(MISCREG_HCR);
const HDCR hdcr = tc->readMiscReg(MISCREG_HDCR);
const HSTR hstr = tc->readMiscReg(MISCREG_HSTR);
@@ -683,7 +679,7 @@
bool trap_to_hyp = false;
- if (!inSecureState(scr, cpsr) && (cpsr.mode != MODE_HYP)) {
+ if (EL2Enabled(tc) && (currEL(tc) < EL2)) {
mcrMrcIssExtract(iss, is_read, crm, rt, crn, opc1, opc2);
inform("trap check M:%x N:%x 1:%x 2:%x hdcr %x, hcptr %x,
hstr %x\n",
crm, crn, opc1, opc2, hdcr, hcptr, hstr);
@@ -743,12 +739,10 @@
bool is_read;
bool trap_to_hyp = false;
- const CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
const HCR hcr = tc->readMiscReg(MISCREG_HCR);
- const SCR scr = tc->readMiscReg(MISCREG_SCR);
const HSTR hstr = tc->readMiscReg(MISCREG_HSTR);
- if (!inSecureState(scr, cpsr) && (cpsr.mode != MODE_HYP)) {
+ if (EL2Enabled(tc) && (currEL(tc) < EL2)) {
// This is technically the wrong function, but we can re-use it for
// the moment because we only need one field, which overlaps with
the
// mcrmrc layout
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53266
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: I3551a93af7db0b1d2bdf0935c3a29e39e8db55f8
Gerrit-Change-Number: 53266
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.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