From owner-dev-commits-src-all@freebsd.org Sun Jun 6 15:06:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62B31638589; Sun, 6 Jun 2021 15:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyfw92HFbz3DHv; Sun, 6 Jun 2021 15:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 321192555C; Sun, 6 Jun 2021 15:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156F6HtB000529; Sun, 6 Jun 2021 15:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156F6H0D000528; Sun, 6 Jun 2021 15:06:17 GMT (envelope-from git) Date: Sun, 6 Jun 2021 15:06:17 GMT Message-Id: <202106061506.156F6H0D000528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: f4e801085b05 - main - linux(4): optimize ksiginfo to siginfo conversion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4e801085b055fd33f680dd7cb9f8562d236f39a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 15:06:17 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f4e801085b055fd33f680dd7cb9f8562d236f39a commit f4e801085b055fd33f680dd7cb9f8562d236f39a Author: Dmitry Chagin AuthorDate: 2021-06-07 03:06:17 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-07 03:06:17 +0000 linux(4): optimize ksiginfo to siginfo conversion. Retire ksiginfo_to_lsiginfo function, use siginfo_to_lsiginfo instead. Convert rt_sigtimedwait siginfo variables to well known names. MFC after: 2 weeks --- sys/amd64/linux/linux_sysvec.c | 2 +- sys/amd64/linux32/linux32_sysvec.c | 2 +- sys/compat/linux/linux_signal.c | 21 +++++++-------------- sys/compat/linux/linux_signal.h | 1 - sys/i386/linux/linux_sysvec.c | 2 +- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index a04cddeb3c71..02225e63072d 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -666,7 +666,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sf.sf_handler = catcher; /* Fill in POSIX parts. */ - ksiginfo_to_lsiginfo(ksi, &sf.sf_si, sig); + siginfo_to_lsiginfo(&ksi->ksi_info, &sf.sf_si, sig); /* Copy the sigframe out to the user's stack. */ if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 86402035ff5a..05354803cf03 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -298,7 +298,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) frame.sf_ucontext = PTROUT(&fp->sf_sc); /* Fill in POSIX parts. */ - ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); + siginfo_to_lsiginfo(&ksi->ksi_info, &frame.sf_si, sig); /* * Build the signal context to be used by sigreturn and libgcc unwind. diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 02abfe961e6b..5310895cb92c 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -398,8 +398,8 @@ linux_rt_sigtimedwait(struct thread *td, struct l_timespec lts; l_sigset_t lset; sigset_t bset; - l_siginfo_t linfo; - ksiginfo_t info; + l_siginfo_t lsi; + ksiginfo_t ksi; if (args->sigsetsize != sizeof(l_sigset_t)) return (EINVAL); @@ -419,16 +419,16 @@ linux_rt_sigtimedwait(struct thread *td, } else tsa = NULL; - error = kern_sigtimedwait(td, bset, &info, tsa); + error = kern_sigtimedwait(td, bset, &ksi, tsa); if (error) return (error); - sig = bsd_to_linux_signal(info.ksi_signo); + sig = bsd_to_linux_signal(ksi.ksi_signo); if (args->ptr) { - memset(&linfo, 0, sizeof(linfo)); - ksiginfo_to_lsiginfo(&info, &linfo, sig); - error = copyout(&linfo, args->ptr, sizeof(linfo)); + memset(&lsi, 0, sizeof(lsi)); + siginfo_to_lsiginfo(&ksi.ksi_info, &lsi, sig); + error = copyout(&lsi, args->ptr, sizeof(lsi)); } if (error == 0) td->td_retval[0] = sig; @@ -542,13 +542,6 @@ linux_tkill(struct thread *td, struct linux_tkill_args *args) return (linux_do_tkill(td, tdt, &ksi)); } -void -ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig) -{ - - siginfo_to_lsiginfo(&ksi->ksi_info, lsi, sig); -} - static void sicode_to_lsicode(int si_code, int *lsi_code) { diff --git a/sys/compat/linux/linux_signal.h b/sys/compat/linux/linux_signal.h index bb34613fa2be..f434ab1b1b35 100644 --- a/sys/compat/linux/linux_signal.h +++ b/sys/compat/linux/linux_signal.h @@ -44,7 +44,6 @@ #define LINUX_SI_TKILL -6 /* sent by tkill system call */ int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *); -void ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig); void siginfo_to_lsiginfo(const siginfo_t *si, l_siginfo_t *lsi, l_int sig); int lsiginfo_to_siginfo(struct thread *td, const l_siginfo_t *lsi, siginfo_t *si, int sig); diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index ef845675aaa4..0e6ad4b5c137 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -430,7 +430,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) frame.sf_ucontext = &fp->sf_sc; /* Fill in POSIX parts. */ - ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); + siginfo_to_lsiginfo(&ksi->ksi_info, &frame.sf_si, sig); /* Build the signal context to be used by sigreturn. */ frame.sf_sc.uc_flags = 0; /* XXX ??? */