riscvarchive / riscv-qemu

QEMU with RISC-V (RV64G, RV32G) Emulation Support
384 stars 154 forks source link

PMP NAPOT decoding bug #152

Closed dayeol closed 6 years ago

dayeol commented 6 years ago

According to the RISC-V priv. v1.10 ISA document and these slides, pmpaddr register stores (base_addr | (size/2 - 1)) >> 2 for a NAPOT-encoded address. However, the current code decodes (base_addr | (size - 1)) >> 3 which leads to a wrong base address and size. Splited PR #150

dayeol commented 6 years ago

@michaeljclark Can you review & merge? Thank you!