diff mbox series

[v3,4/9] target/arm: Fix exception case in allocation_tag_mem_probe

Message ID 20240617062849.3531745-5-gustavo.romero@linaro.org
State Superseded
Headers show
Series Add MTE stubs for aarch64 user mode | expand

Commit Message

Gustavo Romero June 17, 2024, 6:28 a.m. UTC
If page in 'ptr_access' is inaccessible and probe is 'true'
allocation_tag_mem_probe should not throw an exception, but currently it
does, so fix it.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
---
 target/arm/tcg/mte_helper.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Henderson June 21, 2024, 4:28 a.m. UTC | #1
On 6/16/24 23:28, Gustavo Romero wrote:
> If page in 'ptr_access' is inaccessible and probe is 'true'
> allocation_tag_mem_probe should not throw an exception, but currently it
> does, so fix it.
> 
> Signed-off-by: Gustavo Romero<gustavo.romero@linaro.org>
> Reviewed-by: Alex Bennée<alex.bennee@linaro.org>
> ---
>   target/arm/tcg/mte_helper.c | 3 +++
>   1 file changed, 3 insertions(+)

Oops.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c
index 037ac6dd60..a50d576294 100644
--- a/target/arm/tcg/mte_helper.c
+++ b/target/arm/tcg/mte_helper.c
@@ -96,6 +96,9 @@  static uint8_t *allocation_tag_mem_probe(CPUARMState *env, int ptr_mmu_idx,
     assert(!(probe && ra));
 
     if (!(flags & (ptr_access == MMU_DATA_STORE ? PAGE_WRITE_ORG : PAGE_READ))) {
+        if (probe) {
+            return NULL;
+        }
         cpu_loop_exit_sigsegv(env_cpu(env), ptr, ptr_access,
                               !(flags & PAGE_VALID), ra);
     }