RISC-V: Improve page table walker spec compliance
commitc3b03e5800a7151d3c746f40efceabdfdae08f85
authorMichael Clark <mjc@sifive.com>
Sun, 4 Mar 2018 20:27:28 +0000 (5 09:27 +1300)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 4 Sep 2018 20:19:23 +0000 (4 13:19 -0700)
tree0f9711fffef25b426df4b0b2398b393f5571b68d
parent718a941e19005492015ae7aa5db04d853b5af877
RISC-V: Improve page table walker spec compliance

- Inline PTE_TABLE check for better readability
- Change access checks from ternary operator to if
- Improve readibility of User page U mode and SUM test
- Disallow non U mode from fetching from User pages
- Add reserved PTE flag check: W or W|X
- Add misaligned PPN check
- Set READ protection for PTE X flag and mstatus.mxr
- Use memory_region_is_ram in pte update

Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu_bits.h
target/riscv/helper.c