From owner-svn-src-stable@freebsd.org Sun Feb 26 10:53:04 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 310B3CED4D8; Sun, 26 Feb 2017 10:53:04 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id D2C7CB14; Sun, 26 Feb 2017 10:53:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1QAr2oo060478; Sun, 26 Feb 2017 10:53:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1QAr2OH060474; Sun, 26 Feb 2017 10:53:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702261053.v1QAr2OH060474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 26 Feb 2017 10:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314296 - in stable/11/sys: amd64/amd64 arm/arm i386/i386 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 10:53:04 -0000 Author: kib Date: Sun Feb 26 10:53:02 2017 New Revision: 314296 URL: https://svnweb.freebsd.org/changeset/base/314296 Log: MFC r313933, r313939, r313966: Microoptimize pmap_protect_pde() on amd64, i386 and pmap_protect_pte1() on armv6. Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/arm/arm/pmap-v6.c stable/11/sys/i386/i386/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Sun Feb 26 09:48:18 2017 (r314295) +++ stable/11/sys/amd64/amd64/pmap.c Sun Feb 26 10:53:02 2017 (r314296) @@ -4015,12 +4015,12 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t anychanged = FALSE; retry: oldpde = newpde = *pde; - if (oldpde & PG_MANAGED) { + if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); va < eva; va += PAGE_SIZE, m++) - if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) - vm_page_dirty(m); + vm_page_dirty(m); } if ((prot & VM_PROT_WRITE) == 0) newpde &= ~(PG_RW | PG_M); Modified: stable/11/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/11/sys/arm/arm/pmap-v6.c Sun Feb 26 09:48:18 2017 (r314295) +++ stable/11/sys/arm/arm/pmap-v6.c Sun Feb 26 10:53:02 2017 (r314296) @@ -4806,12 +4806,11 @@ pmap_protect_pte1(pmap_t pmap, pt1_entry ("%s: sva is not 1mpage aligned", __func__)); opte1 = npte1 = pte1_load(pte1p); - if (pte1_is_managed(opte1)) { + if (pte1_is_managed(opte1) && pte1_is_dirty(opte1)) { eva = sva + PTE1_SIZE; for (va = sva, m = PHYS_TO_VM_PAGE(pte1_pa(opte1)); va < eva; va += PAGE_SIZE, m++) - if (pte1_is_dirty(opte1)) - vm_page_dirty(m); + vm_page_dirty(m); } if ((prot & VM_PROT_WRITE) == 0) npte1 |= PTE1_RO | PTE1_NM; Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Sun Feb 26 09:48:18 2017 (r314295) +++ stable/11/sys/i386/i386/pmap.c Sun Feb 26 10:53:02 2017 (r314296) @@ -3146,12 +3146,12 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t anychanged = FALSE; retry: oldpde = newpde = *pde; - if (oldpde & PG_MANAGED) { + if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); va < eva; va += PAGE_SIZE, m++) - if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) - vm_page_dirty(m); + vm_page_dirty(m); } if ((prot & VM_PROT_WRITE) == 0) newpde &= ~(PG_RW | PG_M); From owner-svn-src-stable@freebsd.org Sun Feb 26 10:58:02 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77C37CED5C9; Sun, 26 Feb 2017 10:58:02 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 447C1C9A; Sun, 26 Feb 2017 10:58:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1QAw1eR060732; Sun, 26 Feb 2017 10:58:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1QAw1fV060731; Sun, 26 Feb 2017 10:58:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702261058.v1QAw1fV060731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 26 Feb 2017 10:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314297 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 10:58:02 -0000 Author: kib Date: Sun Feb 26 10:58:01 2017 New Revision: 314297 URL: https://svnweb.freebsd.org/changeset/base/314297 Log: MFC r313688: Switch copyout_map() to use vm_mmap_object() instead of vm_mmap(). Modified: stable/11/sys/kern/subr_uio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_uio.c ============================================================================== --- stable/11/sys/kern/subr_uio.c Sun Feb 26 10:53:02 2017 (r314296) +++ stable/11/sys/kern/subr_uio.c Sun Feb 26 10:58:01 2017 (r314297) @@ -468,10 +468,11 @@ copyout_map(struct thread *td, vm_offset /* round size up to page boundary */ size = (vm_size_t)round_page(sz); - - error = vm_mmap(&vms->vm_map, addr, size, VM_PROT_READ | VM_PROT_WRITE, - VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); - + if (size == 0) + return (EINVAL); + error = vm_mmap_object(&vms->vm_map, addr, size, VM_PROT_READ | + VM_PROT_WRITE, VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, NULL, 0, + FALSE, td); return (error); } From owner-svn-src-stable@freebsd.org Sun Feb 26 11:02:15 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3223CED810; Sun, 26 Feb 2017 11:02:15 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 7F221165; Sun, 26 Feb 2017 11:02:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1QB2EsL064576; Sun, 26 Feb 2017 11:02:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1QB2Eqd064574; Sun, 26 Feb 2017 11:02:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702261102.v1QB2Eqd064574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 26 Feb 2017 11:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314298 - in stable/11/sys: fs/devfs kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 11:02:15 -0000 Author: kib Date: Sun Feb 26 11:02:14 2017 New Revision: 314298 URL: https://svnweb.freebsd.org/changeset/base/314298 Log: MFC r313967: Apply noexec mount option for mmap(PROT_EXEC). PR: 217062 Modified: stable/11/sys/fs/devfs/devfs_vnops.c stable/11/sys/kern/vfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/11/sys/fs/devfs/devfs_vnops.c Sun Feb 26 10:58:01 2017 (r314297) +++ stable/11/sys/fs/devfs/devfs_vnops.c Sun Feb 26 11:02:14 2017 (r314298) @@ -1789,9 +1789,11 @@ devfs_mmap_f(struct file *fp, vm_map_t m * compatible. */ mp = vp->v_mount; - if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0) + if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0) { maxprot = VM_PROT_NONE; - else + if ((prot & VM_PROT_EXECUTE) != 0) + return (EACCES); + } else maxprot = VM_PROT_EXECUTE; if ((fp->f_flag & FREAD) != 0) maxprot |= VM_PROT_READ; Modified: stable/11/sys/kern/vfs_vnops.c ============================================================================== --- stable/11/sys/kern/vfs_vnops.c Sun Feb 26 10:58:01 2017 (r314297) +++ stable/11/sys/kern/vfs_vnops.c Sun Feb 26 11:02:14 2017 (r314298) @@ -2434,9 +2434,11 @@ vn_mmap(struct file *fp, vm_map_t map, v * proc does a setuid? */ mp = vp->v_mount; - if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0) + if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0) { maxprot = VM_PROT_NONE; - else + if ((prot & VM_PROT_EXECUTE) != 0) + return (EACCES); + } else maxprot = VM_PROT_EXECUTE; if ((fp->f_flag & FREAD) != 0) maxprot |= VM_PROT_READ; From owner-svn-src-stable@freebsd.org Sun Feb 26 18:17:13 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA75CEE34D; Sun, 26 Feb 2017 18:17:13 +0000 (UTC) (envelope-from alc@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 mx1.freebsd.org (Postfix) with ESMTPS id 694D21AC; Sun, 26 Feb 2017 18:17:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1QIHCLl037745; Sun, 26 Feb 2017 18:17:12 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1QIHCkG037744; Sun, 26 Feb 2017 18:17:12 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201702261817.v1QIHCkG037744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 26 Feb 2017 18:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314305 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 18:17:13 -0000 Author: alc Date: Sun Feb 26 18:17:12 2017 New Revision: 314305 URL: https://svnweb.freebsd.org/changeset/base/314305 Log: MFC r313960 In pmap_enter(), set the PG_MANAGED flag on the new PTE in one place, rather two places, and do so before the pmap lock is acquired. Modified: stable/11/sys/amd64/amd64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Sun Feb 26 16:34:58 2017 (r314304) +++ stable/11/sys/amd64/amd64/pmap.c Sun Feb 26 18:17:12 2017 (r314305) @@ -4367,7 +4367,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if ((m->oflags & VPO_UNMANAGED) != 0) { if ((newpte & PG_RW) != 0) newpte |= PG_M; - } + } else + newpte |= PG_MANAGED; mpte = NULL; @@ -4440,11 +4441,9 @@ retry: /* * No, might be a protection or wiring change. */ - if ((origpte & PG_MANAGED) != 0) { - newpte |= PG_MANAGED; - if ((newpte & PG_RW) != 0) - vm_page_aflag_set(m, PGA_WRITEABLE); - } + if ((origpte & PG_MANAGED) != 0 && + (newpte & PG_RW) != 0) + vm_page_aflag_set(m, PGA_WRITEABLE); if (((origpte ^ newpte) & ~(PG_M | PG_A)) == 0) goto unchanged; goto validate; @@ -4461,8 +4460,7 @@ retry: /* * Enter on the PV list if part of our managed memory. */ - if ((m->oflags & VPO_UNMANAGED) == 0) { - newpte |= PG_MANAGED; + if ((newpte & PG_MANAGED) != 0) { pv = get_pv_entry(pmap, &lock); pv->pv_va = va; CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa); From owner-svn-src-stable@freebsd.org Mon Feb 27 03:52:33 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDFD8CEF2A7; Mon, 27 Feb 2017 03:52:33 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 950A5B6F; Mon, 27 Feb 2017 03:52:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1R3qWuZ062511; Mon, 27 Feb 2017 03:52:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1R3qWxd062510; Mon, 27 Feb 2017 03:52:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702270352.v1R3qWxd062510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Feb 2017 03:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314323 - stable/11/sys/dev/iscsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 03:52:33 -0000 Author: mav Date: Mon Feb 27 03:52:32 2017 New Revision: 314323 URL: https://svnweb.freebsd.org/changeset/base/314323 Log: MFC r313707: Remove M_PKTHDR from m_getm2() in icl_pdu_append_data(). ip_data_mbuf is always appended to ip_bhs_mbuf, so it does not need own packet header. This change first avoids allocation/initialization of the header, and then avoids dropping one when it later gets to socket buffer. Modified: stable/11/sys/dev/iscsi/icl_soft.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/icl_soft.c ============================================================================== --- stable/11/sys/dev/iscsi/icl_soft.c Mon Feb 27 00:10:00 2017 (r314322) +++ stable/11/sys/dev/iscsi/icl_soft.c Mon Feb 27 03:52:32 2017 (r314323) @@ -1087,7 +1087,7 @@ icl_pdu_append_data(struct icl_pdu *requ KASSERT(len > 0, ("len == 0")); - newmb = m_getm2(NULL, len, flags, MT_DATA, M_PKTHDR); + newmb = m_getm2(NULL, len, flags, MT_DATA, 0); if (newmb == NULL) { ICL_WARN("failed to allocate mbuf for %zd bytes", len); return (ENOMEM); From owner-svn-src-stable@freebsd.org Mon Feb 27 04:05:36 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42782CEF4EE; Mon, 27 Feb 2017 04:05:36 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id ED6B7FED; Mon, 27 Feb 2017 04:05:35 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1R45Zv5066480; Mon, 27 Feb 2017 04:05:35 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1R45ZsB066479; Mon, 27 Feb 2017 04:05:35 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201702270405.v1R45ZsB066479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Mon, 27 Feb 2017 04:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314324 - stable/11/contrib/blacklist/libexec X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 04:05:36 -0000 Author: lidl Date: Mon Feb 27 04:05:34 2017 New Revision: 314324 URL: https://svnweb.freebsd.org/changeset/base/314324 Log: MFC r314111: Improve ipfw rule creation for blacklist-helper script When blocking an address, the blacklist-helper script needs to do the following things for the ipfw packet filter: - create a table to hold the addresses to be blocked, so lookups can be done quickly, and place the address to be blocked in that table - create rule that does the lookup in the table and blocks the packet The ipfw system allows multiple rules to be inserted for a given rule number. There only needs to be one rule to do the lookup per port. Modify the script to probe for the existence of the rule before attempting to create it, so only one rule is inserted, rather than one rule per blocked address. PR: 214980 Reported by: azhegalov (at) gmail.com Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9681 Modified: stable/11/contrib/blacklist/libexec/blacklistd-helper Modified: stable/11/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- stable/11/contrib/blacklist/libexec/blacklistd-helper Mon Feb 27 03:52:32 2017 (r314323) +++ stable/11/contrib/blacklist/libexec/blacklistd-helper Mon Feb 27 04:05:34 2017 (r314324) @@ -63,8 +63,11 @@ add) tname="port$6" /sbin/ipfw table $tname create type addr 2>/dev/null /sbin/ipfw -q table $tname add "$addr/$mask" - /sbin/ipfw -q add $rule drop $3 from "table("$tname")" to \ - any dst-port $6 && echo OK + # if rule number $rule does not already exist, create it + /sbin/ipfw show $rule >/dev/null 2>&1 || \ + /sbin/ipfw add $rule drop $3 from \ + table"("$tname")" to any dst-port $6 >/dev/null && \ + echo OK ;; npf) /sbin/npfctl rule "$2" add block in final $proto from \ From owner-svn-src-stable@freebsd.org Mon Feb 27 04:08:10 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09255CEF5C8; Mon, 27 Feb 2017 04:08:10 +0000 (UTC) (envelope-from lidl@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 mx1.freebsd.org (Postfix) with ESMTPS id BC4B330A; Mon, 27 Feb 2017 04:08:09 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1R488gT066629; Mon, 27 Feb 2017 04:08:08 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1R488So066628; Mon, 27 Feb 2017 04:08:08 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201702270408.v1R488So066628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Mon, 27 Feb 2017 04:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314325 - stable/11/contrib/blacklist/bin X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 04:08:10 -0000 Author: lidl Date: Mon Feb 27 04:08:08 2017 New Revision: 314325 URL: https://svnweb.freebsd.org/changeset/base/314325 Log: MFC r314120: Reset failed login count to zero when removing a blocked address The blacklistd daemon keeps records of failed login attempts for each address:port that is flagged as a failed login. When a successful login occurs for that address:port combination, the record's last update time is set to zero, to indicate no current failed login attempts. Reset the failed login count to zero, so that at the next failed login attempt, the counting will restart properly at zero. Without this reset to zero, the first failed login after a successful login will cause the address to be blocked immediately. When debugging is turned on, output more information about database state before and after the database updates have occured. A similar patch has already been upstreamed to NetBSD. Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/blacklist/bin/blacklistd.c Modified: stable/11/contrib/blacklist/bin/blacklistd.c ============================================================================== --- stable/11/contrib/blacklist/bin/blacklistd.c Mon Feb 27 04:05:34 2017 (r314324) +++ stable/11/contrib/blacklist/bin/blacklistd.c Mon Feb 27 04:08:08 2017 (r314325) @@ -207,7 +207,7 @@ process(bl_t bl) if (debug) { char b1[128], b2[128]; - (*lfun)(LOG_DEBUG, "%s: db state info for %s: count=%d/%d " + (*lfun)(LOG_DEBUG, "%s: initial db state for %s: count=%d/%d " "last=%s now=%s", __func__, rbuf, dbi.count, c.c_nfail, fmttime(b1, sizeof(b1), dbi.last), fmttime(b2, sizeof(b2), ts.tv_sec)); @@ -246,15 +246,24 @@ process(bl_t bl) case BL_DELETE: if (dbi.last == 0) goto out; + dbi.count = 0; dbi.last = 0; break; default: (*lfun)(LOG_ERR, "unknown message %d", bi->bi_type); } - if (state_put(state, &c, &dbi) == -1) - goto out; + state_put(state, &c, &dbi); + out: close(bi->bi_fd); + + if (debug) { + char b1[128], b2[128]; + (*lfun)(LOG_DEBUG, "%s: final db state for %s: count=%d/%d " + "last=%s now=%s", __func__, rbuf, dbi.count, c.c_nfail, + fmttime(b1, sizeof(b1), dbi.last), + fmttime(b2, sizeof(b2), ts.tv_sec)); + } } static void @@ -393,7 +402,7 @@ rules_restore(void) int main(int argc, char *argv[]) { - int c, tout, flags, flush, restore; + int c, tout, flags, flush, restore, ret; const char *spath, *blsock; setprogname(argv[0]); @@ -512,7 +521,10 @@ main(int argc, char *argv[]) readconf = 0; conf_parse(configfile); } - switch (poll(pfd, (nfds_t)nfd, tout)) { + ret = poll(pfd, (nfds_t)nfd, tout); + if (debug) + (*lfun)(LOG_DEBUG, "received %d from poll()", ret); + switch (ret) { case -1: if (errno == EINTR) continue; From owner-svn-src-stable@freebsd.org Mon Feb 27 08:27:41 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CDFACEF883; Mon, 27 Feb 2017 08:27:41 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 213488CF; Mon, 27 Feb 2017 08:27:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1R8ReZd066415; Mon, 27 Feb 2017 08:27:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1R8Rcx0066394; Mon, 27 Feb 2017 08:27:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702270827.v1R8Rcx0066394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 08:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314327 - in stable/10: lib/libcrypt lib/libmd sbin/gbde sbin/geom/class/eli sbin/md5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/crypto/sha2 sys/dev/random sys/geom/bde... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 08:27:41 -0000 Author: avg Date: Mon Feb 27 08:27:38 2017 New Revision: 314327 URL: https://svnweb.freebsd.org/changeset/base/314327 Log: MFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c cperciva's libmd implementation is 5-30% faster The same was done for SHA256 previously in r263218 Approved by: secteam Added: stable/10/sys/crypto/sha2/sha384.h - copied unchanged from r292782, head/sys/crypto/sha2/sha384.h stable/10/sys/crypto/sha2/sha512.h - copied unchanged from r292782, head/sys/crypto/sha2/sha512.h stable/10/sys/crypto/sha2/sha512c.c - copied unchanged from r292782, head/sys/crypto/sha2/sha512c.c Deleted: stable/10/lib/libmd/sha512.h stable/10/lib/libmd/sha512c.c stable/10/sys/crypto/sha2/sha2.c stable/10/sys/crypto/sha2/sha2.h Modified: stable/10/lib/libcrypt/Makefile stable/10/lib/libmd/Makefile stable/10/lib/libmd/sha512.3 stable/10/lib/libmd/shadriver.c stable/10/sbin/gbde/Makefile stable/10/sbin/gbde/gbde.c stable/10/sbin/geom/class/eli/Makefile stable/10/sbin/md5/Makefile stable/10/sbin/md5/md5.1 stable/10/sbin/md5/md5.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c stable/10/sys/conf/files stable/10/sys/crypto/sha2/sha256.h stable/10/sys/dev/random/hash.c stable/10/sys/dev/random/yarrow.c stable/10/sys/geom/bde/g_bde.c stable/10/sys/geom/bde/g_bde_crypt.c stable/10/sys/geom/bde/g_bde_lock.c stable/10/sys/geom/bde/g_bde_work.c stable/10/sys/geom/eli/g_eli.h stable/10/sys/modules/crypto/Makefile stable/10/sys/modules/geom/geom_bde/Makefile stable/10/sys/modules/zfs/Makefile stable/10/sys/netinet/sctp_os_bsd.h stable/10/sys/opencrypto/xform.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/Makefile ============================================================================== --- stable/10/lib/libcrypt/Makefile Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/lib/libcrypt/Makefile Mon Feb 27 08:27:38 2017 (r314327) @@ -29,6 +29,7 @@ CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BL .for sym in MD4Init MD4Final MD4Update MD4Pad \ MD5Init MD5Final MD5Update MD5Pad \ SHA256_Init SHA256_Final SHA256_Update \ + SHA384_Init SHA384_Final SHA384_Update \ SHA512_Init SHA512_Final SHA512_Update CFLAGS+= -D${sym}=__${sym} .endfor Modified: stable/10/lib/libmd/Makefile ============================================================================== --- stable/10/lib/libmd/Makefile Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/lib/libmd/Makefile Mon Feb 27 08:27:38 2017 (r314327) @@ -7,8 +7,9 @@ SRCS= md4c.c md5c.c md4hl.c md5hl.c \ rmd160c.c rmd160hl.c \ sha0c.c sha0hl.c sha1c.c sha1hl.c \ sha256c.c sha256hl.c \ + sha384hl.c \ sha512c.c sha512hl.c -INCS= md4.h md5.h ripemd.h sha.h sha256.h sha512.h +INCS= md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h WARNS?= 0 @@ -33,6 +34,10 @@ MLINKS+=sha256.3 SHA256_Init.3 sha256.3 MLINKS+=sha256.3 SHA256_Final.3 sha256.3 SHA256_End.3 MLINKS+=sha256.3 SHA256_File.3 sha256.3 SHA256_FileChunk.3 MLINKS+=sha256.3 SHA256_Data.3 +MLINKS+=sha512.3 SHA384_Init.3 sha512.3 SHA384_Update.3 +MLINKS+=sha512.3 SHA384_Final.3 sha512.3 SHA384_End.3 +MLINKS+=sha512.3 SHA384_File.3 sha512.3 SHA384_FileChunk.3 +MLINKS+=sha512.3 SHA384_Data.3 sha512.3 sha384.3 MLINKS+=sha512.3 SHA512_Init.3 sha512.3 SHA512_Update.3 MLINKS+=sha512.3 SHA512_Final.3 sha512.3 SHA512_End.3 MLINKS+=sha512.3 SHA512_File.3 sha512.3 SHA512_FileChunk.3 @@ -40,7 +45,8 @@ MLINKS+=sha512.3 SHA512_Data.3 CLEANFILES+= md[245]hl.c md[245].ref md[245].3 mddriver \ rmd160.ref rmd160hl.c rmddriver \ sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \ - sha256.ref sha256hl.c sha512.ref sha512hl.c + sha256.ref sha256hl.c sha384hl.c sha384.ref \ + sha512.ref sha512hl.c # Define WEAK_REFS to provide weak aliases for libmd symbols # @@ -87,6 +93,12 @@ sha256hl.c: mdXhl.c -e 's/SHA256__/SHA256_/g' \ ${.ALLSRC}) > ${.TARGET} +sha384hl.c: mdXhl.c + (echo '#define LENGTH 48'; \ + sed -e 's/mdX/sha384/g' -e 's/MDX/SHA384_/g' \ + -e 's/SHA384__/SHA384_/g' \ + ${.ALLSRC}) > ${.TARGET} + sha512hl.c: mdXhl.c (echo '#define LENGTH 64'; \ sed -e 's/mdX/sha512/g' -e 's/MDX/SHA512_/g' \ @@ -167,6 +179,21 @@ sha256.ref: @echo 'SHA-256 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ 'f371bc4a311f2b009eef952dd83ca80e2b60026c8e935592d0f9c308453c813e' >> ${.TARGET} +sha384.ref: + echo 'SHA-384 test suite:' > ${.TARGET} + @echo 'SHA-384 ("") =' \ + '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b' >> ${.TARGET} + @echo 'SHA-384 ("abc") =' \ + 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7' >> ${.TARGET} + @echo 'SHA-384 ("message digest") =' \ + '473ed35167ec1f5d8e550368a3db39be54639f828868e9454c239fc8b52e3c61dbd0d8b4de1390c256dcbb5d5fd99cd5' >> ${.TARGET} + @echo 'SHA-384 ("abcdefghijklmnopqrstuvwxyz") =' \ + 'feb67349df3db6f5924815d6c3dc133f091809213731fe5c7b5f4999e463479ff2877f5f2936fa63bb43784b12f3ebb4' >> ${.TARGET} + @echo 'SHA-384 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \ + '1761336e3f7cbfe51deb137f026f89e01a448e3b1fafa64039c1464ee8732f11a5341a6f41e0c202294736ed64db1a84' >> ${.TARGET} + @echo 'SHA-384 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ + 'b12932b0627d1c060942f5447764155655bd4da0c9afa6dd9b9ef53129af1b8fb0195996d2de9ca0df9d821ffee67026' >> ${.TARGET} + sha512.ref: echo 'SHA-512 test suite:' > ${.TARGET} @echo 'SHA-512 ("") =' \ @@ -195,7 +222,8 @@ rmd160.ref: @echo 'RIPEMD160 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ '9b752e45573d4b39f4dbd3323cab82bf63326bfb' >> ${.TARGET} -test: md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha256.ref sha512.ref +test: md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha256.ref sha384.ref \ + sha512.ref @${ECHO} if any of these test fail, the code produces wrong results @${ECHO} and should NOT be used. ${CC} ${CFLAGS} ${LDFLAGS} -DMD=4 -o mddriver ${.CURDIR}/mddriver.c libmd.a @@ -218,6 +246,9 @@ test: md4.ref md5.ref sha0.ref rmd160.re ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=256 -o shadriver ${.CURDIR}/shadriver.c libmd.a ./shadriver | cmp sha256.ref - @${ECHO} SHA-256 passed test + ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=384 -o shadriver ${.CURDIR}/shadriver.c libmd.a + ./shadriver | cmp sha384.ref - + @${ECHO} SHA-384 passed test ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512 -o shadriver ${.CURDIR}/shadriver.c libmd.a ./shadriver | cmp sha512.ref - @${ECHO} SHA-512 passed test Modified: stable/10/lib/libmd/sha512.3 ============================================================================== --- stable/10/lib/libmd/sha512.3 Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/lib/libmd/sha512.3 Mon Feb 27 08:27:38 2017 (r314327) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd March 28, 2014 +.Dd October 17, 2015 .Dt SHA512 3 .Os .Sh NAME @@ -19,8 +19,15 @@ .Nm SHA512_End , .Nm SHA512_File , .Nm SHA512_FileChunk , -.Nm SHA512_Data -.Nd calculate the FIPS 180-2 ``SHA-512'' message digest +.Nm SHA512_Data , +.Nm SHA384_Init , +.Nm SHA384_Update , +.Nm SHA384_Final , +.Nm SHA384_End , +.Nm SHA384_File , +.Nm SHA384_FileChunk , +.Nm SHA384_Data +.Nd calculate the FIPS 180-4 ``SHA-512'' family of message digests .Sh LIBRARY .Lb libmd .Sh SYNOPSIS @@ -40,6 +47,20 @@ .Fn SHA512_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" .Ft "char *" .Fn SHA512_Data "const unsigned char *data" "unsigned int len" "char *buf" +.Ft void +.Fn SHA384_Init "SHA384_CTX *context" +.Ft void +.Fn SHA384_Update "SHA384_CTX *context" "const unsigned char *data" "size_t len" +.Ft void +.Fn SHA384_Final "unsigned char digest[48]" "SHA384_CTX *context" +.Ft "char *" +.Fn SHA384_End "SHA384_CTX *context" "char *buf" +.Ft "char *" +.Fn SHA384_File "const char *filename" "char *buf" +.Ft "char *" +.Fn SHA384_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" +.Ft "char *" +.Fn SHA384_Data "const unsigned char *data" "unsigned int len" "char *buf" .Sh DESCRIPTION The .Li SHA512_ @@ -119,6 +140,21 @@ after use. If the .Fa buf argument is non-null it must point to at least 65 characters of buffer space. +.Pp +The +.Li SHA384_ +functions are identical to the +.Li SHA512_ +functions except they use a different initial hash value and the output is +truncated to 384 bits. +.Pp +.Fn SHA384_End +is a wrapper for +.Fn SHA384_Final +which converts the return value to a 49-character +(including the terminating '\e0') +.Tn ASCII +string which represents the 384 bits in hexadecimal. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: stable/10/lib/libmd/shadriver.c ============================================================================== --- stable/10/lib/libmd/shadriver.c Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/lib/libmd/shadriver.c Mon Feb 27 08:27:38 2017 (r314327) @@ -22,6 +22,7 @@ __FBSDID("$FreeBSD$"); #include "sha.h" #include "sha256.h" +#include "sha384.h" #include "sha512.h" /* The following makes SHA default to SHA-1 if it has not already been @@ -36,6 +37,9 @@ __FBSDID("$FreeBSD$"); #elif SHA == 256 #undef SHA_Data #define SHA_Data SHA256_Data +#elif SHA == 384 +#undef SHA_Data +#define SHA_Data SHA384_Data #elif SHA == 512 #undef SHA_Data #define SHA_Data SHA512_Data Modified: stable/10/sbin/gbde/Makefile ============================================================================== --- stable/10/sbin/gbde/Makefile Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sbin/gbde/Makefile Mon Feb 27 08:27:38 2017 (r314327) @@ -4,7 +4,7 @@ PROG= gbde SRCS= gbde.c template.c SRCS+= rijndael-alg-fst.c SRCS+= rijndael-api-fst.c -SRCS+= sha2.c +SRCS+= sha512c.c SRCS+= g_bde_lock.c # rijndael-fst.c does evil casting things which can results in warnings, Modified: stable/10/sbin/gbde/gbde.c ============================================================================== --- stable/10/sbin/gbde/gbde.c Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sbin/gbde/gbde.c Mon Feb 27 08:27:38 2017 (r314327) @@ -84,7 +84,7 @@ #include #include #include -#include +#include #include #include Modified: stable/10/sbin/geom/class/eli/Makefile ============================================================================== --- stable/10/sbin/geom/class/eli/Makefile Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sbin/geom/class/eli/Makefile Mon Feb 27 08:27:38 2017 (r314327) @@ -6,7 +6,8 @@ GEOM_CLASS= eli SRCS= g_eli_crypto.c SRCS+= g_eli_key.c SRCS+= pkcs5v2.c -SRCS+= sha2.c +SRCS+= sha256c.c +SRCS+= sha512c.c DPADD= ${LIBMD} ${LIBCRYPTO} LDADD= -lmd -lcrypto Modified: stable/10/sbin/md5/Makefile ============================================================================== --- stable/10/sbin/md5/Makefile Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sbin/md5/Makefile Mon Feb 27 08:27:38 2017 (r314327) @@ -6,11 +6,13 @@ PROG= md5 LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha1 \ ${BINDIR}/md5 ${BINDIR}/sha256 \ + ${BINDIR}/md5 ${BINDIR}/sha384 \ ${BINDIR}/md5 ${BINDIR}/sha512 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ md5.1 sha256.1 \ + md5.1 sha384.1 \ md5.1 sha512.1 DPADD= ${LIBMD} Modified: stable/10/sbin/md5/md5.1 ============================================================================== --- stable/10/sbin/md5/md5.1 Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sbin/md5/md5.1 Mon Feb 27 08:27:38 2017 (r314327) @@ -1,9 +1,9 @@ .\" $FreeBSD$ -.Dd May 17, 2014 +.Dd October 17, 2015 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha256 , sha512, rmd160 +.Nm md5 , sha1 , sha256 , sha384 , sha512, rmd160 .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm md5 @@ -21,6 +21,11 @@ .Op Fl c Ar string .Op Fl s Ar string .Op Ar +.Nm sha384 +.Op Fl pqrtx +.Op Fl c Ar string +.Op Fl s Ar string +.Op Ar .Nm sha512 .Op Fl pqrtx .Op Fl c Ar string @@ -33,7 +38,7 @@ .Op Ar .Sh DESCRIPTION The -.Nm md5 , sha1 , sha256 , sha512 +.Nm md5 , sha1 , sha256 , sha384 , sha512 and .Nm rmd160 utilities take as input a message of arbitrary length and produce as @@ -46,7 +51,7 @@ It is conjectured that it is computation produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The -.Tn MD5 , SHA-1 , SHA-256 , SHA-512 +.Tn MD5 , SHA-1 , SHA-256 , SHA-384 , SHA-512 and .Tn RIPEMD-160 algorithms are intended for digital signature applications, where a @@ -123,6 +128,7 @@ option. .Xr ripemd 3 , .Xr sha 3 , .Xr sha256 3 , +.Xr sha384 3 , .Xr sha512 3 .Rs .%A R. Rivest Modified: stable/10/sbin/md5/md5.c ============================================================================== --- stable/10/sbin/md5/md5.c Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sbin/md5/md5.c Mon Feb 27 08:27:38 2017 (r314327) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -55,6 +56,7 @@ typedef char *(DIGEST_End)(void *, char extern const char *MD5TestOutput[MDTESTCOUNT]; extern const char *SHA1_TestOutput[MDTESTCOUNT]; extern const char *SHA256_TestOutput[MDTESTCOUNT]; +extern const char *SHA384_TestOutput[MDTESTCOUNT]; extern const char *SHA512_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; @@ -80,6 +82,7 @@ typedef union { MD5_CTX md5; SHA1_CTX sha1; SHA256_CTX sha256; + SHA384_CTX sha384; SHA512_CTX sha512; RIPEMD160_CTX ripemd160; } DIGEST_CTX; @@ -101,6 +104,9 @@ static const struct Algorithm_t Algorith { "sha256", "SHA256", &SHA256_TestOutput, (DIGEST_Init*)&SHA256_Init, (DIGEST_Update*)&SHA256_Update, (DIGEST_End*)&SHA256_End, &SHA256_Data, &SHA256_File }, + { "sha384", "SHA384", &SHA384_TestOutput, (DIGEST_Init*)&SHA384_Init, + (DIGEST_Update*)&SHA384_Update, (DIGEST_End*)&SHA384_End, + &SHA384_Data, &SHA384_File }, { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, &SHA512_Data, &SHA512_File }, @@ -327,6 +333,17 @@ const char *SHA256_TestOutput[MDTESTCOUN "e6eae09f10ad4122a0e2a4075761d185a272ebd9f5aa489e998ff2f09cbfdd9f" }; +const char *SHA384_TestOutput[MDTESTCOUNT] = { + "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", + "54a59b9f22b0b80880d8427e548b7c23abd873486e1f035dce9cd697e85175033caa88e6d57bc35efae0b5afd3145f31", + "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7", + "473ed35167ec1f5d8e550368a3db39be54639f828868e9454c239fc8b52e3c61dbd0d8b4de1390c256dcbb5d5fd99cd5", + "feb67349df3db6f5924815d6c3dc133f091809213731fe5c7b5f4999e463479ff2877f5f2936fa63bb43784b12f3ebb4", + "1761336e3f7cbfe51deb137f026f89e01a448e3b1fafa64039c1464ee8732f11a5341a6f41e0c202294736ed64db1a84", + "b12932b0627d1c060942f5447764155655bd4da0c9afa6dd9b9ef53129af1b8fb0195996d2de9ca0df9d821ffee67026", + "99428d401bf4abcd4ee0695248c9858b7503853acfae21a9cffa7855f46d1395ef38596fcd06d5a8c32d41a839cc5dfb" +}; + const char *SHA512_TestOutput[MDTESTCOUNT] = { "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75", Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Mon Feb 27 08:27:38 2017 (r314327) @@ -28,7 +28,7 @@ #include #include #ifdef _KERNEL -#include +#include #else #include #endif Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sys/conf/files Mon Feb 27 08:27:38 2017 (r314327) @@ -543,10 +543,9 @@ crypto/rijndael/rijndael-api-fst.c optio crypto/rijndael/rijndael-api.c optional crypto | ipsec | wlan_ccmp crypto/sha1.c optional carp | crypto | ipsec | \ netgraph_mppc_encryption | sctp -crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random | \ - sctp | zfs crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random | \ sctp | zfs +crypto/sha2/sha512c.c optional crypto | geom_bde | ipsec | zfs crypto/siphash/siphash.c optional inet | inet6 crypto/siphash/siphash_test.c optional inet | inet6 ddb/db_access.c optional ddb Modified: stable/10/sys/crypto/sha2/sha256.h ============================================================================== --- stable/10/sys/crypto/sha2/sha256.h Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sys/crypto/sha2/sha256.h Mon Feb 27 08:27:38 2017 (r314327) @@ -33,10 +33,14 @@ #include #endif +#define SHA256_BLOCK_LENGTH 64 +#define SHA256_DIGEST_LENGTH 32 +#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) + typedef struct SHA256Context { uint32_t state[8]; uint64_t count; - uint8_t buf[64]; + uint8_t buf[SHA256_BLOCK_LENGTH]; } SHA256_CTX; __BEGIN_DECLS @@ -74,10 +78,10 @@ __BEGIN_DECLS void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); -void SHA256_Final(unsigned char [32], SHA256_CTX *); +void SHA256_Final(unsigned char [SHA256_DIGEST_LENGTH], SHA256_CTX *); +#ifndef _KERNEL char *SHA256_End(SHA256_CTX *, char *); char *SHA256_Data(const void *, unsigned int, char *); -#ifndef _KERNEL char *SHA256_File(const char *, char *); char *SHA256_FileChunk(const char *, char *, off_t, off_t); #endif Copied: stable/10/sys/crypto/sha2/sha384.h (from r292782, head/sys/crypto/sha2/sha384.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/crypto/sha2/sha384.h Mon Feb 27 08:27:38 2017 (r314327, copy of r292782, head/sys/crypto/sha2/sha384.h) @@ -0,0 +1,87 @@ +/*- + * Copyright 2005 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SHA384_H_ +#define _SHA384_H_ + +#ifndef _KERNEL +#include +#endif + +#define SHA384_BLOCK_LENGTH 128 +#define SHA384_DIGEST_LENGTH 48 +#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) + +typedef struct SHA384Context { + uint64_t state[8]; + uint64_t count[2]; + uint8_t buf[SHA384_BLOCK_LENGTH]; +} SHA384_CTX; + +__BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ +#ifndef SHA384_Init +#define SHA384_Init _libmd_SHA384_Init +#endif +#ifndef SHA384_Update +#define SHA384_Update _libmd_SHA384_Update +#endif +#ifndef SHA384_Final +#define SHA384_Final _libmd_SHA384_Final +#endif +#ifndef SHA384_End +#define SHA384_End _libmd_SHA384_End +#endif +#ifndef SHA384_File +#define SHA384_File _libmd_SHA384_File +#endif +#ifndef SHA384_FileChunk +#define SHA384_FileChunk _libmd_SHA384_FileChunk +#endif +#ifndef SHA384_Data +#define SHA384_Data _libmd_SHA384_Data +#endif + +#ifndef SHA384_version +#define SHA384_version _libmd_SHA384_version +#endif + +void SHA384_Init(SHA384_CTX *); +void SHA384_Update(SHA384_CTX *, const void *, size_t); +void SHA384_Final(unsigned char [SHA384_DIGEST_LENGTH], SHA384_CTX *); +#ifndef _KERNEL +char *SHA384_End(SHA384_CTX *, char *); +char *SHA384_Data(const void *, unsigned int, char *); +char *SHA384_File(const char *, char *); +char *SHA384_FileChunk(const char *, char *, off_t, off_t); +#endif + +__END_DECLS + +#endif /* !_SHA384_H_ */ Copied: stable/10/sys/crypto/sha2/sha512.h (from r292782, head/sys/crypto/sha2/sha512.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/crypto/sha2/sha512.h Mon Feb 27 08:27:38 2017 (r314327, copy of r292782, head/sys/crypto/sha2/sha512.h) @@ -0,0 +1,90 @@ +/*- + * Copyright 2005 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SHA512_H_ +#define _SHA512_H_ + +#ifndef _KERNEL +#include +#endif + +#define SHA512_BLOCK_LENGTH 128 +#define SHA512_DIGEST_LENGTH 64 +#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) + +typedef struct SHA512Context { + uint64_t state[8]; + uint64_t count[2]; + uint8_t buf[SHA512_BLOCK_LENGTH]; +} SHA512_CTX; + +__BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ +#ifndef SHA512_Init +#define SHA512_Init _libmd_SHA512_Init +#endif +#ifndef SHA512_Update +#define SHA512_Update _libmd_SHA512_Update +#endif +#ifndef SHA512_Final +#define SHA512_Final _libmd_SHA512_Final +#endif +#ifndef SHA512_End +#define SHA512_End _libmd_SHA512_End +#endif +#ifndef SHA512_File +#define SHA512_File _libmd_SHA512_File +#endif +#ifndef SHA512_FileChunk +#define SHA512_FileChunk _libmd_SHA512_FileChunk +#endif +#ifndef SHA512_Data +#define SHA512_Data _libmd_SHA512_Data +#endif + +#ifndef SHA512_Transform +#define SHA512_Transform _libmd_SHA512_Transform +#endif +#ifndef SHA512_version +#define SHA512_version _libmd_SHA512_version +#endif + +void SHA512_Init(SHA512_CTX *); +void SHA512_Update(SHA512_CTX *, const void *, size_t); +void SHA512_Final(unsigned char [SHA512_DIGEST_LENGTH], SHA512_CTX *); +#ifndef _KERNEL +char *SHA512_End(SHA512_CTX *, char *); +char *SHA512_Data(const void *, unsigned int, char *); +char *SHA512_File(const char *, char *); +char *SHA512_FileChunk(const char *, char *, off_t, off_t); +#endif + +__END_DECLS + +#endif /* !_SHA512_H_ */ Copied: stable/10/sys/crypto/sha2/sha512c.c (from r292782, head/sys/crypto/sha2/sha512c.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/crypto/sha2/sha512c.c Mon Feb 27 08:27:38 2017 (r314327, copy of r292782, head/sys/crypto/sha2/sha512c.c) @@ -0,0 +1,397 @@ +/*- + * Copyright 2005 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef _KERNEL +#include +#else +#include +#endif + +#include "sha512.h" +#include "sha384.h" + +#if BYTE_ORDER == BIG_ENDIAN + +/* Copy a vector of big-endian uint64_t into a vector of bytes */ +#define be64enc_vect(dst, src, len) \ + memcpy((void *)dst, (const void *)src, (size_t)len) + +/* Copy a vector of bytes into a vector of big-endian uint64_t */ +#define be64dec_vect(dst, src, len) \ + memcpy((void *)dst, (const void *)src, (size_t)len) + +#else /* BYTE_ORDER != BIG_ENDIAN */ + +/* + * Encode a length len/4 vector of (uint64_t) into a length len vector of + * (unsigned char) in big-endian form. Assumes len is a multiple of 8. + */ +static void +be64enc_vect(unsigned char *dst, const uint64_t *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 8; i++) + be64enc(dst + i * 8, src[i]); +} + +/* + * Decode a big-endian length len vector of (unsigned char) into a length + * len/4 vector of (uint64_t). Assumes len is a multiple of 8. + */ +static void +be64dec_vect(uint64_t *dst, const unsigned char *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 8; i++) + dst[i] = be64dec(src + i * 8); +} + +#endif /* BYTE_ORDER != BIG_ENDIAN */ + +/* Elementary functions used by SHA512 */ +#define Ch(x, y, z) ((x & (y ^ z)) ^ z) +#define Maj(x, y, z) ((x & (y | z)) | (y & z)) +#define SHR(x, n) (x >> n) +#define ROTR(x, n) ((x >> n) | (x << (64 - n))) +#define S0(x) (ROTR(x, 28) ^ ROTR(x, 34) ^ ROTR(x, 39)) +#define S1(x) (ROTR(x, 14) ^ ROTR(x, 18) ^ ROTR(x, 41)) +#define s0(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x, 7)) +#define s1(x) (ROTR(x, 19) ^ ROTR(x, 61) ^ SHR(x, 6)) + +/* SHA512 round function */ +#define RND(a, b, c, d, e, f, g, h, k) \ + t0 = h + S1(e) + Ch(e, f, g) + k; \ + t1 = S0(a) + Maj(a, b, c); \ + d += t0; \ + h = t0 + t1; + +/* Adjusted round function for rotating state */ +#define RNDr(S, W, i, k) \ + RND(S[(80 - i) % 8], S[(81 - i) % 8], \ + S[(82 - i) % 8], S[(83 - i) % 8], \ + S[(84 - i) % 8], S[(85 - i) % 8], \ + S[(86 - i) % 8], S[(87 - i) % 8], \ + W[i] + k) + +/* + * SHA512 block compression function. The 512-bit state is transformed via + * the 512-bit input block to produce a new state. + */ +static void +SHA512_Transform(uint64_t * state, const unsigned char block[SHA512_BLOCK_LENGTH]) +{ + uint64_t W[80]; + uint64_t S[8]; + uint64_t t0, t1; + int i; + + /* 1. Prepare message schedule W. */ + be64dec_vect(W, block, SHA512_BLOCK_LENGTH); + for (i = 16; i < 80; i++) + W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; + + /* 2. Initialize working variables. */ + memcpy(S, state, SHA512_DIGEST_LENGTH); + + /* 3. Mix. */ + RNDr(S, W, 0, 0x428a2f98d728ae22ULL); + RNDr(S, W, 1, 0x7137449123ef65cdULL); + RNDr(S, W, 2, 0xb5c0fbcfec4d3b2fULL); + RNDr(S, W, 3, 0xe9b5dba58189dbbcULL); + RNDr(S, W, 4, 0x3956c25bf348b538ULL); + RNDr(S, W, 5, 0x59f111f1b605d019ULL); + RNDr(S, W, 6, 0x923f82a4af194f9bULL); + RNDr(S, W, 7, 0xab1c5ed5da6d8118ULL); + RNDr(S, W, 8, 0xd807aa98a3030242ULL); + RNDr(S, W, 9, 0x12835b0145706fbeULL); + RNDr(S, W, 10, 0x243185be4ee4b28cULL); + RNDr(S, W, 11, 0x550c7dc3d5ffb4e2ULL); + RNDr(S, W, 12, 0x72be5d74f27b896fULL); + RNDr(S, W, 13, 0x80deb1fe3b1696b1ULL); + RNDr(S, W, 14, 0x9bdc06a725c71235ULL); + RNDr(S, W, 15, 0xc19bf174cf692694ULL); + RNDr(S, W, 16, 0xe49b69c19ef14ad2ULL); + RNDr(S, W, 17, 0xefbe4786384f25e3ULL); + RNDr(S, W, 18, 0x0fc19dc68b8cd5b5ULL); + RNDr(S, W, 19, 0x240ca1cc77ac9c65ULL); + RNDr(S, W, 20, 0x2de92c6f592b0275ULL); + RNDr(S, W, 21, 0x4a7484aa6ea6e483ULL); + RNDr(S, W, 22, 0x5cb0a9dcbd41fbd4ULL); + RNDr(S, W, 23, 0x76f988da831153b5ULL); + RNDr(S, W, 24, 0x983e5152ee66dfabULL); + RNDr(S, W, 25, 0xa831c66d2db43210ULL); + RNDr(S, W, 26, 0xb00327c898fb213fULL); + RNDr(S, W, 27, 0xbf597fc7beef0ee4ULL); + RNDr(S, W, 28, 0xc6e00bf33da88fc2ULL); + RNDr(S, W, 29, 0xd5a79147930aa725ULL); + RNDr(S, W, 30, 0x06ca6351e003826fULL); + RNDr(S, W, 31, 0x142929670a0e6e70ULL); + RNDr(S, W, 32, 0x27b70a8546d22ffcULL); + RNDr(S, W, 33, 0x2e1b21385c26c926ULL); + RNDr(S, W, 34, 0x4d2c6dfc5ac42aedULL); + RNDr(S, W, 35, 0x53380d139d95b3dfULL); + RNDr(S, W, 36, 0x650a73548baf63deULL); + RNDr(S, W, 37, 0x766a0abb3c77b2a8ULL); + RNDr(S, W, 38, 0x81c2c92e47edaee6ULL); + RNDr(S, W, 39, 0x92722c851482353bULL); + RNDr(S, W, 40, 0xa2bfe8a14cf10364ULL); + RNDr(S, W, 41, 0xa81a664bbc423001ULL); + RNDr(S, W, 42, 0xc24b8b70d0f89791ULL); + RNDr(S, W, 43, 0xc76c51a30654be30ULL); + RNDr(S, W, 44, 0xd192e819d6ef5218ULL); + RNDr(S, W, 45, 0xd69906245565a910ULL); + RNDr(S, W, 46, 0xf40e35855771202aULL); + RNDr(S, W, 47, 0x106aa07032bbd1b8ULL); + RNDr(S, W, 48, 0x19a4c116b8d2d0c8ULL); + RNDr(S, W, 49, 0x1e376c085141ab53ULL); + RNDr(S, W, 50, 0x2748774cdf8eeb99ULL); + RNDr(S, W, 51, 0x34b0bcb5e19b48a8ULL); + RNDr(S, W, 52, 0x391c0cb3c5c95a63ULL); + RNDr(S, W, 53, 0x4ed8aa4ae3418acbULL); + RNDr(S, W, 54, 0x5b9cca4f7763e373ULL); + RNDr(S, W, 55, 0x682e6ff3d6b2b8a3ULL); + RNDr(S, W, 56, 0x748f82ee5defb2fcULL); + RNDr(S, W, 57, 0x78a5636f43172f60ULL); + RNDr(S, W, 58, 0x84c87814a1f0ab72ULL); + RNDr(S, W, 59, 0x8cc702081a6439ecULL); + RNDr(S, W, 60, 0x90befffa23631e28ULL); + RNDr(S, W, 61, 0xa4506cebde82bde9ULL); + RNDr(S, W, 62, 0xbef9a3f7b2c67915ULL); + RNDr(S, W, 63, 0xc67178f2e372532bULL); + RNDr(S, W, 64, 0xca273eceea26619cULL); + RNDr(S, W, 65, 0xd186b8c721c0c207ULL); + RNDr(S, W, 66, 0xeada7dd6cde0eb1eULL); + RNDr(S, W, 67, 0xf57d4f7fee6ed178ULL); + RNDr(S, W, 68, 0x06f067aa72176fbaULL); + RNDr(S, W, 69, 0x0a637dc5a2c898a6ULL); + RNDr(S, W, 70, 0x113f9804bef90daeULL); + RNDr(S, W, 71, 0x1b710b35131c471bULL); + RNDr(S, W, 72, 0x28db77f523047d84ULL); + RNDr(S, W, 73, 0x32caab7b40c72493ULL); + RNDr(S, W, 74, 0x3c9ebe0a15c9bebcULL); + RNDr(S, W, 75, 0x431d67c49c100d4cULL); + RNDr(S, W, 76, 0x4cc5d4becb3e42b6ULL); + RNDr(S, W, 77, 0x597f299cfc657e2aULL); + RNDr(S, W, 78, 0x5fcb6fab3ad6faecULL); + RNDr(S, W, 79, 0x6c44198c4a475817ULL); + + /* 4. Mix local working variables into global state */ + for (i = 0; i < 8; i++) + state[i] += S[i]; +} + +static unsigned char PAD[SHA512_BLOCK_LENGTH] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* Add padding and terminating bit-count. */ +static void +SHA512_Pad(SHA512_CTX * ctx) +{ + unsigned char len[16]; + uint64_t r, plen; + + /* + * Convert length to a vector of bytes -- we do this now rather + * than later because the length will change after we pad. + */ + be64enc_vect(len, ctx->count, 16); + + /* Add 1--128 bytes so that the resulting length is 112 mod 128 */ + r = (ctx->count[1] >> 3) & 0x7f; + plen = (r < 112) ? (112 - r) : (240 - r); + SHA512_Update(ctx, PAD, (size_t)plen); + + /* Add the terminating bit-count */ + SHA512_Update(ctx, len, 16); +} + +/* SHA-512 initialization. Begins a SHA-512 operation. */ +void +SHA512_Init(SHA512_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x6a09e667f3bcc908ULL; + ctx->state[1] = 0xbb67ae8584caa73bULL; + ctx->state[2] = 0x3c6ef372fe94f82bULL; + ctx->state[3] = 0xa54ff53a5f1d36f1ULL; + ctx->state[4] = 0x510e527fade682d1ULL; + ctx->state[5] = 0x9b05688c2b3e6c1fULL; + ctx->state[6] = 0x1f83d9abfb41bd6bULL; + ctx->state[7] = 0x5be0cd19137e2179ULL; +} + +/* Add bytes into the hash */ +void +SHA512_Update(SHA512_CTX * ctx, const void *in, size_t len) +{ + uint64_t bitlen[2]; + uint64_t r; + const unsigned char *src = in; + + /* Number of bytes left in the buffer from previous updates */ + r = (ctx->count[1] >> 3) & 0x7f; + + /* Convert the length into a number of bits */ + bitlen[1] = ((uint64_t)len) << 3; + bitlen[0] = ((uint64_t)len) >> 61; + + /* Update number of bits */ + if ((ctx->count[1] += bitlen[1]) < bitlen[1]) + ctx->count[0]++; + ctx->count[0] += bitlen[0]; + + /* Handle the case where we don't need to perform any transforms */ + if (len < SHA512_BLOCK_LENGTH - r) { + memcpy(&ctx->buf[r], src, len); + return; + } + + /* Finish the current block */ + memcpy(&ctx->buf[r], src, SHA512_BLOCK_LENGTH - r); + SHA512_Transform(ctx->state, ctx->buf); + src += SHA512_BLOCK_LENGTH - r; + len -= SHA512_BLOCK_LENGTH - r; + + /* Perform complete blocks */ + while (len >= SHA512_BLOCK_LENGTH) { + SHA512_Transform(ctx->state, src); + src += SHA512_BLOCK_LENGTH; + len -= SHA512_BLOCK_LENGTH; + } + + /* Copy left over data into buffer */ + memcpy(ctx->buf, src, len); +} + +/* + * SHA-512 finalization. Pads the input data, exports the hash value, + * and clears the context state. + */ +void +SHA512_Final(unsigned char digest[SHA512_DIGEST_LENGTH], SHA512_CTX * ctx) +{ + + /* Add padding */ + SHA512_Pad(ctx); + + /* Write the hash */ + be64enc_vect(digest, ctx->state, SHA512_DIGEST_LENGTH); + + /* Clear the context state */ + memset((void *)ctx, 0, sizeof(*ctx)); +} + +/*** SHA-384: *********************************************************/ +/* + * the SHA384 and SHA512 transforms are identical, so SHA384 is skipped + */ + +/* SHA-384 initialization. Begins a SHA-384 operation. */ +void +SHA384_Init(SHA384_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0xcbbb9d5dc1059ed8ULL; + ctx->state[1] = 0x629a292a367cd507ULL; + ctx->state[2] = 0x9159015a3070dd17ULL; + ctx->state[3] = 0x152fecd8f70e5939ULL; + ctx->state[4] = 0x67332667ffc00b31ULL; + ctx->state[5] = 0x8eb44a8768581511ULL; + ctx->state[6] = 0xdb0c2e0d64f98fa7ULL; + ctx->state[7] = 0x47b5481dbefa4fa4ULL; +} + +/* Add bytes into the SHA-384 hash */ +void +SHA384_Update(SHA384_CTX * ctx, const void *in, size_t len) +{ + + SHA512_Update((SHA512_CTX *)ctx, in, len); +} + +/* + * SHA-384 finalization. Pads the input data, exports the hash value, + * and clears the context state. + */ +void +SHA384_Final(unsigned char digest[SHA384_DIGEST_LENGTH], SHA384_CTX * ctx) +{ + + /* Add padding */ + SHA512_Pad((SHA512_CTX *)ctx); + + /* Write the hash */ + be64enc_vect(digest, ctx->state, SHA384_DIGEST_LENGTH); + + /* Clear the context state */ + memset((void *)ctx, 0, sizeof(*ctx)); +} + +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ +#undef SHA512_Init +__weak_reference(_libmd_SHA512_Init, SHA512_Init); +#undef SHA512_Update +__weak_reference(_libmd_SHA512_Update, SHA512_Update); +#undef SHA512_Final +__weak_reference(_libmd_SHA512_Final, SHA512_Final); +#undef SHA512_Transform +__weak_reference(_libmd_SHA512_Transform, SHA512_Transform); + +#undef SHA384_Init +__weak_reference(_libmd_SHA384_Init, SHA384_Init); +#undef SHA384_Update +__weak_reference(_libmd_SHA384_Update, SHA384_Update); +#undef SHA384_Final +__weak_reference(_libmd_SHA384_Final, SHA384_Final); +#endif Modified: stable/10/sys/dev/random/hash.c ============================================================================== --- stable/10/sys/dev/random/hash.c Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sys/dev/random/hash.c Mon Feb 27 08:27:38 2017 (r314327) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include Modified: stable/10/sys/dev/random/yarrow.c ============================================================================== --- stable/10/sys/dev/random/yarrow.c Mon Feb 27 08:20:28 2017 (r314326) +++ stable/10/sys/dev/random/yarrow.c Mon Feb 27 08:27:38 2017 (r314327) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Feb 27 10:10:46 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62D77CE9BFB; Mon, 27 Feb 2017 10:10:46 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 324E2C57; Mon, 27 Feb 2017 10:10:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RAAjpq006318; Mon, 27 Feb 2017 10:10:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RAAjCV006317; Mon, 27 Feb 2017 10:10:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271010.v1RAAjCV006317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 10:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314330 - stable/10/lib/libmd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 10:10:46 -0000 Author: avg Date: Mon Feb 27 10:10:45 2017 New Revision: 314330 URL: https://svnweb.freebsd.org/changeset/base/314330 Log: MFC r285417: Add new include path for sha256.h Modified: stable/10/lib/libmd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmd/Makefile ============================================================================== --- stable/10/lib/libmd/Makefile Mon Feb 27 08:58:27 2017 (r314329) +++ stable/10/lib/libmd/Makefile Mon Feb 27 10:10:45 2017 (r314330) @@ -54,7 +54,8 @@ CLEANFILES+= md[245]hl.c md[245].ref md[ # in which case: # * macros are used to rename symbols to libcrypt internal names # * no weak aliases are generated -CFLAGS+= -I${.CURDIR} -DWEAK_REFS +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys/crypto/sha2 +CFLAGS+= -DWEAK_REFS .PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2 .if exists(${MACHINE_ARCH}/sha.S) From owner-svn-src-stable@freebsd.org Mon Feb 27 10:22:17 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89394CEF1CA; Mon, 27 Feb 2017 10:22:17 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 55E0881F; Mon, 27 Feb 2017 10:22:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RAMGC6013743; Mon, 27 Feb 2017 10:22:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RAMGaW013742; Mon, 27 Feb 2017 10:22:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271022.v1RAMGaW013742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 10:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314331 - stable/10/sys/modules/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 10:22:17 -0000 Author: avg Date: Mon Feb 27 10:22:16 2017 New Revision: 314331 URL: https://svnweb.freebsd.org/changeset/base/314331 Log: fix up r314327 (MFC of r292782): sha2 -> sha512 in sys/modules/random Modified: stable/10/sys/modules/random/Makefile Modified: stable/10/sys/modules/random/Makefile ============================================================================== --- stable/10/sys/modules/random/Makefile Mon Feb 27 10:10:45 2017 (r314330) +++ stable/10/sys/modules/random/Makefile Mon Feb 27 10:22:16 2017 (r314331) @@ -12,7 +12,7 @@ SRCS+= ivy.c .endif SRCS+= randomdev_soft.c yarrow.c hash.c SRCS+= random_harvestq.c live_entropy_sources.c rwfile.c -SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c sha256c.c +SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha256c.c sha512c.c SRCS+= bus_if.h device_if.h vnode_if.h opt_cpu.h opt_random.h CFLAGS+= -I${.CURDIR}/../.. From owner-svn-src-stable@freebsd.org Mon Feb 27 10:40:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150EACEF91F; Mon, 27 Feb 2017 10:40:42 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id D18699E; Mon, 27 Feb 2017 10:40:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RAefLM018655; Mon, 27 Feb 2017 10:40:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RAeesS018645; Mon, 27 Feb 2017 10:40:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271040.v1RAeesS018645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 10:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314332 - in stable/10: lib/libcrypt lib/libmd sbin/md5 sys/crypto/sha2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 10:40:42 -0000 Author: avg Date: Mon Feb 27 10:40:39 2017 New Revision: 314332 URL: https://svnweb.freebsd.org/changeset/base/314332 Log: MFC r300903: Implement SHA-512 truncated (224 and 256 bits) Added: stable/10/sys/crypto/sha2/sha512t.h - copied unchanged from r300903, head/sys/crypto/sha2/sha512t.h Modified: stable/10/lib/libcrypt/Makefile stable/10/lib/libmd/Makefile stable/10/lib/libmd/sha512.3 stable/10/lib/libmd/shadriver.c stable/10/sbin/md5/Makefile stable/10/sbin/md5/md5.1 stable/10/sbin/md5/md5.c stable/10/sys/crypto/sha2/sha512c.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/Makefile ============================================================================== --- stable/10/lib/libcrypt/Makefile Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/lib/libcrypt/Makefile Mon Feb 27 10:40:39 2017 (r314332) @@ -29,6 +29,8 @@ CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BL .for sym in MD4Init MD4Final MD4Update MD4Pad \ MD5Init MD5Final MD5Update MD5Pad \ SHA256_Init SHA256_Final SHA256_Update \ + SHA512_224_Init SHA512_224_Final SHA512_224_Update \ + SHA512_256_Init SHA512_256_Final SHA512_256_Update \ SHA384_Init SHA384_Final SHA384_Update \ SHA512_Init SHA512_Final SHA512_Update CFLAGS+= -D${sym}=__${sym} Modified: stable/10/lib/libmd/Makefile ============================================================================== --- stable/10/lib/libmd/Makefile Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/lib/libmd/Makefile Mon Feb 27 10:40:39 2017 (r314332) @@ -8,8 +8,8 @@ SRCS= md4c.c md5c.c md4hl.c md5hl.c \ sha0c.c sha0hl.c sha1c.c sha1hl.c \ sha256c.c sha256hl.c \ sha384hl.c \ - sha512c.c sha512hl.c -INCS= md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h + sha512c.c sha512hl.c sha512thl.c +INCS= md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h sha512t.h WARNS?= 0 @@ -42,11 +42,15 @@ MLINKS+=sha512.3 SHA512_Init.3 sha512.3 MLINKS+=sha512.3 SHA512_Final.3 sha512.3 SHA512_End.3 MLINKS+=sha512.3 SHA512_File.3 sha512.3 SHA512_FileChunk.3 MLINKS+=sha512.3 SHA512_Data.3 +MLINKS+=sha512.3 SHA512_256_Init.3 sha512.3 SHA512_256_Update.3 +MLINKS+=sha512.3 SHA512_256_Final.3 sha512.3 SHA512_256_End.3 +MLINKS+=sha512.3 SHA512_256_File.3 sha512.3 SHA512_256_FileChunk.3 +MLINKS+=sha512.3 SHA512_256_Data.3 CLEANFILES+= md[245]hl.c md[245].ref md[245].3 mddriver \ rmd160.ref rmd160hl.c rmddriver \ sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \ sha256.ref sha256hl.c sha384hl.c sha384.ref \ - sha512.ref sha512hl.c + sha512.ref sha512hl.c sha512t256.ref sha512thl.c # Define WEAK_REFS to provide weak aliases for libmd symbols # @@ -106,6 +110,13 @@ sha512hl.c: mdXhl.c -e 's/SHA512__/SHA512_/g' \ ${.ALLSRC}) > ${.TARGET} +sha512thl.c: mdXhl.c + (echo '#define LENGTH 32'; \ + sed -e 's/mdX/sha512t/g' -e 's/MDX/SHA512_256_/g' \ + -e 's/SHA512_256__/SHA512_256_/g' \ + -e 's/SHA512_256_CTX/SHA512_CTX/g' \ + ${.ALLSRC}) > ${.TARGET} + rmd160hl.c: mdXhl.c (echo '#define LENGTH 20'; \ sed -e 's/mdX/ripemd/g' -e 's/MDX/RIPEMD160_/g' \ @@ -210,6 +221,21 @@ sha512.ref: @echo 'SHA-512 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ '72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843' >> ${.TARGET} +sha512t256.ref: + echo 'SHA-512256 test suite:' > ${.TARGET} + @echo 'SHA-512256 ("") =' \ + 'c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a' >> ${.TARGET} + @echo 'SHA-512256 ("abc") =' \ + '53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23' >> ${.TARGET} + @echo 'SHA-512256 ("message digest") =' \ + '0cf471fd17ed69d990daf3433c89b16d63dec1bb9cb42a6094604ee5d7b4e9fb' >> ${.TARGET} + @echo 'SHA-512256 ("abcdefghijklmnopqrstuvwxyz") =' \ + 'fc3189443f9c268f626aea08a756abe7b726b05f701cb08222312ccfd6710a26' >> ${.TARGET} + @echo 'SHA-512256 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \ + 'cdf1cc0effe26ecc0c13758f7b4a48e000615df241284185c39eb05d355bb9c8' >> ${.TARGET} + @echo 'SHA-512256 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ + '2c9fdbc0c90bdd87612ee8455474f9044850241dc105b1e8b94b8ddf5fac9148' >> ${.TARGET} + rmd160.ref: echo 'RIPEMD160 test suite:' > ${.TARGET} @echo 'RIPEMD160 ("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31' >> ${.TARGET} @@ -224,7 +250,7 @@ rmd160.ref: '9b752e45573d4b39f4dbd3323cab82bf63326bfb' >> ${.TARGET} test: md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha256.ref sha384.ref \ - sha512.ref + sha512.ref sha512t256.ref @${ECHO} if any of these test fail, the code produces wrong results @${ECHO} and should NOT be used. ${CC} ${CFLAGS} ${LDFLAGS} -DMD=4 -o mddriver ${.CURDIR}/mddriver.c libmd.a @@ -253,6 +279,9 @@ test: md4.ref md5.ref sha0.ref rmd160.re ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512 -o shadriver ${.CURDIR}/shadriver.c libmd.a ./shadriver | cmp sha512.ref - @${ECHO} SHA-512 passed test + ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512256 -o shadriver ${.CURDIR}/shadriver.c libmd.a + ./shadriver | cmp sha512t256.ref - + @${ECHO} SHA-512t256 passed test -rm -f shadriver .include Modified: stable/10/lib/libmd/sha512.3 ============================================================================== --- stable/10/lib/libmd/sha512.3 Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/lib/libmd/sha512.3 Mon Feb 27 10:40:39 2017 (r314332) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd October 17, 2015 +.Dd April 22, 2016 .Dt SHA512 3 .Os .Sh NAME @@ -26,7 +26,14 @@ .Nm SHA384_End , .Nm SHA384_File , .Nm SHA384_FileChunk , -.Nm SHA384_Data +.Nm SHA384_Data, +.Nm SHA512_256_Init , +.Nm SHA512_256_Update , +.Nm SHA512_256_Final , +.Nm SHA512_256_End , +.Nm SHA512_256_File , +.Nm SHA512_256_FileChunk , +.Nm SHA512_256_Data .Nd calculate the FIPS 180-4 ``SHA-512'' family of message digests .Sh LIBRARY .Lb libmd @@ -47,6 +54,7 @@ .Fn SHA512_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" .Ft "char *" .Fn SHA512_Data "const unsigned char *data" "unsigned int len" "char *buf" +.In sha384.h .Ft void .Fn SHA384_Init "SHA384_CTX *context" .Ft void @@ -61,6 +69,21 @@ .Fn SHA384_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" .Ft "char *" .Fn SHA384_Data "const unsigned char *data" "unsigned int len" "char *buf" +.In sha512t.h +.Ft void +.Fn SHA512_256_Init "SHA512_CTX *context" +.Ft void +.Fn SHA512_256_Update "SHA512_CTX *context" "const unsigned char *data" "size_t len" +.Ft void +.Fn SHA512_256_Final "unsigned char digest[32]" "SHA512_CTX *context" +.Ft "char *" +.Fn SHA512_256_End "SHA512_CTX *context" "char *buf" +.Ft "char *" +.Fn SHA512_256_File "const char *filename" "char *buf" +.Ft "char *" +.Fn SHA512_256_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" +.Ft "char *" +.Fn SHA512_256_Data "const unsigned char *data" "unsigned int len" "char *buf" .Sh DESCRIPTION The .Li SHA512_ @@ -92,7 +115,7 @@ and finally extract the result using .Fn SHA512_End is a wrapper for .Fn SHA512_Final -which converts the return value to a 65-character +which converts the return value to a 129-character (including the terminating '\e0') .Tn ASCII string which represents the 512 bits in hexadecimal. @@ -139,22 +162,32 @@ and subsequently must be explicitly deal after use. If the .Fa buf -argument is non-null it must point to at least 65 characters of buffer space. +argument is non-null it must point to at least 129 characters of buffer space. .Pp The .Li SHA384_ +and +.Li SHA512_256_ functions are identical to the .Li SHA512_ functions except they use a different initial hash value and the output is -truncated to 384 bits. +truncated to 384 bits and 256 bits respectively. .Pp .Fn SHA384_End is a wrapper for .Fn SHA384_Final -which converts the return value to a 49-character +which converts the return value to a 97-character (including the terminating '\e0') .Tn ASCII string which represents the 384 bits in hexadecimal. +.Pp +.Fn SHA512_256_End +is a wrapper for +.Fn SHA512_Final +which converts the return value to a 65-character +(including the terminating '\e0') +.Tn ASCII +string which represents the 256 bits in hexadecimal. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: stable/10/lib/libmd/shadriver.c ============================================================================== --- stable/10/lib/libmd/shadriver.c Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/lib/libmd/shadriver.c Mon Feb 27 10:40:39 2017 (r314332) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include "sha256.h" #include "sha384.h" #include "sha512.h" +#include "sha512t.h" /* The following makes SHA default to SHA-1 if it has not already been * defined with C compiler flags. */ @@ -43,6 +44,9 @@ __FBSDID("$FreeBSD$"); #elif SHA == 512 #undef SHA_Data #define SHA_Data SHA512_Data +#elif SHA == 512256 +#undef SHA_Data +#define SHA_Data SHA512_256_Data #endif /* Digests a string and prints the result. */ Modified: stable/10/sbin/md5/Makefile ============================================================================== --- stable/10/sbin/md5/Makefile Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/sbin/md5/Makefile Mon Feb 27 10:40:39 2017 (r314332) @@ -7,13 +7,15 @@ LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha1 \ ${BINDIR}/md5 ${BINDIR}/sha256 \ ${BINDIR}/md5 ${BINDIR}/sha384 \ - ${BINDIR}/md5 ${BINDIR}/sha512 + ${BINDIR}/md5 ${BINDIR}/sha512 \ + ${BINDIR}/md5 ${BINDIR}/sha512t256 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ md5.1 sha256.1 \ md5.1 sha384.1 \ - md5.1 sha512.1 + md5.1 sha512.1 \ + md5.1 sha512t256.1 DPADD= ${LIBMD} LDADD= -lmd Modified: stable/10/sbin/md5/md5.1 ============================================================================== --- stable/10/sbin/md5/md5.1 Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/sbin/md5/md5.1 Mon Feb 27 10:40:39 2017 (r314332) @@ -1,9 +1,9 @@ .\" $FreeBSD$ -.Dd October 17, 2015 +.Dd April 22, 2016 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha256 , sha384 , sha512, rmd160 +.Nm md5 , sha1 , sha256 , sha384 , sha512, sha512t256, rmd160 .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm md5 @@ -31,6 +31,11 @@ .Op Fl c Ar string .Op Fl s Ar string .Op Ar +.Nm sha512t256 +.Op Fl pqrtx +.Op Fl c Ar string +.Op Fl s Ar string +.Op Ar .Nm rmd160 .Op Fl pqrtx .Op Fl c Ar string @@ -38,7 +43,7 @@ .Op Ar .Sh DESCRIPTION The -.Nm md5 , sha1 , sha256 , sha384 , sha512 +.Nm md5 , sha1 , sha256 , sha384 , sha512, sha512t256 and .Nm rmd160 utilities take as input a message of arbitrary length and produce as @@ -78,8 +83,17 @@ found which is faster than a brute-force .Tn SHA-1 in doubt. .Pp -It is recommended that all new applications use +.Tn SHA-512t256 +is a version of +.Tn SHA-512 +truncated to only 256 bits. +On 64-bit hardware, this algorithm is approximately 50% faster than .Tn SHA-256 +but with the same level of security. +The hashes are not interchangeable. +.Pp +It is recommended that all new applications use +.Tn SHA-512 instead of one of the other hash functions. .Pp The following options may be used in any combination and must @@ -114,7 +128,7 @@ Run a built-in test script. .El .Sh EXIT STATUS The -.Nm md5 , sha1 , sha256 , sha512 +.Nm md5 , sha1 , sha256 , sha512, sha512t256 and .Nm rmd160 utilities exit 0 on success, Modified: stable/10/sbin/md5/md5.c ============================================================================== --- stable/10/sbin/md5/md5.c Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/sbin/md5/md5.c Mon Feb 27 10:40:39 2017 (r314332) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,6 +59,7 @@ extern const char *SHA1_TestOutput[MDTES extern const char *SHA256_TestOutput[MDTESTCOUNT]; extern const char *SHA384_TestOutput[MDTESTCOUNT]; extern const char *SHA512_TestOutput[MDTESTCOUNT]; +extern const char *SHA512t256_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; typedef struct Algorithm_t { @@ -110,6 +112,9 @@ static const struct Algorithm_t Algorith { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, &SHA512_Data, &SHA512_File }, + { "sha512t256", "SHA512t256", &SHA512t256_TestOutput, (DIGEST_Init*)&SHA512_256_Init, + (DIGEST_Update*)&SHA512_256_Update, (DIGEST_End*)&SHA512_256_End, + &SHA512_256_Data, &SHA512_256_File }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File } @@ -355,6 +360,17 @@ const char *SHA512_TestOutput[MDTESTCOUN "e8a835195e039708b13d9131e025f4441dbdc521ce625f245a436dcd762f54bf5cb298d96235e6c6a304e087ec8189b9512cbdf6427737ea82793460c367b9c3" }; +const char *SHA512t256_TestOutput[MDTESTCOUNT] = { + "c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a", + "455e518824bc0601f9fb858ff5c37d417d67c2f8e0df2babe4808858aea830f8", + "53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23", + "0cf471fd17ed69d990daf3433c89b16d63dec1bb9cb42a6094604ee5d7b4e9fb", + "fc3189443f9c268f626aea08a756abe7b726b05f701cb08222312ccfd6710a26", + "cdf1cc0effe26ecc0c13758f7b4a48e000615df241284185c39eb05d355bb9c8", + "2c9fdbc0c90bdd87612ee8455474f9044850241dc105b1e8b94b8ddf5fac9148", + "dd095fc859b336c30a52548b3dc59fcc0d1be8616ebcf3368fad23107db2d736" +}; + const char *RIPEMD160_TestOutput[MDTESTCOUNT] = { "9c1185a5c5e9fc54612808977ee8f548b2258d31", "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", Modified: stable/10/sys/crypto/sha2/sha512c.c ============================================================================== --- stable/10/sys/crypto/sha2/sha512c.c Mon Feb 27 10:22:16 2017 (r314331) +++ stable/10/sys/crypto/sha2/sha512c.c Mon Feb 27 10:40:39 2017 (r314332) @@ -1,5 +1,6 @@ /*- * Copyright 2005 Colin Percival + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #endif #include "sha512.h" +#include "sha512t.h" #include "sha384.h" #if BYTE_ORDER == BIG_ENDIAN @@ -324,6 +326,88 @@ SHA512_Final(unsigned char digest[SHA512 memset((void *)ctx, 0, sizeof(*ctx)); } +/*** SHA-512t: *********************************************************/ +/* + * the SHA512t transforms are identical to SHA512 so reuse the existing function + */ +void +SHA512_224_Init(SHA512_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x8c3d37c819544da2ULL; + ctx->state[1] = 0x73e1996689dcd4d6ULL; + ctx->state[2] = 0x1dfab7ae32ff9c82ULL; + ctx->state[3] = 0x679dd514582f9fcfULL; + ctx->state[4] = 0x0f6d2b697bd44da8ULL; + ctx->state[5] = 0x77e36f7304c48942ULL; + ctx->state[6] = 0x3f9d85a86a1d36c8ULL; + ctx->state[7] = 0x1112e6ad91d692a1ULL; +} + +void +SHA512_224_Update(SHA512_CTX * ctx, const void *in, size_t len) +{ + + SHA512_Update(ctx, in, len); +} + +void +SHA512_224_Final(unsigned char digest[static SHA512_224_DIGEST_LENGTH], SHA512_CTX * ctx) +{ + + /* Add padding */ + SHA512_Pad(ctx); + + /* Write the hash */ + be64enc_vect(digest, ctx->state, SHA512_224_DIGEST_LENGTH); + + /* Clear the context state */ + memset(ctx, 0, sizeof(*ctx)); +} + +void +SHA512_256_Init(SHA512_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x22312194fc2bf72cULL; + ctx->state[1] = 0x9f555fa3c84c64c2ULL; + ctx->state[2] = 0x2393b86b6f53b151ULL; + ctx->state[3] = 0x963877195940eabdULL; + ctx->state[4] = 0x96283ee2a88effe3ULL; + ctx->state[5] = 0xbe5e1e2553863992ULL; + ctx->state[6] = 0x2b0199fc2c85b8aaULL; + ctx->state[7] = 0x0eb72ddc81c52ca2ULL; +} + +void +SHA512_256_Update(SHA512_CTX * ctx, const void *in, size_t len) +{ + + SHA512_Update(ctx, in, len); +} + +void +SHA512_256_Final(unsigned char digest[static SHA512_256_DIGEST_LENGTH], SHA512_CTX * ctx) +{ + + /* Add padding */ + SHA512_Pad(ctx); + + /* Write the hash */ + be64enc_vect(digest, ctx->state, SHA512_256_DIGEST_LENGTH); + + /* Clear the context state */ + memset(ctx, 0, sizeof(*ctx)); +} + /*** SHA-384: *********************************************************/ /* * the SHA384 and SHA512 transforms are identical, so SHA384 is skipped @@ -388,6 +472,20 @@ __weak_reference(_libmd_SHA512_Final, SH #undef SHA512_Transform __weak_reference(_libmd_SHA512_Transform, SHA512_Transform); +#undef SHA512_224_Init +__weak_reference(_libmd_SHA512_224_Init, SHA512_224_Init); +#undef SHA512_224_Update +__weak_reference(_libmd_SHA512_224_Update, SHA512_224_Update); +#undef SHA512_224_Final +__weak_reference(_libmd_SHA512_224_Final, SHA512_224_Final); + +#undef SHA512_256_Init +__weak_reference(_libmd_SHA512_256_Init, SHA512_256_Init); +#undef SHA512_256_Update +__weak_reference(_libmd_SHA512_256_Update, SHA512_256_Update); +#undef SHA512_256_Final +__weak_reference(_libmd_SHA512_256_Final, SHA512_256_Final); + #undef SHA384_Init __weak_reference(_libmd_SHA384_Init, SHA384_Init); #undef SHA384_Update Copied: stable/10/sys/crypto/sha2/sha512t.h (from r300903, head/sys/crypto/sha2/sha512t.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/crypto/sha2/sha512t.h Mon Feb 27 10:40:39 2017 (r314332, copy of r300903, head/sys/crypto/sha2/sha512t.h) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2015 Allan Jude + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SHA512T_H_ +#define _SHA512T_H_ + +#include "sha512.h" + +#ifndef _KERNEL +#include +#endif + +#define SHA512_224_DIGEST_LENGTH 28 +#define SHA512_224_DIGEST_STRING_LENGTH (SHA512_224_DIGEST_LENGTH * 2 + 1) +#define SHA512_256_DIGEST_LENGTH 32 +#define SHA512_256_DIGEST_STRING_LENGTH (SHA512_256_DIGEST_LENGTH * 2 + 1) + +__BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ +#ifndef SHA512_224_Init +#define SHA512_224_Init _libmd_SHA512_224_Init +#endif +#ifndef SHA512_224_Update +#define SHA512_224_Update _libmd_SHA512_224_Update +#endif +#ifndef SHA512_224_Final +#define SHA512_224_Final _libmd_SHA512_224_Final +#endif +#ifndef SHA512_224_End +#define SHA512_224_End _libmd_SHA512_224_End +#endif +#ifndef SHA512_224_File +#define SHA512_224_File _libmd_SHA512_224_File +#endif +#ifndef SHA512_224_FileChunk +#define SHA512_224_FileChunk _libmd_SHA512_224_FileChunk +#endif +#ifndef SHA512_224_Data +#define SHA512_224_Data _libmd_SHA512_224_Data +#endif + +#ifndef SHA512_224_Transform +#define SHA512_224_Transform _libmd_SHA512_224_Transform +#endif +#ifndef SHA512_224_version +#define SHA512_224_version _libmd_SHA512_224_version +#endif + +#ifndef SHA512_256_Init +#define SHA512_256_Init _libmd_SHA512_256_Init +#endif +#ifndef SHA512_256_Update +#define SHA512_256_Update _libmd_SHA512_256_Update +#endif +#ifndef SHA512_256_Final +#define SHA512_256_Final _libmd_SHA512_256_Final +#endif +#ifndef SHA512_256_End +#define SHA512_256_End _libmd_SHA512_256_End +#endif +#ifndef SHA512_256_File +#define SHA512_256_File _libmd_SHA512_256_File +#endif +#ifndef SHA512_256_FileChunk +#define SHA512_256_FileChunk _libmd_SHA512_256_FileChunk +#endif +#ifndef SHA512_256_Data +#define SHA512_256_Data _libmd_SHA512_256_Data +#endif + +#ifndef SHA512_256_Transform +#define SHA512_256_Transform _libmd_SHA512_256_Transform +#endif +#ifndef SHA512_256_version +#define SHA512_256_version _libmd_SHA512_256_version +#endif + +void SHA512_224_Init(SHA512_CTX *); +void SHA512_224_Update(SHA512_CTX *, const void *, size_t); +void SHA512_224_Final(unsigned char [static SHA512_224_DIGEST_LENGTH], SHA512_CTX *); +#ifndef _KERNEL +char *SHA512_224_End(SHA512_CTX *, char *); +char *SHA512_224_Data(const void *, unsigned int, char *); +char *SHA512_224_File(const char *, char *); +char *SHA512_224_FileChunk(const char *, char *, off_t, off_t); +#endif +void SHA512_256_Init(SHA512_CTX *); +void SHA512_256_Update(SHA512_CTX *, const void *, size_t); +void SHA512_256_Final(unsigned char [static SHA512_256_DIGEST_LENGTH], SHA512_CTX *); +#ifndef _KERNEL +char *SHA512_256_End(SHA512_CTX *, char *); +char *SHA512_256_Data(const void *, unsigned int, char *); +char *SHA512_256_File(const char *, char *); +char *SHA512_256_FileChunk(const char *, char *, off_t, off_t); +#endif + +__END_DECLS + +#endif /* !_SHA512T_H_ */ From owner-svn-src-stable@freebsd.org Mon Feb 27 11:27:48 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C542ECEF44D; Mon, 27 Feb 2017 11:27:48 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 933A6A65; Mon, 27 Feb 2017 11:27:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RBRllX037488; Mon, 27 Feb 2017 11:27:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RBRkYG037478; Mon, 27 Feb 2017 11:27:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702271127.v1RBRkYG037478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 Feb 2017 11:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314334 - in stable/11/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 11:27:48 -0000 Author: kib Date: Mon Feb 27 11:27:46 2017 New Revision: 314334 URL: https://svnweb.freebsd.org/changeset/base/314334 Log: MFC kern_mmap(9) and related helpers. MFC r302514 (by rwatson): Audit file-descriptor arguments to I/O system calls such as read(2), write(2), dup(2), and mmap(2). MFC r302524 (by rwatson): When mmap(2) is used with a vnode, capture vnode attributes in the audit trail. MFC r313352 (by trasz): Add kern_vm_mmap2(), kern_vm_mprotect(), kern_vm_msync(), kern_vm_munlock(), kern_vm_munmap(), and kern_vm_madvise(). MFC r313655: Change type of the prot parameter for kern_vm_mmap() from vm_prot_t to int. MFC r313696: Rework r313352. Modified: stable/11/sys/compat/cloudabi/cloudabi_mem.c stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/compat/linux/linux_misc.c stable/11/sys/compat/linux/linux_mmap.c stable/11/sys/kern/kern_descrip.c stable/11/sys/kern/sys_generic.c stable/11/sys/kern/vfs_aio.c stable/11/sys/sys/syscallsubr.h stable/11/sys/vm/vm_extern.h stable/11/sys/vm/vm_mmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/cloudabi/cloudabi_mem.c ============================================================================== --- stable/11/sys/compat/cloudabi/cloudabi_mem.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/compat/cloudabi/cloudabi_mem.c Mon Feb 27 11:27:46 2017 (r314334) @@ -28,7 +28,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include #include @@ -62,137 +63,116 @@ int cloudabi_sys_mem_advise(struct thread *td, struct cloudabi_sys_mem_advise_args *uap) { - struct madvise_args madvise_args = { - .addr = uap->addr, - .len = uap->len - }; + int behav; switch (uap->advice) { case CLOUDABI_ADVICE_DONTNEED: - madvise_args.behav = MADV_DONTNEED; + behav = MADV_DONTNEED; break; case CLOUDABI_ADVICE_NORMAL: - madvise_args.behav = MADV_NORMAL; + behav = MADV_NORMAL; break; case CLOUDABI_ADVICE_RANDOM: - madvise_args.behav = MADV_RANDOM; + behav = MADV_RANDOM; break; case CLOUDABI_ADVICE_SEQUENTIAL: - madvise_args.behav = MADV_SEQUENTIAL; + behav = MADV_SEQUENTIAL; break; case CLOUDABI_ADVICE_WILLNEED: - madvise_args.behav = MADV_WILLNEED; + behav = MADV_WILLNEED; break; default: return (EINVAL); } - return (sys_madvise(td, &madvise_args)); + return (kern_madvise(td, (uintptr_t)uap->addr, uap->len, + behav)); } int cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap) { - struct mlock_args mlock_args = { - .addr = uap->addr, - .len = uap->len - }; - return (sys_mlock(td, &mlock_args)); + return (kern_mlock(td->td_proc, td->td_ucred, + __DECONST(uintptr_t, uap->addr), uap->len)); } int cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap) { - struct mmap_args mmap_args = { - .addr = uap->addr, - .len = uap->len, - .fd = uap->fd, - .pos = uap->off - }; - int error; + int error, flags, prot; /* Translate flags. */ + flags = 0; if (uap->flags & CLOUDABI_MAP_ANON) - mmap_args.flags |= MAP_ANON; + flags |= MAP_ANON; if (uap->flags & CLOUDABI_MAP_FIXED) - mmap_args.flags |= MAP_FIXED; + flags |= MAP_FIXED; if (uap->flags & CLOUDABI_MAP_PRIVATE) - mmap_args.flags |= MAP_PRIVATE; + flags |= MAP_PRIVATE; if (uap->flags & CLOUDABI_MAP_SHARED) - mmap_args.flags |= MAP_SHARED; + flags |= MAP_SHARED; /* Translate protection. */ - error = convert_mprot(uap->prot, &mmap_args.prot); + error = convert_mprot(uap->prot, &prot); if (error != 0) return (error); - return (sys_mmap(td, &mmap_args)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, + uap->fd, uap->off)); } int cloudabi_sys_mem_protect(struct thread *td, struct cloudabi_sys_mem_protect_args *uap) { - struct mprotect_args mprotect_args = { - .addr = uap->addr, - .len = uap->len, - }; - int error; + int error, prot; /* Translate protection. */ - error = convert_mprot(uap->prot, &mprotect_args.prot); + error = convert_mprot(uap->prot, &prot); if (error != 0) return (error); - return (sys_mprotect(td, &mprotect_args)); + return (kern_mprotect(td, (uintptr_t)uap->addr, uap->len, + prot)); } int cloudabi_sys_mem_sync(struct thread *td, struct cloudabi_sys_mem_sync_args *uap) { - struct msync_args msync_args = { - .addr = uap->addr, - .len = uap->len, - }; + int flags; /* Convert flags. */ switch (uap->flags & (CLOUDABI_MS_ASYNC | CLOUDABI_MS_SYNC)) { case CLOUDABI_MS_ASYNC: - msync_args.flags |= MS_ASYNC; + flags = MS_ASYNC; break; case CLOUDABI_MS_SYNC: - msync_args.flags |= MS_SYNC; + flags = MS_SYNC; break; default: return (EINVAL); } if ((uap->flags & CLOUDABI_MS_INVALIDATE) != 0) - msync_args.flags |= MS_INVALIDATE; + flags |= MS_INVALIDATE; - return (sys_msync(td, &msync_args)); + return (kern_msync(td, (uintptr_t)uap->addr, uap->len, + flags)); } int cloudabi_sys_mem_unlock(struct thread *td, struct cloudabi_sys_mem_unlock_args *uap) { - struct munlock_args munlock_args = { - .addr = uap->addr, - .len = uap->len - }; - return (sys_munlock(td, &munlock_args)); + return (kern_munlock(td, __DECONST(uintptr_t, uap->addr), + uap->len)); } int cloudabi_sys_mem_unmap(struct thread *td, struct cloudabi_sys_mem_unmap_args *uap) { - struct munmap_args munmap_args = { - .addr = uap->addr, - .len = uap->len - }; - return (sys_munmap(td, &munmap_args)); + return (kern_munmap(td, (uintptr_t)uap->addr, uap->len)); } Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Mon Feb 27 11:27:46 2017 (r314334) @@ -449,42 +449,30 @@ freebsd32_fexecve(struct thread *td, str int freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap) { - struct mprotect_args ap; + int prot; - ap.addr = PTRIN(uap->addr); - ap.len = uap->len; - ap.prot = uap->prot; + prot = uap->prot; #if defined(__amd64__) - if (i386_read_exec && (ap.prot & PROT_READ) != 0) - ap.prot |= PROT_EXEC; + if (i386_read_exec && (prot & PROT_READ) != 0) + prot |= PROT_EXEC; #endif - return (sys_mprotect(td, &ap)); + return (kern_mprotect(td, (uintptr_t)PTRIN(uap->addr), uap->len, + prot)); } int freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap) { - struct mmap_args ap; - vm_offset_t addr = (vm_offset_t) uap->addr; - vm_size_t len = uap->len; - int prot = uap->prot; - int flags = uap->flags; - int fd = uap->fd; - off_t pos = PAIR32TO64(off_t,uap->pos); + int prot; + prot = uap->prot; #if defined(__amd64__) if (i386_read_exec && (prot & PROT_READ)) prot |= PROT_EXEC; #endif - ap.addr = (void *) addr; - ap.len = len; - ap.prot = prot; - ap.flags = flags; - ap.fd = fd; - ap.pos = pos; - - return (sys_mmap(td, &ap)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, + uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); } #ifdef COMPAT_FREEBSD6 @@ -492,17 +480,16 @@ int freebsd6_freebsd32_mmap(struct thread *td, struct freebsd6_freebsd32_mmap_args *uap) { - struct freebsd32_mmap_args ap; + int prot; - ap.addr = uap->addr; - ap.len = uap->len; - ap.prot = uap->prot; - ap.flags = uap->flags; - ap.fd = uap->fd; - ap.pos1 = uap->pos1; - ap.pos2 = uap->pos2; + prot = uap->prot; +#if defined(__amd64__) + if (i386_read_exec && (prot & PROT_READ)) + prot |= PROT_EXEC; +#endif - return (freebsd32_mmap(td, &ap)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, + uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); } #endif Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/compat/linux/linux_misc.c Mon Feb 27 11:27:46 2017 (r314334) @@ -585,10 +585,8 @@ select_out: int linux_mremap(struct thread *td, struct linux_mremap_args *args) { - struct munmap_args /* { - void *addr; - size_t len; - } */ bsd_args; + uintptr_t addr; + size_t len; int error = 0; #ifdef DEBUG @@ -623,10 +621,9 @@ linux_mremap(struct thread *td, struct l } if (args->new_len < args->old_len) { - bsd_args.addr = - (caddr_t)((uintptr_t)args->addr + args->new_len); - bsd_args.len = args->old_len - args->new_len; - error = sys_munmap(td, &bsd_args); + addr = args->addr + args->new_len; + len = args->old_len - args->new_len; + error = kern_munmap(td, addr, len); } td->td_retval[0] = error ? 0 : (uintptr_t)args->addr; @@ -640,13 +637,9 @@ linux_mremap(struct thread *td, struct l int linux_msync(struct thread *td, struct linux_msync_args *args) { - struct msync_args bsd_args; - bsd_args.addr = (caddr_t)(uintptr_t)args->addr; - bsd_args.len = (uintptr_t)args->len; - bsd_args.flags = args->fl & ~LINUX_MS_SYNC; - - return (sys_msync(td, &bsd_args)); + return (kern_msync(td, args->addr, args->len, + args->fl & ~LINUX_MS_SYNC)); } int Modified: stable/11/sys/compat/linux/linux_mmap.c ============================================================================== --- stable/11/sys/compat/linux/linux_mmap.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/compat/linux/linux_mmap.c Mon Feb 27 11:27:46 2017 (r314334) @@ -41,10 +41,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -67,15 +69,7 @@ linux_mmap_common(struct thread *td, uin { struct proc *p = td->td_proc; struct vmspace *vms = td->td_proc->p_vmspace; - struct mmap_args /* { - caddr_t addr; - size_t len; - int prot; - int flags; - int fd; - off_t pos; - } */ bsd_args; - int error; + int bsd_flags, error; struct file *fp; cap_rights_t rights; @@ -83,7 +77,7 @@ linux_mmap_common(struct thread *td, uin addr, len, prot, flags, fd, pos); error = 0; - bsd_args.flags = 0; + bsd_flags = 0; fp = NULL; /* @@ -94,21 +88,21 @@ linux_mmap_common(struct thread *td, uin return (EINVAL); if (flags & LINUX_MAP_SHARED) - bsd_args.flags |= MAP_SHARED; + bsd_flags |= MAP_SHARED; if (flags & LINUX_MAP_PRIVATE) - bsd_args.flags |= MAP_PRIVATE; + bsd_flags |= MAP_PRIVATE; if (flags & LINUX_MAP_FIXED) - bsd_args.flags |= MAP_FIXED; + bsd_flags |= MAP_FIXED; if (flags & LINUX_MAP_ANON) { /* Enforce pos to be on page boundary, then ignore. */ if ((pos & PAGE_MASK) != 0) return (EINVAL); pos = 0; - bsd_args.flags |= MAP_ANON; + bsd_flags |= MAP_ANON; } else - bsd_args.flags |= MAP_NOSYNC; + bsd_flags |= MAP_NOSYNC; if (flags & LINUX_MAP_GROWSDOWN) - bsd_args.flags |= MAP_STACK; + bsd_flags |= MAP_STACK; /* * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC @@ -118,14 +112,13 @@ linux_mmap_common(struct thread *td, uin * * XXX. Linux checks that the file system is not mounted with noexec. */ - bsd_args.prot = prot; #if defined(__amd64__) - linux_fixup_prot(td, &bsd_args.prot); + linux_fixup_prot(td, &prot); #endif /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */ - bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd; - if (bsd_args.fd != -1) { + fd = (bsd_flags & MAP_ANON) ? -1 : fd; + if (fd != -1) { /* * Linux follows Solaris mmap(2) description: * The file descriptor fildes is opened with @@ -133,8 +126,7 @@ linux_mmap_common(struct thread *td, uin * protection options specified. */ - error = fget(td, bsd_args.fd, - cap_rights_init(&rights, CAP_MMAP), &fp); + error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), &fp); if (error != 0) return (error); if (fp->f_type != DTYPE_VNODE) { @@ -205,21 +197,13 @@ linux_mmap_common(struct thread *td, uin * we map the full stack, since we don't have a way * to autogrow it. */ - if (len > STACK_SIZE - GUARD_SIZE) { - bsd_args.addr = (caddr_t)addr; - bsd_args.len = len; - } else { - bsd_args.addr = (caddr_t)addr - - (STACK_SIZE - GUARD_SIZE - len); - bsd_args.len = STACK_SIZE - GUARD_SIZE; + if (len <= STACK_SIZE - GUARD_SIZE) { + addr = addr - (STACK_SIZE - GUARD_SIZE - len); + len = STACK_SIZE - GUARD_SIZE; } - } else { - bsd_args.addr = (caddr_t)addr; - bsd_args.len = len; } - bsd_args.pos = pos; - error = sys_mmap(td, &bsd_args); + error = kern_mmap(td, addr, len, prot, bsd_flags, fd, pos); LINUX_CTR2(mmap2, "return: %d (%p)", error, td->td_retval[0]); @@ -229,16 +213,11 @@ linux_mmap_common(struct thread *td, uin int linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { - struct mprotect_args bsd_args; - - bsd_args.addr = (void *)addr; - bsd_args.len = len; - bsd_args.prot = prot; #if defined(__amd64__) - linux_fixup_prot(td, &bsd_args.prot); + linux_fixup_prot(td, &prot); #endif - return (sys_mprotect(td, &bsd_args)); + return (kern_mprotect(td, addr, len, prot)); } #if defined(__amd64__) Modified: stable/11/sys/kern/kern_descrip.c ============================================================================== --- stable/11/sys/kern/kern_descrip.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/kern/kern_descrip.c Mon Feb 27 11:27:46 2017 (r314334) @@ -820,6 +820,9 @@ kern_dup(struct thread *td, u_int mode, MPASS((flags & ~(FDDUP_FLAG_CLOEXEC)) == 0); MPASS(mode < FDDUP_LASTMODE); + AUDIT_ARG_FD(old); + /* XXXRW: if (flags & FDDUP_FIXED) AUDIT_ARG_FD2(new); */ + /* * Verify we have a valid descriptor to dup from and possibly to * dup to. Unlike dup() and dup2(), fcntl()'s F_DUPFD should Modified: stable/11/sys/kern/sys_generic.c ============================================================================== --- stable/11/sys/kern/sys_generic.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/kern/sys_generic.c Mon Feb 27 11:27:46 2017 (r314334) @@ -363,6 +363,8 @@ dofileread(td, fd, fp, auio, offset, fla struct uio *ktruio = NULL; #endif + AUDIT_ARG_FD(fd); + /* Finish zero length reads right here */ if (auio->uio_resid == 0) { td->td_retval[0] = 0; @@ -576,6 +578,7 @@ dofilewrite(td, fd, fp, auio, offset, fl struct uio *ktruio = NULL; #endif + AUDIT_ARG_FD(fd); auio->uio_rw = UIO_WRITE; auio->uio_td = td; auio->uio_offset = offset; Modified: stable/11/sys/kern/vfs_aio.c ============================================================================== --- stable/11/sys/kern/vfs_aio.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/kern/vfs_aio.c Mon Feb 27 11:27:46 2017 (r314334) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -858,12 +859,9 @@ aio_process_mlock(struct kaiocb *job) ("%s: opcode %d", __func__, job->uaiocb.aio_lio_opcode)); aio_switch_vmspace(job); - error = vm_mlock(job->userproc, job->cred, - __DEVOLATILE(void *, cb->aio_buf), cb->aio_nbytes); - if (error) - aio_complete(job, -1, error); - else - aio_complete(job, 0, 0); + error = kern_mlock(job->userproc, job->cred, + __DEVOLATILE(uintptr_t, cb->aio_buf), cb->aio_nbytes); + aio_complete(job, error != 0 ? -1 : 0, error); } static void Modified: stable/11/sys/sys/syscallsubr.h ============================================================================== --- stable/11/sys/sys/syscallsubr.h Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/sys/syscallsubr.h Mon Feb 27 11:27:46 2017 (r314334) @@ -138,15 +138,24 @@ int kern_linkat(struct thread *td, int f char *path2, enum uio_seg segflg, int follow); int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); +int kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav); int kern_mkdirat(struct thread *td, int fd, char *path, enum uio_seg segflg, int mode); int kern_mkfifoat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int mode); int kern_mknodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int mode, int dev); +int kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr, + size_t len); +int kern_mmap(struct thread *td, uintptr_t addr, size_t size, int prot, + int flags, int fd, off_t pos); +int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot); int kern_msgctl(struct thread *, int, int, struct msqid_ds *); int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *); int kern_msgsnd(struct thread *, int, const void *, size_t, int, long); +int kern_msync(struct thread *td, uintptr_t addr, size_t size, int flags); +int kern_munlock(struct thread *td, uintptr_t addr, size_t size); +int kern_munmap(struct thread *td, uintptr_t addr, size_t size); int kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt); int kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, Modified: stable/11/sys/vm/vm_extern.h ============================================================================== --- stable/11/sys/vm/vm_extern.h Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/vm/vm_extern.h Mon Feb 27 11:27:46 2017 (r314334) @@ -114,6 +114,5 @@ struct sf_buf *vm_imgact_map_page(vm_obj void vm_imgact_unmap_page(struct sf_buf *sf); void vm_thread_dispose(struct thread *td); int vm_thread_new(struct thread *td, int pages); -int vm_mlock(struct proc *, struct ucred *, const void *, size_t); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ Modified: stable/11/sys/vm/vm_mmap.c ============================================================================== --- stable/11/sys/vm/vm_mmap.c Mon Feb 27 11:10:36 2017 (r314333) +++ stable/11/sys/vm/vm_mmap.c Mon Feb 27 11:27:46 2017 (r314334) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -169,26 +170,29 @@ struct mmap_args { #endif int -sys_mmap(td, uap) - struct thread *td; - struct mmap_args *uap; +sys_mmap(struct thread *td, struct mmap_args *uap) { + + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot, + uap->flags, uap->fd, uap->pos)); +} + +int +kern_mmap(struct thread *td, uintptr_t addr0, size_t size, int prot, int flags, + int fd, off_t pos) +{ + struct vmspace *vms; struct file *fp; vm_offset_t addr; - vm_size_t size, pageoff; + vm_size_t pageoff; vm_prot_t cap_maxprot; - int align, error, flags, prot; - off_t pos; - struct vmspace *vms = td->td_proc->p_vmspace; + int align, error; cap_rights_t rights; - addr = (vm_offset_t) uap->addr; - size = uap->len; - prot = uap->prot; - flags = uap->flags; - pos = uap->pos; - + vms = td->td_proc->p_vmspace; fp = NULL; + AUDIT_ARG_FD(fd); + addr = addr0; /* * Ignore old flags that used to be defined but did not do anything. @@ -205,8 +209,8 @@ sys_mmap(td, uap) * pos. */ if (!SV_CURPROC_FLAG(SV_AOUT)) { - if ((uap->len == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || - ((flags & MAP_ANON) != 0 && (uap->fd != -1 || pos != 0))) + if ((size == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || + ((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0))) return (EINVAL); } else { if ((flags & MAP_ANON) != 0) @@ -214,7 +218,7 @@ sys_mmap(td, uap) } if (flags & MAP_STACK) { - if ((uap->fd != -1) || + if ((fd != -1) || ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE))) return (EINVAL); flags |= MAP_ANON; @@ -334,7 +338,7 @@ sys_mmap(td, uap) } if (prot & PROT_EXEC) cap_rights_set(&rights, CAP_MMAP_X); - error = fget_mmap(td, uap->fd, &rights, &cap_maxprot, &fp); + error = fget_mmap(td, fd, &rights, &cap_maxprot, &fp); if (error != 0) goto done; if ((flags & (MAP_SHARED | MAP_PRIVATE)) == 0 && @@ -361,15 +365,9 @@ done: int freebsd6_mmap(struct thread *td, struct freebsd6_mmap_args *uap) { - struct mmap_args oargs; - oargs.addr = uap->addr; - oargs.len = uap->len; - oargs.prot = uap->prot; - oargs.flags = uap->flags; - oargs.fd = uap->fd; - oargs.pos = uap->pos; - return (sys_mmap(td, &oargs)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot, + uap->flags, uap->fd, uap->pos)); } #endif @@ -385,11 +383,8 @@ struct ommap_args { }; #endif int -ommap(td, uap) - struct thread *td; - struct ommap_args *uap; +ommap(struct thread *td, struct ommap_args *uap) { - struct mmap_args nargs; static const char cvtbsdprot[8] = { 0, PROT_EXEC, @@ -400,36 +395,34 @@ ommap(td, uap) PROT_WRITE | PROT_READ, PROT_EXEC | PROT_WRITE | PROT_READ, }; + int flags, prot; #define OMAP_ANON 0x0002 #define OMAP_COPY 0x0020 #define OMAP_SHARED 0x0010 #define OMAP_FIXED 0x0100 - nargs.addr = uap->addr; - nargs.len = uap->len; - nargs.prot = cvtbsdprot[uap->prot & 0x7]; + prot = cvtbsdprot[uap->prot & 0x7]; #ifdef COMPAT_FREEBSD32 #if defined(__amd64__) if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32) && - nargs.prot != 0) - nargs.prot |= PROT_EXEC; + prot != 0) + prot |= PROT_EXEC; #endif #endif - nargs.flags = 0; + flags = 0; if (uap->flags & OMAP_ANON) - nargs.flags |= MAP_ANON; + flags |= MAP_ANON; if (uap->flags & OMAP_COPY) - nargs.flags |= MAP_COPY; + flags |= MAP_COPY; if (uap->flags & OMAP_SHARED) - nargs.flags |= MAP_SHARED; + flags |= MAP_SHARED; else - nargs.flags |= MAP_PRIVATE; + flags |= MAP_PRIVATE; if (uap->flags & OMAP_FIXED) - nargs.flags |= MAP_FIXED; - nargs.fd = uap->fd; - nargs.pos = uap->pos; - return (sys_mmap(td, &nargs)); + flags |= MAP_FIXED; + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, + uap->fd, uap->pos)); } #endif /* COMPAT_43 */ @@ -442,20 +435,21 @@ struct msync_args { }; #endif int -sys_msync(td, uap) - struct thread *td; - struct msync_args *uap; +sys_msync(struct thread *td, struct msync_args *uap) +{ + + return (kern_msync(td, (uintptr_t)uap->addr, uap->len, uap->flags)); +} + +int +kern_msync(struct thread *td, uintptr_t addr0, size_t size, int flags) { vm_offset_t addr; - vm_size_t size, pageoff; - int flags; + vm_size_t pageoff; vm_map_t map; int rv; - addr = (vm_offset_t) uap->addr; - size = uap->len; - flags = uap->flags; - + addr = addr0; pageoff = (addr & PAGE_MASK); addr -= pageoff; size += pageoff; @@ -494,23 +488,27 @@ struct munmap_args { }; #endif int -sys_munmap(td, uap) - struct thread *td; - struct munmap_args *uap; +sys_munmap(struct thread *td, struct munmap_args *uap) +{ + + return (kern_munmap(td, (uintptr_t)uap->addr, uap->len)); +} + +int +kern_munmap(struct thread *td, uintptr_t addr0, size_t size) { #ifdef HWPMC_HOOKS struct pmckern_map_out pkm; vm_map_entry_t entry; #endif vm_offset_t addr; - vm_size_t size, pageoff; + vm_size_t pageoff; vm_map_t map; - addr = (vm_offset_t) uap->addr; - size = uap->len; if (size == 0) return (EINVAL); + addr = addr0; pageoff = (addr & PAGE_MASK); addr -= pageoff; size += pageoff; @@ -567,18 +565,20 @@ struct mprotect_args { }; #endif int -sys_mprotect(td, uap) - struct thread *td; - struct mprotect_args *uap; +sys_mprotect(struct thread *td, struct mprotect_args *uap) { - vm_offset_t addr; - vm_size_t size, pageoff; - vm_prot_t prot; - addr = (vm_offset_t) uap->addr; - size = uap->len; - prot = uap->prot & VM_PROT_ALL; + return (kern_mprotect(td, (uintptr_t)uap->addr, uap->len, uap->prot)); +} +int +kern_mprotect(struct thread *td, uintptr_t addr0, size_t size, int prot) +{ + vm_offset_t addr; + vm_size_t pageoff; + + addr = addr0; + prot = (prot & VM_PROT_ALL); pageoff = (addr & PAGE_MASK); addr -= pageoff; size += pageoff; @@ -644,15 +644,22 @@ struct madvise_args { int sys_madvise(struct thread *td, struct madvise_args *uap) { - vm_offset_t start, end; + + return (kern_madvise(td, (uintptr_t)uap->addr, uap->len, uap->behav)); +} + +int +kern_madvise(struct thread *td, uintptr_t addr0, size_t len, int behav) +{ vm_map_t map; + vm_offset_t addr, end, start; int flags; /* * Check for our special case, advising the swap pager we are * "immortal." */ - if (uap->behav == MADV_PROTECT) { + if (behav == MADV_PROTECT) { flags = PPROT_SET; return (kern_procctl(td, P_PID, td->td_proc->p_pid, PROC_SPROTECT, &flags)); @@ -661,27 +668,27 @@ sys_madvise(struct thread *td, struct ma /* * Check for illegal behavior */ - if (uap->behav < 0 || uap->behav > MADV_CORE) + if (behav < 0 || behav > MADV_CORE) return (EINVAL); /* * Check for illegal addresses. Watch out for address wrap... Note * that VM_*_ADDRESS are not constants due to casts (argh). */ map = &td->td_proc->p_vmspace->vm_map; - if ((vm_offset_t)uap->addr < vm_map_min(map) || - (vm_offset_t)uap->addr + uap->len > vm_map_max(map)) + addr = addr0; + if (addr < vm_map_min(map) || addr + len > vm_map_max(map)) return (EINVAL); - if (((vm_offset_t) uap->addr + uap->len) < (vm_offset_t) uap->addr) + if ((addr + len) < addr) return (EINVAL); /* * Since this routine is only advisory, we default to conservative * behavior. */ - start = trunc_page((vm_offset_t) uap->addr); - end = round_page((vm_offset_t) uap->addr + uap->len); + start = trunc_page(addr); + end = round_page(addr + len); - if (vm_map_madvise(map, start, end, uap->behav)) + if (vm_map_madvise(map, start, end, behav)) return (EINVAL); return (0); } @@ -952,11 +959,12 @@ int sys_mlock(struct thread *td, struct mlock_args *uap) { - return (vm_mlock(td->td_proc, td->td_ucred, uap->addr, uap->len)); + return (kern_mlock(td->td_proc, td->td_ucred, + __DECONST(uintptr_t, uap->addr), uap->len)); } int -vm_mlock(struct proc *proc, struct ucred *cred, const void *addr0, size_t len) +kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr0, size_t len) { vm_offset_t addr, end, last, start; vm_size_t npages, size; @@ -967,7 +975,7 @@ vm_mlock(struct proc *proc, struct ucred error = priv_check_cred(cred, PRIV_VM_MLOCK, 0); if (error) return (error); - addr = (vm_offset_t)addr0; + addr = addr0; size = len; last = addr + size; start = trunc_page(addr); @@ -1124,12 +1132,16 @@ struct munlock_args { }; #endif int -sys_munlock(td, uap) - struct thread *td; - struct munlock_args *uap; +sys_munlock(struct thread *td, struct munlock_args *uap) +{ + + return (kern_munlock(td, (uintptr_t)uap->addr, uap->len)); +} + +int +kern_munlock(struct thread *td, uintptr_t addr0, size_t size) { vm_offset_t addr, end, last, start; - vm_size_t size; #ifdef RACCT vm_map_t map; #endif @@ -1138,8 +1150,7 @@ sys_munlock(td, uap) error = priv_check(td, PRIV_VM_MUNLOCK); if (error) return (error); - addr = (vm_offset_t)uap->addr; - size = uap->len; + addr = addr0; last = addr + size; start = trunc_page(addr); end = round_page(last); @@ -1184,6 +1195,7 @@ vm_mmap_vnode(struct thread *td, vm_size locktype = LK_SHARED; if ((error = vget(vp, locktype, td)) != 0) return (error); + AUDIT_ARG_VNODE1(vp); foff = *foffp; flags = *flagsp; obj = vp->v_object; From owner-svn-src-stable@freebsd.org Mon Feb 27 13:05:18 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DD4CCED0EA; Mon, 27 Feb 2017 13:05:18 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 324AFD8F; Mon, 27 Feb 2017 13:05:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RD5Hoo077426; Mon, 27 Feb 2017 13:05:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RD5HOi077424; Mon, 27 Feb 2017 13:05:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271305.v1RD5HOi077424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 13:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314335 - stable/10/sys/crypto/sha2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 13:05:18 -0000 Author: avg Date: Mon Feb 27 13:05:17 2017 New Revision: 314335 URL: https://svnweb.freebsd.org/changeset/base/314335 Log: MFC r300966: Retune SHA2 code for improved performance on CPUs with more ILP... Modified: stable/10/sys/crypto/sha2/sha256c.c stable/10/sys/crypto/sha2/sha512c.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/crypto/sha2/sha256c.c ============================================================================== --- stable/10/sys/crypto/sha2/sha256c.c Mon Feb 27 11:27:46 2017 (r314334) +++ stable/10/sys/crypto/sha2/sha256c.c Mon Feb 27 13:05:17 2017 (r314335) @@ -78,6 +78,26 @@ be32dec_vect(uint32_t *dst, const unsign #endif /* BYTE_ORDER != BIG_ENDIAN */ +/* SHA256 round constants. */ +static const uint32_t K[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + /* Elementary functions used by SHA256 */ #define Ch(x, y, z) ((x & (y ^ z)) ^ z) #define Maj(x, y, z) ((x & (y | z)) | (y & z)) @@ -90,18 +110,21 @@ be32dec_vect(uint32_t *dst, const unsign /* SHA256 round function */ #define RND(a, b, c, d, e, f, g, h, k) \ - t0 = h + S1(e) + Ch(e, f, g) + k; \ - t1 = S0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; + h += S1(e) + Ch(e, f, g) + k; \ + d += h; \ + h += S0(a) + Maj(a, b, c); /* Adjusted round function for rotating state */ -#define RNDr(S, W, i, k) \ +#define RNDr(S, W, i, ii) \ RND(S[(64 - i) % 8], S[(65 - i) % 8], \ S[(66 - i) % 8], S[(67 - i) % 8], \ S[(68 - i) % 8], S[(69 - i) % 8], \ S[(70 - i) % 8], S[(71 - i) % 8], \ - W[i] + k) + W[i + ii] + K[i + ii]) + +/* Message schedule computation */ +#define MSCH(W, ii, i) \ + W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii] /* * SHA256 block compression function. The 256-bit state is transformed via @@ -112,82 +135,52 @@ SHA256_Transform(uint32_t * state, const { uint32_t W[64]; uint32_t S[8]; - uint32_t t0, t1; int i; - /* 1. Prepare message schedule W. */ + /* 1. Prepare the first part of the message schedule W. */ be32dec_vect(W, block, 64); - for (i = 16; i < 64; i++) - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; /* 2. Initialize working variables. */ memcpy(S, state, 32); /* 3. Mix. */ - RNDr(S, W, 0, 0x428a2f98); - RNDr(S, W, 1, 0x71374491); - RNDr(S, W, 2, 0xb5c0fbcf); - RNDr(S, W, 3, 0xe9b5dba5); - RNDr(S, W, 4, 0x3956c25b); - RNDr(S, W, 5, 0x59f111f1); - RNDr(S, W, 6, 0x923f82a4); - RNDr(S, W, 7, 0xab1c5ed5); - RNDr(S, W, 8, 0xd807aa98); - RNDr(S, W, 9, 0x12835b01); - RNDr(S, W, 10, 0x243185be); - RNDr(S, W, 11, 0x550c7dc3); - RNDr(S, W, 12, 0x72be5d74); - RNDr(S, W, 13, 0x80deb1fe); - RNDr(S, W, 14, 0x9bdc06a7); - RNDr(S, W, 15, 0xc19bf174); - RNDr(S, W, 16, 0xe49b69c1); - RNDr(S, W, 17, 0xefbe4786); - RNDr(S, W, 18, 0x0fc19dc6); - RNDr(S, W, 19, 0x240ca1cc); - RNDr(S, W, 20, 0x2de92c6f); - RNDr(S, W, 21, 0x4a7484aa); - RNDr(S, W, 22, 0x5cb0a9dc); - RNDr(S, W, 23, 0x76f988da); - RNDr(S, W, 24, 0x983e5152); - RNDr(S, W, 25, 0xa831c66d); - RNDr(S, W, 26, 0xb00327c8); - RNDr(S, W, 27, 0xbf597fc7); - RNDr(S, W, 28, 0xc6e00bf3); - RNDr(S, W, 29, 0xd5a79147); - RNDr(S, W, 30, 0x06ca6351); - RNDr(S, W, 31, 0x14292967); - RNDr(S, W, 32, 0x27b70a85); - RNDr(S, W, 33, 0x2e1b2138); - RNDr(S, W, 34, 0x4d2c6dfc); - RNDr(S, W, 35, 0x53380d13); - RNDr(S, W, 36, 0x650a7354); - RNDr(S, W, 37, 0x766a0abb); - RNDr(S, W, 38, 0x81c2c92e); - RNDr(S, W, 39, 0x92722c85); - RNDr(S, W, 40, 0xa2bfe8a1); - RNDr(S, W, 41, 0xa81a664b); - RNDr(S, W, 42, 0xc24b8b70); - RNDr(S, W, 43, 0xc76c51a3); - RNDr(S, W, 44, 0xd192e819); - RNDr(S, W, 45, 0xd6990624); - RNDr(S, W, 46, 0xf40e3585); - RNDr(S, W, 47, 0x106aa070); - RNDr(S, W, 48, 0x19a4c116); - RNDr(S, W, 49, 0x1e376c08); - RNDr(S, W, 50, 0x2748774c); - RNDr(S, W, 51, 0x34b0bcb5); - RNDr(S, W, 52, 0x391c0cb3); - RNDr(S, W, 53, 0x4ed8aa4a); - RNDr(S, W, 54, 0x5b9cca4f); - RNDr(S, W, 55, 0x682e6ff3); - RNDr(S, W, 56, 0x748f82ee); - RNDr(S, W, 57, 0x78a5636f); - RNDr(S, W, 58, 0x84c87814); - RNDr(S, W, 59, 0x8cc70208); - RNDr(S, W, 60, 0x90befffa); - RNDr(S, W, 61, 0xa4506ceb); - RNDr(S, W, 62, 0xbef9a3f7); - RNDr(S, W, 63, 0xc67178f2); + for (i = 0; i < 64; i += 16) { + RNDr(S, W, 0, i); + RNDr(S, W, 1, i); + RNDr(S, W, 2, i); + RNDr(S, W, 3, i); + RNDr(S, W, 4, i); + RNDr(S, W, 5, i); + RNDr(S, W, 6, i); + RNDr(S, W, 7, i); + RNDr(S, W, 8, i); + RNDr(S, W, 9, i); + RNDr(S, W, 10, i); + RNDr(S, W, 11, i); + RNDr(S, W, 12, i); + RNDr(S, W, 13, i); + RNDr(S, W, 14, i); + RNDr(S, W, 15, i); + + if (i == 48) + break; + MSCH(W, 0, i); + MSCH(W, 1, i); + MSCH(W, 2, i); + MSCH(W, 3, i); + MSCH(W, 4, i); + MSCH(W, 5, i); + MSCH(W, 6, i); + MSCH(W, 7, i); + MSCH(W, 8, i); + MSCH(W, 9, i); + MSCH(W, 10, i); + MSCH(W, 11, i); + MSCH(W, 12, i); + MSCH(W, 13, i); + MSCH(W, 14, i); + MSCH(W, 15, i); + } /* 4. Mix local working variables into global state */ for (i = 0; i < 8; i++) @@ -205,22 +198,29 @@ static unsigned char PAD[64] = { static void SHA256_Pad(SHA256_CTX * ctx) { - unsigned char len[8]; - uint32_t r, plen; - - /* - * Convert length to a vector of bytes -- we do this now rather - * than later because the length will change after we pad. - */ - be64enc(len, ctx->count); + size_t r; - /* Add 1--64 bytes so that the resulting length is 56 mod 64 */ + /* Figure out how many bytes we have buffered. */ r = (ctx->count >> 3) & 0x3f; - plen = (r < 56) ? (56 - r) : (120 - r); - SHA256_Update(ctx, PAD, (size_t)plen); - /* Add the terminating bit-count */ - SHA256_Update(ctx, len, 8); + /* Pad to 56 mod 64, transforming if we finish a block en route. */ + if (r < 56) { + /* Pad to 56 mod 64. */ + memcpy(&ctx->buf[r], PAD, 56 - r); + } else { + /* Finish the current block and mix. */ + memcpy(&ctx->buf[r], PAD, 64 - r); + SHA256_Transform(ctx->state, ctx->buf); + + /* The start of the final block is all zeroes. */ + memset(&ctx->buf[0], 0, 56); + } + + /* Add the terminating bit-count. */ + be64enc(&ctx->buf[56], ctx->count); + + /* Mix in the final block. */ + SHA256_Transform(ctx->state, ctx->buf); } /* SHA-256 initialization. Begins a SHA-256 operation. */ Modified: stable/10/sys/crypto/sha2/sha512c.c ============================================================================== --- stable/10/sys/crypto/sha2/sha512c.c Mon Feb 27 11:27:46 2017 (r314334) +++ stable/10/sys/crypto/sha2/sha512c.c Mon Feb 27 13:05:17 2017 (r314335) @@ -81,6 +81,50 @@ be64dec_vect(uint64_t *dst, const unsign #endif /* BYTE_ORDER != BIG_ENDIAN */ +/* SHA512 round constants. */ +static const uint64_t K[80] = { + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, + 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, + 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, + 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, + 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, + 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, + 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, + 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, + 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, + 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, + 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, + 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, + 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, + 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL +}; + /* Elementary functions used by SHA512 */ #define Ch(x, y, z) ((x & (y ^ z)) ^ z) #define Maj(x, y, z) ((x & (y | z)) | (y & z)) @@ -93,18 +137,21 @@ be64dec_vect(uint64_t *dst, const unsign /* SHA512 round function */ #define RND(a, b, c, d, e, f, g, h, k) \ - t0 = h + S1(e) + Ch(e, f, g) + k; \ - t1 = S0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; + h += S1(e) + Ch(e, f, g) + k; \ + d += h; \ + h += S0(a) + Maj(a, b, c); /* Adjusted round function for rotating state */ -#define RNDr(S, W, i, k) \ +#define RNDr(S, W, i, ii) \ RND(S[(80 - i) % 8], S[(81 - i) % 8], \ S[(82 - i) % 8], S[(83 - i) % 8], \ S[(84 - i) % 8], S[(85 - i) % 8], \ S[(86 - i) % 8], S[(87 - i) % 8], \ - W[i] + k) + W[i + ii] + K[i + ii]) + +/* Message schedule computation */ +#define MSCH(W, ii, i) \ + W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii] /* * SHA512 block compression function. The 512-bit state is transformed via @@ -115,98 +162,52 @@ SHA512_Transform(uint64_t * state, const { uint64_t W[80]; uint64_t S[8]; - uint64_t t0, t1; int i; - /* 1. Prepare message schedule W. */ + /* 1. Prepare the first part of the message schedule W. */ be64dec_vect(W, block, SHA512_BLOCK_LENGTH); - for (i = 16; i < 80; i++) - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; /* 2. Initialize working variables. */ memcpy(S, state, SHA512_DIGEST_LENGTH); /* 3. Mix. */ - RNDr(S, W, 0, 0x428a2f98d728ae22ULL); - RNDr(S, W, 1, 0x7137449123ef65cdULL); - RNDr(S, W, 2, 0xb5c0fbcfec4d3b2fULL); - RNDr(S, W, 3, 0xe9b5dba58189dbbcULL); - RNDr(S, W, 4, 0x3956c25bf348b538ULL); - RNDr(S, W, 5, 0x59f111f1b605d019ULL); - RNDr(S, W, 6, 0x923f82a4af194f9bULL); - RNDr(S, W, 7, 0xab1c5ed5da6d8118ULL); - RNDr(S, W, 8, 0xd807aa98a3030242ULL); - RNDr(S, W, 9, 0x12835b0145706fbeULL); - RNDr(S, W, 10, 0x243185be4ee4b28cULL); - RNDr(S, W, 11, 0x550c7dc3d5ffb4e2ULL); - RNDr(S, W, 12, 0x72be5d74f27b896fULL); - RNDr(S, W, 13, 0x80deb1fe3b1696b1ULL); - RNDr(S, W, 14, 0x9bdc06a725c71235ULL); - RNDr(S, W, 15, 0xc19bf174cf692694ULL); - RNDr(S, W, 16, 0xe49b69c19ef14ad2ULL); - RNDr(S, W, 17, 0xefbe4786384f25e3ULL); - RNDr(S, W, 18, 0x0fc19dc68b8cd5b5ULL); - RNDr(S, W, 19, 0x240ca1cc77ac9c65ULL); - RNDr(S, W, 20, 0x2de92c6f592b0275ULL); - RNDr(S, W, 21, 0x4a7484aa6ea6e483ULL); - RNDr(S, W, 22, 0x5cb0a9dcbd41fbd4ULL); - RNDr(S, W, 23, 0x76f988da831153b5ULL); - RNDr(S, W, 24, 0x983e5152ee66dfabULL); - RNDr(S, W, 25, 0xa831c66d2db43210ULL); - RNDr(S, W, 26, 0xb00327c898fb213fULL); - RNDr(S, W, 27, 0xbf597fc7beef0ee4ULL); - RNDr(S, W, 28, 0xc6e00bf33da88fc2ULL); - RNDr(S, W, 29, 0xd5a79147930aa725ULL); - RNDr(S, W, 30, 0x06ca6351e003826fULL); - RNDr(S, W, 31, 0x142929670a0e6e70ULL); - RNDr(S, W, 32, 0x27b70a8546d22ffcULL); - RNDr(S, W, 33, 0x2e1b21385c26c926ULL); - RNDr(S, W, 34, 0x4d2c6dfc5ac42aedULL); - RNDr(S, W, 35, 0x53380d139d95b3dfULL); - RNDr(S, W, 36, 0x650a73548baf63deULL); - RNDr(S, W, 37, 0x766a0abb3c77b2a8ULL); - RNDr(S, W, 38, 0x81c2c92e47edaee6ULL); - RNDr(S, W, 39, 0x92722c851482353bULL); - RNDr(S, W, 40, 0xa2bfe8a14cf10364ULL); - RNDr(S, W, 41, 0xa81a664bbc423001ULL); - RNDr(S, W, 42, 0xc24b8b70d0f89791ULL); - RNDr(S, W, 43, 0xc76c51a30654be30ULL); - RNDr(S, W, 44, 0xd192e819d6ef5218ULL); - RNDr(S, W, 45, 0xd69906245565a910ULL); - RNDr(S, W, 46, 0xf40e35855771202aULL); - RNDr(S, W, 47, 0x106aa07032bbd1b8ULL); - RNDr(S, W, 48, 0x19a4c116b8d2d0c8ULL); - RNDr(S, W, 49, 0x1e376c085141ab53ULL); - RNDr(S, W, 50, 0x2748774cdf8eeb99ULL); - RNDr(S, W, 51, 0x34b0bcb5e19b48a8ULL); - RNDr(S, W, 52, 0x391c0cb3c5c95a63ULL); - RNDr(S, W, 53, 0x4ed8aa4ae3418acbULL); - RNDr(S, W, 54, 0x5b9cca4f7763e373ULL); - RNDr(S, W, 55, 0x682e6ff3d6b2b8a3ULL); - RNDr(S, W, 56, 0x748f82ee5defb2fcULL); - RNDr(S, W, 57, 0x78a5636f43172f60ULL); - RNDr(S, W, 58, 0x84c87814a1f0ab72ULL); - RNDr(S, W, 59, 0x8cc702081a6439ecULL); - RNDr(S, W, 60, 0x90befffa23631e28ULL); - RNDr(S, W, 61, 0xa4506cebde82bde9ULL); - RNDr(S, W, 62, 0xbef9a3f7b2c67915ULL); - RNDr(S, W, 63, 0xc67178f2e372532bULL); - RNDr(S, W, 64, 0xca273eceea26619cULL); - RNDr(S, W, 65, 0xd186b8c721c0c207ULL); - RNDr(S, W, 66, 0xeada7dd6cde0eb1eULL); - RNDr(S, W, 67, 0xf57d4f7fee6ed178ULL); - RNDr(S, W, 68, 0x06f067aa72176fbaULL); - RNDr(S, W, 69, 0x0a637dc5a2c898a6ULL); - RNDr(S, W, 70, 0x113f9804bef90daeULL); - RNDr(S, W, 71, 0x1b710b35131c471bULL); - RNDr(S, W, 72, 0x28db77f523047d84ULL); - RNDr(S, W, 73, 0x32caab7b40c72493ULL); - RNDr(S, W, 74, 0x3c9ebe0a15c9bebcULL); - RNDr(S, W, 75, 0x431d67c49c100d4cULL); - RNDr(S, W, 76, 0x4cc5d4becb3e42b6ULL); - RNDr(S, W, 77, 0x597f299cfc657e2aULL); - RNDr(S, W, 78, 0x5fcb6fab3ad6faecULL); - RNDr(S, W, 79, 0x6c44198c4a475817ULL); + for (i = 0; i < 80; i += 16) { + RNDr(S, W, 0, i); + RNDr(S, W, 1, i); + RNDr(S, W, 2, i); + RNDr(S, W, 3, i); + RNDr(S, W, 4, i); + RNDr(S, W, 5, i); + RNDr(S, W, 6, i); + RNDr(S, W, 7, i); + RNDr(S, W, 8, i); + RNDr(S, W, 9, i); + RNDr(S, W, 10, i); + RNDr(S, W, 11, i); + RNDr(S, W, 12, i); + RNDr(S, W, 13, i); + RNDr(S, W, 14, i); + RNDr(S, W, 15, i); + + if (i == 64) + break; + MSCH(W, 0, i); + MSCH(W, 1, i); + MSCH(W, 2, i); + MSCH(W, 3, i); + MSCH(W, 4, i); + MSCH(W, 5, i); + MSCH(W, 6, i); + MSCH(W, 7, i); + MSCH(W, 8, i); + MSCH(W, 9, i); + MSCH(W, 10, i); + MSCH(W, 11, i); + MSCH(W, 12, i); + MSCH(W, 13, i); + MSCH(W, 14, i); + MSCH(W, 15, i); + } /* 4. Mix local working variables into global state */ for (i = 0; i < 8; i++) @@ -228,22 +229,29 @@ static unsigned char PAD[SHA512_BLOCK_LE static void SHA512_Pad(SHA512_CTX * ctx) { - unsigned char len[16]; - uint64_t r, plen; - - /* - * Convert length to a vector of bytes -- we do this now rather - * than later because the length will change after we pad. - */ - be64enc_vect(len, ctx->count, 16); + size_t r; - /* Add 1--128 bytes so that the resulting length is 112 mod 128 */ + /* Figure out how many bytes we have buffered. */ r = (ctx->count[1] >> 3) & 0x7f; - plen = (r < 112) ? (112 - r) : (240 - r); - SHA512_Update(ctx, PAD, (size_t)plen); - /* Add the terminating bit-count */ - SHA512_Update(ctx, len, 16); + /* Pad to 112 mod 128, transforming if we finish a block en route. */ + if (r < 112) { + /* Pad to 112 mod 128. */ + memcpy(&ctx->buf[r], PAD, 112 - r); + } else { + /* Finish the current block and mix. */ + memcpy(&ctx->buf[r], PAD, 128 - r); + SHA512_Transform(ctx->state, ctx->buf); + + /* The start of the final block is all zeroes. */ + memset(&ctx->buf[0], 0, 112); + } + + /* Add the terminating bit-count. */ + be64enc_vect(&ctx->buf[112], ctx->count, 16); + + /* Mix in the final block. */ + SHA512_Transform(ctx->state, ctx->buf); } /* SHA-512 initialization. Begins a SHA-512 operation. */ From owner-svn-src-stable@freebsd.org Mon Feb 27 14:02:13 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474EFCEF829 for ; Mon, 27 Feb 2017 14:02:13 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x230.google.com (mail-yw0-x230.google.com [IPv6:2607:f8b0:4002:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10BB5808 for ; Mon, 27 Feb 2017 14:02:12 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x230.google.com with SMTP id l138so11862348ywc.0 for ; Mon, 27 Feb 2017 06:02:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fHqYQNBv5NxBvRsb+L+5F86AOB4sEIjeRmTQtO02egc=; b=LQyEQwXOLkVC6QAW9CssBW+jLj1YxY/JwNX3fCBRZ01C2yQXP0YOQ0QjpBglVPgMTh kkCAV993oEs1pnLdLQkLxshyewtyxWKPoRY/jPxL4r9IZiCyB+e11Rx4aPrP01lnSQrq DTueFRp11vzlYnOBamXF/RQwGqWvfY+5l7S8EGJJ2aEhUWGlbuP4vGZ4k9xa/8dN2V5E BqEj3vYpivqXEajEM+jk7BpWM5awv7FgXlz3SpkkRzg4/sR6TzSh82jLZEk2x5F6MOKl 5/GZXSPJydMSL/zEp6uc0qdaOxDQJmtD2q7hWvgFuItyCAWBH+9MPZbKeCM7e5yzQK9y fDKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fHqYQNBv5NxBvRsb+L+5F86AOB4sEIjeRmTQtO02egc=; b=eEoo8jQjmKn/jeIYuiQgwpoNVAPZqaDIizzhA3GaJvtu5LVjqlDhqzdZBxmQVROFxp kp+udLlr7AmLbTr5lqCGhQk7OVsj9trV7aOBTDlYywGWTXfpSaVYLh1d61+dBLYZwt84 LeWfprwsTtSJ95fD/+E9CfXmDznrTkbK0KON2m4Bzen8EmpY41Rfk6Az26yH+S2fcWwP D/sWTjoVJ68e7vQxRsxiGs8nFyr0SZ2SGhCAd+5SyvsdRFfo8DFkABXgEgzs4rXzehEs oFW1NCrC2zj1OD92v+pRzMAjl1De1jMldYQkWwPU0LtkjgxJzzE2bsD2+mTrOnD5kgxn WJsg== X-Gm-Message-State: AMke39k5BuB88nMJm7Y47W61PZl+aGhYIKo0fX90CVBxkBjVhc8EpJpXG4eq5s2NFetDK9vC1E8uM9hRPfD8RQ== X-Received: by 10.13.220.65 with SMTP id f62mr12184736ywe.6.1488204131878; Mon, 27 Feb 2017 06:02:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.51.198 with HTTP; Mon, 27 Feb 2017 06:01:41 -0800 (PST) In-Reply-To: <201702271305.v1RD5HOi077424@repo.freebsd.org> References: <201702271305.v1RD5HOi077424@repo.freebsd.org> From: Ed Schouten Date: Mon, 27 Feb 2017 15:01:41 +0100 Message-ID: Subject: Re: svn commit: r314335 - stable/10/sys/crypto/sha2 To: Andriy Gapon Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 14:02:13 -0000 Hi Andriy, 2017-02-27 14:05 GMT+01:00 Andriy Gapon : > +/* Message schedule computation */ > +#define MSCH(W, ii, i) \ > + W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii] [snip] > uint32_t W[64]; [snip] > + for (i = 0; i < 64; i += 16) { > + RNDr(S, W, 1, i); > + RNDr(S, W, 2, i); > + RNDr(S, W, 3, i); > + RNDr(S, W, 4, i); > + RNDr(S, W, 5, i); > + RNDr(S, W, 6, i); > + RNDr(S, W, 7, i); > + RNDr(S, W, 8, i); > + RNDr(S, W, 9, i); > + RNDr(S, W, 10, i); > + RNDr(S, W, 11, i); > + RNDr(S, W, 12, i); > + RNDr(S, W, 13, i); > + RNDr(S, W, 14, i); > + RNDr(S, W, 15, i); > + > + if (i == 48) > + break; > + MSCH(W, 0, i); > + MSCH(W, 1, i); > + MSCH(W, 2, i); > + MSCH(W, 3, i); > + MSCH(W, 4, i); > + MSCH(W, 5, i); > + MSCH(W, 6, i); > + MSCH(W, 7, i); > + MSCH(W, 8, i); > + MSCH(W, 9, i); > + MSCH(W, 10, i); > + MSCH(W, 11, i); > + MSCH(W, 12, i); > + MSCH(W, 13, i); > + MSCH(W, 14, i); > + MSCH(W, 15, i); > + } Something interesting that I noticed some time ago when comparing the various SHA-{256,512} implementations: there is no need to store the entire extended message in W. During every iteration of this loop, RNDr() and MSCH() never go more than 16 elements back. Say, if you were to modify MSCH() to something like this: > +#define MSCH(W, ii) \ > + W[ii] += s1(W[(ii + 14) % 16]) + W[(ii + 9) % 16] + s0(W[(ii + 1)) % 16]) Then it will compute the next chunk of the extended message in-place. RNDr() must then be adjusted to use W[i] instead of W[i + ii], of course. W then only needs to hold 16 elements instead of 64 or 80. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-stable@freebsd.org Mon Feb 27 15:15:17 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 282C5CF035D; Mon, 27 Feb 2017 15:15:17 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD0794E; Mon, 27 Feb 2017 15:15:16 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from [10.145.2.129] (unknown [209.171.88.129]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 98CB613480; Mon, 27 Feb 2017 15:15:12 +0000 (UTC) Date: Mon, 27 Feb 2017 07:15:07 -0800 User-Agent: K-9 Mail for Android In-Reply-To: References: <201702271305.v1RD5HOi077424@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r314335 - stable/10/sys/crypto/sha2 To: Ed Schouten , Andriy Gapon , cperciva@freebsd.org CC: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: Allan Jude Message-ID: X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 15:15:17 -0000 On February 27, 2017 6:01:41 AM PST, Ed Schouten wrote: >Hi Andriy, > >2017-02-27 14:05 GMT+01:00 Andriy Gapon : >> +/* Message schedule computation */ >> +#define MSCH(W, ii, i) \ >> + W[i + ii + 16] =3D s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i >+ ii + 1]) + W[i + ii] > >[snip] > >> uint32_t W[64]; > >[snip] > >> + for (i =3D 0; i < 64; i +=3D 16) { >> + RNDr(S, W, 1, i); >> + RNDr(S, W, 2, i); >> + RNDr(S, W, 3, i); >> + RNDr(S, W, 4, i); >> + RNDr(S, W, 5, i); >> + RNDr(S, W, 6, i); >> + RNDr(S, W, 7, i); >> + RNDr(S, W, 8, i); >> + RNDr(S, W, 9, i); >> + RNDr(S, W, 10, i); >> + RNDr(S, W, 11, i); >> + RNDr(S, W, 12, i); >> + RNDr(S, W, 13, i); >> + RNDr(S, W, 14, i); >> + RNDr(S, W, 15, i); >> + >> + if (i =3D=3D 48) >> + break; >> + MSCH(W, 0, i); >> + MSCH(W, 1, i); >> + MSCH(W, 2, i); >> + MSCH(W, 3, i); >> + MSCH(W, 4, i); >> + MSCH(W, 5, i); >> + MSCH(W, 6, i); >> + MSCH(W, 7, i); >> + MSCH(W, 8, i); >> + MSCH(W, 9, i); >> + MSCH(W, 10, i); >> + MSCH(W, 11, i); >> + MSCH(W, 12, i); >> + MSCH(W, 13, i); >> + MSCH(W, 14, i); >> + MSCH(W, 15, i); >> + } > >Something interesting that I noticed some time ago when comparing the >various SHA-{256,512} implementations: there is no need to store the >entire extended message in W=2E During every iteration of this loop, >RNDr() and MSCH() never go more than 16 elements back=2E > >Say, if you were to modify MSCH() to something like this: > >> +#define MSCH(W, ii) \ >> + W[ii] +=3D s1(W[(ii + 14) % 16]) + W[(ii + 9) % 16] + s0(W[(ii >+ 1)) % 16]) > >Then it will compute the next chunk of the extended message in-place=2E >RNDr() must then be adjusted to use W[i] instead of W[i + ii], of >course=2E W then only needs to hold 16 elements instead of 64 or 80=2E Add Colin, author of the original code --=20 Allan Jude From owner-svn-src-stable@freebsd.org Mon Feb 27 17:18:06 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA919CF0902; Mon, 27 Feb 2017 17:18:06 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id A1AAD79B; Mon, 27 Feb 2017 17:18:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHI5H8079890; Mon, 27 Feb 2017 17:18:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHI5wG079888; Mon, 27 Feb 2017 17:18:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271718.v1RHI5wG079888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314347 - in stable/11/sys: kern vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:18:07 -0000 Author: avg Date: Mon Feb 27 17:18:05 2017 New Revision: 314347 URL: https://svnweb.freebsd.org/changeset/base/314347 Log: MFC r313730: try to fix RACCT_RSS accounting Modified: stable/11/sys/kern/kern_racct.c stable/11/sys/vm/vm_pageout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_racct.c ============================================================================== --- stable/11/sys/kern/kern_racct.c Mon Feb 27 17:12:17 2017 (r314346) +++ stable/11/sys/kern/kern_racct.c Mon Feb 27 17:18:05 2017 (r314347) @@ -1014,10 +1014,13 @@ racct_proc_exit(struct proc *p) racct_set_locked(p, RACCT_CPU, runtime, 0); racct_add_cred_locked(p->p_ucred, RACCT_PCTCPU, pct); + KASSERT(p->p_racct->r_resources[RACCT_RSS] == 0, + ("process reaped with %ju allocated for RSS\n", + p->p_racct->r_resources[RACCT_RSS])); for (i = 0; i <= RACCT_MAX; i++) { if (p->p_racct->r_resources[i] == 0) continue; - if (!RACCT_IS_RECLAIMABLE(i)) + if (!RACCT_IS_RECLAIMABLE(i)) continue; racct_set_locked(p, i, 0, 0); } Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Mon Feb 27 17:12:17 2017 (r314346) +++ stable/11/sys/vm/vm_pageout.c Mon Feb 27 17:18:05 2017 (r314347) @@ -1806,12 +1806,14 @@ again: if (size >= limit) { vm_pageout_map_deactivate_pages( &vm->vm_map, limit); + size = vmspace_resident_count(vm); } #ifdef RACCT if (racct_enable) { rsize = IDX_TO_OFF(size); PROC_LOCK(p); - racct_set(p, RACCT_RSS, rsize); + if (p->p_state == PRS_NORMAL) + racct_set(p, RACCT_RSS, rsize); ravailable = racct_get_available(p, RACCT_RSS); PROC_UNLOCK(p); if (rsize > ravailable) { @@ -1837,7 +1839,8 @@ again: size = vmspace_resident_count(vm); rsize = IDX_TO_OFF(size); PROC_LOCK(p); - racct_set(p, RACCT_RSS, rsize); + if (p->p_state == PRS_NORMAL) + racct_set(p, RACCT_RSS, rsize); PROC_UNLOCK(p); if (rsize > ravailable) tryagain = 1; From owner-svn-src-stable@freebsd.org Mon Feb 27 17:18:09 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34852CF0930; Mon, 27 Feb 2017 17:18:09 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id D9D8A7A3; Mon, 27 Feb 2017 17:18:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHI7hC079936; Mon, 27 Feb 2017 17:18:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHI7Dx079934; Mon, 27 Feb 2017 17:18:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271718.v1RHI7Dx079934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314348 - in stable/10/sys: kern vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:18:09 -0000 Author: avg Date: Mon Feb 27 17:18:07 2017 New Revision: 314348 URL: https://svnweb.freebsd.org/changeset/base/314348 Log: MFC r313730: try to fix RACCT_RSS accounting Modified: stable/10/sys/kern/kern_racct.c stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_racct.c ============================================================================== --- stable/10/sys/kern/kern_racct.c Mon Feb 27 17:18:05 2017 (r314347) +++ stable/10/sys/kern/kern_racct.c Mon Feb 27 17:18:07 2017 (r314348) @@ -1008,10 +1008,13 @@ racct_proc_exit(struct proc *p) racct_set_locked(p, RACCT_CPU, runtime); racct_add_cred_locked(p->p_ucred, RACCT_PCTCPU, pct); + KASSERT(p->p_racct->r_resources[RACCT_RSS] == 0, + ("process reaped with %ju allocated for RSS\n", + p->p_racct->r_resources[RACCT_RSS])); for (i = 0; i <= RACCT_MAX; i++) { if (p->p_racct->r_resources[i] == 0) continue; - if (!RACCT_IS_RECLAIMABLE(i)) + if (!RACCT_IS_RECLAIMABLE(i)) continue; racct_set_locked(p, i, 0); } Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Mon Feb 27 17:18:05 2017 (r314347) +++ stable/10/sys/vm/vm_pageout.c Mon Feb 27 17:18:07 2017 (r314348) @@ -1981,12 +1981,14 @@ again: if (size >= limit) { vm_pageout_map_deactivate_pages( &vm->vm_map, limit); + size = vmspace_resident_count(vm); } #ifdef RACCT if (racct_enable) { rsize = IDX_TO_OFF(size); PROC_LOCK(p); - racct_set(p, RACCT_RSS, rsize); + if (p->p_state == PRS_NORMAL) + racct_set(p, RACCT_RSS, rsize); ravailable = racct_get_available(p, RACCT_RSS); PROC_UNLOCK(p); if (rsize > ravailable) { @@ -2012,7 +2014,8 @@ again: size = vmspace_resident_count(vm); rsize = IDX_TO_OFF(size); PROC_LOCK(p); - racct_set(p, RACCT_RSS, rsize); + if (p->p_state == PRS_NORMAL) + racct_set(p, RACCT_RSS, rsize); PROC_UNLOCK(p); if (rsize > ravailable) tryagain = 1; From owner-svn-src-stable@freebsd.org Mon Feb 27 17:20:45 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB50CF0A5A; Mon, 27 Feb 2017 17:20:45 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id AA7A7B28; Mon, 27 Feb 2017 17:20:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHKiJE080109; Mon, 27 Feb 2017 17:20:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHKiwc080108; Mon, 27 Feb 2017 17:20:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271720.v1RHKiwc080108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314349 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:20:46 -0000 Author: avg Date: Mon Feb 27 17:20:44 2017 New Revision: 314349 URL: https://svnweb.freebsd.org/changeset/base/314349 Log: MFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling Modified: stable/11/sys/x86/x86/mca.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/mca.c ============================================================================== --- stable/11/sys/x86/x86/mca.c Mon Feb 27 17:18:07 2017 (r314348) +++ stable/11/sys/x86/x86/mca.c Mon Feb 27 17:20:44 2017 (r314349) @@ -73,7 +73,7 @@ enum scan_mode { */ struct cmc_state { int max_threshold; - int last_intr; + time_t last_intr; }; #endif @@ -533,7 +533,7 @@ cmci_update(enum scan_mode mode, int ban cc = &cmc_state[PCPU_GET(cpuid)][bank]; ctl = rdmsr(MSR_MC_CTL2(bank)); count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; - delta = (u_int)(ticks - cc->last_intr); + delta = (u_int)(time_uptime - cc->last_intr); /* * If an interrupt was received less than cmc_throttle seconds @@ -550,7 +550,7 @@ cmci_update(enum scan_mode mode, int ban ctl |= limit; wrmsr(MSR_MC_CTL2(bank), limit); } - cc->last_intr = ticks; + cc->last_intr = time_uptime; return; } @@ -857,7 +857,7 @@ cmci_resume(int i) return; cc = &cmc_state[PCPU_GET(cpuid)][i]; - cc->last_intr = -ticks; + cc->last_intr = 0; ctl = rdmsr(MSR_MC_CTL2(i)); ctl &= ~MC_CTL2_THRESHOLD; ctl |= MC_CTL2_CMCI_EN | 1; From owner-svn-src-stable@freebsd.org Mon Feb 27 17:20:51 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BC61CF0A90; Mon, 27 Feb 2017 17:20:51 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id EF72AB7C; Mon, 27 Feb 2017 17:20:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHKojc080160; Mon, 27 Feb 2017 17:20:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHKofs080159; Mon, 27 Feb 2017 17:20:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271720.v1RHKofs080159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314350 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:20:51 -0000 Author: avg Date: Mon Feb 27 17:20:49 2017 New Revision: 314350 URL: https://svnweb.freebsd.org/changeset/base/314350 Log: MFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling Modified: stable/10/sys/x86/x86/mca.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/mca.c ============================================================================== --- stable/10/sys/x86/x86/mca.c Mon Feb 27 17:20:44 2017 (r314349) +++ stable/10/sys/x86/x86/mca.c Mon Feb 27 17:20:49 2017 (r314350) @@ -73,7 +73,7 @@ enum scan_mode { */ struct cmc_state { int max_threshold; - int last_intr; + time_t last_intr; }; #endif @@ -535,7 +535,7 @@ cmci_update(enum scan_mode mode, int ban cc = &cmc_state[PCPU_GET(cpuid)][bank]; ctl = rdmsr(MSR_MC_CTL2(bank)); count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; - delta = (u_int)(ticks - cc->last_intr); + delta = (u_int)(time_uptime - cc->last_intr); /* * If an interrupt was received less than cmc_throttle seconds @@ -552,7 +552,7 @@ cmci_update(enum scan_mode mode, int ban ctl |= limit; wrmsr(MSR_MC_CTL2(bank), limit); } - cc->last_intr = ticks; + cc->last_intr = time_uptime; return; } @@ -852,7 +852,7 @@ cmci_resume(int i) return; cc = &cmc_state[PCPU_GET(cpuid)][i]; - cc->last_intr = -ticks; + cc->last_intr = 0; ctl = rdmsr(MSR_MC_CTL2(i)); ctl &= ~MC_CTL2_THRESHOLD; ctl |= MC_CTL2_CMCI_EN | 1; From owner-svn-src-stable@freebsd.org Mon Feb 27 17:23:43 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8877DCF0C4B; Mon, 27 Feb 2017 17:23:43 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 4E2FDFFA; Mon, 27 Feb 2017 17:23:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHNg7F083772; Mon, 27 Feb 2017 17:23:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHNgba083771; Mon, 27 Feb 2017 17:23:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271723.v1RHNgba083771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314351 - stable/10/sys/dev/jedec_ts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:23:43 -0000 Author: avg Date: Mon Feb 27 17:23:42 2017 New Revision: 314351 URL: https://svnweb.freebsd.org/changeset/base/314351 Log: MFC r314037: jedec_ts: fix slave address check Modified: stable/10/sys/dev/jedec_ts/jedec_ts.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/jedec_ts/jedec_ts.c ============================================================================== --- stable/10/sys/dev/jedec_ts/jedec_ts.c Mon Feb 27 17:20:49 2017 (r314350) +++ stable/10/sys/dev/jedec_ts/jedec_ts.c Mon Feb 27 17:23:42 2017 (r314351) @@ -104,7 +104,7 @@ ts_attach(device_t dev) uint8_t addr; addr = smbus_get_addr(dev); - if ((addr & 0x30) != 0x30) { + if ((addr & 0xf0) != 0x30) { /* Up to 8 slave devices starting at 0x30. */ return (ENXIO); } From owner-svn-src-stable@freebsd.org Mon Feb 27 17:24:03 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32FD4CF0CB9; Mon, 27 Feb 2017 17:24:03 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id F3C30183; Mon, 27 Feb 2017 17:24:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHO2iv084127; Mon, 27 Feb 2017 17:24:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHO27h084126; Mon, 27 Feb 2017 17:24:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271724.v1RHO27h084126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314352 - stable/11/sys/dev/jedec_ts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:24:03 -0000 Author: avg Date: Mon Feb 27 17:24:01 2017 New Revision: 314352 URL: https://svnweb.freebsd.org/changeset/base/314352 Log: MFC r314037: jedec_ts: fix slave address check Modified: stable/11/sys/dev/jedec_ts/jedec_ts.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/jedec_ts/jedec_ts.c ============================================================================== --- stable/11/sys/dev/jedec_ts/jedec_ts.c Mon Feb 27 17:23:42 2017 (r314351) +++ stable/11/sys/dev/jedec_ts/jedec_ts.c Mon Feb 27 17:24:01 2017 (r314352) @@ -104,7 +104,7 @@ ts_attach(device_t dev) uint8_t addr; addr = smbus_get_addr(dev); - if ((addr & 0x30) != 0x30) { + if ((addr & 0xf0) != 0x30) { /* Up to 8 slave devices starting at 0x30. */ return (ENXIO); } From owner-svn-src-stable@freebsd.org Mon Feb 27 17:25:53 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75E4DCF0D81; Mon, 27 Feb 2017 17:25:53 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 4293B75A; Mon, 27 Feb 2017 17:25:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHPq4g084581; Mon, 27 Feb 2017 17:25:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHPq2a084580; Mon, 27 Feb 2017 17:25:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271725.v1RHPq2a084580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314353 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:25:53 -0000 Author: avg Date: Mon Feb 27 17:25:52 2017 New Revision: 314353 URL: https://svnweb.freebsd.org/changeset/base/314353 Log: MFC r314183: add jedec_ts.4 to the list of manual pages Modified: stable/11/share/man/man4/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Mon Feb 27 17:24:01 2017 (r314352) +++ stable/11/share/man/man4/Makefile Mon Feb 27 17:25:52 2017 (r314353) @@ -240,6 +240,7 @@ MAN= aac.4 \ ixgbe.4 \ ixl.4 \ ixlv.4 \ + jedec_ts.4 \ jme.4 \ joy.4 \ kbdmux.4 \ From owner-svn-src-stable@freebsd.org Mon Feb 27 17:25:58 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 372BBCF0DBC; Mon, 27 Feb 2017 17:25:58 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 0689C787; Mon, 27 Feb 2017 17:25:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHPvWW084633; Mon, 27 Feb 2017 17:25:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHPvc7084632; Mon, 27 Feb 2017 17:25:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271725.v1RHPvc7084632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314354 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:25:58 -0000 Author: avg Date: Mon Feb 27 17:25:56 2017 New Revision: 314354 URL: https://svnweb.freebsd.org/changeset/base/314354 Log: MFC r314183: add jedec_ts.4 to the list of manual pages Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Mon Feb 27 17:25:52 2017 (r314353) +++ stable/10/share/man/man4/Makefile Mon Feb 27 17:25:56 2017 (r314354) @@ -222,6 +222,7 @@ MAN= aac.4 \ ixgbe.4 \ ixl.4 \ ixlv.4 \ + jedec_ts.4 \ jme.4 \ joy.4 \ kbdmux.4 \ From owner-svn-src-stable@freebsd.org Mon Feb 27 17:27:25 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29612CF0EA8; Mon, 27 Feb 2017 17:27:25 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id EC9CEA40; Mon, 27 Feb 2017 17:27:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHROQi084790; Mon, 27 Feb 2017 17:27:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHROBB084789; Mon, 27 Feb 2017 17:27:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271727.v1RHROBB084789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314355 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:27:25 -0000 Author: avg Date: Mon Feb 27 17:27:23 2017 New Revision: 314355 URL: https://svnweb.freebsd.org/changeset/base/314355 Log: MFC r314059: zfs: move zio_taskq_basedc under SYSDC Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 27 17:25:56 2017 (r314354) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 27 17:27:23 2017 (r314355) @@ -167,8 +167,8 @@ id_t zio_taskq_psrset_bind = PS_NONE; #endif #ifdef SYSDC boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC scheduling class */ -#endif uint_t zio_taskq_basedc = 80; /* base duty cycle */ +#endif boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ extern int zfs_sync_pass_deferred_free; From owner-svn-src-stable@freebsd.org Mon Feb 27 17:27:43 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78E42CF0EED; Mon, 27 Feb 2017 17:27:43 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 4756AB76; Mon, 27 Feb 2017 17:27:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RHRgYA084843; Mon, 27 Feb 2017 17:27:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RHRg4Q084842; Mon, 27 Feb 2017 17:27:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702271727.v1RHRg4Q084842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Feb 2017 17:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314356 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 17:27:43 -0000 Author: avg Date: Mon Feb 27 17:27:42 2017 New Revision: 314356 URL: https://svnweb.freebsd.org/changeset/base/314356 Log: MFC r314059: zfs: move zio_taskq_basedc under SYSDC Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 27 17:27:23 2017 (r314355) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 27 17:27:42 2017 (r314356) @@ -168,8 +168,8 @@ id_t zio_taskq_psrset_bind = PS_NONE; #endif #ifdef SYSDC boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC scheduling class */ -#endif uint_t zio_taskq_basedc = 80; /* base duty cycle */ +#endif boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ extern int zfs_sync_pass_deferred_free; From owner-svn-src-stable@freebsd.org Mon Feb 27 19:51:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79742CF07E9; Mon, 27 Feb 2017 19:51:28 +0000 (UTC) (envelope-from gonzo@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 mx1.freebsd.org (Postfix) with ESMTPS id 45BE5145; Mon, 27 Feb 2017 19:51:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RJpReZ040294; Mon, 27 Feb 2017 19:51:27 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RJpRYY040293; Mon, 27 Feb 2017 19:51:27 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201702271951.v1RJpRYY040293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 27 Feb 2017 19:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314361 - stable/11/sys/dev/atkbdc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 19:51:28 -0000 Author: gonzo Date: Mon Feb 27 19:51:27 2017 New Revision: 314361 URL: https://svnweb.freebsd.org/changeset/base/314361 Log: MFC r313757: [psm] Fix calculation for clickpad softbuttons at the top On laptops like the ThinkPad X240, ClickPad buttons are located at the top. The hw.psm.synaptics.softbuttons_y sysctl was supposed to allow this by setting the value to a negative one (e.g. -1700). However, the condition was wrong (double negative), and doing that placed the buttons in an unreachable area. PR: 216342 Submitted by: Greg V Modified: stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Mon Feb 27 19:46:27 2017 (r314360) +++ stable/11/sys/dev/atkbdc/psm.c Mon Feb 27 19:51:27 2017 (r314361) @@ -3194,7 +3194,7 @@ psmgestures(struct psm_softc *sc, finger if (sc->synhw.capClickPad && ms->button & MOUSE_BUTTON1DOWN) { y_ok = sc->syninfo.softbuttons_y >= 0 ? start_y < sc->syninfo.softbuttons_y : - start_y > max_y - sc->syninfo.softbuttons_y; + start_y > max_y + sc->syninfo.softbuttons_y; center_button = MOUSE_BUTTON2DOWN; center_x = sc->syninfo.softbutton2_x; From owner-svn-src-stable@freebsd.org Mon Feb 27 20:50:22 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B4FCCF0891; Mon, 27 Feb 2017 20:50:22 +0000 (UTC) (envelope-from gonzo@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 mx1.freebsd.org (Postfix) with ESMTPS id 4DBD29AC; Mon, 27 Feb 2017 20:50:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RKoLKC063149; Mon, 27 Feb 2017 20:50:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RKoLm5063146; Mon, 27 Feb 2017 20:50:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201702272050.v1RKoLm5063146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 27 Feb 2017 20:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314363 - in stable/11/sys: conf dev/intel modules modules/intelspi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 20:50:22 -0000 Author: gonzo Date: Mon Feb 27 20:50:21 2017 New Revision: 314363 URL: https://svnweb.freebsd.org/changeset/base/314363 Log: MFC r310645: [intelspi] Add SPI driver for Intel BayTrail SoC Add SPI mode (PIO-only) support for Intel Synchronous Serial Port that can be found in several Intel's products starting from PXA family. Most of implementations have slight differences in behavior and in addresses for registers subset. This driver covers only BayTrail SoC implementation for it's the only hardware I have to test it on. Driver attaches to ACPI bus only and does not have PCI or FDT support for now due to lack of hardware to test it on. "intelspi" is the best name I've managed to come up with. Linux driver name (spi-pxa2xx) does not make sense because current implementation does not support actual PXA2xx SoCs. And as far as I know there is no codename assigned to Intel SSP chip. Reviewed by: br, manu Differential Revision: https://reviews.freebsd.org/D8896 Added: stable/11/sys/dev/intel/ - copied from r310645, head/sys/dev/intel/ stable/11/sys/modules/intelspi/ - copied from r310645, head/sys/modules/intelspi/ Modified: stable/11/sys/conf/files.amd64 stable/11/sys/conf/files.i386 stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files.amd64 ============================================================================== --- stable/11/sys/conf/files.amd64 Mon Feb 27 20:08:42 2017 (r314362) +++ stable/11/sys/conf/files.amd64 Mon Feb 27 20:50:21 2017 (r314363) @@ -227,6 +227,7 @@ dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb +dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/ioat/ioat.c optional ioat pci dev/ioat/ioat_test.c optional ioat pci Modified: stable/11/sys/conf/files.i386 ============================================================================== --- stable/11/sys/conf/files.i386 Mon Feb 27 20:08:42 2017 (r314362) +++ stable/11/sys/conf/files.i386 Mon Feb 27 20:50:21 2017 (r314363) @@ -275,6 +275,7 @@ dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb +dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Mon Feb 27 20:08:42 2017 (r314362) +++ stable/11/sys/modules/Makefile Mon Feb 27 20:50:21 2017 (r314363) @@ -165,6 +165,7 @@ SUBDIR= \ ${_igb} \ ${_iir} \ imgact_binmisc \ + ${_intelspi} \ ${_io} \ ${_ioat} \ ${_ipoib} \ @@ -623,6 +624,7 @@ _hyperv= hyperv _ichwd= ichwd _ida= ida _iir= iir +_intelspi= intelspi _ipmi= ipmi _ips= ips _isci= isci From owner-svn-src-stable@freebsd.org Mon Feb 27 21:07:46 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1546CEE32C for ; Mon, 27 Feb 2017 21:07:46 +0000 (UTC) (envelope-from 0100015a816670c6-5cea53f5-32f4-43d0-9fe5-18ca7a241430-000000@amazonses.com) Received: from a8-52.smtp-out.amazonses.com (a8-52.smtp-out.amazonses.com [54.240.8.52]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 966FFBCA for ; Mon, 27 Feb 2017 21:07:46 +0000 (UTC) (envelope-from 0100015a816670c6-5cea53f5-32f4-43d0-9fe5-18ca7a241430-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1488229658; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=ug+jEsYIPhvDxpcreueQRI3XLnOiMpxh6gd4lc+iB7w=; b=xIk2FjQbZx9nq5K6gNIYTpTq2tD60ipt0/2LrVEwnWdtqZiX2qrMjTgEPDwb7Igf bm2Ck0huA/RBebe9X7iY0G4pf2A/XOyrfGvOFkcZo6qOjam0HxmhV1lSofOrGE4XozU kgNLjLXlxg9Zgf6V0vqM6EBY/gYiQXy1VIh5632A= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1488229658; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=ug+jEsYIPhvDxpcreueQRI3XLnOiMpxh6gd4lc+iB7w=; b=KvHGG2i6ehZi/rH8DccQlwLV/nShesMEUxpEYayoWCa1FNl623wgVIhZLFjgN7ry tJ60zCez51QsFzfMNQYHp5p7d4vxtMt3jsbdPkrVh6uVWCl4gqez/Zi9cSmXFRvN+/O 4dYcUSdtgog+U2AMzqvUMwmpORvrebweAw9R/HFc= Subject: Re: svn commit: r314335 - stable/10/sys/crypto/sha2 To: Ed Schouten , Andriy Gapon References: <201702271305.v1RD5HOi077424@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: Colin Percival Message-ID: <0100015a816670c6-5cea53f5-32f4-43d0-9fe5-18ca7a241430-000000@email.amazonses.com> Date: Mon, 27 Feb 2017 21:07:38 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2017.02.27-54.240.8.52 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 21:07:46 -0000 On 02/27/17 06:01, Ed Schouten wrote: > Something interesting that I noticed some time ago when comparing the > various SHA-{256,512} implementations: there is no need to store the > entire extended message in W. During every iteration of this loop, > RNDr() and MSCH() never go more than 16 elements back. > > Say, if you were to modify MSCH() to something like this: > >> +#define MSCH(W, ii) \ >> + W[ii] += s1(W[(ii + 14) % 16]) + W[(ii + 9) % 16] + s0(W[(ii + 1)) % 16]) > > Then it will compute the next chunk of the extended message in-place. > RNDr() must then be adjusted to use W[i] instead of W[i + ii], of > course. W then only needs to hold 16 elements instead of 64 or 80. I tried this, and it was slower. The larger array avoids write-after-read accesses and results in better code being emitted due to more flexible instruction scheduling. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-stable@freebsd.org Mon Feb 27 21:15:10 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D729DCEE72B for ; Mon, 27 Feb 2017 21:15:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22e.google.com (mail-yw0-x22e.google.com [IPv6:2607:f8b0:4002:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E82E212 for ; Mon, 27 Feb 2017 21:15:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22e.google.com with SMTP id l138so20979564ywc.0 for ; Mon, 27 Feb 2017 13:15:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UxA5OUe1MEE6lGaUZt5gLA4lUYkidGHazz68m0zWuq4=; b=YWUk5VkMvTTlk/izGK9u0ZxbVumgQgiEpdi6+sL1HmRzm+7jz3OXokbb0ixKLT3zpw /rK0R6M7iHiaqlgEUnjwLWQaxPRqDd+WNniBxEj1PmzKMc4qc8m4dZ0LKbVtNv+FubhN qsIJN0cu9AmubEnqv+Vz0fJyZcWuu2oJFxScm9kgJhFlxFDQjueUuB/duaM/DRAZzUfk 4bJXai2nMeMOLp+1dvnjIut/aRXJKHTmCESVC99Oldbjh87Is6JGz0bMXf//XSyrGReL wS8a2EASIZX4eexsbT8yPeyXP4Upw3qHL6pUYd2hSubKrLHQXwbdLJcravIWv2edgQZk 3Gbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UxA5OUe1MEE6lGaUZt5gLA4lUYkidGHazz68m0zWuq4=; b=jc4ZRrDNI0p1JI0DHfCanfDEQ3Asdv8ysQsSFbplmj9JulTqZ+Pe1xpseB0+MSOQOA 1ZVetEy+pzOWvGCLqan0z+Mu3XUI69i17C4BlhA0agjX0nL0EeRaImhFV/4Bhw1XQ/5T Z3TkA0XtDDOkBHm8X/L/SBJMyf6c54yN0v0wfb/3AZlLWj/5Ctlqgs1HTV9O7DVkTiW0 8fMUyj/92jdPsbMxl4aN9shEn2SZk60BLSfykcU2zy7r9l6Mhz01wG5BGjHsGcSOQr3O paj3JYSPnmonacg2tT85g9sgWnJbQVoulfoAAxA+NZMdp6h84pt+o+Q8zZUMo++hw4I0 JJ0Q== X-Gm-Message-State: AMke39lzmetrRCHraChzEWbpDJD7P2vcK10dbnXoMev7VwHWnb54czWWc8VHZyxgXP74XaRHXJNbe7TAdMX+0Q== X-Received: by 10.13.225.142 with SMTP id k136mr12978092ywe.178.1488230109224; Mon, 27 Feb 2017 13:15:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.51.198 with HTTP; Mon, 27 Feb 2017 13:14:38 -0800 (PST) In-Reply-To: <0100015a8166843e-66ad72c4-7cc0-4fc5-95eb-47b5ea66b36f-000000@email.amazonses.com> References: <201702271305.v1RD5HOi077424@repo.freebsd.org> <0100015a8166843e-66ad72c4-7cc0-4fc5-95eb-47b5ea66b36f-000000@email.amazonses.com> From: Ed Schouten Date: Mon, 27 Feb 2017 22:14:38 +0100 Message-ID: Subject: Re: svn commit: r314335 - stable/10/sys/crypto/sha2 To: Colin Percival Cc: Andriy Gapon , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 21:15:10 -0000 2017-02-27 22:07 GMT+01:00 Colin Percival : > I tried this, and it was slower. The larger array avoids write-after-read > accesses and results in better code being emitted due to more flexible > instruction scheduling. Ah, makes sense. Thanks for testing this regardless! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-stable@freebsd.org Mon Feb 27 22:53:27 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00CDDCF0D96; Mon, 27 Feb 2017 22:53:27 +0000 (UTC) (envelope-from gonzo@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 mx1.freebsd.org (Postfix) with ESMTPS id C1260AE3; Mon, 27 Feb 2017 22:53:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1RMrPHY014120; Mon, 27 Feb 2017 22:53:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1RMrPsq014119; Mon, 27 Feb 2017 22:53:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201702272253.v1RMrPsq014119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 27 Feb 2017 22:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314364 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 22:53:27 -0000 Author: gonzo Date: Mon Feb 27 22:53:25 2017 New Revision: 314364 URL: https://svnweb.freebsd.org/changeset/base/314364 Log: MFC r313712: [sdhci_acpi] Add support for Bay Trail SDHC SD card slot Add ACPI device 80860F14 with _UID 3 to the list of known devices. It make SD card available on NUCs and Minnowboard. Previously added _UID 1 covered only eMMC devices. Reported by: kib@ Modified: stable/11/sys/dev/sdhci/sdhci_acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_acpi.c Mon Feb 27 20:50:21 2017 (r314363) +++ stable/11/sys/dev/sdhci/sdhci_acpi.c Mon Feb 27 22:53:25 2017 (r314364) @@ -60,9 +60,11 @@ static const struct sdhci_acpi_device { const char *desc; u_int quirks; } sdhci_acpi_devices[] = { - { "80860F14", 1, "Intel Bay Trail eMMC 4.5 Controller", + { "80860F14", 1, "Intel Bay Trail SD Host Controller", SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { "80860F14", 3, "Intel Bay Trail SD Host Controller", + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, { "80860F16", 0, "Intel Bay Trail SD Host Controller", 0 }, { NULL, 0, NULL, 0} From owner-svn-src-stable@freebsd.org Tue Feb 28 00:56:35 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE70CEFC1D; Tue, 28 Feb 2017 00:56:35 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 296CE62A; Tue, 28 Feb 2017 00:56:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S0uYck060287; Tue, 28 Feb 2017 00:56:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S0uX8t060278; Tue, 28 Feb 2017 00:56:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702280056.v1S0uX8t060278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Feb 2017 00:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314366 - in stable/10/lib/libnetbsd: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 00:56:35 -0000 Author: ngie Date: Tue Feb 28 00:56:33 2017 New Revision: 314366 URL: https://svnweb.freebsd.org/changeset/base/314366 Log: Note: this change reintroduces r314020 after r314327, r314330, and r314332 MFC r313404: Improve libnetbsd compatibility with NetBSD This change is being made to diff reduce/reduce duplication in contrib/netbsd-tests and to facilitate further porting of software from NetBSD Add the following headers: - sys/event.h: -- sys/types.h is required for kqueue on FreeBSD, but not NetBSD. - sys/types.h: -- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD. Pull in sys/param.h to have parity with NetBSD. - sys/wait.h: -- Define wrusage as __wrusage for parity with NetBSD typedef. - glob.h -- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef. - pthread.h: -- Pull in pthread_np.h for _np functions defined separately on FreeBSD. Improve compatibility with NetBSD in the following headers: - sha1.h: -- define SHA1_CTX as SHA_CTX -- define SHA1Final as SHA1_Final - sha2.h: -- #include sha384 to pick up all of the SHA 384 bit macros and definitions. - util.h: -- Add sys/types.h to util.h to pollute the header for types used in flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them for the functions. Added: stable/10/lib/libnetbsd/glob.h - copied unchanged from r313404, head/lib/libnetbsd/glob.h stable/10/lib/libnetbsd/pthread.h - copied unchanged from r313404, head/lib/libnetbsd/pthread.h stable/10/lib/libnetbsd/sys/event.h - copied unchanged from r313404, head/lib/libnetbsd/sys/event.h stable/10/lib/libnetbsd/sys/types.h - copied unchanged from r313404, head/lib/libnetbsd/sys/types.h stable/10/lib/libnetbsd/sys/wait.h - copied unchanged from r313404, head/lib/libnetbsd/sys/wait.h Modified: stable/10/lib/libnetbsd/sha1.h stable/10/lib/libnetbsd/sha2.h stable/10/lib/libnetbsd/util.h Directory Properties: stable/10/ (props changed) Copied: stable/10/lib/libnetbsd/glob.h (from r313404, head/lib/libnetbsd/glob.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/glob.h Tue Feb 28 00:56:33 2017 (r314366, copy of r313404, head/lib/libnetbsd/glob.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBNETBSD_GLOB_H_ +#define _LIBNETBSD_GLOB_H_ + +#include_next + +#ifndef __gl_stat_t +#define __gl_stat_t struct stat +#endif + +#endif Copied: stable/10/lib/libnetbsd/pthread.h (from r313404, head/lib/libnetbsd/pthread.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/pthread.h Tue Feb 28 00:56:33 2017 (r314366, copy of r313404, head/lib/libnetbsd/pthread.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBNETBSD_PTHREAD_H_ +#define _LIBNETBSD_PTHREAD_H_ + +#include_next +#include + +#endif Modified: stable/10/lib/libnetbsd/sha1.h ============================================================================== --- stable/10/lib/libnetbsd/sha1.h Mon Feb 27 23:38:51 2017 (r314365) +++ stable/10/lib/libnetbsd/sha1.h Tue Feb 28 00:56:33 2017 (r314366) @@ -35,8 +35,11 @@ #include +#define SHA1_CTX SHA_CTX + #define SHA1End SHA1_End #define SHA1File SHA1_File +#define SHA1Final SHA1_Final #define SHA1Init SHA1_Init #define SHA1Update SHA1_Update Modified: stable/10/lib/libnetbsd/sha2.h ============================================================================== --- stable/10/lib/libnetbsd/sha2.h Mon Feb 27 23:38:51 2017 (r314365) +++ stable/10/lib/libnetbsd/sha2.h Tue Feb 28 00:56:33 2017 (r314366) @@ -34,6 +34,7 @@ #define _SHA2_H_ #include +#include #include #endif /* _SHA2_H_ */ Copied: stable/10/lib/libnetbsd/sys/event.h (from r313404, head/lib/libnetbsd/sys/event.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/sys/event.h Tue Feb 28 00:56:33 2017 (r314366, copy of r313404, head/lib/libnetbsd/sys/event.h) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_EVENT_H_ +#define _LIBNETBSD_SYS_EVENT_H_ + +/* + * kqueue on FreeBSD requires sys/event.h, which in turn uses uintptr_t + * (defined in sys/types.h), so in order to accomodate their requirements, + * pull in sys/types.h as part of event.h. + */ +#include + +#include_next + +#endif Copied: stable/10/lib/libnetbsd/sys/types.h (from r313404, head/lib/libnetbsd/sys/types.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/sys/types.h Tue Feb 28 00:56:33 2017 (r314366, copy of r313404, head/lib/libnetbsd/sys/types.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_TYPES_H_ +#define _LIBNETBSD_SYS_TYPES_H_ + +#include_next + +#include /* For NBBY */ + +#endif Copied: stable/10/lib/libnetbsd/sys/wait.h (from r313404, head/lib/libnetbsd/sys/wait.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/sys/wait.h Tue Feb 28 00:56:33 2017 (r314366, copy of r313404, head/lib/libnetbsd/sys/wait.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_WAIT_H_ +#define _LIBNETBSD_SYS_WAIT_H_ + +#include_next + +#define wrusage __wrusage + +#endif Modified: stable/10/lib/libnetbsd/util.h ============================================================================== --- stable/10/lib/libnetbsd/util.h Mon Feb 27 23:38:51 2017 (r314365) +++ stable/10/lib/libnetbsd/util.h Tue Feb 28 00:56:33 2017 (r314366) @@ -30,12 +30,13 @@ * SUCH DAMAGE. */ -#ifndef _UTIL_H_ -#define _UTIL_H_ +#ifndef _LIBNETBSD_UTIL_H_ +#define _LIBNETBSD_UTIL_H_ +#include #include char *flags_to_string(u_long flags, const char *def); int string_to_flags(char **stringp, u_long *setp, u_long *clrp); -#endif /* _UTIL_H_ */ +#endif From owner-svn-src-stable@freebsd.org Tue Feb 28 00:57:46 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B45ADCEFCCD; Tue, 28 Feb 2017 00:57:46 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 83A98807; Tue, 28 Feb 2017 00:57:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S0vjwL060387; Tue, 28 Feb 2017 00:57:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S0vjIR060386; Tue, 28 Feb 2017 00:57:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702280057.v1S0vjIR060386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Feb 2017 00:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314367 - stable/11/tools/build/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 00:57:46 -0000 Author: ngie Date: Tue Feb 28 00:57:45 2017 New Revision: 314367 URL: https://svnweb.freebsd.org/changeset/base/314367 Log: MFC r314244: Remove MK_OBJC block It is no longer represented via src.conf(5) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 28 00:56:33 2017 (r314366) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 28 00:57:45 2017 (r314367) @@ -6666,10 +6666,6 @@ OLD_FILES+=usr/share/man/man8/ntpq.8.gz OLD_FILES+=usr/share/man/man8/ntptime.8.gz .endif -#.if ${MK_OBJC} == no -# to be filled in -#.endif - .if ${MK_OPENSSH} == no OLD_FILES+=etc/rc.d/sshd OLD_FILES+=etc/ssh/moduli From owner-svn-src-stable@freebsd.org Tue Feb 28 00:58:17 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCC22CEFD56; Tue, 28 Feb 2017 00:58:17 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id 85D9D948; Tue, 28 Feb 2017 00:58:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S0wGEq060454; Tue, 28 Feb 2017 00:58:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S0wGQN060453; Tue, 28 Feb 2017 00:58:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702280058.v1S0wGQN060453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Feb 2017 00:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314368 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 00:58:17 -0000 Author: ngie Date: Tue Feb 28 00:58:16 2017 New Revision: 314368 URL: https://svnweb.freebsd.org/changeset/base/314368 Log: MFC r314244: Remove MK_OBJC block It is no longer represented via src.conf(5) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 28 00:57:45 2017 (r314367) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 28 00:58:16 2017 (r314368) @@ -4043,10 +4043,6 @@ OLD_FILES+=usr/share/man/man8/ntpq.8.gz OLD_FILES+=usr/share/man/man8/ntptime.8.gz .endif -#.if ${MK_OBJC} == no -# to be filled in -#.endif - .if ${MK_OPENSSH} == no OLD_FILES+=usr/bin/sftp OLD_FILES+=usr/bin/ssh From owner-svn-src-stable@freebsd.org Tue Feb 28 06:28:18 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 920BFCF1107; Tue, 28 Feb 2017 06:28:18 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 5EAC920D; Tue, 28 Feb 2017 06:28:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S6SHcv088538; Tue, 28 Feb 2017 06:28:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S6SHwO088537; Tue, 28 Feb 2017 06:28:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702280628.v1S6SHwO088537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Feb 2017 06:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314376 - stable/11/sys/dev/iscsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 06:28:18 -0000 Author: mav Date: Tue Feb 28 06:28:17 2017 New Revision: 314376 URL: https://svnweb.freebsd.org/changeset/base/314376 Log: MFC r313738: Temporary attach AHS to BHS to calculate header digest. Modified: stable/11/sys/dev/iscsi/icl_soft.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/icl_soft.c ============================================================================== --- stable/11/sys/dev/iscsi/icl_soft.c Tue Feb 28 05:24:06 2017 (r314375) +++ stable/11/sys/dev/iscsi/icl_soft.c Tue Feb 28 06:28:17 2017 (r314376) @@ -389,10 +389,10 @@ icl_pdu_check_header_digest(struct icl_p *availablep -= ISCSI_HEADER_DIGEST_SIZE; - /* - * XXX: Handle AHS. - */ + /* Temporary attach AHS to BHS to calculate header digest. */ + request->ip_bhs_mbuf->m_next = request->ip_ahs_mbuf; valid_digest = icl_mbuf_to_crc32c(request->ip_bhs_mbuf); + request->ip_bhs_mbuf->m_next = NULL; if (received_digest != valid_digest) { ICL_WARN("header digest check failed; got 0x%x, " "should be 0x%x", received_digest, valid_digest); From owner-svn-src-stable@freebsd.org Tue Feb 28 06:29:46 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37E6BCF11A6; Tue, 28 Feb 2017 06:29:46 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id EE20B3C3; Tue, 28 Feb 2017 06:29:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S6Tjfo088668; Tue, 28 Feb 2017 06:29:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S6Tjpx088667; Tue, 28 Feb 2017 06:29:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702280629.v1S6Tjpx088667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Feb 2017 06:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314377 - stable/11/sys/dev/iscsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 06:29:46 -0000 Author: mav Date: Tue Feb 28 06:29:44 2017 New Revision: 314377 URL: https://svnweb.freebsd.org/changeset/base/314377 Log: MFC r313731: Do not rely on data alignment after m_pullup(). In general case m_pullup() does not really guarantee any data alignment. Instead of depenting on side effects caused by data being always copied out of mbuf cluster (which is probably a bug by itself), always allocate aligned BHS buffer and read data there directly from socket. While there, reuse new icl_conn_receive_buf() function to read digests. The code could probably be even more optimized to aggregate those reads, but until that done, this is still easier then the way it was before. Modified: stable/11/sys/dev/iscsi/icl_soft.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/icl_soft.c ============================================================================== --- stable/11/sys/dev/iscsi/icl_soft.c Tue Feb 28 06:28:17 2017 (r314376) +++ stable/11/sys/dev/iscsi/icl_soft.c Tue Feb 28 06:29:44 2017 (r314377) @@ -169,6 +169,40 @@ icl_conn_receive(struct icl_conn *ic, si return (m); } +static int +icl_conn_receive_buf(struct icl_conn *ic, void *buf, size_t len) +{ + struct iovec iov[1]; + struct uio uio; + struct socket *so; + int error, flags; + + so = ic->ic_socket; + + memset(&uio, 0, sizeof(uio)); + iov[0].iov_base = buf; + iov[0].iov_len = len; + uio.uio_iov = iov; + uio.uio_iovcnt = 1; + uio.uio_offset = 0; + uio.uio_resid = len; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + + flags = MSG_DONTWAIT; + error = soreceive(so, NULL, &uio, NULL, NULL, &flags); + if (error != 0) { + ICL_DEBUG("soreceive error %d", error); + return (-1); + } + if (uio.uio_resid != 0) { + ICL_DEBUG("short read"); + return (-1); + } + + return (0); +} + static struct icl_pdu * icl_pdu_new_empty(struct icl_conn *ic, int flags) { @@ -229,7 +263,7 @@ icl_soft_conn_new_pdu(struct icl_conn *i ip->ip_bhs_mbuf = m_getm2(NULL, sizeof(struct iscsi_bhs), flags, MT_DATA, M_PKTHDR); if (ip->ip_bhs_mbuf == NULL) { - ICL_WARN("failed to allocate %zd bytes", sizeof(*ip)); + ICL_WARN("failed to allocate BHS mbuf"); icl_pdu_free(ip); return (NULL); } @@ -308,28 +342,13 @@ icl_pdu_size(const struct icl_pdu *respo static int icl_pdu_receive_bhs(struct icl_pdu *request, size_t *availablep) { - struct mbuf *m; - m = icl_conn_receive(request->ip_conn, sizeof(struct iscsi_bhs)); - if (m == NULL) { + if (icl_conn_receive_buf(request->ip_conn, + request->ip_bhs, sizeof(struct iscsi_bhs))) { ICL_DEBUG("failed to receive BHS"); return (-1); } - request->ip_bhs_mbuf = m_pullup(m, sizeof(struct iscsi_bhs)); - if (request->ip_bhs_mbuf == NULL) { - ICL_WARN("m_pullup failed"); - return (-1); - } - request->ip_bhs = mtod(request->ip_bhs_mbuf, struct iscsi_bhs *); - - /* - * XXX: For architectures with strict alignment requirements - * we may need to allocate ip_bhs and copy the data into it. - * For some reason, though, not doing this doesn't seem - * to cause problems; tested on sparc64. - */ - *availablep -= sizeof(struct iscsi_bhs); return (0); } @@ -371,22 +390,17 @@ icl_mbuf_to_crc32c(const struct mbuf *m0 static int icl_pdu_check_header_digest(struct icl_pdu *request, size_t *availablep) { - struct mbuf *m; uint32_t received_digest, valid_digest; if (request->ip_conn->ic_header_crc32c == false) return (0); - m = icl_conn_receive(request->ip_conn, ISCSI_HEADER_DIGEST_SIZE); - if (m == NULL) { + CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE); + if (icl_conn_receive_buf(request->ip_conn, + &received_digest, ISCSI_HEADER_DIGEST_SIZE)) { ICL_DEBUG("failed to receive header digest"); return (-1); } - - CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE); - m_copydata(m, 0, ISCSI_HEADER_DIGEST_SIZE, (void *)&received_digest); - m_freem(m); - *availablep -= ISCSI_HEADER_DIGEST_SIZE; /* Temporary attach AHS to BHS to calculate header digest. */ @@ -526,7 +540,6 @@ icl_pdu_receive_data_segment(struct icl_ static int icl_pdu_check_data_digest(struct icl_pdu *request, size_t *availablep) { - struct mbuf *m; uint32_t received_digest, valid_digest; if (request->ip_conn->ic_data_crc32c == false) @@ -535,16 +548,12 @@ icl_pdu_check_data_digest(struct icl_pdu if (request->ip_data_len == 0) return (0); - m = icl_conn_receive(request->ip_conn, ISCSI_DATA_DIGEST_SIZE); - if (m == NULL) { + CTASSERT(sizeof(received_digest) == ISCSI_DATA_DIGEST_SIZE); + if (icl_conn_receive_buf(request->ip_conn, + &received_digest, ISCSI_DATA_DIGEST_SIZE)) { ICL_DEBUG("failed to receive data digest"); return (-1); } - - CTASSERT(sizeof(received_digest) == ISCSI_DATA_DIGEST_SIZE); - m_copydata(m, 0, ISCSI_DATA_DIGEST_SIZE, (void *)&received_digest); - m_freem(m); - *availablep -= ISCSI_DATA_DIGEST_SIZE; /* @@ -580,7 +589,7 @@ icl_conn_receive_pdu(struct icl_conn *ic if (ic->ic_receive_state == ICL_CONN_STATE_BHS) { KASSERT(ic->ic_receive_pdu == NULL, ("ic->ic_receive_pdu != NULL")); - request = icl_pdu_new_empty(ic, M_NOWAIT); + request = icl_soft_conn_new_pdu(ic, M_NOWAIT); if (request == NULL) { ICL_DEBUG("failed to allocate PDU; " "dropping connection"); From owner-svn-src-stable@freebsd.org Tue Feb 28 06:30:44 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D1FECF121A; Tue, 28 Feb 2017 06:30:44 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id C92A079D; Tue, 28 Feb 2017 06:30:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S6UgX4088779; Tue, 28 Feb 2017 06:30:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S6UgLH088778; Tue, 28 Feb 2017 06:30:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702280630.v1S6UgLH088778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Feb 2017 06:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314378 - stable/11/sys/dev/iscsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 06:30:44 -0000 Author: mav Date: Tue Feb 28 06:30:42 2017 New Revision: 314378 URL: https://svnweb.freebsd.org/changeset/base/314378 Log: MFC r313739: Directly call m_gethdr() instead of m_getm2() for BHS. All this code is based on assumption that data will be stored in one piece, and since buffer size if known and fixed, it is easier to hardcode it. Modified: stable/11/sys/dev/iscsi/icl_soft.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/icl_soft.c ============================================================================== --- stable/11/sys/dev/iscsi/icl_soft.c Tue Feb 28 06:29:44 2017 (r314377) +++ stable/11/sys/dev/iscsi/icl_soft.c Tue Feb 28 06:30:42 2017 (r314378) @@ -260,8 +260,8 @@ icl_soft_conn_new_pdu(struct icl_conn *i if (ip == NULL) return (NULL); - ip->ip_bhs_mbuf = m_getm2(NULL, sizeof(struct iscsi_bhs), - flags, MT_DATA, M_PKTHDR); + CTASSERT(sizeof(struct iscsi_bhs) <= MHLEN); + ip->ip_bhs_mbuf = m_gethdr(flags, MT_DATA); if (ip->ip_bhs_mbuf == NULL) { ICL_WARN("failed to allocate BHS mbuf"); icl_pdu_free(ip); From owner-svn-src-stable@freebsd.org Tue Feb 28 06:31:35 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65939CF1384; Tue, 28 Feb 2017 06:31:35 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 1C737A77; Tue, 28 Feb 2017 06:31:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S6VYwE089527; Tue, 28 Feb 2017 06:31:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S6VY4r089526; Tue, 28 Feb 2017 06:31:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702280631.v1S6VY4r089526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Feb 2017 06:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314379 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 06:31:35 -0000 Author: mav Date: Tue Feb 28 06:31:34 2017 New Revision: 314379 URL: https://svnweb.freebsd.org/changeset/base/314379 Log: MFC r313744: No need to erase sense_data when sense_len is set to zero. Modified: stable/11/sys/cam/ctl/ctl_error.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_error.c Tue Feb 28 06:30:42 2017 (r314378) +++ stable/11/sys/cam/ctl/ctl_error.c Tue Feb 28 06:31:34 2017 (r314379) @@ -920,10 +920,7 @@ ctl_set_data_phase_error(struct ctl_scsi void ctl_set_reservation_conflict(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -932,10 +929,7 @@ ctl_set_reservation_conflict(struct ctl_ void ctl_set_queue_full(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_QUEUE_FULL; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -944,10 +938,7 @@ ctl_set_queue_full(struct ctl_scsiio *ct void ctl_set_busy(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_BUSY; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -956,10 +947,7 @@ ctl_set_busy(struct ctl_scsiio *ctsio) void ctl_set_task_aborted(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_TASK_ABORTED; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_CMD_ABORTED; @@ -992,10 +980,7 @@ ctl_set_space_alloc_fail(struct ctl_scsi void ctl_set_success(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_OK; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SUCCESS; From owner-svn-src-stable@freebsd.org Tue Feb 28 06:32:02 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF064CF1400; Tue, 28 Feb 2017 06:32:02 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 86DD4C0D; Tue, 28 Feb 2017 06:32:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S6W1UQ092390; Tue, 28 Feb 2017 06:32:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S6W1Oc092389; Tue, 28 Feb 2017 06:32:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702280632.v1S6W1Oc092389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Feb 2017 06:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314380 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 06:32:03 -0000 Author: mav Date: Tue Feb 28 06:32:01 2017 New Revision: 314380 URL: https://svnweb.freebsd.org/changeset/base/314380 Log: MFC r313744: No need to erase sense_data when sense_len is set to zero. Modified: stable/10/sys/cam/ctl/ctl_error.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Tue Feb 28 06:31:34 2017 (r314379) +++ stable/10/sys/cam/ctl/ctl_error.c Tue Feb 28 06:32:01 2017 (r314380) @@ -920,10 +920,7 @@ ctl_set_data_phase_error(struct ctl_scsi void ctl_set_reservation_conflict(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -932,10 +929,7 @@ ctl_set_reservation_conflict(struct ctl_ void ctl_set_queue_full(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_QUEUE_FULL; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -944,10 +938,7 @@ ctl_set_queue_full(struct ctl_scsiio *ct void ctl_set_busy(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_BUSY; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -956,10 +947,7 @@ ctl_set_busy(struct ctl_scsiio *ctsio) void ctl_set_task_aborted(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_TASK_ABORTED; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_CMD_ABORTED; @@ -992,10 +980,7 @@ ctl_set_space_alloc_fail(struct ctl_scsi void ctl_set_success(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_OK; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SUCCESS; From owner-svn-src-stable@freebsd.org Tue Feb 28 06:46:44 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2569BCF16CB; Tue, 28 Feb 2017 06:46:44 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id E4769616; Tue, 28 Feb 2017 06:46:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1S6kg1U096646; Tue, 28 Feb 2017 06:46:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1S6kf9G096633; Tue, 28 Feb 2017 06:46:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702280646.v1S6kf9G096633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Feb 2017 06:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314381 - in stable/11/sys: cam/scsi dev/advansys dev/aha dev/ahci dev/arcmsr dev/ata dev/buslogic dev/hptmv dev/mvs dev/ncr dev/siis dev/sym dev/trm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 06:46:44 -0000 Author: mav Date: Tue Feb 28 06:46:41 2017 New Revision: 314381 URL: https://svnweb.freebsd.org/changeset/base/314381 Log: MFC r313949: Remove dead mentions of CAM target mode APIs from drivers. This makes grepping kernel for target mode implementation much easier. Modified: stable/11/sys/cam/scsi/scsi_low.c stable/11/sys/dev/advansys/advansys.c stable/11/sys/dev/aha/aha.c stable/11/sys/dev/ahci/ahci.c stable/11/sys/dev/arcmsr/arcmsr.c stable/11/sys/dev/ata/ata-all.c stable/11/sys/dev/buslogic/bt.c stable/11/sys/dev/hptmv/entry.c stable/11/sys/dev/mvs/mvs.c stable/11/sys/dev/ncr/ncr.c stable/11/sys/dev/siis/siis.c stable/11/sys/dev/sym/sym_hipd.c stable/11/sys/dev/trm/trm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_low.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_low.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/cam/scsi/scsi_low.c Tue Feb 28 06:46:41 2017 (r314381) @@ -479,15 +479,6 @@ scsi_low_scsi_action_cam(sim, ccb) #endif /* SCSI_LOW_DEBUG */ break; - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ - /* XXX Implement */ - ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); - break; - case XPT_ABORT: /* Abort the specified CCB */ #ifdef SCSI_LOW_DIAGNOSTIC if (target == CAM_TARGET_WILDCARD || lun == CAM_LUN_WILDCARD) Modified: stable/11/sys/dev/advansys/advansys.c ============================================================================== --- stable/11/sys/dev/advansys/advansys.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/advansys/advansys.c Tue Feb 28 06:46:41 2017 (r314381) @@ -233,10 +233,6 @@ adv_action(struct cam_sim *sim, union cc break; } case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ - case XPT_EN_LUN: /* Enable LUN as a target */ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/aha/aha.c ============================================================================== --- stable/11/sys/dev/aha/aha.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/aha/aha.c Tue Feb 28 06:46:41 2017 (r314381) @@ -838,10 +838,6 @@ ahaaction(struct cam_sim *sim, union ccb } break; } - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/ahci/ahci.c Tue Feb 28 06:46:41 2017 (r314381) @@ -2570,10 +2570,6 @@ ahciaction(struct cam_sim *sim, union cc } ahci_begin_transaction(ch, ccb); return; - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/11/sys/dev/arcmsr/arcmsr.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/arcmsr/arcmsr.c Tue Feb 28 06:46:41 2017 (r314381) @@ -2883,12 +2883,6 @@ static void arcmsr_action(struct cam_sim } break; } - case XPT_TARGET_IO: { - /* target mode not yet support vendor specific commands. */ - pccb->ccb_h.status |= CAM_REQ_CMP; - xpt_done(pccb); - break; - } case XPT_PATH_INQ: { struct ccb_pathinq *cpi = &pccb->cpi; @@ -2938,7 +2932,6 @@ static void arcmsr_action(struct cam_sim pabort_ccb = pccb->cab.abort_ccb; switch (pabort_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: case XPT_CONT_TARGET_IO: if(arcmsr_seek_cmd2abort(pabort_ccb)==TRUE) { pabort_ccb->ccb_h.status |= CAM_REQ_ABORTED; Modified: stable/11/sys/dev/ata/ata-all.c ============================================================================== --- stable/11/sys/dev/ata/ata-all.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/ata/ata-all.c Tue Feb 28 06:46:41 2017 (r314381) @@ -1013,10 +1013,6 @@ ataaction(struct cam_sim *sim, union ccb } ata_cam_begin_transaction(dev, ccb); return; - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/buslogic/bt.c ============================================================================== --- stable/11/sys/dev/buslogic/bt.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/buslogic/bt.c Tue Feb 28 06:46:41 2017 (r314381) @@ -1233,10 +1233,6 @@ btaction(struct cam_sim *sim, union ccb } break; } - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/hptmv/entry.c ============================================================================== --- stable/11/sys/dev/hptmv/entry.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/hptmv/entry.c Tue Feb 28 06:46:41 2017 (r314381) @@ -2289,10 +2289,6 @@ hpt_action(struct cam_sim *sim, union cc break; case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ case XPT_TERM_IO: /* Terminate the I/O process */ /* XXX Implement */ Modified: stable/11/sys/dev/mvs/mvs.c ============================================================================== --- stable/11/sys/dev/mvs/mvs.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/mvs/mvs.c Tue Feb 28 06:46:41 2017 (r314381) @@ -2288,10 +2288,6 @@ mvsaction(struct cam_sim *sim, union ccb } mvs_begin_transaction(dev, ccb); return; - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/ncr/ncr.c ============================================================================== --- stable/11/sys/dev/ncr/ncr.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/ncr/ncr.c Tue Feb 28 06:46:41 2017 (r314381) @@ -4152,10 +4152,6 @@ ncr_action (struct cam_sim *sim, union c break; } case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/siis/siis.c ============================================================================== --- stable/11/sys/dev/siis/siis.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/siis/siis.c Tue Feb 28 06:46:41 2017 (r314381) @@ -1835,10 +1835,6 @@ siisaction(struct cam_sim *sim, union cc } siis_begin_transaction(dev, ccb); return; - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; Modified: stable/11/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/11/sys/dev/sym/sym_hipd.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/sym/sym_hipd.c Tue Feb 28 06:46:41 2017 (r314381) @@ -8090,11 +8090,6 @@ static void sym_action2(struct cam_sim * sym_init (np, 1); sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - case XPT_ACCEPT_TARGET_IO: - case XPT_CONT_TARGET_IO: - case XPT_EN_LUN: - case XPT_NOTIFY_ACK: - case XPT_IMMED_NOTIFY: case XPT_TERM_IO: default: sym_xpt_done2(np, ccb, CAM_REQ_INVALID); Modified: stable/11/sys/dev/trm/trm.c ============================================================================== --- stable/11/sys/dev/trm/trm.c Tue Feb 28 06:32:01 2017 (r314380) +++ stable/11/sys/dev/trm/trm.c Tue Feb 28 06:46:41 2017 (r314381) @@ -543,11 +543,6 @@ trm_action(struct cam_sim *psim, union c target_lun = pccb->ccb_h.target_lun; switch (pccb->ccb_h.func_code) { - case XPT_NOOP: - TRM_DPRINTF(" XPT_NOOP \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; /* * Execute the requested I/O operation */ @@ -623,16 +618,6 @@ trm_action(struct cam_sim *psim, union c } break; } - case XPT_GDEV_TYPE: - TRM_DPRINTF(" XPT_GDEV_TYPE \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - case XPT_GDEVLIST: - TRM_DPRINTF(" XPT_GDEVLIST \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; /* * Path routing inquiry * Path Inquiry CCB @@ -661,76 +646,33 @@ trm_action(struct cam_sim *psim, union c cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; xpt_done(pccb); - } break; + } /* - * Release a frozen SIM queue - * Release SIM Queue + * XPT_ABORT = 0x10, Abort the specified CCB + * Abort XPT request CCB */ - case XPT_REL_SIMQ: - TRM_DPRINTF(" XPT_REL_SIMQ \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Set Asynchronous Callback Parameters - * Set Asynchronous Callback CCB - */ - case XPT_SASYNC_CB: - TRM_DPRINTF(" XPT_SASYNC_CB \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Set device type information - * Set Device Type CCB - */ - case XPT_SDEV_TYPE: - TRM_DPRINTF(" XPT_SDEV_TYPE \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Get EDT entries matching the given pattern - */ - case XPT_DEV_MATCH: - TRM_DPRINTF(" XPT_DEV_MATCH \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Turn on debugging for a bus, target or lun - */ - case XPT_DEBUG: - TRM_DPRINTF(" XPT_DEBUG \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * XPT_ABORT = 0x10, Abort the specified CCB - * Abort XPT request CCB - */ case XPT_ABORT: TRM_DPRINTF(" XPT_ABORT \n"); pccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(pccb); break; /* - * Reset the specified SCSI bus - * Reset SCSI Bus CCB - */ - case XPT_RESET_BUS: { + * Reset the specified SCSI bus + * Reset SCSI Bus CCB + */ + case XPT_RESET_BUS: { int i; TRM_DPRINTF(" XPT_RESET_BUS \n"); - trm_reset(pACB); + trm_reset(pACB); pACB->ACBFlag=0; for (i=0; i<500; i++) DELAY(1000); pccb->ccb_h.status = CAM_REQ_CMP; xpt_done(pccb); - } break; + } /* * Bus Device Reset the specified SCSI device * Reset SCSI Device CCB @@ -929,92 +871,6 @@ trm_action(struct cam_sim *psim, union c cam_calc_geometry(&pccb->ccg, /*extended*/1); xpt_done(pccb); break; - case XPT_ENG_INQ: - TRM_DPRINTF(" XPT_ENG_INQ \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * HBA execute engine request - * This structure must match SCSIIO size - */ - case XPT_ENG_EXEC: - TRM_DPRINTF(" XPT_ENG_EXEC \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * XPT_EN_LUN = 0x30, Enable LUN as a target - * Target mode structures. - */ - case XPT_EN_LUN: - /* - * Don't (yet?) support vendor - * specific commands. - */ - TRM_DPRINTF(" XPT_EN_LUN \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Execute target I/O request - */ - case XPT_TARGET_IO: - /* - * Don't (yet?) support vendor - * specific commands. - */ - TRM_DPRINTF(" XPT_TARGET_IO \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Accept Host Target Mode CDB - */ - case XPT_ACCEPT_TARGET_IO: - /* - * Don't (yet?) support vendor - * specific commands. - */ - TRM_DPRINTF(" XPT_ACCEPT_TARGET_IO \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Continue Host Target I/O Connection - */ - case XPT_CONT_TARGET_IO: - /* - * Don't (yet?) support vendor - * specific commands. - */ - TRM_DPRINTF(" XPT_CONT_TARGET_IO \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Notify Host Target driver of event - */ - case XPT_IMMED_NOTIFY: - TRM_DPRINTF(" XPT_IMMED_NOTIFY \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * Acknowledgement of event - */ - case XPT_NOTIFY_ACK: - TRM_DPRINTF(" XPT_NOTIFY_ACK \n"); - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - /* - * XPT_VUNIQUE = 0x80 - */ - case XPT_VUNIQUE: - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; default: pccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(pccb); From owner-svn-src-stable@freebsd.org Tue Feb 28 11:41:59 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A6A7CF1C55; Tue, 28 Feb 2017 11:41:59 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id EDEA9DB7; Tue, 28 Feb 2017 11:41:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SBfwqC016509; Tue, 28 Feb 2017 11:41:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SBfwdK016508; Tue, 28 Feb 2017 11:41:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702281141.v1SBfwdK016508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 28 Feb 2017 11:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314385 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 11:41:59 -0000 Author: avg Date: Tue Feb 28 11:41:57 2017 New Revision: 314385 URL: https://svnweb.freebsd.org/changeset/base/314385 Log: MFC r313751: mca: fix writes to MSR_MC_CTL2 in cmci_update Modified: stable/11/sys/x86/x86/mca.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/mca.c ============================================================================== --- stable/11/sys/x86/x86/mca.c Tue Feb 28 11:38:11 2017 (r314384) +++ stable/11/sys/x86/x86/mca.c Tue Feb 28 11:41:57 2017 (r314385) @@ -548,7 +548,7 @@ cmci_update(enum scan_mode mode, int ban limit = min(limit << 1, cc->max_threshold); ctl &= ~MC_CTL2_THRESHOLD; ctl |= limit; - wrmsr(MSR_MC_CTL2(bank), limit); + wrmsr(MSR_MC_CTL2(bank), ctl); } cc->last_intr = time_uptime; return; @@ -581,7 +581,7 @@ cmci_update(enum scan_mode mode, int ban if ((ctl & MC_CTL2_THRESHOLD) != limit) { ctl &= ~MC_CTL2_THRESHOLD; ctl |= limit; - wrmsr(MSR_MC_CTL2(bank), limit); + wrmsr(MSR_MC_CTL2(bank), ctl); } } #endif From owner-svn-src-stable@freebsd.org Tue Feb 28 11:42:06 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2154FCF1C8C; Tue, 28 Feb 2017 11:42:06 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id E4F98E08; Tue, 28 Feb 2017 11:42:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SBg5Po016685; Tue, 28 Feb 2017 11:42:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SBg5BZ016684; Tue, 28 Feb 2017 11:42:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702281142.v1SBg5BZ016684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 28 Feb 2017 11:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314386 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 11:42:06 -0000 Author: avg Date: Tue Feb 28 11:42:04 2017 New Revision: 314386 URL: https://svnweb.freebsd.org/changeset/base/314386 Log: MFC r313751: mca: fix writes to MSR_MC_CTL2 in cmci_update Modified: stable/10/sys/x86/x86/mca.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/mca.c ============================================================================== --- stable/10/sys/x86/x86/mca.c Tue Feb 28 11:41:57 2017 (r314385) +++ stable/10/sys/x86/x86/mca.c Tue Feb 28 11:42:04 2017 (r314386) @@ -550,7 +550,7 @@ cmci_update(enum scan_mode mode, int ban limit = min(limit << 1, cc->max_threshold); ctl &= ~MC_CTL2_THRESHOLD; ctl |= limit; - wrmsr(MSR_MC_CTL2(bank), limit); + wrmsr(MSR_MC_CTL2(bank), ctl); } cc->last_intr = time_uptime; return; @@ -583,7 +583,7 @@ cmci_update(enum scan_mode mode, int ban if ((ctl & MC_CTL2_THRESHOLD) != limit) { ctl &= ~MC_CTL2_THRESHOLD; ctl |= limit; - wrmsr(MSR_MC_CTL2(bank), limit); + wrmsr(MSR_MC_CTL2(bank), ctl); } } #endif From owner-svn-src-stable@freebsd.org Tue Feb 28 14:48:53 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 920EBCF1E17; Tue, 28 Feb 2017 14:48:53 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 53D4A916; Tue, 28 Feb 2017 14:48:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SEmqR3088690; Tue, 28 Feb 2017 14:48:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SEmqYs088689; Tue, 28 Feb 2017 14:48:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702281448.v1SEmqYs088689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Feb 2017 14:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314391 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 14:48:53 -0000 Author: kib Date: Tue Feb 28 14:48:52 2017 New Revision: 314391 URL: https://svnweb.freebsd.org/changeset/base/314391 Log: MFC r313734: Add RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols. Modified: stable/11/sys/sys/resource.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/resource.h ============================================================================== --- stable/11/sys/sys/resource.h Tue Feb 28 14:42:57 2017 (r314390) +++ stable/11/sys/sys/resource.h Tue Feb 28 14:48:52 2017 (r314391) @@ -119,8 +119,8 @@ struct __wrusage { #define RLIM_NLIMITS 15 /* number of resource limits */ #define RLIM_INFINITY ((rlim_t)(((__uint64_t)1 << 63) - 1)) -/* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */ - +#define RLIM_SAVED_MAX RLIM_INFINITY +#define RLIM_SAVED_CUR RLIM_INFINITY /* * Resource limit string identifiers From owner-svn-src-stable@freebsd.org Tue Feb 28 15:03:35 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB6BCF04CA; Tue, 28 Feb 2017 15:03:35 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 2B93EE82; Tue, 28 Feb 2017 15:03:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SF3Y27097546; Tue, 28 Feb 2017 15:03:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SF3YX4097545; Tue, 28 Feb 2017 15:03:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702281503.v1SF3YX4097545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Feb 2017 15:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314392 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 15:03:35 -0000 Author: kib Date: Tue Feb 28 15:03:34 2017 New Revision: 314392 URL: https://svnweb.freebsd.org/changeset/base/314392 Log: MFC r313734: Add RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols. Modified: stable/10/sys/sys/resource.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/resource.h ============================================================================== --- stable/10/sys/sys/resource.h Tue Feb 28 14:48:52 2017 (r314391) +++ stable/10/sys/sys/resource.h Tue Feb 28 15:03:34 2017 (r314392) @@ -107,8 +107,8 @@ struct __wrusage { #define RLIM_NLIMITS 13 /* number of resource limits */ #define RLIM_INFINITY ((rlim_t)(((uint64_t)1 << 63) - 1)) -/* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */ - +#define RLIM_SAVED_MAX RLIM_INFINITY +#define RLIM_SAVED_CUR RLIM_INFINITY /* * Resource limit string identifiers From owner-svn-src-stable@freebsd.org Tue Feb 28 22:18:07 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2387CCF16E6; Tue, 28 Feb 2017 22:18:07 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id E2B2CC94; Tue, 28 Feb 2017 22:18:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SMI5Vl068130; Tue, 28 Feb 2017 22:18:05 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SMI5Is068122; Tue, 28 Feb 2017 22:18:05 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702282218.v1SMI5Is068122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Feb 2017 22:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314425 - in stable/10: etc/mtree sbin/devd usr.bin/cmp usr.bin/cmp/tests usr.bin/tail usr.bin/tail/tests usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 22:18:07 -0000 Author: asomers Date: Tue Feb 28 22:18:05 2017 New Revision: 314425 URL: https://svnweb.freebsd.org/changeset/base/314425 Log: MFC r311572, r311895, r311928, r311985, r312395, r312417 r311572: Fix file descriptor leaks in cmp(1) Also, add a few test cases Reported by: Coverity CID: 271624 275338 Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9074 r311895: Fix memory leaks during "tail -r" of an irregular file * Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done. * Remove an optimization for the case where the file is a multiple of 128KB in size and there is a scarcity of memory. * Add ATF tests for "tail -r" and its variants. Reported by: Valgrind Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9067 r311928: Fix build of usr.bin/tail with GCC Submitted by: pluknet Reported by: pluknet MFC after: 27 days X-MFC-with: 311895 Sponsored by: Spectra Logic Corp r311985: Fix uninitialized variable CIDs in route6d The variables in question are actually return arguments, but it's still good form to initialize them. Reported by: Coverity CID: 979679 979680 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r312395: Fix several Coverity CIDs in devd CID 1362055, 1362054: File descriptor leaks during shutdown CID 1362013: Potential null-termination fail with long network device names CID 1362097: Uncaught exception during memory pressure CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior if two devd instances start at the same time. CID 1362015: Unchecked error that will probably never fail Reported by: Coverity CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r312417: Fix build of devd with GCC 4.2 Reported by: olivier Pointy-hat-to: asomers MFC after: 27 days X-MFC-with: 312395 Sponsored by: Spectra Logic Corp Added: stable/10/usr.bin/cmp/tests/cmp_test2.sh - copied unchanged from r311572, head/usr.bin/cmp/tests/cmp_test2.sh stable/10/usr.bin/tail/tests/ - copied from r311895, head/usr.bin/tail/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/sbin/devd/devd.cc stable/10/usr.bin/cmp/special.c stable/10/usr.bin/cmp/tests/Makefile stable/10/usr.bin/tail/Makefile stable/10/usr.bin/tail/reverse.c stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Feb 28 21:47:00 2017 (r314424) +++ stable/10/etc/mtree/BSD.tests.dist Tue Feb 28 22:18:05 2017 (r314425) @@ -608,6 +608,8 @@ regress.multitest.out .. .. + tail + .. tar .. timeout Modified: stable/10/sbin/devd/devd.cc ============================================================================== --- stable/10/sbin/devd/devd.cc Tue Feb 28 21:47:00 2017 (r314424) +++ stable/10/sbin/devd/devd.cc Tue Feb 28 22:18:05 2017 (r314425) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "devd.h" /* C compatible definitions */ @@ -372,7 +373,7 @@ media::do_match(config &c) s = socket(PF_INET, SOCK_DGRAM, 0); if (s >= 0) { memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, value.c_str(), sizeof(ifmr.ifm_name)); + strlcpy(ifmr.ifm_name, value.c_str(), sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0 && ifmr.ifm_status & IFM_AVALID) { @@ -856,8 +857,10 @@ create_socket(const char *name, int sock if (::bind(fd, (struct sockaddr *) & sun, slen) < 0) err(1, "bind"); listen(fd, 4); - chown(name, 0, 0); /* XXX - root.wheel */ - chmod(name, 0666); + if (chown(name, 0, 0)) /* XXX - root.wheel */ + err(1, "chown"); + if (chmod(name, 0666)) + err(1, "chmod"); return (fd); } @@ -1043,7 +1046,13 @@ event_loop(void) buffer[rv] = '\0'; while (buffer[--rv] == '\n') buffer[rv] = '\0'; - process_event(buffer); + try { + process_event(buffer); + } + catch (std::length_error e) { + devdlog(LOG_ERR, "Dropping event %s " + "due to low memory", buffer); + } } else if (rv < 0) { if (errno != EINTR) break; @@ -1061,6 +1070,8 @@ event_loop(void) if (FD_ISSET(seqpacket_fd, &fds)) new_client(seqpacket_fd, SOCK_SEQPACKET); } + close(seqpacket_fd); + close(stream_fd); close(fd); } @@ -1203,7 +1214,8 @@ check_devd_enabled() if (val == 0) { warnx("Setting " SYSCTL " to 1000"); val = 1000; - sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val)); + if (sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val))) + err(1, "sysctlbyname"); } } Modified: stable/10/usr.bin/cmp/special.c ============================================================================== --- stable/10/usr.bin/cmp/special.c Tue Feb 28 21:47:00 2017 (r314424) +++ stable/10/usr.bin/cmp/special.c Tue Feb 28 22:18:05 2017 (r314425) @@ -99,6 +99,8 @@ eof: if (ferror(fp1)) } else if (feof(fp2)) eofmsg(file2); + fclose(fp2); + fclose(fp1); if (dfound) exit(DIFF_EXIT); } Modified: stable/10/usr.bin/cmp/tests/Makefile ============================================================================== --- stable/10/usr.bin/cmp/tests/Makefile Tue Feb 28 21:47:00 2017 (r314424) +++ stable/10/usr.bin/cmp/tests/Makefile Tue Feb 28 22:18:05 2017 (r314425) @@ -2,6 +2,7 @@ .include +ATF_TESTS_SH+= cmp_test2 NETBSD_ATF_TESTS_SH= cmp_test .include Copied: stable/10/usr.bin/cmp/tests/cmp_test2.sh (from r311572, head/usr.bin/cmp/tests/cmp_test2.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/cmp/tests/cmp_test2.sh Tue Feb 28 22:18:05 2017 (r314425, copy of r311572, head/usr.bin/cmp/tests/cmp_test2.sh) @@ -0,0 +1,67 @@ +# Copyright (c) 2017 Alan Somers +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +atf_test_case special +special_head() { + atf_set "descr" "Test cmp(1)'s handling of non-regular files" +} +special_body() { + echo 0123456789abcdef > a + echo 0123456789abcdeg > b + cat a | atf_check -s exit:0 cmp a - + cat a | atf_check -s exit:0 cmp - a + cat b | atf_check -s not-exit:0 cmp a - + cat b | atf_check -s not-exit:0 cmp - a + true +} + +atf_test_case symlink +symlink_head() { + atf_set "descr" "Test cmp(1)'s handling of symlinks" +} +symlink_body() { + echo 0123456789abcdef > a + echo 0123456789abcdeg > b + ln -s a a.lnk + ln -s b b.lnk + ln -s a a2.lnk + cp a adup + ln -s adup adup.lnk + atf_check -s exit:0 cmp a a.lnk + atf_check -s exit:0 cmp a.lnk a + atf_check -s not-exit:0 -o ignore cmp a b.lnk + atf_check -s not-exit:0 -o ignore cmp b.lnk a + atf_check -s not-exit:0 -o ignore -e ignore cmp -h a a.lnk + atf_check -s not-exit:0 -o ignore -e ignore cmp -h a.lnk a + atf_check -s exit:0 cmp -h a.lnk a2.lnk + atf_check -s not-exit:0 -o ignore -e ignore cmp -h a.lnk adup.lnk +} + +atf_init_test_cases() +{ + atf_add_test_case special + atf_add_test_case symlink +} Modified: stable/10/usr.bin/tail/Makefile ============================================================================== --- stable/10/usr.bin/tail/Makefile Tue Feb 28 21:47:00 2017 (r314424) +++ stable/10/usr.bin/tail/Makefile Tue Feb 28 22:18:05 2017 (r314425) @@ -1,7 +1,13 @@ # $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + PROG= tail SRCS= forward.c misc.c read.c reverse.c tail.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/tail/reverse.c ============================================================================== --- stable/10/usr.bin/tail/reverse.c Tue Feb 28 21:47:00 2017 (r314424) +++ stable/10/usr.bin/tail/reverse.c Tue Feb 28 22:18:05 2017 (r314425) @@ -40,6 +40,7 @@ static char sccsid[] = "@(#)reverse.c 8. __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -169,12 +170,12 @@ r_reg(FILE *fp, const char *fn, enum STY ierr(fn); } -typedef struct bf { - struct bf *next; - struct bf *prev; - int len; - char *l; -} BF; +#define BSZ (128 * 1024) +typedef struct bfelem { + TAILQ_ENTRY(bfelem) entries; + size_t len; + char l[BSZ]; +} bfelem_t; /* * r_buf -- display a non-regular file in reverse order by line. @@ -189,64 +190,44 @@ typedef struct bf { static void r_buf(FILE *fp, const char *fn) { - BF *mark, *tl, *tr; - int ch, len, llen; + struct bfelem *tl, *first = NULL; + size_t llen; char *p; - off_t enomem; + off_t enomem = 0; + TAILQ_HEAD(bfhead, bfelem) head; + + TAILQ_INIT(&head); + + while (!feof(fp)) { + size_t len; - tl = NULL; -#define BSZ (128 * 1024) - for (mark = NULL, enomem = 0;;) { /* * Allocate a new block and link it into place in a doubly * linked list. If out of memory, toss the LRU block and * keep going. */ - if (enomem || (tl = malloc(sizeof(BF))) == NULL || - (tl->l = malloc(BSZ)) == NULL) { - if (!mark) + while ((tl = malloc(sizeof(bfelem_t))) == NULL) { + first = TAILQ_FIRST(&head); + if (TAILQ_EMPTY(&head)) err(1, "malloc"); - if (enomem) - tl = tl->next; - else { - if (tl) - free(tl); - tl = mark; - } - enomem += tl->len; - } else if (mark) { - tl->next = mark; - tl->prev = mark->prev; - mark->prev->next = tl; - mark->prev = tl; - } else { - mark = tl; - mark->next = mark->prev = mark; + enomem += first->len; + TAILQ_REMOVE(&head, first, entries); + free(first); } + TAILQ_INSERT_TAIL(&head, tl, entries); /* Fill the block with input data. */ - for (p = tl->l, len = 0; - len < BSZ && (ch = getc(fp)) != EOF; ++len) - *p++ = ch; - - if (ferror(fp)) { - ierr(fn); - return; - } - - /* - * If no input data for this block and we tossed some data, - * recover it. - */ - if (!len && enomem) { - enomem -= tl->len; - tl = tl->prev; - break; + len = 0; + while ((!feof(fp)) && len < BSZ) { + p = tl->l + len; + len += fread(p, 1, BSZ - len, fp); + if (ferror(fp)) { + ierr(fn); + return; + } } tl->len = len; - if (ch == EOF) - break; } if (enomem) { @@ -255,37 +236,46 @@ r_buf(FILE *fp, const char *fn) } /* - * Step through the blocks in the reverse order read. The last char - * is special, ignore whether newline or not. + * Now print the lines in reverse order + * Outline: + * Scan backward for "\n", + * print forward to the end of the buffers + * free any buffers that start after the "\n" just found + * Loop */ - for (mark = tl;;) { - for (p = tl->l + (len = tl->len) - 1, llen = 0; len--; - --p, ++llen) - if (*p == '\n') { - if (llen) { + tl = TAILQ_LAST(&head, bfhead); + first = TAILQ_FIRST(&head); + while (tl != NULL) { + struct bfelem *temp; + + for (p = tl->l + tl->len - 1, llen = 0; p >= tl->l; + --p, ++llen) { + int start = (tl == first && p == tl->l); + + if ((*p == '\n') || start) { + struct bfelem *tr; + + if (start && llen) + WR(p, llen + 1); + else if (llen) WR(p + 1, llen); - llen = 0; - } - if (tl == mark) - continue; - for (tr = tl->next; tr->len; tr = tr->next) { - WR(tr->l, tr->len); - tr->len = 0; - if (tr == mark) - break; + tr = TAILQ_NEXT(tl, entries); + llen = 0; + if (tr != NULL) { + TAILQ_FOREACH_FROM_SAFE(tr, &head, + entries, temp) { + if (tr->len) + WR(&tr->l, tr->len); + TAILQ_REMOVE(&head, tr, + entries); + free(tr); + } } } + } tl->len = llen; - if ((tl = tl->prev) == mark) - break; - } - tl = tl->next; - if (tl->len) { - WR(tl->l, tl->len); - tl->len = 0; - } - while ((tl = tl->next)->len) { - WR(tl->l, tl->len); - tl->len = 0; + tl = TAILQ_PREV(tl, bfhead, entries); } + TAILQ_REMOVE(&head, first, entries); + free(first); } Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Tue Feb 28 21:47:00 2017 (r314424) +++ stable/10/usr.sbin/route6d/route6d.c Tue Feb 28 22:18:05 2017 (r314425) @@ -1063,6 +1063,7 @@ sendpacket(struct sockaddr_in6 *sin6, in iov[0].iov_len = len; m.msg_iov = iov; m.msg_iovlen = 1; + m.msg_flags = 0; if (!idx) { m.msg_control = NULL; m.msg_controllen = 0; @@ -1127,6 +1128,7 @@ riprecv(void) cm = (struct cmsghdr *)cmsgbuf; m.msg_control = (caddr_t)cm; m.msg_controllen = sizeof(cmsgbuf); + m.msg_flags = 0; if ((len = recvmsg(ripsock, &m, 0)) < 0) { fatal("recvmsg"); /*NOTREACHED*/ From owner-svn-src-stable@freebsd.org Tue Feb 28 22:49:43 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A0B6CF217A; Tue, 28 Feb 2017 22:49:43 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 650531E8; Tue, 28 Feb 2017 22:49:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SMngIo079973; Tue, 28 Feb 2017 22:49:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SMnflQ079965; Tue, 28 Feb 2017 22:49:41 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702282249.v1SMnflQ079965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Feb 2017 22:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314427 - in stable/11: etc/mtree sbin/devd usr.bin/cmp usr.bin/cmp/tests usr.bin/tail usr.bin/tail/tests usr.sbin/route6d X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 22:49:43 -0000 Author: asomers Date: Tue Feb 28 22:49:41 2017 New Revision: 314427 URL: https://svnweb.freebsd.org/changeset/base/314427 Log: MFC r311572, r311895, r311928, r311985, r312395, r312417 r311572: Fix file descriptor leaks in cmp(1) Also, add a few test cases Reported by: Coverity CID: 271624 275338 Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9074 r311895: Fix memory leaks during "tail -r" of an irregular file * Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done. * Remove an optimization for the case where the file is a multiple of 128KB in size and there is a scarcity of memory. * Add ATF tests for "tail -r" and its variants. Reported by: Valgrind Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9067 r311928: Fix build of usr.bin/tail with GCC Submitted by: pluknet Reported by: pluknet MFC after: 27 days X-MFC-with: 311895 Sponsored by: Spectra Logic Corp r311985: Fix uninitialized variable CIDs in route6d The variables in question are actually return arguments, but it's still good form to initialize them. Reported by: Coverity CID: 979679 979680 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r312395: Fix several Coverity CIDs in devd CID 1362055, 1362054: File descriptor leaks during shutdown CID 1362013: Potential null-termination fail with long network device names CID 1362097: Uncaught exception during memory pressure CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior if two devd instances start at the same time. CID 1362015: Unchecked error that will probably never fail Reported by: Coverity CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r312417: Fix build of devd with GCC 4.2 Reported by: olivier Pointy-hat-to: asomers MFC after: 27 days X-MFC-with: 312395 Sponsored by: Spectra Logic Corp Added: stable/11/usr.bin/cmp/tests/cmp_test2.sh - copied unchanged from r311572, head/usr.bin/cmp/tests/cmp_test2.sh stable/11/usr.bin/tail/tests/ - copied from r311895, head/usr.bin/tail/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/sbin/devd/devd.cc stable/11/usr.bin/cmp/special.c stable/11/usr.bin/cmp/tests/Makefile stable/11/usr.bin/tail/Makefile stable/11/usr.bin/tail/reverse.c stable/11/usr.sbin/route6d/route6d.c Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Tue Feb 28 22:22:53 2017 (r314426) +++ stable/11/etc/mtree/BSD.tests.dist Tue Feb 28 22:49:41 2017 (r314427) @@ -632,6 +632,8 @@ .. soelim .. + tail + .. tar .. timeout Modified: stable/11/sbin/devd/devd.cc ============================================================================== --- stable/11/sbin/devd/devd.cc Tue Feb 28 22:22:53 2017 (r314426) +++ stable/11/sbin/devd/devd.cc Tue Feb 28 22:49:41 2017 (r314427) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "devd.h" /* C compatible definitions */ @@ -372,7 +373,7 @@ media::do_match(config &c) s = socket(PF_INET, SOCK_DGRAM, 0); if (s >= 0) { memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, value.c_str(), sizeof(ifmr.ifm_name)); + strlcpy(ifmr.ifm_name, value.c_str(), sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0 && ifmr.ifm_status & IFM_AVALID) { @@ -871,8 +872,10 @@ create_socket(const char *name, int sock if (::bind(fd, (struct sockaddr *) & sun, slen) < 0) err(1, "bind"); listen(fd, 4); - chown(name, 0, 0); /* XXX - root.wheel */ - chmod(name, 0666); + if (chown(name, 0, 0)) /* XXX - root.wheel */ + err(1, "chown"); + if (chmod(name, 0666)) + err(1, "chmod"); return (fd); } @@ -1058,7 +1061,13 @@ event_loop(void) buffer[rv] = '\0'; while (buffer[--rv] == '\n') buffer[rv] = '\0'; - process_event(buffer); + try { + process_event(buffer); + } + catch (std::length_error e) { + devdlog(LOG_ERR, "Dropping event %s " + "due to low memory", buffer); + } } else if (rv < 0) { if (errno != EINTR) break; @@ -1076,6 +1085,8 @@ event_loop(void) if (FD_ISSET(seqpacket_fd, &fds)) new_client(seqpacket_fd, SOCK_SEQPACKET); } + close(seqpacket_fd); + close(stream_fd); close(fd); } @@ -1218,7 +1229,8 @@ check_devd_enabled() if (val == 0) { warnx("Setting " SYSCTL " to 1000"); val = 1000; - sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val)); + if (sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val))) + err(1, "sysctlbyname"); } } Modified: stable/11/usr.bin/cmp/special.c ============================================================================== --- stable/11/usr.bin/cmp/special.c Tue Feb 28 22:22:53 2017 (r314426) +++ stable/11/usr.bin/cmp/special.c Tue Feb 28 22:49:41 2017 (r314427) @@ -99,6 +99,8 @@ eof: if (ferror(fp1)) } else if (feof(fp2)) eofmsg(file2); + fclose(fp2); + fclose(fp1); if (dfound) exit(DIFF_EXIT); } Modified: stable/11/usr.bin/cmp/tests/Makefile ============================================================================== --- stable/11/usr.bin/cmp/tests/Makefile Tue Feb 28 22:22:53 2017 (r314426) +++ stable/11/usr.bin/cmp/tests/Makefile Tue Feb 28 22:49:41 2017 (r314427) @@ -2,6 +2,7 @@ .include +ATF_TESTS_SH+= cmp_test2 NETBSD_ATF_TESTS_SH= cmp_test .include Copied: stable/11/usr.bin/cmp/tests/cmp_test2.sh (from r311572, head/usr.bin/cmp/tests/cmp_test2.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/cmp/tests/cmp_test2.sh Tue Feb 28 22:49:41 2017 (r314427, copy of r311572, head/usr.bin/cmp/tests/cmp_test2.sh) @@ -0,0 +1,67 @@ +# Copyright (c) 2017 Alan Somers +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +atf_test_case special +special_head() { + atf_set "descr" "Test cmp(1)'s handling of non-regular files" +} +special_body() { + echo 0123456789abcdef > a + echo 0123456789abcdeg > b + cat a | atf_check -s exit:0 cmp a - + cat a | atf_check -s exit:0 cmp - a + cat b | atf_check -s not-exit:0 cmp a - + cat b | atf_check -s not-exit:0 cmp - a + true +} + +atf_test_case symlink +symlink_head() { + atf_set "descr" "Test cmp(1)'s handling of symlinks" +} +symlink_body() { + echo 0123456789abcdef > a + echo 0123456789abcdeg > b + ln -s a a.lnk + ln -s b b.lnk + ln -s a a2.lnk + cp a adup + ln -s adup adup.lnk + atf_check -s exit:0 cmp a a.lnk + atf_check -s exit:0 cmp a.lnk a + atf_check -s not-exit:0 -o ignore cmp a b.lnk + atf_check -s not-exit:0 -o ignore cmp b.lnk a + atf_check -s not-exit:0 -o ignore -e ignore cmp -h a a.lnk + atf_check -s not-exit:0 -o ignore -e ignore cmp -h a.lnk a + atf_check -s exit:0 cmp -h a.lnk a2.lnk + atf_check -s not-exit:0 -o ignore -e ignore cmp -h a.lnk adup.lnk +} + +atf_init_test_cases() +{ + atf_add_test_case special + atf_add_test_case symlink +} Modified: stable/11/usr.bin/tail/Makefile ============================================================================== --- stable/11/usr.bin/tail/Makefile Tue Feb 28 22:22:53 2017 (r314426) +++ stable/11/usr.bin/tail/Makefile Tue Feb 28 22:49:41 2017 (r314427) @@ -1,7 +1,13 @@ # $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + PROG= tail SRCS= forward.c misc.c read.c reverse.c tail.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/11/usr.bin/tail/reverse.c ============================================================================== --- stable/11/usr.bin/tail/reverse.c Tue Feb 28 22:22:53 2017 (r314426) +++ stable/11/usr.bin/tail/reverse.c Tue Feb 28 22:49:41 2017 (r314427) @@ -40,6 +40,7 @@ static char sccsid[] = "@(#)reverse.c 8. __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -169,12 +170,12 @@ r_reg(FILE *fp, const char *fn, enum STY ierr(fn); } -typedef struct bf { - struct bf *next; - struct bf *prev; - int len; - char *l; -} BF; +#define BSZ (128 * 1024) +typedef struct bfelem { + TAILQ_ENTRY(bfelem) entries; + size_t len; + char l[BSZ]; +} bfelem_t; /* * r_buf -- display a non-regular file in reverse order by line. @@ -189,64 +190,44 @@ typedef struct bf { static void r_buf(FILE *fp, const char *fn) { - BF *mark, *tl, *tr; - int ch, len, llen; + struct bfelem *tl, *first = NULL; + size_t llen; char *p; - off_t enomem; + off_t enomem = 0; + TAILQ_HEAD(bfhead, bfelem) head; + + TAILQ_INIT(&head); + + while (!feof(fp)) { + size_t len; - tl = NULL; -#define BSZ (128 * 1024) - for (mark = NULL, enomem = 0;;) { /* * Allocate a new block and link it into place in a doubly * linked list. If out of memory, toss the LRU block and * keep going. */ - if (enomem || (tl = malloc(sizeof(BF))) == NULL || - (tl->l = malloc(BSZ)) == NULL) { - if (!mark) + while ((tl = malloc(sizeof(bfelem_t))) == NULL) { + first = TAILQ_FIRST(&head); + if (TAILQ_EMPTY(&head)) err(1, "malloc"); - if (enomem) - tl = tl->next; - else { - if (tl) - free(tl); - tl = mark; - } - enomem += tl->len; - } else if (mark) { - tl->next = mark; - tl->prev = mark->prev; - mark->prev->next = tl; - mark->prev = tl; - } else { - mark = tl; - mark->next = mark->prev = mark; + enomem += first->len; + TAILQ_REMOVE(&head, first, entries); + free(first); } + TAILQ_INSERT_TAIL(&head, tl, entries); /* Fill the block with input data. */ - for (p = tl->l, len = 0; - len < BSZ && (ch = getc(fp)) != EOF; ++len) - *p++ = ch; - - if (ferror(fp)) { - ierr(fn); - return; - } - - /* - * If no input data for this block and we tossed some data, - * recover it. - */ - if (!len && enomem) { - enomem -= tl->len; - tl = tl->prev; - break; + len = 0; + while ((!feof(fp)) && len < BSZ) { + p = tl->l + len; + len += fread(p, 1, BSZ - len, fp); + if (ferror(fp)) { + ierr(fn); + return; + } } tl->len = len; - if (ch == EOF) - break; } if (enomem) { @@ -255,37 +236,46 @@ r_buf(FILE *fp, const char *fn) } /* - * Step through the blocks in the reverse order read. The last char - * is special, ignore whether newline or not. + * Now print the lines in reverse order + * Outline: + * Scan backward for "\n", + * print forward to the end of the buffers + * free any buffers that start after the "\n" just found + * Loop */ - for (mark = tl;;) { - for (p = tl->l + (len = tl->len) - 1, llen = 0; len--; - --p, ++llen) - if (*p == '\n') { - if (llen) { + tl = TAILQ_LAST(&head, bfhead); + first = TAILQ_FIRST(&head); + while (tl != NULL) { + struct bfelem *temp; + + for (p = tl->l + tl->len - 1, llen = 0; p >= tl->l; + --p, ++llen) { + int start = (tl == first && p == tl->l); + + if ((*p == '\n') || start) { + struct bfelem *tr; + + if (start && llen) + WR(p, llen + 1); + else if (llen) WR(p + 1, llen); - llen = 0; - } - if (tl == mark) - continue; - for (tr = tl->next; tr->len; tr = tr->next) { - WR(tr->l, tr->len); - tr->len = 0; - if (tr == mark) - break; + tr = TAILQ_NEXT(tl, entries); + llen = 0; + if (tr != NULL) { + TAILQ_FOREACH_FROM_SAFE(tr, &head, + entries, temp) { + if (tr->len) + WR(&tr->l, tr->len); + TAILQ_REMOVE(&head, tr, + entries); + free(tr); + } } } + } tl->len = llen; - if ((tl = tl->prev) == mark) - break; - } - tl = tl->next; - if (tl->len) { - WR(tl->l, tl->len); - tl->len = 0; - } - while ((tl = tl->next)->len) { - WR(tl->l, tl->len); - tl->len = 0; + tl = TAILQ_PREV(tl, bfhead, entries); } + TAILQ_REMOVE(&head, first, entries); + free(first); } Modified: stable/11/usr.sbin/route6d/route6d.c ============================================================================== --- stable/11/usr.sbin/route6d/route6d.c Tue Feb 28 22:22:53 2017 (r314426) +++ stable/11/usr.sbin/route6d/route6d.c Tue Feb 28 22:49:41 2017 (r314427) @@ -1062,6 +1062,7 @@ sendpacket(struct sockaddr_in6 *sin6, in iov[0].iov_len = len; m.msg_iov = iov; m.msg_iovlen = 1; + m.msg_flags = 0; if (!idx) { m.msg_control = NULL; m.msg_controllen = 0; @@ -1126,6 +1127,7 @@ riprecv(void) cm = (struct cmsghdr *)cmsgbuf; m.msg_control = (caddr_t)cm; m.msg_controllen = sizeof(cmsgbuf); + m.msg_flags = 0; if ((len = recvmsg(ripsock, &m, 0)) < 0) { fatal("recvmsg"); /*NOTREACHED*/ From owner-svn-src-stable@freebsd.org Tue Feb 28 23:03:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7107CF2B0E; Tue, 28 Feb 2017 23:03:52 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 7377DB9A; Tue, 28 Feb 2017 23:03:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SN3pgJ090564; Tue, 28 Feb 2017 23:03:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SN3px8090563; Tue, 28 Feb 2017 23:03:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702282303.v1SN3px8090563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Feb 2017 23:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314431 - stable/11/cddl/usr.sbin/zfsd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 23:03:52 -0000 Author: asomers Date: Tue Feb 28 23:03:51 2017 New Revision: 314431 URL: https://svnweb.freebsd.org/changeset/base/314431 Log: MFC r312396: Fix an unchecked return value in zfsd It's pretty unlikely to actually hit this, but good to check it anyway Reported by: Coverity CID: 1362018 MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: stable/11/cddl/usr.sbin/zfsd/case_file.cc Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- stable/11/cddl/usr.sbin/zfsd/case_file.cc Tue Feb 28 22:58:19 2017 (r314430) +++ stable/11/cddl/usr.sbin/zfsd/case_file.cc Tue Feb 28 23:03:51 2017 (r314431) @@ -656,8 +656,11 @@ CaseFile::DeSerializeFile(const char *fi uint64_t vdevGUID; nvlist_t *vdevConf; - sscanf(fileName, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case", - &poolGUID, &vdevGUID); + if (sscanf(fileName, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case", + &poolGUID, &vdevGUID) != 2) { + throw ZfsdException("CaseFile::DeSerialize: " + "Unintelligible CaseFile filename %s.\n", fileName); + } existingCaseFile = Find(Guid(poolGUID), Guid(vdevGUID)); if (existingCaseFile != NULL) { /* From owner-svn-src-stable@freebsd.org Tue Feb 28 23:26:51 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DADB2CF214D; Tue, 28 Feb 2017 23:26:51 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id A7018C41; Tue, 28 Feb 2017 23:26:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SNQo0Z098583; Tue, 28 Feb 2017 23:26:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SNQorv098582; Tue, 28 Feb 2017 23:26:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702282326.v1SNQorv098582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Feb 2017 23:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314433 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 23:26:52 -0000 Author: asomers Date: Tue Feb 28 23:26:50 2017 New Revision: 314433 URL: https://svnweb.freebsd.org/changeset/base/314433 Log: MFC r312553: Fix "camcontrol timestamp -s" with LTO-7 drives The length of the scsi_set_timestamp_parameters struct was incorrect. LTO-5 drives don't care, but LTO-7 drives do. Reviewed by: Sam Klopsch MFC after: 2 weeks Sponsored by: Spectra Logic Corp Modified: stable/11/sys/cam/scsi/scsi_all.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.h Tue Feb 28 23:24:08 2017 (r314432) +++ stable/11/sys/cam/scsi/scsi_all.h Tue Feb 28 23:26:50 2017 (r314433) @@ -3039,7 +3039,7 @@ struct scsi_set_timestamp_parameters { uint8_t reserved1[4]; uint8_t timestamp[6]; - uint8_t reserved2[4]; + uint8_t reserved2[2]; }; struct scsi_report_timestamp_parameter_data From owner-svn-src-stable@freebsd.org Tue Feb 28 23:56:15 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC2F6CF2B90; Tue, 28 Feb 2017 23:56:15 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 89FF99B0; Tue, 28 Feb 2017 23:56:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SNuEpG011339; Tue, 28 Feb 2017 23:56:14 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SNuEcC011338; Tue, 28 Feb 2017 23:56:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702282356.v1SNuEcC011338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Feb 2017 23:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314438 - stable/10/usr.sbin/camdd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 23:56:15 -0000 Author: asomers Date: Tue Feb 28 23:56:14 2017 New Revision: 314438 URL: https://svnweb.freebsd.org/changeset/base/314438 Log: MFC r312559: Fix misc Coverity defects in camdd(8) CID 1341620 Fix a small memory leak CID 1341630 Though this is technically a false positive, rearrange the code for clarity. CID 1341635 Eliminate dead code CID 1368663 Fix a double mutex unlock in the error path Also: * Use sig_atomic_t for variables accessed from signal handlers * Don't conditionalize free(3) on its argument being non-null Reported by: Coverity CID: 1341620 1341630 1341635 1368663 Reviewed by: ken MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9237 Modified: stable/10/usr.sbin/camdd/camdd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/camdd/camdd.c ============================================================================== --- stable/10/usr.sbin/camdd/camdd.c Tue Feb 28 23:55:03 2017 (r314437) +++ stable/10/usr.sbin/camdd/camdd.c Tue Feb 28 23:56:14 2017 (r314438) @@ -420,9 +420,9 @@ struct camdd_dev { }; static sem_t camdd_sem; -static int need_exit = 0; -static int error_exit = 0; -static int need_status = 0; +static sig_atomic_t need_exit = 0; +static sig_atomic_t error_exit = 0; +static sig_atomic_t need_status = 0; #ifndef min #define min(a, b) (a < b) ? a : b @@ -712,11 +712,7 @@ camdd_alloc_buf(struct camdd_dev *dev, c return (buf); bailout_error: - if (data_ptr != NULL) - free(data_ptr); - - if (buf != NULL) - free(buf); + free(data_ptr); return (NULL); } @@ -2261,6 +2257,7 @@ camdd_file_run(struct camdd_dev *dev) if (file_dev->tmp_buf == NULL) { buf->status = CAMDD_STATUS_ERROR; error_count++; + pthread_mutex_lock(&dev->mutex); goto bailout; } for (i = 0, cur_offset = 0; i < data->sg_count; i++) { @@ -2983,7 +2980,6 @@ int camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io, int retry_count, int timeout) { - char *device = NULL; struct cam_device *new_cam_dev = NULL; struct camdd_dev *devs[2]; struct timespec start_time; @@ -3003,12 +2999,11 @@ camdd_rw(struct camdd_io_opts *io_opts, for (i = 0; i < num_io_opts; i++) { switch (io_opts[i].dev_type) { case CAMDD_DEV_PASS: { - camdd_argmask new_arglist = CAMDD_ARG_NONE; - int bus = 0, target = 0, lun = 0; - char name[30]; - int rv; - if (isdigit(io_opts[i].dev_name[0])) { + camdd_argmask new_arglist = CAMDD_ARG_NONE; + int bus = 0, target = 0, lun = 0; + int rv; + /* device specified as bus:target[:lun] */ rv = parse_btl(io_opts[i].dev_name, &bus, &target, &lun, &new_arglist); @@ -3024,23 +3019,21 @@ camdd_rw(struct camdd_io_opts *io_opts, lun = 0; new_arglist |= CAMDD_ARG_LUN; } + new_cam_dev = cam_open_btl(bus, target, lun, + O_RDWR, NULL); } else { + char name[30]; + if (cam_get_device(io_opts[i].dev_name, name, sizeof name, &unit) == -1) { warnx("%s", cam_errbuf); error = 1; goto bailout; } - device = strdup(name); - new_arglist |= CAMDD_ARG_DEVICE |CAMDD_ARG_UNIT; + new_cam_dev = cam_open_spec_device(name, unit, + O_RDWR, NULL); } - if (new_arglist & (CAMDD_ARG_BUS | CAMDD_ARG_TARGET)) - new_cam_dev = cam_open_btl(bus, target, lun, - O_RDWR, NULL); - else - new_cam_dev = cam_open_spec_device(device, unit, - O_RDWR, NULL); if (new_cam_dev == NULL) { warnx("%s", cam_errbuf); error = 1; From owner-svn-src-stable@freebsd.org Tue Feb 28 23:56:25 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C497BCF2BCF; Tue, 28 Feb 2017 23:56:25 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 9BF31A2E; Tue, 28 Feb 2017 23:56:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1SNuOQQ011390; Tue, 28 Feb 2017 23:56:24 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1SNuOKK011389; Tue, 28 Feb 2017 23:56:24 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702282356.v1SNuOKK011389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Feb 2017 23:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314439 - stable/11/usr.sbin/camdd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 23:56:25 -0000 Author: asomers Date: Tue Feb 28 23:56:24 2017 New Revision: 314439 URL: https://svnweb.freebsd.org/changeset/base/314439 Log: MFC r312559: Fix misc Coverity defects in camdd(8) CID 1341620 Fix a small memory leak CID 1341630 Though this is technically a false positive, rearrange the code for clarity. CID 1341635 Eliminate dead code CID 1368663 Fix a double mutex unlock in the error path Also: * Use sig_atomic_t for variables accessed from signal handlers * Don't conditionalize free(3) on its argument being non-null Reported by: Coverity CID: 1341620 1341630 1341635 1368663 Reviewed by: ken MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9237 Modified: stable/11/usr.sbin/camdd/camdd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/camdd/camdd.c ============================================================================== --- stable/11/usr.sbin/camdd/camdd.c Tue Feb 28 23:56:14 2017 (r314438) +++ stable/11/usr.sbin/camdd/camdd.c Tue Feb 28 23:56:24 2017 (r314439) @@ -420,9 +420,9 @@ struct camdd_dev { }; static sem_t camdd_sem; -static int need_exit = 0; -static int error_exit = 0; -static int need_status = 0; +static sig_atomic_t need_exit = 0; +static sig_atomic_t error_exit = 0; +static sig_atomic_t need_status = 0; #ifndef min #define min(a, b) (a < b) ? a : b @@ -712,11 +712,7 @@ camdd_alloc_buf(struct camdd_dev *dev, c return (buf); bailout_error: - if (data_ptr != NULL) - free(data_ptr); - - if (buf != NULL) - free(buf); + free(data_ptr); return (NULL); } @@ -2262,6 +2258,7 @@ camdd_file_run(struct camdd_dev *dev) if (file_dev->tmp_buf == NULL) { buf->status = CAMDD_STATUS_ERROR; error_count++; + pthread_mutex_lock(&dev->mutex); goto bailout; } for (i = 0, cur_offset = 0; i < data->sg_count; i++) { @@ -2984,7 +2981,6 @@ int camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io, int retry_count, int timeout) { - char *device = NULL; struct cam_device *new_cam_dev = NULL; struct camdd_dev *devs[2]; struct timespec start_time; @@ -3004,12 +3000,11 @@ camdd_rw(struct camdd_io_opts *io_opts, for (i = 0; i < num_io_opts; i++) { switch (io_opts[i].dev_type) { case CAMDD_DEV_PASS: { - camdd_argmask new_arglist = CAMDD_ARG_NONE; - int bus = 0, target = 0, lun = 0; - char name[30]; - int rv; - if (isdigit(io_opts[i].dev_name[0])) { + camdd_argmask new_arglist = CAMDD_ARG_NONE; + int bus = 0, target = 0, lun = 0; + int rv; + /* device specified as bus:target[:lun] */ rv = parse_btl(io_opts[i].dev_name, &bus, &target, &lun, &new_arglist); @@ -3025,23 +3020,21 @@ camdd_rw(struct camdd_io_opts *io_opts, lun = 0; new_arglist |= CAMDD_ARG_LUN; } + new_cam_dev = cam_open_btl(bus, target, lun, + O_RDWR, NULL); } else { + char name[30]; + if (cam_get_device(io_opts[i].dev_name, name, sizeof name, &unit) == -1) { warnx("%s", cam_errbuf); error = 1; goto bailout; } - device = strdup(name); - new_arglist |= CAMDD_ARG_DEVICE |CAMDD_ARG_UNIT; + new_cam_dev = cam_open_spec_device(name, unit, + O_RDWR, NULL); } - if (new_arglist & (CAMDD_ARG_BUS | CAMDD_ARG_TARGET)) - new_cam_dev = cam_open_btl(bus, target, lun, - O_RDWR, NULL); - else - new_cam_dev = cam_open_spec_device(device, unit, - O_RDWR, NULL); if (new_cam_dev == NULL) { warnx("%s", cam_errbuf); error = 1; From owner-svn-src-stable@freebsd.org Wed Mar 1 00:13:59 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2D85CF1315; Wed, 1 Mar 2017 00:13:59 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 949BD34A; Wed, 1 Mar 2017 00:13:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v210DwDe019109; Wed, 1 Mar 2017 00:13:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v210Dwxu019108; Wed, 1 Mar 2017 00:13:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201703010013.v210Dwxu019108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 1 Mar 2017 00:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314440 - stable/10/sys/dev/mpr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 00:13:59 -0000 Author: asomers Date: Wed Mar 1 00:13:58 2017 New Revision: 314440 URL: https://svnweb.freebsd.org/changeset/base/314440 Log: MFC r312995: Initialize a stack variable in mprsas_get_sas_address_for_sata_disk Thought it's difficult to reproduce, I think this variable was responsible for a use-after-free panic when a SATA disk timed out responding to a SATA identify command during boot. Submitted by: slm Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9364 Modified: stable/10/sys/dev/mpr/mpr_sas_lsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas_lsi.c Tue Feb 28 23:56:24 2017 (r314439) +++ stable/10/sys/dev/mpr/mpr_sas_lsi.c Wed Mar 1 00:13:58 2017 (r314440) @@ -893,6 +893,7 @@ mprsas_get_sas_address_for_sata_disk(str u8 sas_status; memset(&ata_identify, 0, sizeof(ata_identify)); + memset(&mpi_reply, 0, sizeof(mpi_reply)); try_count = 0; do { rc = mprsas_get_sata_identify(sc, handle, &mpi_reply, From owner-svn-src-stable@freebsd.org Wed Mar 1 00:17:05 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABD07CF1450; Wed, 1 Mar 2017 00:17:05 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id 787DB6C6; Wed, 1 Mar 2017 00:17:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v210H4BK019274; Wed, 1 Mar 2017 00:17:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v210H4DH019273; Wed, 1 Mar 2017 00:17:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201703010017.v210H4DH019273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 1 Mar 2017 00:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314441 - stable/11/sys/dev/mpr X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 00:17:05 -0000 Author: asomers Date: Wed Mar 1 00:17:04 2017 New Revision: 314441 URL: https://svnweb.freebsd.org/changeset/base/314441 Log: MFC r312995: Initialize a stack variable in mprsas_get_sas_address_for_sata_disk Thought it's difficult to reproduce, I think this variable was responsible for a use-after-free panic when a SATA disk timed out responding to a SATA identify command during boot. Submitted by: slm Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9364 Modified: stable/11/sys/dev/mpr/mpr_sas_lsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- stable/11/sys/dev/mpr/mpr_sas_lsi.c Wed Mar 1 00:13:58 2017 (r314440) +++ stable/11/sys/dev/mpr/mpr_sas_lsi.c Wed Mar 1 00:17:04 2017 (r314441) @@ -893,6 +893,7 @@ mprsas_get_sas_address_for_sata_disk(str u8 sas_status; memset(&ata_identify, 0, sizeof(ata_identify)); + memset(&mpi_reply, 0, sizeof(mpi_reply)); try_count = 0; do { rc = mprsas_get_sata_identify(sc, handle, &mpi_reply, From owner-svn-src-stable@freebsd.org Wed Mar 1 01:17:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78EB1CF27DE; Wed, 1 Mar 2017 01:17:52 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id 3A9CEAB6; Wed, 1 Mar 2017 01:17:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v211Hp1k043268; Wed, 1 Mar 2017 01:17:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v211Hpp6043267; Wed, 1 Mar 2017 01:17:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201703010117.v211Hpp6043267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 1 Mar 2017 01:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314444 - stable/11/usr.bin/dc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 01:17:52 -0000 Author: pfg Date: Wed Mar 1 01:17:51 2017 New Revision: 314444 URL: https://svnweb.freebsd.org/changeset/base/314444 Log: MFC r314316: dc(1): Catch up with OpenBSD tag. OpenBSD rev 1.12 corresponds to our SVN r275162. Update the tag to make easier future updates. No functional change. Modified: stable/11/usr.bin/dc/stack.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/dc/stack.c ============================================================================== --- stable/11/usr.bin/dc/stack.c Wed Mar 1 00:42:38 2017 (r314443) +++ stable/11/usr.bin/dc/stack.c Wed Mar 1 01:17:51 2017 (r314444) @@ -1,4 +1,4 @@ -/* $OpenBSD: stack.c,v 1.11 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: stack.c,v 1.12 2014/11/26 15:05:51 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek From owner-svn-src-stable@freebsd.org Wed Mar 1 01:19:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08A3CF2863; Wed, 1 Mar 2017 01:19:42 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id 6FE11C0C; Wed, 1 Mar 2017 01:19:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v211JfSX043388; Wed, 1 Mar 2017 01:19:41 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v211JfIM043387; Wed, 1 Mar 2017 01:19:41 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201703010119.v211JfIM043387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 1 Mar 2017 01:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314445 - stable/10/usr.bin/dc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 01:19:42 -0000 Author: pfg Date: Wed Mar 1 01:19:41 2017 New Revision: 314445 URL: https://svnweb.freebsd.org/changeset/base/314445 Log: MFC r314316: dc(1): Catch up with OpenBSD tag. OpenBSD rev 1.12 corresponds to our SVN r275162. Update the tag to make easier future updates. No functional change. Modified: stable/10/usr.bin/dc/stack.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/dc/stack.c ============================================================================== --- stable/10/usr.bin/dc/stack.c Wed Mar 1 01:17:51 2017 (r314444) +++ stable/10/usr.bin/dc/stack.c Wed Mar 1 01:19:41 2017 (r314445) @@ -1,4 +1,4 @@ -/* $OpenBSD: stack.c,v 1.11 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: stack.c,v 1.12 2014/11/26 15:05:51 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek From owner-svn-src-stable@freebsd.org Wed Mar 1 01:44:41 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2D30CF2E71; Wed, 1 Mar 2017 01:44:41 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 4A7E5A32; Wed, 1 Mar 2017 01:44:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v211ieIX054785; Wed, 1 Mar 2017 01:44:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v211ieAf054784; Wed, 1 Mar 2017 01:44:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703010144.v211ieAf054784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 1 Mar 2017 01:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314446 - stable/10/contrib/tzcode/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 01:44:41 -0000 Author: emaste Date: Wed Mar 1 01:44:40 2017 New Revision: 314446 URL: https://svnweb.freebsd.org/changeset/base/314446 Log: MFC r313774: localtime: return NULL if time_t out of range of struct tm Previously we would truncate tm.tm_year for any time_t corresponding to a year that does not fit in int. This issue was discovered because it caused the bash-static build to fail when linking with LLD. As reported by Rafael Espíndola: Configure has AC_FUNC_MKTIME which expands to a test of mktime that fails with the freebsd implementation. Given that, bash compiles a mktime.o file that defines just mktime and uses localtime. That goes in a .a file that is before libc. The freebsd libc defines mktime in localtime.o, which also defines localtime among other functions. When lld sees an undefined reference to mktime from libc, it uses the bash provided one and then tries to find a definition of localtime. It is found on libc's localtime.o, but now we have a duplicated error. The reason it works with bfd is that bash doesn't use mktime directly and the undefined reference from libc is resolved to the libc implementation. It would also fail to link if bash itself directly used mktime. The bash-static configure test verifies that, for many values of t, either localtime(t) returns NULL or mktime(localtime(t)) == t. This test failed when localtime returned a truncated tm_year. This was fixed in tzcode in 2004 but has persisted in our tree since rS2708. Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/tzcode/stdtime/localtime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzcode/stdtime/localtime.c ============================================================================== --- stable/10/contrib/tzcode/stdtime/localtime.c Wed Mar 1 01:19:41 2017 (r314445) +++ stable/10/contrib/tzcode/stdtime/localtime.c Wed Mar 1 01:44:40 2017 (r314446) @@ -1460,14 +1460,13 @@ const time_t * const timep; } _RWLOCK_RDLOCK(&lcl_rwlock); tzset_basic(1); - localsub(timep, 0L, p_tm); + p_tm = localsub(timep, 0L, p_tm); _RWLOCK_UNLOCK(&lcl_rwlock); - return(p_tm); } else { tzset_basic(0); - localsub(timep, 0L, &tm); - return(&tm); + p_tm = localsub(timep, 0L, &tm); } + return(p_tm); } /* @@ -1481,7 +1480,7 @@ struct tm * tmp; { _RWLOCK_RDLOCK(&lcl_rwlock); tzset_basic(1); - localsub(timep, 0L, tmp); + tmp = localsub(timep, 0L, tmp); _RWLOCK_UNLOCK(&lcl_rwlock); return tmp; } From owner-svn-src-stable@freebsd.org Wed Mar 1 01:45:54 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FABCF2EEA; Wed, 1 Mar 2017 01:45:54 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id AB00BB8A; Wed, 1 Mar 2017 01:45:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v211jqqN054888; Wed, 1 Mar 2017 01:45:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v211jqPc054887; Wed, 1 Mar 2017 01:45:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703010145.v211jqPc054887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 1 Mar 2017 01:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314447 - stable/11/contrib/tzcode/stdtime X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 01:45:54 -0000 Author: emaste Date: Wed Mar 1 01:45:52 2017 New Revision: 314447 URL: https://svnweb.freebsd.org/changeset/base/314447 Log: MFC r313774: localtime: return NULL if time_t out of range of struct tm Previously we would truncate tm.tm_year for any time_t corresponding to a year that does not fit in int. This issue was discovered because it caused the bash-static build to fail when linking with LLD. As reported by Rafael Espíndola: Configure has AC_FUNC_MKTIME which expands to a test of mktime that fails with the freebsd implementation. Given that, bash compiles a mktime.o file that defines just mktime and uses localtime. That goes in a .a file that is before libc. The freebsd libc defines mktime in localtime.o, which also defines localtime among other functions. When lld sees an undefined reference to mktime from libc, it uses the bash provided one and then tries to find a definition of localtime. It is found on libc's localtime.o, but now we have a duplicated error. The reason it works with bfd is that bash doesn't use mktime directly and the undefined reference from libc is resolved to the libc implementation. It would also fail to link if bash itself directly used mktime. The bash-static configure test verifies that, for many values of t, either localtime(t) returns NULL or mktime(localtime(t)) == t. This test failed when localtime returned a truncated tm_year. This was fixed in tzcode in 2004 but has persisted in our tree since rS2708. Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/tzcode/stdtime/localtime.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzcode/stdtime/localtime.c ============================================================================== --- stable/11/contrib/tzcode/stdtime/localtime.c Wed Mar 1 01:44:40 2017 (r314446) +++ stable/11/contrib/tzcode/stdtime/localtime.c Wed Mar 1 01:45:52 2017 (r314447) @@ -1453,14 +1453,13 @@ localtime(const time_t *const timep) } _RWLOCK_RDLOCK(&lcl_rwlock); tzset_basic(1); - localsub(timep, 0L, p_tm); + p_tm = localsub(timep, 0L, p_tm); _RWLOCK_UNLOCK(&lcl_rwlock); - return(p_tm); } else { tzset_basic(0); - localsub(timep, 0L, &tm); - return(&tm); + p_tm = localsub(timep, 0L, &tm); } + return(p_tm); } /* @@ -1472,7 +1471,7 @@ localtime_r(const time_t *const timep, s { _RWLOCK_RDLOCK(&lcl_rwlock); tzset_basic(1); - localsub(timep, 0L, tmp); + tmp = localsub(timep, 0L, tmp); _RWLOCK_UNLOCK(&lcl_rwlock); return tmp; } From owner-svn-src-stable@freebsd.org Wed Mar 1 04:24:31 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A008FCF0EA9; Wed, 1 Mar 2017 04:24:31 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 6DCB2CB2; Wed, 1 Mar 2017 04:24:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v214OUNZ019011; Wed, 1 Mar 2017 04:24:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v214OU21019010; Wed, 1 Mar 2017 04:24:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703010424.v214OU21019010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 1 Mar 2017 04:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314465 - stable/11/sys/dev/iscsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 04:24:31 -0000 Author: mav Date: Wed Mar 1 04:24:30 2017 New Revision: 314465 URL: https://svnweb.freebsd.org/changeset/base/314465 Log: MFC r313779: Fix handling of negative sbspace() return values. I found that at least with Chelsio NICs TOE sockets quite often report negative sbspace() values. Using unsigned variable to store it resulted in attempts to aggregate too much data in one sosend() call, that caused errors and following connection termination. Modified: stable/11/sys/dev/iscsi/icl_soft.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/icl_soft.c ============================================================================== --- stable/11/sys/dev/iscsi/icl_soft.c Wed Mar 1 04:24:24 2017 (r314464) +++ stable/11/sys/dev/iscsi/icl_soft.c Wed Mar 1 04:24:30 2017 (r314465) @@ -892,7 +892,7 @@ icl_conn_send_pdus(struct icl_conn *ic, { struct icl_pdu *request, *request2; struct socket *so; - size_t available, size, size2; + long available, size, size2; int coalesced, error; ICL_CONN_LOCK_ASSERT_NOT(ic); @@ -931,7 +931,7 @@ icl_conn_send_pdus(struct icl_conn *ic, if (available < size) { #if 1 ICL_DEBUG("no space to send; " - "have %zd, need %zd", + "have %ld, need %ld", available, size); #endif so->so_snd.sb_lowat = size; @@ -978,7 +978,7 @@ icl_conn_send_pdus(struct icl_conn *ic, } #if 0 if (coalesced > 1) { - ICL_DEBUG("coalesced %d PDUs into %zd bytes", + ICL_DEBUG("coalesced %d PDUs into %ld bytes", coalesced, size); } #endif From owner-svn-src-stable@freebsd.org Wed Mar 1 08:01:44 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 863CECF2738; Wed, 1 Mar 2017 08:01:44 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CCA32859; Wed, 1 Mar 2017 08:01:43 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (220-253-188-71.dyn.iinet.net.au [220.253.188.71]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v2181bVD018360 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 1 Mar 2017 00:01:40 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r314465 - stable/11/sys/dev/iscsi To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201703010424.v214OU21019010@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Wed, 1 Mar 2017 16:01:31 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201703010424.v214OU21019010@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 08:01:44 -0000 Might be an idea to add a comment in a good place pointing out that that should not be unsigned so that the next person doesn't make the same mistake.. On 1/3/17 12:24 pm, Alexander Motin wrote: > Author: mav > Date: Wed Mar 1 04:24:30 2017 > New Revision: 314465 > URL: https://svnweb.freebsd.org/changeset/base/314465 > > Log: > MFC r313779: Fix handling of negative sbspace() return values. > > I found that at least with Chelsio NICs TOE sockets quite often report > negative sbspace() values. Using unsigned variable to store it resulted > in attempts to aggregate too much data in one sosend() call, that caused > errors and following connection termination. > > Modified: > stable/11/sys/dev/iscsi/icl_soft.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/dev/iscsi/icl_soft.c > ============================================================================== > --- stable/11/sys/dev/iscsi/icl_soft.c Wed Mar 1 04:24:24 2017 (r314464) > +++ stable/11/sys/dev/iscsi/icl_soft.c Wed Mar 1 04:24:30 2017 (r314465) > @@ -892,7 +892,7 @@ icl_conn_send_pdus(struct icl_conn *ic, > { > struct icl_pdu *request, *request2; > struct socket *so; > - size_t available, size, size2; > + long available, size, size2; > int coalesced, error; > > ICL_CONN_LOCK_ASSERT_NOT(ic); > @@ -931,7 +931,7 @@ icl_conn_send_pdus(struct icl_conn *ic, > if (available < size) { > #if 1 > ICL_DEBUG("no space to send; " > - "have %zd, need %zd", > + "have %ld, need %ld", > available, size); > #endif > so->so_snd.sb_lowat = size; > @@ -978,7 +978,7 @@ icl_conn_send_pdus(struct icl_conn *ic, > } > #if 0 > if (coalesced > 1) { > - ICL_DEBUG("coalesced %d PDUs into %zd bytes", > + ICL_DEBUG("coalesced %d PDUs into %ld bytes", > coalesced, size); > } > #endif > > From owner-svn-src-stable@freebsd.org Wed Mar 1 13:45:41 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2DB4CF3EDB; Wed, 1 Mar 2017 13:45:41 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id AFBE99DE; Wed, 1 Mar 2017 13:45:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21Dje2Q038126; Wed, 1 Mar 2017 13:45:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21DjeFS038125; Wed, 1 Mar 2017 13:45:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703011345.v21DjeFS038125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 1 Mar 2017 13:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314491 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 13:45:42 -0000 Author: avg Date: Wed Mar 1 13:45:40 2017 New Revision: 314491 URL: https://svnweb.freebsd.org/changeset/base/314491 Log: MFC r314100: fix a typo in __STDC_VERSION__ in __min_size requirements Modified: stable/11/sys/sys/cdefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Wed Mar 1 12:10:24 2017 (r314490) +++ stable/11/sys/sys/cdefs.h Wed Mar 1 13:45:40 2017 (r314491) @@ -349,7 +349,7 @@ * void bar(int myArray[__min_size(10)]); */ #if !defined(__cplusplus) && \ - (!defined(__STDC_VERSION) || (__STDC_VERSION__ >= 199901)) + (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901)) #define __min_size(x) static (x) #else #define __min_size(x) (x) From owner-svn-src-stable@freebsd.org Wed Mar 1 13:45:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32146CF3F19; Wed, 1 Mar 2017 13:45:52 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id F3343A78; Wed, 1 Mar 2017 13:45:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21DjpN6038181; Wed, 1 Mar 2017 13:45:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21DjpM9038180; Wed, 1 Mar 2017 13:45:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703011345.v21DjpM9038180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 1 Mar 2017 13:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314492 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 13:45:52 -0000 Author: avg Date: Wed Mar 1 13:45:50 2017 New Revision: 314492 URL: https://svnweb.freebsd.org/changeset/base/314492 Log: MFC r314100: fix a typo in __STDC_VERSION__ in __min_size requirements Modified: stable/10/sys/sys/cdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/cdefs.h ============================================================================== --- stable/10/sys/sys/cdefs.h Wed Mar 1 13:45:40 2017 (r314491) +++ stable/10/sys/sys/cdefs.h Wed Mar 1 13:45:50 2017 (r314492) @@ -340,7 +340,7 @@ * void bar(int myArray[__min_size(10)]); */ #if !defined(__cplusplus) && \ - (!defined(__STDC_VERSION) || (__STDC_VERSION__ >= 199901)) + (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901)) #define __min_size(x) static (x) #else #define __min_size(x) (x) From owner-svn-src-stable@freebsd.org Wed Mar 1 13:47:30 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2750FCEE022; Wed, 1 Mar 2017 13:47:30 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id E839FCB1; Wed, 1 Mar 2017 13:47:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21DlSvn038297; Wed, 1 Mar 2017 13:47:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21DlSnb038296; Wed, 1 Mar 2017 13:47:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703011347.v21DlSnb038296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 1 Mar 2017 13:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314493 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 13:47:30 -0000 Author: avg Date: Wed Mar 1 13:47:28 2017 New Revision: 314493 URL: https://svnweb.freebsd.org/changeset/base/314493 Log: MFC r314101: don't use C99 static array indices with older GCC versions Sponsored by: Panzura Modified: stable/11/sys/sys/cdefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Wed Mar 1 13:45:50 2017 (r314492) +++ stable/11/sys/sys/cdefs.h Wed Mar 1 13:47:28 2017 (r314493) @@ -349,6 +349,7 @@ * void bar(int myArray[__min_size(10)]); */ #if !defined(__cplusplus) && \ + (defined(__clang__) || __GNUC_PREREQ__(4, 6)) && \ (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901)) #define __min_size(x) static (x) #else From owner-svn-src-stable@freebsd.org Wed Mar 1 13:47:38 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52A30CEE073; Wed, 1 Mar 2017 13:47:38 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 1FA32D1E; Wed, 1 Mar 2017 13:47:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21DlbNd038347; Wed, 1 Mar 2017 13:47:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21DlbYi038346; Wed, 1 Mar 2017 13:47:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703011347.v21DlbYi038346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 1 Mar 2017 13:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314494 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 13:47:38 -0000 Author: avg Date: Wed Mar 1 13:47:36 2017 New Revision: 314494 URL: https://svnweb.freebsd.org/changeset/base/314494 Log: MFC r314101: don't use C99 static array indices with older GCC versions Sponsored by: Panzura Modified: stable/10/sys/sys/cdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/cdefs.h ============================================================================== --- stable/10/sys/sys/cdefs.h Wed Mar 1 13:47:28 2017 (r314493) +++ stable/10/sys/sys/cdefs.h Wed Mar 1 13:47:36 2017 (r314494) @@ -340,6 +340,7 @@ * void bar(int myArray[__min_size(10)]); */ #if !defined(__cplusplus) && \ + (defined(__clang__) || __GNUC_PREREQ__(4, 6)) && \ (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901)) #define __min_size(x) static (x) #else From owner-svn-src-stable@freebsd.org Wed Mar 1 18:03:36 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CFECCF3729; Wed, 1 Mar 2017 18:03:36 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 09DAD642; Wed, 1 Mar 2017 18:03:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21I3Z0t043284; Wed, 1 Mar 2017 18:03:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21I3Zv1043283; Wed, 1 Mar 2017 18:03:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703011803.v21I3Zv1043283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 18:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314498 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 18:03:36 -0000 Author: ian Date: Wed Mar 1 18:03:34 2017 New Revision: 314498 URL: https://svnweb.freebsd.org/changeset/base/314498 Log: MFC r310430: Use ${.OBJDIR} to refer to the kernel build object dir, instead of trying to recreate it from ${MAKEOBJDIRPREFIX} and ${SRC_BASE} and ${KERNCONF}, the latter being especially problematic when KERNCONF is set to the names of multiple kernel configs. Modified: stable/11/sys/conf/kern.post.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.post.mk ============================================================================== --- stable/11/sys/conf/kern.post.mk Wed Mar 1 18:03:32 2017 (r314497) +++ stable/11/sys/conf/kern.post.mk Wed Mar 1 18:03:34 2017 (r314498) @@ -63,7 +63,7 @@ OSRELDATE!= awk '/^\#define[[:space:]]*_ ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h .endif # Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build -WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} +WRKDIRPREFIX?= ${.OBJDIR} PORTSMODULESENV=\ env \ -u CC \ From owner-svn-src-stable@freebsd.org Wed Mar 1 18:05:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 052DBCF3803; Wed, 1 Mar 2017 18:05:42 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id C888395F; Wed, 1 Mar 2017 18:05:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21I5ecx043403; Wed, 1 Mar 2017 18:05:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21I5eaQ043402; Wed, 1 Mar 2017 18:05:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703011805.v21I5eaQ043402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 18:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314499 - stable/11/sys/dev/gpio X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 18:05:42 -0000 Author: ian Date: Wed Mar 1 18:05:40 2017 New Revision: 314499 URL: https://svnweb.freebsd.org/changeset/base/314499 Log: MFC r311658: Only write to *active once, even when GPIO_ACTIVE_LOW is set. Modified: stable/11/sys/dev/gpio/ofw_gpiobus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- stable/11/sys/dev/gpio/ofw_gpiobus.c Wed Mar 1 18:03:34 2017 (r314498) +++ stable/11/sys/dev/gpio/ofw_gpiobus.c Wed Mar 1 18:05:40 2017 (r314499) @@ -176,9 +176,10 @@ gpio_pin_is_active(gpio_pin_t pin, bool return (rv); } - *active = tmp != 0; if (pin->flags & GPIO_ACTIVE_LOW) - *active = !(*active); + *active = tmp == 0; + else + *active = tmp != 0; return (0); } From owner-svn-src-stable@freebsd.org Wed Mar 1 18:19:47 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8E30CF3FDB; Wed, 1 Mar 2017 18:19:47 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 980D2394; Wed, 1 Mar 2017 18:19:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21IJkr5047533; Wed, 1 Mar 2017 18:19:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21IJkC5047532; Wed, 1 Mar 2017 18:19:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703011819.v21IJkC5047532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 18:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314500 - stable/11/sys/dev/usb/serial X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 18:19:47 -0000 Author: ian Date: Wed Mar 1 18:19:46 2017 New Revision: 314500 URL: https://svnweb.freebsd.org/changeset/base/314500 Log: MFC r303346: Actually return line status register values from umoscom_cfg_get_status(). The hardware delivers ns16550-compatible status bits, which is what the usb_serial code expects, so no need for translation, no need for a local variable to hold a temporary lsr result. Modified: stable/11/sys/dev/usb/serial/umoscom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/umoscom.c ============================================================================== --- stable/11/sys/dev/usb/serial/umoscom.c Wed Mar 1 18:05:40 2017 (r314499) +++ stable/11/sys/dev/usb/serial/umoscom.c Wed Mar 1 18:19:46 2017 (r314500) @@ -523,14 +523,16 @@ static void umoscom_cfg_get_status(struct ucom_softc *ucom, uint8_t *p_lsr, uint8_t *p_msr) { struct umoscom_softc *sc = ucom->sc_parent; - uint8_t lsr; uint8_t msr; DPRINTFN(5, "\n"); - /* read status registers */ + /* + * Read status registers. MSR bits need translation from ns16550 to + * SER_* values. LSR bits are ns16550 in hardware and ucom. + */ - lsr = umoscom_cfg_read(sc, UMOSCOM_LSR); + *p_lsr = umoscom_cfg_read(sc, UMOSCOM_LSR); msr = umoscom_cfg_read(sc, UMOSCOM_MSR); /* translate bits */ From owner-svn-src-stable@freebsd.org Wed Mar 1 18:23:32 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E389BCF3189; Wed, 1 Mar 2017 18:23:32 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id A3406A2E; Wed, 1 Mar 2017 18:23:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21INVCK051207; Wed, 1 Mar 2017 18:23:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21INUNl051196; Wed, 1 Mar 2017 18:23:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703011823.v21INUNl051196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 18:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314501 - stable/11/sys/dev/usb/serial X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 18:23:33 -0000 Author: ian Date: Wed Mar 1 18:23:30 2017 New Revision: 314501 URL: https://svnweb.freebsd.org/changeset/base/314501 Log: MFC r303347, r303350, r303351, r303353: Translate modem status reg bits from ns16550 to SER_* values used by the tty layer. Annotate the usb-serial drivers which always return 0 for line status, so that it'll be easier to find and fix them in the future. Also annotate a switch case fall-through per style(9). Modified: stable/11/sys/dev/usb/serial/u3g.c stable/11/sys/dev/usb/serial/uark.c stable/11/sys/dev/usb/serial/ubsa.c stable/11/sys/dev/usb/serial/uchcom.c stable/11/sys/dev/usb/serial/ufoma.c stable/11/sys/dev/usb/serial/umcs.c stable/11/sys/dev/usb/serial/umct.c stable/11/sys/dev/usb/serial/umodem.c stable/11/sys/dev/usb/serial/uplcom.c stable/11/sys/dev/usb/serial/uslcom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/11/sys/dev/usb/serial/u3g.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/u3g.c Wed Mar 1 18:23:30 2017 (r314501) @@ -1102,6 +1102,7 @@ u3g_cfg_get_status(struct ucom_softc *uc { struct u3g_softc *sc = ucom->sc_parent; + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr[ucom->sc_subunit]; *msr = sc->sc_msr[ucom->sc_subunit]; } Modified: stable/11/sys/dev/usb/serial/uark.c ============================================================================== --- stable/11/sys/dev/usb/serial/uark.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/uark.c Wed Mar 1 18:23:30 2017 (r314501) @@ -427,6 +427,7 @@ uark_cfg_get_status(struct ucom_softc *u { struct uark_softc *sc = ucom->sc_parent; + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: stable/11/sys/dev/usb/serial/ubsa.c ============================================================================== --- stable/11/sys/dev/usb/serial/ubsa.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/ubsa.c Wed Mar 1 18:23:30 2017 (r314501) @@ -650,11 +650,19 @@ ubsa_intr_callback(struct usb_xfer *xfer usbd_copy_out(pc, 0, buf, sizeof(buf)); /* - * incidentally, Belkin adapter status bits match - * UART 16550 bits + * MSR bits need translation from ns16550 to SER_* values. + * LSR bits are ns16550 in hardware and ucom. */ + sc->sc_msr = 0; + if (buf[3] & UBSA_MSR_CTS) + sc->sc_msr |= SER_CTS; + if (buf[3] & UBSA_MSR_DCD) + sc->sc_msr |= SER_DCD; + if (buf[3] & UBSA_MSR_RI) + sc->sc_msr |= SER_RI; + if (buf[3] & UBSA_MSR_DSR) + sc->sc_msr |= SER_DSR; sc->sc_lsr = buf[2]; - sc->sc_msr = buf[3]; DPRINTF("lsr = 0x%02x, msr = 0x%02x\n", sc->sc_lsr, sc->sc_msr); @@ -663,7 +671,7 @@ ubsa_intr_callback(struct usb_xfer *xfer } else { DPRINTF("ignoring short packet, %d bytes\n", actlen); } - + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); Modified: stable/11/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/11/sys/dev/usb/serial/uchcom.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/uchcom.c Wed Mar 1 18:23:30 2017 (r314501) @@ -625,6 +625,7 @@ uchcom_cfg_get_status(struct ucom_softc DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: stable/11/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/11/sys/dev/usb/serial/ufoma.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/ufoma.c Wed Mar 1 18:23:30 2017 (r314501) @@ -900,6 +900,7 @@ ufoma_cfg_get_status(struct ucom_softc * { struct ufoma_softc *sc = ucom->sc_parent; + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: stable/11/sys/dev/usb/serial/umcs.c ============================================================================== --- stable/11/sys/dev/usb/serial/umcs.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/umcs.c Wed Mar 1 18:23:30 2017 (r314501) @@ -743,15 +743,26 @@ umcs7840_cfg_get_status(struct ucom_soft { struct umcs7840_softc *sc = ucom->sc_parent; uint8_t pn = ucom->sc_portno; - uint8_t hw_lsr = 0; /* local line status register */ uint8_t hw_msr = 0; /* local modem status register */ - /* Read LSR & MSR */ - umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_LSR, &hw_lsr); + /* + * Read status registers. MSR bits need translation from ns16550 to + * SER_* values. LSR bits are ns16550 in hardware and ucom. + */ + umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_LSR, lsr); umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_MSR, &hw_msr); - *lsr = hw_lsr; - *msr = hw_msr; + if (hw_msr & MCS7840_UART_MSR_NEGCTS) + *msr |= SER_CTS; + + if (hw_msr & MCS7840_UART_MSR_NEGDCD) + *msr |= SER_DCD; + + if (hw_msr & MCS7840_UART_MSR_NEGRI) + *msr |= SER_RI; + + if (hw_msr & MCS7840_UART_MSR_NEGDSR) + *msr |= SER_DSR; DPRINTF("Port %d status: LSR=%02x MSR=%02x\n", ucom->sc_portno, *lsr, *msr); } Modified: stable/11/sys/dev/usb/serial/umct.c ============================================================================== --- stable/11/sys/dev/usb/serial/umct.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/umct.c Wed Mar 1 18:23:30 2017 (r314501) @@ -86,6 +86,15 @@ __FBSDID("$FreeBSD$"); #define UMCT_SET_MCR 10 /* Set Modem Control Register */ #define UMCT_SET_MCR_SIZE 1 +#define UMCT_MSR_CTS_CHG 0x01 +#define UMCT_MSR_DSR_CHG 0x02 +#define UMCT_MSR_RI_CHG 0x04 +#define UMCT_MSR_CD_CHG 0x08 +#define UMCT_MSR_CTS 0x10 +#define UMCT_MSR_RTS 0x20 +#define UMCT_MSR_RI 0x40 +#define UMCT_MSR_CD 0x80 + #define UMCT_INTR_INTERVAL 100 #define UMCT_IFACE_INDEX 0 #define UMCT_CONFIG_INDEX 0 @@ -384,11 +393,23 @@ umct_intr_callback_sub(struct usb_xfer * pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); - sc->sc_msr = buf[0]; + /* + * MSR bits need translation from ns16550 to SER_* values. + * LSR bits are ns16550 in hardware and ucom. + */ + sc->sc_msr = 0; + if (buf[0] & UMCT_MSR_CTS) + sc->sc_msr |= SER_CTS; + if (buf[0] & UMCT_MSR_CD) + sc->sc_msr |= SER_DCD; + if (buf[0] & UMCT_MSR_RI) + sc->sc_msr |= SER_RI; + if (buf[0] & UMCT_MSR_RTS) + sc->sc_msr |= SER_DSR; sc->sc_lsr = buf[1]; ucom_status_change(&sc->sc_ucom); - + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); Modified: stable/11/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/11/sys/dev/usb/serial/umodem.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/umodem.c Wed Mar 1 18:23:30 2017 (r314501) @@ -558,6 +558,7 @@ umodem_cfg_get_status(struct ucom_softc DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: stable/11/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/11/sys/dev/usb/serial/uplcom.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/uplcom.c Wed Mar 1 18:23:30 2017 (r314501) @@ -807,6 +807,7 @@ uplcom_cfg_get_status(struct ucom_softc DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } Modified: stable/11/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/11/sys/dev/usb/serial/uslcom.c Wed Mar 1 18:19:46 2017 (r314500) +++ stable/11/sys/dev/usb/serial/uslcom.c Wed Mar 1 18:23:30 2017 (r314501) @@ -704,6 +704,7 @@ uslcom_get_status(struct ucom_softc *uco DPRINTF("\n"); + /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } From owner-svn-src-stable@freebsd.org Wed Mar 1 18:53:09 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 490C0CF38BE; Wed, 1 Mar 2017 18:53:09 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id EBD7ED3D; Wed, 1 Mar 2017 18:53:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21Ir8qR063256; Wed, 1 Mar 2017 18:53:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21Ir54W063233; Wed, 1 Mar 2017 18:53:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703011853.v21Ir54W063233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 18:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314503 - in stable/11/sys/arm: altera/socfpga broadcom/bcm2835 freescale/imx freescale/vybrid lpc mv rockchip ti ti/am335x versatile xilinx X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 18:53:09 -0000 Author: ian Date: Wed Mar 1 18:53:05 2017 New Revision: 314503 URL: https://svnweb.freebsd.org/changeset/base/314503 Log: MFC r308640: Use the correct OF_getencprop over OF_getprop + fdt32_to_cpu to read integer data from the device tree. Modified: stable/11/sys/arm/altera/socfpga/socfpga_common.c stable/11/sys/arm/altera/socfpga/socfpga_rstmgr.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_fb.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/11/sys/arm/freescale/imx/imx51_ipuv3.c stable/11/sys/arm/freescale/imx/imx51_ipuv3_fbd.c stable/11/sys/arm/freescale/imx/imx6_ssi.c stable/11/sys/arm/freescale/vybrid/vf_common.c stable/11/sys/arm/freescale/vybrid/vf_dcu4.c stable/11/sys/arm/freescale/vybrid/vf_edma.c stable/11/sys/arm/freescale/vybrid/vf_iomuxc.c stable/11/sys/arm/freescale/vybrid/vf_sai.c stable/11/sys/arm/lpc/lpc_fb.c stable/11/sys/arm/lpc/lpc_timer.c stable/11/sys/arm/mv/gpio.c stable/11/sys/arm/mv/mv_machdep.c stable/11/sys/arm/rockchip/rk30xx_gpio.c stable/11/sys/arm/ti/am335x/am335x_lcd.c stable/11/sys/arm/ti/am335x/am335x_lcd_syscons.c stable/11/sys/arm/ti/ti_adc.c stable/11/sys/arm/ti/ti_sdhci.c stable/11/sys/arm/versatile/sp804.c stable/11/sys/arm/xilinx/zy7_slcr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/altera/socfpga/socfpga_common.c ============================================================================== --- stable/11/sys/arm/altera/socfpga/socfpga_common.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/altera/socfpga/socfpga_common.c Wed Mar 1 18:53:05 2017 (r314503) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -47,7 +46,7 @@ __FBSDID("$FreeBSD$"); void cpu_reset(void) { - uint32_t addr, paddr; + uint32_t paddr; bus_addr_t vaddr; phandle_t node; @@ -58,9 +57,8 @@ cpu_reset(void) if (node == -1) goto end; - if ((OF_getprop(node, "reg", &paddr, sizeof(paddr))) > 0) { - addr = fdt32_to_cpu(paddr); - if (bus_space_map(fdtbus_bs_tag, addr, 0x8, 0, &vaddr) == 0) { + if ((OF_getencprop(node, "reg", &paddr, sizeof(paddr))) > 0) { + if (bus_space_map(fdtbus_bs_tag, paddr, 0x8, 0, &vaddr) == 0) { bus_space_write_4(fdtbus_bs_tag, vaddr, RSTMGR_CTRL, CTRL_SWWARMRSTREQ); } Modified: stable/11/sys/arm/altera/socfpga/socfpga_rstmgr.c ============================================================================== --- stable/11/sys/arm/altera/socfpga/socfpga_rstmgr.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/altera/socfpga/socfpga_rstmgr.c Wed Mar 1 18:53:05 2017 (r314503) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -84,7 +83,7 @@ enum { static int l3remap(struct rstmgr_softc *sc, int remap, int enable) { - uint32_t addr, paddr; + uint32_t paddr; bus_addr_t vaddr; phandle_t node; int reg; @@ -106,9 +105,8 @@ l3remap(struct rstmgr_softc *sc, int rem return (1); } - if ((OF_getprop(node, "reg", &paddr, sizeof(paddr))) > 0) { - addr = fdt32_to_cpu(paddr); - if (bus_space_map(fdtbus_bs_tag, addr, 0x4, 0, &vaddr) == 0) { + if ((OF_getencprop(node, "reg", &paddr, sizeof(paddr))) > 0) { + if (bus_space_map(fdtbus_bs_tag, paddr, 0x4, 0, &vaddr) == 0) { bus_space_write_4(fdtbus_bs_tag, vaddr, L3REGS_REMAP, reg); return (0); Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Mar 1 18:53:05 2017 (r314503) @@ -474,15 +474,15 @@ bcmfb_configure(int flags) if ((root != 0) && (display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) { if (sc->width == 0) { - if ((OF_getprop(display, "broadcom,width", + if ((OF_getencprop(display, "broadcom,width", &cell, sizeof(cell))) > 0) - sc->width = (int)fdt32_to_cpu(cell); + sc->width = cell; } if (sc->height == 0) { if ((OF_getprop(display, "broadcom,height", &cell, sizeof(cell))) > 0) - sc->height = (int)fdt32_to_cpu(cell); + sc->height = cell; } } Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Mar 1 18:53:05 2017 (r314503) @@ -78,13 +78,15 @@ bcm2835_late_init(platform_t plat) system = OF_finddevice("/system"); if (system != 0) { - len = OF_getprop(system, "linux,serial", &cells, sizeof(cells)); + len = OF_getencprop(system, "linux,serial", cells, + sizeof(cells)); if (len > 0) - board_set_serial(fdt64_to_cpu(*((uint64_t *)cells))); + board_set_serial(((uint64_t)cells[0]) << 32 | cells[1]); - len = OF_getprop(system, "linux,revision", &cells, sizeof(cells)); + len = OF_getencprop(system, "linux,revision", cells, + sizeof(cells)); if (len > 0) - board_set_revision(fdt32_to_cpu(*((uint32_t *)cells))); + board_set_revision(cells[0]); } } Modified: stable/11/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx51_ipuv3.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/imx/imx51_ipuv3.c Wed Mar 1 18:53:05 2017 (r314503) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -313,10 +312,10 @@ ipu3_fb_attach(device_t dev) * On i.MX53, the offset is 0. */ node = ofw_bus_get_node(dev); - if ((OF_getprop(node, "reg", ®, sizeof(reg))) <= 0) + if ((OF_getencprop(node, "reg", ®, sizeof(reg))) <= 0) base = 0; else - base = fdt32_to_cpu(reg) - IPU_CM_BASE(0); + base = reg - IPU_CM_BASE(0); /* map controller registers */ err = bus_space_map(iot, IPU_CM_BASE(base), IPU_CM_SIZE, 0, &ioh); if (err) Modified: stable/11/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Wed Mar 1 18:53:05 2017 (r314503) @@ -222,10 +222,10 @@ ipu3_fb_attach(device_t dev) * On i.MX53, the offset is 0. */ node = ofw_bus_get_node(dev); - if ((OF_getprop(node, "reg", ®, sizeof(reg))) <= 0) + if ((OF_getencprop(node, "reg", ®, sizeof(reg))) <= 0) base = 0; else - base = fdt32_to_cpu(reg) - IPU_CM_BASE(0); + base = reg - IPU_CM_BASE(0); /* map controller registers */ err = bus_space_map(iot, IPU_CM_BASE(base), IPU_CM_SIZE, 0, &ioh); if (err) Modified: stable/11/sys/arm/freescale/imx/imx6_ssi.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx6_ssi.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/imx/imx6_ssi.c Wed Mar 1 18:53:05 2017 (r314503) @@ -447,12 +447,12 @@ find_sdma_controller(struct sc_info *sc) if ((len = OF_getproplen(node, "dmas")) <= 0) return (ENXIO); - OF_getprop(node, "dmas", &dts_value, len); + OF_getencprop(node, "dmas", &dts_value, len); - sc->sdma_ev_rx = fdt32_to_cpu(dts_value[1]); - sc->sdma_ev_tx = fdt32_to_cpu(dts_value[5]); + sc->sdma_ev_rx = dts_value[1]; + sc->sdma_ev_tx = dts_value[5]; - sdma_node = OF_node_from_xref(fdt32_to_cpu(dts_value[0])); + sdma_node = OF_node_from_xref(dts_value[0]); sdma_sc = NULL; Modified: stable/11/sys/arm/freescale/vybrid/vf_common.c ============================================================================== --- stable/11/sys/arm/freescale/vybrid/vf_common.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/vybrid/vf_common.c Wed Mar 1 18:53:05 2017 (r314503) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -44,16 +43,15 @@ void cpu_reset(void) { phandle_t src; - uint32_t addr, paddr; + uint32_t paddr; bus_addr_t vaddr; if (src_swreset() == 0) goto end; src = OF_finddevice("src"); - if ((src != 0) && (OF_getprop(src, "reg", &paddr, sizeof(paddr))) > 0) { - addr = fdt32_to_cpu(paddr); - if (bus_space_map(fdtbus_bs_tag, addr, 0x10, 0, &vaddr) == 0) { + if ((src != 0) && (OF_getencprop(src, "reg", &paddr, sizeof(paddr))) > 0) { + if (bus_space_map(fdtbus_bs_tag, paddr, 0x10, 0, &vaddr) == 0) { bus_space_write_4(fdtbus_bs_tag, vaddr, 0x00, SW_RST); } } Modified: stable/11/sys/arm/freescale/vybrid/vf_dcu4.c ============================================================================== --- stable/11/sys/arm/freescale/vybrid/vf_dcu4.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/vybrid/vf_dcu4.c Wed Mar 1 18:53:05 2017 (r314503) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -246,37 +245,37 @@ get_panel_info(struct dcu_softc *sc, str /* panel size */ if ((len = OF_getproplen(node, "panel-size")) <= 0) return (ENXIO); - OF_getprop(node, "panel-size", &dts_value, len); - panel->width = fdt32_to_cpu(dts_value[0]); - panel->height = fdt32_to_cpu(dts_value[1]); + OF_getencprop(node, "panel-size", dts_value, len); + panel->width = dts_value[0]; + panel->height = dts_value[1]; /* hsync */ if ((len = OF_getproplen(node, "panel-hsync")) <= 0) return (ENXIO); - OF_getprop(node, "panel-hsync", &dts_value, len); - panel->h_back_porch = fdt32_to_cpu(dts_value[0]); - panel->h_pulse_width = fdt32_to_cpu(dts_value[1]); - panel->h_front_porch = fdt32_to_cpu(dts_value[2]); + OF_getencprop(node, "panel-hsync", dts_value, len); + panel->h_back_porch = dts_value[0]; + panel->h_pulse_width = dts_value[1]; + panel->h_front_porch = dts_value[2]; /* vsync */ if ((len = OF_getproplen(node, "panel-vsync")) <= 0) return (ENXIO); - OF_getprop(node, "panel-vsync", &dts_value, len); - panel->v_back_porch = fdt32_to_cpu(dts_value[0]); - panel->v_pulse_width = fdt32_to_cpu(dts_value[1]); - panel->v_front_porch = fdt32_to_cpu(dts_value[2]); + OF_getencprop(node, "panel-vsync", dts_value, len); + panel->v_back_porch = dts_value[0]; + panel->v_pulse_width = dts_value[1]; + panel->v_front_porch = dts_value[2]; /* clk divider */ if ((len = OF_getproplen(node, "panel-clk-div")) <= 0) return (ENXIO); - OF_getprop(node, "panel-clk-div", &dts_value, len); - panel->clk_div = fdt32_to_cpu(dts_value[0]); + OF_getencprop(node, "panel-clk-div", dts_value, len); + panel->clk_div = dts_value[0]; /* backlight pin */ if ((len = OF_getproplen(node, "panel-backlight-pin")) <= 0) return (ENXIO); - OF_getprop(node, "panel-backlight-pin", &dts_value, len); - panel->backlight_pin = fdt32_to_cpu(dts_value[0]); + OF_getencprop(node, "panel-backlight-pin", dts_value, len); + panel->backlight_pin = dts_value[0]; return (0); } Modified: stable/11/sys/arm/freescale/vybrid/vf_edma.c ============================================================================== --- stable/11/sys/arm/freescale/vybrid/vf_edma.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/vybrid/vf_edma.c Wed Mar 1 18:53:05 2017 (r314503) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -284,8 +283,8 @@ edma_attach(device_t dev) if ((len = OF_getproplen(node, "device-id")) <= 0) return (ENXIO); - OF_getprop(node, "device-id", &dts_value, len); - sc->device_id = fdt32_to_cpu(dts_value); + OF_getencprop(node, "device-id", &dts_value, len); + sc->device_id = dts_value; sc->dma_stop = dma_stop; sc->dma_setup = dma_setup; Modified: stable/11/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- stable/11/sys/arm/freescale/vybrid/vf_iomuxc.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/vybrid/vf_iomuxc.c Wed Mar 1 18:53:05 2017 (r314503) @@ -148,12 +148,12 @@ pinmux_set(struct iomuxc_softc *sc) continue; if ((len = OF_getproplen(child, "iomux_config")) > 0) { - OF_getprop(child, "iomux_config", &iomux_config, len); + OF_getencprop(child, "iomux_config", iomux_config, len); values = len / (sizeof(uint32_t)); for (i = 0; i < values; i += 2) { - pin = fdt32_to_cpu(iomux_config[i]); - pin_cfg = fdt32_to_cpu(iomux_config[i+1]); + pin = iomux_config[i]; + pin_cfg = iomux_config[i+1]; #if 0 device_printf(sc->dev, "Set pin %d to 0x%08x\n", pin, pin_cfg); Modified: stable/11/sys/arm/freescale/vybrid/vf_sai.c ============================================================================== --- stable/11/sys/arm/freescale/vybrid/vf_sai.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/freescale/vybrid/vf_sai.c Wed Mar 1 18:53:05 2017 (r314503) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -424,19 +423,19 @@ find_edma_controller(struct sc_info *sc) if ((len = OF_getproplen(node, "edma-mux-group")) <= 0) return (ENXIO); - OF_getprop(node, "edma-src-transmit", &dts_value, len); - edma_src_transmit = fdt32_to_cpu(dts_value); - OF_getprop(node, "edma-mux-group", &dts_value, len); - edma_mux_group = fdt32_to_cpu(dts_value); - OF_getprop(node, "edma-controller", &dts_value, len); - edma_node = OF_node_from_xref(fdt32_to_cpu(dts_value)); + OF_getencprop(node, "edma-src-transmit", &dts_value, len); + edma_src_transmit = dts_value; + OF_getencprop(node, "edma-mux-group", &dts_value, len); + edma_mux_group = dts_value; + OF_getencprop(node, "edma-controller", &dts_value, len); + edma_node = OF_node_from_xref(dts_value); if ((len = OF_getproplen(edma_node, "device-id")) <= 0) { return (ENXIO); } - OF_getprop(edma_node, "device-id", &dts_value, len); - edma_device_id = fdt32_to_cpu(dts_value); + OF_getencprop(edma_node, "device-id", &dts_value, len); + edma_device_id = dts_value; edma_sc = NULL; Modified: stable/11/sys/arm/lpc/lpc_fb.c ============================================================================== --- stable/11/sys/arm/lpc/lpc_fb.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/lpc/lpc_fb.c Wed Mar 1 18:53:05 2017 (r314503) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -280,10 +279,9 @@ lpc_fb_intr(void *arg) static int lpc_fb_fdt_read(phandle_t node, const char *name, uint32_t *ret) { - if (OF_getprop(node, name, ret, sizeof(uint32_t)) <= 0) + if (OF_getencprop(node, name, ret, sizeof(uint32_t)) <= 0) return (ENOENT); - *ret = fdt32_to_cpu(*ret); return (0); } Modified: stable/11/sys/arm/lpc/lpc_timer.c ============================================================================== --- stable/11/sys/arm/lpc/lpc_timer.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/lpc/lpc_timer.c Wed Mar 1 18:53:05 2017 (r314503) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -158,7 +157,7 @@ lpc_timer_attach(device_t dev) /* Get PERIPH_CLK encoded in parent bus 'bus-frequency' property */ node = ofw_bus_get_node(dev); - if (OF_getprop(OF_parent(node), "bus-frequency", &freq, + if (OF_getencprop(OF_parent(node), "bus-frequency", &freq, sizeof(pcell_t)) <= 0) { bus_release_resources(dev, lpc_timer_spec, sc->lt_res); bus_teardown_intr(dev, sc->lt_res[2], intrcookie); @@ -166,8 +165,6 @@ lpc_timer_attach(device_t dev) return (ENXIO); } - freq = fdt32_to_cpu(freq); - /* Set desired frequency in event timer and timecounter */ sc->lt_et.et_frequency = (uint64_t)freq; lpc_timecounter.tc_frequency = (uint64_t)freq; Modified: stable/11/sys/arm/mv/gpio.c ============================================================================== --- stable/11/sys/arm/mv/gpio.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/mv/gpio.c Wed Mar 1 18:53:05 2017 (r314503) @@ -113,7 +113,7 @@ struct gpio_ctrl_entry { gpios_phandler_t handler; }; -int mv_handle_gpios_prop(phandle_t ctrl, pcell_t *gpios, int len); +static int mv_handle_gpios_prop(phandle_t ctrl, pcell_t *gpios, int len); int gpio_get_config_from_dt(void); struct gpio_ctrl_entry gpio_controllers[] = { @@ -540,7 +540,7 @@ mv_gpio_value_set(uint32_t pin, uint8_t mv_gpio_reg_clear(reg, pin); } -int +static int mv_handle_gpios_prop(phandle_t ctrl, pcell_t *gpios, int len) { pcell_t gpio_cells, pincnt; @@ -554,10 +554,8 @@ mv_handle_gpios_prop(phandle_t ctrl, pce /* Node is not a GPIO controller. */ return (ENXIO); - if (OF_getprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) + if (OF_getencprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) return (ENXIO); - - gpio_cells = fdt32_to_cpu(gpio_cells); if (gpio_cells != 3) return (ENXIO); @@ -567,9 +565,9 @@ mv_handle_gpios_prop(phandle_t ctrl, pce if (fdt_regsize(ctrl, &gpio_ctrl, &size)) return (ENXIO); - if (OF_getprop(ctrl, "pin-count", &pincnt, sizeof(pcell_t)) < 0) + if (OF_getencprop(ctrl, "pin-count", &pincnt, sizeof(pcell_t)) < 0) return (ENXIO); - sc.pin_num = fdt32_to_cpu(pincnt); + sc.pin_num = pincnt; /* * Skip controller reference, since controller's phandle is given @@ -579,9 +577,9 @@ mv_handle_gpios_prop(phandle_t ctrl, pce gpios += inc; for (t = 0; t < tuples; t++) { - pin = fdt32_to_cpu(gpios[0]); - dir = fdt32_to_cpu(gpios[1]); - flags = fdt32_to_cpu(gpios[2]); + pin = gpios[0]; + dir = gpios[1]; + flags = gpios[2]; mv_gpio_configure(pin, flags); @@ -630,7 +628,7 @@ mv_gpio_init(void) return (ENXIO); /* Get 'gpios' property. */ - OF_getprop(child, "gpios", &gpios, len); + OF_getencprop(child, "gpios", gpios, len); e = (struct gpio_ctrl_entry *)&gpio_controllers; @@ -641,7 +639,7 @@ mv_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); + ctrl = OF_node_from_xref(gpios[0]); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: stable/11/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/11/sys/arm/mv/mv_machdep.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/mv/mv_machdep.c Wed Mar 1 18:53:05 2017 (r314503) @@ -146,21 +146,19 @@ moveon: /* * Process 'pin-count' and 'pin-map' props. */ - if (OF_getprop(node, "pin-count", &pin_count, sizeof(pin_count)) <= 0) + if (OF_getencprop(node, "pin-count", &pin_count, sizeof(pin_count)) <= 0) return (ENXIO); - pin_count = fdt32_to_cpu(pin_count); if (pin_count > MPP_PIN_MAX) return (ERANGE); - if (OF_getprop(node, "#pin-cells", &pin_cells, sizeof(pin_cells)) <= 0) + if (OF_getencprop(node, "#pin-cells", &pin_cells, sizeof(pin_cells)) <= 0) pin_cells = MPP_PIN_CELLS; - pin_cells = fdt32_to_cpu(pin_cells); if (pin_cells > MPP_PIN_CELLS) return (ERANGE); tuple_size = sizeof(pcell_t) * pin_cells; bzero(pinmap, sizeof(pinmap)); - len = OF_getprop(node, "pin-map", pinmap, sizeof(pinmap)); + len = OF_getencprop(node, "pin-map", pinmap, sizeof(pinmap)); if (len <= 0) return (ERANGE); if (len % tuple_size) @@ -175,8 +173,8 @@ moveon: bzero(mpp, sizeof(mpp)); pinmap_ptr = pinmap; for (i = 0; i < pins; i++) { - mpp_pin = fdt32_to_cpu(*pinmap_ptr); - mpp_function = fdt32_to_cpu(*(pinmap_ptr + 1)); + mpp_pin = *pinmap_ptr; + mpp_function = *(pinmap_ptr + 1); mpp[mpp_pin] = mpp_function; pinmap_ptr += pin_cells; } @@ -408,12 +406,10 @@ platform_devmap_init(void) if (fdt_is_compatible(child, "mrvl,lbc")) { /* Check available space */ - if (OF_getprop(child, "bank-count", (void *)&bank_count, + if (OF_getencprop(child, "bank-count", &bank_count, sizeof(bank_count)) <= 0) /* If no property, use default value */ bank_count = 1; - else - bank_count = fdt32_to_cpu(bank_count); if ((i + bank_count) >= FDT_DEVMAP_MAX) return (ENOMEM); Modified: stable/11/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- stable/11/sys/arm/rockchip/rk30xx_gpio.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/rockchip/rk30xx_gpio.c Wed Mar 1 18:53:05 2017 (r314503) @@ -526,10 +526,8 @@ rk30_gpios_prop_handle(phandle_t ctrl, p if (sc == NULL) return ENXIO; - if (OF_getprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) + if (OF_getencprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) return (ENXIO); - - gpio_cells = fdt32_to_cpu(gpio_cells); if (gpio_cells != 2) return (ENXIO); @@ -546,9 +544,9 @@ rk30_gpios_prop_handle(phandle_t ctrl, p inc = sizeof(ihandle_t) / sizeof(pcell_t); gpios += inc; for (t = 0; t < tuples; t++) { - pin = fdt32_to_cpu(gpios[0]); - dir = fdt32_to_cpu(gpios[1]); - flags = fdt32_to_cpu(gpios[2]); + pin = gpios[0]; + dir = gpios[1]; + flags = gpios[2]; for (i = 0; i < sc->sc_gpio_npins; i++) { if (sc->sc_gpio_pins[i].gp_pin == pin) @@ -601,7 +599,7 @@ rk30_gpio_init(void) return (ENXIO); /* Get 'gpios' property. */ - OF_getprop(child, "gpios", &gpios, len); + OF_getencprop(child, "gpios", gpios, len); e = (struct gpio_ctrl_entry *)&gpio_controllers; @@ -612,7 +610,7 @@ rk30_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); + ctrl = OF_node_from_xref(gpios[0]); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: stable/11/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_lcd.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/ti/am335x/am335x_lcd.c Wed Mar 1 18:53:05 2017 (r314503) @@ -359,13 +359,13 @@ am335x_read_property(device_t dev, phand { pcell_t cell; - if ((OF_getprop(node, name, &cell, sizeof(cell))) <= 0) { + if ((OF_getencprop(node, name, &cell, sizeof(cell))) <= 0) { device_printf(dev, "missing '%s' attribute in LCD panel info\n", name); return (ENXIO); } - *val = fdt32_to_cpu(cell); + *val = cell; return (0); } Modified: stable/11/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_lcd_syscons.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/ti/am335x/am335x_lcd_syscons.c Wed Mar 1 18:53:05 2017 (r314503) @@ -383,13 +383,13 @@ am335x_syscons_configure(int flags) root = OF_finddevice("/"); if ((root != 0) && (display = am335x_syscons_find_panel_node(root))) { - if ((OF_getprop(display, "panel_width", - &cell, sizeof(cell))) > 0) - va_sc->width = (int)fdt32_to_cpu(cell); - - if ((OF_getprop(display, "panel_height", - &cell, sizeof(cell))) > 0) - va_sc->height = (int)fdt32_to_cpu(cell); + if ((OF_getencprop(display, "panel_width", &cell, + sizeof(cell))) > 0) + va_sc->width = cell; + + if ((OF_getencprop(display, "panel_height", &cell, + sizeof(cell))) > 0) + va_sc->height = cell; } if (va_sc->width == 0) Modified: stable/11/sys/arm/ti/ti_adc.c ============================================================================== --- stable/11/sys/arm/ti/ti_adc.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/ti/ti_adc.c Wed Mar 1 18:53:05 2017 (r314503) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -767,14 +766,17 @@ ti_adc_attach(device_t dev) /* Read "tsc" node properties */ child = ofw_bus_find_child(node, "tsc"); if (child != 0 && OF_hasprop(child, "ti,wires")) { - if ((OF_getprop(child, "ti,wires", &cell, sizeof(cell))) > 0) - sc->sc_tsc_wires = fdt32_to_cpu(cell); - if ((OF_getprop(child, "ti,coordinate-readouts", &cell, sizeof(cell))) > 0) - sc->sc_coord_readouts = fdt32_to_cpu(cell); - if ((OF_getprop(child, "ti,x-plate-resistance", &cell, sizeof(cell))) > 0) - sc->sc_x_plate_resistance = fdt32_to_cpu(cell); - if ((OF_getprop(child, "ti,charge-delay", &cell, sizeof(cell))) > 0) - sc->sc_charge_delay = fdt32_to_cpu(cell); + if ((OF_getencprop(child, "ti,wires", &cell, sizeof(cell))) > 0) + sc->sc_tsc_wires = cell; + if ((OF_getencprop(child, "ti,coordinate-readouts", &cell, + sizeof(cell))) > 0) + sc->sc_coord_readouts = cell; + if ((OF_getencprop(child, "ti,x-plate-resistance", &cell, + sizeof(cell))) > 0) + sc->sc_x_plate_resistance = cell; + if ((OF_getencprop(child, "ti,charge-delay", &cell, + sizeof(cell))) > 0) + sc->sc_charge_delay = cell; nwire_configs = OF_getencprop_alloc(child, "ti,wire-config", sizeof(*wire_configs), (void **)&wire_configs); if (nwire_configs != sc->sc_tsc_wires) { Modified: stable/11/sys/arm/ti/ti_sdhci.c ============================================================================== --- stable/11/sys/arm/ti/ti_sdhci.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/ti/ti_sdhci.c Wed Mar 1 18:53:05 2017 (r314503) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -506,10 +505,10 @@ ti_sdhci_attach(device_t dev) * See if we've got a GPIO-based write detect pin. This is not the * standard documented property for this, we added it in freebsd. */ - if ((OF_getprop(node, "mmchs-wp-gpio-pin", &prop, sizeof(prop))) <= 0) + if ((OF_getencprop(node, "mmchs-wp-gpio-pin", &prop, sizeof(prop))) <= 0) sc->wp_gpio_pin = 0xffffffff; else - sc->wp_gpio_pin = fdt32_to_cpu(prop); + sc->wp_gpio_pin = prop; if (sc->wp_gpio_pin != 0xffffffff) { sc->gpio_dev = devclass_get_device(devclass_find("gpio"), 0); Modified: stable/11/sys/arm/versatile/sp804.c ============================================================================== --- stable/11/sys/arm/versatile/sp804.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/versatile/sp804.c Wed Mar 1 18:53:05 2017 (r314503) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -223,8 +222,8 @@ sp804_timer_attach(device_t dev) sc->sysclk_freq = DEFAULT_FREQUENCY; /* Get the base clock frequency */ node = ofw_bus_get_node(dev); - if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) > 0) { - sc->sysclk_freq = fdt32_to_cpu(clock); + if ((OF_getencprop(node, "clock-frequency", &clock, sizeof(clock))) > 0) { + sc->sysclk_freq = clock; } /* Setup and enable the timer */ Modified: stable/11/sys/arm/xilinx/zy7_slcr.c ============================================================================== --- stable/11/sys/arm/xilinx/zy7_slcr.c Wed Mar 1 18:37:35 2017 (r314502) +++ stable/11/sys/arm/xilinx/zy7_slcr.c Wed Mar 1 18:53:05 2017 (r314503) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -621,8 +620,8 @@ zy7_slcr_attach(device_t dev) /* Derive PLL frequencies from PS_CLK. */ node = ofw_bus_get_node(dev); - if (OF_getprop(node, "clock-frequency", &cell, sizeof(cell)) > 0) - ps_clk_frequency = fdt32_to_cpu(cell); + if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) > 0) + ps_clk_frequency = cell; else ps_clk_frequency = ZYNQ_DEFAULT_PS_CLK_FREQUENCY; From owner-svn-src-stable@freebsd.org Wed Mar 1 19:55:11 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80D32CF3980; Wed, 1 Mar 2017 19:55:11 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 1DCCD1D2; Wed, 1 Mar 2017 19:55:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21JtAsT087165; Wed, 1 Mar 2017 19:55:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21Jt5IT087115; Wed, 1 Mar 2017 19:55:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703011955.v21Jt5IT087115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 19:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314506 - in stable/11/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/arm arm/at91 arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/in... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 19:55:11 -0000 Author: ian Date: Wed Mar 1 19:55:04 2017 New Revision: 314506 URL: https://svnweb.freebsd.org/changeset/base/314506 Log: MFC r306262, r306267, r310021: (needed to avoid conflicts on later merges) Remove bus_dma_get_range and bus_dma_get_range_nb on armv6. We only need this on a few earlier arm SoCs. Restrict where we need to define fdt_fixup_table to just PowerPC and Marvell. Add the missing void to function signatures in much of the arm code. Modified: stable/11/sys/arm/allwinner/a10_common.c stable/11/sys/arm/allwinner/aw_machdep.c stable/11/sys/arm/allwinner/aw_wdog.c stable/11/sys/arm/altera/socfpga/socfpga_common.c stable/11/sys/arm/altera/socfpga/socfpga_machdep.c stable/11/sys/arm/amlogic/aml8726/aml8726_identsoc.c stable/11/sys/arm/amlogic/aml8726/aml8726_machdep.c stable/11/sys/arm/amlogic/aml8726/aml8726_wdt.c stable/11/sys/arm/annapurna/alpine/alpine_machdep.c stable/11/sys/arm/annapurna/alpine/common.c stable/11/sys/arm/arm/busdma_machdep-v6.c stable/11/sys/arm/arm/cpufunc.c stable/11/sys/arm/arm/db_trace.c stable/11/sys/arm/arm/physmem.c stable/11/sys/arm/arm/platform.c stable/11/sys/arm/arm/undefined.c stable/11/sys/arm/at91/at91_common.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_common.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_wdog.c stable/11/sys/arm/freescale/imx/imx6_anatop.c stable/11/sys/arm/freescale/imx/imx6_machdep.c stable/11/sys/arm/freescale/imx/imx6_src.c stable/11/sys/arm/freescale/imx/imx_common.c stable/11/sys/arm/freescale/imx/imx_machdep.c stable/11/sys/arm/freescale/vybrid/vf_common.c stable/11/sys/arm/freescale/vybrid/vf_machdep.c stable/11/sys/arm/include/bus_dma.h stable/11/sys/arm/lpc/lpc_gpio.c stable/11/sys/arm/lpc/lpc_intc.c stable/11/sys/arm/mv/mv_machdep.c stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c stable/11/sys/arm/nvidia/tegra_efuse.c stable/11/sys/arm/qemu/virt_common.c stable/11/sys/arm/qemu/virt_machdep.c stable/11/sys/arm/rockchip/rk30xx_common.c stable/11/sys/arm/rockchip/rk30xx_machdep.c stable/11/sys/arm/rockchip/rk30xx_wdog.c stable/11/sys/arm/samsung/exynos/exynos5_common.c stable/11/sys/arm/samsung/exynos/exynos5_machdep.c stable/11/sys/arm/ti/am335x/am335x_dmtpps.c stable/11/sys/arm/ti/ti_common.c stable/11/sys/arm/ti/ti_machdep.c stable/11/sys/arm/versatile/versatile_common.c stable/11/sys/arm/versatile/versatile_machdep.c stable/11/sys/arm/xilinx/zy7_machdep.c stable/11/sys/arm/xilinx/zy7_slcr.c stable/11/sys/arm/xscale/pxa/pxa_gpio.c stable/11/sys/arm/xscale/pxa/pxa_icu.c stable/11/sys/arm/xscale/pxa/pxa_space.c stable/11/sys/arm/xscale/pxa/pxa_timer.c stable/11/sys/dev/ofw/ofw_fdt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/a10_common.c ============================================================================== --- stable/11/sys/arm/allwinner/a10_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/allwinner/a10_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -38,10 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int Modified: stable/11/sys/arm/allwinner/aw_machdep.c ============================================================================== --- stable/11/sys/arm/allwinner/aw_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/allwinner/aw_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -36,7 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -147,18 +146,6 @@ allwinner_devmap_init(platform_t plat) return (0); } -struct arm32_dma_range * -bus_dma_get_range(void) -{ - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - return (0); -} - void cpu_reset() { Modified: stable/11/sys/arm/allwinner/aw_wdog.c ============================================================================== --- stable/11/sys/arm/allwinner/aw_wdog.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/allwinner/aw_wdog.c Wed Mar 1 19:55:04 2017 (r314506) @@ -238,7 +238,7 @@ aw_wdog_shutdown_fn(void *private, int h } void -aw_wdog_watchdog_reset() +aw_wdog_watchdog_reset(void) { if (aw_wdog_sc == NULL) { Modified: stable/11/sys/arm/altera/socfpga/socfpga_common.c ============================================================================== --- stable/11/sys/arm/altera/socfpga/socfpga_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/altera/socfpga/socfpga_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -68,10 +68,6 @@ end: while (1); } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/altera/socfpga/socfpga_machdep.c ============================================================================== --- stable/11/sys/arm/altera/socfpga/socfpga_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/altera/socfpga/socfpga_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -100,17 +99,3 @@ platform_devmap_init(void) return (0); } - -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} Modified: stable/11/sys/arm/amlogic/aml8726/aml8726_identsoc.c ============================================================================== --- stable/11/sys/arm/amlogic/aml8726/aml8726_identsoc.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/amlogic/aml8726/aml8726_identsoc.c Wed Mar 1 19:55:04 2017 (r314506) @@ -87,7 +87,7 @@ static const struct { }; void -aml8726_identify_soc() +aml8726_identify_soc(void) { int err; struct resource res; Modified: stable/11/sys/arm/amlogic/aml8726/aml8726_machdep.c ============================================================================== --- stable/11/sys/arm/amlogic/aml8726/aml8726_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/amlogic/aml8726/aml8726_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -57,7 +56,7 @@ vm_offset_t aml8726_aobus_kva_base; #endif static void -aml8726_fixup_busfreq() +aml8726_fixup_busfreq(void) { phandle_t node; pcell_t freq, prop; @@ -165,24 +164,6 @@ platform_devmap_init(void) return (0); } -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG #ifndef DEV_GIC static int Modified: stable/11/sys/arm/amlogic/aml8726/aml8726_wdt.c ============================================================================== --- stable/11/sys/arm/amlogic/aml8726/aml8726_wdt.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/amlogic/aml8726/aml8726_wdt.c Wed Mar 1 19:55:04 2017 (r314506) @@ -290,7 +290,7 @@ EARLY_DRIVER_MODULE(wdt, simplebus, aml8 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); void -cpu_reset() +cpu_reset(void) { /* Watchdog has not yet been initialized */ Modified: stable/11/sys/arm/annapurna/alpine/alpine_machdep.c ============================================================================== --- stable/11/sys/arm/annapurna/alpine/alpine_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/annapurna/alpine/alpine_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -29,7 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -131,17 +130,3 @@ platform_devmap_init(void) devmap_add_entry(al_devmap_pa, al_devmap_size); return (0); } - -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} Modified: stable/11/sys/arm/annapurna/alpine/common.c ============================================================================== --- stable/11/sys/arm/annapurna/alpine/common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/annapurna/alpine/common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -56,9 +56,6 @@ __FBSDID("$FreeBSD$"); #define LOCK 0x00000001 extern bus_addr_t al_devmap_pa; -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; static int alpine_get_wdt_base(uint32_t *pbase, uint32_t *psize); static int alpine_pic_decode_fdt(uint32_t iparent, uint32_t *intr, Modified: stable/11/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/11/sys/arm/arm/busdma_machdep-v6.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/arm/busdma_machdep-v6.c Wed Mar 1 19:55:04 2017 (r314506) @@ -33,7 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -90,14 +89,6 @@ struct bus_dma_tag { bus_dma_lock_t *lockfunc; void *lockfuncarg; struct bounce_zone *bounce_zone; - /* - * DMA range for this tag. If the page doesn't fall within - * one of these ranges, an error is returned. The caller - * may then decide what to do with the transfer. If the - * range pointer is NULL, it is ignored. - */ - struct arm32_dma_range *ranges; - int _nranges; }; struct bounce_page { @@ -402,22 +393,6 @@ must_bounce(bus_dma_tag_t dmat, bus_dmam return (0); } -static __inline struct arm32_dma_range * -_bus_dma_inrange(struct arm32_dma_range *ranges, int nranges, - bus_addr_t curaddr) -{ - struct arm32_dma_range *dr; - int i; - - for (i = 0, dr = ranges; i < nranges; i++, dr++) { - if (curaddr >= dr->dr_sysbase && - round_page(curaddr) <= (dr->dr_sysbase + dr->dr_len)) - return (dr); - } - - return (NULL); -} - /* * Convenience function for manipulating driver locks from busdma (during * busdma_swi, for example). Drivers that don't provide their own locks @@ -502,8 +477,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->flags = flags; newtag->ref_count = 1; /* Count ourself */ newtag->map_count = 0; - newtag->ranges = bus_dma_get_range(); - newtag->_nranges = bus_dma_get_range_nb(); if (lockfunc != NULL) { newtag->lockfunc = lockfunc; newtag->lockfuncarg = lockfuncarg; @@ -987,22 +960,6 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b sgsize = (baddr - curaddr); } - if (dmat->ranges) { - struct arm32_dma_range *dr; - - dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, - curaddr); - if (dr == NULL) { - _bus_dmamap_unload(dmat, map); - return (0); - } - /* - * In a valid DMA range. Translate the physical - * memory address to an address in the DMA window. - */ - curaddr = (curaddr - dr->dr_sysbase) + dr->dr_busbase; - } - /* * Insert chunk into a segment, coalescing with * previous segment if possible. Modified: stable/11/sys/arm/arm/cpufunc.c ============================================================================== --- stable/11/sys/arm/arm/cpufunc.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/arm/cpufunc.c Wed Mar 1 19:55:04 2017 (r314506) @@ -585,7 +585,7 @@ static int arm_dcache_l2_assoc; static int arm_dcache_l2_linesize; static void -get_cachetype_cp15() +get_cachetype_cp15(void) { u_int ctype, isize, dsize, cpuid; u_int clevel, csize, i, sel; @@ -700,7 +700,7 @@ get_cachetype_cp15() */ int -set_cpufuncs() +set_cpufuncs(void) { cputype = cpu_ident(); cputype &= CPU_ID_CPU_MASK; Modified: stable/11/sys/arm/arm/db_trace.c ============================================================================== --- stable/11/sys/arm/arm/db_trace.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/arm/db_trace.c Wed Mar 1 19:55:04 2017 (r314506) @@ -130,7 +130,7 @@ db_stack_trace_cmd(struct unwind_state * } void -db_md_list_watchpoints() +db_md_list_watchpoints(void) { dbg_show_watchpoint(); Modified: stable/11/sys/arm/arm/physmem.c ============================================================================== --- stable/11/sys/arm/arm/physmem.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/arm/physmem.c Wed Mar 1 19:55:04 2017 (r314506) @@ -145,7 +145,7 @@ physmem_dump_tables(int (*prfunc)(const * Print the contents of the static mapping table. Used for bootverbose. */ void -arm_physmem_print_tables() +arm_physmem_print_tables(void) { physmem_dump_tables(printf); Modified: stable/11/sys/arm/arm/platform.c ============================================================================== --- stable/11/sys/arm/arm/platform.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/arm/platform.c Wed Mar 1 19:55:04 2017 (r314506) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); * through a previously registered kernel object. */ -#define _ARM32_BUS_DMA_PRIVATE #include #include #include Modified: stable/11/sys/arm/arm/undefined.c ============================================================================== --- stable/11/sys/arm/arm/undefined.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/arm/undefined.c Wed Mar 1 19:55:04 2017 (r314506) @@ -165,7 +165,7 @@ gdb_trapper(u_int addr, u_int insn, stru static struct undefined_handler gdb_uh; void -undefined_init() +undefined_init(void) { int loop; Modified: stable/11/sys/arm/at91/at91_common.c ============================================================================== --- stable/11/sys/arm/at91/at91_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/at91/at91_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -49,10 +49,6 @@ __FBSDID("$FreeBSD$"); extern const struct devmap_entry at91_devmap[]; -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_aic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_common.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -46,10 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -42,7 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -115,19 +114,7 @@ bcm2836_devmap_init(platform_t plat) } #endif -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} -int -bus_dma_get_range_nb(void) -{ - - return (0); -} void cpu_reset() Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Wed Mar 1 19:55:04 2017 (r314506) @@ -191,7 +191,7 @@ bcmwd_watchdog_fn(void *private, u_int c } void -bcmwd_watchdog_reset() +bcmwd_watchdog_reset(void) { if (bcmwd_lsc == NULL) Modified: stable/11/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx6_anatop.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/freescale/imx/imx6_anatop.c Wed Mar 1 19:55:04 2017 (r314506) @@ -776,7 +776,7 @@ imx6_anatop_probe(device_t dev) } uint32_t -imx6_get_cpu_clock() +imx6_get_cpu_clock(void) { uint32_t corediv, plldiv; Modified: stable/11/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx6_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/freescale/imx/imx6_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -52,10 +52,6 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - static uint32_t gpio1_node; #ifndef INTRNG Modified: stable/11/sys/arm/freescale/imx/imx6_src.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx6_src.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/freescale/imx/imx6_src.c Wed Mar 1 19:55:04 2017 (r314506) @@ -70,7 +70,7 @@ WR4(struct src_softc *sc, bus_size_t off } int -src_reset_ipu() +src_reset_ipu(void) { uint32_t reg; int timeout = 10000; Modified: stable/11/sys/arm/freescale/imx/imx_common.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/freescale/imx/imx_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -50,10 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/freescale/imx/imx_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -29,7 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -54,20 +53,6 @@ SYSCTL_UINT(_hw_imx, OID_AUTO, last_rese SYSCTL_STRING(_hw_imx, OID_AUTO, last_reset_reason, CTLFLAG_RD, "unknown", 0, "Last reset reason"); -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - /* * This code which manipulates the watchdog hardware is here to implement * cpu_reset() because the watchdog is the only way for software to reset the Modified: stable/11/sys/arm/freescale/vybrid/vf_common.c ============================================================================== --- stable/11/sys/arm/freescale/vybrid/vf_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/freescale/vybrid/vf_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -60,10 +60,6 @@ end: while (1); } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/freescale/vybrid/vf_machdep.c ============================================================================== --- stable/11/sys/arm/freescale/vybrid/vf_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/freescale/vybrid/vf_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -30,7 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -78,17 +77,3 @@ platform_devmap_init(void) return (0); } - -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} Modified: stable/11/sys/arm/include/bus_dma.h ============================================================================== --- stable/11/sys/arm/include/bus_dma.h Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/include/bus_dma.h Wed Mar 1 19:55:04 2017 (r314506) @@ -72,7 +72,7 @@ #define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) -#ifdef _ARM32_BUS_DMA_PRIVATE +#if defined(_ARM32_BUS_DMA_PRIVATE) && __ARM_ARCH < 6 /* * arm32_dma_range * Modified: stable/11/sys/arm/lpc/lpc_gpio.c ============================================================================== --- stable/11/sys/arm/lpc/lpc_gpio.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/lpc/lpc_gpio.c Wed Mar 1 19:55:04 2017 (r314506) @@ -518,7 +518,7 @@ lpc_gpio_get_state(device_t dev, int pin } void -lpc_gpio_init() +lpc_gpio_init(void) { bus_space_tag_t bst; bus_space_handle_t bsh; Modified: stable/11/sys/arm/lpc/lpc_intc.c ============================================================================== --- stable/11/sys/arm/lpc/lpc_intc.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/lpc/lpc_intc.c Wed Mar 1 19:55:04 2017 (r314506) @@ -227,10 +227,6 @@ lpc_intc_eoi(void *data) } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/11/sys/arm/mv/mv_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/mv/mv_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -428,6 +428,7 @@ platform_devmap_init(void) return (0); } +#if __ARM_ARCH < 6 struct arm32_dma_range * bus_dma_get_range(void) { @@ -441,6 +442,7 @@ bus_dma_get_range_nb(void) return (0); } +#endif #if defined(CPU_MV_PJ4B) #ifdef DDB Modified: stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ -#define _ARM32_BUS_DMA_PRIVATE #include "opt_platform.h" #include @@ -62,24 +61,6 @@ __FBSDID("$FreeBSD$"); PMC_SCRATCH0_MODE_BOOTLOADER | \ PMC_SCRATCH0_MODE_RCM) -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - static vm_offset_t tegra124_lastaddr(platform_t plat) { Modified: stable/11/sys/arm/nvidia/tegra_efuse.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra_efuse.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/nvidia/tegra_efuse.c Wed Mar 1 19:55:04 2017 (r314506) @@ -237,7 +237,7 @@ tegra_fuse_read_4(int addr) { static void -tegra_efuse_dump_sku() +tegra_efuse_dump_sku(void) { printf(" TEGRA SKU Info:\n"); printf(" chip_id: %u\n", tegra_sku_info.chip_id); Modified: stable/11/sys/arm/qemu/virt_common.c ============================================================================== --- stable/11/sys/arm/qemu/virt_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/qemu/virt_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -37,10 +37,6 @@ __FBSDID("$FreeBSD$"); #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG fdt_pic_decode_t fdt_pic_table[] = { &gic_decode_fdt, Modified: stable/11/sys/arm/qemu/virt_machdep.c ============================================================================== --- stable/11/sys/arm/qemu/virt_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/qemu/virt_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -30,7 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -45,20 +44,6 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - void cpu_reset(void) { Modified: stable/11/sys/arm/rockchip/rk30xx_common.c ============================================================================== --- stable/11/sys/arm/rockchip/rk30xx_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/rockchip/rk30xx_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -38,10 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/11/sys/arm/rockchip/rk30xx_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/rockchip/rk30xx_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -92,20 +91,6 @@ platform_devmap_init(void) return (0); } -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - void cpu_reset() { Modified: stable/11/sys/arm/rockchip/rk30xx_wdog.c ============================================================================== --- stable/11/sys/arm/rockchip/rk30xx_wdog.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/rockchip/rk30xx_wdog.c Wed Mar 1 19:55:04 2017 (r314506) @@ -171,7 +171,7 @@ rk30_wd_watchdog_fn(void *private, u_int } void -rk30_wd_watchdog_reset() +rk30_wd_watchdog_reset(void) { bus_space_handle_t bsh; Modified: stable/11/sys/arm/samsung/exynos/exynos5_common.c ============================================================================== --- stable/11/sys/arm/samsung/exynos/exynos5_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/samsung/exynos/exynos5_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -49,10 +49,6 @@ cpu_reset(void) while (1); } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- stable/11/sys/arm/samsung/exynos/exynos5_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/samsung/exynos/exynos5_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -30,7 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -83,17 +82,3 @@ platform_devmap_init(void) return (0); } - -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} Modified: stable/11/sys/arm/ti/am335x/am335x_dmtpps.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_dmtpps.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/ti/am335x/am335x_dmtpps.c Wed Mar 1 19:55:04 2017 (r314506) @@ -163,7 +163,7 @@ dmtpps_translate_nickname(const char *ni * fails that IS an error, return -1. */ static int -dmtpps_find_tmr_num_by_tunable() +dmtpps_find_tmr_num_by_tunable(void) { struct padinfo *pi; char iname[20]; @@ -201,7 +201,7 @@ dmtpps_find_tmr_num_by_tunable() * input pin. If so, return the timer number, if not return 0. */ static int -dmtpps_find_tmr_num_by_padconf() +dmtpps_find_tmr_num_by_padconf(void) { int err; unsigned int padstate; @@ -225,7 +225,7 @@ dmtpps_find_tmr_num_by_padconf() * configuration. This is done just once, the first time probe() runs. */ static int -dmtpps_find_tmr_num() +dmtpps_find_tmr_num(void) { int tmr_num; Modified: stable/11/sys/arm/ti/ti_common.c ============================================================================== --- stable/11/sys/arm/ti/ti_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/ti/ti_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -49,10 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG #ifdef SOC_TI_AM335X static int Modified: stable/11/sys/arm/ti/ti_machdep.c ============================================================================== --- stable/11/sys/arm/ti/ti_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/ti/ti_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -40,7 +40,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -96,20 +95,6 @@ ti_am335x_devmap_init(platform_t plat) } #endif -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - void cpu_reset() { Modified: stable/11/sys/arm/versatile/versatile_common.c ============================================================================== --- stable/11/sys/arm/versatile/versatile_common.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/versatile/versatile_common.c Wed Mar 1 19:55:04 2017 (r314506) @@ -46,10 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, Modified: stable/11/sys/arm/versatile/versatile_machdep.c ============================================================================== --- stable/11/sys/arm/versatile/versatile_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/versatile/versatile_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -39,7 +39,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -102,22 +101,8 @@ platform_devmap_init(void) return (0); } -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - void -cpu_reset() +cpu_reset(void) { printf("cpu_reset\n"); while (1); Modified: stable/11/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- stable/11/sys/arm/xilinx/zy7_machdep.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/xilinx/zy7_machdep.c Wed Mar 1 19:55:04 2017 (r314506) @@ -36,7 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include @@ -94,10 +93,6 @@ platform_devmap_init(void) } -struct fdt_fixup_entry fdt_fixup_table[] = { - { NULL, NULL } -}; - #ifndef INTRNG static int fdt_gic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, @@ -120,22 +115,8 @@ fdt_pic_decode_t fdt_pic_table[] = { }; #endif -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - - return (0); -} - void -cpu_reset() +cpu_reset(void) { if (zynq7_cpu_reset != NULL) (*zynq7_cpu_reset)(); Modified: stable/11/sys/arm/xilinx/zy7_slcr.c ============================================================================== --- stable/11/sys/arm/xilinx/zy7_slcr.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/xilinx/zy7_slcr.c Wed Mar 1 19:55:04 2017 (r314506) @@ -496,7 +496,7 @@ zy7_pl_fclk_enabled(int unit) } int -zy7_pl_level_shifters_enabled() +zy7_pl_level_shifters_enabled(void) { struct zy7_slcr_softc *sc = zy7_slcr_softc_p; @@ -513,7 +513,7 @@ zy7_pl_level_shifters_enabled() } void -zy7_pl_level_shifters_enable() +zy7_pl_level_shifters_enable(void) { struct zy7_slcr_softc *sc = zy7_slcr_softc_p; @@ -528,7 +528,7 @@ zy7_pl_level_shifters_enable() } void -zy7_pl_level_shifters_disable() +zy7_pl_level_shifters_disable(void) { struct zy7_slcr_softc *sc = zy7_slcr_softc_p; Modified: stable/11/sys/arm/xscale/pxa/pxa_gpio.c ============================================================================== --- stable/11/sys/arm/xscale/pxa/pxa_gpio.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/xscale/pxa/pxa_gpio.c Wed Mar 1 19:55:04 2017 (r314506) @@ -331,7 +331,7 @@ pxa_gpio_unmask_irq(int irq) } int -pxa_gpio_get_next_irq() +pxa_gpio_get_next_irq(void) { struct pxa_gpio_softc *sc; int gpio; Modified: stable/11/sys/arm/xscale/pxa/pxa_icu.c ============================================================================== --- stable/11/sys/arm/xscale/pxa/pxa_icu.c Wed Mar 1 19:36:32 2017 (r314505) +++ stable/11/sys/arm/xscale/pxa/pxa_icu.c Wed Mar 1 19:55:04 2017 (r314506) @@ -171,7 +171,7 @@ arm_unmask_irq(uintptr_t nb) } uint32_t -pxa_icu_get_icip() +pxa_icu_get_icip(void) { return (bus_space_read_4(pxa_icu_softc->pi_bst, @@ -187,7 +187,7 @@ pxa_icu_clear_icip(int irq) } uint32_t -pxa_icu_get_icfp() +pxa_icu_get_icfp(void) { return (bus_space_read_4(pxa_icu_softc->pi_bst, @@ -203,7 +203,7 @@ pxa_icu_clear_icfp(int irq) } uint32_t -pxa_icu_get_icmr() +pxa_icu_get_icmr(void) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Mar 1 20:22:27 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45FBBCF34BB; Wed, 1 Mar 2017 20:22:27 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 16BCF954; Wed, 1 Mar 2017 20:22:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21KMQVf098270; Wed, 1 Mar 2017 20:22:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21KMPJv098266; Wed, 1 Mar 2017 20:22:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012022.v21KMPJv098266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 20:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314508 - in stable/11/sys: arm/ti conf dev/sdhci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 20:22:27 -0000 Author: ian Date: Wed Mar 1 20:22:25 2017 New Revision: 314508 URL: https://svnweb.freebsd.org/changeset/base/314508 Log: MFC r311734, r311735, r311951, r314071: Add new helper routines for sdhci bridge drivers that use gpio pins for card presence and write protect switch detection. Use the new sdhci_fdt_gpio helper functions to add full support for FDT gpio pins for detecting card insert/remove and write protect for ti_sdhci. Include sys/systm.h for use of bootverbose. Revert to ti_sdhci driver's historic behavior: assume an sd card is writable if the fdt data doesn't provide a gpio pin for reading the write protect switch and also doesn't contain a "wp-disable" property. Added: stable/11/sys/dev/sdhci/sdhci_fdt_gpio.c - copied, changed from r311734, head/sys/dev/sdhci/sdhci_fdt_gpio.c stable/11/sys/dev/sdhci/sdhci_fdt_gpio.h - copied unchanged from r311734, head/sys/dev/sdhci/sdhci_fdt_gpio.h Modified: stable/11/sys/arm/ti/ti_sdhci.c stable/11/sys/conf/files Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/ti_sdhci.c ============================================================================== --- stable/11/sys/arm/ti/ti_sdhci.c Wed Mar 1 20:00:19 2017 (r314507) +++ stable/11/sys/arm/ti/ti_sdhci.c Wed Mar 1 20:22:25 2017 (r314508) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "sdhci_if.h" #include @@ -61,7 +62,7 @@ __FBSDID("$FreeBSD$"); struct ti_sdhci_softc { device_t dev; - device_t gpio_dev; + struct sdhci_fdt_gpio * gpio; struct resource * mem_res; struct resource * irq_res; void * intr_cookie; @@ -75,6 +76,7 @@ struct ti_sdhci_softc { uint32_t sdhci_clkdiv; boolean_t disable_highspeed; boolean_t force_card_present; + boolean_t disable_readonly; }; /* @@ -362,20 +364,27 @@ static int ti_sdhci_get_ro(device_t brdev, device_t reqdev) { struct ti_sdhci_softc *sc = device_get_softc(brdev); - unsigned int readonly = 0; - /* If a gpio pin is configured, read it. */ - if (sc->gpio_dev != NULL) { - GPIO_PIN_GET(sc->gpio_dev, sc->wp_gpio_pin, &readonly); - } + if (sc->disable_readonly) + return (0); - return (readonly); + return (sdhci_fdt_gpio_get_readonly(sc->gpio)); +} + +static bool +ti_sdhci_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); } static int ti_sdhci_detach(device_t dev) { + /* sdhci_fdt_gpio_teardown(sc->gpio); */ + return (EBUSY); } @@ -502,25 +511,6 @@ ti_sdhci_attach(device_t dev) } /* - * See if we've got a GPIO-based write detect pin. This is not the - * standard documented property for this, we added it in freebsd. - */ - if ((OF_getencprop(node, "mmchs-wp-gpio-pin", &prop, sizeof(prop))) <= 0) - sc->wp_gpio_pin = 0xffffffff; - else - sc->wp_gpio_pin = prop; - - if (sc->wp_gpio_pin != 0xffffffff) { - sc->gpio_dev = devclass_get_device(devclass_find("gpio"), 0); - if (sc->gpio_dev == NULL) - device_printf(dev, "Error: No GPIO device, " - "Write Protect pin will not function\n"); - else - GPIO_PIN_SETFLAGS(sc->gpio_dev, sc->wp_gpio_pin, - GPIO_PIN_INPUT); - } - - /* * Set the offset from the device's memory start to the MMCHS registers. * Also for OMAP4 disable high speed mode due to erratum ID i626. */ @@ -572,6 +562,21 @@ ti_sdhci_attach(device_t dev) goto fail; } + /* + * Set up handling of card-detect and write-protect gpio lines. + * + * If there is no write protect info in the fdt data, fall back to the + * historical practice of assuming that the card is writable. This + * works around bad fdt data from the upstream source. The alternative + * would be to trust the sdhci controller's PRESENT_STATE register WP + * bit, but it may say write protect is in effect when it's not if the + * pinmux setup doesn't route the WP signal into the sdchi block. + */ + sc->gpio = sdhci_fdt_gpio_setup(sc->dev, &sc->slot); + + if (!OF_hasprop(node, "wp-gpios") && !OF_hasprop(node, "wp-disable")) + sc->disable_readonly = true; + /* Initialise the MMCHS hardware. */ ti_sdhci_hw_init(dev); @@ -706,6 +711,7 @@ static device_method_t ti_sdhci_methods[ DEVMETHOD(sdhci_write_2, ti_sdhci_write_2), DEVMETHOD(sdhci_write_4, ti_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, ti_sdhci_write_multi_4), + DEVMETHOD(sdhci_get_card_present, ti_sdhci_get_card_present), DEVMETHOD_END }; Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Mar 1 20:00:19 2017 (r314507) +++ stable/11/sys/conf/files Wed Mar 1 20:22:25 2017 (r314508) @@ -2556,6 +2556,7 @@ dev/scc/scc_dev_z8530.c optional scc dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa dev/sdhci/sdhci.c optional sdhci +dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci Copied and modified: stable/11/sys/dev/sdhci/sdhci_fdt_gpio.c (from r311734, head/sys/dev/sdhci/sdhci_fdt_gpio.c) ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt_gpio.c Mon Jan 9 01:54:36 2017 (r311734, copy source) +++ stable/11/sys/dev/sdhci/sdhci_fdt_gpio.c Wed Mar 1 20:22:25 2017 (r314508) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Copied: stable/11/sys/dev/sdhci/sdhci_fdt_gpio.h (from r311734, head/sys/dev/sdhci/sdhci_fdt_gpio.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/sdhci/sdhci_fdt_gpio.h Wed Mar 1 20:22:25 2017 (r314508, copy of r311734, head/sys/dev/sdhci/sdhci_fdt_gpio.h) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2017 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Support routines usable by any SoC sdhci bridge driver that uses gpio pins + * for card detect and/or write protect, and uses FDT data to describe those + * pins. A bridge driver need only supply a couple 2-line forwarding functions + * to connect the get_present and get_readonly accessors to the corresponding + * driver interface functions, and add setup/teardown calls to its attach and + * detach functions. + */ + +#ifndef _SDHCI_FDT_GPIO_H_ +#define _SDHCI_FDT_GPIO_H_ + +struct sdhci_slot; +struct sdhci_fdt_gpio; + +/* + * sdhci_fdt_gpio_setup() + * sdhci_fdt_gpio_teardown() + * + * Process FDT properties that use gpio pins and set up interrupt handling (if + * supported by hardware) and accessor functions to read the pins. + * + * Setup cannot fail. If the properties are not present, the accessors will + * return the values from standard sdhci registers. If the gpio controller + * can't trigger interrupts on both edges, it configures the slot to use polling + * for card presence detection. If it can't access the gpio pin at all it sets + * up the get_present() accessor to always return true. Likewise the + * get_readonly() accessor always returns false if its pin can't be accessed. + */ +struct sdhci_fdt_gpio *sdhci_fdt_gpio_setup(device_t dev, struct sdhci_slot *slot); +void sdhci_fdt_gpio_teardown(struct sdhci_fdt_gpio *gpio); + +/* + * sdhci_fdt_gpio_get_present() + * sdhci_fdt_gpio_get_readonly() + * + * Gpio pin state accessor functions. + */ +bool sdhci_fdt_gpio_get_present(struct sdhci_fdt_gpio *gpio); +int sdhci_fdt_gpio_get_readonly(struct sdhci_fdt_gpio *gpio); + +#endif From owner-svn-src-stable@freebsd.org Wed Mar 1 21:02:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F510CF33BC; Wed, 1 Mar 2017 21:02:28 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id C3A547E5; Wed, 1 Mar 2017 21:02:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21L2QPH015097; Wed, 1 Mar 2017 21:02:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21L2Q8F015094; Wed, 1 Mar 2017 21:02:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012102.v21L2Q8F015094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314510 - in stable/11/sys: arm/freescale/imx conf dev/sdhci powerpc/mpc85xx X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:02:28 -0000 Author: ian Date: Wed Mar 1 21:02:26 2017 New Revision: 314510 URL: https://svnweb.freebsd.org/changeset/base/314510 Log: MFC r308186, r308188, r308231, r308232: Move imx_sdhci driver over to a dev/sdhci in preparation for QorIQ support. Freescale uses eSDHC in both i.MX (ARM) and QorIQ (PowerPC), with slight differences. This is part one in unifying the drivers. Merge i.MX and PowerPC SDHCI drivers Summary: i.MX5 and PowerPC use a very similar eSDHC controller, which is also similar to the uSDHC controller used by i.MX6. The imx_sdhci driver works almost completely with PowerPC, with some minor tweaks. Fix the build. protctl is only used on powerpc. While here, remove the need to check the SVR SPR, as others may be compatible with the p1022-esdhc type. Since it's no longer accessing a powerpc-specific register, drop the #ifdef. Added: stable/11/sys/dev/sdhci/fsl_sdhci.c - copied, changed from r308186, head/sys/dev/sdhci/fsl_sdhci.c Deleted: stable/11/sys/arm/freescale/imx/imx_sdhci.c stable/11/sys/powerpc/mpc85xx/fsl_sdhc.c stable/11/sys/powerpc/mpc85xx/fsl_sdhc.h Modified: stable/11/sys/arm/freescale/imx/files.imx5 stable/11/sys/arm/freescale/imx/files.imx6 stable/11/sys/conf/files.powerpc Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/freescale/imx/files.imx5 ============================================================================== --- stable/11/sys/arm/freescale/imx/files.imx5 Wed Mar 1 20:23:21 2017 (r314509) +++ stable/11/sys/arm/freescale/imx/files.imx5 Wed Mar 1 21:02:26 2017 (r314510) @@ -32,7 +32,7 @@ arm/freescale/imx/imx51_ccm.c standard dev/ata/chipsets/ata-fsl.c optional imxata # SDHCI/MMC -arm/freescale/imx/imx_sdhci.c optional sdhci +dev/sdhci/fsl_sdhci.c optional sdhci # USB OH3 controller (1 OTG, 3 EHCI) arm/freescale/imx/imx_nop_usbphy.c optional ehci Modified: stable/11/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/11/sys/arm/freescale/imx/files.imx6 Wed Mar 1 20:23:21 2017 (r314509) +++ stable/11/sys/arm/freescale/imx/files.imx6 Wed Mar 1 21:02:26 2017 (r314510) @@ -32,7 +32,7 @@ arm/freescale/imx/imx6_ipu.c optional v # # Optional devices. # -arm/freescale/imx/imx_sdhci.c optional sdhci +dev/sdhci/fsl_sdhci.c optional sdhci arm/freescale/imx/imx_wdog.c optional imxwdt Modified: stable/11/sys/conf/files.powerpc ============================================================================== --- stable/11/sys/conf/files.powerpc Wed Mar 1 20:23:21 2017 (r314509) +++ stable/11/sys/conf/files.powerpc Wed Mar 1 21:02:26 2017 (r314510) @@ -63,6 +63,7 @@ dev/ofw/ofw_subr.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx dev/scc/scc_bfe_macio.c optional scc powermac +dev/sdhci/fsl_sdhci.c optional mpc85xx sdhci dev/sec/sec.c optional sec mpc85xx dev/sound/macio/aoa.c optional snd_davbus | snd_ai2s powermac dev/sound/macio/davbus.c optional snd_davbus powermac @@ -135,7 +136,6 @@ powerpc/mikrotik/platform_rb.c optional powerpc/mpc85xx/atpic.c optional mpc85xx isa powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 -powerpc/mpc85xx/fsl_sdhc.c optional mpc85xx sdhc | qoriq_dpaa sdhc powerpc/mpc85xx/i2c.c optional iicbus fdt powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx | qoriq_dpaa Copied and modified: stable/11/sys/dev/sdhci/fsl_sdhci.c (from r308186, head/sys/dev/sdhci/fsl_sdhci.c) ============================================================================== --- head/sys/dev/sdhci/fsl_sdhci.c Wed Nov 2 00:51:09 2016 (r308186, copy source) +++ stable/11/sys/dev/sdhci/fsl_sdhci.c Wed Mar 1 21:02:26 2017 (r314510) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); /* - * SDHCI driver glue for Freescale i.MX SoC family. + * SDHCI driver glue for Freescale i.MX SoC and QorIQ families. * * This supports both eSDHC (earlier SoCs) and uSDHC (more recent SoCs). */ @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,9 +53,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __arm__ #include #include +#endif #include #include @@ -146,7 +149,6 @@ struct fsl_sdhci_softc { #define SDHC_PROT_CDSS (1 << 7) #define SDHC_SYS_CTRL 0x2c -#define SDHC_INT_STATUS 0x30 /* * The clock enable bits exist in different registers for ESDHC vs USDHC, but @@ -169,6 +171,7 @@ static struct ofw_compat_data compat_dat {"fsl,imx6sl-usdhc", HWTYPE_USDHC}, {"fsl,imx53-esdhc", HWTYPE_ESDHC}, {"fsl,imx51-esdhc", HWTYPE_ESDHC}, + {"fsl,esdhc", HWTYPE_ESDHC}, {NULL, HWTYPE_NONE}, }; @@ -397,6 +400,11 @@ fsl_sdhci_write_1(device_t dev, struct s if (off == SDHCI_POWER_CONTROL) { return; } +#ifdef __powerpc__ + /* XXX Reset doesn't seem to work as expected. Do nothing for now. */ + if (off == SDHCI_SOFTWARE_RESET) + return; +#endif val32 = RD4(sc, off & ~3); val32 &= ~(0xff << (off & 3) * 8); @@ -531,17 +539,20 @@ fsl_sdhc_get_clock(struct fsl_sdhci_soft val |= SDHCI_CLOCK_INT_STABLE; /* - * On ESDHC hardware the card bus clock enable is in the usual sdhci - * register but it's a different bit, so transcribe it (note the + * On i.MX ESDHC hardware the card bus clock enable is in the usual + * sdhci register but it's a different bit, so transcribe it (note the * difference between standard SDHCI_ and Freescale SDHC_ prefixes - * here). On USDHC hardware there is a force-on bit, but no force-off - * for the card bus clock (the hardware runs the clock when transfers - * are active no matter what), so we always say the clock is on. + * here). On USDHC and QorIQ ESDHC hardware there is a force-on bit, but + * no force-off for the card bus clock (the hardware runs the clock when + * transfers are active no matter what), so we always say the clock is + * on. * XXX Maybe we should say it's in whatever state the sdhci driver last * set it to. */ if (sc->hwtype == HWTYPE_ESDHC) { +#ifdef __arm__ if (RD4(sc, SDHC_SYS_CTRL) & SDHC_CLK_SDCLKEN) +#endif val |= SDHCI_CLOCK_CARD_EN; } else { val |= SDHCI_CLOCK_CARD_EN; @@ -565,15 +576,18 @@ fsl_sdhc_set_clock(struct fsl_sdhci_soft sc->sdclockreg_freq_bits = val & SDHCI_DIVIDERS_MASK; if (sc->hwtype == HWTYPE_ESDHC) { /* - * The ESDHC hardware requires the driver to manually start and - * stop the sd bus clock. If the enable bit is not set, turn - * off the clock in hardware and we're done, otherwise decode - * the requested frequency. ESDHC hardware is sdhci 2.0; the - * sdhci driver will use the original 8-bit divisor field and - * the "base / 2^N" divisor scheme. + * The i.MX5 ESDHC hardware requires the driver to manually + * start and stop the sd bus clock. If the enable bit is not + * set, turn off the clock in hardware and we're done, otherwise + * decode the requested frequency. ESDHC hardware is sdhci 2.0; + * the sdhci driver will use the original 8-bit divisor field + * and the "base / 2^N" divisor scheme. */ if ((val & SDHCI_CLOCK_CARD_EN) == 0) { +#ifdef __arm__ + /* On QorIQ, this is a reserved bit. */ WR4(sc, SDHCI_CLOCK_CONTROL, val32 & ~SDHC_CLK_SDCLKEN); +#endif return; } @@ -625,6 +639,7 @@ fsl_sdhc_set_clock(struct fsl_sdhci_soft val32 &= ~(SDHC_CLK_DIVISOR_MASK | SDHC_CLK_PRESCALE_MASK); val32 |= divisor << SDHC_CLK_DIVISOR_SHIFT; val32 |= prescale << SDHC_CLK_PRESCALE_SHIFT; + val32 |= SDHC_CLK_IPGEN; WR4(sc, SDHCI_CLOCK_CONTROL, val32); } @@ -710,10 +725,10 @@ fsl_sdhci_intr(void *arg) */ switch (sc->r1bfix_type) { case R1BFIX_NODATA: - intmask = RD4(sc, SDHC_INT_STATUS) & SDHCI_INT_RESPONSE; + intmask = RD4(sc, SDHCI_INT_STATUS) & SDHCI_INT_RESPONSE; break; case R1BFIX_AC12: - intmask = RD4(sc, SDHC_INT_STATUS) & SDHCI_INT_DATA_END; + intmask = RD4(sc, SDHCI_INT_STATUS) & SDHCI_INT_DATA_END; break; default: intmask = 0; @@ -722,8 +737,8 @@ fsl_sdhci_intr(void *arg) if (intmask) { sc->r1bfix_timeout_at = getsbinuptime() + 250 * SBT_1MS; if (!fsl_sdhci_r1bfix_is_wait_done(sc)) { - WR4(sc, SDHC_INT_STATUS, intmask); - bus_barrier(sc->mem_res, SDHC_INT_STATUS, 4, + WR4(sc, SDHCI_INT_STATUS, intmask); + bus_barrier(sc->mem_res, SDHCI_INT_STATUS, 4, BUS_SPACE_BARRIER_WRITE); } } @@ -735,9 +750,53 @@ fsl_sdhci_intr(void *arg) static int fsl_sdhci_get_ro(device_t bus, device_t child) { + struct fsl_sdhci_softc *sc = device_get_softc(bus); + + if (RD4(sc, SDHCI_PRESENT_STATE) & SDHC_PRES_WPSPL) + return (false); + return (true); +} + +#ifdef __powerpc__ +static uint32_t +fsl_sdhci_get_platform_clock(device_t dev) +{ + device_t parent; + phandle_t node; + uint32_t clock; + + node = ofw_bus_get_node(dev); - return (false); + /* Get sdhci node properties */ + if((OF_getprop(node, "clock-frequency", (void *)&clock, + sizeof(clock)) <= 0) || (clock == 0)) { + + /* + * Trying to get clock from parent device (soc) if correct + * clock cannot be acquired from sdhci node. + */ + parent = device_get_parent(dev); + node = ofw_bus_get_node(parent); + + /* Get soc properties */ + if ((OF_getprop(node, "bus-frequency", (void *)&clock, + sizeof(clock)) <= 0) || (clock == 0)) { + device_printf(dev,"Cannot acquire correct sdhci " + "frequency from DTS.\n"); + + return (0); + } + /* eSDHC clock is 1/2 platform clock. */ + clock /= 2; + } + + if (bootverbose) + device_printf(dev, "Acquired clock: %d from DTS\n", clock); + + return (clock); } +#endif + static int fsl_sdhci_detach(device_t dev) @@ -752,6 +811,9 @@ fsl_sdhci_attach(device_t dev) struct fsl_sdhci_softc *sc = device_get_softc(dev); int rid, err; phandle_t node; +#ifdef __powerpc__ + uint32_t protctl; +#endif sc->dev = dev; @@ -807,9 +869,21 @@ fsl_sdhci_attach(device_t dev) * * XXX need named constants for this stuff. */ - WR4(sc, SDHC_WTMK_LVL, 0x08800880); + /* P1022 has the '*_BRST_LEN' fields as reserved, always reading 0x10 */ + if (ofw_bus_is_compatible(dev, "fsl,p1022-esdhc")) + WR4(sc, SDHC_WTMK_LVL, 0x10801080); + else + WR4(sc, SDHC_WTMK_LVL, 0x08800880); + /* + * We read in native byte order in the main driver, but the register + * defaults to little endian. + */ +#ifdef __powerpc__ + sc->baseclk_hz = fsl_sdhci_get_platform_clock(dev); +#else sc->baseclk_hz = imx_ccm_sdhci_hz(); +#endif sc->slot.max_clk = sc->baseclk_hz; /* @@ -830,6 +904,16 @@ fsl_sdhci_attach(device_t dev) /* XXX put real gpio hookup here. */ sc->force_card_present = true; } +#ifdef __powerpc__ + /* Default to big-endian on powerpc */ + protctl = RD4(sc, SDHC_PROT_CTRL); + protctl &= ~SDHC_PROT_EMODE_MASK; + if (OF_hasprop(node, "little-endian")) + protctl |= SDHC_PROT_EMODE_LITTLE; + else + protctl |= SDHC_PROT_EMODE_BIG; + WR4(sc, SDHC_PROT_CTRL, protctl); +#endif callout_init(&sc->r1bfix_callout, 1); sdhci_init_slot(dev, &sc->slot, 0); From owner-svn-src-stable@freebsd.org Wed Mar 1 21:05:26 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29BAECF3487; Wed, 1 Mar 2017 21:05:26 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 046F3976; Wed, 1 Mar 2017 21:05:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21L5PYC015257; Wed, 1 Mar 2017 21:05:25 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21L5PWt015256; Wed, 1 Mar 2017 21:05:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012105.v21L5PWt015256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314511 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:05:26 -0000 Author: ian Date: Wed Mar 1 21:05:24 2017 New Revision: 314511 URL: https://svnweb.freebsd.org/changeset/base/314511 Log: MFC r311736: Use the new sdhci_fdt_gpio helper functions to add full support for FDT gpio pins for detecting card insert/remove and write protect. Modified: stable/11/sys/dev/sdhci/fsl_sdhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/fsl_sdhci.c Wed Mar 1 21:02:26 2017 (r314510) +++ stable/11/sys/dev/sdhci/fsl_sdhci.c Wed Mar 1 21:05:24 2017 (r314511) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include @@ -67,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "sdhci_if.h" struct fsl_sdhci_softc { @@ -77,10 +79,10 @@ struct fsl_sdhci_softc { struct sdhci_slot slot; struct callout r1bfix_callout; sbintime_t r1bfix_timeout_at; + struct sdhci_fdt_gpio * gpio; uint32_t baseclk_hz; uint32_t cmd_and_mode; uint32_t r1bfix_intmask; - boolean_t force_card_present; uint16_t sdclockreg_freq_bits; uint8_t r1bfix_type; uint8_t hwtype; @@ -345,8 +347,6 @@ fsl_sdhci_read_4(device_t dev, struct sd val32 &= 0x000F0F07; val32 |= (wrk32 >> 4) & SDHCI_STATE_DAT_MASK; val32 |= (wrk32 >> 9) & SDHCI_RETUNE_REQUEST; - if (sc->force_card_present) - val32 |= SDHCI_CARD_PRESENT; return (val32); } @@ -752,9 +752,15 @@ fsl_sdhci_get_ro(device_t bus, device_t { struct fsl_sdhci_softc *sc = device_get_softc(bus); - if (RD4(sc, SDHCI_PRESENT_STATE) & SDHC_PRES_WPSPL) - return (false); - return (true); + return (sdhci_fdt_gpio_get_readonly(sc->gpio)); +} + +static bool +fsl_sdhci_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct fsl_sdhci_softc *sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); } #ifdef __powerpc__ @@ -802,6 +808,7 @@ static int fsl_sdhci_detach(device_t dev) { + /* sdhci_fdt_gpio_teardown(sc->gpio); */ return (EBUSY); } @@ -810,8 +817,8 @@ fsl_sdhci_attach(device_t dev) { struct fsl_sdhci_softc *sc = device_get_softc(dev); int rid, err; - phandle_t node; #ifdef __powerpc__ + phandle_t node; uint32_t protctl; #endif @@ -887,24 +894,13 @@ fsl_sdhci_attach(device_t dev) sc->slot.max_clk = sc->baseclk_hz; /* - * If the slot is flagged with the non-removable property, set our flag - * to always force the SDHCI_CARD_PRESENT bit on. - * - * XXX Workaround for gpio-based card detect... - * - * We don't have gpio support yet. If there's a cd-gpios property just - * force the SDHCI_CARD_PRESENT bit on for now. If there isn't really a - * card there it will fail to probe at the mmc layer and nothing bad - * happens except instantiating an mmcN device for an empty slot. + * Set up any gpio pin handling described in the FDT data. This cannot + * fail; see comments in sdhci_fdt_gpio.h for details. */ - node = ofw_bus_get_node(dev); - if (OF_hasprop(node, "non-removable")) - sc->force_card_present = true; - else if (OF_hasprop(node, "cd-gpios")) { - /* XXX put real gpio hookup here. */ - sc->force_card_present = true; - } + sc->gpio = sdhci_fdt_gpio_setup(dev, &sc->slot); + #ifdef __powerpc__ + node = ofw_bus_get_node(dev); /* Default to big-endian on powerpc */ protctl = RD4(sc, SDHC_PROT_CTRL); protctl &= ~SDHC_PROT_EMODE_MASK; @@ -974,7 +970,7 @@ static device_method_t fsl_sdhci_methods DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), - /* SDHCI registers accessors */ + /* SDHCI accessors */ DEVMETHOD(sdhci_read_1, fsl_sdhci_read_1), DEVMETHOD(sdhci_read_2, fsl_sdhci_read_2), DEVMETHOD(sdhci_read_4, fsl_sdhci_read_4), @@ -983,6 +979,7 @@ static device_method_t fsl_sdhci_methods DEVMETHOD(sdhci_write_2, fsl_sdhci_write_2), DEVMETHOD(sdhci_write_4, fsl_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, fsl_sdhci_write_multi_4), + DEVMETHOD(sdhci_get_card_present,fsl_sdhci_get_card_present), { 0, 0 } }; From owner-svn-src-stable@freebsd.org Wed Mar 1 21:11:38 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 686C4CF3679; Wed, 1 Mar 2017 21:11:38 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 1DAA4D4D; Wed, 1 Mar 2017 21:11:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21LBbBp018992; Wed, 1 Mar 2017 21:11:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21LBbaT018990; Wed, 1 Mar 2017 21:11:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012111.v21LBbaT018990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314512 - stable/11/sys/arm/ti/am335x X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:11:38 -0000 Author: ian Date: Wed Mar 1 21:11:36 2017 New Revision: 314512 URL: https://svnweb.freebsd.org/changeset/base/314512 Log: MFC r312859: Configure the timer capture pin to input mode in the timer control register, in addition to configuring it as input with the pinmux driver. There was a control register bit commented as "no desc in datasheet". A later revision of the manual reveals the bit to be an input/output control for the timer pin. In addition to configuring capture or pulse mode, you apparently have to separately configure the pin direction in the timer control register. Before this change, the timer block was apparently driving a signal onto a pad configured by pinmux as input. Capture mode still accidentally worked for me during testing because I was using a very strong signal source that just out-muscled the weaker drive from the misconfigured pin. Modified: stable/11/sys/arm/ti/am335x/am335x_dmtpps.c stable/11/sys/arm/ti/am335x/am335x_dmtreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/am335x/am335x_dmtpps.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_dmtpps.c Wed Mar 1 21:05:24 2017 (r314511) +++ stable/11/sys/arm/ti/am335x/am335x_dmtpps.c Wed Mar 1 21:11:36 2017 (r314512) @@ -463,6 +463,14 @@ dmtpps_attach(device_t dev) sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); + /* + * Configure the timer pulse/capture pin to input/capture mode. This is + * required in addition to configuring the pin as input with the pinmux + * controller (which was done via fdt data or tunable at probe time). + */ + sc->tclr = DMT_TCLR_GPO_CFG; + DMTIMER_WRITE4(sc, DMT_TCLR, sc->tclr); + /* Set up timecounter hardware, start it. */ DMTIMER_WRITE4(sc, DMT_TSICR, DMT_TSICR_RESET); while (DMTIMER_READ4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) Modified: stable/11/sys/arm/ti/am335x/am335x_dmtreg.h ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_dmtreg.h Wed Mar 1 21:05:24 2017 (r314511) +++ stable/11/sys/arm/ti/am335x/am335x_dmtreg.h Wed Mar 1 21:11:36 2017 (r314512) @@ -62,7 +62,7 @@ #define DMT_TCLR_TRGMODE_BOTH (2 << 10) /* Trigger on match + ovflow */ #define DMT_TCLR_PWM_PTOGGLE (1 << 12) /* PWM toggles */ #define DMT_TCLR_CAP_MODE_2ND (1 << 13) /* Capture second event mode */ -#define DMT_TCLR_GPO_CFG (1 << 14) /* (no descr in datasheet) */ +#define DMT_TCLR_GPO_CFG (1 << 14) /* Tmr pin conf, 0=out, 1=in */ #define DMT_TCRR 0x3C /* Counter Register */ #define DMT_TLDR 0x40 /* Load Reg */ #define DMT_TTGR 0x44 /* Trigger Reg */ From owner-svn-src-stable@freebsd.org Wed Mar 1 21:12:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64AB3CF386B; Wed, 1 Mar 2017 21:12:52 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 30F66F51; Wed, 1 Mar 2017 21:12:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21LCpjZ019079; Wed, 1 Mar 2017 21:12:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21LCpNU019077; Wed, 1 Mar 2017 21:12:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012112.v21LCpNU019077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314513 - in stable/11/sys: arm/freescale/imx dev/usb/controller X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:12:52 -0000 Author: ian Date: Wed Mar 1 21:12:50 2017 New Revision: 314513 URL: https://svnweb.freebsd.org/changeset/base/314513 Log: MFC r313674: Enable usb low and full speed devices connected to the imx6 root hubs. Modified: stable/11/sys/arm/freescale/imx/imx6_usbphy.c stable/11/sys/dev/usb/controller/ehci_imx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx6_usbphy.c Wed Mar 1 21:11:36 2017 (r314512) +++ stable/11/sys/arm/freescale/imx/imx6_usbphy.c Wed Mar 1 21:12:50 2017 (r314513) @@ -143,6 +143,10 @@ usbphy_attach(device_t dev) bus_write_4(sc->mem_res, CTRL_SET_REG, CTRL_SFTRST); bus_write_4(sc->mem_res, CTRL_CLR_REG, CTRL_SFTRST | CTRL_CLKGATE); + /* Set UTMI+ level 2+3 bits to enable low and full speed devices. */ + bus_write_4(sc->mem_res, CTRL_SET_REG, + CTRL_ENUTMILEVEL2 | CTRL_ENUTMILEVEL3); + /* Power up: clear all bits in the powerdown register. */ bus_write_4(sc->mem_res, PWD_REG, 0); Modified: stable/11/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- stable/11/sys/dev/usb/controller/ehci_imx.c Wed Mar 1 21:11:36 2017 (r314512) +++ stable/11/sys/dev/usb/controller/ehci_imx.c Wed Mar 1 21:12:50 2017 (r314513) @@ -298,8 +298,9 @@ imx_ehci_attach(device_t dev) * Set flags that affect ehci_init() behavior, and hook our post-reset * code into the standard controller code. */ - esc->sc_flags |= EHCI_SCFLG_NORESTERM; + esc->sc_flags |= EHCI_SCFLG_NORESTERM | EHCI_SCFLG_TT; esc->sc_vendor_post_reset = imx_ehci_post_reset; + esc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; err = ehci_init(esc); if (err != 0) { From owner-svn-src-stable@freebsd.org Wed Mar 1 21:18:44 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 545EACF392A; Wed, 1 Mar 2017 21:18:44 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 233DF1B8; Wed, 1 Mar 2017 21:18:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21LIhUE019361; Wed, 1 Mar 2017 21:18:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21LIhaY019359; Wed, 1 Mar 2017 21:18:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012118.v21LIhaY019359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314514 - in stable/11/sys: arm/ti dev/sdhci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:18:44 -0000 Author: ian Date: Wed Mar 1 21:18:42 2017 New Revision: 314514 URL: https://svnweb.freebsd.org/changeset/base/314514 Log: MFC r314064, r314060: Fix typos in bootverbose printfs... display the write-protect pin info, not the card-detect pin info. Remove a variable that has been unused since r311735 (it should have been removed as part of those changes). Modified: stable/11/sys/arm/ti/ti_sdhci.c stable/11/sys/dev/sdhci/sdhci_fdt_gpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/ti_sdhci.c ============================================================================== --- stable/11/sys/arm/ti/ti_sdhci.c Wed Mar 1 21:12:50 2017 (r314513) +++ stable/11/sys/arm/ti/ti_sdhci.c Wed Mar 1 21:18:42 2017 (r314514) @@ -71,7 +71,6 @@ struct ti_sdhci_softc { uint32_t mmchs_reg_off; uint32_t sdhci_reg_off; uint32_t baseclk_hz; - uint32_t wp_gpio_pin; uint32_t cmd_and_mode; uint32_t sdhci_clkdiv; boolean_t disable_highspeed; Modified: stable/11/sys/dev/sdhci/sdhci_fdt_gpio.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_fdt_gpio.c Wed Mar 1 21:12:50 2017 (r314513) +++ stable/11/sys/dev/sdhci/sdhci_fdt_gpio.c Wed Mar 1 21:18:42 2017 (r314514) @@ -188,7 +188,7 @@ wp_setup(struct sdhci_fdt_gpio *gpio, ph if (bootverbose) device_printf(dev, "Write protect switch on %s pin %u\n", - device_get_nameunit(gpio->cd_pin->dev), gpio->cd_pin->pin); + device_get_nameunit(gpio->wp_pin->dev), gpio->wp_pin->pin); } struct sdhci_fdt_gpio * From owner-svn-src-stable@freebsd.org Wed Mar 1 21:19:47 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BADCECF39A0; Wed, 1 Mar 2017 21:19:47 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 8A22D32C; Wed, 1 Mar 2017 21:19:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21LJk7r019440; Wed, 1 Mar 2017 21:19:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21LJkLq019439; Wed, 1 Mar 2017 21:19:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012119.v21LJkLq019439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314515 - stable/11/sys/arm/freescale/imx X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:19:47 -0000 Author: ian Date: Wed Mar 1 21:19:46 2017 New Revision: 314515 URL: https://svnweb.freebsd.org/changeset/base/314515 Log: MFC r313917: Change the naming of imx{5,6} gpio pins to exactly match the names used in the reference manual. Modified: stable/11/sys/arm/freescale/imx/imx_gpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx_gpio.c Wed Mar 1 21:18:42 2017 (r314514) +++ stable/11/sys/arm/freescale/imx/imx_gpio.c Wed Mar 1 21:19:46 2017 (r314515) @@ -728,7 +728,7 @@ imx51_gpio_attach(device_t dev) (READ4(sc, IMX_GPIO_OE_REG) & (1U << i)) ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME, - "imx_gpio%d.%d", unit, i); + "GPIO%d_IO%02d", unit + 1, i); } #ifdef INTRNG From owner-svn-src-stable@freebsd.org Wed Mar 1 21:20:30 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 235E6CF3A82; Wed, 1 Mar 2017 21:20:30 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id E4712690; Wed, 1 Mar 2017 21:20:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21LKSiK019531; Wed, 1 Mar 2017 21:20:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21LKSr5019530; Wed, 1 Mar 2017 21:20:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012120.v21LKSr5019530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314516 - stable/11/sys/dev/ffec X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:20:30 -0000 Author: ian Date: Wed Mar 1 21:20:28 2017 New Revision: 314516 URL: https://svnweb.freebsd.org/changeset/base/314516 Log: MFC r313918: Add definitions for the IEEE-1588 registers. Modified: stable/11/sys/dev/ffec/if_ffecreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ffec/if_ffecreg.h ============================================================================== --- stable/11/sys/dev/ffec/if_ffecreg.h Wed Mar 1 21:19:46 2017 (r314515) +++ stable/11/sys/dev/ffec/if_ffecreg.h Wed Mar 1 21:20:28 2017 (r314516) @@ -186,6 +186,27 @@ __FBSDID("$FreeBSD$"); #define FEC_RACC_PADREM (1 << 0) /* + * IEEE-1588 timer registers + */ + +#define FEC_ATCR_REG 0x0400 +#define FEC_ATCR_SLAVE (1u << 13) +#define FEC_ATCR_CAPTURE (1u << 11) +#define FEC_ATCR_RESTART (1u << 9) +#define FEC_ATCR_PINPER (1u << 7) +#define FEC_ATCR_PEREN (1u << 4) +#define FEC_ATCR_OFFRST (1u << 3) +#define FEC_ATCR_OFFEN (1u << 2) +#define FEC_ATCR_EN (1u << 0) + +#define FEC_ATVR_REG 0x0404 +#define FEC_ATOFF_REG 0x0408 +#define FEC_ATPER_REG 0x040c +#define FEC_ATCOR_REG 0x0410 +#define FEC_ATINC_REG 0x0414 +#define FEC_ATSTMP_REG 0x0418 + +/* * Statistics registers */ #define FEC_RMON_T_DROP 0x200 From owner-svn-src-stable@freebsd.org Wed Mar 1 21:31:45 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FBEFCF3047; Wed, 1 Mar 2017 21:31:45 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 3AE33EFF; Wed, 1 Mar 2017 21:31:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21LVia7026177; Wed, 1 Mar 2017 21:31:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21LVikJ026176; Wed, 1 Mar 2017 21:31:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012131.v21LVikJ026176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314517 - stable/11/sys/modules/dtb/imx6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:31:45 -0000 Author: ian Date: Wed Mar 1 21:31:44 2017 New Revision: 314517 URL: https://svnweb.freebsd.org/changeset/base/314517 Log: MFC r313919: Add dtb files for Boundary Devices Nitrogen 6 family boards. Modified: stable/11/sys/modules/dtb/imx6/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/dtb/imx6/Makefile ============================================================================== --- stable/11/sys/modules/dtb/imx6/Makefile Wed Mar 1 21:20:28 2017 (r314516) +++ stable/11/sys/modules/dtb/imx6/Makefile Wed Mar 1 21:31:44 2017 (r314517) @@ -5,6 +5,9 @@ DTS= \ imx6q-cubox-i.dts \ imx6dl-hummingboard.dts \ imx6q-hummingboard.dts \ + imx6dl-nitrogen6x.dts \ + imx6q-nitrogen6_max.dts \ + imx6q-nitrogen6x.dts \ imx6dl-riotboard.dts \ imx6dl-wandboard.dts \ imx6q-wandboard.dts From owner-svn-src-stable@freebsd.org Wed Mar 1 21:45:06 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4CD7CF37B6; Wed, 1 Mar 2017 21:45:06 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 9F1E4DDE; Wed, 1 Mar 2017 21:45:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21Lj54X031109; Wed, 1 Mar 2017 21:45:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21Lj3Gp031090; Wed, 1 Mar 2017 21:45:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012145.v21Lj3Gp031090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314521 - stable/11/sys/arm/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:45:06 -0000 Author: ian Date: Wed Mar 1 21:45:03 2017 New Revision: 314521 URL: https://svnweb.freebsd.org/changeset/base/314521 Log: MFC r302506: Remove HZ= from all armv6 configs, put HZ=1000 in std.armv6. Modified: stable/11/sys/arm/conf/ALLWINNER stable/11/sys/arm/conf/ALPINE stable/11/sys/arm/conf/AML8726 stable/11/sys/arm/conf/ARMADA38X stable/11/sys/arm/conf/ARMADAXP stable/11/sys/arm/conf/BEAGLEBONE stable/11/sys/arm/conf/EXYNOS5.common stable/11/sys/arm/conf/IMX53-QSB stable/11/sys/arm/conf/IMX6 stable/11/sys/arm/conf/PANDABOARD stable/11/sys/arm/conf/RK3188 stable/11/sys/arm/conf/RPI-B stable/11/sys/arm/conf/RPI2 stable/11/sys/arm/conf/SOCKIT.common stable/11/sys/arm/conf/TEGRA124 stable/11/sys/arm/conf/VERSATILEPB stable/11/sys/arm/conf/VIRT stable/11/sys/arm/conf/VYBRID stable/11/sys/arm/conf/std.armv6 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/conf/ALLWINNER ============================================================================== --- stable/11/sys/arm/conf/ALLWINNER Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/ALLWINNER Wed Mar 1 21:45:03 2017 (r314521) @@ -32,7 +32,6 @@ options SOC_ALLWINNER_A31S options SOC_ALLWINNER_A83T options SOC_ALLWINNER_H3 -options HZ=100 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores options PLATFORM Modified: stable/11/sys/arm/conf/ALPINE ============================================================================== --- stable/11/sys/arm/conf/ALPINE Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/ALPINE Wed Mar 1 21:45:03 2017 (r314521) @@ -25,7 +25,6 @@ include "../annapurna/alpine/std.alpine makeoptions MODULES_OVERRIDE="" makeoptions WERROR="-Werror" -options HZ=100 options SCHED_4BSD # 4BSD scheduler options SMP # Enable multiple cores Modified: stable/11/sys/arm/conf/AML8726 ============================================================================== --- stable/11/sys/arm/conf/AML8726 Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/AML8726 Wed Mar 1 21:45:03 2017 (r314521) @@ -23,7 +23,6 @@ ident AML8726 include "std.armv6" include "../amlogic/aml8726/std.aml8726" -options HZ=100 options SCHED_ULE # ULE scheduler options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options LINUX_BOOT_ABI Modified: stable/11/sys/arm/conf/ARMADA38X ============================================================================== --- stable/11/sys/arm/conf/ARMADA38X Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/ARMADA38X Wed Mar 1 21:45:03 2017 (r314521) @@ -19,8 +19,6 @@ options MD_ROOT options ROOTDEVNAME=\"/dev/da0s1a\" options SCHED_ULE # ULE scheduler -#options SCHED_4BSD # 4BSD scheduler - options SMP # Pseudo devices Modified: stable/11/sys/arm/conf/ARMADAXP ============================================================================== --- stable/11/sys/arm/conf/ARMADAXP Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/ARMADAXP Wed Mar 1 21:45:03 2017 (r314521) @@ -27,7 +27,6 @@ options SOC_MV_ARMADAXP makeoptions WERROR="-Werror" -options HZ=1000 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores Modified: stable/11/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/11/sys/arm/conf/BEAGLEBONE Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/BEAGLEBONE Wed Mar 1 21:45:03 2017 (r314521) @@ -30,7 +30,6 @@ makeoptions MODULES_EXTRA="dtb/am335x am options INTRNG -options HZ=100 options SCHED_4BSD # 4BSD scheduler options PLATFORM Modified: stable/11/sys/arm/conf/EXYNOS5.common ============================================================================== --- stable/11/sys/arm/conf/EXYNOS5.common Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/EXYNOS5.common Wed Mar 1 21:45:03 2017 (r314521) @@ -21,7 +21,6 @@ makeoptions WERROR="-Werror" include "std.armv6" -options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking Modified: stable/11/sys/arm/conf/IMX53-QSB ============================================================================== --- stable/11/sys/arm/conf/IMX53-QSB Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/IMX53-QSB Wed Mar 1 21:45:03 2017 (r314521) @@ -22,8 +22,6 @@ include "IMX53" ident IMX53-QSB -options HZ=250 # 4ms scheduling quantum - # required for netbooting #options BOOTP #options BOOTP_COMPAT Modified: stable/11/sys/arm/conf/IMX6 ============================================================================== --- stable/11/sys/arm/conf/IMX6 Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/IMX6 Wed Mar 1 21:45:03 2017 (r314521) @@ -26,7 +26,6 @@ options INTRNG options SOC_IMX6 -options HZ=500 # Scheduling quantum is 2 milliseconds. options SCHED_ULE # ULE scheduler #options NFSD # Network Filesystem Server options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/11/sys/arm/conf/PANDABOARD ============================================================================== --- stable/11/sys/arm/conf/PANDABOARD Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/PANDABOARD Wed Mar 1 21:45:03 2017 (r314521) @@ -30,7 +30,6 @@ hints "PANDABOARD.hints" include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" -options HZ=100 options SCHED_ULE # ULE scheduler options PLATFORM options SMP # Enable multiple cores Modified: stable/11/sys/arm/conf/RK3188 ============================================================================== --- stable/11/sys/arm/conf/RK3188 Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/RK3188 Wed Mar 1 21:45:03 2017 (r314521) @@ -23,7 +23,6 @@ ident RK3188 include "std.armv6" include "../rockchip/std.rk30xx" -options HZ=100 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores Modified: stable/11/sys/arm/conf/RPI-B ============================================================================== --- stable/11/sys/arm/conf/RPI-B Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/RPI-B Wed Mar 1 21:45:03 2017 (r314521) @@ -26,7 +26,6 @@ include "../broadcom/bcm2835/std.bcm283 options INTRNG -options HZ=100 options SCHED_4BSD # 4BSD scheduler options PLATFORM Modified: stable/11/sys/arm/conf/RPI2 ============================================================================== --- stable/11/sys/arm/conf/RPI2 Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/RPI2 Wed Mar 1 21:45:03 2017 (r314521) @@ -26,7 +26,6 @@ include "../broadcom/bcm2835/std.bcm283 options INTRNG -options HZ=100 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores options PLATFORM Modified: stable/11/sys/arm/conf/SOCKIT.common ============================================================================== --- stable/11/sys/arm/conf/SOCKIT.common Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/SOCKIT.common Wed Mar 1 21:45:03 2017 (r314521) @@ -25,7 +25,6 @@ makeoptions MODULES_OVERRIDE="" makeoptions WERROR="-Werror" -options HZ=100 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores Modified: stable/11/sys/arm/conf/TEGRA124 ============================================================================== --- stable/11/sys/arm/conf/TEGRA124 Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/TEGRA124 Wed Mar 1 21:45:03 2017 (r314521) @@ -23,7 +23,6 @@ include "../nvidia/tegra124/std.tegra12 ident TEGRA124 -options HZ=100 # Scheduling quantum is 10 milliseconds. options SCHED_ULE # ULE scheduler options PLATFORM # Platform based SoC options PLATFORM_SMP Modified: stable/11/sys/arm/conf/VERSATILEPB ============================================================================== --- stable/11/sys/arm/conf/VERSATILEPB Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/VERSATILEPB Wed Mar 1 21:45:03 2017 (r314521) @@ -29,7 +29,6 @@ makeoptions MODULES_OVERRIDE="" options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 -options HZ=100 options SCHED_4BSD # 4BSD scheduler options LINUX_BOOT_ABI # Process metadata passed from Linux boot loaders Modified: stable/11/sys/arm/conf/VIRT ============================================================================== --- stable/11/sys/arm/conf/VIRT Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/VIRT Wed Mar 1 21:45:03 2017 (r314521) @@ -23,8 +23,7 @@ ident VIRT include "std.armv6" include "../qemu/std.virt" -options HZ=100 -options SCHED_ULE # 4BSD scheduler +options SCHED_ULE # ULE scheduler options PLATFORM options PLATFORM_SMP options SMP # Enable multiple cores Modified: stable/11/sys/arm/conf/VYBRID ============================================================================== --- stable/11/sys/arm/conf/VYBRID Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/VYBRID Wed Mar 1 21:45:03 2017 (r314521) @@ -24,7 +24,6 @@ include "../freescale/vybrid/std.vybrid makeoptions WERROR="-Werror" -options HZ=100 options SCHED_4BSD # 4BSD scheduler #options NANDFS # NAND Filesystem #options SMP # Enable multiple cores Modified: stable/11/sys/arm/conf/std.armv6 ============================================================================== --- stable/11/sys/arm/conf/std.armv6 Wed Mar 1 21:42:22 2017 (r314520) +++ stable/11/sys/arm/conf/std.armv6 Wed Mar 1 21:45:03 2017 (r314521) @@ -2,8 +2,8 @@ # # $FreeBSD$ +options HZ=1000 options ARM_L2_PIPT # Only L2 PIPT is supported - options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols From owner-svn-src-stable@freebsd.org Wed Mar 1 21:48:16 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABBD9CF38D6; Wed, 1 Mar 2017 21:48:16 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 7851CC; Wed, 1 Mar 2017 21:48:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21LmFvp031283; Wed, 1 Mar 2017 21:48:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21LmF30031281; Wed, 1 Mar 2017 21:48:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012148.v21LmF30031281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 21:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314522 - stable/11/sys/boot/fdt/dts/arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 21:48:16 -0000 Author: ian Date: Wed Mar 1 21:48:15 2017 New Revision: 314522 URL: https://svnweb.freebsd.org/changeset/base/314522 Log: MFC r309195: Add an ethernet0 alias pointing to the /aix/usb/hub/ethernet node. This is required for u-boot to locate the ethernet node when it's doing fixup of the mac-address property when the user has overridden the default addr. Modified: stable/11/sys/boot/fdt/dts/arm/rpi.dts stable/11/sys/boot/fdt/dts/arm/rpi2.dts Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/fdt/dts/arm/rpi.dts ============================================================================== --- stable/11/sys/boot/fdt/dts/arm/rpi.dts Wed Mar 1 21:45:03 2017 (r314521) +++ stable/11/sys/boot/fdt/dts/arm/rpi.dts Wed Mar 1 21:48:15 2017 (r314522) @@ -298,7 +298,7 @@ reg = <0x00000001>; #address-cells = <1>; #size-cells = <0>; - ethernet { + ethernet: ethernet { compatible = "net,ethernet", "usb,device"; reg = <0x00000001>; @@ -386,6 +386,7 @@ aliases { uart0 = &uart0; + ethernet0 = ðernet; }; chosen { Modified: stable/11/sys/boot/fdt/dts/arm/rpi2.dts ============================================================================== --- stable/11/sys/boot/fdt/dts/arm/rpi2.dts Wed Mar 1 21:45:03 2017 (r314521) +++ stable/11/sys/boot/fdt/dts/arm/rpi2.dts Wed Mar 1 21:48:15 2017 (r314522) @@ -315,7 +315,7 @@ reg = <0x00000001>; #address-cells = <1>; #size-cells = <0>; - ethernet { + ethernet: ethernet { compatible = "net,ethernet", "usb,device"; reg = <0x00000001>; @@ -397,6 +397,7 @@ aliases { uart0 = &uart0; + ethernet0 = ðernet; }; chosen { From owner-svn-src-stable@freebsd.org Wed Mar 1 22:45:14 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B10FCF3C22; Wed, 1 Mar 2017 22:45:14 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id EC567CC0; Wed, 1 Mar 2017 22:45:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21MjDNk054983; Wed, 1 Mar 2017 22:45:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21MjCkC054978; Wed, 1 Mar 2017 22:45:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012245.v21MjCkC054978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 22:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314525 - in stable/11/sys: arm/arm arm/include conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 22:45:14 -0000 Author: ian Date: Wed Mar 1 22:45:12 2017 New Revision: 314525 URL: https://svnweb.freebsd.org/changeset/base/314525 Log: MFC r306901: ARM: Split identify_arm_cpu() into ARMv4 and ARMv6 variant. On ARMv6, be more verbose about supported CPU features and/or optional instructions. Added: stable/11/sys/arm/arm/identcpu-v4.c - copied unchanged from r306901, head/sys/arm/arm/identcpu-v4.c stable/11/sys/arm/arm/identcpu-v6.c - copied unchanged from r306901, head/sys/arm/arm/identcpu-v6.c Deleted: stable/11/sys/arm/arm/identcpu.c Modified: stable/11/sys/arm/arm/cpuinfo.c stable/11/sys/arm/include/cpuinfo.h stable/11/sys/conf/files.arm Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/cpuinfo.c ============================================================================== --- stable/11/sys/arm/arm/cpuinfo.c Wed Mar 1 21:58:26 2017 (r314524) +++ stable/11/sys/arm/arm/cpuinfo.c Wed Mar 1 22:45:12 2017 (r314525) @@ -111,6 +111,10 @@ cpuinfo_init(void) /* Not yet - CBAR only exist on ARM SMP Cortex A CPUs cpuinfo.cbar = cp15_cbar_get(); */ + if (CPU_CT_FORMAT(cpuinfo.ctr) == CPU_CT_ARMV7) { + cpuinfo.ccsidr = cp15_ccsidr_get(); + cpuinfo.clidr = cp15_clidr_get(); + } /* Test if revidr is implemented */ if (cpuinfo.revidr == cpuinfo.midr) @@ -163,6 +167,7 @@ cpuinfo_get_actlr_modifier(uint32_t *act if (cpuinfo.implementer == CPU_IMPLEMENTER_ARM) { switch (cpuinfo.part_number) { + case CPU_ARCH_CORTEX_A73: case CPU_ARCH_CORTEX_A72: case CPU_ARCH_CORTEX_A57: case CPU_ARCH_CORTEX_A53: Copied: stable/11/sys/arm/arm/identcpu-v4.c (from r306901, head/sys/arm/arm/identcpu-v4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/arm/arm/identcpu-v4.c Wed Mar 1 22:45:12 2017 (r314525, copy of r306901, head/sys/arm/arm/identcpu-v4.c) @@ -0,0 +1,386 @@ +/* $NetBSD: cpu.c,v 1.55 2004/02/13 11:36:10 wiz Exp $ */ + +/*- + * Copyright (c) 1995 Mark Brinicombe. + * Copyright (c) 1995 Brini. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Brini. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * RiscBSD kernel project + * + * cpu.c + * + * Probing and configuration for the master CPU + * + * Created : 10/10/95 + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +char machine[] = "arm"; + +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, + machine, 0, "Machine class"); + +static const char * const generic_steppings[16] = { + "rev 0", "rev 1", "rev 2", "rev 3", + "rev 4", "rev 5", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +static const char * const xscale_steppings[16] = { + "step A-0", "step A-1", "step B-0", "step C-0", + "step D-0", "rev 5", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +static const char * const i80219_steppings[16] = { + "step A-0", "rev 1", "rev 2", "rev 3", + "rev 4", "rev 5", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +static const char * const i80321_steppings[16] = { + "step A-0", "step B-0", "rev 2", "rev 3", + "rev 4", "rev 5", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +static const char * const i81342_steppings[16] = { + "step A-0", "rev 1", "rev 2", "rev 3", + "rev 4", "rev 5", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +/* Steppings for PXA2[15]0 */ +static const char * const pxa2x0_steppings[16] = { + "step A-0", "step A-1", "step B-0", "step B-1", + "step B-2", "step C-0", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +/* Steppings for PXA255/26x. + * rev 5: PXA26x B0, rev 6: PXA255 A0 + */ +static const char * const pxa255_steppings[16] = { + "rev 0", "rev 1", "rev 2", "step A-0", + "rev 4", "step B-0", "step A-0", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +/* Stepping for PXA27x */ +static const char * const pxa27x_steppings[16] = { + "step A-0", "step A-1", "step B-0", "step B-1", + "step C-0", "rev 5", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +static const char * const ixp425_steppings[16] = { + "step 0 (A0)", "rev 1 (ARMv5TE)", "rev 2", "rev 3", + "rev 4", "rev 5", "rev 6", "rev 7", + "rev 8", "rev 9", "rev 10", "rev 11", + "rev 12", "rev 13", "rev 14", "rev 15", +}; + +struct cpuidtab { + u_int32_t cpuid; + enum cpu_class cpu_class; + const char *cpu_name; + const char * const *cpu_steppings; +}; + +const struct cpuidtab cpuids[] = { + { CPU_ID_ARM920T, CPU_CLASS_ARM9TDMI, "ARM920T", + generic_steppings }, + { CPU_ID_ARM920T_ALT, CPU_CLASS_ARM9TDMI, "ARM920T", + generic_steppings }, + { CPU_ID_ARM922T, CPU_CLASS_ARM9TDMI, "ARM922T", + generic_steppings }, + { CPU_ID_ARM926EJS, CPU_CLASS_ARM9EJS, "ARM926EJ-S", + generic_steppings }, + { CPU_ID_ARM940T, CPU_CLASS_ARM9TDMI, "ARM940T", + generic_steppings }, + { CPU_ID_ARM946ES, CPU_CLASS_ARM9ES, "ARM946E-S", + generic_steppings }, + { CPU_ID_ARM966ES, CPU_CLASS_ARM9ES, "ARM966E-S", + generic_steppings }, + { CPU_ID_ARM966ESR1, CPU_CLASS_ARM9ES, "ARM966E-S", + generic_steppings }, + { CPU_ID_FA526, CPU_CLASS_ARM9TDMI, "FA526", + generic_steppings }, + { CPU_ID_FA626TE, CPU_CLASS_ARM9ES, "FA626TE", + generic_steppings }, + + { CPU_ID_TI925T, CPU_CLASS_ARM9TDMI, "TI ARM925T", + generic_steppings }, + + { CPU_ID_ARM1020E, CPU_CLASS_ARM10E, "ARM1020E", + generic_steppings }, + { CPU_ID_ARM1022ES, CPU_CLASS_ARM10E, "ARM1022E-S", + generic_steppings }, + { CPU_ID_ARM1026EJS, CPU_CLASS_ARM10EJ, "ARM1026EJ-S", + generic_steppings }, + + { CPU_ID_80200, CPU_CLASS_XSCALE, "i80200", + xscale_steppings }, + + { CPU_ID_80321_400, CPU_CLASS_XSCALE, "i80321 400MHz", + i80321_steppings }, + { CPU_ID_80321_600, CPU_CLASS_XSCALE, "i80321 600MHz", + i80321_steppings }, + { CPU_ID_80321_400_B0, CPU_CLASS_XSCALE, "i80321 400MHz", + i80321_steppings }, + { CPU_ID_80321_600_B0, CPU_CLASS_XSCALE, "i80321 600MHz", + i80321_steppings }, + + { CPU_ID_81342, CPU_CLASS_XSCALE, "i81342", + i81342_steppings }, + + { CPU_ID_80219_400, CPU_CLASS_XSCALE, "i80219 400MHz", + i80219_steppings }, + { CPU_ID_80219_600, CPU_CLASS_XSCALE, "i80219 600MHz", + i80219_steppings }, + + { CPU_ID_PXA27X, CPU_CLASS_XSCALE, "PXA27x", + pxa27x_steppings }, + { CPU_ID_PXA250A, CPU_CLASS_XSCALE, "PXA250", + pxa2x0_steppings }, + { CPU_ID_PXA210A, CPU_CLASS_XSCALE, "PXA210", + pxa2x0_steppings }, + { CPU_ID_PXA250B, CPU_CLASS_XSCALE, "PXA250", + pxa2x0_steppings }, + { CPU_ID_PXA210B, CPU_CLASS_XSCALE, "PXA210", + pxa2x0_steppings }, + { CPU_ID_PXA250C, CPU_CLASS_XSCALE, "PXA255", + pxa255_steppings }, + { CPU_ID_PXA210C, CPU_CLASS_XSCALE, "PXA210", + pxa2x0_steppings }, + + { CPU_ID_IXP425_533, CPU_CLASS_XSCALE, "IXP425 533MHz", + ixp425_steppings }, + { CPU_ID_IXP425_400, CPU_CLASS_XSCALE, "IXP425 400MHz", + ixp425_steppings }, + { CPU_ID_IXP425_266, CPU_CLASS_XSCALE, "IXP425 266MHz", + ixp425_steppings }, + + /* XXX ixp435 steppings? */ + { CPU_ID_IXP435, CPU_CLASS_XSCALE, "IXP435", + ixp425_steppings }, + + { CPU_ID_MV88FR131, CPU_CLASS_MARVELL, "Feroceon 88FR131", + generic_steppings }, + + { CPU_ID_MV88FR571_VD, CPU_CLASS_MARVELL, "Feroceon 88FR571-VD", + generic_steppings }, + + { 0, CPU_CLASS_NONE, NULL, NULL } +}; + +struct cpu_classtab { + const char *class_name; + const char *class_option; +}; + +const struct cpu_classtab cpu_classes[] = { + { "unknown", NULL }, /* CPU_CLASS_NONE */ + { "ARM9TDMI", "CPU_ARM9TDMI" }, /* CPU_CLASS_ARM9TDMI */ + { "ARM9E-S", "CPU_ARM9E" }, /* CPU_CLASS_ARM9ES */ + { "ARM9EJ-S", "CPU_ARM9E" }, /* CPU_CLASS_ARM9EJS */ + { "ARM10E", "CPU_ARM10" }, /* CPU_CLASS_ARM10E */ + { "ARM10EJ", "CPU_ARM10" }, /* CPU_CLASS_ARM10EJ */ + { "XScale", "CPU_XSCALE_..." }, /* CPU_CLASS_XSCALE */ + { "Marvell", "CPU_MARVELL" }, /* CPU_CLASS_MARVELL */ +}; + +/* + * Report the type of the specified arm processor. This uses the generic and + * arm specific information in the cpu structure to identify the processor. + * The remaining fields in the cpu structure are filled in appropriately. + */ + +static const char * const wtnames[] = { + "write-through", + "write-back", + "write-back", + "**unknown 3**", + "**unknown 4**", + "write-back-locking", /* XXX XScale-specific? */ + "write-back-locking-A", + "write-back-locking-B", + "**unknown 8**", + "**unknown 9**", + "**unknown 10**", + "**unknown 11**", + "**unknown 12**", + "**unknown 13**", + "write-back-locking-C", + "**unknown 15**", +}; + +static void +print_enadis(int enadis, char *s) +{ + + printf(" %s %sabled", s, (enadis == 0) ? "dis" : "en"); +} + +enum cpu_class cpu_class = CPU_CLASS_NONE; + +u_int cpu_pfr(int num) +{ + u_int feat; + + switch (num) { + case 0: + __asm __volatile("mrc p15, 0, %0, c0, c1, 0" + : "=r" (feat)); + break; + case 1: + __asm __volatile("mrc p15, 0, %0, c0, c1, 1" + : "=r" (feat)); + break; + default: + panic("Processor Feature Register %d not implemented", num); + break; + } + + return (feat); +} + +void +identify_arm_cpu(void) +{ + u_int cpuid; + u_int8_t ctrl; + int i; + + ctrl = cpu_get_control(); + cpuid = cpu_ident(); + + if (cpuid == 0) { + printf("Processor failed probe - no CPU ID\n"); + return; + } + + for (i = 0; cpuids[i].cpuid != 0; i++) + if (cpuids[i].cpuid == (cpuid & CPU_ID_CPU_MASK)) { + cpu_class = cpuids[i].cpu_class; + printf("CPU: %s %s (%s core)\n", + cpuids[i].cpu_name, + cpuids[i].cpu_steppings[cpuid & + CPU_ID_REVISION_MASK], + cpu_classes[cpu_class].class_name); + break; + } + if (cpuids[i].cpuid == 0) + printf("unknown CPU (ID = 0x%x)\n", cpuid); + + printf(" "); + + if (ctrl & CPU_CONTROL_BEND_ENABLE) + printf(" Big-endian"); + else + printf(" Little-endian"); + + switch (cpu_class) { + case CPU_CLASS_ARM9TDMI: + case CPU_CLASS_ARM9ES: + case CPU_CLASS_ARM9EJS: + case CPU_CLASS_ARM10E: + case CPU_CLASS_ARM10EJ: + case CPU_CLASS_XSCALE: + case CPU_CLASS_MARVELL: + print_enadis(ctrl & CPU_CONTROL_DC_ENABLE, "DC"); + print_enadis(ctrl & CPU_CONTROL_IC_ENABLE, "IC"); +#ifdef CPU_XSCALE_81342 + print_enadis(ctrl & CPU_CONTROL_L2_ENABLE, "L2"); +#endif +#if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) + i = sheeva_control_ext(0, 0); + print_enadis(i & MV_WA_ENABLE, "WA"); + print_enadis(i & MV_DC_STREAM_ENABLE, "DC streaming"); + printf("\n "); + print_enadis((i & MV_BTB_DISABLE) == 0, "BTB"); + print_enadis(i & MV_L2_ENABLE, "L2"); + print_enadis((i & MV_L2_PREFETCH_DISABLE) == 0, + "L2 prefetch"); + printf("\n "); +#endif + break; + default: + break; + } + + print_enadis(ctrl & CPU_CONTROL_WBUF_ENABLE, "WB"); + if (ctrl & CPU_CONTROL_LABT_ENABLE) + printf(" LABT"); + else + printf(" EABT"); + + print_enadis(ctrl & CPU_CONTROL_BPRD_ENABLE, "branch prediction"); + printf("\n"); + + /* Print cache info. */ + if (arm_picache_line_size == 0 && arm_pdcache_line_size == 0) + return; + + if (arm_pcache_unified) { + printf(" %dKB/%dB %d-way %s unified cache\n", + arm_pdcache_size / 1024, + arm_pdcache_line_size, arm_pdcache_ways, + wtnames[arm_pcache_type]); + } else { + printf(" %dKB/%dB %d-way instruction cache\n", + arm_picache_size / 1024, + arm_picache_line_size, arm_picache_ways); + printf(" %dKB/%dB %d-way %s data cache\n", + arm_pdcache_size / 1024, + arm_pdcache_line_size, arm_pdcache_ways, + wtnames[arm_pcache_type]); + } +} Copied: stable/11/sys/arm/arm/identcpu-v6.c (from r306901, head/sys/arm/arm/identcpu-v6.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/arm/arm/identcpu-v6.c Wed Mar 1 22:45:12 2017 (r314525, copy of r306901, head/sys/arm/arm/identcpu-v6.c) @@ -0,0 +1,360 @@ +/* $NetBSD: cpu.c,v 1.55 2004/02/13 11:36:10 wiz Exp $ */ + +/*- + * Copyright (c) 1995 Mark Brinicombe. + * Copyright (c) 1995 Brini. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Brini. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * RiscBSD kernel project + * + * cpu.c + * + * Probing and configuration for the master CPU + * + * Created : 10/10/95 + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +char machine[] = "arm"; + +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, + machine, 0, "Machine class"); + +static char hw_buf[81]; +static int hw_buf_idx; +static bool hw_buf_newline; + +static struct { + int implementer; + int part_number; + char *impl_name; + char *core_name; +} cpu_names[] = { + {CPU_IMPLEMENTER_ARM, CPU_ARCH_ARM1176, "ARM", "ARM1176"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A5 , "ARM", "Cortex-A5"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A7 , "ARM", "Cortex-A7"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A8 , "ARM", "Cortex-A8"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A9 , "ARM", "Cortex-A9"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A12, "ARM", "Cortex-A12"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A15, "ARM", "Cortex-A15"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A17, "ARM", "Cortex-A17"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A53, "ARM", "Cortex-A53"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A57, "ARM", "Cortex-A57"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A72, "ARM", "Cortex-A72"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A73, "ARM", "Cortex-A73"}, + + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_581, "Marwell", "PJ4 v7"}, + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_584, "Marwell", "PJ4MP v7"}, + + {CPU_IMPLEMENTER_QCOM, CPU_ARCH_KRAIT_300, "Qualcomm", "Krait 300"}, +}; + + +static void +print_v5_cache(void) +{ + uint32_t isize, dsize; + uint32_t multiplier; + int pcache_type; + int pcache_unified; + int picache_size; + int picache_line_size; + int picache_ways; + int pdcache_size; + int pdcache_line_size; + int pdcache_ways; + + pcache_unified = 0; + picache_size = 0 ; + picache_line_size = 0 ; + picache_ways = 0 ; + pdcache_size = 0; + pdcache_line_size = 0; + pdcache_ways = 0; + + if ((cpuinfo.ctr & CPU_CT_S) == 0) + pcache_unified = 1; + + /* + * If you want to know how this code works, go read the ARM ARM. + */ + pcache_type = CPU_CT_CTYPE(cpuinfo.ctr); + + if (pcache_unified == 0) { + isize = CPU_CT_ISIZE(cpuinfo.ctr); + multiplier = (isize & CPU_CT_xSIZE_M) ? 3 : 2; + picache_line_size = 1U << (CPU_CT_xSIZE_LEN(isize) + 3); + if (CPU_CT_xSIZE_ASSOC(isize) == 0) { + if (isize & CPU_CT_xSIZE_M) + picache_line_size = 0; /* not present */ + else + picache_ways = 1; + } else { + picache_ways = multiplier << + (CPU_CT_xSIZE_ASSOC(isize) - 1); + } + picache_size = multiplier << (CPU_CT_xSIZE_SIZE(isize) + 8); + } + + dsize = CPU_CT_DSIZE(cpuinfo.ctr); + multiplier = (dsize & CPU_CT_xSIZE_M) ? 3 : 2; + pdcache_line_size = 1U << (CPU_CT_xSIZE_LEN(dsize) + 3); + if (CPU_CT_xSIZE_ASSOC(dsize) == 0) { + if (dsize & CPU_CT_xSIZE_M) + pdcache_line_size = 0; /* not present */ + else + pdcache_ways = 1; + } else { + pdcache_ways = multiplier << + (CPU_CT_xSIZE_ASSOC(dsize) - 1); + } + pdcache_size = multiplier << (CPU_CT_xSIZE_SIZE(dsize) + 8); + + + /* Print cache info. */ + if (picache_line_size == 0 && pdcache_line_size == 0) + return; + + if (pcache_unified) { + printf(" %dKB/%dB %d-way %s unified cache\n", + pdcache_size / 1024, + pdcache_line_size, pdcache_ways, + pcache_type == 0 ? "WT" : "WB"); + } else { + printf(" %dKB/%dB %d-way instruction cache\n", + picache_size / 1024, + picache_line_size, picache_ways); + printf(" %dKB/%dB %d-way %s data cache\n", + pdcache_size / 1024, + pdcache_line_size, pdcache_ways, + pcache_type == 0 ? "WT" : "WB"); + } +} + +static void +print_v7_cache(void ) +{ + uint32_t type, val, size, sets, ways, linesize; + int i; + + printf("LoUU:%d LoC:%d LoUIS:%d \n", + CPU_CLIDR_LOUU(cpuinfo.clidr) + 1, + CPU_CLIDR_LOC(cpuinfo.clidr) + 1, + CPU_CLIDR_LOUIS(cpuinfo.clidr) + 1); + + for (i = 0; i < 7; i++) { + type = CPU_CLIDR_CTYPE(cpuinfo.clidr, i); + if (type == 0) + break; + printf("Cache level %d:\n", i + 1); + if (type == CACHE_DCACHE || type == CACHE_UNI_CACHE || + type == CACHE_SEP_CACHE) { + cp15_csselr_set(i << 1); + val = cp15_ccsidr_get(); + ways = CPUV7_CT_xSIZE_ASSOC(val) + 1; + sets = CPUV7_CT_xSIZE_SET(val) + 1; + linesize = 1 << (CPUV7_CT_xSIZE_LEN(val) + 4); + size = (ways * sets * linesize) / 1024; + + if (type == CACHE_UNI_CACHE) + printf(" %dKB/%dB %d-way unified cache", + size, linesize,ways); + else + printf(" %dKB/%dB %d-way data cache", + size, linesize, ways); + if (val & CPUV7_CT_CTYPE_WT) + printf(" WT"); + if (val & CPUV7_CT_CTYPE_WB) + printf(" WB"); + if (val & CPUV7_CT_CTYPE_RA) + printf(" Read-Alloc"); + if (val & CPUV7_CT_CTYPE_WA) + printf(" Write-Alloc"); + printf("\n"); + } + + if (type == CACHE_ICACHE || type == CACHE_SEP_CACHE) { + cp15_csselr_set(i << 1 | 1); + val = cp15_ccsidr_get(); + ways = CPUV7_CT_xSIZE_ASSOC(val) + 1; + sets = CPUV7_CT_xSIZE_SET(val) + 1; + linesize = 1 << (CPUV7_CT_xSIZE_LEN(val) + 4); + size = (ways * sets * linesize) / 1024; + printf(" %dKB/%dB %d-way instruction cache", + size, linesize, ways); + if (val & CPUV7_CT_CTYPE_WT) + printf(" WT"); + if (val & CPUV7_CT_CTYPE_WB) + printf(" WB"); + if (val & CPUV7_CT_CTYPE_RA) + printf(" Read-Alloc"); + if (val & CPUV7_CT_CTYPE_WA) + printf(" Write-Alloc"); + printf("\n"); + } + } + cp15_csselr_set(0); +} + +static void +add_cap(char *cap) +{ + int len; + + len = strlen(cap); + + if ((hw_buf_idx + len + 2) >= 79) { + printf("%s,\n", hw_buf); + hw_buf_idx = 0; + hw_buf_newline = true; + } + if (hw_buf_newline) + hw_buf_idx += sprintf(hw_buf + hw_buf_idx, " "); + else + hw_buf_idx += sprintf(hw_buf + hw_buf_idx, ", "); + hw_buf_newline = false; + + + hw_buf_idx += sprintf(hw_buf + hw_buf_idx, "%s", cap); +} + +void +identify_arm_cpu(void) +{ + int i; + u_int val; + + /* + * CPU + */ + for(i = 0; i < nitems(cpu_names); i++) { + if (cpu_names[i].implementer == cpuinfo.implementer && + cpu_names[i].part_number == cpuinfo.part_number) { + printf("CPU: %s %s r%dp%d (ECO: 0x%08X)\n", + cpu_names[i].impl_name, cpu_names[i].core_name, + cpuinfo.revision, cpuinfo.patch, + cpuinfo.midr != cpuinfo.revidr ? + cpuinfo.revidr : 0); + break; + } + + } + if (i >= nitems(cpu_names)) + printf("unknown CPU (ID = 0x%x)\n", cpuinfo.midr); + + printf("CPU Features: \n"); + hw_buf_idx = 0; + hw_buf_newline = true; + + val = (cpuinfo.mpidr >> 4)& 0xF; + if (cpuinfo.mpidr & (1 << 31U)) + add_cap("Multiprocessing"); + val = (cpuinfo.id_pfr0 >> 4)& 0xF; + if (val == 1) + add_cap("Thumb"); + else if (val == 3) + add_cap("Thumb2"); + + val = (cpuinfo.id_pfr1 >> 4)& 0xF; + if (val == 1 || val == 2) + add_cap("Security"); + + val = (cpuinfo.id_pfr1 >> 12)& 0xF; + if (val == 1) + add_cap("Virtualization"); + + val = (cpuinfo.id_pfr1 >> 16)& 0xF; + if (val == 1) + add_cap("Generic Timer"); + + val = (cpuinfo.id_mmfr0 >> 0)& 0xF; + if (val == 2) { + add_cap("VMSAv6"); + } else if (val >= 3) { + add_cap("VMSAv7"); + if (val >= 4) + add_cap("PXN"); + if (val >= 5) + add_cap("LPAE"); + } + + val = (cpuinfo.id_mmfr3 >> 20)& 0xF; + if (val == 1) + add_cap("Coherent Walk"); + + if (hw_buf_idx != 0) + printf("%s\n", hw_buf); + + printf("Optional instructions: \n"); + hw_buf_idx = 0; + hw_buf_newline = true; + val = (cpuinfo.id_isar0 >> 24)& 0xF; + if (val == 1) + add_cap("SDIV/UDIV (Thumb)"); + else if (val == 2) + add_cap("SDIV/UDIV"); + + val = (cpuinfo.id_isar2 >> 20)& 0xF; + if (val == 1 || val == 2) + add_cap("UMULL"); + + val = (cpuinfo.id_isar2 >> 16)& 0xF; + if (val == 1 || val == 2 || val == 3) + add_cap("SMULL"); + + val = (cpuinfo.id_isar2 >> 12)& 0xF; + if (val == 1) + add_cap("MLA"); + + val = (cpuinfo.id_isar3 >> 4)& 0xF; + if (val == 1) + add_cap("SIMD"); + else if (val == 3) + add_cap("SIMD(ext)"); + if (hw_buf_idx != 0) + printf("%s\n", hw_buf); + + /* + * Cache + */ + if (CPU_CT_FORMAT(cpuinfo.ctr) == CPU_CT_ARMV7) + print_v7_cache(); + else + print_v5_cache(); +} Modified: stable/11/sys/arm/include/cpuinfo.h ============================================================================== --- stable/11/sys/arm/include/cpuinfo.h Wed Mar 1 21:58:26 2017 (r314524) +++ stable/11/sys/arm/include/cpuinfo.h Wed Mar 1 22:45:12 2017 (r314525) @@ -48,13 +48,14 @@ #define CPU_ARCH_CORTEX_A53 0xD03 #define CPU_ARCH_CORTEX_A57 0xD07 #define CPU_ARCH_CORTEX_A72 0xD08 +#define CPU_ARCH_CORTEX_A73 0xD09 /* QCOM */ #define CPU_ARCH_KRAIT_300 0x06F /* MRVL */ -#define CPU_ARCH_SHEEVA_851 0x581 /* PJ4/PJ4B */ +#define CPU_ARCH_SHEEVA_581 0x581 /* PJ4/PJ4B */ #define CPU_ARCH_SHEEVA_584 0x584 /* PJ4B-MP/PJ4C */ struct cpuinfo { @@ -80,8 +81,10 @@ struct cpuinfo { uint32_t id_isar4; uint32_t id_isar5; uint32_t cbar; + uint32_t ccsidr; + uint32_t clidr; - /* Parsed bits of above registers... */ + /* Parsed bits of above registers... */ /* midr */ int implementer; Modified: stable/11/sys/conf/files.arm ============================================================================== --- stable/11/sys/conf/files.arm Wed Mar 1 21:58:26 2017 (r314524) +++ stable/11/sys/conf/files.arm Wed Mar 1 22:45:12 2017 (r314525) @@ -53,7 +53,8 @@ arm/arm/gdb_machdep.c optional gdb arm/arm/generic_timer.c optional generic_timer arm/arm/gic.c optional gic arm/arm/hdmi_if.m optional hdmi -arm/arm/identcpu.c standard +arm/arm/identcpu-v4.c optional !armv6 +arm/arm/identcpu-v6.c optional armv6 arm/arm/in_cksum.c optional inet | inet6 arm/arm/in_cksum_arm.S optional inet | inet6 arm/arm/intr.c optional !intrng From owner-svn-src-stable@freebsd.org Wed Mar 1 23:35:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47F8BCF4EFE; Wed, 1 Mar 2017 23:35:42 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 13C6C616; Wed, 1 Mar 2017 23:35:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v21NZfRw074371; Wed, 1 Mar 2017 23:35:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v21NZf5n074370; Wed, 1 Mar 2017 23:35:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703012335.v21NZf5n074370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 1 Mar 2017 23:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314526 - stable/11/sys/arm/arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 23:35:42 -0000 Author: ian Date: Wed Mar 1 23:35:40 2017 New Revision: 314526 URL: https://svnweb.freebsd.org/changeset/base/314526 Log: MFC r312251: Remove a bit of armv6 support that didn't get deleted when this file was split from trap.c into trap-v4.c and trap-v6.c. Modified: stable/11/sys/arm/arm/trap-v4.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/trap-v4.c ============================================================================== --- stable/11/sys/arm/arm/trap-v4.c Wed Mar 1 22:45:12 2017 (r314525) +++ stable/11/sys/arm/arm/trap-v4.c Wed Mar 1 23:35:40 2017 (r314526) @@ -139,11 +139,7 @@ static const struct data_abort data_abor {dab_align, "Alignment Fault 3"}, {dab_buserr, "External Linefetch Abort (S)"}, {NULL, "Translation Fault (S)"}, -#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 - {NULL, "Translation Flag Fault"}, -#else {dab_buserr, "External Linefetch Abort (P)"}, -#endif {NULL, "Translation Fault (P)"}, {dab_buserr, "External Non-Linefetch Abort (S)"}, {NULL, "Domain Fault (S)"}, From owner-svn-src-stable@freebsd.org Thu Mar 2 01:18:48 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F21C2CF2434; Thu, 2 Mar 2017 01:18:48 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id A8100385; Thu, 2 Mar 2017 01:18:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v221Il9g013189; Thu, 2 Mar 2017 01:18:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v221Iktx013176; Thu, 2 Mar 2017 01:18:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703020118.v221Iktx013176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 2 Mar 2017 01:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314530 - in stable/11/sys: arm/arm arm/include contrib/vchiq/interface/compat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 01:18:49 -0000 Author: ian Date: Thu Mar 2 01:18:46 2017 New Revision: 314530 URL: https://svnweb.freebsd.org/changeset/base/314530 Log: MFC r312292, r313573: Stop including sys/types.h from arm's machine/atomic.h, fix the places where atomic.h was being included without ensuring that types.h (via param.h) was included first, as required by atomic(9). Remove arm's cpuconf.h, and references to it, after moving a few lines from it into pmap-v4.h where they are used. Other than those few lines of support for different MMU types, nothing in cpuconf.h has been used in our code for quite a while. The file existed to set up a variety of symbols to describe the architecture. Over the past few years we have converted all of our source to use the new architecture symbols standardized by ARM Inc, and predefined by both clang and gcc. Deleted: stable/11/sys/arm/include/cpuconf.h Modified: stable/11/sys/arm/arm/bus_space_asm_generic.S stable/11/sys/arm/arm/cpufunc.c stable/11/sys/arm/arm/identcpu-v4.c stable/11/sys/arm/arm/identcpu-v6.c stable/11/sys/arm/arm/locore-v4.S stable/11/sys/arm/arm/locore-v6.S stable/11/sys/arm/arm/stack_machdep.c stable/11/sys/arm/include/atomic.h stable/11/sys/arm/include/cpufunc.h stable/11/sys/arm/include/pcpu.h stable/11/sys/arm/include/pmap-v4.h stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/bus_space_asm_generic.S ============================================================================== --- stable/11/sys/arm/arm/bus_space_asm_generic.S Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/arm/bus_space_asm_generic.S Thu Mar 2 01:18:46 2017 (r314530) @@ -36,7 +36,6 @@ */ #include -#include __FBSDID("$FreeBSD$"); /* Modified: stable/11/sys/arm/arm/cpufunc.c ============================================================================== --- stable/11/sys/arm/arm/cpufunc.c Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/arm/cpufunc.c Thu Mar 2 01:18:46 2017 (r314530) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #if defined(CPU_XSCALE_81342) Modified: stable/11/sys/arm/arm/identcpu-v4.c ============================================================================== --- stable/11/sys/arm/arm/identcpu-v4.c Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/arm/identcpu-v4.c Thu Mar 2 01:18:46 2017 (r314530) @@ -43,15 +43,14 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include #include #include #include #include #include -#include #include char machine[] = "arm"; Modified: stable/11/sys/arm/arm/identcpu-v6.c ============================================================================== --- stable/11/sys/arm/arm/identcpu-v6.c Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/arm/identcpu-v6.c Thu Mar 2 01:18:46 2017 (r314530) @@ -43,8 +43,8 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include #include #include #include Modified: stable/11/sys/arm/arm/locore-v4.S ============================================================================== --- stable/11/sys/arm/arm/locore-v4.S Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/arm/locore-v4.S Thu Mar 2 01:18:46 2017 (r314530) @@ -37,7 +37,6 @@ #include #include #include -#include #include __FBSDID("$FreeBSD$"); Modified: stable/11/sys/arm/arm/locore-v6.S ============================================================================== --- stable/11/sys/arm/arm/locore-v6.S Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/arm/locore-v6.S Thu Mar 2 01:18:46 2017 (r314530) @@ -34,7 +34,6 @@ #include #include #include -#include #include __FBSDID("$FreeBSD$"); Modified: stable/11/sys/arm/arm/stack_machdep.c ============================================================================== --- stable/11/sys/arm/arm/stack_machdep.c Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/arm/stack_machdep.c Thu Mar 2 01:18:46 2017 (r314530) @@ -27,8 +27,8 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include #include #include Modified: stable/11/sys/arm/include/atomic.h ============================================================================== --- stable/11/sys/arm/include/atomic.h Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/include/atomic.h Thu Mar 2 01:18:46 2017 (r314530) @@ -39,13 +39,10 @@ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ -#include #include #ifndef _KERNEL #include -#else -#include #endif #if __ARM_ARCH >= 6 Modified: stable/11/sys/arm/include/cpufunc.h ============================================================================== --- stable/11/sys/arm/include/cpufunc.h Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/include/cpufunc.h Thu Mar 2 01:18:46 2017 (r314530) @@ -48,7 +48,6 @@ #include #include -#include static __inline void breakpoint(void) Modified: stable/11/sys/arm/include/pcpu.h ============================================================================== --- stable/11/sys/arm/include/pcpu.h Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/include/pcpu.h Thu Mar 2 01:18:46 2017 (r314530) @@ -32,8 +32,6 @@ #ifdef _KERNEL -#include - #include #include Modified: stable/11/sys/arm/include/pmap-v4.h ============================================================================== --- stable/11/sys/arm/include/pmap-v4.h Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/arm/include/pmap-v4.h Thu Mar 2 01:18:46 2017 (r314530) @@ -51,7 +51,30 @@ #define _MACHINE_PMAP_V4_H_ #include -#include + +/* + * Define the MMU types we support based on the cpu types. While the code has + * some theoretical support for multiple MMU types in a single kernel, there are + * no actual working configurations that use that feature. + */ +#if (defined(CPU_ARM9) || defined(CPU_ARM9E) || defined(CPU_FA526)) +#define ARM_MMU_GENERIC 1 +#else +#define ARM_MMU_GENERIC 0 +#endif + +#if (defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ + defined(CPU_XSCALE_81342)) +#define ARM_MMU_XSCALE 1 +#else +#define ARM_MMU_XSCALE 0 +#endif + +#define ARM_NMMUS (ARM_MMU_GENERIC + ARM_MMU_XSCALE) +#if ARM_NMMUS == 0 && !defined(KLD_MODULE) && defined(_KERNEL) +#error ARM_NMMUS is 0 +#endif + /* * Pte related macros */ Modified: stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.h ============================================================================== --- stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.h Thu Mar 2 01:14:48 2017 (r314529) +++ stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.h Thu Mar 2 01:18:46 2017 (r314530) @@ -28,8 +28,8 @@ #ifndef __VCHI_BSD_H__ #define __VCHI_BSD_H__ -#include #include +#include #include #include #include From owner-svn-src-stable@freebsd.org Thu Mar 2 01:23:18 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFAD1CF295D; Thu, 2 Mar 2017 01:23:18 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id B150FB5E; Thu, 2 Mar 2017 01:23:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v221NHiO016859; Thu, 2 Mar 2017 01:23:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v221NHED016857; Thu, 2 Mar 2017 01:23:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703020123.v221NHED016857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 2 Mar 2017 01:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314531 - in stable/11/etc: . rc.d X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 01:23:19 -0000 Author: ian Date: Thu Mar 2 01:23:17 2017 New Revision: 314531 URL: https://svnweb.freebsd.org/changeset/base/314531 Log: MFC r311103, r311907: Update ntp.conf to use the ntpd pool feature. Our previous ntp.conf file configured 3 servers from freebsd.pool.ntp.org using 3 separate 'server' config lines. That is now replaced with a single 'pool' line which causes ntpd to add multiple servers from the pool. More than just making the config smaller, the pool feature in ntpd has one major advantage over configuring 3 separate servers from a pool: if a server that was added using a 'pool' statement provides bad time (initially or at some later date), ntpd automatically discards it and configures a new different server from the pool without needing to be restarted. These changes also add a 'tos' line to control how many pool servers get added, a 'restrict source' line that is required to allow ntpd to add new peers from the pool, and it deletes a 'restrict 127.127.1.0' line that does nothing and should never have been there (127.127.1.0 is not a valid IP address, it's a refclock identifier). Add "pool" to the keywords that rc.d/ntpdate examines to find a server address in ntp.conf. Modified: stable/11/etc/ntp.conf stable/11/etc/rc.d/ntpdate Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/ntp.conf ============================================================================== --- stable/11/etc/ntp.conf Thu Mar 2 01:18:46 2017 (r314530) +++ stable/11/etc/ntp.conf Thu Mar 2 01:23:17 2017 (r314531) @@ -11,28 +11,43 @@ # # -# The following three servers will give you a random set of three -# NTP servers geographically close to you. -# See http://www.pool.ntp.org/ for details. Note, the pool encourages +# Set the target and limit for adding servers configured via pool statements +# or discovered dynamically via mechanisms such as broadcast and manycast. +# Ntpd automatically adds maxclock-1 servers from configured pools, and may +# add as many as maxclock*2 if necessary to ensure that at least minclock +# servers are providing good consistant time. +# +tos minclock 3 maxclock 6 + +# +# The following pool statement will give you a random set of NTP servers +# geographically close to you. A single pool statement adds multiple +# servers from the pool, according to the tos minclock/maxclock targets. +# See http://www.pool.ntp.org/ for details. Note, pool.ntp.org encourages # users with a static IP and good upstream NTP servers to add a server # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronization. # -server 0.freebsd.pool.ntp.org iburst -server 1.freebsd.pool.ntp.org iburst -server 2.freebsd.pool.ntp.org iburst -#server 3.freebsd.pool.ntp.org iburst +pool 0.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server -# you want sync against, comment out the above servers, uncomment -# the next ones and replace CC with the country's abbreviation. -# Make sure that the hostnames resolve to a proper IP address! -# -# server 0.CC.pool.ntp.org iburst -# server 1.CC.pool.ntp.org iburst -# server 2.CC.pool.ntp.org iburst +# you want to sync against, comment out the above pool, uncomment +# the next one, and replace CC with the country's abbreviation. +# Make sure that the hostname resolves to a proper IP address! +# +# pool 0.CC.pool.ntp.org iburst + +# +# To configure a specific server, such as an organization-wide local +# server, add lines similar to the following. One or more specific +# servers can be configured in addition to, or instead of, any server +# pools specified above. When both are configured, ntpd first adds all +# the specific servers, then adds servers from the pool until the tos +# minclock/maxclock targets are met. +# +#server time.my-internal.org iburst # # Security: @@ -40,11 +55,17 @@ server 2.freebsd.pool.ntp.org iburst # By default, only allow time queries and block all other requests # from unauthenticated clients. # +# The "restrict source" line allows peers to be mobilized when added by +# ntpd from a pool, but does not enable mobilizing a new peer association +# by other dynamic means (broadcast, manycast, ntpq commands, etc). +# # See http://support.ntp.org/bin/view/Support/AccessRestrictions # for more information. # -restrict default limited kod nomodify notrap nopeer noquery -restrict -6 default limited kod nomodify notrap nopeer noquery +restrict default limited kod nomodify notrap noquery nopeer +restrict -6 default limited kod nomodify notrap noquery nopeer +restrict source limited kod nomodify notrap noquery + # # Alternatively, the following rules would block all unauthorized access. # @@ -65,7 +86,6 @@ restrict -6 default limited kod nomodify # The following settings allow unrestricted access from the localhost restrict 127.0.0.1 restrict -6 ::1 -restrict 127.127.1.0 # # If a server loses sync with all upstream servers, NTP clients Modified: stable/11/etc/rc.d/ntpdate ============================================================================== --- stable/11/etc/rc.d/ntpdate Thu Mar 2 01:18:46 2017 (r314530) +++ stable/11/etc/rc.d/ntpdate Thu Mar 2 01:23:17 2017 (r314531) @@ -20,7 +20,7 @@ ntpdate_start() if [ -z "$ntpdate_hosts" -a -f "$ntpdate_config" ]; then ntpdate_hosts=`awk ' /^server[ \t]*127.127/ {next} - /^(server|peer)/ { + /^(server|peer|pool)/ { if ($2 ~/^-/) {print $3} else {print $2}} ' < "$ntpdate_config"` From owner-svn-src-stable@freebsd.org Thu Mar 2 01:28:16 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A5BCF2C9B; Thu, 2 Mar 2017 01:28:16 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 26A1EE2D; Thu, 2 Mar 2017 01:28:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v221SFJG017094; Thu, 2 Mar 2017 01:28:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v221SFtF017093; Thu, 2 Mar 2017 01:28:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703020128.v221SFtF017093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 2 Mar 2017 01:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314532 - stable/11/usr.bin/vi/catalog X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 01:28:16 -0000 Author: emaste Date: Thu Mar 2 01:28:15 2017 New Revision: 314532 URL: https://svnweb.freebsd.org/changeset/base/314532 Log: MFC r314139: make vi message catalogues build independent of locale r275234 addressed sort automatically converting 8-bit locales to UTF-8 by using "LANG=C sort", but LC_ALL overrides LANG if set, so the issue may still be present depending on the user's environment. Use LC_ALL=C instead. Reported by: https://tests.reproducible-builds.org/ Sponsored by: The Linux Foundation / Core Infrastructure Initiative Modified: stable/11/usr.bin/vi/catalog/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/vi/catalog/Makefile ============================================================================== --- stable/11/usr.bin/vi/catalog/Makefile Thu Mar 2 01:23:17 2017 (r314531) +++ stable/11/usr.bin/vi/catalog/Makefile Thu Mar 2 01:28:15 2017 (r314532) @@ -39,7 +39,7 @@ CAT+= $c.UTF-8 ${c}: ${c}.base echo "... $c"; \ rm -f $c; \ - env LANG=C sort -u ${.ALLSRC} | \ + env LC_ALL=C sort -u ${.ALLSRC} | \ awk '{ \ if ($$1 == 1) { \ print "\nMESSAGE NUMBER 1 IS NOT LEGAL"; \ @@ -86,13 +86,13 @@ ${c}.check: ${c}.base echo =========================; \ echo "MESSAGES WITH THE SAME MESSAGE ID's (FIX!):"; \ for j in \ - `sed '/^$$/d' < $$f.base | LANG=C sort -u | \ + `sed '/^$$/d' < $$f.base | LC_ALL=C sort -u | \ awk '{print $$1}' | uniq -d`; do \ egrep $$j $$f.base; \ done; \ echo =========================; \ echo "Duplicate messages, both id and message (this is okay):"; \ - sed '/^$$/d' < $$f.base | LANG=C sort | uniq -c | \ + sed '/^$$/d' < $$f.base | LC_ALL=C sort | uniq -c | \ awk '$$1 != 1 { print $$0 }' | sort -n; \ echo =========================) > $c .endfor From owner-svn-src-stable@freebsd.org Thu Mar 2 02:06:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19935CF47A9; Thu, 2 Mar 2017 02:06:28 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4DBED5E; Thu, 2 Mar 2017 02:06:27 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v2226QX4060131; Wed, 1 Mar 2017 18:06:26 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v2226QGL060130; Wed, 1 Mar 2017 18:06:26 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201703020206.v2226QGL060130@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r314525 - in stable/11/sys: arm/arm arm/include conf In-Reply-To: <201703012245.v21MjCkC054978@repo.freebsd.org> To: Ian Lepore Date: Wed, 1 Mar 2017 18:06:26 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 02:06:28 -0000 > Author: ian > Date: Wed Mar 1 22:45:12 2017 > New Revision: 314525 > URL: https://svnweb.freebsd.org/changeset/base/314525 ... > > Modified: stable/11/sys/conf/files.arm > ============================================================================== > --- stable/11/sys/conf/files.arm Wed Mar 1 21:58:26 2017 (r314524) > +++ stable/11/sys/conf/files.arm Wed Mar 1 22:45:12 2017 (r314525) > @@ -53,7 +53,8 @@ arm/arm/gdb_machdep.c optional gdb > arm/arm/generic_timer.c optional generic_timer > arm/arm/gic.c optional gic > arm/arm/hdmi_if.m optional hdmi > -arm/arm/identcpu.c standard > +arm/arm/identcpu-v4.c optional !armv6 > +arm/arm/identcpu-v6.c optional armv6 > arm/arm/in_cksum.c optional inet | inet6 > arm/arm/in_cksum_arm.S optional inet | inet6 > arm/arm/intr.c optional !intrng > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org" If we are adding armv4 as an optional supported cpu type (I didnt think we could run on anything less than an armv6, this patch clearly seems to make that false.) I think we should just do the above as > +arm/arm/identcpu-v4.c optional !armv6 | armv4 > +arm/arm/identcpu-v6.c optional armv6 As your above code would make the config for an armv6 machine be expressed by the lack of a CPU token in the CONFIG file, which is non intutive. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Thu Mar 2 04:15:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF8CCF4AD0 for ; Thu, 2 Mar 2017 04:15:28 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54D84178 for ; Thu, 2 Mar 2017 04:15:28 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cabd85b4-fefe-11e6-b3c2-c9f38144898e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id cabd85b4-fefe-11e6-b3c2-c9f38144898e; Thu, 02 Mar 2017 04:14:56 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v224FPnp008092; Wed, 1 Mar 2017 21:15:25 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1488428125.60166.55.camel@freebsd.org> Subject: Re: svn commit: r314525 - in stable/11/sys: arm/arm arm/include conf From: Ian Lepore To: "Rodney W. Grimes" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Date: Wed, 01 Mar 2017 21:15:25 -0700 In-Reply-To: <201703020206.v2226QGL060130@pdx.rh.CN85.dnsmgr.net> References: <201703020206.v2226QGL060130@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 04:15:28 -0000 On Wed, 2017-03-01 at 18:06 -0800, Rodney W. Grimes wrote: > > > > Author: ian > > Date: Wed Mar1 22:45:12 2017 > > New Revision: 314525 > > URL: https://svnweb.freebsd.org/changeset/base/314525 > ... > > > > > > > Modified: stable/11/sys/conf/files.arm > > =================================================================== > > =========== > > --- stable/11/sys/conf/files.arm Wed Mar1 21:58:26 2017 > > (r314524) > > +++ stable/11/sys/conf/files.arm Wed Mar1 22:45:12 2017 > > (r314525) > > @@ -53,7 +53,8 @@ arm/arm/gdb_machdep.c optional > > gdb > > arm/arm/generic_timer.c optional generic_tim > > er > > arm/arm/gic.c optional gic > > arm/arm/hdmi_if.m optional hdmi > > -arm/arm/identcpu.c standard > > +arm/arm/identcpu-v4.c optional !armv6 > > +arm/arm/identcpu-v6.c optional armv6 > > arm/arm/in_cksum.c optional inet | inet6 > > arm/arm/in_cksum_arm.S optional inet | inet6 > > arm/arm/intr.c optional !intrng > > _______________________________________________ > > svn-src-stable-11@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@fre > > ebsd.org" > If we are adding armv4 as an optional supported cpu type (I didnt > think > we could run on anything less than an armv6, this patch clearly seems > to > make that false.) I think we should just do the above as > > > > > +arm/arm/identcpu-v4.c optional !armv6 | > > armv4 > > +arm/arm/identcpu-v6.c optional armv6 > As your above code would make the config for an armv6 machine be > expressed by the lack of a CPU token in the CONFIG file, which is > non intutive. > There is no such cpuarch as armv4. Arm v4/v5 support has been around since 2005-ish, and when v6/v7 support came along, it was differentiated in kernel config files using "optional [!]armv6". That leverages a feature in config(8) that exports the 'cpuarch' argument of the machine keyword as an option keyword (for armv6/7 machines it's always "machine arm armv6"). In the old arm config files there is no cpuarch specified, it's always just "machine arm". I think that implies that for armv4/5 that cpuarch keyword would default to 'arm' (same as the machine arch), and that would allow using 'optional arm' rather than 'optional !armv6'. I would find that confusing because TARGET=arm TARGET_ARCH=armv6 makes me think "armv6 is arm too". Also, this is in files.arm, so having lines that say "optional arm" would be confusing too -- everything in there is for arm (of some flavor). -- Ian From owner-svn-src-stable@freebsd.org Thu Mar 2 04:23:55 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C70ECCF4FAB; Thu, 2 Mar 2017 04:23:55 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 9EC878FC; Thu, 2 Mar 2017 04:23:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v224Nswn087386; Thu, 2 Mar 2017 04:23:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v224Nsfj087379; Thu, 2 Mar 2017 04:23:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703020423.v224Nsfj087379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 2 Mar 2017 04:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314538 - in stable/11: lib/libc/gen share/man/man4 sys/kern sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 04:23:55 -0000 Author: ian Date: Thu Mar 2 04:23:53 2017 New Revision: 314538 URL: https://svnweb.freebsd.org/changeset/base/314538 Log: MFC r311954, r311996, r312077, r312080: Rework tty_drain() to poll the hardware for completion, and restore drain timeout handling to historical freebsd behavior. The primary reason for these changes is the need to have tty_drain() call ttydevsw_busy() at some reasonable sub-second rate, to poll hardware that doesn't signal an interrupt when the transmit shift register becomes empty (which includes virtually all USB serial hardware). Such hardware hangs in a ttyout wait, because it never gets an opportunity to trigger a wakeup from the sleep in tty_drain() by calling ttydisc_getc() again, after handing the last of the buffered data to the hardware. Restructure the tty_drain loop so that device-busy is checked one more time after tty_timedwait() returns an error only if the error is EWOULDBLOCK; other errors cause an immediate return. This fixes the case of the tty disappearing while in tty_drain(). Check tty_gone() after allocating IO buffers. The tty lock has to be dropped then reacquired due to using M_WAITOK, which opens a window in which the tty device can disappear. Check for this and return ENXIO back up the call chain so that callers can cope. Correct the comments about how much buffer is allocated. Modified: stable/11/lib/libc/gen/tcsendbreak.3 stable/11/share/man/man4/tty.4 stable/11/sys/kern/tty.c stable/11/sys/kern/tty_inq.c stable/11/sys/kern/tty_outq.c stable/11/sys/sys/tty.h stable/11/sys/sys/ttyqueue.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/tcsendbreak.3 ============================================================================== --- stable/11/lib/libc/gen/tcsendbreak.3 Thu Mar 2 04:11:18 2017 (r314537) +++ stable/11/lib/libc/gen/tcsendbreak.3 Thu Mar 2 04:23:53 2017 (r314538) @@ -28,7 +28,7 @@ .\" @(#)tcsendbreak.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 11, 2017 .Dt TCSENDBREAK 3 .Os .Sh NAME @@ -137,17 +137,44 @@ is not a terminal. A signal interrupted the .Fn tcdrain function. +.It Bq Er EWOULDBLOCK +The configured timeout expired before the +.Fn tcdrain +function could write all buffered output. .El .Sh SEE ALSO .Xr tcsetattr 3 , -.Xr termios 4 +.Xr termios 4 , +.Xr tty 4 , +.Xr comcontrol 8 .Sh STANDARDS The .Fn tcsendbreak , -.Fn tcdrain , .Fn tcflush and .Fn tcflow functions are expected to be compliant with the .St -p1003.1-88 specification. +.Pp +The +.Fn tcdrain +function is expected to be compliant with +.St -p1003.1-88 +when the drain wait value is set to zero with +.Xr comcontrol 8 , +or with +.Xr ioctl 2 +.Va TIOCSDRAINWAIT , +or with +.Xr sysctl 8 +.Va kern.tty_drainwait . +A non-zero drain wait value can result in +.Fn tcdrain +returning +.Va EWOULDBLOCK +without writing all output. +The default value for +.Va kern.tty_drainwait +is 300 seconds. + Modified: stable/11/share/man/man4/tty.4 ============================================================================== --- stable/11/share/man/man4/tty.4 Thu Mar 2 04:11:18 2017 (r314537) +++ stable/11/share/man/man4/tty.4 Thu Mar 2 04:23:53 2017 (r314538) @@ -28,7 +28,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 26, 2009 +.Dd January 11, 2017 .Dt TTY 4 .Os .Sh NAME @@ -238,7 +238,16 @@ Start output on the terminal (like typin Make the terminal the controlling terminal for the process (the process must not currently have a controlling terminal). .It Dv TIOCDRAIN Fa void -Wait until all output is drained. +Wait until all output is drained, or until the drain wait timeout expires. +.It Dv TIOCGDRAINWAIT Fa int *timeout +Return the current drain wait timeout in seconds. +.It Dv TIOCSDRAINWAIT Fa int *timeout +Set the drain wait timeout in seconds. +A value of zero disables timeouts. +The default drain wait timeout is controlled by the tunable +.Xr sysctl 8 +OID +.Va kern.tty_drainwait . .It Dv TIOCEXCL Fa void Set exclusive use on the terminal. No further opens are permitted except by root. Modified: stable/11/sys/kern/tty.c ============================================================================== --- stable/11/sys/kern/tty.c Thu Mar 2 04:11:18 2017 (r314537) +++ stable/11/sys/kern/tty.c Thu Mar 2 04:23:53 2017 (r314538) @@ -95,64 +95,101 @@ static const char *dev_console_filename; #define TTY_CALLOUT(tp,d) (dev2unit(d) & TTYUNIT_CALLOUT) +static int tty_drainwait = 5 * 60; +SYSCTL_INT(_kern, OID_AUTO, tty_drainwait, CTLFLAG_RWTUN, + &tty_drainwait, 0, "Default output drain timeout in seconds"); + /* * Set TTY buffer sizes. */ #define TTYBUF_MAX 65536 -static void +/* + * Allocate buffer space if necessary, and set low watermarks, based on speed. + * Note that the ttyxxxq_setsize() functions may drop and then reacquire the tty + * lock during memory allocation. They will return ENXIO if the tty disappears + * while unlocked. + */ +static int tty_watermarks(struct tty *tp) { size_t bs = 0; + int error; - /* Provide an input buffer for 0.2 seconds of data. */ + /* Provide an input buffer for 2 seconds of data. */ if (tp->t_termios.c_cflag & CREAD) bs = MIN(tp->t_termios.c_ispeed / 5, TTYBUF_MAX); - ttyinq_setsize(&tp->t_inq, tp, bs); + error = ttyinq_setsize(&tp->t_inq, tp, bs); + if (error != 0) + return (error); /* Set low watermark at 10% (when 90% is available). */ tp->t_inlow = (ttyinq_getallocatedsize(&tp->t_inq) * 9) / 10; - /* Provide an output buffer for 0.2 seconds of data. */ + /* Provide an output buffer for 2 seconds of data. */ bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX); - ttyoutq_setsize(&tp->t_outq, tp, bs); + error = ttyoutq_setsize(&tp->t_outq, tp, bs); + if (error != 0) + return (error); /* Set low watermark at 10% (when 90% is available). */ tp->t_outlow = (ttyoutq_getallocatedsize(&tp->t_outq) * 9) / 10; + + return (0); } static int tty_drain(struct tty *tp, int leaving) { - size_t bytesused; + sbintime_t timeout_at; + size_t bytes; int error; if (ttyhook_hashook(tp, getc_inject)) /* buffer is inaccessible */ return (0); - while (ttyoutq_bytesused(&tp->t_outq) > 0 || ttydevsw_busy(tp)) { - ttydevsw_outwakeup(tp); - /* Could be handled synchronously. */ - bytesused = ttyoutq_bytesused(&tp->t_outq); - if (bytesused == 0 && !ttydevsw_busy(tp)) - return (0); - - /* Wait for data to be drained. */ - if (leaving) { - error = tty_timedwait(tp, &tp->t_outwait, hz); - if (error == EWOULDBLOCK && - ttyoutq_bytesused(&tp->t_outq) < bytesused) - error = 0; - } else - error = tty_wait(tp, &tp->t_outwait); + /* + * For close(), use the recent historic timeout of "1 second without + * making progress". For tcdrain(), use t_drainwait as the timeout, + * with zero meaning "no timeout" which gives POSIX behavior. + */ + if (leaving) + timeout_at = getsbinuptime() + SBT_1S; + else if (tp->t_drainwait != 0) + timeout_at = getsbinuptime() + SBT_1S * tp->t_drainwait; + else + timeout_at = 0; - if (error) + /* + * Poll the output buffer and the hardware for completion, at 10 Hz. + * Polling is required for devices which are not able to signal an + * interrupt when the transmitter becomes idle (most USB serial devs). + * The unusual structure of this loop ensures we check for busy one more + * time after tty_timedwait() returns EWOULDBLOCK, so that success has + * higher priority than timeout if the IO completed in the last 100mS. + */ + error = 0; + bytes = ttyoutq_bytesused(&tp->t_outq); + for (;;) { + if (ttyoutq_bytesused(&tp->t_outq) == 0 && !ttydevsw_busy(tp)) + return (0); + if (error != 0) + return (error); + ttydevsw_outwakeup(tp); + error = tty_timedwait(tp, &tp->t_outwait, hz / 10); + if (error != 0 && error != EWOULDBLOCK) return (error); + else if (timeout_at == 0 || getsbinuptime() < timeout_at) + error = 0; + else if (leaving && ttyoutq_bytesused(&tp->t_outq) < bytes) { + /* In close, making progress, grant an extra second. */ + error = 0; + timeout_at += SBT_1S; + bytes = ttyoutq_bytesused(&tp->t_outq); + } } - - return (0); } /* @@ -294,7 +331,9 @@ ttydev_open(struct cdev *dev, int oflags goto done; ttydisc_open(tp); - tty_watermarks(tp); /* XXXGL: drops lock */ + error = tty_watermarks(tp); + if (error != 0) + goto done; } /* Wait for Carrier Detect. */ @@ -1015,6 +1054,7 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo tp->t_devsw = tsw; tp->t_devswsoftc = sc; tp->t_flags = tsw->tsw_flags; + tp->t_drainwait = tty_drainwait; tty_init_termios(tp); @@ -1602,7 +1642,9 @@ tty_generic_ioctl(struct tty *tp, u_long tp->t_termios.c_ospeed = t->c_ospeed; /* Baud rate has changed - update watermarks. */ - tty_watermarks(tp); + error = tty_watermarks(tp); + if (error) + return (error); } /* Copy new non-device driver parameters. */ @@ -1755,6 +1797,14 @@ tty_generic_ioctl(struct tty *tp, u_long case TIOCDRAIN: /* Drain TTY output. */ return tty_drain(tp, 0); + case TIOCGDRAINWAIT: + *(int *)data = tp->t_drainwait; + return (0); + case TIOCSDRAINWAIT: + error = priv_check(td, PRIV_TTY_DRAINWAIT); + if (error == 0) + tp->t_drainwait = *(int *)data; + return (error); case TIOCCONS: /* Set terminal as console TTY. */ if (*(int *)data) { Modified: stable/11/sys/kern/tty_inq.c ============================================================================== --- stable/11/sys/kern/tty_inq.c Thu Mar 2 04:11:18 2017 (r314537) +++ stable/11/sys/kern/tty_inq.c Thu Mar 2 04:23:53 2017 (r314538) @@ -112,7 +112,7 @@ static uma_zone_t ttyinq_zone; TTYINQ_INSERT_TAIL(ti, tib); \ } while (0) -void +int ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t size) { struct ttyinq_block *tib; @@ -134,8 +134,14 @@ ttyinq_setsize(struct ttyinq *ti, struct tib = uma_zalloc(ttyinq_zone, M_WAITOK); tty_lock(tp); + if (tty_gone(tp)) { + uma_zfree(ttyinq_zone, tib); + return (ENXIO); + } + TTYINQ_INSERT_TAIL(ti, tib); } + return (0); } void Modified: stable/11/sys/kern/tty_outq.c ============================================================================== --- stable/11/sys/kern/tty_outq.c Thu Mar 2 04:11:18 2017 (r314537) +++ stable/11/sys/kern/tty_outq.c Thu Mar 2 04:23:53 2017 (r314538) @@ -89,7 +89,7 @@ ttyoutq_flush(struct ttyoutq *to) to->to_end = 0; } -void +int ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t size) { struct ttyoutq_block *tob; @@ -111,8 +111,14 @@ ttyoutq_setsize(struct ttyoutq *to, stru tob = uma_zalloc(ttyoutq_zone, M_WAITOK); tty_lock(tp); + if (tty_gone(tp)) { + uma_zfree(ttyoutq_zone, tob); + return (ENXIO); + } + TTYOUTQ_INSERT_TAIL(to, tob); } + return (0); } void Modified: stable/11/sys/sys/tty.h ============================================================================== --- stable/11/sys/sys/tty.h Thu Mar 2 04:11:18 2017 (r314537) +++ stable/11/sys/sys/tty.h Thu Mar 2 04:23:53 2017 (r314538) @@ -62,6 +62,7 @@ struct tty { struct mtx *t_mtx; /* TTY lock. */ struct mtx t_mtxobj; /* Per-TTY lock (when not borrowing). */ TAILQ_ENTRY(tty) t_list; /* (l) TTY list entry. */ + int t_drainwait; /* (t) TIOCDRAIN timeout seconds. */ unsigned int t_flags; /* (t) Terminal option flags. */ /* Keep flags in sync with db_show_tty and pstat(8). */ #define TF_NOPREFIX 0x00001 /* Don't prepend "tty" to device name. */ Modified: stable/11/sys/sys/ttyqueue.h ============================================================================== --- stable/11/sys/sys/ttyqueue.h Thu Mar 2 04:11:18 2017 (r314537) +++ stable/11/sys/sys/ttyqueue.h Thu Mar 2 04:23:53 2017 (r314538) @@ -69,7 +69,7 @@ struct ttyoutq { #ifdef _KERNEL /* Input queue handling routines. */ -void ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t len); +int ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t len); void ttyinq_free(struct ttyinq *ti); int ttyinq_read_uio(struct ttyinq *ti, struct tty *tp, struct uio *uio, size_t readlen, size_t flushlen); @@ -136,7 +136,7 @@ void ttyinq_line_iterate_from_reprintpos /* Output queue handling routines. */ void ttyoutq_flush(struct ttyoutq *to); -void ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t len); +int ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t len); void ttyoutq_free(struct ttyoutq *to); size_t ttyoutq_read(struct ttyoutq *to, void *buf, size_t len); int ttyoutq_read_uio(struct ttyoutq *to, struct tty *tp, struct uio *uio); From owner-svn-src-stable@freebsd.org Thu Mar 2 04:42:35 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27581CF57CA; Thu, 2 Mar 2017 04:42:35 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id 01C7E67D; Thu, 2 Mar 2017 04:42:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v224gYsN095039; Thu, 2 Mar 2017 04:42:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v224gXwG095036; Thu, 2 Mar 2017 04:42:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703020442.v224gXwG095036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 2 Mar 2017 04:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314539 - stable/11/sys/dev/usb/serial X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 04:42:35 -0000 Author: ian Date: Thu Mar 2 04:42:33 2017 New Revision: 314539 URL: https://svnweb.freebsd.org/changeset/base/314539 Log: MFC r313287: Add tsw_busy support to usb_serial (ucom). The tty layer uses tsw_busy to poll for busy/idle status of the transmitter hardware during close() and tcdrain(). The ucom layer defines ULSR_TXRDY and ULSR_TSRE bits for the line status register; when both are set, the transmitter is idle. Not all chip drivers maintain those bits in the sc_lsr field, and if the bits never get set the transmitter will always appear busy, causing hangs in tcdrain(). These changes add a new sc_flag bit, UCOM_FLAG_LSRTXIDLE. When this flag is set, ucom_busy() uses the lsr bits to return busy vs. idle state, otherwise it always returns idle (which is effectively what happened before this change because tsw_busy wasn't implemented). For the uftdi chip driver, these changes stop masking out the tx idle bits when processing the status register (because now they're useful), and it calls ucom_use_lsr_txbits() to indicate the bits are maintained by the driver and can be used by ucom_busy(). Modified: stable/11/sys/dev/usb/serial/uftdi.c stable/11/sys/dev/usb/serial/usb_serial.c stable/11/sys/dev/usb/serial/usb_serial.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/11/sys/dev/usb/serial/uftdi.c Thu Mar 2 04:23:53 2017 (r314538) +++ stable/11/sys/dev/usb/serial/uftdi.c Thu Mar 2 04:42:33 2017 (r314539) @@ -1123,6 +1123,9 @@ uftdi_attach(device_t dev) FTDI_SIO_SET_DATA_PARITY_NONE | FTDI_SIO_SET_DATA_BITS(8)); + /* Indicate tx bits in sc_lsr can be used to determine busy vs idle. */ + ucom_use_lsr_txbits(&sc->sc_ucom); + error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &uftdi_callback, &sc->sc_mtx); if (error) { @@ -1279,16 +1282,20 @@ uftdi_read_callback(struct usb_xfer *xfe offset = 0; /* * Extract packet headers and payload bytes from the buffer. - * Feed payload bytes to ucom/tty layer; OR-accumulate header - * status bits which are transient and could toggle with each - * packet. After processing all packets in the buffer, process - * the accumulated transient MSR and LSR values along with the + * Feed payload bytes to ucom/tty layer; OR-accumulate the + * receiver-related header status bits which are transient and + * could toggle with each packet, but for transmitter-related + * bits keep only the ones from the last packet. + * + * After processing all packets in the buffer, process the + * accumulated transient MSR and LSR values along with the * non-transient bits from the last packet header. */ while (buflen >= UFTDI_IHDRSIZE) { usbd_copy_out(pc, offset, buf, UFTDI_IHDRSIZE); offset += UFTDI_IHDRSIZE; buflen -= UFTDI_IHDRSIZE; + lsr &= ~(ULSR_TXRDY | ULSR_TSRE); lsr |= FTDI_GET_LSR(buf); if (FTDI_GET_MSR(buf) & FTDI_SIO_RI_MASK) msr |= SER_RI; @@ -1311,8 +1318,7 @@ uftdi_read_callback(struct usb_xfer *xfe if (ftdi_msr & FTDI_SIO_RLSD_MASK) msr |= SER_DCD; - if ((sc->sc_msr != msr) || - ((sc->sc_lsr & FTDI_LSR_MASK) != (lsr & FTDI_LSR_MASK))) { + if (sc->sc_msr != msr || sc->sc_lsr != lsr) { DPRINTF("status change msr=0x%02x (0x%02x) " "lsr=0x%02x (0x%02x)\n", msr, sc->sc_msr, lsr, sc->sc_lsr); Modified: stable/11/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/11/sys/dev/usb/serial/usb_serial.c Thu Mar 2 04:23:53 2017 (r314538) +++ stable/11/sys/dev/usb/serial/usb_serial.c Thu Mar 2 04:42:33 2017 (r314539) @@ -162,6 +162,7 @@ static tsw_param_t ucom_param; static tsw_outwakeup_t ucom_outwakeup; static tsw_inwakeup_t ucom_inwakeup; static tsw_free_t ucom_free; +static tsw_busy_t ucom_busy; static struct ttydevsw ucom_class = { .tsw_flags = TF_INITLOCK | TF_CALLOUT, @@ -173,6 +174,7 @@ static struct ttydevsw ucom_class = { .tsw_param = ucom_param, .tsw_modem = ucom_modem, .tsw_free = ucom_free, + .tsw_busy = ucom_busy, }; MODULE_DEPEND(ucom, usb, 1, 1, 1); @@ -1295,6 +1297,27 @@ ucom_outwakeup(struct tty *tp) ucom_start_transfers(sc); } +static bool +ucom_busy(struct tty *tp) +{ + struct ucom_softc *sc = tty_softc(tp); + const uint8_t txidle = ULSR_TXRDY | ULSR_TSRE; + + UCOM_MTX_ASSERT(sc, MA_OWNED); + + DPRINTFN(3, "sc = %p lsr 0x%02x\n", sc, sc->sc_lsr); + + /* + * If the driver maintains the txidle bits in LSR, we can use them to + * determine whether the transmitter is busy or idle. Otherwise we have + * to assume it is idle to avoid hanging forever on tcdrain(3). + */ + if (sc->sc_flag & UCOM_FLAG_LSRTXIDLE) + return ((sc->sc_lsr & txidle) != txidle); + else + return (false); +} + /*------------------------------------------------------------------------* * ucom_get_data * Modified: stable/11/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/11/sys/dev/usb/serial/usb_serial.h Thu Mar 2 04:23:53 2017 (r314538) +++ stable/11/sys/dev/usb/serial/usb_serial.h Thu Mar 2 04:42:33 2017 (r314539) @@ -180,6 +180,7 @@ struct ucom_softc { #define UCOM_FLAG_WAIT_REFS 0x0100 /* set if we must wait for refs */ #define UCOM_FLAG_FREE_UNIT 0x0200 /* set if we must free the unit */ #define UCOM_FLAG_INWAKEUP 0x0400 /* set if we are in the tsw_inwakeup callback */ +#define UCOM_FLAG_LSRTXIDLE 0x0800 /* set if sc_lsr bits ULSR_TSRE+TXRDY work */ uint8_t sc_lsr; uint8_t sc_msr; uint8_t sc_mcr; @@ -218,4 +219,12 @@ void ucom_drain(struct ucom_super_softc void ucom_drain_all(void *); void ucom_ref(struct ucom_super_softc *); int ucom_unref(struct ucom_super_softc *); + +static inline void +ucom_use_lsr_txbits(struct ucom_softc *sc) +{ + + sc->sc_flag |= UCOM_FLAG_LSRTXIDLE; +} + #endif /* _USB_SERIAL_H_ */ From owner-svn-src-stable@freebsd.org Thu Mar 2 04:55:55 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8FFECF5CA8; Thu, 2 Mar 2017 04:55:55 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id B5675CCC; Thu, 2 Mar 2017 04:55:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v224tsHQ099009; Thu, 2 Mar 2017 04:55:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v224tstC099008; Thu, 2 Mar 2017 04:55:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201703020455.v224tstC099008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 2 Mar 2017 04:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314540 - stable/11/sys/arm/freescale/imx X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 04:55:56 -0000 Author: ian Date: Thu Mar 2 04:55:54 2017 New Revision: 314540 URL: https://svnweb.freebsd.org/changeset/base/314540 Log: MFC r312679: Handle imx6 erratum ERR004346... to reboot, clear the SRS bit twice within the same cycle of the 32khz clock. I've never actually noticed this error happening, but it's an easy fix. Modified: stable/11/sys/arm/freescale/imx/imx_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx_machdep.c Thu Mar 2 04:42:33 2017 (r314539) +++ stable/11/sys/arm/freescale/imx/imx_machdep.c Thu Mar 2 04:55:54 2017 (r314540) @@ -69,11 +69,18 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_phys * Trigger an immediate reset by clearing the SRS bit in the watchdog * control register. The reset happens on the next cycle of the wdog * 32KHz clock, so hang out in a spin loop until the reset takes effect. + * + * Imx6 erratum ERR004346 says the SRS bit has to be cleared twice + * within the same cycle of the 32khz clock to reliably trigger the + * reset. Writing it 3 times in a row ensures at least 2 of the writes + * happen in the same 32k clock cycle. */ if ((pcr = devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) { printf("cpu_reset() can't find its control register... locking up now."); } else { *pcr &= ~WDOG_CR_SRS; + *pcr &= ~WDOG_CR_SRS; + *pcr &= ~WDOG_CR_SRS; } for (;;) continue; From owner-svn-src-stable@freebsd.org Thu Mar 2 09:10:41 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FAC1CF56E8; Thu, 2 Mar 2017 09:10:41 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 2089C27A; Thu, 2 Mar 2017 09:10:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v229AeAa097217; Thu, 2 Mar 2017 09:10:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v229Aewu097214; Thu, 2 Mar 2017 09:10:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703020910.v229Aewu097214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 2 Mar 2017 09:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314550 - stable/10/sys/crypto/sha2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 09:10:41 -0000 Author: avg Date: Thu Mar 2 09:10:39 2017 New Revision: 314550 URL: https://svnweb.freebsd.org/changeset/base/314550 Log: Fix r314332 (MFC of r300903): do not use C99 Static array indices The proper conditional support for that feature has not been MFC-ed yet and GCC is quirky about it. See r314101. This is a direct commit. Reported by: gjb Modified: stable/10/sys/crypto/sha2/sha512c.c stable/10/sys/crypto/sha2/sha512t.h Modified: stable/10/sys/crypto/sha2/sha512c.c ============================================================================== --- stable/10/sys/crypto/sha2/sha512c.c Thu Mar 2 07:55:47 2017 (r314549) +++ stable/10/sys/crypto/sha2/sha512c.c Thu Mar 2 09:10:39 2017 (r314550) @@ -364,7 +364,7 @@ SHA512_224_Update(SHA512_CTX * ctx, cons } void -SHA512_224_Final(unsigned char digest[static SHA512_224_DIGEST_LENGTH], SHA512_CTX * ctx) +SHA512_224_Final(unsigned char digest[SHA512_224_DIGEST_LENGTH], SHA512_CTX * ctx) { /* Add padding */ @@ -403,7 +403,7 @@ SHA512_256_Update(SHA512_CTX * ctx, cons } void -SHA512_256_Final(unsigned char digest[static SHA512_256_DIGEST_LENGTH], SHA512_CTX * ctx) +SHA512_256_Final(unsigned char digest[SHA512_256_DIGEST_LENGTH], SHA512_CTX * ctx) { /* Add padding */ Modified: stable/10/sys/crypto/sha2/sha512t.h ============================================================================== --- stable/10/sys/crypto/sha2/sha512t.h Thu Mar 2 07:55:47 2017 (r314549) +++ stable/10/sys/crypto/sha2/sha512t.h Thu Mar 2 09:10:39 2017 (r314550) @@ -103,7 +103,7 @@ __BEGIN_DECLS void SHA512_224_Init(SHA512_CTX *); void SHA512_224_Update(SHA512_CTX *, const void *, size_t); -void SHA512_224_Final(unsigned char [static SHA512_224_DIGEST_LENGTH], SHA512_CTX *); +void SHA512_224_Final(unsigned char [SHA512_224_DIGEST_LENGTH], SHA512_CTX *); #ifndef _KERNEL char *SHA512_224_End(SHA512_CTX *, char *); char *SHA512_224_Data(const void *, unsigned int, char *); @@ -112,7 +112,7 @@ char *SHA512_224_FileChunk(const char #endif void SHA512_256_Init(SHA512_CTX *); void SHA512_256_Update(SHA512_CTX *, const void *, size_t); -void SHA512_256_Final(unsigned char [static SHA512_256_DIGEST_LENGTH], SHA512_CTX *); +void SHA512_256_Final(unsigned char [SHA512_256_DIGEST_LENGTH], SHA512_CTX *); #ifndef _KERNEL char *SHA512_256_End(SHA512_CTX *, char *); char *SHA512_256_Data(const void *, unsigned int, char *); From owner-svn-src-stable@freebsd.org Thu Mar 2 10:43:43 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D69C6CF549C; Thu, 2 Mar 2017 10:43:43 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 97D0E1A5; Thu, 2 Mar 2017 10:43:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v22Ahguh036481; Thu, 2 Mar 2017 10:43:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v22Ahgde036480; Thu, 2 Mar 2017 10:43:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703021043.v22Ahgde036480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 2 Mar 2017 10:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314551 - stable/11/sys/dev/chromebook_platform X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 10:43:44 -0000 Author: avg Date: Thu Mar 2 10:43:42 2017 New Revision: 314551 URL: https://svnweb.freebsd.org/changeset/base/314551 Log: MFC r314271: chromebook_platform: catch up with ig4iic -> ig4iic_pci in r310621 It was MFC-ed as r311809. Modified: stable/11/sys/dev/chromebook_platform/chromebook_platform.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/chromebook_platform/chromebook_platform.c ============================================================================== --- stable/11/sys/dev/chromebook_platform/chromebook_platform.c Thu Mar 2 09:10:39 2017 (r314550) +++ stable/11/sys/dev/chromebook_platform/chromebook_platform.c Thu Mar 2 10:43:42 2017 (r314551) @@ -69,7 +69,7 @@ chromebook_i2c_identify(driver_t *driver * See http://lxr.free-electrons.com/source/drivers/platform/chrome/chromeos_laptop.c */ controller = device_get_parent(bus); - if (strcmp(device_get_name(controller), "ig4iic") != 0) + if (strcmp(device_get_name(controller), "ig4iic_pci") != 0) return; for (i = 0; i < nitems(slaves); i++) { From owner-svn-src-stable@freebsd.org Thu Mar 2 10:44:58 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BE25CF5547; Thu, 2 Mar 2017 10:44:58 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 2B30F322; Thu, 2 Mar 2017 10:44:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v22AivQ3036597; Thu, 2 Mar 2017 10:44:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v22AivNB036596; Thu, 2 Mar 2017 10:44:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703021044.v22AivNB036596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 2 Mar 2017 10:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314552 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 10:44:58 -0000 Author: avg Date: Thu Mar 2 10:44:57 2017 New Revision: 314552 URL: https://svnweb.freebsd.org/changeset/base/314552 Log: MFC r314268: add chromebook_platform.4 to the list of manual pages Modified: stable/11/share/man/man4/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Thu Mar 2 10:43:42 2017 (r314551) +++ stable/11/share/man/man4/Makefile Thu Mar 2 10:44:57 2017 (r314552) @@ -103,6 +103,7 @@ MAN= aac.4 \ cdce.4 \ cfi.4 \ ch.4 \ + chromebook_platform.4 \ ciss.4 \ cloudabi.4 \ cm.4 \ From owner-svn-src-stable@freebsd.org Thu Mar 2 17:17:07 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE506CF5FB0; Thu, 2 Mar 2017 17:17:07 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 7AF13809; Thu, 2 Mar 2017 17:17:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v22HH6PO092019; Thu, 2 Mar 2017 17:17:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v22HH6Nv092018; Thu, 2 Mar 2017 17:17:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703021717.v22HH6Nv092018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 2 Mar 2017 17:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314560 - stable/10/contrib/tcpdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 17:17:07 -0000 Author: emaste Date: Thu Mar 2 17:17:06 2017 New Revision: 314560 URL: https://svnweb.freebsd.org/changeset/base/314560 Log: MFC r309649 (oshogbo): tcpdump: allow to use BIOCROTZBUF in capability mode The libpcap library can use a BIOCROTZBUF ioctl when net.bpf.zerocopy_enable sysctl is set. PR: 217490 Modified: stable/10/contrib/tcpdump/tcpdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/10/contrib/tcpdump/tcpdump.c Thu Mar 2 17:09:14 2017 (r314559) +++ stable/10/contrib/tcpdump/tcpdump.c Thu Mar 2 17:17:06 2017 (r314560) @@ -1554,7 +1554,7 @@ main(int argc, char **argv) error("%s", pcap_geterr(pd)); #ifdef __FreeBSD__ if (RFileName == NULL && VFileName == NULL) { - static const unsigned long cmds[] = { BIOCGSTATS }; + static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF }; /* * The various libpcap devices use a combination of From owner-svn-src-stable@freebsd.org Thu Mar 2 22:43:01 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFD96CF697E; Thu, 2 Mar 2017 22:43:00 +0000 (UTC) (envelope-from gonzo@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 mx1.freebsd.org (Postfix) with ESMTPS id B92211E9E; Thu, 2 Mar 2017 22:43:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v22MgxOE026124; Thu, 2 Mar 2017 22:42:59 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v22MgxIP026122; Thu, 2 Mar 2017 22:42:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201703022242.v22MgxIP026122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 2 Mar 2017 22:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314569 - in stable/11/sys/modules: bytgpio intelspi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 22:43:01 -0000 Author: gonzo Date: Thu Mar 2 22:42:59 2017 New Revision: 314569 URL: https://svnweb.freebsd.org/changeset/base/314569 Log: MFC r314535: [intelspi][bytgio] Fix buildworld with MODULES_WITH_WORLD set Add opt_platform.h and opt_acpi.h to the dependencies so modules can be built as a part of buildworld when MODULES_WITH_WORLD is set Reported by: Andre Albsmeier (for 11-stable) Modified: stable/11/sys/modules/bytgpio/Makefile stable/11/sys/modules/intelspi/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/bytgpio/Makefile ============================================================================== --- stable/11/sys/modules/bytgpio/Makefile Thu Mar 2 22:17:53 2017 (r314568) +++ stable/11/sys/modules/bytgpio/Makefile Thu Mar 2 22:42:59 2017 (r314569) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/gpio KMOD= bytgpio SRCS= bytgpio.c -SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h +SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h opt_acpi.h opt_platform.h .include Modified: stable/11/sys/modules/intelspi/Makefile ============================================================================== --- stable/11/sys/modules/intelspi/Makefile Thu Mar 2 22:17:53 2017 (r314568) +++ stable/11/sys/modules/intelspi/Makefile Thu Mar 2 22:42:59 2017 (r314569) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/intel KMOD= intelspi SRCS= spi.c -SRCS+= acpi_if.h device_if.h bus_if.h spibus_if.h +SRCS+= acpi_if.h device_if.h bus_if.h opt_acpi.h spibus_if.h .include From owner-svn-src-stable@freebsd.org Fri Mar 3 00:39:31 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30222CF50C5; Fri, 3 Mar 2017 00:39:31 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 081841AFD; Fri, 3 Mar 2017 00:39:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v230dU2U070798; Fri, 3 Mar 2017 00:39:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v230dTug070794; Fri, 3 Mar 2017 00:39:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703030039.v230dTug070794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 3 Mar 2017 00:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314573 - in stable/11: contrib/binutils/gas/config contrib/gcc/config/mips gnu/usr.bin/cc/cc_tools X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 00:39:31 -0000 Author: emaste Date: Fri Mar 3 00:39:29 2017 New Revision: 314573 URL: https://svnweb.freebsd.org/changeset/base/314573 Log: MFC r312899: add octeon+ as an alias for octeon in GCC & binutils r208737 added support for the "mips64r2" architecture and "octeon" CPU, and the saa/saad instructions. Upstream binutils also added the "octeon+" CPU, and the saa/saad instructions are only available in octeon+, not octeon. Since our base system tool chain already accepts saa/saad with -march=octeon, just allow octeon+ as an alias. This allows the use of octeon+ in kernel config files, for use with both external tool chain and in-tree GCC/binutils. Also includes GCC FBSD_CC_VER bump (r313041 in HEAD) PR: 216516 Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/binutils/gas/config/tc-mips.c stable/11/contrib/gcc/config/mips/mips.c stable/11/contrib/gcc/config/mips/mips.h stable/11/gnu/usr.bin/cc/cc_tools/freebsd-native.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- stable/11/contrib/binutils/gas/config/tc-mips.c Thu Mar 2 23:23:28 2017 (r314572) +++ stable/11/contrib/binutils/gas/config/tc-mips.c Fri Mar 3 00:39:29 2017 (r314573) @@ -15156,6 +15156,7 @@ static const struct mips_cpu_info mips_c /* Cavium Networks Octeon CPU core */ { "octeon", 0, ISA_MIPS64R2, CPU_OCTEON }, + { "octeon+", 0, ISA_MIPS64R2, CPU_OCTEON }, /* End marker */ { NULL, 0, 0, 0 } Modified: stable/11/contrib/gcc/config/mips/mips.c ============================================================================== --- stable/11/contrib/gcc/config/mips/mips.c Thu Mar 2 23:23:28 2017 (r314572) +++ stable/11/contrib/gcc/config/mips/mips.c Fri Mar 3 00:39:29 2017 (r314573) @@ -765,6 +765,7 @@ const struct mips_cpu_info mips_cpu_info /* MIPS64R2 */ { "octeon", PROCESSOR_OCTEON, 65 }, + { "octeon+", PROCESSOR_OCTEON, 65 }, /* End marker */ { 0, 0, 0 } Modified: stable/11/contrib/gcc/config/mips/mips.h ============================================================================== --- stable/11/contrib/gcc/config/mips/mips.h Thu Mar 2 23:23:28 2017 (r314572) +++ stable/11/contrib/gcc/config/mips/mips.h Fri Mar 3 00:39:29 2017 (r314573) @@ -285,7 +285,10 @@ extern const struct mips_rtx_cost_data * \ macro = concat ((PREFIX), "_", (INFO)->name, NULL); \ for (p = macro; *p != 0; p++) \ - *p = TOUPPER (*p); \ + if (*p == '+') \ + *p = 'P'; \ + else \ + *p = TOUPPER (*p); \ \ builtin_define (macro); \ builtin_define_with_value ((PREFIX), (INFO)->name, 1); \ Modified: stable/11/gnu/usr.bin/cc/cc_tools/freebsd-native.h ============================================================================== --- stable/11/gnu/usr.bin/cc/cc_tools/freebsd-native.h Thu Mar 2 23:23:28 2017 (r314572) +++ stable/11/gnu/usr.bin/cc/cc_tools/freebsd-native.h Fri Mar 3 00:39:29 2017 (r314573) @@ -8,7 +8,7 @@ /* Fake out gcc/config/freebsd.h. */ #define FBSD_MAJOR 11 -#define FBSD_CC_VER 1100002 /* form like __FreeBSD_version */ +#define FBSD_CC_VER 1100003 /* form like __FreeBSD_version */ #undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */ #undef TOOL_INCLUDE_DIR /* We don't need one for now. */ From owner-svn-src-stable@freebsd.org Fri Mar 3 00:47:44 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 116E1CF5314; Fri, 3 Mar 2017 00:47:44 +0000 (UTC) (envelope-from avos@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 mx1.freebsd.org (Postfix) with ESMTPS id C50001F50; Fri, 3 Mar 2017 00:47:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v230lgKP074667; Fri, 3 Mar 2017 00:47:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v230lgQY074666; Fri, 3 Mar 2017 00:47:42 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703030047.v230lgQY074666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 3 Mar 2017 00:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314574 - stable/11/sys/dev/iwn X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 00:47:44 -0000 Author: avos Date: Fri Mar 3 00:47:42 2017 New Revision: 314574 URL: https://svnweb.freebsd.org/changeset/base/314574 Log: MFC r314287: iwn: stop all watchdogs on device shutdown. Tested with Intel 6205, STA mode. Modified: stable/11/sys/dev/iwn/if_iwn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/11/sys/dev/iwn/if_iwn.c Fri Mar 3 00:39:29 2017 (r314573) +++ stable/11/sys/dev/iwn/if_iwn.c Fri Mar 3 00:47:42 2017 (r314574) @@ -8828,6 +8828,7 @@ iwn_stop_locked(struct iwn_softc *sc) sc->sc_is_scanning = 0; sc->sc_tx_timer = 0; callout_stop(&sc->watchdog_to); + callout_stop(&sc->scan_timeout); callout_stop(&sc->calib_to); sc->sc_flags &= ~IWN_FLAG_RUNNING; From owner-svn-src-stable@freebsd.org Fri Mar 3 06:02:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67FB9CF6F11; Fri, 3 Mar 2017 06:02:28 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 34C69168E; Fri, 3 Mar 2017 06:02:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2362RSe005892; Fri, 3 Mar 2017 06:02:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2362RUg005891; Fri, 3 Mar 2017 06:02:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703030602.v2362RUg005891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 Mar 2017 06:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314580 - stable/11/sys/dev/iscsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 06:02:28 -0000 Author: mav Date: Fri Mar 3 06:02:27 2017 New Revision: 314580 URL: https://svnweb.freebsd.org/changeset/base/314580 Log: MFC r313851: Fix tight loop spinning on postponed requests. Modified: stable/11/sys/dev/iscsi/iscsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/11/sys/dev/iscsi/iscsi.c Fri Mar 3 03:11:58 2017 (r314579) +++ stable/11/sys/dev/iscsi/iscsi.c Fri Mar 3 06:02:27 2017 (r314580) @@ -475,15 +475,14 @@ iscsi_maintenance_thread_terminate(struc static void iscsi_maintenance_thread(void *arg) { - struct iscsi_session *is; - - is = arg; + struct iscsi_session *is = arg; + ISCSI_SESSION_LOCK(is); for (;;) { - ISCSI_SESSION_LOCK(is); if (is->is_reconnecting == false && is->is_terminating == false && - STAILQ_EMPTY(&is->is_postponed)) + (STAILQ_EMPTY(&is->is_postponed) || + ISCSI_SNGT(is->is_cmdsn, is->is_maxcmdsn))) cv_wait(&is->is_maintenance_cv, &is->is_lock); /* Terminate supersedes reconnect. */ @@ -497,12 +496,13 @@ iscsi_maintenance_thread(void *arg) if (is->is_reconnecting) { ISCSI_SESSION_UNLOCK(is); iscsi_maintenance_thread_reconnect(is); + ISCSI_SESSION_LOCK(is); continue; } iscsi_session_send_postponed(is); - ISCSI_SESSION_UNLOCK(is); } + ISCSI_SESSION_UNLOCK(is); } static void From owner-svn-src-stable@freebsd.org Fri Mar 3 06:03:02 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E12ACF6F73; Fri, 3 Mar 2017 06:03:02 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 4AD3417E1; Fri, 3 Mar 2017 06:03:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23631xW005971; Fri, 3 Mar 2017 06:03:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23631Vq005970; Fri, 3 Mar 2017 06:03:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703030603.v23631Vq005970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 Mar 2017 06:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314581 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 06:03:02 -0000 Author: mav Date: Fri Mar 3 06:03:01 2017 New Revision: 314581 URL: https://svnweb.freebsd.org/changeset/base/314581 Log: MFC r313851: Fix tight loop spinning on postponed requests. Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Fri Mar 3 06:02:27 2017 (r314580) +++ stable/10/sys/dev/iscsi/iscsi.c Fri Mar 3 06:03:01 2017 (r314581) @@ -470,15 +470,14 @@ iscsi_maintenance_thread_terminate(struc static void iscsi_maintenance_thread(void *arg) { - struct iscsi_session *is; - - is = arg; + struct iscsi_session *is = arg; + ISCSI_SESSION_LOCK(is); for (;;) { - ISCSI_SESSION_LOCK(is); if (is->is_reconnecting == false && is->is_terminating == false && - STAILQ_EMPTY(&is->is_postponed)) + (STAILQ_EMPTY(&is->is_postponed) || + ISCSI_SNGT(is->is_cmdsn, is->is_maxcmdsn))) cv_wait(&is->is_maintenance_cv, &is->is_lock); /* Terminate supersedes reconnect. */ @@ -492,12 +491,13 @@ iscsi_maintenance_thread(void *arg) if (is->is_reconnecting) { ISCSI_SESSION_UNLOCK(is); iscsi_maintenance_thread_reconnect(is); + ISCSI_SESSION_LOCK(is); continue; } iscsi_session_send_postponed(is); - ISCSI_SESSION_UNLOCK(is); } + ISCSI_SESSION_UNLOCK(is); } static void From owner-svn-src-stable@freebsd.org Fri Mar 3 06:04:04 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83E43CF6FDF; Fri, 3 Mar 2017 06:04:04 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 36BEE1939; Fri, 3 Mar 2017 06:04:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23643Z5006060; Fri, 3 Mar 2017 06:04:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23643Yi006059; Fri, 3 Mar 2017 06:04:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703030604.v23643Yi006059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 Mar 2017 06:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314582 - stable/11/sys/dev/iscsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 06:04:04 -0000 Author: mav Date: Fri Mar 3 06:04:03 2017 New Revision: 314582 URL: https://svnweb.freebsd.org/changeset/base/314582 Log: MFC r313852: Freeze CAM SIM when request is postponed due to MaxCmdSN. This allows to avoid resource allocation (especially offload) for requests that can not be executed at this time any way. Modified: stable/11/sys/dev/iscsi/iscsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/11/sys/dev/iscsi/iscsi.c Fri Mar 3 06:03:01 2017 (r314581) +++ stable/11/sys/dev/iscsi/iscsi.c Fri Mar 3 06:04:03 2017 (r314582) @@ -231,14 +231,16 @@ iscsi_session_send_postponed(struct iscs ISCSI_SESSION_LOCK_ASSERT(is); - while (!STAILQ_EMPTY(&is->is_postponed)) { - request = STAILQ_FIRST(&is->is_postponed); + if (STAILQ_EMPTY(&is->is_postponed)) + return; + while ((request = STAILQ_FIRST(&is->is_postponed)) != NULL) { postpone = iscsi_pdu_prepare(request); if (postpone) - break; + return; STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_queue(request); } + xpt_release_simq(is->is_sim, 1); } static void @@ -252,6 +254,8 @@ iscsi_pdu_queue_locked(struct icl_pdu *r iscsi_session_send_postponed(is); postpone = iscsi_pdu_prepare(request); if (postpone) { + if (STAILQ_EMPTY(&is->is_postponed)) + xpt_freeze_simq(is->is_sim, 1); STAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next); return; } @@ -339,8 +343,9 @@ iscsi_session_cleanup(struct iscsi_sessi /* * Remove postponed PDUs. */ - while (!STAILQ_EMPTY(&is->is_postponed)) { - pdu = STAILQ_FIRST(&is->is_postponed); + if (!STAILQ_EMPTY(&is->is_postponed)) + xpt_release_simq(is->is_sim, 1); + while ((pdu = STAILQ_FIRST(&is->is_postponed)) != NULL) { STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_free(pdu); } From owner-svn-src-stable@freebsd.org Fri Mar 3 06:04:43 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C51ACF406A; Fri, 3 Mar 2017 06:04:43 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 2E8641A99; Fri, 3 Mar 2017 06:04:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2364g49006137; Fri, 3 Mar 2017 06:04:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2364gXp006136; Fri, 3 Mar 2017 06:04:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703030604.v2364gXp006136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 Mar 2017 06:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314583 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 06:04:43 -0000 Author: mav Date: Fri Mar 3 06:04:42 2017 New Revision: 314583 URL: https://svnweb.freebsd.org/changeset/base/314583 Log: MFC r313852: Freeze CAM SIM when request is postponed due to MaxCmdSN. This allows to avoid resource allocation (especially offload) for requests that can not be executed at this time any way. Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Fri Mar 3 06:04:03 2017 (r314582) +++ stable/10/sys/dev/iscsi/iscsi.c Fri Mar 3 06:04:42 2017 (r314583) @@ -233,14 +233,16 @@ iscsi_session_send_postponed(struct iscs ISCSI_SESSION_LOCK_ASSERT(is); - while (!STAILQ_EMPTY(&is->is_postponed)) { - request = STAILQ_FIRST(&is->is_postponed); + if (STAILQ_EMPTY(&is->is_postponed)) + return; + while ((request = STAILQ_FIRST(&is->is_postponed)) != NULL) { postpone = iscsi_pdu_prepare(request); if (postpone) - break; + return; STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_queue(request); } + xpt_release_simq(is->is_sim, 1); } static void @@ -254,6 +256,8 @@ iscsi_pdu_queue_locked(struct icl_pdu *r iscsi_session_send_postponed(is); postpone = iscsi_pdu_prepare(request); if (postpone) { + if (STAILQ_EMPTY(&is->is_postponed)) + xpt_freeze_simq(is->is_sim, 1); STAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next); return; } @@ -339,8 +343,9 @@ iscsi_session_cleanup(struct iscsi_sessi /* * Remove postponed PDUs. */ - while (!STAILQ_EMPTY(&is->is_postponed)) { - pdu = STAILQ_FIRST(&is->is_postponed); + if (!STAILQ_EMPTY(&is->is_postponed)) + xpt_release_simq(is->is_sim, 1); + while ((pdu = STAILQ_FIRST(&is->is_postponed)) != NULL) { STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_free(pdu); } From owner-svn-src-stable@freebsd.org Fri Mar 3 06:06:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8D66CF40FE; Fri, 3 Mar 2017 06:06:28 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id A0D401DAC; Fri, 3 Mar 2017 06:06:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2366Rlh006265; Fri, 3 Mar 2017 06:06:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2366Rkm006263; Fri, 3 Mar 2017 06:06:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703030606.v2366Rkm006263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 Mar 2017 06:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314584 - in stable/11: share/man/man4 sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 06:06:28 -0000 Author: mav Date: Fri Mar 3 06:06:27 2017 New Revision: 314584 URL: https://svnweb.freebsd.org/changeset/base/314584 Log: MFC r313854, r313963: Change the way MaxCmdSN is used. Before this change MaxCmdSN was reported as CmdSN + delta, that made it limit number of requests in transmission from the initiator to target, that was pretty useless. After this change MaxCmdSN limits number of requests queued to CTL, i.e. maximal queue depth for the initiator. The default limit is 256 outstanding requests per initiator at a time. This code uses existing cs_outstanding_ctl_pdus counter to track queue depth. It's semantics doen't perfectly match, but close enough to not add another counter. Just don't set the maxtags below 2. Modified: stable/11/share/man/man4/ctl.4 stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ctl.4 ============================================================================== --- stable/11/share/man/man4/ctl.4 Fri Mar 3 06:04:42 2017 (r314583) +++ stable/11/share/man/man4/ctl.4 Fri Mar 3 06:06:27 2017 (r314584) @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 27, 2015 +.Dd January 19, 2017 .Dt CTL 4 .Os .Sh NAME @@ -158,10 +158,9 @@ Verbosity level for log messages from th Set to 0 to disable logging or 1 to warn about potential problems. Larger values enable debugging output. Defaults to 1. -.It Va kern.cam.ctl.iscsi.maxcmdsn_delta -The number of outstanding commands to advertise to the iSCSI initiator. -Technically, it is the difference between ExpCmdSN and MaxCmdSN fields -in the iSCSI PDU. +.It Va kern.cam.ctl.iscsi.maxtags +The number of outstanding commands to advertise to each iSCSI initiator. +Current implementation is not very accurate, so do not set this below 2. Defaults to 256. .It Va kern.cam.ctl.iscsi.ping_timeout The number of seconds to wait for the iSCSI initiator to respond to a NOP-In Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Fri Mar 3 06:04:42 2017 (r314583) +++ stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Fri Mar 3 06:06:27 2017 (r314584) @@ -95,10 +95,9 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO static int login_timeout = 60; SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds"); -static int maxcmdsn_delta = 256; -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN, - &maxcmdsn_delta, 256, "Number of commands the initiator can send " - "without confirmation"); +static int maxtags = 256; +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, + &maxtags, 0, "Max number of requests queued by initiator"); #define CFISCSI_DEBUG(X, ...) \ do { \ @@ -244,7 +243,7 @@ cfiscsi_pdu_update_cmdsn(const struct ic * outside of this range. */ if (ISCSI_SNLT(cmdsn, cs->cs_cmdsn) || - ISCSI_SNGT(cmdsn, cs->cs_cmdsn + maxcmdsn_delta)) { + ISCSI_SNGT(cmdsn, cs->cs_cmdsn - 1 + maxtags)) { CFISCSI_SESSION_UNLOCK(cs); CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " "while expected %u", cmdsn, cs->cs_cmdsn); @@ -399,7 +398,8 @@ cfiscsi_pdu_prepare(struct icl_pdu *resp (bhssr->bhssr_flags & BHSDI_FLAGS_S)) bhssr->bhssr_statsn = htonl(cs->cs_statsn); bhssr->bhssr_expcmdsn = htonl(cs->cs_cmdsn); - bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn + maxcmdsn_delta); + bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn - 1 + + imax(0, maxtags - cs->cs_outstanding_ctl_pdus)); if (advance_statsn) cs->cs_statsn++; From owner-svn-src-stable@freebsd.org Fri Mar 3 10:02:58 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01507CF5D52; Fri, 3 Mar 2017 10:02:58 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id C4D9F1048; Fri, 3 Mar 2017 10:02:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23A2usL004955; Fri, 3 Mar 2017 10:02:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23A2uFr004954; Fri, 3 Mar 2017 10:02:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703031002.v23A2uFr004954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Mar 2017 10:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314589 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 10:02:58 -0000 Author: kib Date: Fri Mar 3 10:02:56 2017 New Revision: 314589 URL: https://svnweb.freebsd.org/changeset/base/314589 Log: MFC r314195: Properly handle possible underflow in vm_fault_prefault(). Modified: stable/11/sys/vm/vm_fault.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Fri Mar 3 08:13:45 2017 (r314588) +++ stable/11/sys/vm/vm_fault.c Fri Mar 3 10:02:56 2017 (r314589) @@ -1372,11 +1372,12 @@ vm_fault_prefault(const struct faultstat entry = fs->entry; - starta = addra - backward * PAGE_SIZE; - if (starta < entry->start) { + if (addra < backward * PAGE_SIZE) { starta = entry->start; - } else if (starta > addra) { - starta = 0; + } else { + starta = addra - backward * PAGE_SIZE; + if (starta < entry->start) + starta = entry->start; } /* From owner-svn-src-stable@freebsd.org Fri Mar 3 10:17:17 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CC57CF6103; Fri, 3 Mar 2017 10:17:17 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 651FD17AB; Fri, 3 Mar 2017 10:17:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23AHGnw009505; Fri, 3 Mar 2017 10:17:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23AHGn2009504; Fri, 3 Mar 2017 10:17:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703031017.v23AHGn2009504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Mar 2017 10:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314590 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 10:17:17 -0000 Author: kib Date: Fri Mar 3 10:17:16 2017 New Revision: 314590 URL: https://svnweb.freebsd.org/changeset/base/314590 Log: MFC r314195: Properly handle possible underflow in vm_fault_prefault(). Modified: stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Fri Mar 3 10:02:56 2017 (r314589) +++ stable/10/sys/vm/vm_fault.c Fri Mar 3 10:17:16 2017 (r314590) @@ -1140,11 +1140,12 @@ vm_fault_prefault(const struct faultstat } entry = fs->entry; - starta = addra - backward * PAGE_SIZE; - if (starta < entry->start) { + if (addra < backward * PAGE_SIZE) { starta = entry->start; - } else if (starta > addra) { - starta = 0; + } else { + starta = addra - backward * PAGE_SIZE; + if (starta < entry->start) + starta = entry->start; } /* From owner-svn-src-stable@freebsd.org Fri Mar 3 10:30:32 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979D5CF69BB; Fri, 3 Mar 2017 10:30:32 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 59D8A1C36; Fri, 3 Mar 2017 10:30:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23AUVkW015904; Fri, 3 Mar 2017 10:30:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23AUVvs015379; Fri, 3 Mar 2017 10:30:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703031030.v23AUVvs015379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Mar 2017 10:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314591 - in stable/11/sys: amd64/amd64 conf i386/i386 modules/mem x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 10:30:32 -0000 Author: kib Date: Fri Mar 3 10:30:30 2017 New Revision: 314591 URL: https://svnweb.freebsd.org/changeset/base/314591 Log: MFC r313898, r313902, r313903, r313934, r314087, r314252: Merge i386 and amd64 mtrr drivers. Added: stable/11/sys/x86/x86/x86_mem.c - copied, changed from r313898, head/sys/x86/x86/x86_mem.c Deleted: stable/11/sys/amd64/amd64/amd64_mem.c stable/11/sys/i386/i386/i686_mem.c Modified: stable/11/sys/conf/files.amd64 stable/11/sys/conf/files.i386 stable/11/sys/modules/mem/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files.amd64 ============================================================================== --- stable/11/sys/conf/files.amd64 Fri Mar 3 10:17:16 2017 (r314590) +++ stable/11/sys/conf/files.amd64 Fri Mar 3 10:30:30 2017 (r314591) @@ -125,7 +125,6 @@ acpi_wakedata.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_wakedata.h" # -amd64/amd64/amd64_mem.c optional mem #amd64/amd64/apic_vector.S standard amd64/amd64/atomic.c standard amd64/amd64/bios.c standard @@ -651,6 +650,7 @@ x86/x86/io_apic.c standard x86/x86/legacy.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard +x86/x86/x86_mem.c optional mem x86/x86/mptable.c optional mptable x86/x86/mptable_pci.c optional mptable pci x86/x86/mp_x86.c optional smp Modified: stable/11/sys/conf/files.i386 ============================================================================== --- stable/11/sys/conf/files.i386 Fri Mar 3 10:17:16 2017 (r314590) +++ stable/11/sys/conf/files.i386 Fri Mar 3 10:30:30 2017 (r314591) @@ -486,7 +486,6 @@ i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode -i386/i386/i686_mem.c optional mem i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.c standard i386/i386/io.c optional io @@ -625,6 +624,7 @@ x86/x86/io_apic.c optional apic x86/x86/legacy.c standard x86/x86/local_apic.c optional apic x86/x86/mca.c standard +x86/x86/x86_mem.c optional mem x86/x86/mptable.c optional apic x86/x86/mptable_pci.c optional apic pci x86/x86/mp_x86.c optional smp Modified: stable/11/sys/modules/mem/Makefile ============================================================================== --- stable/11/sys/modules/mem/Makefile Fri Mar 3 10:17:16 2017 (r314590) +++ stable/11/sys/modules/mem/Makefile Fri Mar 3 10:30:30 2017 (r314591) @@ -3,14 +3,17 @@ .PATH: ${.CURDIR}/../../dev/mem .PATH: ${.CURDIR}/../../${MACHINE}/${MACHINE} .PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH} +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.PATH: ${.CURDIR}/../../x86/x86 +.endif KMOD= mem SRCS= mem.c memdev.c memutil.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= i686_mem.c k6_mem.c +SRCS+= x86_mem.c k6_mem.c .endif .if ${MACHINE_CPUARCH} == "amd64" -SRCS+= amd64_mem.c +SRCS+= x86_mem.c .endif SRCS+= bus_if.h device_if.h Copied and modified: stable/11/sys/x86/x86/x86_mem.c (from r313898, head/sys/x86/x86/x86_mem.c) ============================================================================== --- head/sys/x86/x86/x86_mem.c Fri Feb 17 21:08:32 2017 (r313898, copy source) +++ stable/11/sys/x86/x86/x86_mem.c Fri Mar 3 10:30:30 2017 (r314591) @@ -260,7 +260,7 @@ x86_mrfetch(struct mem_range_softc *sc) /* Compute the range from the mask. Ick. */ mrd->mr_len = (~(msrv & mtrr_physmask) & - (mtrr_physmask | 0xfffL)) + 1; + (mtrr_physmask | 0xfff)) + 1; if (!mrvalid(mrd->mr_base, mrd->mr_len)) mrd->mr_flags |= MDF_BOGUS; @@ -303,19 +303,13 @@ x86_mrt2mtrr(int flags, int oldval) * Update running CPU(s) MTRRs to match the ranges in the descriptor * list. * - * XXX Must be called with interrupts enabled. + * Must be called with interrupts enabled. */ static void x86_mrstore(struct mem_range_softc *sc) { -#ifdef SMP smp_rendezvous(NULL, x86_mrstoreone, NULL, sc); -#else - disable_intr(); /* disable interrupts */ - x86_mrstoreone(sc); - enable_intr(); -#endif } /* @@ -644,7 +638,8 @@ x86_mrinit(struct mem_range_softc *sc) * Determine the size of the PhysMask and PhysBase fields in * the variable range MTRRs. */ - mtrr_physmask = ((1UL << cpu_maxphyaddr) - 1) & ~0xfffUL; + mtrr_physmask = (((uint64_t)1 << cpu_maxphyaddr) - 1) & + ~(uint64_t)0xfff; /* If fixed MTRRs supported and enabled. */ if ((mtrrcap & MTRR_CAP_FIXED) && (mtrrdef & MTRR_DEF_FIXED_ENABLE)) { @@ -710,19 +705,13 @@ x86_mrAPinit(struct mem_range_softc *sc) * Re-initialise running CPU(s) MTRRs to match the ranges in the descriptor * list. * - * XXX Must be called with interrupts enabled. + * Must be called with interrupts enabled. */ static void x86_mrreinit(struct mem_range_softc *sc) { -#ifdef SMP - smp_rendezvous(NULL, (void *)x86_mrAPinit, NULL, sc); -#else - disable_intr(); /* disable interrupts */ - x86_mrAPinit(sc); - enable_intr(); -#endif + smp_rendezvous(NULL, (void (*)(void *))x86_mrAPinit, NULL, sc); } static void @@ -733,16 +722,6 @@ x86_mem_drvinit(void *unused) return; if (!(cpu_feature & CPUID_MTRR)) return; - if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) - return; - switch (cpu_vendor_id) { - case CPU_VENDOR_INTEL: - case CPU_VENDOR_AMD: - case CPU_VENDOR_CENTAUR: - break; - default: - return; - } mem_range_softc.mr_op = &x86_mrops; x86_mrinit(&mem_range_softc); } From owner-svn-src-stable@freebsd.org Fri Mar 3 12:03:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77430CF7BC8; Fri, 3 Mar 2017 12:03:52 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 29F6E1141; Fri, 3 Mar 2017 12:03:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23C3pn0055826; Fri, 3 Mar 2017 12:03:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23C3pYD055824; Fri, 3 Mar 2017 12:03:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703031203.v23C3pYD055824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 3 Mar 2017 12:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314593 - in stable/10/sys/dev/drm2: . radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 12:03:52 -0000 Author: avg Date: Fri Mar 3 12:03:50 2017 New Revision: 314593 URL: https://svnweb.freebsd.org/changeset/base/314593 Log: MFC r288112,r302571: remove unused and redundant declarations and code r288112 Hide an unused in FreeBSD function behind #ifdef linux to get rid of the compile time warning. r302571 Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix -Wredundant-decls warning This allows the code to be compiled with the base gcc. Modified: stable/10/sys/dev/drm2/drm_lock.c stable/10/sys/dev/drm2/radeon/radeon_acpi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_lock.c ============================================================================== --- stable/10/sys/dev/drm2/drm_lock.c Fri Mar 3 11:21:13 2017 (r314592) +++ stable/10/sys/dev/drm2/drm_lock.c Fri Mar 3 12:03:50 2017 (r314593) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include +#if defined(__linux__) static int drm_notifier(void *priv); +#endif static int drm_lock_take(struct drm_lock_data *lock_data, unsigned int context); @@ -284,6 +286,7 @@ int drm_lock_free(struct drm_lock_data * return 0; } +#if defined(__linux__) /** * If we get here, it means that the process has called DRM_IOCTL_LOCK * without calling DRM_IOCTL_UNLOCK. @@ -314,6 +317,7 @@ static int drm_notifier(void *priv) } while (prev != old); return 0; } +#endif /** * This function returns immediately and takes the hw lock Modified: stable/10/sys/dev/drm2/radeon/radeon_acpi.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_acpi.c Fri Mar 3 11:21:13 2017 (r314592) +++ stable/10/sys/dev/drm2/radeon/radeon_acpi.c Fri Mar 3 12:03:50 2017 (r314593) @@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$"); #define ACPI_AC_CLASS "ac_adapter" -extern void radeon_pm_acpi_event_handler(struct radeon_device *rdev); - struct atif_verify_interface { u16 size; /* structure size in bytes (includes size field) */ u16 version; /* version */ From owner-svn-src-stable@freebsd.org Fri Mar 3 12:06:34 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9308CCF7CC6; Fri, 3 Mar 2017 12:06:34 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 5F98A12E8; Fri, 3 Mar 2017 12:06:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23C6XkS055973; Fri, 3 Mar 2017 12:06:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23C6XTF055972; Fri, 3 Mar 2017 12:06:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703031206.v23C6XTF055972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 3 Mar 2017 12:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314594 - stable/10/sys/modules/mlx5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 12:06:34 -0000 Author: avg Date: Fri Mar 3 12:06:33 2017 New Revision: 314594 URL: https://svnweb.freebsd.org/changeset/base/314594 Log: mlx5 module: remove include path that doesn't exist in this branch This is a direct commit. It allows the module to be compiled with the base gcc. Modified: stable/10/sys/modules/mlx5/Makefile Modified: stable/10/sys/modules/mlx5/Makefile ============================================================================== --- stable/10/sys/modules/mlx5/Makefile Fri Mar 3 12:03:50 2017 (r314593) +++ stable/10/sys/modules/mlx5/Makefile Fri Mar 3 12:06:33 2017 (r314594) @@ -30,7 +30,6 @@ device_if.h bus_if.h vnode_if.h pci_if.h SRCS+= linux_compat.c linux_radix.c linux_idr.c CFLAGS+= -I${.CURDIR}/../../ofed/include -CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include .include From owner-svn-src-stable@freebsd.org Fri Mar 3 12:30:19 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8548CF39DA; Fri, 3 Mar 2017 12:30:19 +0000 (UTC) (envelope-from garga@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 mx1.freebsd.org (Postfix) with ESMTPS id 969531497; Fri, 3 Mar 2017 12:30:19 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23CUIsN064541; Fri, 3 Mar 2017 12:30:18 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23CUI7u064540; Fri, 3 Mar 2017 12:30:18 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201703031230.v23CUI7u064540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Fri, 3 Mar 2017 12:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314595 - stable/11/usr.bin/sockstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 12:30:20 -0000 Author: garga (ports committer) Date: Fri Mar 3 12:30:18 2017 New Revision: 314595 URL: https://svnweb.freebsd.org/changeset/base/314595 Log: MFC r314039: Fix style(9) Reviewed by: ngie, tuexen, vangyzen, allanjude Approved by: allanjude MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D9588 Modified: stable/11/usr.bin/sockstat/sockstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/11/usr.bin/sockstat/sockstat.c Fri Mar 3 12:06:33 2017 (r314594) +++ stable/11/usr.bin/sockstat/sockstat.c Fri Mar 3 12:30:18 2017 (r314595) @@ -88,9 +88,9 @@ static size_t numprotos; /* allocated s static int *ports; -#define INT_BIT (sizeof(int)*CHAR_BIT) -#define SET_PORT(p) do { ports[p / INT_BIT] |= 1 << (p % INT_BIT); } while (0) -#define CHK_PORT(p) (ports[p / INT_BIT] & (1 << (p % INT_BIT))) +#define INT_BIT (sizeof(int)*CHAR_BIT) +#define SET_PORT(p) do { ports[p / INT_BIT] |= 1 << (p % INT_BIT); } while (0) +#define CHK_PORT(p) (ports[p / INT_BIT] & (1 << (p % INT_BIT))) struct addr { struct sockaddr_storage address; @@ -111,7 +111,7 @@ struct sock { struct sock *next; }; -#define HASHSIZE 1009 +#define HASHSIZE 1009 static struct sock *sockhash[HASHSIZE]; static struct xfile *xfiles; @@ -131,7 +131,6 @@ xprintf(const char *fmt, ...) return (len); } - static int get_proto_type(const char *proto) { @@ -147,7 +146,6 @@ get_proto_type(const char *proto) return (pent->p_proto); } - static void init_protos(int num) { @@ -167,7 +165,6 @@ init_protos(int num) numprotos = proto_count; } - static int parse_protos(char *protospec) { @@ -190,7 +187,6 @@ parse_protos(char *protospec) return (proto_index); } - static void parse_ports(const char *portspec) { @@ -359,27 +355,27 @@ gather_sctp(void) err(1, "malloc()"); switch (xladdr->address.sa.sa_family) { case AF_INET: -#define __IN_IS_ADDR_LOOPBACK(pina) \ +#define __IN_IS_ADDR_LOOPBACK(pina) \ ((ntohl((pina)->s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) - if (!__IN_IS_ADDR_LOOPBACK(&xladdr->address.sin.sin_addr)) + if (!__IN_IS_ADDR_LOOPBACK( + &xladdr->address.sin.sin_addr)) local_all_loopback = 0; -#undef __IN_IS_ADDR_LOOPBACK - sockaddr(&laddr->address, - AF_INET, - &xladdr->address.sin.sin_addr, - htons(xinpcb->local_port)); +#undef __IN_IS_ADDR_LOOPBACK + sockaddr(&laddr->address, AF_INET, + &xladdr->address.sin.sin_addr, + htons(xinpcb->local_port)); break; case AF_INET6: - if (!IN6_IS_ADDR_LOOPBACK(&xladdr->address.sin6.sin6_addr)) + if (!IN6_IS_ADDR_LOOPBACK( + &xladdr->address.sin6.sin6_addr)) local_all_loopback = 0; - sockaddr(&laddr->address, - AF_INET6, - &xladdr->address.sin6.sin6_addr, - htons(xinpcb->local_port)); + sockaddr(&laddr->address, AF_INET6, + &xladdr->address.sin6.sin6_addr, + htons(xinpcb->local_port)); break; default: errx(1, "address family %d not supported", - xladdr->address.sa.sa_family); + xladdr->address.sa.sa_family); } laddr->next = NULL; if (prev_laddr == NULL) @@ -389,33 +385,38 @@ gather_sctp(void) prev_laddr = laddr; } if (sock->laddr == NULL) { - if ((sock->laddr = calloc(1, sizeof(struct addr))) == NULL) + if ((sock->laddr = + calloc(1, sizeof(struct addr))) == NULL) err(1, "malloc()"); sock->laddr->address.ss_family = sock->family; if (sock->family == AF_INET) - sock->laddr->address.ss_len = sizeof(struct sockaddr_in); + sock->laddr->address.ss_len = + sizeof(struct sockaddr_in); else - sock->laddr->address.ss_len = sizeof(struct sockaddr_in6); + sock->laddr->address.ss_len = + sizeof(struct sockaddr_in6); local_all_loopback = 0; } if ((sock->faddr = calloc(1, sizeof(struct addr))) == NULL) err(1, "malloc()"); sock->faddr->address.ss_family = sock->family; if (sock->family == AF_INET) - sock->faddr->address.ss_len = sizeof(struct sockaddr_in); + sock->faddr->address.ss_len = + sizeof(struct sockaddr_in); else - sock->faddr->address.ss_len = sizeof(struct sockaddr_in6); + sock->faddr->address.ss_len = + sizeof(struct sockaddr_in6); no_stcb = 1; while (offset < len) { xstcb = (struct xsctp_tcb *)(void *)(buf + offset); offset += sizeof(struct xsctp_tcb); if (no_stcb) { - if (opt_l && - (sock->vflag & vflag) && + if (opt_l && (sock->vflag & vflag) && (!opt_L || !local_all_loopback) && ((xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) || (xstcb->last == 1))) { - hash = (int)((uintptr_t)sock->socket % HASHSIZE); + hash = (int)((uintptr_t)sock->socket % + HASHSIZE); sock->next = sockhash[hash]; sockhash[hash] = sock; } else { @@ -448,37 +449,40 @@ gather_sctp(void) prev_laddr = NULL; local_all_loopback = 1; while (offset < len) { - xladdr = (struct xsctp_laddr *)(void *)(buf + offset); + xladdr = (struct xsctp_laddr *)(void *)(buf + + offset); offset += sizeof(struct xsctp_laddr); if (xladdr->last == 1) break; if (!opt_c) continue; - if ((laddr = calloc(1, sizeof(struct addr))) == NULL) + laddr = calloc(1, sizeof(struct addr)); + if (laddr == NULL) err(1, "malloc()"); switch (xladdr->address.sa.sa_family) { case AF_INET: -#define __IN_IS_ADDR_LOOPBACK(pina) \ +#define __IN_IS_ADDR_LOOPBACK(pina) \ ((ntohl((pina)->s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) - if (!__IN_IS_ADDR_LOOPBACK(&xladdr->address.sin.sin_addr)) + if (!__IN_IS_ADDR_LOOPBACK( + &xladdr->address.sin.sin_addr)) local_all_loopback = 0; -#undef __IN_IS_ADDR_LOOPBACK - sockaddr(&laddr->address, - AF_INET, - &xladdr->address.sin.sin_addr, - htons(xstcb->local_port)); +#undef __IN_IS_ADDR_LOOPBACK + sockaddr(&laddr->address, AF_INET, + &xladdr->address.sin.sin_addr, + htons(xstcb->local_port)); break; case AF_INET6: - if (!IN6_IS_ADDR_LOOPBACK(&xladdr->address.sin6.sin6_addr)) + if (!IN6_IS_ADDR_LOOPBACK( + &xladdr->address.sin6.sin6_addr)) local_all_loopback = 0; - sockaddr(&laddr->address, - AF_INET6, - &xladdr->address.sin6.sin6_addr, - htons(xstcb->local_port)); + sockaddr(&laddr->address, AF_INET6, + &xladdr->address.sin6.sin6_addr, + htons(xstcb->local_port)); break; default: - errx(1, "address family %d not supported", - xladdr->address.sa.sa_family); + errx(1, + "address family %d not supported", + xladdr->address.sa.sa_family); } laddr->next = NULL; if (prev_laddr == NULL) @@ -490,37 +494,40 @@ gather_sctp(void) prev_faddr = NULL; foreign_all_loopback = 1; while (offset < len) { - xraddr = (struct xsctp_raddr *)(void *)(buf + offset); + xraddr = (struct xsctp_raddr *)(void *)(buf + + offset); offset += sizeof(struct xsctp_raddr); if (xraddr->last == 1) break; if (!opt_c) continue; - if ((faddr = calloc(1, sizeof(struct addr))) == NULL) + faddr = calloc(1, sizeof(struct addr)); + if (faddr == NULL) err(1, "malloc()"); switch (xraddr->address.sa.sa_family) { case AF_INET: -#define __IN_IS_ADDR_LOOPBACK(pina) \ +#define __IN_IS_ADDR_LOOPBACK(pina) \ ((ntohl((pina)->s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) - if (!__IN_IS_ADDR_LOOPBACK(&xraddr->address.sin.sin_addr)) + if (!__IN_IS_ADDR_LOOPBACK( + &xraddr->address.sin.sin_addr)) foreign_all_loopback = 0; -#undef __IN_IS_ADDR_LOOPBACK - sockaddr(&faddr->address, - AF_INET, - &xraddr->address.sin.sin_addr, - htons(xstcb->remote_port)); +#undef __IN_IS_ADDR_LOOPBACK + sockaddr(&faddr->address, AF_INET, + &xraddr->address.sin.sin_addr, + htons(xstcb->remote_port)); break; case AF_INET6: - if (!IN6_IS_ADDR_LOOPBACK(&xraddr->address.sin6.sin6_addr)) + if (!IN6_IS_ADDR_LOOPBACK( + &xraddr->address.sin6.sin6_addr)) foreign_all_loopback = 0; - sockaddr(&faddr->address, - AF_INET6, - &xraddr->address.sin6.sin6_addr, - htons(xstcb->remote_port)); + sockaddr(&faddr->address, AF_INET6, + &xraddr->address.sin6.sin6_addr, + htons(xstcb->remote_port)); break; default: - errx(1, "address family %d not supported", - xraddr->address.sa.sa_family); + errx(1, + "address family %d not supported", + xraddr->address.sa.sa_family); } faddr->next = NULL; if (prev_faddr == NULL) @@ -532,8 +539,10 @@ gather_sctp(void) if (opt_c) { if ((sock->vflag & vflag) && (!opt_L || - !(local_all_loopback || foreign_all_loopback))) { - hash = (int)((uintptr_t)sock->socket % HASHSIZE); + !(local_all_loopback || + foreign_all_loopback))) { + hash = (int)((uintptr_t)sock->socket % + HASHSIZE); sock->next = sockhash[hash]; sockhash[hash] = sock; } else { @@ -646,13 +655,13 @@ gather_inet(int proto) if ((inp->inp_fport == 0 && !opt_l) || (inp->inp_fport != 0 && !opt_c)) continue; -#define __IN_IS_ADDR_LOOPBACK(pina) \ +#define __IN_IS_ADDR_LOOPBACK(pina) \ ((ntohl((pina)->s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) if (opt_L && (__IN_IS_ADDR_LOOPBACK(&inp->inp_faddr) || __IN_IS_ADDR_LOOPBACK(&inp->inp_laddr))) continue; -#undef __IN_IS_ADDR_LOOPBACK +#undef __IN_IS_ADDR_LOOPBACK } else if (inp->inp_vflag & INP_IPV6) { if ((inp->inp_fport == 0 && !opt_l) || (inp->inp_fport != 0 && !opt_c)) @@ -1003,7 +1012,7 @@ displaysock(struct sock *s, int pos) case AF_UNIX: if ((laddr == NULL) || (faddr == NULL)) errx(1, "laddr = %p or faddr = %p is NULL", - (void *)laddr, (void *)faddr); + (void *)laddr, (void *)faddr); /* server */ if (laddr->address.ss_len > 0) { pos += printaddr(&laddr->address); @@ -1018,15 +1027,14 @@ displaysock(struct sock *s, int pos) pos += xprintf("-> "); for (hash = 0; hash < HASHSIZE; ++hash) { for (s_tmp = sockhash[hash]; - s_tmp != NULL; - s_tmp = s_tmp->next) + s_tmp != NULL; + s_tmp = s_tmp->next) if (s_tmp->pcb == p) break; if (s_tmp != NULL) break; } - if (s_tmp == NULL || - s_tmp->laddr == NULL || + if (s_tmp == NULL || s_tmp->laddr == NULL || s_tmp->laddr->address.ss_len == 0) pos += xprintf("??"); else @@ -1144,7 +1152,6 @@ static int set_default_protos(void) return (pindex); } - static void usage(void) { From owner-svn-src-stable@freebsd.org Fri Mar 3 13:32:02 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB443CF6186; Fri, 3 Mar 2017 13:32:02 +0000 (UTC) (envelope-from des@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 mx1.freebsd.org (Postfix) with ESMTPS id 5D39816D5; Fri, 3 Mar 2017 13:32:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23DW1qw089930; Fri, 3 Mar 2017 13:32:01 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23DW1ii089929; Fri, 3 Mar 2017 13:32:01 GMT (envelope-from des@FreeBSD.org) Message-Id: <201703031332.v23DW1ii089929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 3 Mar 2017 13:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314597 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 13:32:02 -0000 Author: des Date: Fri Mar 3 13:32:01 2017 New Revision: 314597 URL: https://svnweb.freebsd.org/changeset/base/314597 Log: MFH (r278120): add missing ssh-related files PR: 193980 Submitted by: mcdouga9@egr.msu.edu Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 3 12:51:16 2017 (r314596) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 3 13:32:01 2017 (r314597) @@ -4044,18 +4044,28 @@ OLD_FILES+=usr/share/man/man8/ntptime.8. .endif .if ${MK_OPENSSH} == no +OLD_FILES+=etc/rc.d/sshd +OLD_FILES+=etc/ssh/moduli +OLD_FILES+=etc/ssh/ssh_config +OLD_FILES+=etc/ssh/sshd_config +OLD_FILES+=usr/bin/scp OLD_FILES+=usr/bin/sftp +OLD_FILES+=usr/bin/slogin OLD_FILES+=usr/bin/ssh OLD_FILES+=usr/bin/ssh-add OLD_FILES+=usr/bin/ssh-agent OLD_FILES+=usr/bin/ssh-copy-id OLD_FILES+=usr/bin/ssh-keygen OLD_FILES+=usr/bin/ssh-keyscan +OLD_FILES+=usr/lib/pam_ssh.so +OLD_LIBS+=usr/lib/pam_ssh.so.5 OLD_FILES+=usr/lib/private/libssh.a OLD_FILES+=usr/lib/private/libssh.so OLD_LIBS+=usr/lib/private/libssh.so.5 OLD_FILES+=usr/lib/private/libssh_p.a .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_FILES+=usr/lib32/pam_ssh.so +OLD_LIBS+=usr/lib32/pam_ssh.so.5 OLD_FILES+=usr/lib32/private/libssh.a OLD_FILES+=usr/lib32/private/libssh.so OLD_LIBS+=usr/lib32/private/libssh.so.5 @@ -4065,6 +4075,22 @@ OLD_FILES+=usr/libexec/sftp-server OLD_FILES+=usr/libexec/ssh-keysign OLD_FILES+=usr/libexec/ssh-pkcs11-helper OLD_FILES+=usr/sbin/sshd +OLD_FILES+=usr/share/man/man1/scp.1.gz +OLD_FILES+=usr/share/man/man1/sftp.1.gz +OLD_FILES+=usr/share/man/man1/slogin.1.gz +OLD_FILES+=usr/share/man/man1/ssh-add.1.gz +OLD_FILES+=usr/share/man/man1/ssh-agent.1.gz +OLD_FILES+=usr/share/man/man1/ssh-copy-id.1.gz +OLD_FILES+=usr/share/man/man1/ssh-keygen.1.gz +OLD_FILES+=usr/share/man/man1/ssh-keyscan.1.gz +OLD_FILES+=usr/share/man/man1/ssh.1.gz +OLD_FILES+=usr/share/man/man5/ssh_config.5.gz +OLD_FILES+=usr/share/man/man5/sshd_config.5.gz +OLD_FILES+=usr/share/man/man8/pam_ssh.8.gz +OLD_FILES+=usr/share/man/man8/sftp-server.8.gz +OLD_FILES+=usr/share/man/man8/ssh-keysign.8.gz +OLD_FILES+=usr/share/man/man8/ssh-pkcs11-helper.8.gz +OLD_FILES+=usr/share/man/man8/sshd.8.gz .endif .if ${MK_OPENSSL} == no From owner-svn-src-stable@freebsd.org Fri Mar 3 14:19:13 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A33E7CF535B; Fri, 3 Mar 2017 14:19:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F07E1646; Fri, 3 Mar 2017 14:19:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0785D1FE025; Fri, 3 Mar 2017 15:18:45 +0100 (CET) Subject: Re: svn commit: r314594 - stable/10/sys/modules/mlx5 To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201703031206.v23C6XTF055972@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Fri, 3 Mar 2017 15:18:24 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <201703031206.v23C6XTF055972@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 14:19:13 -0000 On 03/03/17 13:06, Andriy Gapon wrote: > Author: avg > Date: Fri Mar 3 12:06:33 2017 > New Revision: 314594 > URL: https://svnweb.freebsd.org/changeset/base/314594 > > Log: > mlx5 module: remove include path that doesn't exist in this branch > > This is a direct commit. > It allows the module to be compiled with the base gcc. > > Modified: > stable/10/sys/modules/mlx5/Makefile > > Modified: stable/10/sys/modules/mlx5/Makefile > ============================================================================== > --- stable/10/sys/modules/mlx5/Makefile Fri Mar 3 12:03:50 2017 (r314593) > +++ stable/10/sys/modules/mlx5/Makefile Fri Mar 3 12:06:33 2017 (r314594) > @@ -30,7 +30,6 @@ device_if.h bus_if.h vnode_if.h pci_if.h > SRCS+= linux_compat.c linux_radix.c linux_idr.c > > CFLAGS+= -I${.CURDIR}/../../ofed/include > -CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include > > .include > Hi, Which version of GCC is this? Do you want me to check for this kind of errors before committing or are you fine cleaning up every now and then? Currently the mlx4/mlx5 code is only tested with the in-base compiler. --HPS From owner-svn-src-stable@freebsd.org Fri Mar 3 14:35:21 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA3FCF5A4C; Fri, 3 Mar 2017 14:35:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EB54C12B5; Fri, 3 Mar 2017 14:35:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA26957; Fri, 03 Mar 2017 16:35:18 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1cjoIf-0009rN-RL; Fri, 03 Mar 2017 16:35:17 +0200 Subject: Re: svn commit: r314594 - stable/10/sys/modules/mlx5 To: Hans Petter Selasky , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-10@FreeBSD.org References: <201703031206.v23C6XTF055972@repo.freebsd.org> From: Andriy Gapon Message-ID: <915cdd8f-0f12-0bb1-9c8d-e4813e275141@FreeBSD.org> Date: Fri, 3 Mar 2017 16:34:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 14:35:21 -0000 On 03/03/2017 16:18, Hans Petter Selasky wrote: > On 03/03/17 13:06, Andriy Gapon wrote: >> Author: avg >> Date: Fri Mar 3 12:06:33 2017 >> New Revision: 314594 >> URL: https://svnweb.freebsd.org/changeset/base/314594 >> >> Log: >> mlx5 module: remove include path that doesn't exist in this branch >> >> This is a direct commit. >> It allows the module to be compiled with the base gcc. >> >> Modified: >> stable/10/sys/modules/mlx5/Makefile >> >> Modified: stable/10/sys/modules/mlx5/Makefile >> ============================================================================== >> --- stable/10/sys/modules/mlx5/Makefile Fri Mar 3 12:03:50 2017 (r314593) >> +++ stable/10/sys/modules/mlx5/Makefile Fri Mar 3 12:06:33 2017 (r314594) >> @@ -30,7 +30,6 @@ device_if.h bus_if.h vnode_if.h pci_if.h >> SRCS+= linux_compat.c linux_radix.c linux_idr.c >> >> CFLAGS+= -I${.CURDIR}/../../ofed/include >> -CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include >> >> .include >> > > Hi, > > Which version of GCC is this? gcc version 4.2.1 20070831 patched [FreeBSD] That is, the compiler that you get when clang is disabled. > Do you want me to check for this kind of errors before committing or are you > fine cleaning up every now and then? Currently the mlx4/mlx5 code is only tested > with the in-base compiler. Checking with a non-default compiler is probably too much a burden for anyone who doesn't use it regularly. -- Andriy Gapon From owner-svn-src-stable@freebsd.org Fri Mar 3 17:53:24 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D0F6CF64ED; Fri, 3 Mar 2017 17:53:24 +0000 (UTC) (envelope-from np@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 mx1.freebsd.org (Postfix) with ESMTPS id C5E6A1760; Fri, 3 Mar 2017 17:53:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23HrMV5001118; Fri, 3 Mar 2017 17:53:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23HrMUo001114; Fri, 3 Mar 2017 17:53:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703031753.v23HrMUo001114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 3 Mar 2017 17:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314605 - in stable/11/sys: dev/cxgbe/iw_cxgbe ofed/drivers/infiniband/core X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 17:53:24 -0000 Author: np Date: Fri Mar 3 17:53:22 2017 New Revision: 314605 URL: https://svnweb.freebsd.org/changeset/base/314605 Log: MFC r314400: cxgbe/iw_cxgbe: fix various double-close panics with iWARP sockets. Sockets representing the TCP endpoints for iWARP connections are allocated by the ibcore module. Before this revision they were closed either by the ibcore module or the iw_cxgbe hardware driver depending on the state transitions during connection teardown. This is error prone and there were cases where both iw_cxgbe and ibcore closed the socket leading to double-free panics. The fix is to let ibcore close the sockets it creates and never do it in the driver. - Use sodisconnect instead of soclose (preceded by solinger = 0) in the driver to tear down an RDMA connection abruptly. This does what's intended without releasing the socket's fd reference. - Close the socket in ibcore when the iWARP iw_cm_id is destroyed. This works for all kinds of sockets: clients that initiate connections, listeners, and sockets accepted off of listeners. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/11/sys/ofed/drivers/infiniband/core/cma.c stable/11/sys/ofed/drivers/infiniband/core/iwcm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Mar 3 16:28:03 2017 (r314604) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Mar 3 17:53:22 2017 (r314605) @@ -92,9 +92,7 @@ static void *alloc_ep(int size, gfp_t fl void __free_ep(struct c4iw_ep_common *epc); static int find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, __be16 peer_port, u8 tos, struct nhop4_extended *pnh4); -static int close_socket(struct c4iw_ep_common *epc, int close); -static int shutdown_socket(struct c4iw_ep_common *epc); -static void abort_socket(struct c4iw_ep *ep); +static void close_socket(struct socket *so); static int send_mpa_req(struct c4iw_ep *ep); static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); @@ -111,7 +109,8 @@ static void process_peer_close(struct c4 static void process_conn_error(struct c4iw_ep *ep); static void process_close_complete(struct c4iw_ep *ep); static void ep_timeout(unsigned long arg); -static void init_sock(struct c4iw_ep_common *epc); +static void init_iwarp_socket(struct socket *so, void *arg); +static void uninit_iwarp_socket(struct socket *so); static void process_data(struct c4iw_ep *ep); static void process_connected(struct c4iw_ep *ep); static int c4iw_so_upcall(struct socket *so, void *arg, int waitflag); @@ -319,87 +318,12 @@ find_route(__be32 local_ip, __be32 peer_ return err; } -static int -close_socket(struct c4iw_ep_common *epc, int close) -{ - struct socket *so = epc->so; - int rc; - - CTR5(KTR_IW_CXGBE, "%s:csoB so %p, ep %p, state %s, tid %d", __func__, - so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - mutex_lock(&epc->so_mutex); - if ((so == NULL) || (so->so_count == 0)) { - mutex_unlock(&epc->so_mutex); - CTR5(KTR_IW_CXGBE, "%s:cso1 so %p, ep %p, state %s, tid %d", - __func__, so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - return -EINVAL; - } - - SOCK_LOCK(so); - soupcall_clear(so, SO_RCV); - SOCK_UNLOCK(so); - - if (close) - rc = soclose(so); - else - rc = soshutdown(so, SHUT_WR | SHUT_RD); - epc->so = NULL; - - mutex_unlock(&epc->so_mutex); - return (rc); -} - -static int -shutdown_socket(struct c4iw_ep_common *epc) -{ - - struct socket *so = epc->so; - int rc; - - CTR5(KTR_IW_CXGBE, "%s:ssoB so %p, ep %p, state %s, tid %d", __func__, - epc->so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - mutex_lock(&epc->so_mutex); - if ((so == NULL) || (so->so_count == 0)) { - mutex_unlock(&epc->so_mutex); - CTR5(KTR_IW_CXGBE, "%s:sso1 so %p, ep %p, state %s, tid %d", - __func__, epc->so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - return -EINVAL; - } - rc = soshutdown(so, SHUT_WR); - mutex_unlock(&epc->so_mutex); - return rc; -} - static void -abort_socket(struct c4iw_ep *ep) +close_socket(struct socket *so) { - struct sockopt sopt; - int rc; - struct linger l; - - CTR5(KTR_IW_CXGBE, "%s ep %p so %p state %s tid %d", __func__, ep, - ep->com.so, states[ep->com.state], ep->hwtid); - mutex_lock(&ep->com.so_mutex); - l.l_onoff = 1; - l.l_linger = 0; - /* linger_time of 0 forces RST to be sent */ - sopt.sopt_dir = SOPT_SET; - sopt.sopt_level = SOL_SOCKET; - sopt.sopt_name = SO_LINGER; - sopt.sopt_val = (caddr_t)&l; - sopt.sopt_valsize = sizeof l; - sopt.sopt_td = NULL; - rc = sosetopt(ep->com.so, &sopt); - if (rc) { - log(LOG_ERR, "%s: can't set linger to 0, no RST! err %d\n", - __func__, rc); - } - mutex_unlock(&ep->com.so_mutex); + uninit_iwarp_socket(so); + sodisconnect(so); } static void @@ -429,7 +353,7 @@ process_peer_close(struct c4iw_ep *ep) disconnect = 0; STOP_EP_TIMER(ep); - close_socket(&ep->com, 0); + close_socket(ep->com.so); deref_cm_id(&ep->com); release = 1; break; @@ -486,7 +410,7 @@ process_peer_close(struct c4iw_ep *ep) c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); } - close_socket(&ep->com, 0); + close_socket(ep->com.so); close_complete_upcall(ep, 0); __state_set(&ep->com, DEAD); release = 1; @@ -595,14 +519,7 @@ process_conn_error(struct c4iw_ep *ep) } if (state != ABORTING) { - if (ep->parent_ep) { - CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 1); - } else { - CTR2(KTR_IW_CXGBE, "%s:pce2 %p", __func__, ep); - close_socket(&ep->com, 0); - } - + close_socket(ep->com.so); __state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } @@ -648,16 +565,7 @@ process_close_complete(struct c4iw_ep *e &attrs, 1); } - if (ep->parent_ep) { - - CTR2(KTR_IW_CXGBE, "%s:pcc3 %p", __func__, ep); - close_socket(&ep->com, 1); - } - else { - - CTR2(KTR_IW_CXGBE, "%s:pcc4 %p", __func__, ep); - close_socket(&ep->com, 0); - } + close_socket(ep->com.so); close_complete_upcall(ep, 0); __state_set(&ep->com, DEAD); release = 1; @@ -688,23 +596,15 @@ process_close_complete(struct c4iw_ep *e } static void -init_sock(struct c4iw_ep_common *epc) +init_iwarp_socket(struct socket *so, void *arg) { int rc; struct sockopt sopt; - struct socket *so = epc->so; int on = 1; - mutex_lock(&epc->so_mutex); - if ((so == NULL) || (so->so_count == 0)) { - mutex_unlock(&epc->so_mutex); - CTR5(KTR_IW_CXGBE, "%s:iso1 so %p, ep %p, state %s, tid %d", - __func__, so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - return; - } + /* Note that SOCK_LOCK(so) is same as SOCKBUF_LOCK(&so->so_rcv) */ SOCK_LOCK(so); - soupcall_set(so, SO_RCV, c4iw_so_upcall, epc); + soupcall_set(so, SO_RCV, c4iw_so_upcall, arg); so->so_state |= SS_NBIO; SOCK_UNLOCK(so); sopt.sopt_dir = SOPT_SET; @@ -718,7 +618,15 @@ init_sock(struct c4iw_ep_common *epc) log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n", __func__, so, rc); } - mutex_unlock(&epc->so_mutex); +} + +static void +uninit_iwarp_socket(struct socket *so) +{ + + SOCKBUF_LOCK(&so->so_rcv); + soupcall_clear(so, SO_RCV); + SOCKBUF_UNLOCK(&so->so_rcv); } static void @@ -759,18 +667,18 @@ process_data(struct c4iw_ep *ep) static void process_connected(struct c4iw_ep *ep) { + struct socket *so = ep->com.so; - if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) { + if ((so->so_state & SS_ISCONNECTED) && !so->so_error) { if (send_mpa_req(ep)) goto err; - } - else { - connect_reply_upcall(ep, -ep->com.so->so_error); + } else { + connect_reply_upcall(ep, -so->so_error); goto err; } return; err: - close_socket(&ep->com, 0); + close_socket(so); state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); return; @@ -785,23 +693,9 @@ process_newconn(struct iw_cm_id *parent_ struct c4iw_ep *parent_ep = parent_cm_id->provider_data; int ret = 0; - if (!child_so) { - CTR4(KTR_IW_CXGBE, - "%s: parent so %p, parent ep %p, child so %p, invalid so", - __func__, parent_ep->com.so, parent_ep, child_so); - log(LOG_ERR, "%s: invalid child socket\n", __func__); - return; - } - child_ep = alloc_ep(sizeof(*child_ep), M_NOWAIT); - if (!child_ep) { - CTR3(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, ENOMEM", - __func__, parent_ep->com.so, parent_ep); - log(LOG_ERR, "%s: failed to allocate ep entry\n", __func__); - return; - } - SOCKBUF_LOCK(&child_so->so_rcv); - soupcall_set(child_so, SO_RCV, c4iw_so_upcall, child_ep); - SOCKBUF_UNLOCK(&child_so->so_rcv); + MPASS(child_so != NULL); + + child_ep = alloc_ep(sizeof(*child_ep), M_WAITOK); CTR5(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, child so %p, child ep %p", @@ -821,6 +715,7 @@ process_newconn(struct iw_cm_id *parent_ free(local, M_SONAME); free(remote, M_SONAME); + init_iwarp_socket(child_so, &child_ep->com); c4iw_get_ep(&parent_ep->com); init_timer(&child_ep->timer); state_set(&child_ep->com, MPA_REQ_WAIT); @@ -1038,7 +933,6 @@ alloc_ep(int size, gfp_t gfp) kref_init(&epc->kref); mutex_init(&epc->mutex); - mutex_init(&epc->so_mutex); c4iw_init_wr_wait(&epc->wr_wait); return (epc); @@ -1359,30 +1253,47 @@ static void close_complete_upcall(struct CTR2(KTR_IW_CXGBE, "%s:ccuE %p", __func__, ep); } -static int send_abort(struct c4iw_ep *ep) +static int +send_abort(struct c4iw_ep *ep) { - int err; + struct socket *so = ep->com.so; + struct sockopt sopt; + int rc; + struct linger l; - CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep); - abort_socket(ep); + CTR5(KTR_IW_CXGBE, "%s ep %p so %p state %s tid %d", __func__, ep, so, + states[ep->com.state], ep->hwtid); - /* - * Since socket options were set as l_onoff=1 and l_linger=0 in in - * abort_socket, invoking soclose here sends a RST (reset) to the peer. - */ - err = close_socket(&ep->com, 1); + l.l_onoff = 1; + l.l_linger = 0; + + /* linger_time of 0 forces RST to be sent */ + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_LINGER; + sopt.sopt_val = (caddr_t)&l; + sopt.sopt_valsize = sizeof l; + sopt.sopt_td = NULL; + rc = sosetopt(so, &sopt); + if (rc != 0) { + log(LOG_ERR, "%s: sosetopt(%p, linger = 0) failed with %d.\n", + __func__, so, rc); + } + + uninit_iwarp_socket(so); + sodisconnect(so); set_bit(ABORT_CONN, &ep->com.history); - CTR2(KTR_IW_CXGBE, "%s:abE %p", __func__, ep); /* - * TBD: iw_cgbe driver should receive ABORT reply for every ABORT + * TBD: iw_cxgbe driver should receive ABORT reply for every ABORT * request it has sent. But the current TOE driver is not propagating * this ABORT reply event (via do_abort_rpl) to iw_cxgbe. So as a work- * around de-refer 'ep' (which was refered before sending ABORT request) * here instead of doing it in abort_rpl() handler of iw_cxgbe driver. */ c4iw_put_ep(&ep->com); - return err; + + return (0); } static void peer_close_upcall(struct c4iw_ep *ep) @@ -2213,7 +2124,6 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct c4iw_dev *dev = to_c4iw_dev(cm_id->device); struct c4iw_ep *ep = NULL; struct nhop4_extended nh4; - struct toedev *tdev; CTR2(KTR_IW_CXGBE, "%s:ccB %p", __func__, cm_id); @@ -2266,8 +2176,6 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->com.thread = curthread; ep->com.so = cm_id->so; - init_sock(&ep->com); - /* find a route */ err = find_route( cm_id->local_addr.sin_addr.s_addr, @@ -2283,22 +2191,11 @@ int c4iw_connect(struct iw_cm_id *cm_id, goto fail2; } - if (!(nh4.nh_ifp->if_capenable & IFCAP_TOE)) { - - CTR2(KTR_IW_CXGBE, "%s:cc8 %p", __func__, ep); - printf("%s - interface not TOE capable.\n", __func__); - close_socket(&ep->com, 0); + if (!(nh4.nh_ifp->if_capenable & IFCAP_TOE) || + TOEDEV(nh4.nh_ifp) == NULL) { err = -ENOPROTOOPT; goto fail3; } - tdev = TOEDEV(nh4.nh_ifp); - - if (tdev == NULL) { - - CTR2(KTR_IW_CXGBE, "%s:cc9 %p", __func__, ep); - printf("%s - No toedev for interface.\n", __func__); - goto fail3; - } fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); state_set(&ep->com, CONNECTING); @@ -2309,19 +2206,18 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->com.thread); if (!err) { - CTR2(KTR_IW_CXGBE, "%s:cca %p", __func__, ep); + init_iwarp_socket(cm_id->so, &ep->com); goto out; } else { - close_socket(&ep->com, 0); goto fail2; } fail3: - CTR2(KTR_IW_CXGBE, "%s:ccb %p", __func__, ep); fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); fail2: deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); + ep = NULL; /* CTR shouldn't display already-freed ep. */ out: CTR2(KTR_IW_CXGBE, "%s:ccE %p", __func__, ep); return err; @@ -2465,7 +2361,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *e if (!ep->parent_ep) __state_set(&ep->com, MORIBUND); - ret = shutdown_socket(&ep->com); + ret = sodisconnect(ep->com.so); } if (ret) { Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Mar 3 16:28:03 2017 (r314604) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Mar 3 17:53:22 2017 (r314605) @@ -754,7 +754,6 @@ struct c4iw_ep_common { int rpl_done; struct thread *thread; struct socket *so; - struct mutex so_mutex; }; struct c4iw_listen_ep { Modified: stable/11/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/cma.c Fri Mar 3 16:28:03 2017 (r314604) +++ stable/11/sys/ofed/drivers/infiniband/core/cma.c Fri Mar 3 17:53:22 2017 (r314605) @@ -1049,8 +1049,6 @@ static void cma_release_port(struct rdma kfree(bind_list); } mutex_unlock(&lock); - if (id_priv->sock) - sock_release(id_priv->sock); } static void cma_leave_mc_groups(struct rdma_id_private *id_priv) Modified: stable/11/sys/ofed/drivers/infiniband/core/iwcm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/iwcm.c Fri Mar 3 16:28:03 2017 (r314604) +++ stable/11/sys/ofed/drivers/infiniband/core/iwcm.c Fri Mar 3 17:53:22 2017 (r314605) @@ -528,24 +528,15 @@ iw_init_sock(struct iw_cm_id *cm_id) } static int -iw_close_socket(struct iw_cm_id *cm_id, int close) +iw_uninit_socket(struct iw_cm_id *cm_id) { struct socket *so = cm_id->so; - int rc; - SOCK_LOCK(so); soupcall_clear(so, SO_RCV); SOCK_UNLOCK(so); - if (close) - rc = soclose(so); - else - rc = soshutdown(so, SHUT_WR | SHUT_RD); - - cm_id->so = NULL; - - return rc; + return (0); } static int @@ -554,18 +545,17 @@ iw_create_listen(struct iw_cm_id *cm_id, int rc; iw_init_sock(cm_id); - rc = solisten(cm_id->so, backlog, curthread); + rc = -solisten(cm_id->so, backlog, curthread); if (rc != 0) - iw_close_socket(cm_id, 0); - return rc; + iw_uninit_socket(cm_id); + return (rc); } static int iw_destroy_listen(struct iw_cm_id *cm_id) { - int rc; - rc = iw_close_socket(cm_id, 0); - return rc; + + return (iw_uninit_socket(cm_id)); } @@ -663,6 +653,9 @@ void iw_destroy_cm_id(struct iw_cm_id *c wait_for_completion(&cm_id_priv->destroy_comp); + if (cm_id->so) + sock_release(cm_id->so); + free_cm_id(cm_id_priv); } EXPORT_SYMBOL(iw_destroy_cm_id); From owner-svn-src-stable@freebsd.org Fri Mar 3 17:57:19 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36971CF685A; Fri, 3 Mar 2017 17:57:19 +0000 (UTC) (envelope-from np@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 mx1.freebsd.org (Postfix) with ESMTPS id F33D21BE9; Fri, 3 Mar 2017 17:57:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23HvI4e001318; Fri, 3 Mar 2017 17:57:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23HvHWf001313; Fri, 3 Mar 2017 17:57:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703031757.v23HvHWf001313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 3 Mar 2017 17:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314606 - in stable/10/sys: dev/cxgbe/iw_cxgbe ofed/drivers/infiniband/core X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 17:57:19 -0000 Author: np Date: Fri Mar 3 17:57:17 2017 New Revision: 314606 URL: https://svnweb.freebsd.org/changeset/base/314606 Log: MFC r314400: cxgbe/iw_cxgbe: fix various double-close panics with iWARP sockets. Sockets representing the TCP endpoints for iWARP connections are allocated by the ibcore module. Before this revision they were closed either by the ibcore module or the iw_cxgbe hardware driver depending on the state transitions during connection teardown. This is error prone and there were cases where both iw_cxgbe and ibcore closed the socket leading to double-free panics. The fix is to let ibcore close the sockets it creates and never do it in the driver. - Use sodisconnect instead of soclose (preceded by solinger = 0) in the driver to tear down an RDMA connection abruptly. This does what's intended without releasing the socket's fd reference. - Close the socket in ibcore when the iWARP iw_cm_id is destroyed. This works for all kinds of sockets: clients that initiate connections, listeners, and sockets accepted off of listeners. Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/10/sys/ofed/drivers/infiniband/core/cma.c stable/10/sys/ofed/drivers/infiniband/core/iwcm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Mar 3 17:53:22 2017 (r314605) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Mar 3 17:57:17 2017 (r314606) @@ -90,9 +90,7 @@ static void *alloc_ep(int size, gfp_t fl void __free_ep(struct c4iw_ep_common *epc); static struct rtentry * find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, __be16 peer_port, u8 tos); -static int close_socket(struct c4iw_ep_common *epc, int close); -static int shutdown_socket(struct c4iw_ep_common *epc); -static void abort_socket(struct c4iw_ep *ep); +static void close_socket(struct socket *so); static int send_mpa_req(struct c4iw_ep *ep); static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); @@ -109,7 +107,8 @@ static void process_peer_close(struct c4 static void process_conn_error(struct c4iw_ep *ep); static void process_close_complete(struct c4iw_ep *ep); static void ep_timeout(unsigned long arg); -static void init_sock(struct c4iw_ep_common *epc); +static void init_iwarp_socket(struct socket *so, void *arg); +static void uninit_iwarp_socket(struct socket *so); static void process_data(struct c4iw_ep *ep); static void process_connected(struct c4iw_ep *ep); static int c4iw_so_upcall(struct socket *so, void *arg, int waitflag); @@ -319,87 +318,12 @@ find_route(__be32 local_ip, __be32 peer_ return iproute.ro_rt; } -static int -close_socket(struct c4iw_ep_common *epc, int close) -{ - struct socket *so = epc->so; - int rc; - - CTR5(KTR_IW_CXGBE, "%s:csoB so %p, ep %p, state %s, tid %d", __func__, - so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - mutex_lock(&epc->so_mutex); - if ((so == NULL) || (so->so_count == 0)) { - mutex_unlock(&epc->so_mutex); - CTR5(KTR_IW_CXGBE, "%s:cso1 so %p, ep %p, state %s, tid %d", - __func__, so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - return -EINVAL; - } - - SOCK_LOCK(so); - soupcall_clear(so, SO_RCV); - SOCK_UNLOCK(so); - - if (close) - rc = soclose(so); - else - rc = soshutdown(so, SHUT_WR | SHUT_RD); - epc->so = NULL; - - mutex_unlock(&epc->so_mutex); - return (rc); -} - -static int -shutdown_socket(struct c4iw_ep_common *epc) -{ - - struct socket *so = epc->so; - int rc; - - CTR5(KTR_IW_CXGBE, "%s:ssoB so %p, ep %p, state %s, tid %d", __func__, - epc->so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - mutex_lock(&epc->so_mutex); - if ((so == NULL) || (so->so_count == 0)) { - mutex_unlock(&epc->so_mutex); - CTR5(KTR_IW_CXGBE, "%s:sso1 so %p, ep %p, state %s, tid %d", - __func__, epc->so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - return -EINVAL; - } - rc = soshutdown(so, SHUT_WR); - mutex_unlock(&epc->so_mutex); - return rc; -} - static void -abort_socket(struct c4iw_ep *ep) +close_socket(struct socket *so) { - struct sockopt sopt; - int rc; - struct linger l; - - CTR5(KTR_IW_CXGBE, "%s ep %p so %p state %s tid %d", __func__, ep, - ep->com.so, states[ep->com.state], ep->hwtid); - mutex_lock(&ep->com.so_mutex); - l.l_onoff = 1; - l.l_linger = 0; - /* linger_time of 0 forces RST to be sent */ - sopt.sopt_dir = SOPT_SET; - sopt.sopt_level = SOL_SOCKET; - sopt.sopt_name = SO_LINGER; - sopt.sopt_val = (caddr_t)&l; - sopt.sopt_valsize = sizeof l; - sopt.sopt_td = NULL; - rc = sosetopt(ep->com.so, &sopt); - if (rc) { - log(LOG_ERR, "%s: can't set linger to 0, no RST! err %d\n", - __func__, rc); - } - mutex_unlock(&ep->com.so_mutex); + uninit_iwarp_socket(so); + sodisconnect(so); } static void @@ -429,7 +353,7 @@ process_peer_close(struct c4iw_ep *ep) disconnect = 0; STOP_EP_TIMER(ep); - close_socket(&ep->com, 0); + close_socket(ep->com.so); deref_cm_id(&ep->com); release = 1; break; @@ -486,7 +410,7 @@ process_peer_close(struct c4iw_ep *ep) c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); } - close_socket(&ep->com, 0); + close_socket(ep->com.so); close_complete_upcall(ep, 0); __state_set(&ep->com, DEAD); release = 1; @@ -595,14 +519,7 @@ process_conn_error(struct c4iw_ep *ep) } if (state != ABORTING) { - if (ep->parent_ep) { - CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 1); - } else { - CTR2(KTR_IW_CXGBE, "%s:pce2 %p", __func__, ep); - close_socket(&ep->com, 0); - } - + close_socket(ep->com.so); __state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } @@ -648,16 +565,7 @@ process_close_complete(struct c4iw_ep *e &attrs, 1); } - if (ep->parent_ep) { - - CTR2(KTR_IW_CXGBE, "%s:pcc3 %p", __func__, ep); - close_socket(&ep->com, 1); - } - else { - - CTR2(KTR_IW_CXGBE, "%s:pcc4 %p", __func__, ep); - close_socket(&ep->com, 0); - } + close_socket(ep->com.so); close_complete_upcall(ep, 0); __state_set(&ep->com, DEAD); release = 1; @@ -688,23 +596,15 @@ process_close_complete(struct c4iw_ep *e } static void -init_sock(struct c4iw_ep_common *epc) +init_iwarp_socket(struct socket *so, void *arg) { int rc; struct sockopt sopt; - struct socket *so = epc->so; int on = 1; - mutex_lock(&epc->so_mutex); - if ((so == NULL) || (so->so_count == 0)) { - mutex_unlock(&epc->so_mutex); - CTR5(KTR_IW_CXGBE, "%s:iso1 so %p, ep %p, state %s, tid %d", - __func__, so, epc, states[epc->state], - ((struct c4iw_ep *)epc)->hwtid); - return; - } + /* Note that SOCK_LOCK(so) is same as SOCKBUF_LOCK(&so->so_rcv) */ SOCK_LOCK(so); - soupcall_set(so, SO_RCV, c4iw_so_upcall, epc); + soupcall_set(so, SO_RCV, c4iw_so_upcall, arg); so->so_state |= SS_NBIO; SOCK_UNLOCK(so); sopt.sopt_dir = SOPT_SET; @@ -718,7 +618,15 @@ init_sock(struct c4iw_ep_common *epc) log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n", __func__, so, rc); } - mutex_unlock(&epc->so_mutex); +} + +static void +uninit_iwarp_socket(struct socket *so) +{ + + SOCKBUF_LOCK(&so->so_rcv); + soupcall_clear(so, SO_RCV); + SOCKBUF_UNLOCK(&so->so_rcv); } static void @@ -759,18 +667,18 @@ process_data(struct c4iw_ep *ep) static void process_connected(struct c4iw_ep *ep) { + struct socket *so = ep->com.so; - if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) { + if ((so->so_state & SS_ISCONNECTED) && !so->so_error) { if (send_mpa_req(ep)) goto err; - } - else { - connect_reply_upcall(ep, -ep->com.so->so_error); + } else { + connect_reply_upcall(ep, -so->so_error); goto err; } return; err: - close_socket(&ep->com, 0); + close_socket(so); state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); return; @@ -785,23 +693,9 @@ process_newconn(struct iw_cm_id *parent_ struct c4iw_ep *parent_ep = parent_cm_id->provider_data; int ret = 0; - if (!child_so) { - CTR4(KTR_IW_CXGBE, - "%s: parent so %p, parent ep %p, child so %p, invalid so", - __func__, parent_ep->com.so, parent_ep, child_so); - log(LOG_ERR, "%s: invalid child socket\n", __func__); - return; - } - child_ep = alloc_ep(sizeof(*child_ep), M_NOWAIT); - if (!child_ep) { - CTR3(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, ENOMEM", - __func__, parent_ep->com.so, parent_ep); - log(LOG_ERR, "%s: failed to allocate ep entry\n", __func__); - return; - } - SOCKBUF_LOCK(&child_so->so_rcv); - soupcall_set(child_so, SO_RCV, c4iw_so_upcall, child_ep); - SOCKBUF_UNLOCK(&child_so->so_rcv); + MPASS(child_so != NULL); + + child_ep = alloc_ep(sizeof(*child_ep), M_WAITOK); CTR5(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, child so %p, child ep %p", @@ -821,6 +715,7 @@ process_newconn(struct iw_cm_id *parent_ free(local, M_SONAME); free(remote, M_SONAME); + init_iwarp_socket(child_so, &child_ep->com); c4iw_get_ep(&parent_ep->com); init_timer(&child_ep->timer); state_set(&child_ep->com, MPA_REQ_WAIT); @@ -1052,7 +947,6 @@ alloc_ep(int size, gfp_t gfp) kref_init(&epc->kref); mutex_init(&epc->mutex); - mutex_init(&epc->so_mutex); c4iw_init_wr_wait(&epc->wr_wait); return (epc); @@ -1373,30 +1267,47 @@ static void close_complete_upcall(struct CTR2(KTR_IW_CXGBE, "%s:ccuE %p", __func__, ep); } -static int send_abort(struct c4iw_ep *ep) +static int +send_abort(struct c4iw_ep *ep) { - int err; + struct socket *so = ep->com.so; + struct sockopt sopt; + int rc; + struct linger l; - CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep); - abort_socket(ep); + CTR5(KTR_IW_CXGBE, "%s ep %p so %p state %s tid %d", __func__, ep, so, + states[ep->com.state], ep->hwtid); - /* - * Since socket options were set as l_onoff=1 and l_linger=0 in in - * abort_socket, invoking soclose here sends a RST (reset) to the peer. - */ - err = close_socket(&ep->com, 1); + l.l_onoff = 1; + l.l_linger = 0; + + /* linger_time of 0 forces RST to be sent */ + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_LINGER; + sopt.sopt_val = (caddr_t)&l; + sopt.sopt_valsize = sizeof l; + sopt.sopt_td = NULL; + rc = sosetopt(so, &sopt); + if (rc != 0) { + log(LOG_ERR, "%s: sosetopt(%p, linger = 0) failed with %d.\n", + __func__, so, rc); + } + + uninit_iwarp_socket(so); + sodisconnect(so); set_bit(ABORT_CONN, &ep->com.history); - CTR2(KTR_IW_CXGBE, "%s:abE %p", __func__, ep); /* - * TBD: iw_cgbe driver should receive ABORT reply for every ABORT + * TBD: iw_cxgbe driver should receive ABORT reply for every ABORT * request it has sent. But the current TOE driver is not propagating * this ABORT reply event (via do_abort_rpl) to iw_cxgbe. So as a work- * around de-refer 'ep' (which was refered before sending ABORT request) * here instead of doing it in abort_rpl() handler of iw_cxgbe driver. */ c4iw_put_ep(&ep->com); - return err; + + return (0); } static void peer_close_upcall(struct c4iw_ep *ep) @@ -2227,7 +2138,6 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct c4iw_dev *dev = to_c4iw_dev(cm_id->device); struct c4iw_ep *ep = NULL; struct rtentry *rt; - struct toedev *tdev; CTR2(KTR_IW_CXGBE, "%s:ccB %p", __func__, cm_id); @@ -2280,8 +2190,6 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->com.thread = curthread; ep->com.so = cm_id->so; - init_sock(&ep->com); - /* find a route */ rt = find_route( cm_id->local_addr.sin_addr.s_addr, @@ -2297,22 +2205,11 @@ int c4iw_connect(struct iw_cm_id *cm_id, goto fail2; } - if (!(rt->rt_ifp->if_capenable & IFCAP_TOE)) { - - CTR2(KTR_IW_CXGBE, "%s:cc8 %p", __func__, ep); - printf("%s - interface not TOE capable.\n", __func__); - close_socket(&ep->com, 0); + if (!(rt->rt_ifp->if_capenable & IFCAP_TOE) || + TOEDEV(rt->rt_ifp) == NULL) { err = -ENOPROTOOPT; goto fail3; } - tdev = TOEDEV(rt->rt_ifp); - - if (tdev == NULL) { - - CTR2(KTR_IW_CXGBE, "%s:cc9 %p", __func__, ep); - printf("%s - No toedev for interface.\n", __func__); - goto fail3; - } RTFREE(rt); state_set(&ep->com, CONNECTING); @@ -2323,19 +2220,18 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->com.thread); if (!err) { - CTR2(KTR_IW_CXGBE, "%s:cca %p", __func__, ep); + init_iwarp_socket(cm_id->so, &ep->com); goto out; } else { - close_socket(&ep->com, 0); goto fail2; } fail3: - CTR2(KTR_IW_CXGBE, "%s:ccb %p", __func__, ep); RTFREE(rt); fail2: deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); + ep = NULL; /* CTR shouldn't display already-freed ep. */ out: CTR2(KTR_IW_CXGBE, "%s:ccE %p", __func__, ep); return err; @@ -2479,7 +2375,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *e if (!ep->parent_ep) __state_set(&ep->com, MORIBUND); - ret = shutdown_socket(&ep->com); + ret = sodisconnect(ep->com.so); } if (ret) { Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Mar 3 17:53:22 2017 (r314605) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Mar 3 17:57:17 2017 (r314606) @@ -754,7 +754,6 @@ struct c4iw_ep_common { int rpl_done; struct thread *thread; struct socket *so; - struct mutex so_mutex; }; struct c4iw_listen_ep { Modified: stable/10/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/cma.c Fri Mar 3 17:53:22 2017 (r314605) +++ stable/10/sys/ofed/drivers/infiniband/core/cma.c Fri Mar 3 17:57:17 2017 (r314606) @@ -962,8 +962,6 @@ static void cma_release_port(struct rdma kfree(bind_list); } mutex_unlock(&lock); - if (id_priv->sock) - sock_release(id_priv->sock); } static void cma_leave_mc_groups(struct rdma_id_private *id_priv) Modified: stable/10/sys/ofed/drivers/infiniband/core/iwcm.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/iwcm.c Fri Mar 3 17:53:22 2017 (r314605) +++ stable/10/sys/ofed/drivers/infiniband/core/iwcm.c Fri Mar 3 17:57:17 2017 (r314606) @@ -525,24 +525,15 @@ iw_init_sock(struct iw_cm_id *cm_id) } static int -iw_close_socket(struct iw_cm_id *cm_id, int close) +iw_uninit_socket(struct iw_cm_id *cm_id) { struct socket *so = cm_id->so; - int rc; - SOCK_LOCK(so); soupcall_clear(so, SO_RCV); SOCK_UNLOCK(so); - if (close) - rc = soclose(so); - else - rc = soshutdown(so, SHUT_WR | SHUT_RD); - - cm_id->so = NULL; - - return rc; + return (0); } static int @@ -551,18 +542,17 @@ iw_create_listen(struct iw_cm_id *cm_id, int rc; iw_init_sock(cm_id); - rc = solisten(cm_id->so, backlog, curthread); + rc = -solisten(cm_id->so, backlog, curthread); if (rc != 0) - iw_close_socket(cm_id, 0); - return rc; + iw_uninit_socket(cm_id); + return (rc); } static int iw_destroy_listen(struct iw_cm_id *cm_id) { - int rc; - rc = iw_close_socket(cm_id, 0); - return rc; + + return (iw_uninit_socket(cm_id)); } @@ -660,6 +650,9 @@ void iw_destroy_cm_id(struct iw_cm_id *c wait_for_completion(&cm_id_priv->destroy_comp); + if (cm_id->so) + sock_release(cm_id->so); + free_cm_id(cm_id_priv); } EXPORT_SYMBOL(iw_destroy_cm_id); From owner-svn-src-stable@freebsd.org Fri Mar 3 21:35:11 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B51BCF79ED; Fri, 3 Mar 2017 21:35:11 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 0A7861954; Fri, 3 Mar 2017 21:35:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23LZA0G092348; Fri, 3 Mar 2017 21:35:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23LZA7u092347; Fri, 3 Mar 2017 21:35:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032135.v23LZA7u092347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314628 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:35:11 -0000 Author: bdrewery Date: Fri Mar 3 21:35:09 2017 New Revision: 314628 URL: https://svnweb.freebsd.org/changeset/base/314628 Log: MFC r313184: Remove LOCAL_LIB_DIRS warning added in r275839. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Mar 3 21:32:27 2017 (r314627) +++ stable/11/Makefile.inc1 Fri Mar 3 21:35:09 2017 (r314628) @@ -245,8 +245,6 @@ _REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIR .for _DIR in ${LOCAL_LIB_DIRS} .if empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile) SUBDIR+= ${_DIR} -.else -.warning ${_DIR} not added to SUBDIR list. See UPDATING 20141121. .endif .endfor From owner-svn-src-stable@freebsd.org Fri Mar 3 21:37:34 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF54BCF7AA5; Fri, 3 Mar 2017 21:37:34 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 8E75F1AE1; Fri, 3 Mar 2017 21:37:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23LbX9j092478; Fri, 3 Mar 2017 21:37:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23LbX6u092477; Fri, 3 Mar 2017 21:37:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032137.v23LbX6u092477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314629 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:37:34 -0000 Author: bdrewery Date: Fri Mar 3 21:37:33 2017 New Revision: 314629 URL: https://svnweb.freebsd.org/changeset/base/314629 Log: MFC r313163: native-xtools: Add missing readelf. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Mar 3 21:35:09 2017 (r314628) +++ stable/11/Makefile.inc1 Fri Mar 3 21:37:33 2017 (r314629) @@ -1918,6 +1918,7 @@ native-xtools: .PHONY usr.bin/mktemp \ usr.bin/mt \ usr.bin/patch \ + usr.bin/readelf \ usr.bin/sed \ usr.bin/sort \ usr.bin/tar \ From owner-svn-src-stable@freebsd.org Fri Mar 3 21:38:36 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3052BCF7B38; Fri, 3 Mar 2017 21:38:36 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id F3AC21D1B; Fri, 3 Mar 2017 21:38:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23LcZ6p092680; Fri, 3 Mar 2017 21:38:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23LcZaZ092679; Fri, 3 Mar 2017 21:38:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032138.v23LcZaZ092679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314630 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:38:36 -0000 Author: bdrewery Date: Fri Mar 3 21:38:34 2017 New Revision: 314630 URL: https://svnweb.freebsd.org/changeset/base/314630 Log: MFC r313904: META_MODE+xdev: Don't rebuild build-tools during normal build. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Mar 3 21:37:33 2017 (r314629) +++ stable/11/Makefile.inc1 Fri Mar 3 21:38:34 2017 (r314630) @@ -2471,6 +2471,10 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} +.if ${MK_META_MODE} != "no" +# Don't rebuild build-tools targets during normal build. +CD2MAKE+= BUILD_TOOLS_META=.NOMETA_CMP +.endif XDDESTDIR=${DESTDIR}/${XDTP} .if !defined(OSREL) OSREL!= uname -r | sed -e 's/[-(].*//' From owner-svn-src-stable@freebsd.org Fri Mar 3 21:39:38 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0574FCF7BBD; Fri, 3 Mar 2017 21:39:38 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id C89C51E53; Fri, 3 Mar 2017 21:39:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23LdaH3092770; Fri, 3 Mar 2017 21:39:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23Ldae3092769; Fri, 3 Mar 2017 21:39:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032139.v23Ldae3092769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314631 - stable/11/usr.bin/timeout X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:39:38 -0000 Author: bdrewery Date: Fri Mar 3 21:39:36 2017 New Revision: 314631 URL: https://svnweb.freebsd.org/changeset/base/314631 Log: MFC r314001: Make it more clear that -k sends SIGKILL, not the -s signal. Modified: stable/11/usr.bin/timeout/timeout.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/timeout/timeout.1 ============================================================================== --- stable/11/usr.bin/timeout/timeout.1 Fri Mar 3 21:38:34 2017 (r314630) +++ stable/11/usr.bin/timeout/timeout.1 Fri Mar 3 21:39:36 2017 (r314631) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 17, 2017 +.Dd February 20, 2017 .Dt TIMEOUT 1 .Os .Sh NAME @@ -68,7 +68,9 @@ By default, .Ar SIGTERM . is sent. .It Fl k Ar time , Fl -kill-after Ar time -Send a second kill signal if +Send a +.Ar SIGKILL +signal if .Ar command is still running after .Ar time From owner-svn-src-stable@freebsd.org Fri Mar 3 21:41:19 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 117B9CF7CAE; Fri, 3 Mar 2017 21:41:19 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id D08E6105C; Fri, 3 Mar 2017 21:41:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23LfH0b093639; Fri, 3 Mar 2017 21:41:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23LfHij093638; Fri, 3 Mar 2017 21:41:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032141.v23LfHij093638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314632 - stable/10/usr.bin/timeout X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:41:19 -0000 Author: bdrewery Date: Fri Mar 3 21:41:17 2017 New Revision: 314632 URL: https://svnweb.freebsd.org/changeset/base/314632 Log: MFC r313867,r313869,r313870,r314001: r313867: Add history and Authors section in the manpage r313869: Also add vsevolod@ in the authors r313870: Use full name for the month r314001: Make it more clear that -k sends SIGKILL, not the -s signal. Modified: stable/10/usr.bin/timeout/timeout.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/timeout/timeout.1 ============================================================================== --- stable/10/usr.bin/timeout/timeout.1 Fri Mar 3 21:39:36 2017 (r314631) +++ stable/10/usr.bin/timeout/timeout.1 Fri Mar 3 21:41:17 2017 (r314632) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 28, 2014 +.Dd February 20, 2017 .Dt TIMEOUT 1 .Os .Sh NAME @@ -68,7 +68,9 @@ By default, .Ar SIGTERM . is sent. .It Fl k Ar time , Fl -kill-after Ar time -Send a second kill signal if +Send a +.Ar SIGKILL +signal if .Ar command is still running after .Ar time @@ -127,3 +129,12 @@ the exit status return is 125. .Sh SEE ALSO .Xr kill 1 , .Xr signal 3 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 10.3 . +.Sh AUTHORS +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org +and +.An Vsevolod Stakhov Aq Mt vsevolod@FreeBSD.org From owner-svn-src-stable@freebsd.org Fri Mar 3 21:41:27 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9949CF7D4B; Fri, 3 Mar 2017 21:41:27 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 829241101; Fri, 3 Mar 2017 21:41:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23LfQfZ093689; Fri, 3 Mar 2017 21:41:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23LfQub093688; Fri, 3 Mar 2017 21:41:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032141.v23LfQub093688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314633 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:41:27 -0000 Author: bdrewery Date: Fri Mar 3 21:41:26 2017 New Revision: 314633 URL: https://svnweb.freebsd.org/changeset/base/314633 Log: MFC r313905: xdev: Build yacc which is needed for recent libpcap updates. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Mar 3 21:41:17 2017 (r314632) +++ stable/11/Makefile.inc1 Fri Mar 3 21:41:26 2017 (r314633) @@ -2494,7 +2494,8 @@ _xb-worldtmp: .PHONY _xb-bootstrap-tools: .PHONY .for _tool in \ ${_clang_tblgen} \ - ${_gperf} + ${_gperf} \ + ${_yacc} ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ From owner-svn-src-stable@freebsd.org Fri Mar 3 21:43:05 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01853CF7199; Fri, 3 Mar 2017 21:43:05 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id B40531657; Fri, 3 Mar 2017 21:43:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23Lh3OY096983; Fri, 3 Mar 2017 21:43:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23Lh3fS096979; Fri, 3 Mar 2017 21:43:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032143.v23Lh3fS096979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314634 - in stable/11: contrib/libc-vis contrib/netbsd-tests/lib/libc/locale lib/libc/tests/nss X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:43:05 -0000 Author: bdrewery Date: Fri Mar 3 21:43:03 2017 New Revision: 314634 URL: https://svnweb.freebsd.org/changeset/base/314634 Log: MFC r309626,r309627,r309659: r309626: strvis(3): Avoid internal state of multibyte functions being tainted. r309627: Remove unneeded hack fixed by r309626. r309659: Support spaces in group names. Modified: stable/11/contrib/libc-vis/vis.c stable/11/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c stable/11/lib/libc/tests/nss/getgr_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libc-vis/vis.c ============================================================================== --- stable/11/contrib/libc-vis/vis.c Fri Mar 3 21:41:26 2017 (r314633) +++ stable/11/contrib/libc-vis/vis.c Fri Mar 3 21:43:03 2017 (r314634) @@ -353,12 +353,14 @@ makeextralist(int flags, const char *src wchar_t *dst, *d; size_t len; const wchar_t *s; + mbstate_t mbstate; + bzero(&mbstate, sizeof(mbstate)); len = strlen(src); if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) return NULL; - if ((flags & VIS_NOLOCALE) || mbstowcs(dst, src, len) == (size_t)-1) { + if ((flags & VIS_NOLOCALE) || mbsrtowcs(dst, &src, len, &mbstate) == (size_t)-1) { size_t i; for (i = 0; i < len; i++) dst[i] = (wchar_t)(u_char)src[i]; @@ -400,6 +402,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, int clen = 0, cerr, error = -1, i, shft; char *mbdst, *mdst; ssize_t mbslength, maxolen; + mbstate_t mbstate; _DIAGASSERT(mbdstp != NULL); _DIAGASSERT(mbsrc != NULL || mblength == 0); @@ -456,10 +459,11 @@ istrsenvisx(char **mbdstp, size_t *dlen, */ if (mbslength == 1) mbslength++; + bzero(&mbstate, sizeof(mbstate)); while (mbslength > 0) { /* Convert one multibyte character to wchar_t. */ if (!cerr) - clen = mbtowc(src, mbsrc, MB_LEN_MAX); + clen = mbrtowc(src, mbsrc, MB_LEN_MAX, &mbstate); if (cerr || clen < 0) { /* Conversion error, process as a byte instead. */ *src = (wint_t)(u_char)*mbsrc; @@ -530,9 +534,10 @@ istrsenvisx(char **mbdstp, size_t *dlen, len = wcslen(start); maxolen = dlen ? *dlen : (wcslen(start) * MB_LEN_MAX + 1); olen = 0; + bzero(&mbstate, sizeof(mbstate)); for (dst = start; len > 0; len--) { if (!cerr) - clen = wctomb(mbdst, *dst); + clen = wcrtomb(mbdst, *dst, &mbstate); if (cerr || clen < 0) { /* * Conversion error, process as a byte(s) instead. Modified: stable/11/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Fri Mar 3 21:41:26 2017 (r314633) +++ stable/11/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Fri Mar 3 21:43:03 2017 (r314634) @@ -137,16 +137,10 @@ ATF_TC_BODY(mbtowc, tc) h_mbtowc("ja_JP.ISO2022-JP", "\033$B", "\033$B$\"\033(B"); h_mbtowc("ja_JP.SJIS", "\202", "\202\240"); h_mbtowc("ja_JP.eucJP", "\244", "\244\242"); -#ifndef __FreeBSD__ /* Moved last as it fails */ h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); -#endif h_mbtowc("zh_TW.Big5", "\241", "\241@"); h_mbtowc("zh_TW.eucTW", "\241", "\241\241"); -#ifdef __FreeBSD__ - atf_tc_expect_fail("zh_CN.GB18030"); - h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); -#endif } ATF_TP_ADD_TCS(tp) Modified: stable/11/lib/libc/tests/nss/getgr_test.c ============================================================================== --- stable/11/lib/libc/tests/nss/getgr_test.c Fri Mar 3 21:41:26 2017 (r314633) +++ stable/11/lib/libc/tests/nss/getgr_test.c Fri Mar 3 21:43:03 2017 (r314634) @@ -176,7 +176,7 @@ sdump_group(struct group *grp, char *buf char **cp; int written; - written = snprintf(buffer, buflen, "%s %s %d", + written = snprintf(buffer, buflen, "%s:%s:%d:", grp->gr_name, grp->gr_passwd, grp->gr_gid); buffer += written; if (written > buflen) @@ -186,7 +186,8 @@ sdump_group(struct group *grp, char *buf if (grp->gr_mem != NULL) { if (*(grp->gr_mem) != '\0') { for (cp = grp->gr_mem; *cp; ++cp) { - written = snprintf(buffer, buflen, " %s",*cp); + written = snprintf(buffer, buflen, "%s%s", + cp == grp->gr_mem ? "" : ",", *cp); buffer += written; if (written > buflen) return; @@ -196,9 +197,9 @@ sdump_group(struct group *grp, char *buf return; } } else - snprintf(buffer, buflen, " nomem"); + snprintf(buffer, buflen, "nomem"); } else - snprintf(buffer, buflen, " (null)"); + snprintf(buffer, buflen, "(null)"); } static int @@ -206,6 +207,7 @@ group_read_snapshot_func(struct group *g { StringList *sl; char *s, *ps, *ts; + const char *sep; int i; printf("1 line read from snapshot:\n%s\n", line); @@ -213,8 +215,9 @@ group_read_snapshot_func(struct group *g i = 0; sl = NULL; ps = line; + sep = ":"; memset(grp, 0, sizeof(struct group)); - while ((s = strsep(&ps, " ")) != NULL) { + while ((s = strsep(&ps, sep)) != NULL) { switch (i) { case 0: grp->gr_name = strdup(s); @@ -235,6 +238,8 @@ group_read_snapshot_func(struct group *g grp->gr_passwd = NULL; return (-1); } + /* Change to parsing groups. */ + sep = ","; break; default: From owner-svn-src-stable@freebsd.org Fri Mar 3 21:46:31 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 635F9CF73BB; Fri, 3 Mar 2017 21:46:31 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 327B01914; Fri, 3 Mar 2017 21:46:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23LkUWs097188; Fri, 3 Mar 2017 21:46:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23LkUJl097187; Fri, 3 Mar 2017 21:46:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703032146.v23LkUJl097187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 3 Mar 2017 21:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314635 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 21:46:31 -0000 Author: bdrewery Date: Fri Mar 3 21:46:30 2017 New Revision: 314635 URL: https://svnweb.freebsd.org/changeset/base/314635 Log: MFC r313907: xdev: Fix after libc++ update in r300873. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Mar 3 21:43:03 2017 (r314634) +++ stable/11/Makefile.inc1 Fri Mar 3 21:46:30 2017 (r314635) @@ -2461,10 +2461,25 @@ CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREF INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ TOOLS_PREFIX=${XDTP} -CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \ - --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \ - -B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib -CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \ + +.if ${WANT_COMPILER_TYPE} == gcc || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) +# GCC requires -isystem and -L when using a cross-compiler. --sysroot +# won't set header path and -L is used to ensure the base library path +# is added before the port PREFIX library path. +CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib +# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler +# combined with --sysroot. +CD2CFLAGS+= -B${XDDESTDIR}/usr/lib +# Force using libc++ for external GCC. +# XXX: This should be checking MK_GNUCXX == no +.if ${X_COMPILER_VERSION} >= 40800 +CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ +.endif +.endif +CD2CFLAGS+= --sysroot=${XDDESTDIR}/ +CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" \ CPP="${CPP} ${CD2CFLAGS}" \ MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} From owner-svn-src-stable@freebsd.org Sat Mar 4 00:33:43 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 046D2CF5AF5; Sat, 4 Mar 2017 00:33:43 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id C7C471DC9; Sat, 4 Mar 2017 00:33:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v240XfgJ065873; Sat, 4 Mar 2017 00:33:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v240XfKn065872; Sat, 4 Mar 2017 00:33:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703040033.v240XfKn065872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Mar 2017 00:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314639 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 00:33:43 -0000 Author: kib Date: Sat Mar 4 00:33:41 2017 New Revision: 314639 URL: https://svnweb.freebsd.org/changeset/base/314639 Log: MFC r314490: Add some explanation for SV_TIMEKEEP flag. Modified: stable/11/sys/sys/sysent.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/sysent.h ============================================================================== --- stable/11/sys/sys/sysent.h Fri Mar 3 22:51:04 2017 (r314638) +++ stable/11/sys/sys/sysent.h Sat Mar 4 00:33:41 2017 (r314639) @@ -138,7 +138,7 @@ struct sysentvec { #define SV_AOUT 0x008000 /* a.out executable. */ #define SV_SHP 0x010000 /* Shared page. */ #define SV_CAPSICUM 0x020000 /* Force cap_enter() on startup. */ -#define SV_TIMEKEEP 0x040000 +#define SV_TIMEKEEP 0x040000 /* Shared page timehands. */ #define SV_ABI_MASK 0xff #define SV_ABI_ERRNO(p, e) ((p)->p_sysent->sv_errsize <= 0 ? e : \ From owner-svn-src-stable@freebsd.org Sat Mar 4 12:04:20 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AF5ACF7F84; Sat, 4 Mar 2017 12:04:20 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 230A71A12; Sat, 4 Mar 2017 12:04:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24C4Jfk047539; Sat, 4 Mar 2017 12:04:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24C4J6b047538; Sat, 4 Mar 2017 12:04:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703041204.v24C4J6b047538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 4 Mar 2017 12:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314661 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 12:04:20 -0000 Author: avg Date: Sat Mar 4 12:04:19 2017 New Revision: 314661 URL: https://svnweb.freebsd.org/changeset/base/314661 Log: MFC r314357: edge-triggered interrupt mode is set by clearing APIC_LVT_TM Modified: stable/11/sys/x86/x86/local_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Sat Mar 4 11:45:18 2017 (r314660) +++ stable/11/sys/x86/x86/local_apic.c Sat Mar 4 12:04:19 2017 (r314661) @@ -398,7 +398,7 @@ lvt_mode(struct lapic *la, u_int pin, ui if (!lvt->lvt_edgetrigger && bootverbose) { printf("lapic%u: Forcing LINT%u to edge trigger\n", la->la_id, pin); - value |= APIC_LVT_TM; + value &= ~APIC_LVT_TM; } /* Use a vector of 0. */ break; From owner-svn-src-stable@freebsd.org Sat Mar 4 12:04:26 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77E0CCF7FCB; Sat, 4 Mar 2017 12:04:26 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 40B931A51; Sat, 4 Mar 2017 12:04:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24C4Pbp047591; Sat, 4 Mar 2017 12:04:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24C4PPk047590; Sat, 4 Mar 2017 12:04:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703041204.v24C4PPk047590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 4 Mar 2017 12:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314662 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 12:04:26 -0000 Author: avg Date: Sat Mar 4 12:04:24 2017 New Revision: 314662 URL: https://svnweb.freebsd.org/changeset/base/314662 Log: MFC r314357: edge-triggered interrupt mode is set by clearing APIC_LVT_TM Modified: stable/10/sys/x86/x86/local_apic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/local_apic.c ============================================================================== --- stable/10/sys/x86/x86/local_apic.c Sat Mar 4 12:04:19 2017 (r314661) +++ stable/10/sys/x86/x86/local_apic.c Sat Mar 4 12:04:24 2017 (r314662) @@ -206,7 +206,7 @@ lvt_mode(struct lapic *la, u_int pin, ui if (!lvt->lvt_edgetrigger) { printf("lapic%u: Forcing LINT%u to edge trigger\n", la->la_id, pin); - value |= APIC_LVT_TM; + value &= ~APIC_LVT_TM; } /* Use a vector of 0. */ break; From owner-svn-src-stable@freebsd.org Sat Mar 4 12:05:48 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E8F7CF80DA; Sat, 4 Mar 2017 12:05:48 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id DE2871CDD; Sat, 4 Mar 2017 12:05:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24C5kPS047724; Sat, 4 Mar 2017 12:05:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24C5kGa047719; Sat, 4 Mar 2017 12:05:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703041205.v24C5kGa047719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 4 Mar 2017 12:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314663 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 12:05:48 -0000 Author: avg Date: Sat Mar 4 12:05:46 2017 New Revision: 314663 URL: https://svnweb.freebsd.org/changeset/base/314663 Log: MFC r314272: call vm_lowmem hook in uma_reclaim_worker Modified: stable/11/sys/vm/uma_core.c stable/11/sys/vm/vm_kern.c stable/11/sys/vm/vm_pageout.c stable/11/sys/vm/vm_pageout.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/uma_core.c Sat Mar 4 12:05:46 2017 (r314663) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3199,6 +3200,9 @@ uma_reclaim_worker(void *arg __unused) "umarcl", 0); if (uma_reclaim_needed) { uma_reclaim_needed = 0; + sx_xunlock(&uma_drain_lock); + EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM); + sx_xlock(&uma_drain_lock); uma_reclaim_locked(true); } } Modified: stable/11/sys/vm/vm_kern.c ============================================================================== --- stable/11/sys/vm/vm_kern.c Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/vm_kern.c Sat Mar 4 12:05:46 2017 (r314663) @@ -549,11 +549,13 @@ debug_vm_lowmem(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &i, 0, req); if (error) return (error); - if (i) - EVENTHANDLER_INVOKE(vm_lowmem, 0); + if ((i & ~(VM_LOW_KMEM | VM_LOW_PAGES)) != 0) + return (EINVAL); + if (i != 0) + EVENTHANDLER_INVOKE(vm_lowmem, i); return (0); } SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem, CTLTYPE_INT | CTLFLAG_RW, 0, 0, - debug_vm_lowmem, "I", "set to trigger vm_lowmem event"); + debug_vm_lowmem, "I", "set to trigger vm_lowmem event with given flags"); #endif Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/vm_pageout.c Sat Mar 4 12:05:46 2017 (r314663) @@ -871,7 +871,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * Decrease registered cache sizes. */ SDT_PROBE0(vm, , , vm__lowmem_scan); - EVENTHANDLER_INVOKE(vm_lowmem, 0); + EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_PAGES); /* * We do this explicitly after the caches have been * drained above. Modified: stable/11/sys/vm/vm_pageout.h ============================================================================== --- stable/11/sys/vm/vm_pageout.h Sat Mar 4 12:04:24 2017 (r314662) +++ stable/11/sys/vm/vm_pageout.h Sat Mar 4 12:05:46 2017 (r314663) @@ -87,6 +87,12 @@ extern bool vm_pages_needed; #define VM_OOM_SWAPZ 2 /* + * vm_lowmem flags. + */ +#define VM_LOW_KMEM 0x01 +#define VM_LOW_PAGES 0x02 + +/* * Exported routines. */ From owner-svn-src-stable@freebsd.org Sat Mar 4 12:05:52 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B940CF8115; Sat, 4 Mar 2017 12:05:52 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id BF9BE1CF0; Sat, 4 Mar 2017 12:05:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24C5owc047777; Sat, 4 Mar 2017 12:05:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24C5oqx047773; Sat, 4 Mar 2017 12:05:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703041205.v24C5oqx047773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 4 Mar 2017 12:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314664 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 12:05:52 -0000 Author: avg Date: Sat Mar 4 12:05:50 2017 New Revision: 314664 URL: https://svnweb.freebsd.org/changeset/base/314664 Log: MFC r314272: call vm_lowmem hook in uma_reclaim_worker Modified: stable/10/sys/vm/uma_core.c stable/10/sys/vm/vm_kern.c stable/10/sys/vm/vm_pageout.c stable/10/sys/vm/vm_pageout.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sat Mar 4 12:05:46 2017 (r314663) +++ stable/10/sys/vm/uma_core.c Sat Mar 4 12:05:50 2017 (r314664) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3244,6 +3245,9 @@ uma_reclaim_worker(void *arg __unused) "umarcl", 0); if (uma_reclaim_needed) { uma_reclaim_needed = 0; + sx_xunlock(&uma_drain_lock); + EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM); + sx_xlock(&uma_drain_lock); uma_reclaim_locked(true); } } Modified: stable/10/sys/vm/vm_kern.c ============================================================================== --- stable/10/sys/vm/vm_kern.c Sat Mar 4 12:05:46 2017 (r314663) +++ stable/10/sys/vm/vm_kern.c Sat Mar 4 12:05:50 2017 (r314664) @@ -542,11 +542,13 @@ debug_vm_lowmem(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &i, 0, req); if (error) return (error); - if (i) - EVENTHANDLER_INVOKE(vm_lowmem, 0); + if ((i & ~(VM_LOW_KMEM | VM_LOW_PAGES)) != 0) + return (EINVAL); + if (i != 0) + EVENTHANDLER_INVOKE(vm_lowmem, i); return (0); } SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem, CTLTYPE_INT | CTLFLAG_RW, 0, 0, - debug_vm_lowmem, "I", "set to trigger vm_lowmem event"); + debug_vm_lowmem, "I", "set to trigger vm_lowmem event with given flags"); #endif Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Sat Mar 4 12:05:46 2017 (r314663) +++ stable/10/sys/vm/vm_pageout.c Sat Mar 4 12:05:50 2017 (r314664) @@ -962,7 +962,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * Decrease registered cache sizes. */ SDT_PROBE0(vm, , , vm__lowmem_scan); - EVENTHANDLER_INVOKE(vm_lowmem, 0); + EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_PAGES); /* * We do this explicitly after the caches have been * drained above. Modified: stable/10/sys/vm/vm_pageout.h ============================================================================== --- stable/10/sys/vm/vm_pageout.h Sat Mar 4 12:05:46 2017 (r314663) +++ stable/10/sys/vm/vm_pageout.h Sat Mar 4 12:05:50 2017 (r314664) @@ -87,6 +87,12 @@ extern int vm_pageout_page_count; #define VM_OOM_SWAPZ 2 /* + * vm_lowmem flags. + */ +#define VM_LOW_KMEM 0x01 +#define VM_LOW_PAGES 0x02 + +/* * Exported routines. */ From owner-svn-src-stable@freebsd.org Sat Mar 4 12:42:53 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAD79CF8F2A; Sat, 4 Mar 2017 12:42:53 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id C2C4B1016; Sat, 4 Mar 2017 12:42:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24Cgqk3064357; Sat, 4 Mar 2017 12:42:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24CgqOj064354; Sat, 4 Mar 2017 12:42:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703041242.v24CgqOj064354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 4 Mar 2017 12:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314665 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 12:42:54 -0000 Author: avg Date: Sat Mar 4 12:42:52 2017 New Revision: 314665 URL: https://svnweb.freebsd.org/changeset/base/314665 Log: MFC r314273: zfs: call spa_deadman on a taskqueue thread Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Mar 4 12:05:50 2017 (r314664) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Mar 4 12:42:52 2017 (r314665) @@ -173,10 +173,6 @@ uint_t zio_taskq_basedc = 80; /* base boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ extern int zfs_sync_pass_deferred_free; -#ifndef illumos -extern void spa_deadman(void *arg); -#endif - /* * This (illegal) pool name is used when temporarily importing a spa_t in order * to get the vdev stats associated with the imported devices. @@ -6880,8 +6876,8 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_sync_starttime + spa->spa_deadman_synctime)); #else /* !illumos */ #ifdef _KERNEL - callout_reset(&spa->spa_deadman_cycid, - hz * spa->spa_deadman_synctime / NANOSEC, spa_deadman, spa); + callout_schedule(&spa->spa_deadman_cycid, + hz * spa->spa_deadman_synctime / NANOSEC); #endif #endif /* illumos */ Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Mar 4 12:05:50 2017 (r314664) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Mar 4 12:42:52 2017 (r314665) @@ -597,8 +597,8 @@ spa_lookup(const char *name) * If the zfs_deadman_enabled flag is set then it inspects all vdev queues * looking for potentially hung I/Os. */ -void -spa_deadman(void *arg) +static void +spa_deadman(void *arg, int pending) { spa_t *spa = arg; @@ -627,6 +627,16 @@ spa_deadman(void *arg) #endif } +#if defined(__FreeBSD__) && defined(_KERNEL) +static void +spa_deadman_timeout(void *arg) +{ + spa_t *spa = arg; + + taskqueue_enqueue(taskqueue_thread, &spa->spa_deadman_task); +} +#endif + /* * Create an uninitialized spa_t with the given name. Requires * spa_namespace_lock. The caller must ensure that the spa_t doesn't already @@ -698,7 +708,23 @@ spa_add(const char *name, nvlist_t *conf mutex_exit(&cpu_lock); #else /* !illumos */ #ifdef _KERNEL + /* + * callout(9) does not provide a way to initialize a callout with + * a function and an argument, so we use callout_reset() to schedule + * the callout in the very distant future. Even if that event ever + * fires, it should be okayas we won't have any active zio-s. + * But normally spa_sync() will reschedule the callout with a proper + * timeout. + * callout(9) does not allow the callback function to sleep but + * vdev_deadman() needs to acquire vq_lock and illumos mutexes are + * emulated using sx(9). For this reason spa_deadman_timeout() + * will schedule spa_deadman() as task on a taskqueue that allows + * sleeping. + */ + TASK_INIT(&spa->spa_deadman_task, 0, spa_deadman, spa); callout_init(&spa->spa_deadman_cycid, 1); + callout_reset_sbt(&spa->spa_deadman_cycid, SBT_MAX, 0, + spa_deadman_timeout, spa, 0); #endif #endif refcount_create(&spa->spa_refcount); @@ -811,6 +837,7 @@ spa_remove(spa_t *spa) #else /* !illumos */ #ifdef _KERNEL callout_drain(&spa->spa_deadman_cycid); + taskqueue_drain(taskqueue_thread, &spa->spa_deadman_task); #endif #endif Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Mar 4 12:05:50 2017 (r314664) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Mar 4 12:42:52 2017 (r314665) @@ -267,6 +267,7 @@ struct spa { #else /* !illumos */ #ifdef _KERNEL struct callout spa_deadman_cycid; /* callout id */ + struct task spa_deadman_task; #endif #endif /* illumos */ uint64_t spa_deadman_calls; /* number of deadman calls */ From owner-svn-src-stable@freebsd.org Sat Mar 4 13:03:40 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 362AFCF959D; Sat, 4 Mar 2017 13:03:40 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id C7F831D6F; Sat, 4 Mar 2017 13:03:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24D3c3S072801; Sat, 4 Mar 2017 13:03:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24D3Vfi072728; Sat, 4 Mar 2017 13:03:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703041303.v24D3Vfi072728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 4 Mar 2017 13:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314667 - in stable/10/sys: amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs cddl/dev/profile compat/ndis contrib/ipfilter/netinet dev/a... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 13:03:40 -0000 Author: avg Date: Sat Mar 4 13:03:31 2017 New Revision: 314667 URL: https://svnweb.freebsd.org/changeset/base/314667 Log: MFC r283291: don't use CALLOUT_MPSAFE with callout_init() The main purpose of this MFC is to reduce conflicts for other merges. Parts of the original change have already "trickled down" via individual MFCs. Modified: stable/10/sys/amd64/amd64/mp_watchdog.c stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/dev/profile/profile.c stable/10/sys/compat/ndis/subr_ntoskrnl.c stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c stable/10/sys/dev/ath/if_ath.c stable/10/sys/dev/ce/if_ce.c stable/10/sys/dev/cp/if_cp.c stable/10/sys/dev/ctau/if_ct.c stable/10/sys/dev/cx/if_cx.c stable/10/sys/dev/cxgb/cxgb_main.c stable/10/sys/dev/cxgb/cxgb_sge.c stable/10/sys/dev/dcons/dcons_os.c stable/10/sys/dev/drm2/drm_irq.c stable/10/sys/dev/drm2/i915/intel_display.c stable/10/sys/dev/glxsb/glxsb.c stable/10/sys/dev/gxemul/cons/gxemul_cons.c stable/10/sys/dev/hifn/hifn7751.c stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/if_ndis/if_ndis.c stable/10/sys/dev/isci/isci_io_request.c stable/10/sys/dev/mfi/mfi.c stable/10/sys/dev/mwl/if_mwl.c stable/10/sys/dev/nand/nandsim_chip.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/nxge/if_nxge.c stable/10/sys/dev/oce/oce_if.c stable/10/sys/dev/patm/if_patm_attach.c stable/10/sys/dev/rndtest/rndtest.c stable/10/sys/dev/safe/safe.c stable/10/sys/dev/sound/midi/mpu401.c stable/10/sys/dev/sound/pci/atiixp.c stable/10/sys/dev/sound/pci/es137x.c stable/10/sys/dev/sound/pci/hda/hdaa.c stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/via8233.c stable/10/sys/dev/twa/tw_osl_freebsd.c stable/10/sys/dev/tws/tws.c stable/10/sys/dev/ubsec/ubsec.c stable/10/sys/dev/virtio/random/virtio_random.c stable/10/sys/dev/xen/netfront/netfront.c stable/10/sys/fs/nfs/nfs_commonport.c stable/10/sys/gdb/gdb_cons.c stable/10/sys/geom/gate/g_gate.c stable/10/sys/geom/journal/g_journal.c stable/10/sys/geom/mirror/g_mirror.c stable/10/sys/geom/raid3/g_raid3.c stable/10/sys/geom/sched/gs_rr.c stable/10/sys/i386/i386/mp_watchdog.c stable/10/sys/kern/init_main.c stable/10/sys/kern/kern_synch.c stable/10/sys/kern/kern_thread.c stable/10/sys/kern/subr_vmem.c stable/10/sys/kern/uipc_domain.c stable/10/sys/mips/cavium/octe/ethernet.c stable/10/sys/mips/cavium/octeon_rnd.c stable/10/sys/mips/nlm/dev/net/xlpge.c stable/10/sys/mips/rmi/dev/xlr/rge.c stable/10/sys/net/if_spppsubr.c stable/10/sys/net80211/ieee80211_ht.c stable/10/sys/net80211/ieee80211_hwmp.c stable/10/sys/net80211/ieee80211_mesh.c stable/10/sys/net80211/ieee80211_node.c stable/10/sys/net80211/ieee80211_proto.c stable/10/sys/netgraph/netflow/ng_netflow.c stable/10/sys/netgraph/netgraph.h stable/10/sys/netinet/in_pcb.c stable/10/sys/netinet/ip_mroute.c stable/10/sys/netinet/tcp_hostcache.c stable/10/sys/netinet/tcp_subr.c stable/10/sys/netinet6/in6_rmx.c stable/10/sys/netpfil/ipfw/ip_dummynet.c stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c stable/10/sys/netpfil/pf/if_pfsync.c stable/10/sys/ofed/include/linux/timer.h stable/10/sys/ofed/include/linux/workqueue.h stable/10/sys/powerpc/mambo/mambo_console.c stable/10/sys/powerpc/pseries/phyp_console.c stable/10/sys/sys/callout.h stable/10/sys/vm/uma_core.c stable/10/sys/x86/x86/mca.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_watchdog.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_watchdog.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/amd64/amd64/mp_watchdog.c Sat Mar 4 13:03:31 2017 (r314667) @@ -86,7 +86,7 @@ static void watchdog_init(void *arg) { - callout_init(&watchdog_callout, CALLOUT_MPSAFE); + callout_init(&watchdog_callout, 1); if (watchdog_cpu != -1) watchdog_change(watchdog_cpu); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Mar 4 13:03:31 2017 (r314667) @@ -14284,8 +14284,8 @@ dtrace_state_create(struct cdev *dev) state->dts_cleaner = CYCLIC_NONE; state->dts_deadman = CYCLIC_NONE; #else - callout_init(&state->dts_cleaner, CALLOUT_MPSAFE); - callout_init(&state->dts_deadman, CALLOUT_MPSAFE); + callout_init(&state->dts_cleaner, 1); + callout_init(&state->dts_deadman, 1); #endif state->dts_vstate.dtvs_state = state; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Mar 4 13:03:31 2017 (r314667) @@ -698,7 +698,7 @@ spa_add(const char *name, nvlist_t *conf mutex_exit(&cpu_lock); #else /* !illumos */ #ifdef _KERNEL - callout_init(&spa->spa_deadman_cycid, CALLOUT_MPSAFE); + callout_init(&spa->spa_deadman_cycid, 1); #endif #endif refcount_create(&spa->spa_refcount); Modified: stable/10/sys/cddl/dev/profile/profile.c ============================================================================== --- stable/10/sys/cddl/dev/profile/profile.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/cddl/dev/profile/profile.c Sat Mar 4 13:03:31 2017 (r314667) @@ -330,7 +330,7 @@ profile_create(hrtime_t interval, char * prof->prof_cyclic = CYCLIC_NONE; #else prof->prof_interval = nsec_to_sbt(interval); - callout_init(&prof->prof_cyclic, CALLOUT_MPSAFE); + callout_init(&prof->prof_cyclic, 1); #endif prof->prof_kind = kind; prof->prof_id = dtrace_probe_create(profile_id, @@ -578,7 +578,7 @@ profile_enable_omni(profile_probe_t *pro pcpu->profc_probe = prof; pcpu->profc_expected = sbinuptime() + prof->prof_interval; pcpu->profc_interval = prof->prof_interval; - callout_init(&pcpu->profc_cyclic, CALLOUT_MPSAFE); + callout_init(&pcpu->profc_cyclic, 1); callout_reset_sbt_on(&pcpu->profc_cyclic, pcpu->profc_expected, 0, profile_fire, pcpu, cpu, C_DIRECT_EXEC | C_ABSOLUTE); Modified: stable/10/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- stable/10/sys/compat/ndis/subr_ntoskrnl.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/compat/ndis/subr_ntoskrnl.c Sat Mar 4 13:03:31 2017 (r314667) @@ -3746,7 +3746,7 @@ ntoskrnl_insert_timer(timer, ticks) timer->k_callout = c; - callout_init(c, CALLOUT_MPSAFE); + callout_init(c, 1); callout_reset(c, ticks, ntoskrnl_timercall, timer); } Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Mar 4 13:03:31 2017 (r314667) @@ -190,7 +190,7 @@ ipf_timer_func(arg) #if 0 softc->ipf_slow_ch = timeout(ipf_timer_func, softc, hz/2); #endif - callout_init(&softc->ipf_slow_ch, CALLOUT_MPSAFE); + callout_init(&softc->ipf_slow_ch, 1); callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT, ipf_timer_func, softc); @@ -238,7 +238,7 @@ ipfattach(softc) softc->ipf_slow_ch = timeout(ipf_timer_func, softc, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); #endif - callout_init(&softc->ipf_slow_ch, CALLOUT_MPSAFE); + callout_init(&softc->ipf_slow_ch, 1); callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT, ipf_timer_func, softc); return 0; Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c ============================================================================== --- stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Sat Mar 4 13:03:31 2017 (r314667) @@ -454,11 +454,11 @@ altera_jtag_uart_attach(struct altera_jt aju_intr_readable_enable(sc); AJU_UNLOCK(sc); } else { - callout_init(&sc->ajus_io_callout, CALLOUT_MPSAFE); + callout_init(&sc->ajus_io_callout, 1); callout_reset(&sc->ajus_io_callout, AJU_IO_POLLINTERVAL, aju_io_callout, sc); } - callout_init(&sc->ajus_ac_callout, CALLOUT_MPSAFE); + callout_init(&sc->ajus_ac_callout, 1); callout_reset(&sc->ajus_ac_callout, AJU_AC_POLLINTERVAL, aju_ac_callout, sc); return (0); Modified: stable/10/sys/dev/ath/if_ath.c ============================================================================== --- stable/10/sys/dev/ath/if_ath.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/ath/if_ath.c Sat Mar 4 13:03:31 2017 (r314667) @@ -547,7 +547,7 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_ledstate = 1; sc->sc_ledon = 0; /* low true */ sc->sc_ledidle = (2700*hz)/1000; /* 2.7sec */ - callout_init(&sc->sc_ledtimer, CALLOUT_MPSAFE); + callout_init(&sc->sc_ledtimer, 1); /* * Don't setup hardware-based blinking. Modified: stable/10/sys/dev/ce/if_ce.c ============================================================================== --- stable/10/sys/dev/ce/if_ce.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/ce/if_ce.c Sat Mar 4 13:03:31 2017 (r314667) @@ -103,10 +103,6 @@ __FBSDID("$FreeBSD$"); #define CE_DEBUG2(d,s) ({if (d->chan->debug>1) {\ printf ("%s: ", d->name); printf s;}}) -#ifndef CALLOUT_MPSAFE -#define CALLOUT_MPSAFE 0 -#endif - #ifndef IF_DRAIN #define IF_DRAIN(ifq) do { \ struct mbuf *m; \ @@ -625,7 +621,7 @@ static int ce_attach (device_t dev) return (ENXIO); } #if __FreeBSD_version >= 500000 - callout_init (&led_timo[unit], CALLOUT_MPSAFE); + callout_init (&led_timo[unit], 1); #else callout_init (&led_timo[unit]); #endif @@ -677,7 +673,7 @@ static int ce_attach (device_t dev) continue; d = c->sys; - callout_init (&d->timeout_handle, CALLOUT_MPSAFE); + callout_init (&d->timeout_handle, 1); #ifdef NETGRAPH if (ng_make_node_common (&typestruct, &d->node) != 0) { printf ("%s: cannot make common node\n", d->name); @@ -2580,7 +2576,7 @@ static int ce_modevent (module_t mod, in cdevsw_add (&ce_cdevsw); #endif #if __FreeBSD_version >= 500000 - callout_init (&timeout_handle, CALLOUT_MPSAFE); + callout_init (&timeout_handle, 1); #else callout_init (&timeout_handle); #endif Modified: stable/10/sys/dev/cp/if_cp.c ============================================================================== --- stable/10/sys/dev/cp/if_cp.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/cp/if_cp.c Sat Mar 4 13:03:31 2017 (r314667) @@ -461,7 +461,7 @@ static int cp_attach (device_t dev) splx (s); return (ENXIO); } - callout_init (&led_timo[unit], CALLOUT_MPSAFE); + callout_init (&led_timo[unit], 1); error = bus_setup_intr (dev, bd->cp_irq, INTR_TYPE_NET|INTR_MPSAFE, NULL, cp_intr, bd, &bd->cp_intrhand); @@ -490,7 +490,7 @@ static int cp_attach (device_t dev) d->board = b; d->chan = c; c->sys = d; - callout_init (&d->timeout_handle, CALLOUT_MPSAFE); + callout_init (&d->timeout_handle, 1); #ifdef NETGRAPH if (ng_make_node_common (&typestruct, &d->node) != 0) { printf ("%s: cannot make common node\n", d->name); @@ -2240,7 +2240,7 @@ static int cp_modevent (module_t mod, in printf ("Failed to register ng_cp\n"); #endif ++load_count; - callout_init (&timeout_handle, CALLOUT_MPSAFE); + callout_init (&timeout_handle, 1); callout_reset (&timeout_handle, hz*5, cp_timeout, 0); break; case MOD_UNLOAD: Modified: stable/10/sys/dev/ctau/if_ct.c ============================================================================== --- stable/10/sys/dev/ctau/if_ct.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/ctau/if_ct.c Sat Mar 4 13:03:31 2017 (r314667) @@ -663,7 +663,7 @@ static int ct_attach (device_t dev) return ENXIO; } - callout_init (&led_timo[unit], CALLOUT_MPSAFE); + callout_init (&led_timo[unit], 1); s = splimp (); if (bus_setup_intr (dev, bd->irq_res, INTR_TYPE_NET|INTR_MPSAFE, @@ -702,7 +702,7 @@ static int ct_attach (device_t dev) c->sys = d; channel [b->num*NCHAN + c->num] = d; sprintf (d->name, "ct%d.%d", b->num, c->num); - callout_init (&d->timeout_handle, CALLOUT_MPSAFE); + callout_init (&d->timeout_handle, 1); #ifdef NETGRAPH if (ng_make_node_common (&typestruct, &d->node) != 0) { @@ -2180,7 +2180,7 @@ static int ct_modevent (module_t mod, in printf ("Failed to register ng_ct\n"); #endif ++load_count; - callout_init (&timeout_handle, CALLOUT_MPSAFE); + callout_init (&timeout_handle, 1); callout_reset (&timeout_handle, hz*5, ct_timeout, 0); break; case MOD_UNLOAD: Modified: stable/10/sys/dev/cx/if_cx.c ============================================================================== --- stable/10/sys/dev/cx/if_cx.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/cx/if_cx.c Sat Mar 4 13:03:31 2017 (r314667) @@ -762,7 +762,7 @@ static int cx_attach (device_t dev) return ENXIO; } b->sys = bd; - callout_init (&led_timo[b->num], CALLOUT_MPSAFE); + callout_init (&led_timo[b->num], 1); s = splhigh (); if (bus_setup_intr (dev, bd->irq_res, INTR_TYPE_NET|INTR_MPSAFE, @@ -812,7 +812,7 @@ static int cx_attach (device_t dev) case T_UNIV_RS232: case T_UNIV_RS449: case T_UNIV_V35: - callout_init (&d->timeout_handle, CALLOUT_MPSAFE); + callout_init (&d->timeout_handle, 1); #ifdef NETGRAPH if (ng_make_node_common (&typestruct, &d->node) != 0) { printf ("%s: cannot make common node\n", d->name); @@ -883,7 +883,7 @@ static int cx_attach (device_t dev) ttycreate(d->tty, TS_CALLOUT, "x%r%r", b->num, c->num); d->devt = make_dev (&cx_cdevsw, b->num*NCHAN + c->num + 64, UID_ROOT, GID_WHEEL, 0600, "cx%d", b->num*NCHAN + c->num); d->devt->si_drv1 = d; - callout_init (&d->dcd_timeout_handle, CALLOUT_MPSAFE); + callout_init (&d->dcd_timeout_handle, 1); } splx (s); @@ -2514,7 +2514,7 @@ static int cx_modevent (module_t mod, in #endif ++load_count; - callout_init (&timeout_handle, CALLOUT_MPSAFE); + callout_init (&timeout_handle, 1); callout_reset (&timeout_handle, hz*5, cx_timeout, 0); /* Software interrupt. */ swi_add(&tty_intr_event, "cx", cx_softintr, NULL, SWI_TTY, Modified: stable/10/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/10/sys/dev/cxgb/cxgb_main.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/cxgb/cxgb_main.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1009,7 +1009,7 @@ cxgb_port_attach(device_t dev) device_get_unit(device_get_parent(dev)), p->port_id); PORT_LOCK_INIT(p, p->lockbuf); - callout_init(&p->link_check_ch, CALLOUT_MPSAFE); + callout_init(&p->link_check_ch, 1); TASK_INIT(&p->link_check_task, 0, check_link_status, p); /* Allocate an ifnet object and set it up */ Modified: stable/10/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/10/sys/dev/cxgb/cxgb_sge.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/cxgb/cxgb_sge.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1013,7 +1013,7 @@ sge_timer_cb(void *arg) int t3_sge_init_adapter(adapter_t *sc) { - callout_init(&sc->sge_timer_ch, CALLOUT_MPSAFE); + callout_init(&sc->sge_timer_ch, 1); callout_reset(&sc->sge_timer_ch, TX_RECLAIM_PERIOD, sge_timer_cb, sc); TASK_INIT(&sc->slow_intr_task, 0, sge_slow_intr_handler, sc); return (0); Modified: stable/10/sys/dev/dcons/dcons_os.c ============================================================================== --- stable/10/sys/dev/dcons/dcons_os.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/dcons/dcons_os.c Sat Mar 4 13:03:31 2017 (r314667) @@ -374,7 +374,7 @@ dcons_attach(void) dcons_attach_port(DCONS_CON, "dcons", 0); dcons_attach_port(DCONS_GDB, "dgdb", DC_GDB); - callout_init(&dcons_callout, CALLOUT_MPSAFE); + callout_init(&dcons_callout, 1); polltime = hz / poll_hz; callout_reset(&dcons_callout, polltime, dcons_timeout, NULL); return(0); Modified: stable/10/sys/dev/drm2/drm_irq.c ============================================================================== --- stable/10/sys/dev/drm2/drm_irq.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/drm2/drm_irq.c Sat Mar 4 13:03:31 2017 (r314667) @@ -210,7 +210,7 @@ int drm_vblank_init(struct drm_device *d { int i, ret = -ENOMEM; - callout_init(&dev->vblank_disable_callout, CALLOUT_MPSAFE); + callout_init(&dev->vblank_disable_callout, 1); mtx_init(&dev->vbl_lock, "drmvbl", NULL, MTX_DEF); mtx_init(&dev->vblank_time_lock, "drmvtl", NULL, MTX_DEF); Modified: stable/10/sys/dev/drm2/i915/intel_display.c ============================================================================== --- stable/10/sys/dev/drm2/i915/intel_display.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/drm2/i915/intel_display.c Sat Mar 4 13:03:31 2017 (r314667) @@ -6449,7 +6449,7 @@ static void intel_crtc_init(struct drm_d intel_crtc->busy = false; - callout_init(&intel_crtc->idle_callout, CALLOUT_MPSAFE); + callout_init(&intel_crtc->idle_callout, 1); } int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, @@ -7038,7 +7038,7 @@ void intel_modeset_init(struct drm_devic intel_setup_outputs(dev); TASK_INIT(&dev_priv->idle_task, 0, intel_idle_update, dev_priv); - callout_init(&dev_priv->idle_callout, CALLOUT_MPSAFE); + callout_init(&dev_priv->idle_callout, 1); } void intel_modeset_gem_init(struct drm_device *dev) Modified: stable/10/sys/dev/glxsb/glxsb.c ============================================================================== --- stable/10/sys/dev/glxsb/glxsb.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/glxsb/glxsb.c Sat Mar 4 13:03:31 2017 (r314667) @@ -331,7 +331,7 @@ glxsb_attach(device_t dev) sc->sc_rnghz = hz / 100; else sc->sc_rnghz = 1; - callout_init(&sc->sc_rngco, CALLOUT_MPSAFE); + callout_init(&sc->sc_rngco, 1); glxsb_rnd(sc); return (0); Modified: stable/10/sys/dev/gxemul/cons/gxemul_cons.c ============================================================================== --- stable/10/sys/dev/gxemul/cons/gxemul_cons.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/gxemul/cons/gxemul_cons.c Sat Mar 4 13:03:31 2017 (r314667) @@ -279,7 +279,7 @@ gxemul_cons_ttyinit(void *unused) tp = tty_alloc(&gxemul_cons_ttydevsw, NULL); tty_init_console(tp, 0); tty_makedev(tp, NULL, "%s", "ttyu0"); - callout_init(&gxemul_cons_callout, CALLOUT_MPSAFE); + callout_init(&gxemul_cons_callout, 1); callout_reset(&gxemul_cons_callout, gxemul_cons_polltime, gxemul_cons_timeout, tp); Modified: stable/10/sys/dev/hifn/hifn7751.c ============================================================================== --- stable/10/sys/dev/hifn/hifn7751.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/hifn/hifn7751.c Sat Mar 4 13:03:31 2017 (r314667) @@ -590,7 +590,7 @@ hifn_attach(device_t dev) if (sc->sc_flags & (HIFN_HAS_PUBLIC | HIFN_HAS_RNG)) hifn_init_pubrng(sc); - callout_init(&sc->sc_tickto, CALLOUT_MPSAFE); + callout_init(&sc->sc_tickto, 1); callout_reset(&sc->sc_tickto, hz, hifn_tick, sc); return (0); @@ -768,7 +768,7 @@ hifn_init_pubrng(struct hifn_softc *sc) sc->sc_rnghz = hz / 100; else sc->sc_rnghz = 1; - callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); + callout_init(&sc->sc_rngto, 1); callout_reset(&sc->sc_rngto, sc->sc_rnghz, hifn_rng, sc); } Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1553,7 +1553,7 @@ storvsc_action(struct cam_sim *sim, unio #ifdef notyet if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { - callout_init(&reqp->callout, CALLOUT_MPSAFE); + callout_init(&reqp->callout, 1); callout_reset_sbt(&reqp->callout, SBT_1MS * ccb->ccb_h.timeout, 0, storvsc_timeout, reqp, 0); Modified: stable/10/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/10/sys/dev/if_ndis/if_ndis.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/if_ndis/if_ndis.c Sat Mar 4 13:03:31 2017 (r314667) @@ -557,7 +557,7 @@ ndis_attach(dev) InitializeListHead(&sc->ndis_shlist); InitializeListHead(&sc->ndisusb_tasklist); InitializeListHead(&sc->ndisusb_xferdonelist); - callout_init(&sc->ndis_stat_callout, CALLOUT_MPSAFE); + callout_init(&sc->ndis_stat_callout, 1); if (sc->ndis_iftype == PCMCIABus) { error = ndis_alloc_amem(sc); @@ -733,7 +733,7 @@ ndis_attach(dev) uint32_t arg; int r; - callout_init(&sc->ndis_scan_callout, CALLOUT_MPSAFE); + callout_init(&sc->ndis_scan_callout, 1); ifp->if_ioctl = ndis_ioctl_80211; ic->ic_ifp = ifp; Modified: stable/10/sys/dev/isci/isci_io_request.c ============================================================================== --- stable/10/sys/dev/isci/isci_io_request.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/isci/isci_io_request.c Sat Mar 4 13:03:31 2017 (r314667) @@ -680,7 +680,7 @@ isci_request_construct(struct ISCI_REQUE request->dma_tag = io_buffer_dma_tag; request->physical_address = physical_address; bus_dmamap_create(request->dma_tag, 0, &request->dma_map); - callout_init(&request->timer, CALLOUT_MPSAFE); + callout_init(&request->timer, 1); } static void Modified: stable/10/sys/dev/mfi/mfi.c ============================================================================== --- stable/10/sys/dev/mfi/mfi.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/mfi/mfi.c Sat Mar 4 13:03:31 2017 (r314667) @@ -788,7 +788,7 @@ mfi_attach(struct mfi_softc *sc) bus_generic_attach(sc->mfi_dev); /* Start the timeout watchdog */ - callout_init(&sc->mfi_watchdog_callout, CALLOUT_MPSAFE); + callout_init(&sc->mfi_watchdog_callout, 1); callout_reset(&sc->mfi_watchdog_callout, mfi_cmd_timeout * hz, mfi_timeout, sc); Modified: stable/10/sys/dev/mwl/if_mwl.c ============================================================================== --- stable/10/sys/dev/mwl/if_mwl.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/mwl/if_mwl.c Sat Mar 4 13:03:31 2017 (r314667) @@ -368,7 +368,7 @@ mwl_attach(uint16_t devid, struct mwl_so if (error != 0) /* NB: mwl_setupdma prints msg */ goto bad1; - callout_init(&sc->sc_timer, CALLOUT_MPSAFE); + callout_init(&sc->sc_timer, 1); callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); sc->sc_tq = taskqueue_create("mwl_taskq", M_NOWAIT, Modified: stable/10/sys/dev/nand/nandsim_chip.c ============================================================================== --- stable/10/sys/dev/nand/nandsim_chip.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/nand/nandsim_chip.c Sat Mar 4 13:03:31 2017 (r314667) @@ -94,7 +94,7 @@ nandsim_chip_init(struct nandsim_softc* return (NULL); mtx_init(&chip->ns_lock, "nandsim lock", NULL, MTX_DEF); - callout_init(&chip->ns_callout, CALLOUT_MPSAFE); + callout_init(&chip->ns_callout, 1); STAILQ_INIT(&chip->nandsim_events); chip->chip_num = chip_num; Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Mar 4 13:03:31 2017 (r314667) @@ -662,8 +662,8 @@ intel_ntb_attach(device_t device) ntb->msix_mw_idx = B2B_MW_DISABLED; /* Heartbeat timer for NTB_ATOM since there is no link interrupt */ - callout_init(&ntb->heartbeat_timer, CALLOUT_MPSAFE); - callout_init(&ntb->lr_timer, CALLOUT_MPSAFE); + callout_init(&ntb->heartbeat_timer, 1); + callout_init(&ntb->lr_timer, 1); callout_init(&ntb->peer_msix_work, 1); mtx_init(&ntb->db_mask_lock, "ntb hw bits", NULL, MTX_SPIN); Modified: stable/10/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/10/sys/dev/nxge/if_nxge.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/nxge/if_nxge.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1743,7 +1743,7 @@ xge_device_init(xge_lldev_t *lldev, xge_ return; /* Initializing timer */ - callout_init(&lldev->timer, CALLOUT_MPSAFE); + callout_init(&lldev->timer, 1); xge_trace(XGE_TRACE, "Set MTU size"); status = xge_hal_device_mtu_set(hldev, ifnetp->if_mtu); Modified: stable/10/sys/dev/oce/oce_if.c ============================================================================== --- stable/10/sys/dev/oce/oce_if.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/oce/oce_if.c Sat Mar 4 13:03:31 2017 (r314667) @@ -341,7 +341,7 @@ oce_attach(device_t dev) oce_add_sysctls(sc); - callout_init(&sc->timer, CALLOUT_MPSAFE); + callout_init(&sc->timer, 1); rc = callout_reset(&sc->timer, 2 * hz, oce_local_timer, sc); if (rc) goto stats_free; Modified: stable/10/sys/dev/patm/if_patm_attach.c ============================================================================== --- stable/10/sys/dev/patm/if_patm_attach.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/patm/if_patm_attach.c Sat Mar 4 13:03:31 2017 (r314667) @@ -207,7 +207,7 @@ patm_attach(device_t dev) mtx_init(&sc->tst_lock, "tst lock", NULL, MTX_DEF); cv_init(&sc->vcc_cv, "vcc_close"); - callout_init(&sc->tst_callout, CALLOUT_MPSAFE); + callout_init(&sc->tst_callout, 1); sysctl_ctx_init(&sc->sysctl_ctx); Modified: stable/10/sys/dev/rndtest/rndtest.c ============================================================================== --- stable/10/sys/dev/rndtest/rndtest.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/rndtest/rndtest.c Sat Mar 4 13:03:31 2017 (r314667) @@ -98,7 +98,7 @@ rndtest_attach(device_t dev) #if __FreeBSD_version < 500000 callout_init(&rsp->rs_to); #else - callout_init(&rsp->rs_to, CALLOUT_MPSAFE); + callout_init(&rsp->rs_to, 1); #endif } else device_printf(dev, "rndtest_init: no memory for state block\n"); Modified: stable/10/sys/dev/safe/safe.c ============================================================================== --- stable/10/sys/dev/safe/safe.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/safe/safe.c Sat Mar 4 13:03:31 2017 (r314667) @@ -425,7 +425,7 @@ safe_attach(device_t dev) #endif safe_rng_init(sc); - callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); + callout_init(&sc->sc_rngto, 1); callout_reset(&sc->sc_rngto, hz*safe_rnginterval, safe_rng, sc); } #endif /* SAFE_NO_RNG */ Modified: stable/10/sys/dev/sound/midi/mpu401.c ============================================================================== --- stable/10/sys/dev/sound/midi/mpu401.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/sound/midi/mpu401.c Sat Mar 4 13:03:31 2017 (r314667) @@ -185,7 +185,7 @@ mpu401_init(kobj_class_t cls, void *cook kobj_init((kobj_t)m, cls); - callout_init(&m->timer, CALLOUT_MPSAFE); + callout_init(&m->timer, 1); m->si = softintr; m->cookie = cookie; Modified: stable/10/sys/dev/sound/pci/atiixp.c ============================================================================== --- stable/10/sys/dev/sound/pci/atiixp.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/sound/pci/atiixp.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1193,7 +1193,7 @@ atiixp_pci_attach(device_t dev) sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_atiixp softc"); sc->dev = dev; - callout_init(&sc->poll_timer, CALLOUT_MPSAFE); + callout_init(&sc->poll_timer, 1); sc->poll_ticks = 1; if (resource_int_value(device_get_name(sc->dev), Modified: stable/10/sys/dev/sound/pci/es137x.c ============================================================================== --- stable/10/sys/dev/sound/pci/es137x.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/sound/pci/es137x.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1741,7 +1741,7 @@ es_pci_attach(device_t dev) es->st = rman_get_bustag(es->reg); es->sh = rman_get_bushandle(es->reg); - callout_init(&es->poll_timer, CALLOUT_MPSAFE); + callout_init(&es->poll_timer, 1); es->poll_ticks = 1; if (resource_int_value(device_get_name(dev), Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdaa.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/sound/pci/hda/hdaa.c Sat Mar 4 13:03:31 2017 (r314667) @@ -6592,7 +6592,7 @@ hdaa_attach(device_t dev) devinfo->newquirks = -1; devinfo->newgpio = -1; devinfo->newgpo = -1; - callout_init(&devinfo->poll_jack, CALLOUT_MPSAFE); + callout_init(&devinfo->poll_jack, 1); devinfo->poll_ival = hz; hdaa_lock(devinfo); Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1116,7 +1116,7 @@ hdac_attach(device_t dev) sc->lock = snd_mtxcreate(device_get_nameunit(dev), "HDA driver mutex"); sc->dev = dev; TASK_INIT(&sc->unsolq_task, 0, hdac_unsolq_task, sc); - callout_init(&sc->poll_callout, CALLOUT_MPSAFE); + callout_init(&sc->poll_callout, 1); for (i = 0; i < HDAC_CODEC_MAX; i++) sc->codecs[i].dev = NULL; if (devid >= 0) { Modified: stable/10/sys/dev/sound/pci/via8233.c ============================================================================== --- stable/10/sys/dev/sound/pci/via8233.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/sound/pci/via8233.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1175,7 +1175,7 @@ via_attach(device_t dev) "snd_via8233 softc"); via->dev = dev; - callout_init(&via->poll_timer, CALLOUT_MPSAFE); + callout_init(&via->poll_timer, 1); via->poll_ticks = 1; if (resource_int_value(device_get_name(dev), Modified: stable/10/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- stable/10/sys/dev/twa/tw_osl_freebsd.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/twa/tw_osl_freebsd.c Sat Mar 4 13:03:31 2017 (r314667) @@ -423,8 +423,8 @@ twa_attach(device_t dev) } sc->watchdog_index = 0; - callout_init(&(sc->watchdog_callout[0]), CALLOUT_MPSAFE); - callout_init(&(sc->watchdog_callout[1]), CALLOUT_MPSAFE); + callout_init(&(sc->watchdog_callout[0]), 1); + callout_init(&(sc->watchdog_callout[1]), 1); callout_reset(&(sc->watchdog_callout[0]), 5*hz, twa_watchdog, &sc->ctlr_handle); return(0); Modified: stable/10/sys/dev/tws/tws.c ============================================================================== --- stable/10/sys/dev/tws/tws.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/tws/tws.c Sat Mar 4 13:03:31 2017 (r314667) @@ -198,7 +198,7 @@ tws_attach(device_t dev) mtx_init( &sc->sim_lock, "tws_sim_lock", NULL, MTX_DEF); mtx_init( &sc->gen_lock, "tws_gen_lock", NULL, MTX_DEF); mtx_init( &sc->io_lock, "tws_io_lock", NULL, MTX_DEF | MTX_RECURSE); - callout_init(&sc->stats_timer, CALLOUT_MPSAFE); + callout_init(&sc->stats_timer, 1); if ( tws_init_trace_q(sc) == FAILURE ) printf("trace init failure\n"); @@ -706,7 +706,7 @@ tws_init_reqs(struct tws_softc *sc, u_in sc->reqs[i].cmd_pkt->hdr.header_desc.size_header = 128; - callout_init(&sc->reqs[i].timeout, CALLOUT_MPSAFE); + callout_init(&sc->reqs[i].timeout, 1); sc->reqs[i].state = TWS_REQ_STATE_FREE; if ( i >= TWS_RESERVED_REQS ) tws_q_insert_tail(sc, &sc->reqs[i], TWS_FREE_Q); Modified: stable/10/sys/dev/ubsec/ubsec.c ============================================================================== --- stable/10/sys/dev/ubsec/ubsec.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/ubsec/ubsec.c Sat Mar 4 13:03:31 2017 (r314667) @@ -456,7 +456,7 @@ ubsec_attach(device_t dev) sc->sc_rnghz = hz / 100; else sc->sc_rnghz = 1; - callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); + callout_init(&sc->sc_rngto, 1); callout_reset(&sc->sc_rngto, sc->sc_rnghz, ubsec_rng, sc); skip_rng: ; Modified: stable/10/sys/dev/virtio/random/virtio_random.c ============================================================================== --- stable/10/sys/dev/virtio/random/virtio_random.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/virtio/random/virtio_random.c Sat Mar 4 13:03:31 2017 (r314667) @@ -129,7 +129,7 @@ vtrnd_attach(device_t dev) sc = device_get_softc(dev); sc->vtrnd_dev = dev; - callout_init(&sc->vtrnd_callout, CALLOUT_MPSAFE); + callout_init(&sc->vtrnd_callout, 1); virtio_set_feature_desc(dev, vtrnd_feature_desc); vtrnd_negotiate_features(sc); Modified: stable/10/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/10/sys/dev/xen/netfront/netfront.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/dev/xen/netfront/netfront.c Sat Mar 4 13:03:31 2017 (r314667) @@ -2132,7 +2132,7 @@ create_netdev(device_t dev) ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ether_ifattach(ifp, np->mac); - callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); + callout_init(&np->xn_stat_ch, 1); netfront_carrier_off(np); return (0); Modified: stable/10/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonport.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/fs/nfs/nfs_commonport.c Sat Mar 4 13:03:31 2017 (r314667) @@ -609,7 +609,7 @@ nfscommon_modevent(module_t mod, int typ mtx_init(&nfs_req_mutex, "nfs_req_mutex", NULL, MTX_DEF); mtx_init(&nfsrv_nfsuserdsock.nr_mtx, "nfsuserd", NULL, MTX_DEF); - callout_init(&newnfsd_callout, CALLOUT_MPSAFE); + callout_init(&newnfsd_callout, 1); newnfs_init(); nfsd_call_nfscommon = nfssvc_nfscommon; loaded = 1; Modified: stable/10/sys/gdb/gdb_cons.c ============================================================================== --- stable/10/sys/gdb/gdb_cons.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/gdb/gdb_cons.c Sat Mar 4 13:03:31 2017 (r314667) @@ -77,7 +77,7 @@ gdb_cninit(struct consdev *cp) /* setup tx buffer and callout */ if (c->npending == -1) { c->npending = 0; - callout_init(&c->flush, CALLOUT_MPSAFE); + callout_init(&c->flush, 1); cp->cn_arg = c; } } Modified: stable/10/sys/geom/gate/g_gate.c ============================================================================== --- stable/10/sys/geom/gate/g_gate.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/geom/gate/g_gate.c Sat Mar 4 13:03:31 2017 (r314667) @@ -487,7 +487,7 @@ g_gate_create(struct g_gate_ctl_create * if (sc->sc_queue_size > G_GATE_MAX_QUEUE_SIZE) sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE; sc->sc_timeout = ggio->gctl_timeout; - callout_init(&sc->sc_callout, CALLOUT_MPSAFE); + callout_init(&sc->sc_callout, 1); mtx_lock(&g_gate_units_lock); sc->sc_unit = g_gate_getunit(ggio->gctl_unit, &error); Modified: stable/10/sys/geom/journal/g_journal.c ============================================================================== --- stable/10/sys/geom/journal/g_journal.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/geom/journal/g_journal.c Sat Mar 4 13:03:31 2017 (r314667) @@ -2317,7 +2317,7 @@ g_journal_create(struct g_class *mp, str sc->sc_rootmount = root_mount_hold("GJOURNAL"); GJ_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); - callout_init(&sc->sc_callout, CALLOUT_MPSAFE); + callout_init(&sc->sc_callout, 1); if (md->md_type != GJ_TYPE_COMPLETE) { /* * Journal and data are on separate providers. Modified: stable/10/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/geom/mirror/g_mirror.c Sat Mar 4 13:03:31 2017 (r314667) @@ -2966,7 +2966,7 @@ g_mirror_create(struct g_class *mp, cons LIST_INIT(&sc->sc_disks); TAILQ_INIT(&sc->sc_events); mtx_init(&sc->sc_events_mtx, "gmirror:events", NULL, MTX_DEF); - callout_init(&sc->sc_callout, CALLOUT_MPSAFE); + callout_init(&sc->sc_callout, 1); mtx_init(&sc->sc_done_mtx, "gmirror:done", NULL, MTX_DEF); sc->sc_state = G_MIRROR_DEVICE_STATE_STARTING; gp->softc = sc; Modified: stable/10/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/10/sys/geom/raid3/g_raid3.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/geom/raid3/g_raid3.c Sat Mar 4 13:03:31 2017 (r314667) @@ -3165,7 +3165,7 @@ g_raid3_create(struct g_class *mp, const bioq_init(&sc->sc_sync_delayed); TAILQ_INIT(&sc->sc_events); mtx_init(&sc->sc_events_mtx, "graid3:events", NULL, MTX_DEF); - callout_init(&sc->sc_callout, CALLOUT_MPSAFE); + callout_init(&sc->sc_callout, 1); sc->sc_state = G_RAID3_DEVICE_STATE_STARTING; gp->softc = sc; sc->sc_geom = gp; Modified: stable/10/sys/geom/sched/gs_rr.c ============================================================================== --- stable/10/sys/geom/sched/gs_rr.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/geom/sched/gs_rr.c Sat Mar 4 13:03:31 2017 (r314667) @@ -602,7 +602,7 @@ g_rr_init(struct g_geom *geom) sc = malloc(sizeof *sc, M_GEOM_SCHED, M_NOWAIT | M_ZERO); sc->sc_geom = geom; TAILQ_INIT(&sc->sc_rr_tailq); - callout_init(&sc->sc_wait, CALLOUT_MPSAFE); + callout_init(&sc->sc_wait, 1); LIST_INSERT_HEAD(&me.sc_head, sc, sc_next); me.units++; Modified: stable/10/sys/i386/i386/mp_watchdog.c ============================================================================== --- stable/10/sys/i386/i386/mp_watchdog.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/i386/i386/mp_watchdog.c Sat Mar 4 13:03:31 2017 (r314667) @@ -86,7 +86,7 @@ static void watchdog_init(void *arg) { - callout_init(&watchdog_callout, CALLOUT_MPSAFE); + callout_init(&watchdog_callout, 1); if (watchdog_cpu != -1) watchdog_change(watchdog_cpu); } Modified: stable/10/sys/kern/init_main.c ============================================================================== --- stable/10/sys/kern/init_main.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/kern/init_main.c Sat Mar 4 13:03:31 2017 (r314667) @@ -511,7 +511,7 @@ proc0_init(void *dummy __unused) callout_init_mtx(&p->p_itcallout, &p->p_mtx, 0); callout_init_mtx(&p->p_limco, &p->p_mtx, 0); - callout_init(&td->td_slpcallout, CALLOUT_MPSAFE); + callout_init(&td->td_slpcallout, 1); /* Create credentials. */ newcred = crget(); Modified: stable/10/sys/kern/kern_synch.c ============================================================================== --- stable/10/sys/kern/kern_synch.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/kern/kern_synch.c Sat Mar 4 13:03:31 2017 (r314667) @@ -569,7 +569,7 @@ loadav(void *arg) static void synch_setup(void *dummy) { - callout_init(&loadav_callout, CALLOUT_MPSAFE); + callout_init(&loadav_callout, 1); /* Kick off timeout driven events by calling first time. */ loadav(NULL); Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/kern/kern_thread.c Sat Mar 4 13:03:31 2017 (r314667) @@ -551,7 +551,7 @@ thread_link(struct thread *td, struct pr LIST_INIT(&td->td_lprof[0]); LIST_INIT(&td->td_lprof[1]); sigqueue_init(&td->td_sigqueue, p); - callout_init(&td->td_slpcallout, CALLOUT_MPSAFE); + callout_init(&td->td_slpcallout, 1); TAILQ_INSERT_HEAD(&p->p_threads, td, td_plist); p->p_numthreads++; } Modified: stable/10/sys/kern/subr_vmem.c ============================================================================== --- stable/10/sys/kern/subr_vmem.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/kern/subr_vmem.c Sat Mar 4 13:03:31 2017 (r314667) @@ -766,7 +766,7 @@ vmem_start_callout(void *unused) TASK_INIT(&vmem_periodic_wk, 0, vmem_periodic, NULL); vmem_periodic_interval = hz * 10; - callout_init(&vmem_periodic_ch, CALLOUT_MPSAFE); + callout_init(&vmem_periodic_ch, 1); callout_reset(&vmem_periodic_ch, vmem_periodic_interval, vmem_periodic_kick, NULL); } Modified: stable/10/sys/kern/uipc_domain.c ============================================================================== --- stable/10/sys/kern/uipc_domain.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/kern/uipc_domain.c Sat Mar 4 13:03:31 2017 (r314667) @@ -247,8 +247,8 @@ domaininit(void *dummy) if (max_linkhdr < 16) /* XXX */ max_linkhdr = 16; - callout_init(&pffast_callout, CALLOUT_MPSAFE); - callout_init(&pfslow_callout, CALLOUT_MPSAFE); + callout_init(&pffast_callout, 1); + callout_init(&pfslow_callout, 1); mtx_lock(&dom_mtx); KASSERT(domain_init_status == 0, ("domaininit called too late!")); Modified: stable/10/sys/mips/cavium/octe/ethernet.c ============================================================================== --- stable/10/sys/mips/cavium/octe/ethernet.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/mips/cavium/octe/ethernet.c Sat Mar 4 13:03:31 2017 (r314667) @@ -454,7 +454,7 @@ int cvm_oct_init_module(device_t bus) cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0x1001); } - callout_init(&cvm_oct_poll_timer, CALLOUT_MPSAFE); + callout_init(&cvm_oct_poll_timer, 1); callout_reset(&cvm_oct_poll_timer, hz, cvm_do_timer, NULL); return 0; Modified: stable/10/sys/mips/cavium/octeon_rnd.c ============================================================================== --- stable/10/sys/mips/cavium/octeon_rnd.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/mips/cavium/octeon_rnd.c Sat Mar 4 13:03:31 2017 (r314667) @@ -95,7 +95,7 @@ octeon_rnd_attach(device_t dev) struct octeon_rnd_softc *sc; sc = device_get_softc(dev); - callout_init(&sc->sc_callout, CALLOUT_MPSAFE); + callout_init(&sc->sc_callout, 1); callout_reset(&sc->sc_callout, hz * 5, octeon_rnd_harvest, sc); cvmx_rng_enable(); Modified: stable/10/sys/mips/nlm/dev/net/xlpge.c ============================================================================== --- stable/10/sys/mips/nlm/dev/net/xlpge.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/mips/nlm/dev/net/xlpge.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1240,7 +1240,7 @@ nlm_xlpge_attach(device_t dev) sc->prepad_en = sc->network_sc->prepad_en; sc->prepad_size = sc->network_sc->prepad_size; - callout_init(&sc->xlpge_callout, CALLOUT_MPSAFE); + callout_init(&sc->xlpge_callout, 1); XLPGE_LOCK_INIT(sc, device_get_nameunit(dev)); Modified: stable/10/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- stable/10/sys/mips/rmi/dev/xlr/rge.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/mips/rmi/dev/xlr/rge.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1894,9 +1894,9 @@ rge_attach(device_t dev) if (!gmac_common_init_done) { mac_common_init(); gmac_common_init_done = 1; - callout_init(&xlr_tx_stop_bkp, CALLOUT_MPSAFE); + callout_init(&xlr_tx_stop_bkp, 1); callout_reset(&xlr_tx_stop_bkp, hz, xlr_tx_q_wakeup, NULL); - callout_init(&rge_dbg_count, CALLOUT_MPSAFE); + callout_init(&rge_dbg_count, 1); //callout_reset(&rge_dbg_count, hz, xlr_debug_count, NULL); } if ((ret = rmi_xlr_mac_open(sc)) == -1) { Modified: stable/10/sys/net/if_spppsubr.c ============================================================================== --- stable/10/sys/net/if_spppsubr.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/net/if_spppsubr.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1030,7 +1030,7 @@ sppp_attach(struct ifnet *ifp) mtx_init(&sp->mtx, "sppp", MTX_NETWORK_LOCK, MTX_DEF | MTX_RECURSE); /* Initialize keepalive handler. */ - callout_init(&sp->keepalive_callout, CALLOUT_MPSAFE); + callout_init(&sp->keepalive_callout, 1); callout_reset(&sp->keepalive_callout, hz * 10, sppp_keepalive, (void *)sp); @@ -1062,7 +1062,7 @@ sppp_attach(struct ifnet *ifp) #ifdef INET6 sp->confflags |= CONF_ENABLE_IPV6; #endif - callout_init(&sp->ifstart_callout, CALLOUT_MPSAFE); + callout_init(&sp->ifstart_callout, 1); sp->if_start = ifp->if_start; ifp->if_start = sppp_ifstart; sp->pp_comp = malloc(sizeof(struct slcompress), M_TEMP, M_WAITOK); @@ -2170,7 +2170,7 @@ sppp_lcp_init(struct sppp *sp) sp->lcp.max_terminate = 2; sp->lcp.max_configure = 10; sp->lcp.max_failure = 10; - callout_init(&sp->ch[IDX_LCP], CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_LCP], 1); } static void @@ -2861,7 +2861,7 @@ sppp_ipcp_init(struct sppp *sp) sp->fail_counter[IDX_IPCP] = 0; sp->pp_seq[IDX_IPCP] = 0; sp->pp_rseq[IDX_IPCP] = 0; - callout_init(&sp->ch[IDX_IPCP], CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_IPCP], 1); } static void @@ -3420,7 +3420,7 @@ sppp_ipv6cp_init(struct sppp *sp) sp->fail_counter[IDX_IPV6CP] = 0; sp->pp_seq[IDX_IPV6CP] = 0; sp->pp_rseq[IDX_IPV6CP] = 0; - callout_init(&sp->ch[IDX_IPV6CP], CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_IPV6CP], 1); } static void @@ -4225,7 +4225,7 @@ sppp_chap_init(struct sppp *sp) sp->fail_counter[IDX_CHAP] = 0; sp->pp_seq[IDX_CHAP] = 0; sp->pp_rseq[IDX_CHAP] = 0; - callout_init(&sp->ch[IDX_CHAP], CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_CHAP], 1); } static void @@ -4547,8 +4547,8 @@ sppp_pap_init(struct sppp *sp) sp->fail_counter[IDX_PAP] = 0; sp->pp_seq[IDX_PAP] = 0; sp->pp_rseq[IDX_PAP] = 0; - callout_init(&sp->ch[IDX_PAP], CALLOUT_MPSAFE); - callout_init(&sp->pap_my_to_ch, CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_PAP], 1); + callout_init(&sp->pap_my_to_ch, 1); } static void Modified: stable/10/sys/net80211/ieee80211_ht.c ============================================================================== --- stable/10/sys/net80211/ieee80211_ht.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/net80211/ieee80211_ht.c Sat Mar 4 13:03:31 2017 (r314667) @@ -1688,7 +1688,7 @@ ieee80211_setup_basic_htrates(struct iee static void ampdu_tx_setup(struct ieee80211_tx_ampdu *tap) { - callout_init(&tap->txa_timer, CALLOUT_MPSAFE); + callout_init(&tap->txa_timer, 1); tap->txa_flags |= IEEE80211_AGGR_SETUP; } Modified: stable/10/sys/net80211/ieee80211_hwmp.c ============================================================================== --- stable/10/sys/net80211/ieee80211_hwmp.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/net80211/ieee80211_hwmp.c Sat Mar 4 13:03:31 2017 (r314667) @@ -275,7 +275,7 @@ hwmp_vattach(struct ieee80211vap *vap) return; } hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS; - callout_init(&hs->hs_roottimer, CALLOUT_MPSAFE); + callout_init(&hs->hs_roottimer, 1); vap->iv_hwmp = hs; } Modified: stable/10/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/10/sys/net80211/ieee80211_mesh.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/net80211/ieee80211_mesh.c Sat Mar 4 13:03:31 2017 (r314667) @@ -216,7 +216,7 @@ mesh_rt_add_locked(struct ieee80211vap * IEEE80211_ADDR_COPY(rt->rt_dest, dest); rt->rt_priv = (void *)ALIGN(&rt[1]); mtx_init(&rt->rt_lock, "MBSS_RT", "802.11s route entry", MTX_DEF); - callout_init(&rt->rt_discovery, CALLOUT_MPSAFE); + callout_init(&rt->rt_discovery, 1); rt->rt_updtime = ticks; /* create time */ TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); } @@ -678,8 +678,8 @@ mesh_vattach(struct ieee80211vap *vap) TAILQ_INIT(&ms->ms_known_gates); TAILQ_INIT(&ms->ms_routes); mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF); - callout_init(&ms->ms_cleantimer, CALLOUT_MPSAFE); - callout_init(&ms->ms_gatetimer, CALLOUT_MPSAFE); + callout_init(&ms->ms_cleantimer, 1); + callout_init(&ms->ms_gatetimer, 1); ms->ms_gateseq = 0; mesh_select_proto_metric(vap, "AIRTIME"); KASSERT(ms->ms_pmetric, ("ms_pmetric == NULL")); @@ -3382,8 +3382,8 @@ void ieee80211_mesh_node_init(struct ieee80211vap *vap, struct ieee80211_node *ni) { ni->ni_flags |= IEEE80211_NODE_QOS; - callout_init(&ni->ni_mltimer, CALLOUT_MPSAFE); - callout_init(&ni->ni_mlhtimer, CALLOUT_MPSAFE); + callout_init(&ni->ni_mltimer, 1); + callout_init(&ni->ni_mlhtimer, 1); } /* Modified: stable/10/sys/net80211/ieee80211_node.c ============================================================================== --- stable/10/sys/net80211/ieee80211_node.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/net80211/ieee80211_node.c Sat Mar 4 13:03:31 2017 (r314667) @@ -111,7 +111,7 @@ ieee80211_node_attach(struct ieee80211co "802.11 staging q"); ieee80211_node_table_init(ic, &ic->ic_sta, "station", IEEE80211_INACT_INIT, ic->ic_max_keyix); - callout_init(&ic->ic_inact, CALLOUT_MPSAFE); + callout_init(&ic->ic_inact, 1); callout_reset(&ic->ic_inact, IEEE80211_INACT_WAIT*hz, ieee80211_node_timeout, ic); Modified: stable/10/sys/net80211/ieee80211_proto.c ============================================================================== --- stable/10/sys/net80211/ieee80211_proto.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/net80211/ieee80211_proto.c Sat Mar 4 13:03:31 2017 (r314667) @@ -194,7 +194,7 @@ ieee80211_proto_vattach(struct ieee80211 vap->iv_fragthreshold = IEEE80211_FRAG_DEFAULT; vap->iv_bmiss_max = IEEE80211_BMISS_MAX; callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0); - callout_init(&vap->iv_mgtsend, CALLOUT_MPSAFE); + callout_init(&vap->iv_mgtsend, 1); TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap); TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap); /* Modified: stable/10/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- stable/10/sys/netgraph/netflow/ng_netflow.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/netgraph/netflow/ng_netflow.c Sat Mar 4 13:03:31 2017 (r314667) @@ -258,7 +258,7 @@ ng_netflow_constructor(node_p node) priv->ifaces[i].info.conf = NG_NETFLOW_CONF_INGRESS; /* Initialize callout handle */ - callout_init(&priv->exp_callout, CALLOUT_MPSAFE); + callout_init(&priv->exp_callout, 1); /* Allocate memory and set up flow cache */ ng_netflow_cache_init(priv); Modified: stable/10/sys/netgraph/netgraph.h ============================================================================== --- stable/10/sys/netgraph/netgraph.h Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/netgraph/netgraph.h Sat Mar 4 13:03:31 2017 (r314667) @@ -1161,7 +1161,7 @@ int ng_send_fn2(node_p node, hook_p hoo int ng_uncallout(struct callout *c, node_p node); int ng_callout(struct callout *c, node_p node, hook_p hook, int ticks, ng_item_fn *fn, void * arg1, int arg2); -#define ng_callout_init(c) callout_init(c, CALLOUT_MPSAFE) +#define ng_callout_init(c) callout_init(c, 1) /* Flags for netgraph functions. */ #define NG_NOFLAGS 0x00000000 /* no special options */ Modified: stable/10/sys/netinet/in_pcb.c ============================================================================== --- stable/10/sys/netinet/in_pcb.c Sat Mar 4 12:51:57 2017 (r314666) +++ stable/10/sys/netinet/in_pcb.c Sat Mar 4 13:03:31 2017 (r314667) @@ -2139,7 +2139,7 @@ ipport_tick_init(const void *unused __un { /* Start ipport_tick. */ - callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); + callout_init(&ipport_tick_callout, 1); callout_reset(&ipport_tick_callout, 1, ipport_tick, NULL); EVENTHANDLER_REGISTER(shutdown_pre_sync, ip_fini, NULL, SHUTDOWN_PRI_DEFAULT); Modified: stable/10/sys/netinet/ip_mroute.c ============================================================================== --- stable/10/sys/netinet/ip_mroute.c Sat Mar 4 12:51:57 2017 (r314666) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sat Mar 4 13:05:05 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4A10CF9672; Sat, 4 Mar 2017 13:05:05 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id 9CB071F60; Sat, 4 Mar 2017 13:05:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24D54RY072931; Sat, 4 Mar 2017 13:05:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24D54CP072928; Sat, 4 Mar 2017 13:05:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703041305.v24D54CP072928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 4 Mar 2017 13:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314668 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 13:05:05 -0000 Author: avg Date: Sat Mar 4 13:05:04 2017 New Revision: 314668 URL: https://svnweb.freebsd.org/changeset/base/314668 Log: MFC r314273: zfs: call spa_deadman on a taskqueue thread Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Mar 4 13:03:31 2017 (r314667) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Mar 4 13:05:04 2017 (r314668) @@ -174,10 +174,6 @@ uint_t zio_taskq_basedc = 80; /* base boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ extern int zfs_sync_pass_deferred_free; -#ifndef illumos -extern void spa_deadman(void *arg); -#endif - /* * This (illegal) pool name is used when temporarily importing a spa_t in order * to get the vdev stats associated with the imported devices. @@ -6685,8 +6681,8 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_sync_starttime + spa->spa_deadman_synctime)); #else /* !illumos */ #ifdef _KERNEL - callout_reset(&spa->spa_deadman_cycid, - hz * spa->spa_deadman_synctime / NANOSEC, spa_deadman, spa); + callout_schedule(&spa->spa_deadman_cycid, + hz * spa->spa_deadman_synctime / NANOSEC); #endif #endif /* illumos */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Mar 4 13:03:31 2017 (r314667) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Mar 4 13:05:04 2017 (r314668) @@ -597,8 +597,8 @@ spa_lookup(const char *name) * If the zfs_deadman_enabled flag is set then it inspects all vdev queues * looking for potentially hung I/Os. */ -void -spa_deadman(void *arg) +static void +spa_deadman(void *arg, int pending) { spa_t *spa = arg; @@ -627,6 +627,16 @@ spa_deadman(void *arg) #endif } +#if defined(__FreeBSD__) && defined(_KERNEL) +static void +spa_deadman_timeout(void *arg) +{ + spa_t *spa = arg; + + taskqueue_enqueue(taskqueue_thread, &spa->spa_deadman_task); +} +#endif + /* * Create an uninitialized spa_t with the given name. Requires * spa_namespace_lock. The caller must ensure that the spa_t doesn't already @@ -698,7 +708,23 @@ spa_add(const char *name, nvlist_t *conf mutex_exit(&cpu_lock); #else /* !illumos */ #ifdef _KERNEL + /* + * callout(9) does not provide a way to initialize a callout with + * a function and an argument, so we use callout_reset() to schedule + * the callout in the very distant future. Even if that event ever + * fires, it should be okayas we won't have any active zio-s. + * But normally spa_sync() will reschedule the callout with a proper + * timeout. + * callout(9) does not allow the callback function to sleep but + * vdev_deadman() needs to acquire vq_lock and illumos mutexes are + * emulated using sx(9). For this reason spa_deadman_timeout() + * will schedule spa_deadman() as task on a taskqueue that allows + * sleeping. + */ + TASK_INIT(&spa->spa_deadman_task, 0, spa_deadman, spa); callout_init(&spa->spa_deadman_cycid, 1); + callout_reset_sbt(&spa->spa_deadman_cycid, SBT_MAX, 0, + spa_deadman_timeout, spa, 0); #endif #endif refcount_create(&spa->spa_refcount); @@ -811,6 +837,7 @@ spa_remove(spa_t *spa) #else /* !illumos */ #ifdef _KERNEL callout_drain(&spa->spa_deadman_cycid); + taskqueue_drain(taskqueue_thread, &spa->spa_deadman_task); #endif #endif Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Mar 4 13:03:31 2017 (r314667) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Mar 4 13:05:04 2017 (r314668) @@ -261,6 +261,7 @@ struct spa { #else /* !illumos */ #ifdef _KERNEL struct callout spa_deadman_cycid; /* callout id */ + struct task spa_deadman_task; #endif #endif /* illumos */ uint64_t spa_deadman_calls; /* number of deadman calls */ From owner-svn-src-stable@freebsd.org Sat Mar 4 15:30:45 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73EEECF284E; Sat, 4 Mar 2017 15:30:45 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 504101F51; Sat, 4 Mar 2017 15:30:45 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (106-68-109-205.dyn.iinet.net.au [106.68.109.205]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v24FUSeX037697 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 4 Mar 2017 07:30:38 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r314667 - in stable/10/sys: amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs cddl/dev/profile compat/ndis contrib/ipfilter/netinet dev/a... To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201703041303.v24D3Vfi072728@repo.freebsd.org> From: Julian Elischer Message-ID: <1292f504-21e4-1bee-3dd6-6205252bfd26@freebsd.org> Date: Sat, 4 Mar 2017 23:30:22 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201703041303.v24D3Vfi072728@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 15:30:45 -0000 On 4/3/17 9:03 pm, Andriy Gapon wrote: > Author: avg > Date: Sat Mar 4 13:03:31 2017 > New Revision: 314667 > URL: https://svnweb.freebsd.org/changeset/base/314667 > > Log: > MFC r283291: don't use CALLOUT_MPSAFE with callout_init() > > The main purpose of this MFC is to reduce conflicts for other merges. > Parts of the original change have already "trickled down" via individual MFCs. is there a better name than ''1" when you replace " CALLOUT_MPSAFE"? > - callout_init(&watchdog_callout, CALLOUT_MPSAFE); > + callout_init(&watchdog_callout, 1); > if (watchdog_cpu != -1) > watchdog_change(watchdog_cpu); From owner-svn-src-stable@freebsd.org Sat Mar 4 16:03:07 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 449FECF34F3; Sat, 4 Mar 2017 16:03:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BA3451873; Sat, 4 Mar 2017 16:03:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA01372; Sat, 04 Mar 2017 18:03:03 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ckC99-000C1J-Kg; Sat, 04 Mar 2017 18:03:03 +0200 Subject: Re: svn commit: r314667 - in stable/10/sys: amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs cddl/dev/profile compat/ndis contrib/ipfilter/netinet dev/a... To: Julian Elischer , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-10@FreeBSD.org References: <201703041303.v24D3Vfi072728@repo.freebsd.org> <1292f504-21e4-1bee-3dd6-6205252bfd26@freebsd.org> From: Andriy Gapon Message-ID: <47d091e5-6efe-5992-f09c-8c231f2da349@FreeBSD.org> Date: Sat, 4 Mar 2017 18:02:02 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1292f504-21e4-1bee-3dd6-6205252bfd26@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 16:03:07 -0000 On 04/03/2017 17:30, Julian Elischer wrote: > On 4/3/17 9:03 pm, Andriy Gapon wrote: >> Author: avg >> Date: Sat Mar 4 13:03:31 2017 >> New Revision: 314667 >> URL: https://svnweb.freebsd.org/changeset/base/314667 >> >> Log: >> MFC r283291: don't use CALLOUT_MPSAFE with callout_init() >> The main purpose of this MFC is to reduce conflicts for other merges. >> Parts of the original change have already "trickled down" via individual MFCs. > > is there a better name than ''1" when you replace " CALLOUT_MPSAFE"? Maybe 'true'. The argument has type int and it is documented this way: If the mpsafe argument is zero, the callout structure is not considered to be “multi-processor safe”; and the Giant lock will be acquired before calling the callout function and released when the callout function returns. >> - callout_init(&watchdog_callout, CALLOUT_MPSAFE); >> + callout_init(&watchdog_callout, 1); >> if (watchdog_cpu != -1) >> watchdog_change(watchdog_cpu); > -- Andriy Gapon From owner-svn-src-stable@freebsd.org Sat Mar 4 16:11:15 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F1EACF3767; Sat, 4 Mar 2017 16:11:15 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ED20A1CF2; Sat, 4 Mar 2017 16:11:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (106-68-109-205.dyn.iinet.net.au [106.68.109.205]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v24GAx5d037861 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 4 Mar 2017 08:11:06 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r314667 - in stable/10/sys: amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs cddl/dev/profile compat/ndis contrib/ipfilter/netinet dev/a... To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-10@FreeBSD.org References: <201703041303.v24D3Vfi072728@repo.freebsd.org> <1292f504-21e4-1bee-3dd6-6205252bfd26@freebsd.org> <47d091e5-6efe-5992-f09c-8c231f2da349@FreeBSD.org> From: Julian Elischer Message-ID: <0c863f1d-4039-3698-e1f7-e9aea5d190ee@freebsd.org> Date: Sun, 5 Mar 2017 00:10:52 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <47d091e5-6efe-5992-f09c-8c231f2da349@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 16:11:15 -0000 On 5/3/17 12:02 am, Andriy Gapon wrote: > On 04/03/2017 17:30, Julian Elischer wrote: >> On 4/3/17 9:03 pm, Andriy Gapon wrote: >>> Author: avg >>> Date: Sat Mar 4 13:03:31 2017 >>> New Revision: 314667 >>> URL: https://svnweb.freebsd.org/changeset/base/314667 >>> >>> Log: >>> MFC r283291: don't use CALLOUT_MPSAFE with callout_init() >>> The main purpose of this MFC is to reduce conflicts for other merges. >>> Parts of the original change have already "trickled down" via individual MFCs. >> is there a better name than ''1" when you replace " CALLOUT_MPSAFE"? > Maybe 'true'. The argument has type int and it is documented this way: > > If the mpsafe argument is zero, the callout structure > is not considered to be “multi-processor safe”; and the Giant lock will > be acquired before calling the callout function and released when the > callout function returns. then I disagree with the change. I think CALLOUT_MPSAFE is a better value than '1'. or CALLOUT_IS_MPSAFE. I'm sort of confused by why 283291 made that change. It seems a regression to me. MFC-ing it is a different question and 'diff reduction' is a valid reason but the original change in head seems suspect. >>> - callout_init(&watchdog_callout, CALLOUT_MPSAFE); >>> + callout_init(&watchdog_callout, 1); >>> if (watchdog_cpu != -1) >>> watchdog_change(watchdog_cpu); > > From owner-svn-src-stable@freebsd.org Sat Mar 4 18:07:31 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79625CF9E31; Sat, 4 Mar 2017 18:07:31 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 484801F32; Sat, 4 Mar 2017 18:07:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24I7U7L097907; Sat, 4 Mar 2017 18:07:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24I7U4E097906; Sat, 4 Mar 2017 18:07:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703041807.v24I7U4E097906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Mar 2017 18:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314673 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 18:07:31 -0000 Author: bdrewery Date: Sat Mar 4 18:07:30 2017 New Revision: 314673 URL: https://svnweb.freebsd.org/changeset/base/314673 Log: MFC r313909: Fix panic with unlocked vnode to vrecycle(). Modified: stable/11/sys/kern/uipc_mqueue.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_mqueue.c ============================================================================== --- stable/11/sys/kern/uipc_mqueue.c Sat Mar 4 17:34:36 2017 (r314672) +++ stable/11/sys/kern/uipc_mqueue.c Sat Mar 4 18:07:30 2017 (r314673) @@ -714,7 +714,9 @@ do_recycle(void *context, int pending __ { struct vnode *vp = (struct vnode *)context; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vrecycle(vp); + VOP_UNLOCK(vp, 0); vdrop(vp); } From owner-svn-src-stable@freebsd.org Sat Mar 4 18:12:00 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A191CF9FCD; Sat, 4 Mar 2017 18:12:00 +0000 (UTC) (envelope-from bdrewery@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 mx1.freebsd.org (Postfix) with ESMTPS id 23A0912D8; Sat, 4 Mar 2017 18:12:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v24IBx75001181; Sat, 4 Mar 2017 18:11:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v24IBxwd001179; Sat, 4 Mar 2017 18:11:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703041811.v24IBxwd001179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 4 Mar 2017 18:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314674 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2017 18:12:00 -0000 Author: bdrewery Date: Sat Mar 4 18:11:59 2017 New Revision: 314674 URL: https://svnweb.freebsd.org/changeset/base/314674 Log: MFC r313909: Fix panic with unlocked vnode to vrecycle(). Modified: stable/10/sys/kern/uipc_mqueue.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_mqueue.c ============================================================================== --- stable/10/sys/kern/uipc_mqueue.c Sat Mar 4 18:07:30 2017 (r314673) +++ stable/10/sys/kern/uipc_mqueue.c Sat Mar 4 18:11:59 2017 (r314674) @@ -703,7 +703,9 @@ do_recycle(void *context, int pending __ { struct vnode *vp = (struct vnode *)context; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vrecycle(vp); + VOP_UNLOCK(vp, 0); vdrop(vp); }