linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: houdek.ryan@fex-emu.org
To: unlisted-recipients:; (no To-header on input)
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Ryan Houdek <Houdek.Ryan@fex-emu.org>
Subject: [PATCH 4/4] arm64: tools: Update syscall user dispatch tests
Date: Sat, 29 May 2021 01:16:20 -0700	[thread overview]
Message-ID: <20210529081620.164422-5-Houdek.Ryan@fex-emu.org> (raw)
In-Reply-To: <20210529081620.164422-1-Houdek.Ryan@fex-emu.org>

From: Ryan Houdek <Houdek.Ryan@fex-emu.org>

This is a fairly trivial change to support syscall user dispatch in
these selftests.

One of the tests is relying on the syscall to return the syscall number
in the return. Which is a byproduct from the scnum and return registers
being the same.
Since arm64 places the scnum in x8 and the return in x0 it just needs to
move the result over.

Signed-off-by: Ryan Houdek <Houdek.Ryan@fex-emu.org>
---
 .../selftests/syscall_user_dispatch/sud_benchmark.c      | 2 +-
 tools/testing/selftests/syscall_user_dispatch/sud_test.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c b/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c
index 073a03702ff5..6059abe75cb3 100644
--- a/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c
+++ b/tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c
@@ -41,7 +41,7 @@
  * out of the box, but don't enable them until they support syscall user
  * dispatch.
  */
-#if defined(__x86_64__) || defined(__i386__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
 #define TEST_BLOCKED_RETURN
 #endif
 
diff --git a/tools/testing/selftests/syscall_user_dispatch/sud_test.c b/tools/testing/selftests/syscall_user_dispatch/sud_test.c
index b5d592d4099e..11cf4ad6aa6e 100644
--- a/tools/testing/selftests/syscall_user_dispatch/sud_test.c
+++ b/tools/testing/selftests/syscall_user_dispatch/sud_test.c
@@ -150,6 +150,15 @@ int si_errno;
 
 static void handle_sigsys(int sig, siginfo_t *info, void *ucontext)
 {
+#ifdef __aarch64__
+	/* This test expects the syscall number will be returned in r0
+	 * Copy it over from r8 which is the scnum in the ABI
+	 */
+	ucontext_t *_context = (ucontext_t *)ucontext;
+
+	_context->uc_mcontext.regs[0] = _context->uc_mcontext.regs[8];
+#endif
+
 	si_code = info->si_code;
 	si_errno = info->si_errno;
 
-- 
2.30.2


      parent reply	other threads:[~2021-05-29  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-29  8:16 [PATCH 0/4] arm64: Implement userspace syscall dispatch houdek.ryan
2021-05-29  8:16 ` [PATCH 1/4] Move userspace syscall dispatch outside of common entry houdek.ryan
2021-06-02 15:41   ` Thomas Gleixner
2021-06-03 10:58     ` Ryan Houdek
2021-05-29  8:16 ` [PATCH 2/4] arm64: Track the sigreturn landing pad location houdek.ryan
2021-05-29  8:16 ` [PATCH 3/4] arm64: Enable userspace syscall dispatch houdek.ryan
2021-05-29  8:16 ` houdek.ryan [this message]

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=20210529081620.164422-5-Houdek.Ryan@fex-emu.org \
    --to=houdek.ryan@fex-emu.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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).