diff options
author | panciyan <panciyan@eswincomputing.com> | 2023-03-23 02:45:42 +0000 |
---|---|---|
committer | panciyan <panciyan@eswincomputing.com> | 2023-03-23 02:45:42 +0000 |
commit | 1479eca38f15f7655eb21b1d6c330e10229bb805 (patch) | |
tree | b63c866ea1b4fd94335f27fdbd9e0f1eea222350 | |
parent | a01bd76e5c10eba8bc3481eb7552fb8feab79f91 (diff) | |
download | riscv-openocd-1479eca38f15f7655eb21b1d6c330e10229bb805.zip riscv-openocd-1479eca38f15f7655eb21b1d6c330e10229bb805.tar.gz riscv-openocd-1479eca38f15f7655eb21b1d6c330e10229bb805.tar.bz2 |
target/riscv: leaf PTE check PTE_W missing
When permission bits R, W, and X in PTE all three are zero,
the PTE is a pointter to the next level of the page table;
otherwise, it is a leaf PTE. Here PTE_W is missed.
Change-Id: I82a4cc4e64280f0fcad75b20e51b617520aff29b
Signed-off-by: panciyan <panciyan@eswincomputing.com>
-rw-r--r-- | src/target/riscv/riscv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 3c91526..7f05b0c 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1975,7 +1975,7 @@ static int riscv_address_translate(struct target *target, if (!(pte & PTE_V) || (!(pte & PTE_R) && (pte & PTE_W))) return ERROR_FAIL; - if ((pte & PTE_R) || (pte & PTE_X)) /* Found leaf PTE. */ + if ((pte & PTE_R) || (pte & PTE_W) || (pte & PTE_X)) /* Found leaf PTE. */ break; i--; |