From 9f053a87bc9ce3afbdaf5e808f98eed5a8229887 Mon Sep 17 00:00:00 2001 From: Eiji Yoshiya Date: Sat, 3 Feb 2024 09:23:09 +0900 Subject: If Svnapot is not implemented, skip the test. If Svnapot is not implemented, a page fault will occur when accessing a page with napot specified. In this case, let the test pass. --- isa/rv64ssvnapot/napot.S | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/isa/rv64ssvnapot/napot.S b/isa/rv64ssvnapot/napot.S index 92d2b49..fbc4014 100644 --- a/isa/rv64ssvnapot/napot.S +++ b/isa/rv64ssvnapot/napot.S @@ -121,6 +121,7 @@ RVTEST_CODE_BEGIN # Do a store to MY_VA li a0, MY_VA li a1, 42 +napot_store: sw a1, (a0) # Clear MPRV @@ -153,6 +154,16 @@ RVTEST_CODE_BEGIN .align 2 .global mtvec_handler mtvec_handler: + # Skip if Svnapot is not implemented. + csrr t5, mcause + li t6, CAUSE_STORE_PAGE_FAULT + bne t5, t6, die + csrr t5, mepc + la t6, napot_store + bne t5, t6, die + csrr t5, mtval + li t6, MY_VA + beq t5, t6, pass die: RVTEST_FAIL -- cgit v1.1