On Wed, Mar 18, 2026 at 11:38 AM Max Chou <[email protected]> wrote:
>
> This patchset fixes following issues in the RISC-V vector
> fault-only-first load implementation and the probe_pages helper
> function.
>
> 1. probe_pages flag handling:
>    When probing memory spanning two pages, probe_pages calls
>    probe_access_flags twice. The flags from the second page were
>    overwriting the first page's flags instead of being merged, causing
>    watchpoint and other TLB attributes to be lost.
>
> 2. vext_ldff cross-page logic:
>    The manual two-phase probing in vext_ldff had three issues:
>    a) Wrong condition: checked "env->vl > elems" instead of
>       "env->vl > elems + env->vstart", missing the vstart offset
>    b) Wrong address: used "addr + (elems << log2_esz)" instead of
>       "addr + page_split", probing incorrect addresses for segment
>       loads (nf > 1)
>    c) Wrong size: used "elems * msize" (first page size) instead of
>       calculating remaining size, potentially missing faults
>
>
> Patch 1 fixes the probe_pages helper to properly merge flags from both
> pages.
>
> Patch 2 fixes vext_ldff by replacing the buggy manual cross-page logic
> by a single probe_pages call with the correct total size. This
> leverages the infrastructure that probe_pages already provides for
> handling cross-page accesses automatically.
>
> rnax
>
>
> Max Chou (2):
>   target/riscv: rvv: Fix missing flags merge in probe_pages for
>     cross-page accesses
>   target/riscv: rvv: Fix page probe issues in vext_ldff

Thanks!

Applied to riscv-to-apply.next

Alistair

>
>  target/riscv/vector_helper.c | 23 +++++++----------------
>  1 file changed, 7 insertions(+), 16 deletions(-)
>
> --
> 2.43.7
>
>

Reply via email to