qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Romero <gustavo.romero@linaro.org>
To: qemu-devel@nongnu.org, alex.bennee@linaro.org,
	richard.henderson@linaro.org
Cc: philmd@linaro.org, peter.maydell@linaro.org, gustavo.romero@linaro.org
Subject: [PATCH v4 4/9] target/arm: Fix exception case in allocation_tag_mem_probe
Date: Mon, 24 Jun 2024 05:30:41 +0000	[thread overview]
Message-ID: <20240624053046.221802-5-gustavo.romero@linaro.org> (raw)
In-Reply-To: <20240624053046.221802-1-gustavo.romero@linaro.org>

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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/tcg/mte_helper.c | 3 +++
 1 file changed, 3 insertions(+)

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);
     }
-- 
2.34.1



  parent reply	other threads:[~2024-06-24  5:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24  5:30 [PATCH v4 0/9] Add MTE stubs for aarch64 user mode Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 1/9] gdbstub: Clean up process_string_cmd Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 2/9] gdbstub: Move GdbCmdParseEntry into a new header file Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 3/9] gdbstub: Add support for target-specific stubs Gustavo Romero
2024-06-24  5:30 ` Gustavo Romero [this message]
2024-06-24  5:30 ` [PATCH v4 5/9] target/arm: Make some MTE helpers widely available Gustavo Romero
2024-06-24  7:47   ` Philippe Mathieu-Daudé
2024-06-25 14:14     ` Philippe Mathieu-Daudé
2024-06-27  4:42     ` Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 6/9] target/arm: Factor out code for setting MTE TCF0 field Gustavo Romero
2024-06-24  7:48   ` Philippe Mathieu-Daudé
2024-06-24  5:30 ` [PATCH v4 7/9] gdbstub: Make get cpu and hex conversion functions non-internal Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 8/9] gdbstub: Add support for MTE in user mode Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 9/9] tests/tcg/aarch64: Add MTE gdbstub tests Gustavo Romero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240624053046.221802-5-gustavo.romero@linaro.org \
    --to=gustavo.romero@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).