Giacomo Travaglini has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/50667 )

Change subject: arch-arm: SCTLR.WXN not used in S2AP
......................................................................

arch-arm: SCTLR.WXN not used in S2AP

Change-Id: I141f7088fce0e7eed01491920f84774394143b4a
Signed-off-by: Giacomo Travaglini <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50667
Reviewed-by: Andreas Sandberg <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/arm/mmu.cc
1 file changed, 11 insertions(+), 11 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/arm/mmu.cc b/src/arch/arm/mmu.cc
index 4cd1a67..96d0bc4 100644
--- a/src/arch/arm/mmu.cc
+++ b/src/arch/arm/mmu.cc
@@ -547,11 +547,10 @@
     // In stage 2 we use the hypervisor access permission bits.
     // The following permissions are described in ARM DDI 0487A.f
     // D4-1802
-    uint8_t hap = te->hap & 0b11;
     bool grant = false;
-    bool grant_read = hap & 0b1;
+    bool grant_read = te->hap & 0b01;
+    bool grant_write = te->hap & 0b10;

-    bool wxn = state.sctlr.wxn;
     uint8_t xn =  te->xn;
     uint8_t pxn = te->pxn;

@@ -560,19 +559,20 @@
         xn = true;
     }

- DPRINTF(TLBVerbose, "Checking S2 permissions: hap:%d, xn:%d, pxn:%d, r:%d, "
-                        "w:%d, x:%d, wxn: %d\n", hap, xn,
-                        pxn, r, w, x, wxn);
+    DPRINTF(TLBVerbose,
+            "Checking S2 permissions: hap:%d, xn:%d, pxn:%d, r:%d, "
+            "w:%d, x:%d\n", te->hap, xn, pxn, r, w, x);

     if (x) {
-        // sctlr.wxn overrides the xn bit
-        grant = !wxn && !xn;
+        grant = grant_read && !xn;
     } else if (req->isAtomic()) {
-        grant = hap;
+        grant = grant_read || grant_write;
     } else if (w) {
-        grant = hap & 0b10;
-    } else { // is_read
+        grant = grant_write;
+    } else if (r) {
         grant = grant_read;
+    } else {
+        panic("Invalid Operation\n");
     }

     return std::make_pair(grant, grant_read);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50667
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: I141f7088fce0e7eed01491920f84774394143b4a
Gerrit-Change-Number: 50667
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to