target/riscv: Use a smaller guess size for no-MMU PMP
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Bin Meng <bin.meng@windriver.com>
This commit is contained in:
parent
cc4112605e
commit
1145188e09
@ -233,12 +233,16 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size == 0) {
|
||||||
|
if (riscv_feature(env, RISCV_FEATURE_MMU)) {
|
||||||
/*
|
/*
|
||||||
* if size is unknown (0), assume that all bytes
|
* If size is unknown (0), assume that all bytes
|
||||||
* from addr to the end of the page will be accessed.
|
* from addr to the end of the page will be accessed.
|
||||||
*/
|
*/
|
||||||
if (size == 0) {
|
|
||||||
pmp_size = -(addr | TARGET_PAGE_MASK);
|
pmp_size = -(addr | TARGET_PAGE_MASK);
|
||||||
|
} else {
|
||||||
|
pmp_size = sizeof(target_ulong);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
pmp_size = size;
|
pmp_size = size;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user