]> www.infradead.org Git - users/dwmw2/qemu.git/commit
target/riscv: Fix the PMP is locked check when using TOR
authorAlistair Francis <alistair.francis@wdc.com>
Mon, 19 Apr 2021 06:16:25 +0000 (16:16 +1000)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 11 May 2021 10:02:06 +0000 (20:02 +1000)
commit94c6ba83c1a1e45558bd32421b85233053a1c6f3
treea6c52823f9505937855564b37b9411521de7347a
parent0924a423baa227fa8fb363232c20a997cb6f617b
target/riscv: Fix the PMP is locked check when using TOR

The RISC-V spec says:
    if PMP entry i is locked and pmpicfg.A is set to TOR, writes to
    pmpaddri-1 are ignored.

The current QEMU code ignores accesses to pmpaddri-1 and pmpcfgi-1 which
is incorrect.

Update the pmp_is_locked() function to not check the supporting fields
and instead enforce the lock functionality in the pmpaddr write operation.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-id: 2831241458163f445a89bd59c59990247265b0c6.1618812899.git.alistair.francis@wdc.com
target/riscv/pmp.c