qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Brian Cain <brian.cain@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: brian.cain@oss.qualcomm.com, richard.henderson@linaro.org,
	philmd@linaro.org, matheus.bernardino@oss.qualcomm.com,
	ale@rev.ng, anjo@rev.ng, marco.liebel@oss.qualcomm.com,
	ltaylorsimpson@gmail.com, alex.bennee@linaro.org,
	quic_mburton@quicinc.com, sid.manning@oss.qualcomm.com
Subject: [PATCH v2 4/4] tests/tcg/hexagon: Add cs{0,1} coverage
Date: Thu,  9 Oct 2025 12:59:43 -0700	[thread overview]
Message-ID: <20251009195943.438454-5-brian.cain@oss.qualcomm.com> (raw)
In-Reply-To: <20251009195943.438454-1-brian.cain@oss.qualcomm.com>

Cover cs0,1 register corruption in the signal_context test case.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 tests/tcg/hexagon/signal_context.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/tests/tcg/hexagon/signal_context.c b/tests/tcg/hexagon/signal_context.c
index 7202fa64b6..00bbb3efc7 100644
--- a/tests/tcg/hexagon/signal_context.c
+++ b/tests/tcg/hexagon/signal_context.c
@@ -26,7 +26,11 @@ void sig_user(int sig, siginfo_t *info, void *puc)
         "p1 = r7\n\t"
         "p2 = r7\n\t"
         "p3 = r7\n\t"
-        : : : "r7", "p0", "p1", "p2", "p3");
+        "r6 = #0x12345678\n\t"
+        "cs0 = r6\n\t"
+        "r6 = #0x87654321\n\t"
+        "cs1 = r6\n\t"
+        : : : "r6", "r7", "p0", "p1", "p2", "p3");
 }
 
 int main()
@@ -52,7 +56,11 @@ int main()
     it.it_value.tv_nsec = 100000;
     timer_settime(tid, 0, &it, NULL);
 
-    asm("loop0(1f, %1)\n\t"
+    asm("r9 = #0xdeadbeef\n\t"
+        "   cs0 = r9\n\t"
+        "   r9 = #0xbadc0fee\n\t"
+        "   cs1 = r9\n\t"
+        "   loop0(1f, %1)\n\t"
         "1: r8 = #0xff\n\t"
         "   p0 = r8\n\t"
         "   p1 = r8\n\t"
@@ -74,10 +82,18 @@ int main()
         "   r8 = p3\n\t"
         "   p0 = cmp.eq(r8, #0xff)\n\t"
         "   if (!p0) jump 2b\n\t"
+        "   r8 = cs0\n\t"
+        "   r9 = #0xdeadbeef\n\t"
+        "   p0 = cmp.eq(r8, r9)\n\t"
+        "   if (!p0) jump 2b\n\t"
+        "   r8 = cs1\n\t"
+        "   r9 = #0xbadc0fee\n\t"
+        "   p0 = cmp.eq(r8, r9)\n\t"
+        "   if (!p0) jump 2b\n\t"
         "4: {}: endloop0\n\t"
         :
         : "r"(&err), "r"(i)
-        : "memory", "r8", "p0", "p1", "p2", "p3");
+        : "memory", "r8", "r9", "p0", "p1", "p2", "p3");
 
     puts(err ? "FAIL" : "PASS");
     return err;
-- 
2.34.1


  parent reply	other threads:[~2025-10-09 20:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-09 19:59 [PATCH v2 0/4] hexagon: Fixes to sigcontext Brian Cain
2025-10-09 19:59 ` [PATCH v2 1/4] linux-user/hexagon: Fix sigcontext Brian Cain
2025-10-09 21:36   ` Taylor Simpson
2025-10-09 19:59 ` [PATCH v2 2/4] linux-user/hexagon: use abi_ulong Brian Cain
2025-10-09 20:22   ` Philippe Mathieu-Daudé
2025-10-09 21:37     ` Taylor Simpson
2025-10-09 19:59 ` [PATCH v2 3/4] linux-user/hexagon: Use an array for GPRs Brian Cain
2025-10-09 20:22   ` Philippe Mathieu-Daudé
2025-10-09 21:38   ` Taylor Simpson
2025-10-09 19:59 ` Brian Cain [this message]
2025-10-09 21:40   ` [PATCH v2 4/4] tests/tcg/hexagon: Add cs{0,1} coverage Taylor Simpson
2025-10-09 20:07 ` [PATCH v2 0/4] hexagon: Fixes to sigcontext Richard Henderson

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=20251009195943.438454-5-brian.cain@oss.qualcomm.com \
    --to=brian.cain@oss.qualcomm.com \
    --cc=ale@rev.ng \
    --cc=alex.bennee@linaro.org \
    --cc=anjo@rev.ng \
    --cc=ltaylorsimpson@gmail.com \
    --cc=marco.liebel@oss.qualcomm.com \
    --cc=matheus.bernardino@oss.qualcomm.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_mburton@quicinc.com \
    --cc=richard.henderson@linaro.org \
    --cc=sid.manning@oss.qualcomm.com \
    /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).