# Try a faulting store to make sure dirty bit is not set
li TESTNUM, 2
li t2, 1
- sw t2, dummy - DRAM_BASE, t1
+ sw t2, dummy - DRAM_BASE, a0
# Set SUM=1 so user memory access is permitted
li TESTNUM, 3
bnez t0, die
# Try a non-faulting store to make sure dirty bit is set
- sw t2, dummy - DRAM_BASE, t1
+ sw t2, dummy - DRAM_BASE, a0
# Make sure it succeeded
lw t0, dummy - DRAM_BASE
# Make sure D bit is set
lw t0, page_table_1
- li t1, PTE_A | PTE_D
- and t0, t0, t1
- bne t0, t1, die
+ li a0, PTE_A | PTE_D
+ and t0, t0, a0
+ bne t0, a0, die
RVTEST_PASS
1:
li t1, 3
bne TESTNUM, t1, 1f
- # The implementation doesn't appear to set D bits in HW. Skip the test,
- # after making sure the D bit is clear.
+ # The implementation doesn't appear to set D bits in HW.
+ # Make sure the D bit really is clear.
lw t0, page_table_1
and t1, t0, PTE_D
bnez t1, die
- j pass
+ # Set the D bit.
+ or t0, t0, PTE_D
+ sw t0, page_table_1, t1
+ sfence.vma
+ mret
1:
die: