From nobody Fri Jun 17 19:29:07 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B9DA884791A; Fri, 17 Jun 2022 19:29:10 +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 4LPpxx0kdwz3H3F; Fri, 17 Jun 2022 19:29:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WeFdy2bPiv5sPHxtHJay08cA/NbVwbJ7S1lzg+eeMHs=; b=ZZDHdZpUezMwkkOz4NCFx6CvKu/LyNhDf0Y1ol6YOqWp08hleXZBKJmWrhisbLhGjkx5/G WBRwNnkUINs9nAPZeFg2YTHTM5l2pvnC37Et9EuzSNORjB5LacYCq1OFpdyFkkv202rQH5 vqh2GNxOBkgwssvoOOdY50qJh2pRH9rozyIEDvhOeaLM02n/BX80AB6VwCAK6rhykcyBlW I5+lxq8aX8HOrMZJrXq1YxDLNPKRwlwljFrqtaDXOx6U5DyoI+jA1/vPJaNEfZKODE8l/2 eC7o2m6mYc4GI54JCEH6M0SNgx7pyoOuR8SDZ39E+CJ8glHfyfjqhiieSobkGQ== 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 D7FA92554C; Fri, 17 Jun 2022 19:29:07 +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 25HJT78U096992; Fri, 17 Jun 2022 19:29:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJT7T1096991; Fri, 17 Jun 2022 19:29:07 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:29:07 GMT Message-Id: <202206171929.25HJT7T1096991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 27c31bdac578 - stable/13 - linux(4): optimize ksiginfo to siginfo conversion. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 27c31bdac5781d884e99f470a8f8c84d6e3f546d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WeFdy2bPiv5sPHxtHJay08cA/NbVwbJ7S1lzg+eeMHs=; b=qNqrnda/FJDvb3edSyaDH1szoAO33KNfU7/fleVbPw8+wBbqO2XshjzYkIyyDa/f/dbEho HfM8ENBINOJBknkThM8uXZ0eTcxSjxLHZNHq44r6Nb/rORt9kBCml3NjR0vXNlqCmKsIIk t9UHTZ7U5Kbg5D28iw7pQXIksHmNhFWBaR8XAzBm6lxBEffn9CAQsMwZsbbxzVC8N/DymP WvUOF2KoCJQ70Wsj08RsI79v5QAKH2go3ojZ9RwVdWnq13tgEbRQZvhsRywsoentS+JPU5 IxRSaLXvCQW0Ud3mGPV767q9q1gdM7NurIZ65AAHYXXsrnlfcrZFXegrrkUiaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494149; a=rsa-sha256; cv=none; b=N0EHC8T1dmSf7KLMe55YCyS1yq0Bs1rdw8eobAHHuor4H3Qgny3N3Texlmq3X7cXG4gblm +Wyiyl8ZVd/z2QpiKQWOj969++QuJAFvSunmt00QMlDuslJh3Bv/1+UPDVM79DPzyZkbnO 8+Fq8weYly075hNDwio6DmG5hqu7gz+41F3ian1RSi+Xw/pHKtxaSkoW2bTnPTHVDr08OP HSRJLD9fBstlf7Gc8VpPowX+xgP4FHrol5RaELFJd4I9CmdvGZ018toW3U9fXIBQ0jx35D /ddXMukRQeGGbzFoZFlwKD63SBEmU8t5cIiGifvm81a6VGutg0nSjDTfpP+2Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=27c31bdac5781d884e99f470a8f8c84d6e3f546d commit 27c31bdac5781d884e99f470a8f8c84d6e3f546d Author: Dmitry Chagin AuthorDate: 2021-06-07 03:06:17 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:28:00 +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 (cherry picked from commit f4e801085b055fd33f680dd7cb9f8562d236f39a) --- 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 174292527e37..6ed694dc8af9 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -660,7 +660,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 d007f6ad7b77..cce0c8261a84 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 467d2810a228..8c41d724c0b9 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -403,8 +403,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); @@ -424,16 +424,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; @@ -547,13 +547,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 fbfafeee71cd..ed7223f3681a 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -426,7 +426,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 ??? */