From: Benjamin Berg <benjamin@sipsolutions.net>
To: linux-um@lists.infradead.org
Cc: Benjamin Berg <benjamin.berg@intel.com>
Subject: [PATCH v7 1/7] um: Add generic stub_syscall1 function
Date: Thu, 4 Jul 2024 18:27:11 +0200 [thread overview]
Message-ID: <20240704162717.1417338-2-benjamin@sipsolutions.net> (raw)
In-Reply-To: <20240704162717.1417338-1-benjamin@sipsolutions.net>
From: Benjamin Berg <benjamin.berg@intel.com>
The 64bit version did not have a stub_syscall1 function yet. Add it as
it will be useful to implement a static binary for stub loading.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
---
arch/x86/um/shared/sysdep/stub_64.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/x86/um/shared/sysdep/stub_64.h b/arch/x86/um/shared/sysdep/stub_64.h
index 67f44284f1aa..8e4ff39dcade 100644
--- a/arch/x86/um/shared/sysdep/stub_64.h
+++ b/arch/x86/um/shared/sysdep/stub_64.h
@@ -28,6 +28,17 @@ static __always_inline long stub_syscall0(long syscall)
return ret;
}
+static __always_inline long stub_syscall1(long syscall, long arg1)
+{
+ long ret;
+
+ __asm__ volatile (__syscall
+ : "=a" (ret)
+ : "0" (syscall), "D" (arg1) : __syscall_clobber );
+
+ return ret;
+}
+
static __always_inline long stub_syscall2(long syscall, long arg1, long arg2)
{
long ret;
--
2.45.2
next prev parent reply other threads:[~2024-07-04 16:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 16:27 [PATCH v7 0/7] Increased address space for 64 bit Benjamin Berg
2024-07-04 16:27 ` Benjamin Berg [this message]
2024-07-04 16:27 ` [PATCH v7 2/7] um: use execveat to create userspace MMs Benjamin Berg
2024-07-04 16:49 ` Johannes Berg
2024-07-04 17:39 ` Benjamin Berg
2024-07-04 16:27 ` [PATCH v7 3/7] um: Fix stub_start address calculation Benjamin Berg
2024-07-04 16:27 ` [PATCH v7 4/7] um: Limit TASK_SIZE to the addressable range Benjamin Berg
2024-07-04 16:27 ` [PATCH v7 5/7] um: Discover host_task_size from envp Benjamin Berg
2024-07-04 16:27 ` [PATCH v7 6/7] um: clear all memory in new userspace processes Benjamin Berg
2024-07-04 16:50 ` Johannes Berg
2024-07-04 16:27 ` [PATCH v7 7/7] um: Add 4 level page table support Benjamin Berg
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=20240704162717.1417338-2-benjamin@sipsolutions.net \
--to=benjamin@sipsolutions.net \
--cc=benjamin.berg@intel.com \
--cc=linux-um@lists.infradead.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