From 0162444014fd9ddb235ae4734aecdd84167bdd55 Mon Sep 17 00:00:00 2001 From: Yinan Xu Date: Tue, 11 Jul 2023 19:21:35 +0800 Subject: [PATCH] PTW: set ae_ptw for out-of-range non-leaf PTEs (#3407) For PTEs whose physical address is out-of-range, we need to set `ae_ptw` instead of `ae_final` to raise access-fault. Because non-leaf PTEs will not have R or X bits set, `ae_final` will be overrided by page-fault exceptions. (cherry picked from commit b8dad7f5a73396f95e68a4dd2b4bdab171ba28e5) --- src/main/scala/rocket/PTW.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/rocket/PTW.scala b/src/main/scala/rocket/PTW.scala index b8c5f08a80e..484b06c9238 100644 --- a/src/main/scala/rocket/PTW.scala +++ b/src/main/scala/rocket/PTW.scala @@ -720,6 +720,7 @@ class PTW(n: Int)(implicit edge: TLEdgeOut, p: Parameters) extends CoreModule()( resp_valid(r_req_dest) := true.B } + resp_ae_ptw := ae && count < (pgLevels-1).U && pte.table() resp_ae_final := ae resp_pf := pf && !stage2 resp_gf := gf || (pf && stage2)