Skip to content

Commit 0c76e26

Browse files
authored
Merge pull request #823 from panciyan/riscv
target/riscv: leaf PTE check PTE_W missing
2 parents 15bb3e2 + 1479eca commit 0c76e26

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/target/riscv/riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ static int riscv_address_translate(struct target *target,
19841984
if (!(pte & PTE_V) || (!(pte & PTE_R) && (pte & PTE_W)))
19851985
return ERROR_FAIL;
19861986

1987-
if ((pte & PTE_R) || (pte & PTE_X)) /* Found leaf PTE. */
1987+
if ((pte & PTE_R) || (pte & PTE_W) || (pte & PTE_X)) /* Found leaf PTE. */
19881988
break;
19891989

19901990
i--;

0 commit comments

Comments
 (0)