Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Feb 2022 15:53:50 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 20daa209e449 - stable/13 - linux: implement set_upcall on aarch64
Message-ID:  <202202171553.21HFro1v022228@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by trasz:

URL: https://cgit.FreeBSD.org/src/commit/?id=20daa209e4499bb0ba84f75d6fa8dc709fe14624

commit 20daa209e4499bb0ba84f75d6fa8dc709fe14624
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-06-15 12:01:02 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2022-02-14 00:08:11 +0000

    linux: implement set_upcall on aarch64
    
    This fixes "git diff" (git-1:2.25.1-1ubuntu3).
    
    Sponsored By:   EPSRC
    Differential Revision:  https://reviews.freebsd.org/D30509
    
    (cherry picked from commit e505c3066bbdb96dd28ff4634a315346490b9b33)
---
 sys/arm64/linux/linux_machdep.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c
index 711ccb4fd63d..80597a2922a7 100644
--- a/sys/arm64/linux/linux_machdep.c
+++ b/sys/arm64/linux/linux_machdep.c
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
 LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
 
 /* DTrace probes */
-LIN_SDT_PROBE_DEFINE0(machdep, linux_set_upcall, todo);
 LIN_SDT_PROBE_DEFINE0(machdep, linux_mmap2, todo);
 LIN_SDT_PROBE_DEFINE0(machdep, linux_rt_sigsuspend, todo);
 LIN_SDT_PROBE_DEFINE0(machdep, linux_sigaltstack, todo);
@@ -84,13 +83,19 @@ linux_execve(struct thread *td, struct linux_execve_args *uap)
 	return (error);
 }
 
-/* LINUXTODO: implement (or deduplicate) arm64 linux_set_upcall */
 int
 linux_set_upcall(struct thread *td, register_t stack)
 {
 
-	LIN_SDT_PROBE0(machdep, linux_set_upcall, todo);
-	return (EDOOFUS);
+	if (stack)
+		td->td_frame->tf_sp = stack;
+
+	/*
+	 * The newly created Linux thread returns
+	 * to the user space by the same path that a parent does.
+	 */
+	td->td_frame->tf_x[0] = 0;
+	return (0);
 }
 
 /* LINUXTODO: deduplicate arm64 linux_mmap2 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202202171553.21HFro1v022228>