Commit 5568177738 for qemu.org
commit 556817773849f7ed6709672759e406217261db97
Author: Max Chou <max.chou@sifive.com>
Date: Wed Mar 18 09:38:04 2026 +0800
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>
diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index caa8dd9c12..e60248d6d3 100644
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -151,9 +151,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);
@@ -161,7 +161,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)
{