RISC-V: Implement existential predicates for CSRs
commita88365c1991525321e7d4787db611980637e93d4
authorMichael Clark <mjc@sifive.com>
Fri, 4 Jan 2019 23:24:14 +0000 (4 23:24 +0000)
committerPalmer Dabbelt <palmer@sifive.com>
Wed, 9 Jan 2019 18:00:56 +0000 (9 10:00 -0800)
treeb796ff870eb30aabeab44a706e7331fe129af0e9
parent71877e29696b10b6cf69faa1009dd0ec3202741e
RISC-V: Implement existential predicates for CSRs

CSR predicate functions are added to the CSR table.
mstatus.FS and counter enable checks are moved
to predicate functions and two new predicates are
added to check misa.S for s* CSRs and a new PMP
CPU feature for pmp* CSRs.

Processors that don't implement S-mode will trap
on access to s* CSRs and processors that don't
implement PMP will trap on accesses to pmp* CSRs.

PMP checks are disabled in riscv_cpu_handle_mmu_fault
when the PMP CPU feature is not present.

Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
target/riscv/cpu.c
target/riscv/cpu.h
target/riscv/cpu_helper.c
target/riscv/csr.c