[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.0.5 65/66] target/riscv/pmp.c: respect mseccfg.RLB for pmpaddr
From: |
Michael Tokarev |
Subject: |
[Stable-8.0.5 65/66] target/riscv/pmp.c: respect mseccfg.RLB for pmpaddrX changes |
Date: |
Wed, 13 Sep 2023 16:17:46 +0300 |
From: Leon Schuermann <leons@opentitan.org>
When the rule-lock bypass (RLB) bit is set in the mseccfg CSR, the PMP
configuration lock bits must not apply. While this behavior is
implemented for the pmpcfgX CSRs, this bit is not respected for
changes to the pmpaddrX CSRs. This patch ensures that pmpaddrX CSR
writes work even on locked regions when the global rule-lock bypass is
enabled.
Signed-off-by: Leon Schuermann <leons@opentitan.org>
Reviewed-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20230829215046.1430463-1-leon@is.currently.online>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 4e3adce1244e1ca30ec05874c3eca14911dc0825)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index a08cd95658..bcb4baa0a2 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -45,6 +45,10 @@ static inline uint8_t pmp_get_a_field(uint8_t cfg)
*/
static inline int pmp_is_locked(CPURISCVState *env, uint32_t pmp_index)
{
+ /* mseccfg.RLB is set */
+ if (MSECCFG_RLB_ISSET(env)) {
+ return 0;
+ }
if (env->pmp_state.pmp[pmp_index].cfg_reg & PMP_LOCK) {
return 1;
--
2.39.2
- [Stable-8.0.5 12/66] pnv_lpc: disable reentrancy detection for lpc-hc, (continued)
- [Stable-8.0.5 12/66] pnv_lpc: disable reentrancy detection for lpc-hc, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 57/66] arm64: Restore trapless ptimer access, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 56/66] virtio: Drop out of coroutine context in virtio_load(), Michael Tokarev, 2023/09/13
- [Stable-8.0.5 58/66] hw/char/riscv_htif: Fix printing of console characters on big endian hosts, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 59/66] hw/char/riscv_htif: Fix the console syscall on big endian hosts, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 60/66] hw/intc: Fix upper/lower mtime write calculation, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 61/66] hw/intc: Make rtc variable names consistent, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 62/66] linux-user/riscv: Use abi type for target_ucontext, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 63/66] hw/riscv: virt: Fix riscv,pmu DT node path, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 64/66] target/riscv: fix satp_mode_finalize() when satp_mode.supported = 0, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 65/66] target/riscv/pmp.c: respect mseccfg.RLB for pmpaddrX changes,
Michael Tokarev <=
- [Stable-8.0.5 66/66] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option, Michael Tokarev, 2023/09/13
- Re: [Stable-8.0.5 00/66] v2 Patch Round-up for stable 8.0.5, freeze on 2023-09-19, Kevin Wolf, 2023/09/13