diff options
author | Andrew Waterman <andrew@sifive.com> | 2018-12-02 17:11:49 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2018-12-02 17:11:49 -0800 |
commit | f579c48e909acf34c053a15ff1e79f82024a28bb (patch) | |
tree | 7f7fe0be18e0a9716fe6e2137d21e99ab69073b3 | |
parent | e12593841af47b6b15c7de63804342ef87f271ce (diff) | |
download | riscv-pk-f579c48e909acf34c053a15ff1e79f82024a28bb.zip riscv-pk-f579c48e909acf34c053a15ff1e79f82024a28bb.tar.gz riscv-pk-f579c48e909acf34c053a15ff1e79f82024a28bb.tar.bz2 |
Revert "Avoid writing reserved values to pmpaddr CSR"
This reverts commit 7bee30c1ff56975041ffc67cd0170d7477aba865.
All ones is no longer "reserved", so the old code is OK.
-rw-r--r-- | machine/minit.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/machine/minit.c b/machine/minit.c index 4eee256..fe106eb 100644 --- a/machine/minit.c +++ b/machine/minit.c @@ -192,14 +192,13 @@ static inline void setup_pmp(void) // Set up a PMP to permit access to all of memory. // Ignore the illegal-instruction trap if PMPs aren't supported. uintptr_t pmpc = PMP_NAPOT | PMP_R | PMP_W | PMP_X; - uintptr_t pmpa = ((uintptr_t)1 << (__riscv_xlen == 32 ? 31 : 53)) - 1; asm volatile ("la t0, 1f\n\t" "csrrw t0, mtvec, t0\n\t" "csrw pmpaddr0, %1\n\t" "csrw pmpcfg0, %0\n\t" ".align 2\n\t" "1: csrw mtvec, t0" - : : "r" (pmpc), "r" (pmpa) : "t0"); + : : "r" (pmpc), "r" (-1UL) : "t0"); } void enter_supervisor_mode(void (*fn)(uintptr_t), uintptr_t arg0, uintptr_t arg1) |