target/riscv: rvv: Fix missing flags merge in probe_pages for cross-page accesses
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 <max.chou@sifive.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20260318013805.1920377-2-max.chou@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Max Chou committed
Mar 18, 2026 at 09:38 UTC
556817773849f7ed6709672759e406217261db97
1 file changed
+3
-4
target/riscv/vector_helper.c
+3
-4
@@ -151,9 +151,9 @@ static void probe_pages(CPURISCVState *env, target_ulong addr, target_ulong len,
151
addr += curlen;
152
curlen = len - curlen;
153
if (flags != NULL) {
154
- *flags = probe_access_flags(env, adjust_addr(env, addr), curlen,
155
- access_type, mmu_index, nonfault,
156
- host, ra);
154
+ *flags |= probe_access_flags(env, adjust_addr(env, addr), curlen,
155
+ access_type, mmu_index, nonfault,
156
+ host, ra);
157
} else {
158
probe_access(env, adjust_addr(env, addr), curlen, access_type,
159
mmu_index, ra);
@@ -161,7 +161,6 @@ static void probe_pages(CPURISCVState *env, target_ulong addr, target_ulong len,
161
}
162
}
163
164
-
164
static inline void vext_set_elem_mask(void *v0, int index,
165
uint8_t value)
166
{