Skip to content

Commit ab8a672

Browse files
committed
fix: instruction guest-page fault in pmp
The PMP module was checking mock physical addresses from the instruction cache address transaltion requests in the case of instruction guest-page faults. This is is incorrect as the instruction guest-page fault takes precedence and the physical address is not meaningful if the translation did not succeed.
1 parent fccad66 commit ab8a672

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/pmp/src/pmp_data_if.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ module pmp_data_if
8282
// fault, therefore do not change the exception type in case of double
8383
// exception
8484
if (icache_areq_i.fetch_valid) begin
85-
if (icache_areq_o.fetch_exception.cause != riscv::INSTR_PAGE_FAULT) begin
85+
if (icache_areq_o.fetch_exception.cause != riscv::INSTR_PAGE_FAULT
86+
!(CVA6Cfg.RVH && icache_areq_o.fetch_exception.cause == riscv::INSTR_GUEST_PAGE_FAULT)) begin
8687
if (!match_any_execute_region || !pmp_if_allow) begin
8788
icache_areq_o.fetch_exception.cause = riscv::INSTR_ACCESS_FAULT;
8889
icache_areq_o.fetch_exception.valid = 1'b1;

0 commit comments

Comments
 (0)