When probe_pages probes a memory region that spans two pages, it calls probe_access_flags twice - once for each page. However, the flags from the second page probe were overwriting the flags from the first page instead of being merged together.
Signed-off-by: Max Chou <[email protected]> --- target/riscv/vector_helper.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 3334662dcd..a74ce70943 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -265,9 +265,9 @@ static void probe_pages(CPURISCVState *env, target_ulong addr, target_ulong len, addr += curlen; curlen = len - curlen; if (flags != NULL) { - *flags = probe_access_flags(env, adjust_addr(env, addr), curlen, - access_type, mmu_index, nonfault, - host, ra); + *flags |= probe_access_flags(env, adjust_addr(env, addr), curlen, + access_type, mmu_index, nonfault, + host, ra); } else { probe_access(env, adjust_addr(env, addr), curlen, access_type, mmu_index, ra); @@ -275,7 +275,6 @@ static void probe_pages(CPURISCVState *env, target_ulong addr, target_ulong len, } } - static inline void vext_set_elem_mask(void *v0, int index, uint8_t value) { -- 2.43.7
