OSDN Git Service

target/riscv: Smepmp: Skip applying default rules when address matches
authorHimanshu Chauhan <hchauhan@ventanamicro.com>
Thu, 9 Feb 2023 05:52:06 +0000 (11:22 +0530)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 23 Feb 2023 22:21:32 +0000 (14:21 -0800)
commit90b1fafce0602d46243a40d8eea3006ef57e24d8
treebfe39568f3b84d3ec735641f8092f90eaf860fa7
parenta3ae8d46c04364148a6ea814140dff3b9b29ba1b
target/riscv: Smepmp: Skip applying default rules when address matches

When MSECCFG.MML is set, after checking the address range in PMP if the
asked permissions are not same as programmed in PMP, the default
permissions are applied. This should only be the case when there
is no matching address is found.

This patch skips applying default rules when matching address range
is found. It returns the index of the match PMP entry.

Fixes: 824cac681c3 (target/riscv: Fix PMP propagation for tlb)
Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230209055206.229392-1-hchauhan@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
target/riscv/pmp.c