[PATCH] lib: sbi: fix pmp_set: clear A befor setting
Anup Patel
anup at brainfault.org
Thu Nov 11 22:52:05 PST 2021
On Mon, Nov 8, 2021 at 3:13 PM Xiang W <wxjstz at 126.com> wrote:
>
> Signed-off-by: Xiang W <wxjstz at 126.com>
Overall patch looks good but I have updated the patch subject and
added a one line commit description.
Reviewed-by: Anup Patel <anup.patel at wdc.com>
Applied this patch to the riscv/opensbi repo
Thanks,
Anup
> ---
> lib/sbi/riscv_asm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/sbi/riscv_asm.c b/lib/sbi/riscv_asm.c
> index f6b8c8e..845039c 100644
> --- a/lib/sbi/riscv_asm.c
> +++ b/lib/sbi/riscv_asm.c
> @@ -255,6 +255,7 @@ int pmp_set(unsigned int n, unsigned long prot, unsigned long addr,
> return SBI_ENOTSUPP;
>
> /* encode PMP config */
> + prot &= ~PMP_A;
> prot |= (log2len == PMP_SHIFT) ? PMP_A_NA4 : PMP_A_NAPOT;
> cfgmask = ~(0xffUL << pmpcfg_shift);
> pmpcfg = (csr_read_num(pmpcfg_csr) & cfgmask);
> --
> 2.30.2
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
More information about the opensbi
mailing list