arch-riscv: Fixed a bug in pmp.cc
This commit fixes an issue that allowed illegal accesses to the pmpTable to take place. Change-Id: If517d0d9579260a8dd8a8d2e0c673564a649a728 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49870 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Melissa Jost
parent
526f5271d8
commit
737cdd7397
@@ -92,8 +92,8 @@ PMP::pmpCheck(const RequestPtr &req, BaseMMU::Mode mode,
|
||||
match_index = i;
|
||||
}
|
||||
|
||||
if ((PMP_OFF != pmpGetAField(pmpTable[match_index].pmpCfg))
|
||||
&& (match_index > -1)) {
|
||||
if ((match_index > -1)
|
||||
&& (PMP_OFF != pmpGetAField(pmpTable[match_index].pmpCfg))) {
|
||||
// check the RWX permissions from the pmp entry
|
||||
uint8_t allowed_privs = PMP_READ | PMP_WRITE | PMP_EXEC;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user