Skip to content

Commit

Permalink
updating pmp setup macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ved-rivos committed Aug 4, 2023
1 parent 826dbdc commit 0102159
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
12 changes: 8 additions & 4 deletions riscv-test-suite/env/test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -987,18 +987,22 @@ RVTEST_SIGUPD_F(swreg,destreg,flagreg)
#define SETUP_PMP_SVADU_TEST(swreg, offset, TR0, TR1, TR2) \
li TR0, -1 ;\
csrw pmpaddr0, TR0 ;\
j PMP_exist ;\
li TR0, 0 ;\
li TR1, 0 ;\
j Mend_PMP ;\
PMP_exist: ;\
li TR1, PMP_TOR | PMP_X | PMP_W | PMP_R ;\
csrw pmpcfg0, TR1 ;\
csrr TR2, pmpcfg0 ;\
RVTEST_SIGUPD(x1,TR0,offset) ;\
RVTEST_SIGUPD(x1,TR1,offset) ;\
beq TR1, TR2, M1 ;\
beq TR1, TR2, Mend_PMP ;\
no_TOR_try_NAPOT: ;\
li TR1, PMP_NAPOT | PMP_X | PMP_W | PMP_R ;\
csrw pmpcfg0, TR1 ;\
csrr TR2, pmpcfg0 ;\
Mend_PMP: ;\
RVTEST_SIGUPD(x1,TR0,offset) ;\
RVTEST_SIGUPD(x1,TR1,offset) ;\
M1:

#define TEST_SVADU(swreg, PTE_ADDR, VA, offset, menvcfgaddr, hade_bit) \
sfence.vma ;\
Expand Down
2 changes: 0 additions & 2 deletions riscv-test-suite/rv32i_m/Svadu/src/svadu_sv32.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ RVTEST_CODE_BEGIN

# Setup PMP to cover 4G of address space
SETUP_PMP_SVADU_TEST(x1, offset, t0, t1, t2)
bne t1, t2, 1f

# Identity map the page_4k
la t1, page_4k
Expand All @@ -37,7 +36,6 @@ RVTEST_CODE_BEGIN

# test svadu
TEST_SVADU(x1, s2, page_4k, offset, 0x31a, MENVCFGH_HADE)
1:
RVMODEL_HALT

#endif
Expand Down
2 changes: 0 additions & 2 deletions riscv-test-suite/rv64i_m/Svadu/src/svadu_sv39.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ RVTEST_CODE_BEGIN

# Setup PMP to cover 4G of address space
SETUP_PMP_SVADU_TEST(x1, offset, t0, t1, t2)
bne t1, t2, 1f

# Idenity map the page_4k
la t1, page_4k
Expand All @@ -37,7 +36,6 @@ RVTEST_CODE_BEGIN

# test svadu
TEST_SVADU(x1, s2, page_4k, offset, 0x30a, MENVCFG_HADE)
1:
RVMODEL_HALT
#endif
RVTEST_CODE_END
Expand Down
2 changes: 0 additions & 2 deletions riscv-test-suite/rv64i_m/Svadu/src/svadu_sv48.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ RVTEST_CODE_BEGIN

# Setup PMP to cover 4G of address space
SETUP_PMP_SVADU_TEST(x1, offset, t0, t1, t2)
bne t1, t2, 1f

# Identity map the page_4k
la t1, page_4k
Expand All @@ -37,7 +36,6 @@ RVTEST_CODE_BEGIN

# test svadu
TEST_SVADU(x1, s2, page_4k, offset, 0x30a, MENVCFG_HADE)
1:
RVMODEL_HALT
#endif
RVTEST_CODE_END
Expand Down
2 changes: 0 additions & 2 deletions riscv-test-suite/rv64i_m/Svadu/src/svadu_sv57.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ RVTEST_CODE_BEGIN

# Setup PMP to cover 4G of address space
SETUP_PMP_SVADU_TEST(x1, offset, t0, t1, t2)
bne t1, t2, 1f

# Identity map the page_4k
la t1, page_4k
Expand All @@ -37,7 +36,6 @@ RVTEST_CODE_BEGIN

# test svadu
TEST_SVADU(x1, s2, page_4k, offset, 0x30a, MENVCFG_HADE)
1:
RVMODEL_HALT
#endif
RVTEST_CODE_END
Expand Down

0 comments on commit 0102159

Please sign in to comment.