From owner-svn-src-head@freebsd.org Mon Nov 26 20:56:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32768114442B; Mon, 26 Nov 2018 20:56:07 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C96556ABAB; Mon, 26 Nov 2018 20:56:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9127112BE; Mon, 26 Nov 2018 20:56:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQKu64J022545; Mon, 26 Nov 2018 20:56:06 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQKu6q2022542; Mon, 26 Nov 2018 20:56:06 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811262056.wAQKu6q2022542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 26 Nov 2018 20:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340996 - in head/sys: amd64/amd64 amd64/ia32 i386/i386 kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 i386/i386 kern X-SVN-Commit-Revision: 340996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C96556ABAB X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.28)[0.285,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 20:56:07 -0000 Author: vangyzen Date: Mon Nov 26 20:56:05 2018 New Revision: 340996 URL: https://svnweb.freebsd.org/changeset/base/340996 Log: Remove superfluous bzero in getcontext/swapcontext/sendsig We zero the whole structure; we don't need to zero the __spare__ field again. Remove trailing whitespace. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/i386/i386/machdep.c head/sys/kern/kern_context.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/amd64/amd64/machdep.c Mon Nov 26 20:56:05 2018 (r340996) @@ -392,7 +392,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase; bzero(sf.sf_uc.uc_mcontext.mc_spare, sizeof(sf.sf_uc.uc_mcontext.mc_spare)); - bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/amd64/ia32/ia32_signal.c Mon Nov 26 20:56:05 2018 (r340996) @@ -266,7 +266,6 @@ freebsd32_getcontext(struct thread *td, struct freebsd PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; PROC_UNLOCK(td->td_proc); - bzero(&uc.__spare__, sizeof(uc.__spare__)); ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); } return (ret); @@ -276,7 +275,7 @@ int freebsd32_setcontext(struct thread *td, struct freebsd32_setcontext_args *uap) { struct ia32_ucontext uc; - int ret; + int ret; if (uap->ucp == NULL) ret = EINVAL; @@ -297,7 +296,7 @@ int freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args *uap) { struct ia32_ucontext uc; - int ret; + int ret; if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; @@ -622,7 +621,6 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t fpstate_drop(td); sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase; sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase; - bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/i386/i386/machdep.c Mon Nov 26 20:56:05 2018 (r340996) @@ -645,7 +645,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask sdp->sd_lobase; bzero(sf.sf_uc.uc_mcontext.mc_spare2, sizeof(sf.sf_uc.uc_mcontext.mc_spare2)); - bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && Modified: head/sys/kern/kern_context.c ============================================================================== --- head/sys/kern/kern_context.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/kern/kern_context.c Mon Nov 26 20:56:05 2018 (r340996) @@ -75,7 +75,6 @@ sys_getcontext(struct thread *td, struct getcontext_ar PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; PROC_UNLOCK(td->td_proc); - bzero(uc.__spare__, sizeof(uc.__spare__)); ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); } return (ret); @@ -85,7 +84,7 @@ int sys_setcontext(struct thread *td, struct setcontext_args *uap) { ucontext_t uc; - int ret; + int ret; if (uap->ucp == NULL) ret = EINVAL; @@ -106,14 +105,13 @@ int sys_swapcontext(struct thread *td, struct swapcontext_args *uap) { ucontext_t uc; - int ret; + int ret; if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { bzero(&uc, sizeof(ucontext_t)); get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); - bzero(uc.__spare__, sizeof(uc.__spare__)); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; PROC_UNLOCK(td->td_proc);