arch-riscv: be prepared for CSR changes during PT walk.
authorNils Asmussen <nils.asmussen@barkhauseninstitut.org>
Fri, 1 May 2020 08:27:01 +0000 (10:27 +0200)
committerNils Asmussen <nils.asmussen@barkhauseninstitut.org>
Sat, 2 May 2020 05:04:50 +0000 (05:04 +0000)
commit72e3c9687234405c45e52b09ed27fb9b871e78ab
tree488ac3ca063f3be83026e8855b8c800e70249788
parentaf1f3b35b0259d705830cc624a43e7936e137d1c
arch-riscv: be prepared for CSR changes during PT walk.

If the address space is changed (by writing to SATP), it can happen that
a page table walk is in progress. Previously, this failed if the ASID
changed, because we then used the wrong ASID for the lookup.

This commit makes sure that we don't access CSRs after the beginning of
the walk by loading SATP, STATUS, and PRV at the beginning.

Change-Id: I8c184c7ae7dd44d78e881bb5ec8d430dd480849c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28447
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/riscv/pagetable_walker.cc
src/arch/riscv/pagetable_walker.hh
src/arch/riscv/tlb.cc
src/arch/riscv/tlb.hh