From owner-svn-src-head@freebsd.org Sun Nov 27 01:42:55 2016 Return-Path: Delivered-To: svn-src-head@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 22356C58811; Sun, 27 Nov 2016 01:42:55 +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 CC405DBD; Sun, 27 Nov 2016 01:42:54 +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 uAR1gsqM015884; Sun, 27 Nov 2016 01:42:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR1gs9G015883; Sun, 27 Nov 2016 01:42:54 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201611270142.uAR1gs9G015883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 27 Nov 2016 01:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309203 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 01:42:55 -0000 Author: alc Date: Sun Nov 27 01:42:53 2016 New Revision: 309203 URL: https://svnweb.freebsd.org/changeset/base/309203 Log: Recursion on the free page queue mutex occurred when UMA needed to allocate a new page of radix trie nodes to complete a vm_radix_insert() operation that was requested by vm_page_cache(). Specifically, vm_page_cache() already held the free page queue lock when UMA tried to acquire it through a call to vm_page_alloc(). This code path no longer exists, so there is no longer any reason to allow recursion on the free page queue mutex. Improve nearby comments. Reviewed by: kib, markj Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8628 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Nov 26 23:22:32 2016 (r309202) +++ head/sys/vm/vm_page.c Sun Nov 27 01:42:53 2016 (r309203) @@ -1512,19 +1512,17 @@ vm_page_alloc(vm_object_t object, vm_pin } /* - * The page allocation request can came from consumers which already - * hold the free page queue mutex, like vm_page_insert() in - * vm_page_cache(). + * Allocate a page if the number of free pages exceeds the minimum + * for the request class. */ - mtx_lock_flags(&vm_page_queue_free_mtx, MTX_RECURSE); + mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && vm_cnt.v_free_count > 0)) { /* - * Allocate from the free queue if the number of free pages - * exceeds the minimum for the request class. + * Can we allocate the page from a reservation? */ #if VM_NRESERVLEVEL > 0 if (object == NULL || (object->flags & (OBJ_COLORED | @@ -1532,6 +1530,9 @@ vm_page_alloc(vm_object_t object, vm_pin vm_reserv_alloc_page(object, pindex, mpred)) == NULL) #endif { + /* + * If not, allocate it from the free page queues. + */ m = vm_phys_alloc_pages(object != NULL ? VM_FREEPOOL_DEFAULT : VM_FREEPOOL_DIRECT, 0); #if VM_NRESERVLEVEL > 0 @@ -1841,7 +1842,7 @@ vm_page_alloc_freelist(int flind, int re /* * Do not allocate reserved pages unless the req has asked for it. */ - mtx_lock_flags(&vm_page_queue_free_mtx, MTX_RECURSE); + mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || From owner-svn-src-head@freebsd.org Sun Nov 27 01:44:32 2016 Return-Path: Delivered-To: svn-src-head@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 DFB0CC588A6; Sun, 27 Nov 2016 01:44:32 +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 A8900F3C; Sun, 27 Nov 2016 01:44:32 +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 uAR1iVM7016005; Sun, 27 Nov 2016 01:44:31 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR1iVNW016003; Sun, 27 Nov 2016 01:44:31 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201611270144.uAR1iVNW016003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 27 Nov 2016 01:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309204 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 01:44:33 -0000 Author: alc Date: Sun Nov 27 01:44:31 2016 New Revision: 309204 URL: https://svnweb.freebsd.org/changeset/base/309204 Log: The function vm_page_cache() no longer exists. Remove its man page. Deleted: head/share/man/man9/vm_page_cache.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 27 01:42:53 2016 (r309203) +++ head/ObsoleteFiles.inc Sun Nov 27 01:44:31 2016 (r309204) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20161127: Remove vm_page_cache(9) +OLD_FILES+=usr/share/man/man9/vm_page_cache.9.gz # 20161124: new clang import which bumps version from 3.8.0 to 3.9.0. OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/asan_interface.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Nov 27 01:42:53 2016 (r309203) +++ head/share/man/man9/Makefile Sun Nov 27 01:44:31 2016 (r309204) @@ -352,7 +352,6 @@ MAN= accept_filter.9 \ vm_page_alloc.9 \ vm_page_bits.9 \ vm_page_busy.9 \ - vm_page_cache.9 \ vm_page_deactivate.9 \ vm_page_dontneed.9 \ vm_page_aflag.9 \ From owner-svn-src-head@freebsd.org Sun Nov 27 09:21:00 2016 Return-Path: Delivered-To: svn-src-head@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 6507BC58FDF; Sun, 27 Nov 2016 09:21:00 +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 1AB875E5; Sun, 27 Nov 2016 09:21:00 +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 uAR9KxhN002022; Sun, 27 Nov 2016 09:20:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR9KxV0002019; Sun, 27 Nov 2016 09:20:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611270920.uAR9KxV0002019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Nov 2016 09:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309209 - in head/sys: fs/nfsclient fs/nullfs sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 09:21:00 -0000 Author: kib Date: Sun Nov 27 09:20:58 2016 New Revision: 309209 URL: https://svnweb.freebsd.org/changeset/base/309209 Log: NFSv4 client tracks opens, and the track records are only dropped when the vnode is inactivated. This contradicts with the nullfs caching which keeps upper vnode around, as consequence keeping the use reference to lower vnode. Add a filesystem flag to request nullfs to not cache when mounted over that filesystem, and set the flag for nfs v4 mounts. Reported by: asomers Reviewed by: rmacklem Tested by: asomers, rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nullfs/null_vfsops.c head/sys/sys/mount.h Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Nov 27 09:14:52 2016 (r309208) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Nov 27 09:20:58 2016 (r309209) @@ -1320,6 +1320,8 @@ out: MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF | MNTK_USES_BCACHE; + if ((VFSTONFS(mp)->nm_flag & NFSMNT_NFSV4) != 0) + mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); } return (error); Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Sun Nov 27 09:14:52 2016 (r309208) +++ head/sys/fs/nullfs/null_vfsops.c Sun Nov 27 09:20:58 2016 (r309209) @@ -188,7 +188,8 @@ nullfs_mount(struct mount *mp) } xmp->nullm_flags |= NULLM_CACHE; - if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0) + if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 || + (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) != 0) xmp->nullm_flags &= ~NULLM_CACHE; MNT_ILOCK(mp); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Nov 27 09:14:52 2016 (r309208) +++ head/sys/sys/mount.h Sun Nov 27 09:20:58 2016 (r309209) @@ -370,7 +370,8 @@ void __mnt_vnode_markerfree_act #define MNTK_SUSPEND 0x08000000 /* request write suspension */ #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ -#define MNTK_UNUSED1 0x20000000 +#define MNTK_NULL_NOCACHE 0x20000000 /* auto disable cache for nullfs + mounts over this fs */ #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ From owner-svn-src-head@freebsd.org Sun Nov 27 12:03:36 2016 Return-Path: Delivered-To: svn-src-head@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 624A9C58B1E; Sun, 27 Nov 2016 12:03:36 +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 2311A1141; Sun, 27 Nov 2016 12:03:36 +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 uARC3Zpf068131; Sun, 27 Nov 2016 12:03:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARC3ZLe068129; Sun, 27 Nov 2016 12:03:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611271203.uARC3ZLe068129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Nov 2016 12:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309210 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 12:03:36 -0000 Author: avos Date: Sun Nov 27 12:03:34 2016 New Revision: 309210 URL: https://svnweb.freebsd.org/changeset/base/309210 Log: rsu: various scanning fixes. - Set IEEE80211_FEXT_SCAN_OFFLOAD flag; firmware can send null data frames when associated. - Check IEEE80211_SCAN_ACTIVE scan flag instead of IEEE80211_F_ASCAN ic flag; the last is never set since r170530. - Eliminate software scan (net80211) <-> site_survey (driver) race: * override ic_scan_curchan and ic_scan_mindwell pointers so net80211 will not try to finish scanning automatically; * inform net80211 about current status via ieee80211_cancel_scan() and ieee80211_scan_done(); * remove corresponding workaround from rsu_join_bss(). Now the driver can associate to an AP with hidden SSID. Tested with Asus USB-N10. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 09:20:58 2016 (r309209) +++ head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 12:03:34 2016 (r309210) @@ -173,6 +173,8 @@ static void rsu_scan_end(struct ieee8021 static void rsu_getradiocaps(struct ieee80211com *, int, int *, struct ieee80211_channel[]); static void rsu_set_channel(struct ieee80211com *); +static void rsu_scan_curchan(struct ieee80211_scan_state *, unsigned long); +static void rsu_scan_mindwell(struct ieee80211_scan_state *); static void rsu_update_mcast(struct ieee80211com *); static int rsu_alloc_rx_list(struct rsu_softc *); static void rsu_free_rx_list(struct rsu_softc *); @@ -203,7 +205,8 @@ static int rsu_newstate(struct ieee80211 static void rsu_set_key(struct rsu_softc *, const struct ieee80211_key *); static void rsu_delete_key(struct rsu_softc *, const struct ieee80211_key *); #endif -static int rsu_site_survey(struct rsu_softc *, struct ieee80211vap *); +static int rsu_site_survey(struct rsu_softc *, + struct ieee80211_scan_ssid *); static int rsu_join_bss(struct rsu_softc *, struct ieee80211_node *); static int rsu_disconnect(struct rsu_softc *); static int rsu_hwrssi_to_rssi(struct rsu_softc *, int hw_rssi); @@ -537,6 +540,7 @@ rsu_attach(device_t self) ic->ic_txstream = sc->sc_ntxstream; ic->ic_rxstream = sc->sc_nrxstream; } + ic->ic_flags_ext |= IEEE80211_FEXT_SCAN_OFFLOAD; rsu_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, ic->ic_channels); @@ -547,6 +551,8 @@ rsu_attach(device_t self) ic->ic_scan_end = rsu_scan_end; ic->ic_getradiocaps = rsu_getradiocaps; ic->ic_set_channel = rsu_set_channel; + ic->ic_scan_curchan = rsu_scan_curchan; + ic->ic_scan_mindwell = rsu_scan_mindwell; ic->ic_vap_create = rsu_vap_create; ic->ic_vap_delete = rsu_vap_delete; ic->ic_update_mcast = rsu_update_mcast; @@ -680,16 +686,21 @@ static void rsu_scan_start(struct ieee80211com *ic) { struct rsu_softc *sc = ic->ic_softc; + struct ieee80211_scan_state *ss = ic->ic_scan; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); int error; /* Scanning is done by the firmware. */ RSU_LOCK(sc); - /* XXX TODO: force awake if in in network-sleep? */ - error = rsu_site_survey(sc, TAILQ_FIRST(&ic->ic_vaps)); + sc->sc_active_scan = !!(ss->ss_flags & IEEE80211_SCAN_ACTIVE); + /* XXX TODO: force awake if in network-sleep? */ + error = rsu_site_survey(sc, ss->ss_nssid > 0 ? &ss->ss_ssid[0] : NULL); RSU_UNLOCK(sc); - if (error != 0) + if (error != 0) { device_printf(sc->sc_dev, "could not send site survey command\n"); + ieee80211_cancel_scan(vap); + } } static void @@ -722,6 +733,24 @@ rsu_set_channel(struct ieee80211com *ic } static void +rsu_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell) +{ + /* Scan is done in rsu_scan_start(). */ +} + +/** + * Called by the net80211 framework to indicate + * the minimum dwell time has been met, terminate the scan. + * We don't actually terminate the scan as the firmware will notify + * us when it's finished and we have no way to interrupt it. + */ +static void +rsu_scan_mindwell(struct ieee80211_scan_state *ss) +{ + /* NB: don't try to abort scan; wait for firmware to finish */ +} + +static void rsu_update_mcast(struct ieee80211com *ic) { /* XXX do nothing? */ @@ -1323,31 +1352,36 @@ rsu_delete_key(struct rsu_softc *sc, con #endif static int -rsu_site_survey(struct rsu_softc *sc, struct ieee80211vap *vap) +rsu_site_survey(struct rsu_softc *sc, struct ieee80211_scan_ssid *ssid) { struct r92s_fw_cmd_sitesurvey cmd; - struct ieee80211com *ic = &sc->sc_ic; - int r; RSU_ASSERT_LOCKED(sc); memset(&cmd, 0, sizeof(cmd)); - if ((ic->ic_flags & IEEE80211_F_ASCAN) || sc->sc_scan_pass == 1) + /* TODO: passive channels? */ + if (sc->sc_active_scan) cmd.active = htole32(1); cmd.limit = htole32(48); - if (sc->sc_scan_pass == 1 && vap->iv_des_nssid > 0) { - /* Do a directed scan for second pass. */ - cmd.ssidlen = htole32(vap->iv_des_ssid[0].len); - memcpy(cmd.ssid, vap->iv_des_ssid[0].ssid, - vap->iv_des_ssid[0].len); - + + if (ssid != NULL) { + sc->sc_extra_scan = 1; + cmd.ssidlen = htole32(ssid->len); + memcpy(cmd.ssid, ssid->ssid, ssid->len); } - DPRINTF("sending site survey command, pass=%d\n", sc->sc_scan_pass); - r = rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, &cmd, sizeof(cmd)); - if (r == 0) { - sc->sc_scanning = 1; +#ifdef USB_DEBUG + if (rsu_debug & (RSU_DEBUG_SCAN | RSU_DEBUG_FWCMD)) { + device_printf(sc->sc_dev, + "sending site survey command, active %d", + le32toh(cmd.active)); + if (ssid != NULL) { + printf(", ssid: "); + ieee80211_print_essid(cmd.ssid, le32toh(cmd.ssidlen)); + } + printf("\n"); } - return (r); +#endif + return (rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, &cmd, sizeof(cmd))); } static int @@ -1362,28 +1396,9 @@ rsu_join_bss(struct rsu_softc *sc, struc uint8_t *frm; uint8_t opmode; int error; - int cnt; - char *msg = "rsujoin"; RSU_ASSERT_LOCKED(sc); - /* - * Until net80211 scanning doesn't automatically finish - * before we tell it to, let's just wait until any pending - * scan is done. - * - * XXX TODO: yes, this releases and re-acquires the lock. - * We should re-verify the state whenever we re-attempt this! - */ - cnt = 0; - while (sc->sc_scanning && cnt < 10) { - device_printf(sc->sc_dev, - "%s: still scanning! (attempt %d)\n", - __func__, cnt); - msleep(msg, &sc->sc_mtx, 0, msg, hz / 2); - cnt++; - } - /* Let the FW decide the opmode based on the capinfo field. */ opmode = NDIS802_11AUTOUNKNOWN; RSU_DPRINTF(sc, RSU_DEBUG_RESET, @@ -1634,26 +1649,24 @@ rsu_rx_event(struct rsu_softc *sc, uint8 break; case R92S_EVT_SURVEY_DONE: RSU_DPRINTF(sc, RSU_DEBUG_SCAN, - "%s: site survey pass %d done, found %d BSS\n", - __func__, sc->sc_scan_pass, le32toh(*(uint32_t *)buf)); - sc->sc_scanning = 0; - if (vap->iv_state != IEEE80211_S_SCAN) - break; /* Ignore if not scanning. */ - - /* - * XXX TODO: This needs to be done without a transition to - * the SCAN state again. Grr. - */ - if (sc->sc_scan_pass == 0 && vap->iv_des_nssid != 0) { - /* Schedule a directed scan for hidden APs. */ - /* XXX bad! */ - sc->sc_scan_pass = 1; + "%s: %s scan done, found %d BSS\n", + __func__, sc->sc_extra_scan ? "direct" : "broadcast", + le32toh(*(uint32_t *)buf)); + if (sc->sc_extra_scan == 1) { + /* Send broadcast probe request. */ + sc->sc_extra_scan = 0; + if (vap != NULL && rsu_site_survey(sc, NULL) != 0) { + RSU_UNLOCK(sc); + ieee80211_cancel_scan(vap); + RSU_LOCK(sc); + } + break; + } + if (vap != NULL) { RSU_UNLOCK(sc); - ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); + ieee80211_scan_done(vap); RSU_LOCK(sc); - break; } - sc->sc_scan_pass = 0; break; case R92S_EVT_JOIN_BSS: if (vap->iv_state == IEEE80211_S_AUTH) @@ -2920,12 +2933,11 @@ rsu_init(struct rsu_softc *sc) goto fail; } - sc->sc_scan_pass = 0; + sc->sc_extra_scan = 0; usbd_transfer_start(sc->sc_xfer[RSU_BULK_RX]); /* We're ready to go. */ sc->sc_running = 1; - sc->sc_scanning = 0; return; fail: /* Need to stop all failed transfers, if any */ Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 09:20:58 2016 (r309209) +++ head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 12:03:34 2016 (r309210) @@ -768,8 +768,8 @@ struct rsu_softc { u_int sc_running:1, sc_calibrating:1, - sc_scanning:1, - sc_scan_pass:1; + sc_active_scan:1, + sc_extra_scan:1; u_int cut; uint8_t sc_rftype; int8_t sc_nrxstream; From owner-svn-src-head@freebsd.org Sun Nov 27 12:04:56 2016 Return-Path: Delivered-To: svn-src-head@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 095A6C58CAD; Sun, 27 Nov 2016 12:04:56 +0000 (UTC) (envelope-from hselasky@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 B11D013A7; Sun, 27 Nov 2016 12:04:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARC4sjS068397; Sun, 27 Nov 2016 12:04:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARC4sHI068396; Sun, 27 Nov 2016 12:04:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611271204.uARC4sHI068396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 27 Nov 2016 12:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309211 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 12:04:56 -0000 Author: hselasky Date: Sun Nov 27 12:04:54 2016 New Revision: 309211 URL: https://svnweb.freebsd.org/changeset/base/309211 Log: Fix spelling. Modified: head/sys/dev/usb/usb_process.c Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Sun Nov 27 12:03:34 2016 (r309210) +++ head/sys/dev/usb/usb_process.c Sun Nov 27 12:04:54 2016 (r309211) @@ -184,7 +184,7 @@ usb_process(void *arg) continue; } - /* end if messages - check if anyone is waiting for sync */ + /* end of messages - check if anyone is waiting for sync */ if (up->up_dsleep) { up->up_dsleep = 0; cv_broadcast(&up->up_drain); From owner-svn-src-head@freebsd.org Sun Nov 27 14:19:20 2016 Return-Path: Delivered-To: svn-src-head@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 E2E1DC5641E; Sun, 27 Nov 2016 14:19:20 +0000 (UTC) (envelope-from dim@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 B255510C6; Sun, 27 Nov 2016 14:19:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAREJJoo021163; Sun, 27 Nov 2016 14:19:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAREJJZV021162; Sun, 27 Nov 2016 14:19:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611271419.uAREJJZV021162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 27 Nov 2016 14:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309212 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 14:19:21 -0000 Author: dim Date: Sun Nov 27 14:19:19 2016 New Revision: 309212 URL: https://svnweb.freebsd.org/changeset/base/309212 Log: Add a few missed clang 3.9.0 files to OptionalObsoleteFiles. X-MFC-With: 309149 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Nov 27 12:04:54 2016 (r309211) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Nov 27 14:19:19 2016 (r309212) @@ -1142,6 +1142,7 @@ OLD_FILES+=usr/lib/clang/3.9.0/include/s OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/common_interface_defs.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/coverage_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/esan_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/linux_syscall_hooks.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/lsan_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/msan_interface.h @@ -1233,6 +1234,10 @@ OLD_FILES+=usr/lib/clang/3.9.0/lib/freeb OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.profile-x86_64.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.safestack-i386.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats_client-x86_64.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a From owner-svn-src-head@freebsd.org Sun Nov 27 16:12:23 2016 Return-Path: Delivered-To: svn-src-head@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 98C7BC58921; Sun, 27 Nov 2016 16:12:23 +0000 (UTC) (envelope-from eugen@eg.sd.rdtc.ru) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD37E63; Sun, 27 Nov 2016 16:12:20 +0000 (UTC) (envelope-from eugen@eg.sd.rdtc.ru) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id uARGCGc0019373 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 27 Nov 2016 17:12:17 +0100 (CET) (envelope-from eugen@eg.sd.rdtc.ru) X-Envelope-From: eugen@eg.sd.rdtc.ru X-Envelope-To: br@freebsd.org Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id uARGCDnF038489 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 27 Nov 2016 23:12:13 +0700 (KRAT) (envelope-from eugen@eg.sd.rdtc.ru) Received: (from eugen@localhost) by eg.sd.rdtc.ru (8.15.2/8.15.2/Submit) id uARGCDcd038486; Sun, 27 Nov 2016 23:12:13 +0700 (KRAT) (envelope-from eugen) Date: Sun, 27 Nov 2016 23:12:13 +0700 From: Eugene Grosbein To: Ruslan Bukin Cc: freebsd-mips@freebsd.org, svn-src-head@freebsd.org Subject: r306186 broke ipfw for MIPS32-BE Message-ID: <20161127161213.GA29204@rdtc.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,LOCAL_FROM,RP_MATCHES_RCVD autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * 0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain * 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail * domains are different * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 16:12:23 -0000 Hi! Ruslan, please take a look. > For reference - this breaks sooptcopyin() on MIPS32 BE. Undoing this > commit fixes things. :) > > (it breaks ipfw. ) I acknowledge this running FreeBSD 12/mips with real MIP32 big endian hardware. ipfw show now complains: ipfw: retrieving config failed: Invalid argument And there is a line in a dmesg: ipfw_ctl3 invalid option 0v0 "ipfw add" is broken too: # ipfw add 10 allow ip from any to any ipfw: getsockopt(IP_FW_XADD): Invalid argument dmesg says: ipfw: ipfw_ctl3 invalid option 11521v0 Rollback of r306186 fixes this. Eugene Grosbein From owner-svn-src-head@freebsd.org Sun Nov 27 17:08:49 2016 Return-Path: Delivered-To: svn-src-head@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 8E9FAC58E3D; Sun, 27 Nov 2016 17:08:49 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-40.csi.cam.ac.uk (ppsw-40.csi.cam.ac.uk [131.111.8.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5B7331C4; Sun, 27 Nov 2016 17:08:49 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sc1.bsdpad.com ([163.172.212.18]:27597) by ppsw-40.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1cB2wY-0000rC-jt (Exim 4.86_36-e07b163) (return-path ); Sun, 27 Nov 2016 17:08:46 +0000 Date: Sun, 27 Nov 2016 17:07:46 +0000 From: Ruslan Bukin To: Eugene Grosbein Cc: Ruslan Bukin , freebsd-mips@freebsd.org, svn-src-head@freebsd.org Subject: Re: r306186 broke ipfw for MIPS32-BE Message-ID: <20161127170746.GA92813@bsdpad.com> References: <20161127161213.GA29204@rdtc.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161127161213.GA29204@rdtc.ru> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 17:08:49 -0000 On Sun, Nov 27, 2016 at 11:12:13PM +0700, Eugene Grosbein wrote: > Hi! > > Ruslan, please take a look. > > > For reference - this breaks sooptcopyin() on MIPS32 BE. Undoing this > > commit fixes things. :) > > > > (it breaks ipfw. ) > > I acknowledge this running FreeBSD 12/mips with real MIP32 big endian > hardware. ipfw show now complains: > ipfw: retrieving config failed: Invalid argument > > And there is a line in a dmesg: ipfw_ctl3 invalid option 0v0 > > "ipfw add" is broken too: > > # ipfw add 10 allow ip from any to any > ipfw: getsockopt(IP_FW_XADD): Invalid argument > > dmesg says: ipfw: ipfw_ctl3 invalid option 11521v0 > > Rollback of r306186 fixes this. > > Eugene Grosbein Hi this should be fixed already in r309018 thanks! Ruslan From owner-svn-src-head@freebsd.org Sun Nov 27 18:06:04 2016 Return-Path: Delivered-To: svn-src-head@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 5841EC58257; Sun, 27 Nov 2016 18:06:04 +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 32EB91F4; Sun, 27 Nov 2016 18:06:04 +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 uARI63UA017635; Sun, 27 Nov 2016 18:06:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARI63dc017633; Sun, 27 Nov 2016 18:06:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611271806.uARI63dc017633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Nov 2016 18:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309214 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 18:06:04 -0000 Author: avos Date: Sun Nov 27 18:06:03 2016 New Revision: 309214 URL: https://svnweb.freebsd.org/changeset/base/309214 Log: rsu: add support for hardware multicast filter setup. The algorithm is the same as in rtwn(4). Tested with Asus USB-N10 (STA) + RTL8188CUS (AP). Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 14:27:51 2016 (r309213) +++ head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 18:06:03 2016 (r309214) @@ -175,6 +175,8 @@ static void rsu_getradiocaps(struct ieee static void rsu_set_channel(struct ieee80211com *); static void rsu_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void rsu_scan_mindwell(struct ieee80211_scan_state *); +static uint8_t rsu_get_multi_pos(const uint8_t[]); +static void rsu_set_multi(struct rsu_softc *); static void rsu_update_mcast(struct ieee80211com *); static int rsu_alloc_rx_list(struct rsu_softc *); static void rsu_free_rx_list(struct rsu_softc *); @@ -750,10 +752,78 @@ rsu_scan_mindwell(struct ieee80211_scan_ /* NB: don't try to abort scan; wait for firmware to finish */ } +/* + * The same as rtwn_get_multi_pos() / rtwn_set_multi(). + */ +static uint8_t +rsu_get_multi_pos(const uint8_t maddr[]) +{ + uint64_t mask = 0x00004d101df481b4; + uint8_t pos = 0x27; /* initial value */ + int i, j; + + for (i = 0; i < IEEE80211_ADDR_LEN; i++) + for (j = (i == 0) ? 1 : 0; j < 8; j++) + if ((maddr[i] >> j) & 1) + pos ^= (mask >> (i * 8 + j - 1)); + + pos &= 0x3f; + + return (pos); +} + +static void +rsu_set_multi(struct rsu_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t mfilt[2]; + + RSU_ASSERT_LOCKED(sc); + + /* general structure was copied from ath(4). */ + if (ic->ic_allmulti == 0) { + struct ieee80211vap *vap; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + + /* + * Merge multicast addresses to form the hardware filter. + */ + mfilt[0] = mfilt[1] = 0; + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + caddr_t dl; + uint8_t pos; + + dl = LLADDR((struct sockaddr_dl *) + ifma->ifma_addr); + pos = rsu_get_multi_pos(dl); + + mfilt[pos / 32] |= (1 << (pos % 32)); + } + if_maddr_runlock(ifp); + } + } else + mfilt[0] = mfilt[1] = ~0; + + rsu_write_4(sc, R92S_MAR + 0, mfilt[0]); + rsu_write_4(sc, R92S_MAR + 4, mfilt[1]); + + RSU_DPRINTF(sc, RSU_DEBUG_STATE, "%s: MC filter %08x:%08x\n", + __func__, mfilt[0], mfilt[1]); +} + static void rsu_update_mcast(struct ieee80211com *ic) { - /* XXX do nothing? */ + struct rsu_softc *sc = ic->ic_softc; + + RSU_LOCK(sc); + if (sc->sc_running) + rsu_set_multi(sc); + RSU_UNLOCK(sc); } static int @@ -2925,6 +2995,9 @@ rsu_init(struct rsu_softc *sc) goto fail; } + /* Setup multicast filter (must be done after firmware loading). */ + rsu_set_multi(sc); + /* Set PS mode fully active */ error = rsu_set_fw_power_state(sc, RSU_PWR_ACTIVE); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 14:27:51 2016 (r309213) +++ head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 18:06:03 2016 (r309214) @@ -48,6 +48,7 @@ #define R92S_MACIDSETTING 0x0050 #define R92S_MACID (R92S_MACIDSETTING + 0x000) +#define R92S_MAR (R92S_MACIDSETTING + 0x010) #define R92S_GP 0x01e0 #define R92S_GPIO_CTRL (R92S_GP + 0x00c) From owner-svn-src-head@freebsd.org Sun Nov 27 18:34:31 2016 Return-Path: Delivered-To: svn-src-head@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 3D3C3C5886D; Sun, 27 Nov 2016 18:34:31 +0000 (UTC) (envelope-from adrian@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 0CDC3EE4; Sun, 27 Nov 2016 18:34:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARIYU71029377; Sun, 27 Nov 2016 18:34:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARIYUjJ029375; Sun, 27 Nov 2016 18:34:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611271834.uARIYUjJ029375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 27 Nov 2016 18:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309215 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 18:34:31 -0000 Author: adrian Date: Sun Nov 27 18:34:29 2016 New Revision: 309215 URL: https://svnweb.freebsd.org/changeset/base/309215 Log: [ath] Begin to lay the groundwork for btcoex related ioctl controls. Modified: head/sys/dev/ath/if_ath_ioctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_ioctl.c ============================================================================== --- head/sys/dev/ath/if_ath_ioctl.c Sun Nov 27 18:06:03 2016 (r309214) +++ head/sys/dev/ath/if_ath_ioctl.c Sun Nov 27 18:34:29 2016 (r309215) @@ -296,6 +296,8 @@ ath_ioctl(struct ieee80211com *ic, u_lon return (ath_ioctl_spectral(sc, data)); case SIOCGATHNODERATESTATS: return (ath_ioctl_ratestats(sc, data)); + case SIOCGATHBTCOEX: + return (ath_btcoex_ioctl(sc, data)); default: /* * This signals the net80211 layer that we didn't handle this Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Sun Nov 27 18:06:03 2016 (r309214) +++ head/sys/dev/ath/if_athioctl.h Sun Nov 27 18:34:29 2016 (r309215) @@ -447,4 +447,9 @@ struct ath_tx_radiotap_header { #define SPECTRAL_CONTROL_ENABLE_AT_RESET 8 #define SPECTRAL_CONTROL_DISABLE_AT_RESET 9 +/* + * Bluetooth coexistence control parameters + */ +#define SIOCGATHBTCOEX _IOWR('i', 152, struct ath_diag) + #endif /* _DEV_ATH_ATHIOCTL_H */ From owner-svn-src-head@freebsd.org Sun Nov 27 19:18:23 2016 Return-Path: Delivered-To: svn-src-head@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 75D2DC5928E; Sun, 27 Nov 2016 19:18:23 +0000 (UTC) (envelope-from kubito@gmail.com) Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com [IPv6:2a00:1450:400c:c01::244]) (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 0A7041E79; Sun, 27 Nov 2016 19:18:23 +0000 (UTC) (envelope-from kubito@gmail.com) Received: by mail-wj0-x244.google.com with SMTP id jb2so11531871wjb.3; Sun, 27 Nov 2016 11:18:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Qw+aUFjvSY2tCcotZbDZm04IWf4nnPC+eHwpUkgbWXQ=; b=XdPeBvvS1CBPd9UM5ICRZymCEJ8s7jrPrP6nH1fNygKOY5AEcDJ9GXL2j4oomHxS8N QZUPoJT6g6iqOw+yrrb3ayldXwhqGUkkGtxx5Vwk7B9E51tYfYKMtpmt9gL6b2mY5cPT mxYAi4QChklQ4fJ/H8zhBA3uUzdzYxJqitDTLJqV1JZLQ9xsasr2iXNbewFQljR01chA OkoIu7hRAFlg/0gCLt4vxZic9x+JFa3DnJ48hHTh9ZzSIFHFI8h30nJ4EleA5GaUV0Mx GjOdVtMeyDHGTwAQPoz7ttYkDjVasrGd/mdfzC9a8AAgP957h7RPI3ALIF0AL+sR8suo iuHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Qw+aUFjvSY2tCcotZbDZm04IWf4nnPC+eHwpUkgbWXQ=; b=Dj30EFtm5UhKW2vaaTgABu7aPKQDTObGN9ZGv48ieBi9DXdjsMt6Z1BscKVICQ3bA4 x6uPng4ZpEN9zGLHCN2ooNaM93tQqF2xG1JBXRBWTJ2Rm3ybqsGSBuCrKb7ZhLlpNOS9 ndiwVuVJnS37kJM3OvZhwOxEsnH6sbYmtZ4C/XCWDUV1qIT2KNS8Cu5+lpsc1WZ35+TO NKXJ+gwA3O1doQ3ztDjmt9P+RT8NgN43fC/xvByeclwzDKPDcnCOeDj3tCe74bpgqdNa /QS5YhLiiW9cpCkumbc06bbLnbEZoMox7pZu5SQwj2BYTAyZEqvY3RKPnR0JbQm8XvIj 8w4g== X-Gm-Message-State: AKaTC02sWlnWVoACYQGOt98HVDTyXKVFdOQmQF4hMML23LZZD9xCRmGrRCCccc5w4/+nRw== X-Received: by 10.194.94.70 with SMTP id da6mr18231066wjb.180.1480274301190; Sun, 27 Nov 2016 11:18:21 -0800 (PST) Received: from orwell.gmail.com (dhcp-077-248-147-050.chello.nl. [77.248.147.50]) by smtp.gmail.com with ESMTPSA id u17sm24895022wma.24.2016.11.27.11.18.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Nov 2016 11:18:20 -0800 (PST) Sender: Raphael Kubo da Costa From: Raphael Kubo da Costa To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309194 - head/usr.sbin/syslogd References: <201611261550.uAQFo0HC074016@repo.freebsd.org> Date: Sun, 27 Nov 2016 20:18:14 +0100 In-Reply-To: <201611261550.uAQFo0HC074016@repo.freebsd.org> (Baptiste Daroussin's message of "Sat, 26 Nov 2016 15:50:00 +0000 (UTC)") Message-ID: <86shqchguh.fsf@FreeBSD.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 19:18:23 -0000 Baptiste Daroussin writes: > Author: bapt > Date: Sat Nov 26 15:49:59 2016 > New Revision: 309194 > URL: https://svnweb.freebsd.org/changeset/base/309194 > > Log: > initialize *nextp which could be left uninitialized in case the configuration > file cannot be open/read > > Reported by: Coverity via cem > MFC after: 2 days > CID: 1365665 This is causing syslogd to crash on launch with SIGILL here (I'm on r309213). The disassembly shows it's stumbling upon an UD2 instruction here on amd64. From owner-svn-src-head@freebsd.org Sun Nov 27 19:27:15 2016 Return-Path: Delivered-To: svn-src-head@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 0A387C594D5; Sun, 27 Nov 2016 19:27:15 +0000 (UTC) (envelope-from bapt@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 C3316680; Sun, 27 Nov 2016 19:27:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARJRDXa049730; Sun, 27 Nov 2016 19:27:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARJRDYA049729; Sun, 27 Nov 2016 19:27:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201611271927.uARJRDYA049729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 27 Nov 2016 19:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309216 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 19:27:15 -0000 Author: bapt Date: Sun Nov 27 19:27:13 2016 New Revision: 309216 URL: https://svnweb.freebsd.org/changeset/base/309216 Log: Properly initialize nextp MFC after: 1 day Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sun Nov 27 18:34:29 2016 (r309215) +++ head/usr.sbin/syslogd/syslogd.c Sun Nov 27 19:27:13 2016 (r309216) @@ -1835,7 +1835,7 @@ init(int signo) free((char *)f); } Files = NULL; - *nextp = NULL; + nextp = &Files; /* open the configuration file */ if ((cf = fopen(ConfFile, "r")) == NULL) { From owner-svn-src-head@freebsd.org Sun Nov 27 20:11:56 2016 Return-Path: Delivered-To: svn-src-head@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 759B0C590B8; Sun, 27 Nov 2016 20:11:56 +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 4556DFA8; Sun, 27 Nov 2016 20:11:56 +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 uARKBtjO067213; Sun, 27 Nov 2016 20:11:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARKBtdP067212; Sun, 27 Nov 2016 20:11:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201611272011.uARKBtdP067212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 27 Nov 2016 20:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309217 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:11:56 -0000 Author: pfg Date: Sun Nov 27 20:11:55 2016 New Revision: 309217 URL: https://svnweb.freebsd.org/changeset/base/309217 Log: indent(1): minor off-by-one error. This was introduced in r303571. Obtianed from: Piotr Stefaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Sun Nov 27 19:27:13 2016 (r309216) +++ head/usr.bin/indent/parse.c Sun Nov 27 20:11:55 2016 (r309217) @@ -202,7 +202,7 @@ parse(int tk) /* tk: the code for the co } /* end of switch */ - if (ps.tos >= STACKSIZE) + if (ps.tos >= STACKSIZE - 1) errx(1, "Parser stack overflow"); reduce(); /* see if any reduction can be done */ From owner-svn-src-head@freebsd.org Sun Nov 27 20:30:10 2016 Return-Path: Delivered-To: svn-src-head@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 3E6E7C59517; Sun, 27 Nov 2016 20:30:10 +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 0E36F17FC; Sun, 27 Nov 2016 20:30:09 +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 uARKU9Ns073712; Sun, 27 Nov 2016 20:30:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARKU9jY073711; Sun, 27 Nov 2016 20:30:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201611272030.uARKU9jY073711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 27 Nov 2016 20:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309219 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:30:10 -0000 Author: pfg Date: Sun Nov 27 20:30:09 2016 New Revision: 309219 URL: https://svnweb.freebsd.org/changeset/base/309219 Log: indent(1): fix regression introduced in r303596. Multi-line comments are always block comments in KNF. Restore properly, handling the case when a long one-liner gets wrapped and becomes a multi-line comment. Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Nov 27 20:21:38 2016 (r309218) +++ head/usr.bin/indent/pr_comment.c Sun Nov 27 20:30:09 2016 (r309219) @@ -162,15 +162,19 @@ pr_comment(void) if (*buf_ptr != ' ' && !ps.box_com) *e_com++ = ' '; - /* Don't put a break delimiter if this comment is a one-liner */ - for (t_ptr = buf_ptr; *t_ptr != '\0' && *t_ptr != '\n'; t_ptr++) { - if (t_ptr >= buf_end) - fill_buffer(); - if (t_ptr[0] == '*' && t_ptr[1] == '/') { - break_delim = false; - break; + /* + * Don't put a break delimiter if this is a one-liner that won't wrap. + */ + if (break_delim) + for (t_ptr = buf_ptr; *t_ptr != '\0' && *t_ptr != '\n'; t_ptr++) { + if (t_ptr >= buf_end) + fill_buffer(); + if (t_ptr[0] == '*' && t_ptr[1] == '/') { + if (adj_max_col >= count_spaces_until(ps.com_col, buf_ptr, t_ptr + 2)) + break_delim = false; + break; + } } - } if (break_delim) { char *t = e_com; From owner-svn-src-head@freebsd.org Sun Nov 27 20:38:16 2016 Return-Path: Delivered-To: svn-src-head@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 4C718C596A3; Sun, 27 Nov 2016 20:38:16 +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 EB4BF1C43; Sun, 27 Nov 2016 20:38:15 +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 uARKcF8x077479; Sun, 27 Nov 2016 20:38:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARKcESW077476; Sun, 27 Nov 2016 20:38:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201611272038.uARKcESW077476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 27 Nov 2016 20:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309220 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:38:16 -0000 Author: pfg Date: Sun Nov 27 20:38:14 2016 New Revision: 309220 URL: https://svnweb.freebsd.org/changeset/base/309220 Log: indent(1): Properly handle the wide string literal and wide char constant L. indent(1) treated the "L" in "L'a'" as if it were an identifier and forced a space character after it, breaking valid code. PR: 143090 MFC after: 2 weeks Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_codes.h head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Nov 27 20:30:09 2016 (r309219) +++ head/usr.bin/indent/indent.c Sun Nov 27 20:38:14 2016 (r309220) @@ -1004,6 +1004,16 @@ check_type: ps.want_blank = true; break; + case strpfx: + if (ps.want_blank) + *e_code++ = ' '; + for (t_ptr = token; *t_ptr; ++t_ptr) { + CHECK_SIZE_CODE; + *e_code++ = *t_ptr; + } + ps.want_blank = false; + break; + case period: /* treat a period kind of like a binary * operation */ *e_code++ = '.'; /* move the period into line */ Modified: head/usr.bin/indent/indent_codes.h ============================================================================== --- head/usr.bin/indent/indent_codes.h Sun Nov 27 20:30:09 2016 (r309219) +++ head/usr.bin/indent/indent_codes.h Sun Nov 27 20:38:14 2016 (r309220) @@ -68,3 +68,4 @@ #define ifhead 30 #define elsehead 31 #define period 32 +#define strpfx 33 Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Nov 27 20:30:09 2016 (r309219) +++ head/usr.bin/indent/lexi.c Sun Nov 27 20:38:14 2016 (r309220) @@ -237,6 +237,11 @@ lexi(void) fill_buffer(); } *e_token++ = '\0'; + + if (s_token[0] == 'L' && s_token[1] == '\0' && + (*buf_ptr == '"' || *buf_ptr == '\'')) + return (strpfx); + while (*buf_ptr == ' ' || *buf_ptr == '\t') { /* get rid of blanks */ if (++buf_ptr >= buf_end) fill_buffer(); From owner-svn-src-head@freebsd.org Sun Nov 27 20:43:08 2016 Return-Path: Delivered-To: svn-src-head@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 B5089C599C1; Sun, 27 Nov 2016 20:43:08 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 83BBF241; Sun, 27 Nov 2016 20:43:08 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id ECAA737; Sun, 27 Nov 2016 21:43:05 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id D965028494; Sun, 27 Nov 2016 21:43:05 +0100 (CET) Date: Sun, 27 Nov 2016 21:43:05 +0100 From: Jilles Tjoelker To: Julian Elischer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests Message-ID: <20161127204305.GA58954@stack.nl> References: <201611230757.uAN7vqmC008888@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201611230757.uAN7vqmC008888@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:43:08 -0000 On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: > Author: julian > Date: Wed Nov 23 07:57:52 2016 > New Revision: 309035 > URL: https://svnweb.freebsd.org/changeset/base/309035 > Log: > This little BSD licensed library has been kicking around for years. > It allows one to trivially convert an absolute path to a relative path > and the reverse. The test programs themselves are very useful in scripts > but the real use comes shortly with the -r and -a arguments to ln. > These are sometimes known as the --relative and --absolute flags and > can force a symlink to be relative when you only have an absolue path. > Another place these are sometimes used is to add -a and -r args to 'realpath'. > Incredibly useful in Makefiles. > I was going to just add the files in with 'ln' but a library makes more sense. > The test programs may come out in their own right some day for scripting. > released under a BSD 2-clause: > * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. > * Copyright (c) 1999 Tama Communications Corporation. All rights reserved. > The test directry does not conform to any framework. > Not connected to build. > doc people may want to play with the manual pages. > Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yamaguchi. > MFC after: 1 month > Relnotes: yes > Sponsored by: Panzura, Tama Communications Corporation Consider making this a static-only library or a part of an existing library such as libc or libutil, since the overhead of a shared object is rather big compared to the amount of code here. Thanks for not linking this to the build right away. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Sun Nov 27 22:27:53 2016 Return-Path: Delivered-To: svn-src-head@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 93127C59F22; Sun, 27 Nov 2016 22:27:53 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wj0-x243.google.com (mail-wj0-x243.google.com [IPv6:2a00:1450:400c:c01::243]) (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 2A1AB1D2C; Sun, 27 Nov 2016 22:27:53 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wj0-x243.google.com with SMTP id xy5so11916137wjc.1; Sun, 27 Nov 2016 14:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=61Zp2QBfuQNmqsaUu/haQox0WDUxpONKZd5knKg9jCM=; b=o7By6ci/J3FCfOmFLCyPdOkTAzABeTjnyzNv/DuKk+tbDeeKR+9BYoSRDq8YcqcFEP ww2+847q71r5PxC7G332PMydN4iTt/IxegLsY0BKGBZDetToe1/JtNGg3Ax0EPcBbL6x m66Z7CbMR8xRRmpf0SRTp9niV81Vr5K3Zq0OL9acRf/8e+FX0+Uci+NN9yq4yn3O4ceF dNA+jPsRCzUkW830FFdrnx/t7xJqR8fm6hh82va3SAu5sEcBYJxULBJul6147w42jE8t uqS4Lo7LALd/fvD/6erI1hd/eeTFxa6KE4ALpPsXiGB/a0Uf+YxTFyI7SX+lmu0F2MDX UNFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=61Zp2QBfuQNmqsaUu/haQox0WDUxpONKZd5knKg9jCM=; b=H9QsjjEY6UkEbIbP6aYQ8WGjoiaOV33i5a6jGtP+vIJylYRhpbQspUcv83IIo+U72L VDKFmW1McXxHhqMQ8nuunD1fWbpLWpuljmiE+BSjl9b3DxFCudk5LExU/hYuWPkiTgrT vh+rdzCxAPdF0aeDp5MwG8/WC5gdPI6oXKBJN1MxlEfi5KTiy2fqRH1ExHBDLRjBM1kf IMMvww4Rkp/WsT32Sopr51UycMGyrNIQGnDa/OIb/9fE5ly5xKbjrwZivf6UBhBo01kx kaGFEVkN9h2d2isZFZEsZQc07BUaXiWwHI4izmZPQM0pPJTNB+iEyS5zzRlAx5IBVeLJ 5LEw== X-Gm-Message-State: AKaTC00Kw1pA0LF4RAbIlo/SOBT7dqKn4MBqY0Ez+q8phRN7XkWFiieOM5lm3WCIWfpNRA== X-Received: by 10.194.121.6 with SMTP id lg6mr18770904wjb.105.1480285670489; Sun, 27 Nov 2016 14:27:50 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id n5sm24557729wmf.0.2016.11.27.14.27.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 14:27:49 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 27 Nov 2016 23:27:48 +0100 From: Baptiste Daroussin To: Jilles Tjoelker Cc: Julian Elischer , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests Message-ID: <20161127222748.uptaiumgvnyopzic@ivaldir.etoilebsd.net> References: <201611230757.uAN7vqmC008888@repo.freebsd.org> <20161127204305.GA58954@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yrzfvtni7wfrptil" Content-Disposition: inline In-Reply-To: <20161127204305.GA58954@stack.nl> User-Agent: NeoMutt/20161104 (1.7.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 22:27:53 -0000 --yrzfvtni7wfrptil Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 27, 2016 at 09:43:05PM +0100, Jilles Tjoelker wrote: > On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: > > Author: julian > > Date: Wed Nov 23 07:57:52 2016 > > New Revision: 309035 > > URL: https://svnweb.freebsd.org/changeset/base/309035 >=20 > > Log: > > This little BSD licensed library has been kicking around for years. > > It allows one to trivially convert an absolute path to a relative path > > and the reverse. The test programs themselves are very useful in scri= pts > > but the real use comes shortly with the -r and -a arguments to ln. > > These are sometimes known as the --relative and --absolute flags and > > can force a symlink to be relative when you only have an absolue path. > > Another place these are sometimes used is to add -a and -r args to 'r= ealpath'. > > Incredibly useful in Makefiles. >=20 > > I was going to just add the files in with 'ln' but a library makes mo= re sense. > > The test programs may come out in their own right some day for script= ing. >=20 > > released under a BSD 2-clause: > > * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. > > * Copyright (c) 1999 Tama Communications Corporation. All rights res= erved. >=20 > > The test directry does not conform to any framework. > > Not connected to build. > > doc people may want to play with the manual pages. >=20 > > Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yama= guchi. > > MFC after: 1 month > > Relnotes: yes > > Sponsored by: Panzura, Tama Communications Corporation >=20 > Consider making this a static-only library or a part of an existing > library such as libc or libutil, since the overhead of a shared object > is rather big compared to the amount of code here. >=20 > Thanks for not linking this to the build right away. +1 seems like a good candidate for libutil Best regards, Bapt --yrzfvtni7wfrptil Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlg7XeEACgkQY4mL3PG3 PlqknhAAuqG1Llqsz2f4DaAviEm+/p9HzAKnQ6TeyXf5txYYK74aXFa4GbJdUsYC d6fmLbPgJEAMWBiKz8jmx+6vcVCNVtRpLXhZ+dLzzBhEUAZMJtmpFjYRpMg4A+vA 66mYd6tQHQHI27ua2X9Dgbzwtw5+gpuVDqJY1NHfg62vwfq5ToFuel/ACb57Ifk5 NjKzWxsnQE8mJ3/xUS4wKa873AIjvwz9njy4tMUNH9F3WmlQgIzr873d4jaRCQV4 9DzpgOk4XVHbuxzN62PxpN2FDa0bF/vVvGx03KlUljyAk3IiPefSbUBe6iqU/qcF 7WLJ7ya+/N6wNAMPzwtYykFTXfQDX4KhEmf0Ujti1SdtTQ4FpJBCzhS53YFKlXqm 4e0uYLCXyHxYitBeqi1wOEKCvPtWZhgNaENl7DWNui7IilZtQFsm3N+7jCVZ5mGW tcWouILfsi1mJ4YMay5qqw0E0wrG2YZ3r+g6Muk3f97vVqGNlzcACfM0O77hWlO7 p1kTV2QML0hccUV5HzlKAXrJIGYqoo+z1mg4Sh6HzAYNTAS4bz6xu6osydxvIQrG pi3F2PNOlcD/yDiL0iPUeZoA3VRa98yfcJcAdQ1ICgfkl1RGJMA6+oKDaV+H7LLV pxsAanwLE03iqCZlTJsxmbL04Uo2HMJXLlg5kPuRtaxxuZqtC2k= =NYpy -----END PGP SIGNATURE----- --yrzfvtni7wfrptil-- From owner-svn-src-head@freebsd.org Mon Nov 28 01:16:56 2016 Return-Path: Delivered-To: svn-src-head@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 A3CE8C585DC; Mon, 28 Nov 2016 01:16:56 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 6C53D36E4; Mon, 28 Nov 2016 01:16:56 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id a124so205591577ioe.2; Sun, 27 Nov 2016 17:16:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8dvyggNus8Ns4JQm1TPy5ykJeKIRt0LDXiAHGuo3aY4=; b=PCtNio8a88YlwDDZ4LEJ/NAX4dfYvETQSUw/46ZjX6qJysiwLDTDUEJoWaAhuHBi7w Ne8vmbLsoqdlxYy5IwHTzNimwkleY1ZJjqgoWD71jhYJnVnQdxrDW2+MF2XB+TVdoWkz mBJNZUkAG16bM0am9UifPLD5kWqpuPv/IJrQxR+8lkzzcbAYSxQTl4A8oectPoXLz6uR kmbcuwWkcDFqSeHASXB3KwMVZlkwgOYhh585s820fypT1gfK4XAUeRlGARvrusnyi4MS 983xvhCLTolgN/Mhuj3RQxqiVH+EkcimKXN3ykzfguY3q8FyR85XVqcW4+oSUeVpJlET dAVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8dvyggNus8Ns4JQm1TPy5ykJeKIRt0LDXiAHGuo3aY4=; b=SJ+1jyFKC5jWxz/z3vSgWaoY6eqHWbdxYo22ovnKSGk/s53ZlPHm9VvoKEJg6KNYPO Y5AiRavqyXJ7abPbqSO+BW6JN+EfMyD45zTX3MOJhdeKr9SxHApfDW+/pQfVSFhl3K+o ki6ORAbM/J9ciO/FjrlxAGisN/wtxbBTdkn+0+LwkJ5BRzyCgxlb1HN09GSrbwZkkkqs ol1Oj80lCzFCQNwHsTYFIzho1gEFYOJvgb2msYnhGW3Mn9ns9jGsByCHygPr7EDSzoQt h2At36EyRiZxtzMG4+Jymdx1CVIzMiaX2SR3seiF2M5n2UxaJ4Tg/w9cp0P31fryt9Tu p59g== X-Gm-Message-State: AKaTC005uQX3qJWGFNLzEbk5TzJCGU2/QYyKHkMXZWn8icm7o587OtIO+PPXR9liGH/YmzxN1Wf2oLvtnuZfig== X-Received: by 10.107.18.230 with SMTP id 99mr14873206ios.41.1480295815769; Sun, 27 Nov 2016 17:16:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.152.204 with HTTP; Sun, 27 Nov 2016 17:16:55 -0800 (PST) In-Reply-To: <201611261550.uAQFo0HC074016@repo.freebsd.org> References: <201611261550.uAQFo0HC074016@repo.freebsd.org> From: Ryan Stone Date: Sun, 27 Nov 2016 20:16:55 -0500 Message-ID: Subject: Re: svn commit: r309194 - head/usr.sbin/syslogd To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 01:16:56 -0000 On Sat, Nov 26, 2016 at 10:50 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Nov 26 15:49:59 2016 > New Revision: 309194 > URL: https://svnweb.freebsd.org/changeset/base/309194 > > Log: > initialize *nextp which could be left uninitialized in case the > configuration > file cannot be open/read > > Reported by: Coverity via cem > MFC after: 2 days > CID: 1365665 > > Modified: > head/usr.sbin/syslogd/syslogd.c > > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================ > ================== > --- head/usr.sbin/syslogd/syslogd.c Sat Nov 26 15:01:35 2016 > (r309193) > +++ head/usr.sbin/syslogd/syslogd.c Sat Nov 26 15:49:59 2016 > (r309194) > @@ -1835,6 +1835,7 @@ init(int signo) > free((char *)f); > } > Files = NULL; > + *nextp = NULL; > > /* open the configuration file */ > if ((cf = fopen(ConfFile, "r")) == NULL) { > > There is something very wrong in the code here. nextp is never initialized, so obviously we can't access *nextp. I'm surprised that this code can even compile with -Werror. I'd fix it but it'd not clear to me what nextp is intended to do. From owner-svn-src-head@freebsd.org Mon Nov 28 01:18:35 2016 Return-Path: Delivered-To: svn-src-head@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 C2CAEC58666; Mon, 28 Nov 2016 01:18:35 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (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 8B1B337B7; Mon, 28 Nov 2016 01:18:35 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x236.google.com with SMTP id j65so206089669iof.0; Sun, 27 Nov 2016 17:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wbo7MZvWYfYvnTuw53nKridc4z8bDPTwnYEIq778Sb0=; b=0rW2zxTcSii7LykzKU0vHgWDF89EkdNPZGCGwGflqhSIsLFFAMchI4/kS8DmLktT6x VzNJtSvYsugtrSF1ydebqhLO3/eqH9MWRSMLpcxzoO1ACJnLyTuY/G31Ci0ITPrHP9Hs xdVmrGIpLaljP3mUb9UrlRxmQGTsga/y4i/ruNSqorY46exQuZu8yPvlV+t2GJJ4iGe4 GQn4JGXcAw9DHjF2SMaEUdvV4XxVpCgxYLtF6OXti6XTvIEF6BfbGUPoLfZ1u7GQPWmx dYqL5udiKJQsV70VljGEVPFOhl4fC2t4khEdVpXoYvVyjG879p3uF6y50OCYadJU4+kE q98w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wbo7MZvWYfYvnTuw53nKridc4z8bDPTwnYEIq778Sb0=; b=Pynwzdt0rMqF37estWucqSvT59UIYbgL6NA+s50xyWvWOZJp+923UUIe4IVJC3Ns8y 7Uy4Kg1E+7OiENB3MdatCxKOJFdoyes4CXhBD3ZdZr3EsB/ta0kbE0OxFDoWjx8hrruJ aIP4DD/0wrgzzAhuD6crhSrrHqdETRtUzWNNfielmDUtqKe6HdQEuF38nvrb0vO7bas5 3KXjYoUEK+HTEmvfKlvdTvEoNWHQJgNlENjpKHrHEtXgC7I+QKBUJD2ZDhi8G9IMS9Hs ru/MD8vcQHal+ypVHlSnT2s1sTEFzPyhrTsgf6IHuzbfYM0mjKly/gV6tCaoBV2JDCfl 6Uhw== X-Gm-Message-State: AKaTC018xVfwA6d/TldVvHoDE0CcwMNA6TJ5trxl0JqMo9qVev9SeWptVJJJtBe0HS+ChhREL25TaYAoRTXojA== X-Received: by 10.107.18.230 with SMTP id 99mr14876367ios.41.1480295914924; Sun, 27 Nov 2016 17:18:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.152.204 with HTTP; Sun, 27 Nov 2016 17:18:34 -0800 (PST) In-Reply-To: References: <201611261550.uAQFo0HC074016@repo.freebsd.org> From: Ryan Stone Date: Sun, 27 Nov 2016 20:18:34 -0500 Message-ID: Subject: Re: svn commit: r309194 - head/usr.sbin/syslogd To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 01:18:35 -0000 > > There is something very wrong in the code here. nextp is never > initialized, so obviously we can't access *nextp. I'm surprised that this > code can even compile with -Werror. I'd fix it but it'd not clear to me > what nextp is intended to do. > Apologies for the noise; I didn't see r309216, which properly initialized nextp. From owner-svn-src-head@freebsd.org Mon Nov 28 02:34:58 2016 Return-Path: Delivered-To: svn-src-head@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 D3E64C59B41 for ; Mon, 28 Nov 2016 02:34:58 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-36.reflexion.net [208.70.210.36]) (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 88AC71F76 for ; Mon, 28 Nov 2016 02:34:58 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 10907 invoked from network); 28 Nov 2016 02:34:43 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 28 Nov 2016 02:34:43 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.20.0) with SMTP; Sun, 27 Nov 2016 21:35:03 -0500 (EST) Received: (qmail 1460 invoked from network); 28 Nov 2016 02:35:03 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 28 Nov 2016 02:35:03 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 047DBEC9011; Sun, 27 Nov 2016 18:34:55 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309144 - in head: lib/libipsec sys/net sys/netipsec [-r309174 does not fix everything] Message-Id: <938D4472-267F-4CDA-A6BA-6A62A1AB054F@dsl-only.net> Date: Sun, 27 Nov 2016 18:34:55 -0800 Cc: FreeBSD Current To: svn-src-head@freebsd.org, rakuco@FreeBSD.org, fabien.thomas@stormshield.eu, Ed Maste X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 02:34:58 -0000 key_debug.c is not the only place with problems : The below is based on my experience with head -r309179. First what someone else reported: > On Fri, Nov 25, 2016 at 05:34:51PM +0100, O. Hartmann wrote:=20 > > Recent sources do not build kernel due to:=20 > >=20 > > [...]=20 > > Building /usr/obj/usr/src/sys/SB21X1/ipsec_mbuf.o=20 > > In file included from /usr/src/sys/netipsec/ipsec_mbuf.c:43:=20 > > In file included from /usr/src/sys/netipsec/ipsec.h:46:=20 > > In file included from /usr/src/sys/netipsec/keydb.h:38:=20 > > /usr/src/sys/sys/mutex.h:367:2: error: LOCK_DEBUG not defined, = include =20 > > before #error LOCK_DEBUG not defined, include = before=20 > > ^=20 > > /usr/src/sys/sys/mutex.h:369:5: error: 'LOCK_DEBUG' is not defined, = evaluates to 0=20 > > [-Werror,-Wundef] #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE)=20 > > ^=20 > > 2 errors generated.=20 > > *** Error code 1=20 (From: = https://lists.freebsd.org/pipermail/freebsd-current/2016-November/063920.h= tml ) I ran into the same thing in the same place. Like O. Hartmann I followed the compiler's advice to work around the problem. That allowed my buildworld buildkernel to complete. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Mon Nov 28 02:36:13 2016 Return-Path: Delivered-To: svn-src-head@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 F34C3C59C9F; Mon, 28 Nov 2016 02:36:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) (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 AE25C10C3; Mon, 28 Nov 2016 02:36:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-yw0-x243.google.com with SMTP id a10so8388154ywa.1; Sun, 27 Nov 2016 18:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=MOJM+wICaVFep1oWWqH5N69p4Z5G1oZ/2JY2TWonYCY=; b=dYxaFX3CccnJg6CoF4aQ2FI0Zpg+UVrDza5wws2WvWOwQX5Q4ONRY6r1/DFxrzm5fF qdKjFhQwT0nkvHtwT+0s0ctNCkbF3uOje2iIbckrfd12z8Ie4AXFqpcemDmJzBTrSLmz 8ztgkdqF7qOGHI0zYlaxNmpQSkx65jeRGDnwL03Y00822AvlNyGvFx6DHe0X1zOjTsP3 RaFHVc/oKOK11wYrxaRIVheZnHxEIODrIuMWFmETaq0KInd09Dl0M2vwdzvp6ewwJGr5 +J/waqusk/X7p/p8FxGe10MrjSfh4ny9F8ewzoOl4E2g4PfrWUsFAOBY4LbHYwx9RZia UdDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=MOJM+wICaVFep1oWWqH5N69p4Z5G1oZ/2JY2TWonYCY=; b=c4e+BdlcJ8kNGqj6G3BmhHBjLjW3XUe4p/5okFWOqG2lq+ayHvotR0RSKLQ+RtxKSa nLEyNlK5oxdcCOXK7e58o+WHcTxWLMT32IqLKxX53Zm2WpbEvVn0VExzunr9Pvqj14wa 96Nmfro/mELdO/irrLCQII0y/86pZkNhh5MAACzfIS75o6WQNT3to/4FCSE/3Sb3YhCg t/bJVWanJ+Ku/Ur+7oYsPKm/p2EEEeCCfTC5I5xtT1+hzv85+1CYLRJSCnkN+5Xieyhm 5gaAZBxZc09rKUk0y+CZ8giTiAHIljfmpd2gq0wEzWCCH0lDBRnYmR3P1joMcS4ep/l+ P9Xg== X-Gm-Message-State: AKaTC02b9VeUrFkq+7Rll4u6ZAy6ADmkr+NDQz/GZjhoTz9N/Kms8ctJfGgx1Nwew+jpjHtDs6U7WLJBDFuscw== X-Received: by 10.129.179.8 with SMTP id r8mr22571067ywh.156.1480300572496; Sun, 27 Nov 2016 18:36:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.22.196 with HTTP; Sun, 27 Nov 2016 18:36:12 -0800 (PST) Received: by 10.37.22.196 with HTTP; Sun, 27 Nov 2016 18:36:12 -0800 (PST) Reply-To: BYOND.Lenox@gmail.com In-Reply-To: References: <201611242254.uAOMswkb081748@repo.freebsd.org> From: Kyle Evans Date: Sun, 27 Nov 2016 20:36:12 -0600 Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: Dimitry Andric , Glen Barber Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 02:36:14 -0000 On Nov 27, 2016 20:20, "Kyle Evans" wrote: > > Hi, > > On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: > > Author: dim > > Date: Thu Nov 24 22:54:55 2016 > > New Revision: 309124 > > URL: https://svnweb.freebsd.org/changeset/base/309124 > > > > Log: > > Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 > > release, and add lld 3.9.0. Also completely revamp the build system for > > clang, llvm, lldb and their related tools. > > > > Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 > > support to build; see UPDATING for more information. > > > > Release notes for llvm, clang and lld are available here: > > > > > > > > > > Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan > > Beich for their help. > > > > Relnotes: yes > > MFC after: 1 month > > First off, thanks for this! =) > > Unfortunately, this commit seems to have done away with the -clang > pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= > elsewhere as FreeBSD-clang has disappeared from my newly built > repository. =( > > [1] https://svnweb.freebsd.org/base/head/usr.bin/clang/clang.prog.mk?limit_changes=0&r1=298107&r2=309124&pathrev=309124 Argh, sorry about the noise here. I just realized that clang was moved to the runtime package -- spooked by the package disappearing for no good reason. From owner-svn-src-head@freebsd.org Mon Nov 28 02:51:56 2016 Return-Path: Delivered-To: svn-src-head@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 BFCEBC59F9A; Mon, 28 Nov 2016 02:51:56 +0000 (UTC) (envelope-from adrian@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 8F7CC19CE; Mon, 28 Nov 2016 02:51:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS2ptir029445; Mon, 28 Nov 2016 02:51:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS2ptoi029444; Mon, 28 Nov 2016 02:51:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611280251.uAS2ptoi029444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 02:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309222 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 02:51:56 -0000 Author: adrian Date: Mon Nov 28 02:51:55 2016 New Revision: 309222 URL: https://svnweb.freebsd.org/changeset/base/309222 Log: [ath] include logging of TU versions of the TSF values. The beacon programming side of things deals in TUs and 1/8th TUs, so it's good to se the TU value here when debugging beaconing issues. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Nov 27 20:52:52 2016 (r309221) +++ head/sys/dev/ath/if_ath_rx.c Mon Nov 28 02:51:55 2016 (r309222) @@ -420,19 +420,24 @@ ath_recv_mgmt(struct ieee80211_node *ni, tsf_remainder = (tsf_beacon - tsf_beacon_old) % tsf_intval; } - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: old_tsf=%llu, new_tsf=%llu, target_tsf=%llu, delta=%lld, bmiss=%d, remainder=%d\n", + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: old_tsf=%llu (%u), new_tsf=%llu (%u), target_tsf=%llu (%u), delta=%lld, bmiss=%d, remainder=%d\n", __func__, (unsigned long long) tsf_beacon_old, + (unsigned int) (tsf_beacon_old >> 10), (unsigned long long) tsf_beacon, + (unsigned int ) (tsf_beacon >> 10), (unsigned long long) tsf_beacon_target, + (unsigned int) (tsf_beacon_target >> 10), (long long) tsf_delta, tsf_delta_bmiss, tsf_remainder); - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: tsf=%llu, nexttbtt=%llu, delta=%d\n", + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: tsf=%llu (%u), nexttbtt=%llu (%u), delta=%d\n", __func__, (unsigned long long) tsf_beacon, + (unsigned int) (tsf_beacon >> 10), (unsigned long long) nexttbtt, + (unsigned int) (nexttbtt >> 10), (int32_t) tsf_beacon - (int32_t) nexttbtt + tsf_intval); /* We only do syncbeacon on STA VAPs; not on IBSS */ From owner-svn-src-head@freebsd.org Mon Nov 28 02:59:34 2016 Return-Path: Delivered-To: svn-src-head@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 CCB98C584D4; Mon, 28 Nov 2016 02:59:34 +0000 (UTC) (envelope-from adrian@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 A1B2D1F4A; Mon, 28 Nov 2016 02:59:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS2xXVw029734; Mon, 28 Nov 2016 02:59:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS2xXcO029733; Mon, 28 Nov 2016 02:59:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611280259.uAS2xXcO029733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 02:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309223 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 02:59:34 -0000 Author: adrian Date: Mon Nov 28 02:59:33 2016 New Revision: 309223 URL: https://svnweb.freebsd.org/changeset/base/309223 Log: [ath] fix target beacon interval programming for STA mode when in powersave. This bug has been bugging me for quite some time. I finally sat down with enough coffee to figure it out. The short of it - rounding up to the next intval multiple of the TSF value only works if the AP is transmitting all its beacons on an interval of the TSF. If it isn't - for example, doing staggered beacons on a multi-VAP setup with a single hardware TSF - then weird things occur. The long of it - When powersave is enabled, the MAC and PHY are partially powered off. They can't receive any packets (or transmit, for that matter.) The target beacon timer programming will wake up the MAC/PHY just before the beacon is supposed to be received (well, strictly speaking, at DTIM so it can see the TIM - traffic information map - telling the STA whether any traffic is there for it) and it happens automatically. However, this relies on the target beacon time being programmed correctly. If it isn't then the hardware will wake up and not hear any beacons - and then it'll be asleep for said beacons. After enough of this, net80211 will give up and assume the AP went away. This should fix both TSFOOR interrupts and disconnects from APs with powersave enabled. The annoying bit is that it only happens if APs stagger things or start on a non-zero TSF. So, this would sometimes be fine and sometimes not be fine. What: * I don't know (yet) why the code rounds up to the next intval. For now, just disable rounding it and trust the value we get. TODO: * If we do see a beacon miss in STA mode then we should transition out of sleep for a while so we can hear beacons to resync against. I'd love a patch from someone to enable that particular behaviour. Note - that doesn't require that net80211 brings the chip out of sleep state - only that we wake the chip up through to full-on and then let it go to sleep again when we've seen a beacon. The wifi stack and AP can still completely just stay believing we're in sleep mode. Tested: * AR9485, STA mode, powersave enabled MFC after: 1 week Relnotes: Yes Modified: head/sys/dev/ath/if_ath_beacon.c Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 02:51:55 2016 (r309222) +++ head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 02:59:33 2016 (r309223) @@ -964,10 +964,30 @@ ath_beacon_config(struct ath_softc *sc, /* NB: the beacon interval is kept internally in TU's */ intval = ni->ni_intval & HAL_BEACON_PERIOD; } + + + /* + * Note: rounding up to the next intval can cause problems. + * + * In STA mode with powersave enabled, beacons are only received + * whenever the beacon timer fires to wake up the hardware. + * Now, if this is rounded up to the next intval, it assumes + * that the AP has started transmitting beacons at TSF values that + * are multiples of intval, versus say being 25 TU off. + * + * I'm not sure why nexttbtt is rounded up to the intval. + * If we sync against a beacon that is way out, we should + * take a beacon miss and re-sync against the next beacon. + * + * So for now - don't round up if we're in STA mode. + * Maybe later (when someone eventually does powersave+IBSS, + * powersave+MBSS) this can be flipped on for those too. + */ if (nexttbtt == 0) /* e.g. for ap mode */ nexttbtt = intval; - else if (intval) /* NB: can be 0 for monitor mode */ + else if ((ic->ic_opmode != IEEE80211_M_STA) && intval) /* NB: can be 0 for monitor mode */ nexttbtt = roundup(nexttbtt, intval); + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", __func__, nexttbtt, intval, ni->ni_intval); if (ic->ic_opmode == IEEE80211_M_STA && !sc->sc_swbmiss) { From owner-svn-src-head@freebsd.org Mon Nov 28 03:50:36 2016 Return-Path: Delivered-To: svn-src-head@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 4B4A6C59136; Mon, 28 Nov 2016 03:50:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) (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 1D440B7A; Mon, 28 Nov 2016 03:50:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f172.google.com with SMTP id m5so71829291ioe.3; Sun, 27 Nov 2016 19:50:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=6D7MdErKWIS8YX53UbGOJO7/tAw7xrZ+89sKBkAP7Mc=; b=MREqDc6DAzy4ytZMH3wW1PEFn/hT1ebgFcegzcbsWp88P00EntPiiCG7uY8O77XWSM 1GKX2uPfz/d3BcVgow0UaMZ2Y6XfBH7p4QO2pTvx32usTbI10JsvXEfyjATAQviqwbTD J113xmSkgGcR9hkuTJ5m2f2uCWvxeKZJXMUsyyPGLJ8nbck8gOS41Tuk4wz0G038aiYY ZmaRQXr71DtRIeJcHtdIHSByI4p02FT8ylhM3BKL+inYJrLIJuv8ocZdXXXfkfnRNWKu ClpfmiunP8NzMiu4LOZ5sm+Aqpv4wsncNSBqLT85DMus4al09A/vSiyfOdbeSwlxK+O7 fp+g== X-Gm-Message-State: AKaTC0360YiRw/QLkpj8emZBUNfk1+NBVdOCNGgypSVeFfMvRHTuNRrdBKsxEXaRwQ0qdw== X-Received: by 10.36.189.201 with SMTP id x192mr16166203ite.114.1480303185909; Sun, 27 Nov 2016 19:19:45 -0800 (PST) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id g185sm8615596ith.14.2016.11.27.19.19.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 19:19:45 -0800 (PST) Received: by mail-io0-f181.google.com with SMTP id m5so71035335ioe.3; Sun, 27 Nov 2016 19:19:45 -0800 (PST) X-Received: by 10.36.7.71 with SMTP id f68mr12877353itf.104.1480303185205; Sun, 27 Nov 2016 19:19:45 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.109.68 with HTTP; Sun, 27 Nov 2016 19:19:44 -0800 (PST) In-Reply-To: <938D4472-267F-4CDA-A6BA-6A62A1AB054F@dsl-only.net> References: <938D4472-267F-4CDA-A6BA-6A62A1AB054F@dsl-only.net> From: Conrad Meyer Date: Sun, 27 Nov 2016 19:19:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309144 - in head: lib/libipsec sys/net sys/netipsec [-r309174 does not fix everything] To: Mark Millard Cc: svn-src-head@freebsd.org, rakuco@freebsd.org, fabien.thomas@stormshield.eu, Ed Maste , FreeBSD Current Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 03:50:36 -0000 Hi Mark, I believe this was addressed by Scott Long in r309201. r309174 (an incomplete fix for the same problem) can probably be reverted. Best, Conrad On Sun, Nov 27, 2016 at 6:34 PM, Mark Millard wrote: > key_debug.c is not the only place with problems : The below is > based on my experience with head -r309179. First what someone > else reported: > >> On Fri, Nov 25, 2016 at 05:34:51PM +0100, O. Hartmann wrote: >> > Recent sources do not build kernel due to: >> > >> > [...] >> > Building /usr/obj/usr/src/sys/SB21X1/ipsec_mbuf.o >> > In file included from /usr/src/sys/netipsec/ipsec_mbuf.c:43: >> > In file included from /usr/src/sys/netipsec/ipsec.h:46: >> > In file included from /usr/src/sys/netipsec/keydb.h:38: >> > /usr/src/sys/sys/mutex.h:367:2: error: LOCK_DEBUG not defined, include >> > before #error LOCK_DEBUG not defined, include before >> > ^ >> > /usr/src/sys/sys/mutex.h:369:5: error: 'LOCK_DEBUG' is not defined, evaluates to 0 >> > [-Werror,-Wundef] #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE) >> > ^ >> > 2 errors generated. >> > *** Error code 1 > (From: https://lists.freebsd.org/pipermail/freebsd-current/2016-November/063920.html ) > > I ran into the same thing in the same place. > > Like O. Hartmann I followed the compiler's advice to work around > the problem. That allowed my buildworld buildkernel to complete. > > > === > Mark Millard > markmi at dsl-only.net > > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Nov 28 04:53:38 2016 Return-Path: Delivered-To: svn-src-head@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 145C1C59365; Mon, 28 Nov 2016 04:53:38 +0000 (UTC) (envelope-from sephe@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 D81A71E53; Mon, 28 Nov 2016 04:53:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS4rb52077707; Mon, 28 Nov 2016 04:53:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS4rbU4077706; Mon, 28 Nov 2016 04:53:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280453.uAS4rbU4077706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 04:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309224 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 04:53:38 -0000 Author: sephe Date: Mon Nov 28 04:53:36 2016 New Revision: 309224 URL: https://svnweb.freebsd.org/changeset/base/309224 Log: hyperv/vmbus: Zero out GPADL if error happens. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8601 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 02:59:33 2016 (r309223) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 04:53:36 2016 (r309224) @@ -503,6 +503,12 @@ vmbus_chan_gpadl_connect(struct vmbus_ch uint64_t page_id; /* + * Reset GPADL, so that the result would consistent, if error + * happened later on. + */ + *gpadl0 = 0; + + /* * Preliminary checks. */ From owner-svn-src-head@freebsd.org Mon Nov 28 05:07:50 2016 Return-Path: Delivered-To: svn-src-head@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 155B3C59653; Mon, 28 Nov 2016 05:07:50 +0000 (UTC) (envelope-from sephe@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 BF877147A; Mon, 28 Nov 2016 05:07:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS57mpS081701; Mon, 28 Nov 2016 05:07:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS57mmf081698; Mon, 28 Nov 2016 05:07:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280507.uAS57mmf081698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309225 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:07:50 -0000 Author: sephe Date: Mon Nov 28 05:07:48 2016 New Revision: 309225 URL: https://svnweb.freebsd.org/changeset/base/309225 Log: hyperv/vmbus: Add supportive transaction wait function. This function supports channel revocation properly. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8611 Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Mon Nov 28 04:53:36 2016 (r309224) +++ head/sys/dev/hyperv/include/vmbus.h Mon Nov 28 05:07:48 2016 (r309225) @@ -116,6 +116,7 @@ struct vmbus_chan_br { }; struct vmbus_channel; +struct vmbus_xact; struct vmbus_xact_ctx; struct hyperv_guid; struct task; @@ -173,6 +174,8 @@ void vmbus_chan_run_task(struct vmbus_c void vmbus_chan_set_orphan(struct vmbus_channel *chan, struct vmbus_xact_ctx *); void vmbus_chan_unset_orphan(struct vmbus_channel *chan); +const void *vmbus_chan_xact_wait(const struct vmbus_channel *chan, + struct vmbus_xact *xact, size_t *resp_len, bool can_sleep); int vmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr, int size, uint32_t *gpadl); Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 04:53:36 2016 (r309224) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 05:07:48 2016 (r309225) @@ -1927,3 +1927,37 @@ vmbus_chan_unset_orphan(struct vmbus_cha chan->ch_orphan_xact = NULL; sx_xunlock(&chan->ch_orphan_lock); } + +const void * +vmbus_chan_xact_wait(const struct vmbus_channel *chan, + struct vmbus_xact *xact, size_t *resp_len, bool can_sleep) +{ + const void *ret; + + if (can_sleep) + ret = vmbus_xact_wait(xact, resp_len); + else + ret = vmbus_xact_busywait(xact, resp_len); + if (vmbus_chan_is_revoked(chan)) { + /* + * This xact probably is interrupted, and the + * interruption can race the reply reception, + * so we have to make sure that there are nothing + * left on the RX bufring, i.e. this xact will + * not be touched, once this function returns. + * + * Since the hypervisor will not put more data + * onto the RX bufring once the channel is revoked, + * the following loop will be terminated, once all + * data are drained by the driver's channel + * callback. + */ + while (!vmbus_chan_rx_empty(chan)) { + if (can_sleep) + pause("chxact", 1); + else + DELAY(1000); + } + } + return (ret); +} From owner-svn-src-head@freebsd.org Mon Nov 28 05:15:29 2016 Return-Path: Delivered-To: svn-src-head@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 9CB41C59859; Mon, 28 Nov 2016 05:15:29 +0000 (UTC) (envelope-from sephe@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 6C1C119E1; Mon, 28 Nov 2016 05:15:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5FSlS085776; Mon, 28 Nov 2016 05:15:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5FSSA085774; Mon, 28 Nov 2016 05:15:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280515.uAS5FSSA085774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309226 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:15:29 -0000 Author: sephe Date: Mon Nov 28 05:15:28 2016 New Revision: 309226 URL: https://svnweb.freebsd.org/changeset/base/309226 Log: hyperv/hn: Utilize vmbus_chan_xact_wait MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8612 Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/hn_rndis.c Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:07:48 2016 (r309225) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:15:28 2016 (r309226) @@ -109,10 +109,8 @@ hn_nvs_xact_execute(struct hn_softc *sc, vmbus_xact_deactivate(xact); return (NULL); } - if (HN_CAN_SLEEP(sc)) - hdr = vmbus_xact_wait(xact, &resplen); - else - hdr = vmbus_xact_busywait(xact, &resplen); + hdr = vmbus_chan_xact_wait(sc->hn_prichan, xact, &resplen, + HN_CAN_SLEEP(sc)); /* * Check this NVS response message. Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:07:48 2016 (r309225) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:15:28 2016 (r309226) @@ -232,10 +232,8 @@ hn_rndis_xact_exec1(struct hn_softc *sc, if_printf(sc->hn_ifp, "RNDIS ctrl send failed: %d\n", error); return (NULL); } - if (HN_CAN_SLEEP(sc)) - return (vmbus_xact_wait(xact, comp_len)); - else - return (vmbus_xact_busywait(xact, comp_len)); + return (vmbus_chan_xact_wait(sc->hn_prichan, xact, comp_len, + HN_CAN_SLEEP(sc))); } static const void * From owner-svn-src-head@freebsd.org Mon Nov 28 05:23:59 2016 Return-Path: Delivered-To: svn-src-head@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 7D329C59A8B; Mon, 28 Nov 2016 05:23:59 +0000 (UTC) (envelope-from sephe@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 37F1B1E2D; Mon, 28 Nov 2016 05:23:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5NwQw089692; Mon, 28 Nov 2016 05:23:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5NwUq089689; Mon, 28 Nov 2016 05:23:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280523.uAS5NwUq089689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309227 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:23:59 -0000 Author: sephe Date: Mon Nov 28 05:23:57 2016 New Revision: 309227 URL: https://svnweb.freebsd.org/changeset/base/309227 Log: hyperv/hn: Fix detach error handling. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8613 Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:15:28 2016 (r309226) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:23:57 2016 (r309227) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); static int hn_nvs_conn_chim(struct hn_softc *); static int hn_nvs_conn_rxbuf(struct hn_softc *); -static int hn_nvs_disconn_chim(struct hn_softc *); -static int hn_nvs_disconn_rxbuf(struct hn_softc *); +static void hn_nvs_disconn_chim(struct hn_softc *); +static void hn_nvs_disconn_rxbuf(struct hn_softc *); static int hn_nvs_conf_ndis(struct hn_softc *, int); static int hn_nvs_init_ndis(struct hn_softc *); static int hn_nvs_doinit(struct hn_softc *, uint32_t); @@ -308,7 +308,7 @@ cleanup: return (error); } -static int +static void hn_nvs_disconn_rxbuf(struct hn_softc *sc) { int error; @@ -328,7 +328,12 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc if (error) { if_printf(sc->hn_ifp, "send nvs rxbuf disconn failed: %d\n", error); - return (error); + /* + * Fine for a revoked channel, since the hypervisor + * does not drain TX bufring for a revoked channel. + */ + if (!vmbus_chan_is_revoked(sc->hn_prichan)) + sc->hn_flags |= HN_FLAG_RXBUF_REF; } sc->hn_flags &= ~HN_FLAG_RXBUF_CONNECTED; @@ -357,14 +362,13 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc if (error) { if_printf(sc->hn_ifp, "rxbuf gpadl disconn failed: %d\n", error); - return (error); + sc->hn_flags |= HN_FLAG_RXBUF_REF; } sc->hn_rxbuf_gpadl = 0; } - return (0); } -static int +static void hn_nvs_disconn_chim(struct hn_softc *sc) { int error; @@ -384,7 +388,12 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (error) { if_printf(sc->hn_ifp, "send nvs chim disconn failed: %d\n", error); - return (error); + /* + * Fine for a revoked channel, since the hypervisor + * does not drain TX bufring for a revoked channel. + */ + if (!vmbus_chan_is_revoked(sc->hn_prichan)) + sc->hn_flags |= HN_FLAG_CHIM_REF; } sc->hn_flags &= ~HN_FLAG_CHIM_CONNECTED; @@ -414,7 +423,7 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (error) { if_printf(sc->hn_ifp, "chim gpadl disconn failed: %d\n", error); - return (error); + sc->hn_flags |= HN_FLAG_CHIM_REF; } sc->hn_chim_gpadl = 0; } @@ -423,7 +432,6 @@ hn_nvs_disconn_chim(struct hn_softc *sc) free(sc->hn_chim_bmap, M_DEVBUF); sc->hn_chim_bmap = NULL; } - return (0); } static int Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:15:28 2016 (r309226) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:23:57 2016 (r309227) @@ -296,6 +296,7 @@ static int hn_synth_attach(struct hn_s static void hn_synth_detach(struct hn_softc *); static int hn_synth_alloc_subchans(struct hn_softc *, int *); +static bool hn_synth_attachable(const struct hn_softc *); static void hn_suspend(struct hn_softc *); static void hn_suspend_data(struct hn_softc *); static void hn_suspend_mgmt(struct hn_softc *); @@ -3249,7 +3250,10 @@ hn_destroy_rx_data(struct hn_softc *sc) int i; if (sc->hn_rxbuf != NULL) { - hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + if ((sc->hn_flags & HN_FLAG_RXBUF_REF) == 0) + hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + else + device_printf(sc->hn_dev, "RXBUF is referenced\n"); sc->hn_rxbuf = NULL; } @@ -3261,7 +3265,12 @@ hn_destroy_rx_data(struct hn_softc *sc) if (rxr->hn_br == NULL) continue; - hyperv_dmamem_free(&rxr->hn_br_dma, rxr->hn_br); + if ((rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) == 0) { + hyperv_dmamem_free(&rxr->hn_br_dma, rxr->hn_br); + } else { + device_printf(sc->hn_dev, + "%dth channel bufring is referenced", i); + } rxr->hn_br = NULL; #if defined(INET) || defined(INET6) @@ -3730,7 +3739,12 @@ hn_destroy_tx_data(struct hn_softc *sc) int i; if (sc->hn_chim != NULL) { - hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + if ((sc->hn_flags & HN_FLAG_CHIM_REF) == 0) { + hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + } else { + device_printf(sc->hn_dev, + "chimney sending buffer is referenced"); + } sc->hn_chim = NULL; } @@ -4214,7 +4228,7 @@ static void hn_chan_detach(struct hn_softc *sc, struct vmbus_channel *chan) { struct hn_rx_ring *rxr; - int idx; + int idx, error; idx = vmbus_chan_subidx(chan); @@ -4243,7 +4257,16 @@ hn_chan_detach(struct hn_softc *sc, stru * NOTE: * Channel closing does _not_ destroy the target channel. */ - vmbus_chan_close(chan); + error = vmbus_chan_close_direct(chan); + if (error == EISCONN) { + if_printf(sc->hn_ifp, "chan%u subidx%u " + "bufring is connected after being closed\n", + vmbus_chan_id(chan), vmbus_chan_subidx(chan)); + rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; + } else if (error) { + if_printf(sc->hn_ifp, "chan%u subidx%u close failed: %d\n", + vmbus_chan_id(chan), vmbus_chan_subidx(chan), error); + } } static int @@ -4373,6 +4396,23 @@ hn_synth_alloc_subchans(struct hn_softc return (0); } +static bool +hn_synth_attachable(const struct hn_softc *sc) +{ + int i; + + if (sc->hn_flags & HN_FLAG_ERRORS) + return (false); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + const struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; + + if (rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) + return (false); + } + return (true); +} + static int hn_synth_attach(struct hn_softc *sc, int mtu) { @@ -4383,6 +4423,9 @@ hn_synth_attach(struct hn_softc *sc, int KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0, ("synthetic parts were attached")); + if (!hn_synth_attachable(sc)) + return (ENXIO); + /* Save capabilities for later verification. */ old_caps = sc->hn_caps; sc->hn_caps = 0; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Nov 28 05:15:28 2016 (r309226) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Nov 28 05:23:57 2016 (r309227) @@ -91,7 +91,8 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_TCP 0x0002 #define HN_TRUST_HCSUM_UDP 0x0004 -#define HN_RX_FLAG_ATTACHED 0x1 +#define HN_RX_FLAG_ATTACHED 0x0001 +#define HN_RX_FLAG_BR_REF 0x0002 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -162,8 +163,8 @@ struct hn_tx_ring { struct sysctl_oid *hn_tx_sysctl_tree; } __aligned(CACHE_LINE_SIZE); -#define HN_TX_FLAG_ATTACHED 0x1 -#define HN_TX_FLAG_HASHVAL 0x2 /* support HASHVAL pktinfo */ +#define HN_TX_FLAG_ATTACHED 0x0001 +#define HN_TX_FLAG_HASHVAL 0x0002 /* support HASHVAL pktinfo */ /* * Device-specific softc structure @@ -237,6 +238,10 @@ struct hn_softc { #define HN_FLAG_HAS_RSSIND 0x0008 #define HN_FLAG_SYNTH_ATTACHED 0x0010 #define HN_FLAG_NO_SLEEPING 0x0020 +#define HN_FLAG_RXBUF_REF 0x0040 +#define HN_FLAG_CHIM_REF 0x0080 + +#define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) #define HN_NO_SLEEPING(sc) \ do { \ From owner-svn-src-head@freebsd.org Mon Nov 28 05:31:38 2016 Return-Path: Delivered-To: svn-src-head@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 21901C59CE5; Mon, 28 Nov 2016 05:31:38 +0000 (UTC) (envelope-from sephe@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 E53511300; Mon, 28 Nov 2016 05:31:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5VbCo092924; Mon, 28 Nov 2016 05:31:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5Vbw6092923; Mon, 28 Nov 2016 05:31:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280531.uAS5Vbw6092923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309228 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:31:38 -0000 Author: sephe Date: Mon Nov 28 05:31:36 2016 New Revision: 309228 URL: https://svnweb.freebsd.org/changeset/base/309228 Log: hyperv/hn: Fix multi-packet RNDIS message aggregation size setting. Just in case that no chimney sending buffer can be used. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8619 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:23:57 2016 (r309227) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:31:36 2016 (r309228) @@ -706,6 +706,10 @@ hn_set_txagg(struct hn_softc *sc) if (sc->hn_rndis_agg_size < size) size = sc->hn_rndis_agg_size; + /* NOTE: We only aggregate packets using chimney sending buffers. */ + if (size > (uint32_t)sc->hn_chim_szmax) + size = sc->hn_chim_szmax; + if (size <= 2 * HN_PKTSIZE_MIN(sc->hn_rndis_agg_align)) { /* Disable */ size = 0; @@ -717,10 +721,6 @@ hn_set_txagg(struct hn_softc *sc) if (size > INT_MAX) size = INT_MAX; - /* NOTE: We only aggregate packets using chimney sending buffers. */ - if (size > (uint32_t)sc->hn_chim_szmax) - size = sc->hn_chim_szmax; - /* * Setup aggregation packet count. */ From owner-svn-src-head@freebsd.org Mon Nov 28 05:46:01 2016 Return-Path: Delivered-To: svn-src-head@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 7ED25C59EDE; Mon, 28 Nov 2016 05:46:01 +0000 (UTC) (envelope-from sephe@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 5951B1992; Mon, 28 Nov 2016 05:46:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5k0A3097644; Mon, 28 Nov 2016 05:46:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5k0nT097641; Mon, 28 Nov 2016 05:46:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280546.uAS5k0nT097641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309229 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:46:01 -0000 Author: sephe Date: Mon Nov 28 05:46:00 2016 New Revision: 309229 URL: https://svnweb.freebsd.org/changeset/base/309229 Log: hyperv/hn: Fix attach error handling MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8620 Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/hn_rndis.c head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:31:36 2016 (r309228) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:46:00 2016 (r309229) @@ -273,8 +273,14 @@ hn_nvs_conn_chim(struct hn_softc *sc) goto cleanup; } if (sectsz == 0) { + /* + * Can't use chimney sending buffer; done! + */ if_printf(sc->hn_ifp, "zero chimney sending buffer " "section size\n"); + sc->hn_chim_szmax = 0; + sc->hn_chim_cnt = 0; + sc->hn_flags |= HN_FLAG_CHIM_CONNECTED; return (0); } @@ -431,6 +437,7 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (sc->hn_chim_bmap != NULL) { free(sc->hn_chim_bmap, M_DEVBUF); sc->hn_chim_bmap = NULL; + sc->hn_chim_bmap_cnt = 0; } } @@ -620,8 +627,10 @@ hn_nvs_attach(struct hn_softc *sc, int m * Connect chimney sending buffer. */ error = hn_nvs_conn_chim(sc); - if (error) + if (error) { + hn_nvs_disconn_rxbuf(sc); return (error); + } return (0); } Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:31:36 2016 (r309228) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:46:00 2016 (r309229) @@ -979,7 +979,6 @@ hn_rndis_attach(struct hn_softc *sc, int /* * Configure NDIS offload settings. - * XXX no offloading, if error happened? */ hn_rndis_conf_offload(sc, mtu); return (0); Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:31:36 2016 (r309228) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:46:00 2016 (r309229) @@ -4215,11 +4215,14 @@ hn_chan_attach(struct hn_softc *sc, stru cbr.cbr_rxsz = HN_RXBR_SIZE; error = vmbus_chan_open_br(chan, &cbr, NULL, 0, hn_chan_callback, rxr); if (error) { - if_printf(sc->hn_ifp, "open chan%u failed: %d\n", - vmbus_chan_id(chan), error); - rxr->hn_rx_flags &= ~HN_RX_FLAG_ATTACHED; - if (txr != NULL) - txr->hn_tx_flags &= ~HN_TX_FLAG_ATTACHED; + if (error == EISCONN) { + if_printf(sc->hn_ifp, "bufring is connected after " + "chan%u open failure\n", vmbus_chan_id(chan)); + rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; + } else { + if_printf(sc->hn_ifp, "open chan%u failed: %d\n", + vmbus_chan_id(chan), error); + } } return (error); } @@ -4276,15 +4279,18 @@ hn_attach_subchans(struct hn_softc *sc) int subchan_cnt = sc->hn_rx_ring_inuse - 1; int i, error = 0; - if (subchan_cnt == 0) - return (0); + KASSERT(subchan_cnt > 0, ("no sub-channels")); /* Attach the sub-channels. */ subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); for (i = 0; i < subchan_cnt; ++i) { - error = hn_chan_attach(sc, subchans[i]); - if (error) - break; + int error1; + + error1 = hn_chan_attach(sc, subchans[i]); + if (error1) { + error = error1; + /* Move on; all channels will be detached later. */ + } } vmbus_subchan_rel(subchans, subchan_cnt); @@ -4416,9 +4422,12 @@ hn_synth_attachable(const struct hn_soft static int hn_synth_attach(struct hn_softc *sc, int mtu) { +#define ATTACHED_NVS 0x0002 +#define ATTACHED_RNDIS 0x0004 + struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; int error, nsubch, nchan, i; - uint32_t old_caps; + uint32_t old_caps, attached = 0; KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0, ("synthetic parts were attached")); @@ -4439,21 +4448,23 @@ hn_synth_attach(struct hn_softc *sc, int */ error = hn_chan_attach(sc, sc->hn_prichan); if (error) - return (error); + goto failed; /* * Attach NVS. */ error = hn_nvs_attach(sc, mtu); if (error) - return (error); + goto failed; + attached |= ATTACHED_NVS; /* * Attach RNDIS _after_ NVS is attached. */ error = hn_rndis_attach(sc, mtu); if (error) - return (error); + goto failed; + attached |= ATTACHED_RNDIS; /* * Make sure capabilities are not changed. @@ -4461,9 +4472,8 @@ hn_synth_attach(struct hn_softc *sc, int if (device_is_attached(sc->hn_dev) && old_caps != sc->hn_caps) { if_printf(sc->hn_ifp, "caps mismatch old 0x%08x, new 0x%08x\n", old_caps, sc->hn_caps); - /* Restore old capabilities and abort. */ - sc->hn_caps = old_caps; - return ENXIO; + error = ENXIO; + goto failed; } /* @@ -4476,19 +4486,32 @@ hn_synth_attach(struct hn_softc *sc, int nsubch = sc->hn_rx_ring_cnt - 1; error = hn_synth_alloc_subchans(sc, &nsubch); if (error) - return (error); + goto failed; + /* NOTE: _Full_ synthetic parts detach is required now. */ + sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED; + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that NVS offered. + */ nchan = nsubch + 1; + hn_set_ring_inuse(sc, nchan); if (nchan == 1) { /* Only the primary channel can be used; done */ goto back; } /* - * Configure RSS key and indirect table _after_ all sub-channels - * are allocated. + * Attach the sub-channels. */ + error = hn_attach_subchans(sc); + if (error) + goto failed; + /* + * Configure RSS key and indirect table _after_ all sub-channels + * are attached. + */ if ((sc->hn_flags & HN_FLAG_HAS_RSSKEY) == 0) { /* * RSS key is not set yet; set it to the default RSS key. @@ -4521,34 +4544,31 @@ hn_synth_attach(struct hn_softc *sc, int } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); - if (error) { - /* - * Failed to configure RSS key or indirect table; only - * the primary channel can be used. - */ - nchan = 1; - } -back: - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that NVS offered. - */ - hn_set_ring_inuse(sc, nchan); - - /* - * Attach the sub-channels, if any. - */ - error = hn_attach_subchans(sc); if (error) - return (error); - + goto failed; +back: /* * Fixup transmission aggregation setup. */ hn_set_txagg(sc); - - sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED; return (0); + +failed: + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + hn_synth_detach(sc); + } else { + if (attached & ATTACHED_RNDIS) + hn_rndis_detach(sc); + if (attached & ATTACHED_NVS) + hn_nvs_detach(sc); + hn_chan_detach(sc, sc->hn_prichan); + /* Restore old capabilities. */ + sc->hn_caps = old_caps; + } + return (error); + +#undef ATTACHED_RNDIS +#undef ATTACHED_NVS } /* @@ -4559,7 +4579,6 @@ back: static void hn_synth_detach(struct hn_softc *sc) { - HN_LOCK_ASSERT(sc); KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, ("synthetic parts were not attached")); From owner-svn-src-head@freebsd.org Mon Nov 28 05:54:21 2016 Return-Path: Delivered-To: svn-src-head@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 9FDC6C51184; Mon, 28 Nov 2016 05:54:21 +0000 (UTC) (envelope-from sephe@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 6F7681ECD; Mon, 28 Nov 2016 05:54:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5sK9B001995; Mon, 28 Nov 2016 05:54:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5sKfm001994; Mon, 28 Nov 2016 05:54:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280554.uAS5sKfm001994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309230 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:54:21 -0000 Author: sephe Date: Mon Nov 28 05:54:20 2016 New Revision: 309230 URL: https://svnweb.freebsd.org/changeset/base/309230 Log: hyperv/hn: Enable multi-packet RNDIS message support by default. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8621 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:46:00 2016 (r309229) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:54:20 2016 (r309230) @@ -465,7 +465,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_size &hn_tx_agg_size, 0, "Packet transmission aggregation size limit"); /* Packet transmission aggregation count limit */ -static int hn_tx_agg_pkts = 0; +static int hn_tx_agg_pkts = -1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); From owner-svn-src-head@freebsd.org Mon Nov 28 06:10:43 2016 Return-Path: Delivered-To: svn-src-head@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 1C471C51683; Mon, 28 Nov 2016 06:10:43 +0000 (UTC) (envelope-from sephe@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 DFE8A1654; Mon, 28 Nov 2016 06:10:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6Ag9T006375; Mon, 28 Nov 2016 06:10:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6AgVo006374; Mon, 28 Nov 2016 06:10:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280610.uAS6AgVo006374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 06:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309231 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:10:43 -0000 Author: sephe Date: Mon Nov 28 06:10:41 2016 New Revision: 309231 URL: https://svnweb.freebsd.org/changeset/base/309231 Log: hyperv/hn: Fix vmbus_chan_subidx usage. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8629 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:54:20 2016 (r309230) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 06:10:41 2016 (r309231) @@ -1524,7 +1524,7 @@ hn_txpkt_done(struct hn_nvs_sendctx *snd txr = txd->txr; KASSERT(txr->hn_chan == chan, ("channel mismatch, on chan%u, should be chan%u", - vmbus_chan_subidx(chan), vmbus_chan_subidx(txr->hn_chan))); + vmbus_chan_id(chan), vmbus_chan_id(txr->hn_chan))); txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); @@ -4262,13 +4262,12 @@ hn_chan_detach(struct hn_softc *sc, stru */ error = vmbus_chan_close_direct(chan); if (error == EISCONN) { - if_printf(sc->hn_ifp, "chan%u subidx%u " - "bufring is connected after being closed\n", - vmbus_chan_id(chan), vmbus_chan_subidx(chan)); + if_printf(sc->hn_ifp, "chan%u bufring is connected " + "after being closed\n", vmbus_chan_id(chan)); rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; } else if (error) { - if_printf(sc->hn_ifp, "chan%u subidx%u close failed: %d\n", - vmbus_chan_id(chan), vmbus_chan_subidx(chan), error); + if_printf(sc->hn_ifp, "chan%u close failed: %d\n", + vmbus_chan_id(chan), error); } } From owner-svn-src-head@freebsd.org Mon Nov 28 06:32:06 2016 Return-Path: Delivered-To: svn-src-head@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 5473FC51F92; Mon, 28 Nov 2016 06:32:06 +0000 (UTC) (envelope-from delphij@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 2409D1880; Mon, 28 Nov 2016 06:32:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6W5Mi017928; Mon, 28 Nov 2016 06:32:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6W5mS017927; Mon, 28 Nov 2016 06:32:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280632.uAS6W5mS017927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 06:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309232 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:32:06 -0000 Author: delphij Date: Mon Nov 28 06:32:05 2016 New Revision: 309232 URL: https://svnweb.freebsd.org/changeset/base/309232 Log: Fix an obvious typo. MFC after: 2 weeks Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon Nov 28 06:10:41 2016 (r309231) +++ head/usr.bin/sort/sort.c Mon Nov 28 06:32:05 2016 (r309232) @@ -280,7 +280,7 @@ set_hw_params(void) pages = sysconf(_SC_PHYS_PAGES); if (pages < 1) { perror("sysconf pages"); - psize = 1; + pages = 1; } psize = sysconf(_SC_PAGESIZE); if (psize < 1) { From owner-svn-src-head@freebsd.org Mon Nov 28 06:36:11 2016 Return-Path: Delivered-To: svn-src-head@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 A7DFFC580D8; Mon, 28 Nov 2016 06:36:11 +0000 (UTC) (envelope-from delphij@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 5DB441BAA; Mon, 28 Nov 2016 06:36:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6aAaf018130; Mon, 28 Nov 2016 06:36:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6aAPC018128; Mon, 28 Nov 2016 06:36:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280636.uAS6aAPC018128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 06:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309233 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:36:11 -0000 Author: delphij Date: Mon Nov 28 06:36:10 2016 New Revision: 309233 URL: https://svnweb.freebsd.org/changeset/base/309233 Log: Eliminate variables that are computed, assigned but never used. MFC after: 2 weeks Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Mon Nov 28 06:32:05 2016 (r309232) +++ head/usr.bin/sort/bwstring.c Mon Nov 28 06:36:10 2016 (r309233) @@ -910,7 +910,6 @@ bws_month_score(const struct bwstring *s if (MB_CUR_MAX == 1) { const unsigned char *end, *s; - size_t len; s = s0->data.cstr; end = s + s0->len; @@ -918,8 +917,6 @@ bws_month_score(const struct bwstring *s while (isblank(*s) && s < end) ++s; - len = strlen((const char*)s); - for (int i = 11; i >= 0; --i) { if (cmonths[i] && (s == (unsigned char*)strstr((const char*)s, (char*)(cmonths[i])))) @@ -928,7 +925,6 @@ bws_month_score(const struct bwstring *s } else { const wchar_t *end, *s; - size_t len; s = s0->data.wstr; end = s + s0->len; @@ -936,8 +932,6 @@ bws_month_score(const struct bwstring *s while (iswblank(*s) && s < end) ++s; - len = wcslen(s); - for (int i = 11; i >= 0; --i) { if (wmonths[i] && (s == wcsstr(s, wmonths[i]))) return (i); Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon Nov 28 06:32:05 2016 (r309232) +++ head/usr.bin/sort/sort.c Mon Nov 28 06:36:10 2016 (r309233) @@ -209,14 +209,10 @@ sort_modifier_empty(struct sort_mods *sm static void usage(bool opt_err) { - struct option *o; FILE *out; - out = stdout; - o = &(long_options[0]); + out = opt_err ? stderr : stdout; - if (opt_err) - out = stderr; fprintf(out, getstr(12), getprogname()); if (opt_err) exit(2); From owner-svn-src-head@freebsd.org Mon Nov 28 06:38:43 2016 Return-Path: Delivered-To: svn-src-head@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 08CD3C581A6; Mon, 28 Nov 2016 06:38:43 +0000 (UTC) (envelope-from delphij@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 CCA201D41; Mon, 28 Nov 2016 06:38:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6cgY7018253; Mon, 28 Nov 2016 06:38:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6cgc8018252; Mon, 28 Nov 2016 06:38:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280638.uAS6cgc8018252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 06:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309234 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:38:43 -0000 Author: delphij Date: Mon Nov 28 06:38:41 2016 New Revision: 309234 URL: https://svnweb.freebsd.org/changeset/base/309234 Log: pages and psize are always assigned, so there is no need to initialize them as zero. MFC after: 2 weeks Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon Nov 28 06:36:10 2016 (r309233) +++ head/usr.bin/sort/sort.c Mon Nov 28 06:38:41 2016 (r309234) @@ -267,8 +267,6 @@ set_hw_params(void) { long pages, psize; - pages = psize = 0; - #if defined(SORT_THREADS) ncpu = 1; #endif From owner-svn-src-head@freebsd.org Mon Nov 28 06:40:27 2016 Return-Path: Delivered-To: svn-src-head@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 5DE98C5825C; Mon, 28 Nov 2016 06:40:27 +0000 (UTC) (envelope-from sephe@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 13C701EC4; Mon, 28 Nov 2016 06:40:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6eQHB018373; Mon, 28 Nov 2016 06:40:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6eQMD018372; Mon, 28 Nov 2016 06:40:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280640.uAS6eQMD018372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 06:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309235 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:40:27 -0000 Author: sephe Date: Mon Nov 28 06:40:26 2016 New Revision: 309235 URL: https://svnweb.freebsd.org/changeset/base/309235 Log: hyperv/hn: Simplify RSS indirect table fixup API MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8630 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 06:38:41 2016 (r309234) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 06:40:26 2016 (r309235) @@ -319,7 +319,7 @@ static void hn_destroy_rx_data(struct static int hn_check_iplen(const struct mbuf *, int); static int hn_set_rxfilter(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); -static void hn_rss_ind_fixup(struct hn_softc *, int); +static void hn_rss_ind_fixup(struct hn_softc *); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); @@ -817,11 +817,12 @@ hn_rss_reconfig(struct hn_softc *sc) } static void -hn_rss_ind_fixup(struct hn_softc *sc, int nchan) +hn_rss_ind_fixup(struct hn_softc *sc) { struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; - int i; + int i, nchan; + nchan = sc->hn_rx_ring_inuse; KASSERT(nchan > 1, ("invalid # of channels %d", nchan)); /* @@ -2943,7 +2944,7 @@ hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS) goto back; sc->hn_flags |= HN_FLAG_HAS_RSSIND; - hn_rss_ind_fixup(sc, sc->hn_rx_ring_inuse); + hn_rss_ind_fixup(sc); error = hn_rss_reconfig(sc); back: HN_UNLOCK(sc); @@ -4502,6 +4503,8 @@ hn_synth_attach(struct hn_softc *sc, int /* * Attach the sub-channels. + * + * NOTE: hn_set_ring_inuse() _must_ have been called. */ error = hn_attach_subchans(sc); if (error) @@ -4538,8 +4541,10 @@ hn_synth_attach(struct hn_softc *sc, int * # of usable channels may be changed, so we have to * make sure that all entries in RSS indirect table * are valid. + * + * NOTE: hn_set_ring_inuse() _must_ have been called. */ - hn_rss_ind_fixup(sc, nchan); + hn_rss_ind_fixup(sc); } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); From owner-svn-src-head@freebsd.org Mon Nov 28 06:53:01 2016 Return-Path: Delivered-To: svn-src-head@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 46099C58702; Mon, 28 Nov 2016 06:53:01 +0000 (UTC) (envelope-from sephe@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 1585A1973; Mon, 28 Nov 2016 06:53:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6r0AA025921; Mon, 28 Nov 2016 06:53:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6r0O8025920; Mon, 28 Nov 2016 06:53:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280653.uAS6r0O8025920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 06:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309236 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:53:01 -0000 Author: sephe Date: Mon Nov 28 06:53:00 2016 New Revision: 309236 URL: https://svnweb.freebsd.org/changeset/base/309236 Log: hyperv/vmbus: Make sure that the allocated GPADL is not zero. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8631 Modified: head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 06:40:26 2016 (r309235) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 06:53:00 2016 (r309236) @@ -325,7 +325,13 @@ vmbus_msghc_wakeup(struct vmbus_softc *s uint32_t vmbus_gpadl_alloc(struct vmbus_softc *sc) { - return atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + uint32_t gpadl; + +again: + gpadl = atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + if (gpadl == 0) + goto again; + return (gpadl); } static int From owner-svn-src-head@freebsd.org Mon Nov 28 07:04:33 2016 Return-Path: Delivered-To: svn-src-head@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 A73B2C58AB2; Mon, 28 Nov 2016 07:04:33 +0000 (UTC) (envelope-from sephe@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 76BD31E9B; Mon, 28 Nov 2016 07:04:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS74W8m030145; Mon, 28 Nov 2016 07:04:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS74WeJ030144; Mon, 28 Nov 2016 07:04:32 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280704.uAS74WeJ030144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309237 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:04:33 -0000 Author: sephe Date: Mon Nov 28 07:04:32 2016 New Revision: 309237 URL: https://svnweb.freebsd.org/changeset/base/309237 Log: hyperv/vmbus: Stringent GPADL parameter assertion. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8632 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 06:53:00 2016 (r309236) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 07:04:32 2016 (r309237) @@ -502,11 +502,7 @@ vmbus_chan_gpadl_connect(struct vmbus_ch int page_count, range_len, i, cnt, error; uint64_t page_id; - /* - * Reset GPADL, so that the result would consistent, if error - * happened later on. - */ - *gpadl0 = 0; + KASSERT(*gpadl0 == 0, ("GPADL is not zero")); /* * Preliminary checks. @@ -652,6 +648,8 @@ vmbus_chan_gpadl_disconnect(struct vmbus struct vmbus_chanmsg_gpadl_disconn *req; int error; + KASSERT(gpadl != 0, ("GPADL is zero")); + mh = vmbus_msghc_get(sc, sizeof(*req)); if (mh == NULL) { vmbus_chan_printf(chan, From owner-svn-src-head@freebsd.org Mon Nov 28 07:19:46 2016 Return-Path: Delivered-To: svn-src-head@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 D4243C58E21; Mon, 28 Nov 2016 07:19:46 +0000 (UTC) (envelope-from delphij@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 A3CFD163E; Mon, 28 Nov 2016 07:19:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7Jj2Y034338; Mon, 28 Nov 2016 07:19:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7JjiA034337; Mon, 28 Nov 2016 07:19:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280719.uAS7JjiA034337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309238 - head/bin/kenv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:19:46 -0000 Author: delphij Date: Mon Nov 28 07:19:45 2016 New Revision: 309238 URL: https://svnweb.freebsd.org/changeset/base/309238 Log: Plug a potential memory leak. MFC after: 2 weeks Modified: head/bin/kenv/kenv.c Modified: head/bin/kenv/kenv.c ============================================================================== --- head/bin/kenv/kenv.c Mon Nov 28 07:04:32 2016 (r309237) +++ head/bin/kenv/kenv.c Mon Nov 28 07:19:45 2016 (r309238) @@ -63,7 +63,6 @@ main(int argc, char **argv) char *env, *eq, *val; int ch, error; - error = 0; val = NULL; env = NULL; while ((ch = getopt(argc, argv, "hNquv")) != -1) { @@ -128,7 +127,7 @@ main(int argc, char **argv) static int kdumpenv(void) { - char *buf, *cp; + char *buf, *bp, *cp; int buflen, envlen; envlen = kenv(KENV_DUMP, NULL, NULL, 0); @@ -136,10 +135,9 @@ kdumpenv(void) return (-1); for (;;) { buflen = envlen * 120 / 100; - buf = malloc(buflen + 1); + buf = calloc(1, buflen + 1); if (buf == NULL) return (-1); - memset(buf, 0, buflen + 1); /* Be defensive */ envlen = kenv(KENV_DUMP, NULL, buf, buflen); if (envlen < 0) { free(buf); @@ -151,21 +149,23 @@ kdumpenv(void) break; } - for (; *buf != '\0'; buf += strlen(buf) + 1) { + for (bp = buf; *bp != '\0'; bp += strlen(bp) + 1) { if (hflag) { - if (strncmp(buf, "hint.", 5) != 0) + if (strncmp(bp, "hint.", 5) != 0) continue; } - cp = strchr(buf, '='); + cp = strchr(bp, '='); if (cp == NULL) continue; *cp++ = '\0'; if (Nflag) - printf("%s\n", buf); + printf("%s\n", bp); else - printf("%s=\"%s\"\n", buf, cp); - buf = cp; + printf("%s=\"%s\"\n", bp, cp); + bp = cp; } + + free(buf); return (0); } From owner-svn-src-head@freebsd.org Mon Nov 28 07:21:10 2016 Return-Path: Delivered-To: svn-src-head@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 CD184C58F6E; Mon, 28 Nov 2016 07:21:10 +0000 (UTC) (envelope-from delphij@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 9CFC11B1B; Mon, 28 Nov 2016 07:21:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7L9VN035286; Mon, 28 Nov 2016 07:21:09 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7L9Xt035285; Mon, 28 Nov 2016 07:21:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280721.uAS7L9Xt035285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309239 - head/bin/kenv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:21:10 -0000 Author: delphij Date: Mon Nov 28 07:21:09 2016 New Revision: 309239 URL: https://svnweb.freebsd.org/changeset/base/309239 Log: style(9). MFC after: 2 weeks Modified: head/bin/kenv/kenv.c Modified: head/bin/kenv/kenv.c ============================================================================== --- head/bin/kenv/kenv.c Mon Nov 28 07:19:45 2016 (r309238) +++ head/bin/kenv/kenv.c Mon Nov 28 07:21:09 2016 (r309239) @@ -190,7 +190,7 @@ ksetenv(const char *env, char *val) { int ret; - ret = kenv(KENV_SET, env, val, strlen(val)+1); + ret = kenv(KENV_SET, env, val, strlen(val) + 1); if (ret == 0) printf("%s=\"%s\"\n", env, val); return (ret); @@ -200,7 +200,7 @@ static int kunsetenv(const char *env) { int ret; - + ret = kenv(KENV_UNSET, env, NULL, 0); return (ret); } From owner-svn-src-head@freebsd.org Mon Nov 28 07:27:09 2016 Return-Path: Delivered-To: svn-src-head@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 B8956C593A1; Mon, 28 Nov 2016 07:27:09 +0000 (UTC) (envelope-from sephe@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 933661022; Mon, 28 Nov 2016 07:27:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7R8JT038254; Mon, 28 Nov 2016 07:27:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7R8Tq038253; Mon, 28 Nov 2016 07:27:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280727.uAS7R8Tq038253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309240 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:27:09 -0000 Author: sephe Date: Mon Nov 28 07:27:08 2016 New Revision: 309240 URL: https://svnweb.freebsd.org/changeset/base/309240 Log: hyperv/vmbus: Add result polling support for xact API. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8633 Modified: head/sys/dev/hyperv/include/vmbus_xact.h head/sys/dev/hyperv/vmbus/vmbus_xact.c Modified: head/sys/dev/hyperv/include/vmbus_xact.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus_xact.h Mon Nov 28 07:21:09 2016 (r309239) +++ head/sys/dev/hyperv/include/vmbus_xact.h Mon Nov 28 07:27:08 2016 (r309240) @@ -55,6 +55,8 @@ const void *vmbus_xact_wait(struct vmbu size_t *resp_len); const void *vmbus_xact_busywait(struct vmbus_xact *xact, size_t *resp_len); +const void *vmbus_xact_poll(struct vmbus_xact *xact, + size_t *resp_len); void vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen); void vmbus_xact_ctx_wakeup(struct vmbus_xact_ctx *ctx, Modified: head/sys/dev/hyperv/vmbus/vmbus_xact.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_xact.c Mon Nov 28 07:21:09 2016 (r309239) +++ head/sys/dev/hyperv/vmbus/vmbus_xact.c Mon Nov 28 07:27:08 2016 (r309240) @@ -71,8 +71,10 @@ static struct vmbus_xact *vmbus_xact_all static void vmbus_xact_free(struct vmbus_xact *); static struct vmbus_xact *vmbus_xact_get1(struct vmbus_xact_ctx *, uint32_t); -const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, +static const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, bool); +static const void *vmbus_xact_return(struct vmbus_xact *, + size_t *); static void vmbus_xact_save_resp(struct vmbus_xact *, const void *, size_t); static void vmbus_xact_ctx_free(struct vmbus_xact_ctx *); @@ -277,27 +279,13 @@ vmbus_xact_deactivate(struct vmbus_xact mtx_unlock(&ctx->xc_lock); } -const void * -vmbus_xact_wait1(struct vmbus_xact *xact, size_t *resp_len, - bool can_sleep) +static const void * +vmbus_xact_return(struct vmbus_xact *xact, size_t *resp_len) { struct vmbus_xact_ctx *ctx = xact->x_ctx; const void *resp; - mtx_lock(&ctx->xc_lock); - - KASSERT(ctx->xc_active == xact, ("xact mismatch")); - while (xact->x_resp == NULL && - (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { - if (can_sleep) { - mtx_sleep(&ctx->xc_active, &ctx->xc_lock, 0, - "wxact", 0); - } else { - mtx_unlock(&ctx->xc_lock); - DELAY(1000); - mtx_lock(&ctx->xc_lock); - } - } + mtx_assert(&ctx->xc_lock, MA_OWNED); KASSERT(ctx->xc_active == xact, ("xact trashed")); if ((ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) && xact->x_resp == NULL) { @@ -317,6 +305,32 @@ vmbus_xact_wait1(struct vmbus_xact *xact resp = xact->x_resp; *resp_len = xact->x_resp_len; + return (resp); +} + +static const void * +vmbus_xact_wait1(struct vmbus_xact *xact, size_t *resp_len, + bool can_sleep) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + const void *resp; + + mtx_lock(&ctx->xc_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + while (xact->x_resp == NULL && + (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { + if (can_sleep) { + mtx_sleep(&ctx->xc_active, &ctx->xc_lock, 0, + "wxact", 0); + } else { + mtx_unlock(&ctx->xc_lock); + DELAY(1000); + mtx_lock(&ctx->xc_lock); + } + } + resp = vmbus_xact_return(xact, resp_len); + mtx_unlock(&ctx->xc_lock); return (resp); @@ -336,6 +350,28 @@ vmbus_xact_busywait(struct vmbus_xact *x return (vmbus_xact_wait1(xact, resp_len, false /* can't sleep */)); } +const void * +vmbus_xact_poll(struct vmbus_xact *xact, size_t *resp_len) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + const void *resp; + + mtx_lock(&ctx->xc_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + if (xact->x_resp == NULL && + (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { + mtx_unlock(&ctx->xc_lock); + *resp_len = 0; + return (NULL); + } + resp = vmbus_xact_return(xact, resp_len); + + mtx_unlock(&ctx->xc_lock); + + return (resp); +} + static void vmbus_xact_save_resp(struct vmbus_xact *xact, const void *data, size_t dlen) { From owner-svn-src-head@freebsd.org Mon Nov 28 07:33:28 2016 Return-Path: Delivered-To: svn-src-head@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 0C872C59556; Mon, 28 Nov 2016 07:33:28 +0000 (UTC) (envelope-from delphij@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 C2F3D14DA; Mon, 28 Nov 2016 07:33:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7XQLi042292; Mon, 28 Nov 2016 07:33:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7XQsM042291; Mon, 28 Nov 2016 07:33:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280733.uAS7XQsM042291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309241 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:33:28 -0000 Author: delphij Date: Mon Nov 28 07:33:26 2016 New Revision: 309241 URL: https://svnweb.freebsd.org/changeset/base/309241 Log: Don't leak 'str' when we see a malformed IPv6 address. MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Mon Nov 28 07:27:08 2016 (r309240) +++ head/usr.sbin/ctld/ctld.c Mon Nov 28 07:33:26 2016 (r309241) @@ -675,8 +675,10 @@ parse_addr_port(char *arg, const char *d */ arg++; addr = strsep(&arg, "]"); - if (arg == NULL) + if (arg == NULL) { + free(str); return (1); + } if (arg[0] == '\0') { port = def_port; } else if (arg[0] == ':') { From owner-svn-src-head@freebsd.org Mon Nov 28 07:36:52 2016 Return-Path: Delivered-To: svn-src-head@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 5628FC595F9; Mon, 28 Nov 2016 07:36:52 +0000 (UTC) (envelope-from sephe@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 25BBF168C; Mon, 28 Nov 2016 07:36:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7ap3i042456; Mon, 28 Nov 2016 07:36:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7ap45042454; Mon, 28 Nov 2016 07:36:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280736.uAS7ap45042454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309242 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:36:52 -0000 Author: sephe Date: Mon Nov 28 07:36:51 2016 New Revision: 309242 URL: https://svnweb.freebsd.org/changeset/base/309242 Log: hyperv/vmbus: Add result polling support for message Hypercall API. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8634 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:33:26 2016 (r309241) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:36:51 2016 (r309242) @@ -315,6 +315,14 @@ vmbus_msghc_wait_result(struct vmbus_sof return (vmbus_xact_wait(mh->mh_xact, &resp_len)); } +const struct vmbus_message * +vmbus_msghc_poll_result(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) +{ + size_t resp_len; + + return (vmbus_xact_poll(mh->mh_xact, &resp_len)); +} + void vmbus_msghc_wakeup(struct vmbus_softc *sc, const struct vmbus_message *msg) { Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:33:26 2016 (r309241) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:36:51 2016 (r309242) @@ -160,6 +160,9 @@ int vmbus_msghc_exec(struct vmbus_softc const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *, struct vmbus_msghc *); +const struct vmbus_message * + vmbus_msghc_poll_result(struct vmbus_softc *, + struct vmbus_msghc *); void vmbus_msghc_wakeup(struct vmbus_softc *, const struct vmbus_message *); void vmbus_msghc_reset(struct vmbus_msghc *, size_t); From owner-svn-src-head@freebsd.org Mon Nov 28 07:41:02 2016 Return-Path: Delivered-To: svn-src-head@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 D483DC59908; Mon, 28 Nov 2016 07:41:02 +0000 (UTC) (envelope-from delphij@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 A43A019B3; Mon, 28 Nov 2016 07:41:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7f1ec043296; Mon, 28 Nov 2016 07:41:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7f1UH043295; Mon, 28 Nov 2016 07:41:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280741.uAS7f1UH043295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309243 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:41:02 -0000 Author: delphij Date: Mon Nov 28 07:41:01 2016 New Revision: 309243 URL: https://svnweb.freebsd.org/changeset/base/309243 Log: Plug another leak with malformed IPv6 address. MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Mon Nov 28 07:36:51 2016 (r309242) +++ head/usr.sbin/ctld/ctld.c Mon Nov 28 07:41:01 2016 (r309243) @@ -401,6 +401,7 @@ auth_portal_new(struct auth_group *ag, c return (ap); error: + free(str); free(ap); log_warnx("incorrect initiator portal \"%s\"", portal); return (NULL); From owner-svn-src-head@freebsd.org Mon Nov 28 07:44:52 2016 Return-Path: Delivered-To: svn-src-head@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 18651C59B21; Mon, 28 Nov 2016 07:44:52 +0000 (UTC) (envelope-from sephe@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 DBFE71D83; Mon, 28 Nov 2016 07:44:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7ipxd046272; Mon, 28 Nov 2016 07:44:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7ioxu046270; Mon, 28 Nov 2016 07:44:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280744.uAS7ioxu046270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309244 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:44:52 -0000 Author: sephe Date: Mon Nov 28 07:44:50 2016 New Revision: 309244 URL: https://svnweb.freebsd.org/changeset/base/309244 Log: hyperv/vmbus: Add exec cancel support for message Hypercall API. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8635 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:41:01 2016 (r309243) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:44:50 2016 (r309244) @@ -307,6 +307,13 @@ vmbus_msghc_exec(struct vmbus_softc *sc return error; } +void +vmbus_msghc_exec_cancel(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) +{ + + vmbus_xact_deactivate(mh->mh_xact); +} + const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) { Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:41:01 2016 (r309243) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:44:50 2016 (r309244) @@ -157,6 +157,8 @@ void vmbus_msghc_put(struct vmbus_softc void *vmbus_msghc_dataptr(struct vmbus_msghc *); int vmbus_msghc_exec_noresult(struct vmbus_msghc *); int vmbus_msghc_exec(struct vmbus_softc *, struct vmbus_msghc *); +void vmbus_msghc_exec_cancel(struct vmbus_softc *, + struct vmbus_msghc *); const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *, struct vmbus_msghc *); From owner-svn-src-head@freebsd.org Mon Nov 28 07:56:04 2016 Return-Path: Delivered-To: svn-src-head@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 9E5F7C59DC5; Mon, 28 Nov 2016 07:56:04 +0000 (UTC) (envelope-from sephe@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 5579312B5; Mon, 28 Nov 2016 07:56:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7u3Le050380; Mon, 28 Nov 2016 07:56:03 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7u3Xp050379; Mon, 28 Nov 2016 07:56:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280756.uAS7u3Xp050379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309245 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:56:04 -0000 Author: sephe Date: Mon Nov 28 07:56:03 2016 New Revision: 309245 URL: https://svnweb.freebsd.org/changeset/base/309245 Log: hyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response. Since hypervisor does not respond CHOPEN to a revoked channel. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8636 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 07:44:50 2016 (r309244) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 07:56:03 2016 (r309245) @@ -349,7 +349,6 @@ vmbus_chan_open_br(struct vmbus_channel const void *udata, int udlen, vmbus_chan_callback_t cb, void *cbarg) { struct vmbus_softc *sc = chan->ch_vmbus; - const struct vmbus_chanmsg_chopen_resp *resp; const struct vmbus_message *msg; struct vmbus_chanmsg_chopen *req; struct vmbus_msghc *mh; @@ -453,9 +452,50 @@ vmbus_chan_open_br(struct vmbus_channel goto failed; } - msg = vmbus_msghc_wait_result(sc, mh); - resp = (const struct vmbus_chanmsg_chopen_resp *)msg->msg_data; - status = resp->chm_status; + for (;;) { + msg = vmbus_msghc_poll_result(sc, mh); + if (msg != NULL) + break; + if (vmbus_chan_is_revoked(chan)) { + int i; + + /* + * NOTE: + * Hypervisor does _not_ send response CHOPEN to + * a revoked channel. + */ + vmbus_chan_printf(chan, + "chan%u is revoked, when it is being opened\n", + chan->ch_id); + + /* + * XXX + * Add extra delay before cancel the hypercall + * execution; mainly to close any possible + * CHRESCIND and CHOPEN_RESP races on the + * hypervisor side. + */ +#define REVOKE_LINGER 100 + for (i = 0; i < REVOKE_LINGER; ++i) { + msg = vmbus_msghc_poll_result(sc, mh); + if (msg != NULL) + break; + DELAY(1000); + } +#undef REVOKE_LINGER + if (msg == NULL) + vmbus_msghc_exec_cancel(sc, mh); + break; + } + DELAY(1000); + } + if (msg != NULL) { + status = ((const struct vmbus_chanmsg_chopen_resp *) + msg->msg_data)->chm_status; + } else { + /* XXX any non-0 value is ok here. */ + status = 0xff; + } vmbus_msghc_put(sc, mh); From owner-svn-src-head@freebsd.org Mon Nov 28 08:13:22 2016 Return-Path: Delivered-To: svn-src-head@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 0F78FC57367; Mon, 28 Nov 2016 08:13:22 +0000 (UTC) (envelope-from adrian@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 BAA441AF7; Mon, 28 Nov 2016 08:13:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS8DK4C058303; Mon, 28 Nov 2016 08:13:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS8DKJW058302; Mon, 28 Nov 2016 08:13:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611280813.uAS8DKJW058302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 08:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309246 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 08:13:22 -0000 Author: adrian Date: Mon Nov 28 08:13:20 2016 New Revision: 309246 URL: https://svnweb.freebsd.org/changeset/base/309246 Log: [ath] wake up the hardware from power-save before doing transmit completion checking. This was being done in the pre-AR9380 case, but not for AR9380 and later. When powersave in STA mode is enabled, this may have lead to the transmit completion code doing this: * call the task, which doesn't wake up the hardware * complete the frames, which doesn't touch the hardware * schedule pending frames on the hardware queue, which DOES touch the hardware, and this will be ignored This would show up in the logs like this: (with debugging enabled): Nov 27 23:03:56 lovelace kernel: Q1[ 0] (nseg=1) (DS.V:0xfffffe011bd57300 DS.P:0x49b57300) I: 168cc117 L:00000000 F:0005 ... (in general, doesn't require debugging enabled): Nov 27 23:03:56 lovelace kernel: ath_hal_reg_write: reg=0x00000804, val=0x49b57300, pm=2 That register is a EDMA TX FIFO register (queue 1), and the val is the descriptor being written. Whilst here, make sure the software queue gets kicked here. Tested; * AR9485, STA mode + powersave Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon Nov 28 07:56:03 2016 (r309245) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Nov 28 08:13:20 2016 (r309246) @@ -755,11 +755,30 @@ ath_edma_tx_proc(void *arg, int npending { struct ath_softc *sc = (struct ath_softc *) arg; + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt++; + ATH_PCU_UNLOCK(sc); + + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + #if 0 DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); #endif ath_edma_tx_processq(sc, 1); + + + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt--; + ATH_PCU_UNLOCK(sc); + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + ath_tx_kick(sc); } /* From owner-svn-src-head@freebsd.org Mon Nov 28 14:24:08 2016 Return-Path: Delivered-To: svn-src-head@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 A02BCC59B70; Mon, 28 Nov 2016 14:24:08 +0000 (UTC) (envelope-from andrew@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 6FC521165; Mon, 28 Nov 2016 14:24:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASEO7Ql008858; Mon, 28 Nov 2016 14:24:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASEO7WX008857; Mon, 28 Nov 2016 14:24:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611281424.uASEO7WX008857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 28 Nov 2016 14:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309248 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 14:24:08 -0000 Author: andrew Date: Mon Nov 28 14:24:07 2016 New Revision: 309248 URL: https://svnweb.freebsd.org/changeset/base/309248 Log: Fix ISS_DATA_DFSC_MASK, it should include all bits in the field. Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Mon Nov 28 11:14:38 2016 (r309247) +++ head/sys/arm64/include/armreg.h Mon Nov 28 14:24:07 2016 (r309248) @@ -89,7 +89,7 @@ #define ISS_DATa_CM (0x01 << 8) #define ISS_INSN_S1PTW (0x01 << 7) #define ISS_DATa_WnR (0x01 << 6) -#define ISS_DATA_DFSC_MASK (0x1f << 0) +#define ISS_DATA_DFSC_MASK (0x3f << 0) #define ISS_DATA_DFSC_ASF_L0 (0x00 << 0) #define ISS_DATA_DFSC_ASF_L1 (0x01 << 0) #define ISS_DATA_DFSC_ASF_L2 (0x02 << 0) From owner-svn-src-head@freebsd.org Mon Nov 28 14:55:22 2016 Return-Path: Delivered-To: svn-src-head@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 DB70AC5953F; Mon, 28 Nov 2016 14:55:22 +0000 (UTC) (envelope-from kevans91@ksu.edu) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0070.outbound.protection.outlook.com [104.47.36.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3881111A2; Mon, 28 Nov 2016 14:55:21 +0000 (UTC) (envelope-from kevans91@ksu.edu) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ksu.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8G2IFPcwlCVMBufp6mEhNDUSJeb+E7sZPdGs8qwslX4=; b=bfkRaTnHM9SnC/Pgaapv+0a1aoKCbulriQ1HU5Z5Ms+8k9rGtsWRfiROmDBq5ic3+Ps/kjOCdfOB3aQ9pFd3o7mp3+C5WLmdUn2Bj6/t822wUWuFTH94u8Wb9jZR+sbIURmAx9YUclpsKXitZ6P+cpOHQbcCjjx4EdjIG5LDUeY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kevans91@ksu.edu; Received: from mail-yw0-f181.google.com (209.85.161.181) by BY1PR0501MB1320.namprd05.prod.outlook.com (10.160.200.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.5; Mon, 28 Nov 2016 02:21:23 +0000 Received: by mail-yw0-f181.google.com with SMTP id a10so104161503ywa.3; Sun, 27 Nov 2016 18:21:22 -0800 (PST) X-Gm-Message-State: AKaTC02gWYP2xonrWOyxMRbKrR2tPSJ4JqTgSbeDoV+scTpAG2IbFiPYi785CTnM+OzSCHg6YVfI5vgHSD830w== X-Received: by 10.13.247.65 with SMTP id h62mr24022248ywf.56.1480299677799; Sun, 27 Nov 2016 18:21:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.22.196 with HTTP; Sun, 27 Nov 2016 18:20:57 -0800 (PST) In-Reply-To: <201611242254.uAOMswkb081748@repo.freebsd.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> From: Kyle Evans Date: Sun, 27 Nov 2016 20:20:57 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: Dimitry Andric , Glen Barber CC: , , Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.161.181] X-ClientProxiedBy: BN6PR2001CA0017.namprd20.prod.outlook.com (10.172.112.155) To BY1PR0501MB1320.namprd05.prod.outlook.com (10.160.200.16) X-MS-Office365-Filtering-Correlation-Id: 6e8a6196-b614-4b5d-4a52-08d417353f92 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0501MB1320; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 3:K0XpTxGP4jqnuJfLrakSsy0zKHwzFRUQpzaJNvG781rlW9m0R1rvs+pPynB6K37B06V6Fmr/fHbPS/gqcX3Vb1fs1CoFj8Kuiv5AzxDtFsXUqIGvsvcy4fT87F5ketcwjwMtHwOUVNBnWm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Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 31:RZ31ellp8d++xnQoeVAZqUOaDrP3++D2vrS9bnH+BK2rXFqigCaZKbUg5cH7dJXGpUFk3zcnCma/tgZD5ARgDpfmCHkoASwdySXveA6DUloOi+aAe0TZmZWFfq9pwFOHd/AVSyICJfs326sIk6ahzUJlEBe9Jd9RQmg1ZRuchgLNOF//UfNr+gR75KvNyoUAFd3UpMzC2SSkeBbXrqT74jt5spkVAX/fxk4d81sTJt6i+5SmUolbf13NXRMIT7VmlXCVVvA1m9z37IZXa98msg==; 20:JJTL+CV1hBt+M51qa78e4tIzuKKInLedZY/ifDpf4NqmbCpZ5W0nhY+fau/dJTfS5V0p2H6KzzG2uJbwbYbjvoyJE91MIUaHxqww5C9skWPL/Mt5adcpdvIHVvfmwkwWOkwMO75QCiHfi5zc6RDCNFzbURmcS8Qjwz0OZp+UApgb44J5j3mG6Cc/XVQEtWZDnQmknpwQhiX1rCoQkFjNOqelFU3rwNKx11+RYbDXy/R+XJa514JRb8nVv4lUM0QV0KbVEoxw3bTLG5L9ZVjhVD5v7BGdPf9XkCJa58AnhOna4m66kUFrpSoUWIGB3Ws6O6OgmlDgEbYUtJ89Wo5nJeUgKK8sp85IfcTAAq+pGUvFvQmuOH19v2H56fvepxx8H8ZTmVKeETJLpXS87YDQRmwaN8LURMAHht0XyIzaPlrn4nsTsKl735Oa4gJxuzAXIh/Kp7sRK5JSBApm9gaOeVWRgV7GNzvW4JT3Xkaj3Wg7OP0kdxahC18MlFE27OUr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849)(262104967686372); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(6040361)(6045199)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(6061324)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148); SRVR:BY1PR0501MB1320; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0501MB1320; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 4:ThU38gaHtna8ZrhapNK3+0j8etfGfRFIwWuIcX5WaEij/OCs9ucWWafAUx9sHR412GnDZ2Mt9nuJ80zEdG6G9D9p6bxF5bo+RlGz6kHb7yTLURX3GdsDyQ63KXwgMfqt40ii8tBOZZBGZa26gi4/yjs9M5zDrbVGYgEIJ4te2tdrksmMY3jZrz4zv1LJVu7nFfFoEqHTX7Rh5ROI0VLVKHhk02DvY+rtqQZZGgoD3wVxPrcAQCwFbG4SrGsD315lmdon9fa8y5+QIWEoQKEbMCuc5hCegG4n9TLUBBn20pwwt/RN4C8ha1QJRsrh5FsC8WEus9WkegVS3LicRxvmaWbbrGaMNR763j90QrbPovA8/lC+mbeo3ZU4oIvw3AalwUSOcNocmWIUp5oq2UdzvlPQRsDdYJVs7MTvgIEYbU439+YiOaoPLvwcq7kTQ4XiaaH4Yp5v6pTSQM3d66rIpOxaPjWHp46hcca9RJ+v4kAOeic3hOQl1gI+grSAD0bOo9cKtKZfYe9J43vWxnCUVOaGaw48gp8SlG2nefXKtORSPBZUiHUPGoAmswOs1wmHHVUYSGvzURQqGC18aU402ZBkfjyjoA3kRSXqpb0p33ubI32kZsxZBWcDGT/84GmPsToqAHnICNkjxoPA4TvhTXG3xy4Dco0w6++VotaxVE0T3FAdBPA/H/2eQh4QppFI3ek7l6MzgF23lms9kZ8GCw== X-Forefront-PRVS: 01401330D1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(24454002)(199003)(377454003)(189002)(23676002)(122856001)(305945005)(15395725005)(7846002)(89122001)(5820100001)(2950100002)(7736002)(229853002)(5660300001)(189998001)(88552002)(69596002)(55446002)(2906002)(90282001)(4326007)(5001770100001)(39450400002)(101416001)(106356001)(97736004)(39380400001)(39400400001)(6116002)(68736007)(38730400001)(8676002)(9896002)(50466002)(3846002)(450100001)(86362001)(61726006)(92566002)(66066001)(98316002)(75432002)(81166006)(81156014)(9686002)(42186005)(61266001)(63696999)(76176999)(50986999)(54356999)(105586002)(59536001)(93516999)(47776003)(55456009); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0501MB1320; H:mail-yw0-f181.google.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: ksu.edu does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjA1MDFNQjEzMjA7MjM6QkFIYUtTakJtNFE1bStsbDQ3Y1RSNFVQ?= =?utf-8?B?YXFEOWI3cTV5dHpzTjV4T2tzanFkdDFCK09mQmZ3MzBuUmp0SVZyWlg0aUw3?= =?utf-8?B?ZGpSYXRITTQyNHRQbXNjSnNhOVZYVU4rODQ1b0JDMzM4ZWtVYy92dnJYcG9h?= =?utf-8?B?YzVXOUpLdG1NSEowak9iUjVPeEQ4UHhjU1Z6S2lmS05xTkJzcWp4R3N0c0h2?= =?utf-8?B?TzRvY1RxUnRZUzViVVVqUWt4eFFZbzRZZVlDUWhpQ1VnVjN0eWVKdXBKbWFz?= =?utf-8?B?cmVxaUJKZUxVT01RY1ZjdXdaTXUyT2x3R21HdHJlSjYxY2VhaUFjTVlWclh2?= =?utf-8?B?Rlc0dHdGcTg0NmpWbkhveit6czVVR1JhNnBJbkowaW5Xc1JyRHdVcnpuTmor?= =?utf-8?B?VW56Q2VnRDdIb1dIMmpCWEpDc0NkZ2NDM09mZFVtbVYyK0FsSXJQSmFvRW5C?= =?utf-8?B?TE1WZS9QWkNsd1kvVllEL1hCZEZwRlhtVGxxTjdpZ3R0UFdNdXc0YjJ0SlFN?= =?utf-8?B?TGd4cmYwVVFFNUpiTGdxME1uSXVrT3pOQzRCVmhpelJwSTFMUmY1TlA5eGpF?= =?utf-8?B?OUx2aWZ4ZWpFM1Z2WlUwR0RYSGZmN1crNjUzQ2lLRWZBV0kraThvWGlXNGU0?= =?utf-8?B?cTNMb3k5RTB3L0FMRmdocU9OSkdjNmpBSC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ZH333g+CqoQuNJ7U0HxJkQCVZQ1nIQjIFkI1cZ7/Qx707ReY/jTKwzGAW5e0XjsvnhUElWjlETQ8zZ0dQxIF4Hlnij7tVIH/0wpPJuE4Y=; 24:wMcIF4SYQ6wT6/W98O+3I/cfZnkXfdbYeQIyDkdVBbMFj9C02kexDFjpi6Atsjw77mBg34udYvHASUqW49icjJ4wfD8tjcEUl9Y+PA7ZLPs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 7:Nu1cfh0Gwv26317iXg/8MsKK8N1GzSnCZbpJpioMk4ccA4L7FoRIU+xYa8uUzSzdXn8Lr47eZPgG/iqxXcZNoQ2wl1NGKo42zbD4N2Ad2t62v1BuGl1OAC4MHGP4nSv74kFaSF6ZWjuWgC5d5Fx2z5eGO4Ve4st8sVk7XksbOHPxJxsn8wkhLUAi0Qcq98mRXG23gdCbipQewQWRXVz+3mdCmQsa9dV2+05tCmKs7XOOdb1hCnhhejGDrhqnLWWSe8YSDMsQ/1x7FFpflMnoyear+k8ilfUo4UvBIA9cecpk6UJMQCM32xikGBVR7gtjn55Bxk1sVXv49EQcUu0lIDh/lUHiN1T42mknEJlCiiZaPoMruv/4GRNgvWxJICad3MyXquaN/KXb/KxfAK8a+45gHXmz7uOGmKaKrjEM3mj66X9JSP5L5KBgTngsOBewwStFCDdvcm9Rb8ccwa7ILw==; 20:3TDb4CJEtyu+PjBwmU+sRevxec4y54irYCpWuCxyuqaEtQO3FEFmwe+Ffafu150DLbfCjEybfEHhACWW9931Ha1bNaZgatDec1uKACSqbMUvcrLCkH60DWhwn3J5a8jBk3jD+/zFQWr0NAFWhUZCMbyVobL+OuhVeIahoi6NHg8= X-OriginatorOrg: ksu.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2016 02:21:23.3309 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0501MB1320 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 14:55:23 -0000 Hi, On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: > Author: dim > Date: Thu Nov 24 22:54:55 2016 > New Revision: 309124 > URL: https://svnweb.freebsd.org/changeset/base/309124 > > Log: > Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 > release, and add lld 3.9.0. Also completely revamp the build system for > clang, llvm, lldb and their related tools. > > Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 > support to build; see UPDATING for more information. > > Release notes for llvm, clang and lld are available here: > > > > > Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan > Beich for their help. > > Relnotes: yes > MFC after: 1 month First off, thanks for this! =) Unfortunately, this commit seems to have done away with the -clang pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= elsewhere as FreeBSD-clang has disappeared from my newly built repository. =( [1] https://svnweb.freebsd.org/base/head/usr.bin/clang/clang.prog.mk?limit_changes=0&r1=298107&r2=309124&pathrev=309124 From owner-svn-src-head@freebsd.org Mon Nov 28 15:14:32 2016 Return-Path: Delivered-To: svn-src-head@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 9E18DC59BA7; Mon, 28 Nov 2016 15:14:32 +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 78E141CD6; Mon, 28 Nov 2016 15:14:32 +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 uASFEVYJ028828; Mon, 28 Nov 2016 15:14:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASFEVkH028825; Mon, 28 Nov 2016 15:14:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611281514.uASFEVkH028825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 28 Nov 2016 15:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309250 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 15:14:32 -0000 Author: avg Date: Mon Nov 28 15:14:31 2016 New Revision: 309250 URL: https://svnweb.freebsd.org/changeset/base/309250 Log: MFV r309249: 3821 Race in rollback, zil close, and zil flush Note: there was a merge conflict resolved by me. illumos/illumos-gate@43297f973a3543e7403ac27076490ab958a94b15 https://github.com/illumos/illumos-gate/commit/43297f973a3543e7403ac27076490ab958a94b15 https://www.illumos.org/issues/3821 We recently had nodes with some of the latest zfs bits panic on us in a rollback-heavy environment. The following is from my preliminary analysis: Let's look at where we died: > $C ffffff01ea6b9a10 taskq_dispatch+0x3a(0, fffffffff7d20450, ffffff5551dea920, 1) ffffff01ea6b9a60 zil_clean+0xce(ffffff4b7106c080, 7e0f1) ffffff01ea6b9aa0 dsl_pool_sync_done+0x47(ffffff4313065680, 7e0f1) ffffff01ea6b9b70 spa_sync+0x55f(ffffff4310c1d040, 7e0f1) ffffff01ea6b9c20 txg_sync_thread+0x20f(ffffff4313065680) ffffff01ea6b9c30 thread_start+8() If we dig in we can find that this dataset corresponds to a zone: > ffffff4b7106c080::print zilog_t zl_os->os_dsl_dataset->ds_dir->dd_myname zl_os->os_dsl_dataset->ds_dir->dd_myname = [ "8ffce16a-13c2-4efa-a233- 9e378e89877b" ] Okay so we have a null taskq pointer. That only happens during the calls to zil_open and zil_close. If we poke around we can see that we're actually in midst of a rollback: > ::pgrep zfs | ::printf "0x%x %s\\n" proc_t . p_user.u_psargs 0xffffff43262800a0 zfs rollback zones/15714eb6-f5ea-469f-ac6d- 4b8ab06213c2@marlin_init 0xffffff54e22a1028 zfs rollback zones/8ffce16a-13c2-4efa-a233- 9e378e89877b@marlin_init 0xffffff4362f3a058 zfs rollback zones/0ddb8e49-ca7e-42e1-8fdc- 4ac4ba8fe9f8@marlin_init 0xffffff5748e8d020 zfs rollback zones/426357b5-832d-4430-953e- 10cd45ff8e9f@marlin_init 0xffffff436b867008 zfs rollback zones/8f36bf37-8a9c-4a44-995c- 6d1b2751e6f5@marlin_init 0xffffff4381ad4090 zfs rollback zones/6c8eca18-fbd6-46dd-ac24- 2ed45cd0da70@marlin_init Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Pavel Zakharov Reviewed by: Andriy Gapon Approved by: Richard Lowe Author: George Wilson MFC after: 3 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Nov 28 15:09:58 2016 (r309249) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Nov 28 15:14:31 2016 (r309250) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -681,9 +681,16 @@ dsl_pool_sync_done(dsl_pool_t *dp, uint6 { zilog_t *zilog; - while (zilog = txg_list_remove(&dp->dp_dirty_zilogs, txg)) { + while (zilog = txg_list_head(&dp->dp_dirty_zilogs, txg)) { dsl_dataset_t *ds = dmu_objset_ds(zilog->zl_os); + /* + * We don't remove the zilog from the dp_dirty_zilogs + * list until after we've cleaned it. This ensures that + * callers of zilog_is_dirty() receive an accurate + * answer when they are racing with the spa sync thread. + */ zil_clean(zilog, txg); + (void) txg_list_remove_this(&dp->dp_dirty_zilogs, zilog, txg); ASSERT(!dmu_objset_is_dirty(zilog->zl_os, txg)); dmu_buf_rele(ds->ds_dbuf, zilog); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Nov 28 15:09:58 2016 (r309249) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Nov 28 15:14:31 2016 (r309250) @@ -7086,8 +7086,6 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_config_syncing = NULL; } - spa->spa_ubsync = spa->spa_uberblock; - dsl_pool_sync_done(dp, txg); mutex_enter(&spa->spa_alloc_lock); @@ -7112,6 +7110,13 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_sync_pass = 0; + /* + * Update the last synced uberblock here. We want to do this at + * the end of spa_sync() so that consumers of spa_last_synced_txg() + * will be guaranteed that all the processing associated with + * that txg has been completed. + */ + spa->spa_ubsync = spa->spa_uberblock; spa_config_exit(spa, SCL_CONFIG, FTAG); spa_handle_ignored_writes(spa); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Nov 28 15:09:58 2016 (r309249) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Nov 28 15:14:31 2016 (r309250) @@ -20,8 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -502,6 +501,27 @@ zilog_dirty(zilog_t *zilog, uint64_t txg } } +/* + * Determine if the zil is dirty in the specified txg. Callers wanting to + * ensure that the dirty state does not change must hold the itxg_lock for + * the specified txg. Holding the lock will ensure that the zil cannot be + * dirtied (zil_itx_assign) or cleaned (zil_clean) while we check its current + * state. + */ +boolean_t +zilog_is_dirty_in_txg(zilog_t *zilog, uint64_t txg) +{ + dsl_pool_t *dp = zilog->zl_dmu_pool; + + if (txg_list_member(&dp->dp_dirty_zilogs, zilog, txg & TXG_MASK)) + return (B_TRUE); + return (B_FALSE); +} + +/* + * Determine if the zil is dirty. The zil is considered dirty if it has + * any pending itx records that have not been cleaned by zil_clean(). + */ boolean_t zilog_is_dirty(zilog_t *zilog) { @@ -1062,8 +1082,6 @@ zil_lwb_commit(zilog_t *zilog, itx_t *it return (NULL); ASSERT(lwb->lwb_buf != NULL); - ASSERT(zilog_is_dirty(zilog) || - spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); if (lrc->lrc_txtype == TX_WRITE && itx->itx_wr_state == WR_NEED_COPY) dlen = P2ROUNDUP_TYPED( @@ -1401,6 +1419,11 @@ zil_get_commit_list(zilog_t *zilog) else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. That's okay since we'll + * only commit things in the future. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1410,6 +1433,16 @@ zil_get_commit_list(zilog_t *zilog) continue; } + /* + * If we're adding itx records to the zl_itx_commit_list, + * then the zil better be dirty in this "txg". We can assert + * that here since we're holding the itxg_lock which will + * prevent spa_sync from cleaning it. Once we add the itxs + * to the zl_itx_commit_list we must commit it to disk even + * if it's unnecessary (i.e. the txg was synced). + */ + ASSERT(zilog_is_dirty_in_txg(zilog, txg) || + spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); list_move_tail(commit_list, &itxg->itxg_itxs->i_sync_list); mutex_exit(&itxg->itxg_lock); @@ -1432,6 +1465,10 @@ zil_async_to_sync(zilog_t *zilog, uint64 else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1503,8 +1540,14 @@ zil_commit_writer(zilog_t *zilog) DTRACE_PROBE1(zil__cw1, zilog_t *, zilog); while (itx = list_head(&zilog->zl_itx_commit_list)) { txg = itx->itx_lr.lrc_txg; - ASSERT(txg); + ASSERT3U(txg, !=, 0); + /* + * This is inherently racy and may result in us writing + * out a log block for a txg that was just synced. This is + * ok since we'll end cleaning up that log block the next + * time we call zil_sync(). + */ if (txg > spa_last_synced_txg(spa) || txg > spa_freeze_txg(spa)) lwb = zil_lwb_commit(zilog, itx, lwb); list_remove(&zilog->zl_itx_commit_list, itx); @@ -1821,7 +1864,10 @@ zil_close(zilog_t *zilog) mutex_exit(&zilog->zl_lock); if (txg) txg_wait_synced(zilog->zl_dmu_pool, txg); - ASSERT(!zilog_is_dirty(zilog)); + + if (zilog_is_dirty(zilog)) + zfs_dbgmsg("zil (%p) is dirty, txg %llu", zilog, txg); + VERIFY(!zilog_is_dirty(zilog)); taskq_destroy(zilog->zl_clean_taskq); zilog->zl_clean_taskq = NULL; From owner-svn-src-head@freebsd.org Mon Nov 28 16:23:33 2016 Return-Path: Delivered-To: svn-src-head@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 5BEB0C5AC2D; Mon, 28 Nov 2016 16:23: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 20E211F25; Mon, 28 Nov 2016 16:23: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 uASGNWbE056996; Mon, 28 Nov 2016 16:23:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASGNWoA056995; Mon, 28 Nov 2016 16:23:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611281623.uASGNWoA056995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 28 Nov 2016 16:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309251 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 16:23:33 -0000 Author: mav Date: Mon Nov 28 16:23:32 2016 New Revision: 309251 URL: https://svnweb.freebsd.org/changeset/base/309251 Log: Process port interrupt even is PxIS register is zero. ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside seems sometimes forgeting to set bits in PxIS, causing command timeouts. Removal of this check fixes the issue by the theoretical cost of slightly higher CPU usage in some odd cases, but this is what Linux does too. MFC after: 1 month Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Nov 28 15:14:31 2016 (r309250) +++ head/sys/dev/ahci/ahci.c Mon Nov 28 16:23:32 2016 (r309251) @@ -1169,8 +1169,6 @@ ahci_ch_intr(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ahci_ch_intr_main(ch, istatus); @@ -1187,8 +1185,6 @@ ahci_ch_intr_direct(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ch->batch = 1; From owner-svn-src-head@freebsd.org Mon Nov 28 16:25:06 2016 Return-Path: Delivered-To: svn-src-head@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 EE030C5AC90; Mon, 28 Nov 2016 16:25:06 +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 BDC7C10B2; Mon, 28 Nov 2016 16:25:06 +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 uASGP5Kn057117; Mon, 28 Nov 2016 16:25:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASGP5Ys057116; Mon, 28 Nov 2016 16:25:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611281625.uASGP5Ys057116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 28 Nov 2016 16:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309252 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 16:25:07 -0000 Author: mav Date: Mon Nov 28 16:25:05 2016 New Revision: 309252 URL: https://svnweb.freebsd.org/changeset/base/309252 Log: Add more ASMedia PCI IDs from different sources. Exact device names are not clear, but its better then nothing at all. MFC after: 1 month Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Mon Nov 28 16:23:32 2016 (r309251) +++ head/sys/dev/ahci/ahci_pci.c Mon Nov 28 16:25:05 2016 (r309252) @@ -73,8 +73,15 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06111b21, 0x00, "ASMedia ASM2106", 0}, - {0x06121b21, 0x00, "ASMedia ASM1061", 0}, + {0x06011b21, 0x00, "ASMedia ASM1060", 0}, + {0x06021b21, 0x00, "ASMedia ASM1060", 0}, + {0x06111b21, 0x00, "ASMedia ASM1061", 0}, + {0x06121b21, 0x00, "ASMedia ASM1062", 0}, + {0x06201b21, 0x00, "ASMedia ASM106x", 0}, + {0x06211b21, 0x00, "ASMedia ASM106x", 0}, + {0x06221b21, 0x00, "ASMedia ASM106x", 0}, + {0x06241b21, 0x00, "ASMedia ASM106x", 0}, + {0x06251b21, 0x00, "ASMedia ASM106x", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-head@freebsd.org Mon Nov 28 17:06:36 2016 Return-Path: Delivered-To: svn-src-head@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 CB4C4C59C7D; Mon, 28 Nov 2016 17:06:36 +0000 (UTC) (envelope-from adrian@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 80E341964; Mon, 28 Nov 2016 17:06:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASH6Zfl073582; Mon, 28 Nov 2016 17:06:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASH6ZtI073581; Mon, 28 Nov 2016 17:06:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611281706.uASH6ZtI073581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 17:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309253 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:06:36 -0000 Author: adrian Date: Mon Nov 28 17:06:35 2016 New Revision: 309253 URL: https://svnweb.freebsd.org/changeset/base/309253 Log: [ath] revert the previous commit, after reading the 802.11-2012 spec a bit more. The 802.11-2012 spec talks about this - section 10.1.3.2 - Beacon Generation in Infrastructure Networks. So yes, we should be expecting beacons to be going out in multiples of intval. Silly adrian. So: * fix the FreeBSD APs that are sending beacons at incorrect TBTTs (target beacon transmit time); and * yes indeed we will have to wake up out of network sleep until we sync a beacon. Modified: head/sys/dev/ath/if_ath_beacon.c Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 16:25:05 2016 (r309252) +++ head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 17:06:35 2016 (r309253) @@ -965,9 +965,9 @@ ath_beacon_config(struct ath_softc *sc, intval = ni->ni_intval & HAL_BEACON_PERIOD; } - /* - * Note: rounding up to the next intval can cause problems. + * Note: rounding up to the next intval can cause problems with + * bad APs when we're in powersave mode. * * In STA mode with powersave enabled, beacons are only received * whenever the beacon timer fires to wake up the hardware. @@ -975,17 +975,14 @@ ath_beacon_config(struct ath_softc *sc, * that the AP has started transmitting beacons at TSF values that * are multiples of intval, versus say being 25 TU off. * - * I'm not sure why nexttbtt is rounded up to the intval. - * If we sync against a beacon that is way out, we should - * take a beacon miss and re-sync against the next beacon. - * - * So for now - don't round up if we're in STA mode. - * Maybe later (when someone eventually does powersave+IBSS, - * powersave+MBSS) this can be flipped on for those too. + * The specification (802.11-2012 10.1.3.2 - Beacon Generation in + * Infrastructure Networks) requires APs be beaconing at a + * mutiple of intval. So, if bintval=100, then we shouldn't + * get beacons at intervals other than around multiples of 100. */ if (nexttbtt == 0) /* e.g. for ap mode */ nexttbtt = intval; - else if ((ic->ic_opmode != IEEE80211_M_STA) && intval) /* NB: can be 0 for monitor mode */ + else nexttbtt = roundup(nexttbtt, intval); DPRINTF(sc, ATH_DEBUG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", From owner-svn-src-head@freebsd.org Mon Nov 28 17:54:30 2016 Return-Path: Delivered-To: svn-src-head@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 AFE21C5AA39; Mon, 28 Nov 2016 17:54:30 +0000 (UTC) (envelope-from adrian@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 8A2A718FA; Mon, 28 Nov 2016 17:54:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASHsTUx093469; Mon, 28 Nov 2016 17:54:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASHsTQe093467; Mon, 28 Nov 2016 17:54:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611281754.uASHsTQe093467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 17:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309256 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:54:30 -0000 Author: adrian Date: Mon Nov 28 17:54:29 2016 New Revision: 309256 URL: https://svnweb.freebsd.org/changeset/base/309256 Log: [ath] force wake the hardware if we see a missed beacon. This adds a workaround to incorrectly behaving APs (ie, FreeBSD APs) which don't beacon out exactly when they should (at TBTT multiples of beacon intervals.) It forces the hardware awake (but leaves it in network-sleep so self generated frames still state that the hardware is asleep!) and will remain awake until the next sleep transition driven by net80211. That way if the beacons are just at the wrong interval, we get a much better chance of hearing more consecutive beacons before we go to sleep, thus not constantly disconnecting. Tested: * AR9485, STA mode, against a misbehaving FreeBSD AP. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Nov 28 17:24:24 2016 (r309255) +++ head/sys/dev/ath/if_ath.c Mon Nov 28 17:54:29 2016 (r309256) @@ -285,22 +285,40 @@ ath_legacy_attach_comp_func(struct ath_s * the hardware is being programmed elsewhere, it will * simply store it away and update it when all current * uses of the hardware are completed. + * + * If the chip is going into network sleep or power off, then + * we will wait until all uses of the chip are done before + * going into network sleep or power off. + * + * If the chip is being programmed full-awake, then immediately + * program it full-awake so we can actually stay awake rather than + * the chip potentially going to sleep underneath us. */ void -_ath_power_setpower(struct ath_softc *sc, int power_state, const char *file, int line) +_ath_power_setpower(struct ath_softc *sc, int power_state, int selfgen, + const char *file, int line) { ATH_LOCK_ASSERT(sc); - sc->sc_target_powerstate = power_state; - - DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) state=%d, refcnt=%d\n", + DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) state=%d, refcnt=%d, target=%d, cur=%d\n", __func__, file, line, power_state, - sc->sc_powersave_refcnt); + sc->sc_powersave_refcnt, + sc->sc_target_powerstate, + sc->sc_cur_powerstate); - if (sc->sc_powersave_refcnt == 0 && + sc->sc_target_powerstate = power_state; + + /* + * Don't program the chip into network sleep if the chip + * is being programmed elsewhere. + * + * However, if the chip is being programmed /awake/, force + * the chip awake so we stay awake. + */ + if ((sc->sc_powersave_refcnt == 0 || power_state == HAL_PM_AWAKE) && power_state != sc->sc_cur_powerstate) { sc->sc_cur_powerstate = power_state; ath_hal_setpower(sc->sc_ah, power_state); @@ -313,7 +331,8 @@ _ath_power_setpower(struct ath_softc *sc * we let the above call leave the self-gen * state as "sleep". */ - if (sc->sc_cur_powerstate == HAL_PM_AWAKE && + if (selfgen && + sc->sc_cur_powerstate == HAL_PM_AWAKE && sc->sc_target_selfgen_state != HAL_PM_AWAKE) { ath_hal_setselfgenpower(sc->sc_ah, sc->sc_target_selfgen_state); @@ -379,10 +398,13 @@ _ath_power_set_power_state(struct ath_so sc->sc_powersave_refcnt++; + /* + * Only do the power state change if we're not programming + * it elsewhere. + */ if (power_state != sc->sc_cur_powerstate) { ath_hal_setpower(sc->sc_ah, power_state); sc->sc_cur_powerstate = power_state; - /* * Adjust the self-gen powerstate if appropriate. */ @@ -391,7 +413,6 @@ _ath_power_set_power_state(struct ath_so ath_hal_setselfgenpower(sc->sc_ah, sc->sc_target_selfgen_state); } - } } @@ -1317,7 +1338,7 @@ ath_attach(u_int16_t devid, struct ath_s * Put it to sleep for now. */ ATH_LOCK(sc); - ath_power_setpower(sc, HAL_PM_FULL_SLEEP); + ath_power_setpower(sc, HAL_PM_FULL_SLEEP, 1); ATH_UNLOCK(sc); return 0; @@ -1359,7 +1380,7 @@ ath_detach(struct ath_softc *sc) */ ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); /* * Stop things cleanly. @@ -1942,7 +1963,7 @@ ath_resume(struct ath_softc *sc) ATH_LOCK(sc); ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_set_power_state(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); ATH_UNLOCK(sc); ath_hal_reset(ah, sc->sc_opmode, @@ -2269,8 +2290,13 @@ ath_intr(void *arg) sc->sc_stats.ast_rxorn++; } if (status & HAL_INT_TSFOOR) { + /* out of range beacon - wake the chip up, + * but don't modify self-gen frame config */ device_printf(sc->sc_dev, "%s: TSFOOR\n", __func__); sc->sc_syncbeacon = 1; + ATH_LOCK(sc); + ath_power_setpower(sc, HAL_PM_AWAKE, 0); + ATH_UNLOCK(sc); } if (status & HAL_INT_MCI) { ath_btcoex_mci_intr(sc); @@ -2360,12 +2386,22 @@ ath_bmiss_vap(struct ieee80211vap *vap) } /* - * There's no need to keep the hardware awake during the call - * to av_bmiss(). + * Keep the hardware awake if it's asleep (and leave self-gen + * frame config alone) until the next beacon, so we can resync + * against the next beacon. + * + * This handles three common beacon miss cases in STA powersave mode - + * (a) the beacon TBTT isnt a multiple of bintval; + * (b) the beacon was missed; and + * (c) the beacons are being delayed because the AP is busy and + * isn't reliably able to meet its TBTT. */ ATH_LOCK(sc); + ath_power_setpower(sc, HAL_PM_AWAKE, 0); ath_power_restore_power_state(sc); ATH_UNLOCK(sc); + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: forced awake; force syncbeacon=1\n", __func__); /* * Attempt to force a beacon resync. @@ -2462,7 +2498,7 @@ ath_init(struct ath_softc *sc) */ ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_set_power_state(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); /* * Stop anything previously setup. This is safe @@ -5563,7 +5599,7 @@ ath_newstate(struct ieee80211vap *vap, e /* Ensure we stay awake during scan */ ATH_LOCK(sc); ath_power_setselfgen(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); ATH_UNLOCK(sc); ath_hal_intrset(ah, @@ -5739,7 +5775,7 @@ ath_newstate(struct ieee80211vap *vap, e */ ATH_LOCK(sc); ath_power_setselfgen(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); /* * Finally, start any timers and the task q thread @@ -5795,7 +5831,7 @@ ath_newstate(struct ieee80211vap *vap, e * our beacon timer config may be wrong. */ if (sc->sc_syncbeacon == 0) { - ath_power_setpower(sc, HAL_PM_NETWORK_SLEEP); + ath_power_setpower(sc, HAL_PM_NETWORK_SLEEP, 1); } ATH_UNLOCK(sc); } @@ -6177,7 +6213,7 @@ ath_parent(struct ieee80211com *ic) } else { ath_stop(sc); if (!sc->sc_invalid) - ath_power_setpower(sc, HAL_PM_FULL_SLEEP); + ath_power_setpower(sc, HAL_PM_FULL_SLEEP, 1); } ATH_UNLOCK(sc); Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Mon Nov 28 17:24:24 2016 (r309255) +++ head/sys/dev/ath/if_ath_misc.h Mon Nov 28 17:54:29 2016 (r309256) @@ -109,15 +109,23 @@ extern void ath_tx_dump(struct ath_softc /* * Power state tracking. */ -extern void _ath_power_setpower(struct ath_softc *sc, int power_state, const char *file, int line); -extern void _ath_power_set_selfgen(struct ath_softc *sc, int power_state, const char *file, int line); -extern void _ath_power_set_power_state(struct ath_softc *sc, int power_state, const char *file, int line); -extern void _ath_power_restore_power_state(struct ath_softc *sc, const char *file, int line); - -#define ath_power_setpower(sc, ps) _ath_power_setpower(sc, ps, __FILE__, __LINE__) -#define ath_power_setselfgen(sc, ps) _ath_power_set_selfgen(sc, ps, __FILE__, __LINE__) -#define ath_power_set_power_state(sc, ps) _ath_power_set_power_state(sc, ps, __FILE__, __LINE__) -#define ath_power_restore_power_state(sc) _ath_power_restore_power_state(sc, __FILE__, __LINE__) +extern void _ath_power_setpower(struct ath_softc *sc, int power_state, + int selfgen, const char *file, int line); +extern void _ath_power_set_selfgen(struct ath_softc *sc, + int power_state, const char *file, int line); +extern void _ath_power_set_power_state(struct ath_softc *sc, + int power_state, const char *file, int line); +extern void _ath_power_restore_power_state(struct ath_softc *sc, + const char *file, int line); + +#define ath_power_setpower(sc, ps, sg) _ath_power_setpower(sc, ps, sg, \ + __FILE__, __LINE__) +#define ath_power_setselfgen(sc, ps) _ath_power_set_selfgen(sc, ps, \ + __FILE__, __LINE__) +#define ath_power_set_power_state(sc, ps) \ + _ath_power_set_power_state(sc, ps, __FILE__, __LINE__) +#define ath_power_restore_power_state(sc) \ + _ath_power_restore_power_state(sc, __FILE__, __LINE__) /* * Kick the frame TX task. From owner-svn-src-head@freebsd.org Mon Nov 28 17:55:33 2016 Return-Path: Delivered-To: svn-src-head@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 4F75EC5AB36; Mon, 28 Nov 2016 17:55:33 +0000 (UTC) (envelope-from ae@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 29CF81B99; Mon, 28 Nov 2016 17:55:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASHtWW8093582; Mon, 28 Nov 2016 17:55:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASHtWFR093581; Mon, 28 Nov 2016 17:55:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201611281755.uASHtWFR093581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 28 Nov 2016 17:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309257 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:55:33 -0000 Author: ae Date: Mon Nov 28 17:55:32 2016 New Revision: 309257 URL: https://svnweb.freebsd.org/changeset/base/309257 Log: Rework ip_tryforward() to use FIB4 KPI. Tested by: olivier Obtained from: Yandex LLC MFC after: 1 month Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D8526 Modified: head/sys/netinet/ip_fastfwd.c Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Mon Nov 28 17:54:29 2016 (r309256) +++ head/sys/netinet/ip_fastfwd.c Mon Nov 28 17:55:32 2016 (r309257) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -107,40 +108,33 @@ __FBSDID("$FreeBSD$"); #include -static struct sockaddr_in * -ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) +static int +ip_findroute(struct nhop4_basic *pnh, struct in_addr dest, struct mbuf *m) { - struct sockaddr_in *dst; - struct rtentry *rt; + bzero(pnh, sizeof(*pnh)); + if (fib4_lookup_nh_basic(M_GETFIB(m), dest, 0, 0, pnh) != 0) { + IPSTAT_INC(ips_noroute); + IPSTAT_INC(ips_cantforward); + icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); + return (EHOSTUNREACH); + } /* - * Find route to destination. + * Drop blackholed traffic and directed broadcasts. */ - bzero(ro, sizeof(*ro)); - dst = (struct sockaddr_in *)&ro->ro_dst; - dst->sin_family = AF_INET; - dst->sin_len = sizeof(*dst); - dst->sin_addr.s_addr = dest.s_addr; - in_rtalloc_ign(ro, 0, M_GETFIB(m)); - - /* - * Route there and interface still up? - */ - rt = ro->ro_rt; - if (rt && (rt->rt_flags & RTF_UP) && - (rt->rt_ifp->if_flags & IFF_UP) && - (rt->rt_ifp->if_drv_flags & IFF_DRV_RUNNING)) { - if (rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rt->rt_gateway; - } else { - IPSTAT_INC(ips_noroute); + if ((pnh->nh_flags & (NHF_BLACKHOLE | NHF_BROADCAST)) != 0) { + IPSTAT_INC(ips_cantforward); + m_freem(m); + return (EHOSTUNREACH); + } + + if (pnh->nh_flags & NHF_REJECT) { IPSTAT_INC(ips_cantforward); - if (rt) - RTFREE(rt); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - return NULL; + return (EHOSTUNREACH); } - return dst; + + return (0); } /* @@ -155,13 +149,11 @@ ip_tryforward(struct mbuf *m) { struct ip *ip; struct mbuf *m0 = NULL; - struct route ro; - struct sockaddr_in *dst = NULL; - struct ifnet *ifp; + struct nhop4_basic nh; + struct sockaddr_in dst; struct in_addr odest, dest; uint16_t ip_len, ip_off; int error = 0; - int mtu; struct m_tag *fwd_tag = NULL; /* @@ -171,9 +163,6 @@ ip_tryforward(struct mbuf *m) M_ASSERTVALID(m); M_ASSERTPKTHDR(m); - bzero(&ro, sizeof(ro)); - - #ifdef ALTQ /* * Is packet dropped by traffic conditioner? @@ -305,29 +294,17 @@ passin: /* * Find route to destination. */ - if ((dst = ip_findroute(&ro, dest, m)) == NULL) - return NULL; /* icmp unreach already sent */ - ifp = ro.ro_rt->rt_ifp; - - /* - * Immediately drop blackholed traffic, and directed broadcasts - * for either the all-ones or all-zero subnet addresses on - * locally attached networks. - */ - if ((ro.ro_rt->rt_flags & (RTF_BLACKHOLE|RTF_BROADCAST)) != 0) - goto drop; + if (ip_findroute(&nh, dest, m) != 0) + return (NULL); /* icmp unreach already sent */ /* * Step 5: outgoing firewall packet processing */ - - /* - * Run through list of hooks for output packets. - */ if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passout; - if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { + if (pfil_run_hooks(&V_inet_pfil_hook, &m, nh.nh_ifp, PFIL_OUT, NULL) || + m == NULL) { goto drop; } @@ -352,9 +329,7 @@ forwardlocal: * Return packet for processing by ip_input(). */ m->m_flags |= M_FASTFWD_OURS; - if (ro.ro_rt) - RTFREE(ro.ro_rt); - return m; + return (m); } /* * Redo route lookup with new destination address @@ -365,10 +340,8 @@ forwardlocal: m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; } - RTFREE(ro.ro_rt); - if ((dst = ip_findroute(&ro, dest, m)) == NULL) - return NULL; /* icmp unreach already sent */ - ifp = ro.ro_rt->rt_ifp; + if (ip_findroute(&nh, dest, m) != 0) + return (NULL); /* icmp unreach already sent */ } passout: @@ -378,32 +351,15 @@ passout: ip_len = ntohs(ip->ip_len); ip_off = ntohs(ip->ip_off); - /* - * Check if route is dampned (when ARP is unable to resolve) - */ - if ((ro.ro_rt->rt_flags & RTF_REJECT) && - (ro.ro_rt->rt_expire == 0 || time_uptime < ro.ro_rt->rt_expire)) { - icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - goto consumed; - } - - /* - * Check if media link state of interface is not down - */ - if (ifp->if_link_state == LINK_STATE_DOWN) { - icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - goto consumed; - } + bzero(&dst, sizeof(dst)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(dst); + dst.sin_addr = nh.nh_addr; /* * Check if packet fits MTU or if hardware will fragment for us */ - if (ro.ro_rt->rt_mtu) - mtu = min(ro.ro_rt->rt_mtu, ifp->if_mtu); - else - mtu = ifp->if_mtu; - - if (ip_len <= mtu) { + if (ip_len <= nh.nh_mtu) { /* * Avoid confusing lower layers. */ @@ -411,9 +367,9 @@ passout: /* * Send off the packet via outgoing interface */ - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, &ro); + IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, ip, NULL); + error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, + (struct sockaddr *)&dst, NULL); } else { /* * Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery @@ -421,14 +377,15 @@ passout: if (ip_off & IP_DF) { IPSTAT_INC(ips_cantfrag); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - 0, mtu); + 0, nh.nh_mtu); goto consumed; } else { /* * We have to fragment the packet */ m->m_pkthdr.csum_flags |= CSUM_IP; - if (ip_fragment(ip, &m, mtu, ifp->if_hwassist)) + if (ip_fragment(ip, &m, nh.nh_mtu, + nh.nh_ifp->if_hwassist) != 0) goto drop; KASSERT(m != NULL, ("null mbuf and no error")); /* @@ -443,9 +400,11 @@ passout: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, &ro); + IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, + ip, NULL); + /* XXX: we can use cached route here */ + error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, + (struct sockaddr *)&dst, NULL); if (error) break; } while ((m = m0) != NULL); @@ -463,17 +422,13 @@ passout: if (error != 0) IPSTAT_INC(ips_odropped); else { - counter_u64_add(ro.ro_rt->rt_pksent, 1); IPSTAT_INC(ips_forward); IPSTAT_INC(ips_fastforward); } consumed: - RTFREE(ro.ro_rt); return NULL; drop: if (m) m_freem(m); - if (ro.ro_rt) - RTFREE(ro.ro_rt); return NULL; } From owner-svn-src-head@freebsd.org Mon Nov 28 19:44:58 2016 Return-Path: Delivered-To: svn-src-head@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 7BD0DC5AD92; Mon, 28 Nov 2016 19:44:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 422F71173; Mon, 28 Nov 2016 19:44:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::704c:f7e5:d757:16ee] (unknown [IPv6:2001:7b8:3a7:0:704c:f7e5:d757:16ee]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9CF0842AD6; Mon, 28 Nov 2016 20:44:54 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... From: Dimitry Andric In-Reply-To: Date: Mon, 28 Nov 2016 20:44:47 +0100 Cc: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 19:44:58 -0000 --Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 28 Nov 2016, at 03:20, Kyle Evans wrote: > > On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: >> Author: dim >> Date: Thu Nov 24 22:54:55 2016 >> New Revision: 309124 >> URL: https://svnweb.freebsd.org/changeset/base/309124 >> >> Log: >> Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 >> release, and add lld 3.9.0. Also completely revamp the build system for >> clang, llvm, lldb and their related tools. ... > Unfortunately, this commit seems to have done away with the -clang > pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= > elsewhere as FreeBSD-clang has disappeared from my newly built > repository. =( Sorry about that. I have submitted the following review to make amends: https://reviews.freebsd.org/D8666 -Dimitry --Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlg8iTcACgkQsF6jCi4glqP4mgCeNvfmD6sh8nDBFil1IR9KwzoP GjsAoNPTe5Mx+tOPRrEUoaXU4iKdM3k8 =P+0F -----END PGP SIGNATURE----- --Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66-- From owner-svn-src-head@freebsd.org Mon Nov 28 20:06:24 2016 Return-Path: Delivered-To: svn-src-head@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 9B4C3C58381; Mon, 28 Nov 2016 20:06:24 +0000 (UTC) (envelope-from kevans91@ksu.edu) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0046.outbound.protection.outlook.com [104.47.33.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B961F1DB0; Mon, 28 Nov 2016 20:06:23 +0000 (UTC) (envelope-from kevans91@ksu.edu) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ksu.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GHLEIxr+lwjcATsaOrsxWM4i1UHKNoqer55oIQNdvZ0=; b=avf7C7trtIcEXhi4akbynoiY4bV4akHuzwc4uFOBnOl/V3d/1FdS0gUFEPHx4O3W59ZixIR+q3bz4BxKCLkuKqQ3eXhmUGViAzvH8/9eMPDkCX7lfbyb+GjB0ZIiZBuqv1zVbyQh/6DBIPGkjCVEvIHang5vFyO7XNvDEsBfFM4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kevans91@ksu.edu; Received: from mail-yw0-f172.google.com (209.85.161.172) by BN3PR0501MB1316.namprd05.prod.outlook.com (10.160.183.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.5; Mon, 28 Nov 2016 19:51:10 +0000 Received: by mail-yw0-f172.google.com with SMTP id r204so123968670ywb.0; Mon, 28 Nov 2016 11:51:10 -0800 (PST) X-Gm-Message-State: AKaTC03cHs9ezEZEWrt3ONqjPs38zH2ioyPYIkHt33KZ/nrNfZhpSyPCdXj/UWEYikC/arIVFZZMZuE6b9p8kQ== X-Received: by 10.129.179.8 with SMTP id r8mr27021166ywh.156.1480362664964; Mon, 28 Nov 2016 11:51:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.22.196 with HTTP; Mon, 28 Nov 2016 11:50:44 -0800 (PST) In-Reply-To: <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> From: Kyle Evans Date: Mon, 28 Nov 2016 13:50:44 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: Dimitry Andric CC: Glen Barber , , , Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.161.172] X-ClientProxiedBy: SN2PR18CA0005.namprd18.prod.outlook.com (10.169.189.15) To BN3PR0501MB1316.namprd05.prod.outlook.com (10.160.183.17) X-MS-Office365-Filtering-Correlation-Id: 707b4ae3-f5dd-4f39-086b-08d417c7e6c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0501MB1316; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 3:BS3zytaV6XhHw8rYpbAFHaMdHsqLAnonJm7JYHbc+rOt6rOEugxO2EB06bJf+JR0RiW5I0PFzpOBuPcew0gtwXO1Q0RIg0PJoQbax02VUKKFE86MUy2ZeEQ/z9JdbMFwr86XWU08j3ApbRTyPtbCNJEeC8zyZQIAztxyTHuo4rHXl7rrpDIwtmUc2U9+qkTKLcIi5aEGb5YL9itsGD77zgOlKCNA8GPUs9p7TCeVLBFDCWAvXoosE7y7GHXoFWS3P3Fft1ZfwTMUVrRvmp1SDA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 25:Ig2kgGe/agmaBdg03R/tp1jBtzB/A4Bc7ypqZsPkMJ1Cl4BivMu2Q7ap5Snn4oSlt3n0nKJ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g9y3fBHTHlKpxxYnBb+ng62lY4AVul5psDXgjrpKb6Fp5y1katVKdr3g==; 20:khDV6QvqgP5kpq51TNlvYHGDcR3Ik5tLQpLU+l0zMmTzX2WGyqnO9QaUC4gyCNlxbG6K+LUBHREE1eeOdq2VAFMrwjn8wwWbC+aiOi4iPusv8gNYif1724q2RY/DE2BSVJmR3Udht9KKaaOedXtDbPEBZQ+ZHQYnFHSyfMtMUse0pvFKztGgOe3B/C6bLPL0lOYwHAjLCvN1qzlYprnKw1MC+b8f+zDn+zwfif/kglMCOK4X2eZXAuif2vyHGzozd2Y9biBjoAA+xthO/XScwaGJSUcWQiXzCOrbTIsagby6yv+koA0vKPeNEHn/4VjXB/iyAjixGUPWzqskwmp0n9vjjBqTNO4ZCGAy9grM7QpCEVLjOhgsxVZVILKvjoCcif70M1o2NmPwl/VRqhmk8ibgTvreYZRnCndk6hwU9Qe28xygi/BQLC7m+v2dG7pZaRjKZlz3V6MPM6v0fapXy6RwOzOpWNF8mhXxjb4cBaGpsYFyEES4QeDdQzjNrNoP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849)(112903893386949); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(6040361)(6045199)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(6061324)(20161123562025)(20161123564025)(20161123560025)(20161123555025); SRVR:BN3PR0501MB1316; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0501MB1316; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 4:eGOKMOHt14T7qU0kcTuLngnuSBFotlgqPLWN/GuBavmGDtPe4t4DrwGdxyWgc7qhr0FzIRKw455vSA8uQA6319MTJT8GaqTrl1k5lwXRbefZcW2Cf/vQcfSopO/XICKQOr5/XK9XzqLAnSKBY75pLTZ1X9Q5nUqXxwuz1qYnQxvGN9eNK3pdCDhSjYztCeCaNGoYfITDP0k5ELW/rYzIIMsQhU0TxezRcv/hK88mNT82QUkOpDHInEhNMIBp1UICPKQSHyhizplNs2uglDPct/DPIHQaBIz6NBPEKtoh0lhhcDMEM0fMKGmMngK5A4HHX6le+9z+g68r8NxPQbtdSBGbwX8SZtr9nzVq3SW3JVOJUKscQ3h7II3LmenRmdssY6uZ5xj9+DX15YAVLg1s1kJAN8DKUw4xRhzSBoCVyrNyjdoqsNkZiPFIKZ2KJhe6AjQbGaW9neM2nTpTG20dsesr4nNixF/HS8uBiNlEtSxNYqvMVnglW0y3kM/GzdYiNoO7MIxqlmbEniqI/6Czv229iVVIRCjYzLNn5McgNHOO1h/wopdwlaGuQq0kE6mVW50DlQ9uckD4g3U2w+K+JO0S6eTl7S5OcmMAKhutJp5FWcAN02wqlEZQY27qnZtJ/zvin9sUE7VXoTY0ZDTyyFRHbD06HOVzr9SMTItPsUKnxrOcmA++N3/qLXpOam6C X-Forefront-PRVS: 01401330D1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(24454002)(189002)(377454003)(122856001)(110136003)(39380400001)(88552002)(66066001)(50466002)(5660300001)(59536001)(39400400001)(81156014)(81166006)(42186005)(39450400002)(69596002)(92566002)(106356001)(101416001)(105586002)(61266001)(47776003)(63696999)(54356999)(89122001)(86362001)(93516999)(90282001)(76176999)(189998001)(3846002)(61726006)(68736007)(229853002)(4326007)(7736002)(2906002)(50986999)(7846002)(6916009)(38730400001)(8676002)(2950100002)(55446002)(9686002)(75432002)(6116002)(97736004)(23676002)(5820100001)(9896002)(450100001)(305945005)(55456009); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0501MB1316; H:mail-yw0-f172.google.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: ksu.edu does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjA1MDFNQjEzMTY7MjM6UUZkVTZ5L0gwdHhwSXEvLzNRWWlYdnJk?= =?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o1d2pJVlI4VGV2NklVMWsyS2pkY3RnSnNxTDNU?= =?utf-8?B?YzJEaGkwbFF6QXZlRGJEUldJbGdzR0ZLcm8wdHFTOTkzVGhmSHhINzdGc3R1?= =?utf-8?B?clVKQk1MYUFucnc9PQ==?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 6:vuiZGPtAxFau2zzYzce5fZYzZUVvi0m/MzrA26EKUbjT+3SaV3boo6RTg6Uk4q1Buh/xGHPG9MHshUwinMzsE/iW81XQlGAUxgTRo9q93C69tZ1fNcqng2MIvVnOr9pYeOEJLdyjwWCUvU8CD9yVY/8J5YwvbnW0H3h2SrntJdeqH3MpM/4MyWXiWeAwx2SON2ODJWch/vDG5MreEygEn6EnWR+DIXD7MhcUWrHbtPcoiKlYQmskdBaf/rAE6UUuWkZPjud33sWA40r0WZFR99ZAtk7jjFugUSqrQ8RiukDFG+PXLMPjSl4ckICJRCY+z/zcJpOzJhAafO0RkVCjANTdux6wSVuyVM07gLxido3emk26gtTBPdxDYoxl82Su8iDZJPQpHECzXFQ2OTLRIhH6IjryDWSpjJae/EFLNzny4IQziqP8AR9YEZ7WBtDeD12LT+iRbDevOcHAGcKHMg==; 5:peAJmaW8KJLV5iHWtuGYpKcGYJIvvJbbLu3/5pR7kirxv+iYbccjyzIQq2g5XBwUWAEE3bVErfxXC2mrXxME+dDAUXdsY5nbXei3Ly21FMz86exg12Zd1UvFw5NL20DKLISLgVLcDl+453yVC/n1DT2fTk4j+sQp9e/Yd6SXgEk=; 24:y7tGN5IRG8VGUrrykHkmmawKo2nQTGgxNuSJY+k9khKMm/l9Ql9mQbI/lFQJ7/DeWhLNKzp7B0WtzeMnCUEtR2+Ad+QUhW1YonHsKld/2c4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 7:sL3UMRPW8VFMu4GhPAIBYx7aZaeyqTu/izkPe2nDRgTWrbU2Jx+n8mMI4TpwVF+Eot0XBRpN+GJF67DGPJJYu1rg9rEoNV5eRd+qYcYUVnnK+7UByx1KSCB7cFyCqf6ydY2q4vCWrrbj00PBVCmBx2jWM+w2wFPz7G7LDwEHzERHD3vYuSdk3K6uFpbSp1IXJCTBxIuQq0zaFyuh/vb7IJplmG6uFReK0x6i+98aYxmNXfqUNGy5PX8XdRhqiN+K3x/W+PnfQbWv1H5OZyCSbT90xHZMKnB2UwxozxnpcvqjqYN39p/7mLz7/hhAaCY+qgOoSBskJfxYg3I/XxYeLZZ8Wvck52Ec762bqWsFQkXfil7egSo6Dx4HFnQnhgpjF0V8ZXW9KYtms8Q5hAK6oN2/KYv0sgIUhO4wM6JGJMaqEc3AFuJcMjP1r8ErtAP7bwuW1Y0Xyo2f4bmQU6E0BQ==; 20:o4YpwTtIOWW1ED3X/JpRovy8nesUgsaPOo0PEcfdlYXF/5moh9bvkNYXDgxkikR/YtZpkHXlqEr93BzPBSVc2XHMihn9/8T4jo2DKn3qx2aoLdHhK22xyPwZeTdUZekbt6Q5cFgnaPZP29hbc4DXDTPiHFxVZLD/Yrp5Mj9hOC8= X-OriginatorOrg: ksu.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2016 19:51:10.3328 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0501MB1316 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:06:24 -0000 On Mon, Nov 28, 2016 at 1:44 PM, Dimitry Andric wrote: > On 28 Nov 2016, at 03:20, Kyle Evans wrote: >> >> On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: >>> Author: dim >>> Date: Thu Nov 24 22:54:55 2016 >>> New Revision: 309124 >>> URL: https://svnweb.freebsd.org/changeset/base/309124 >>> >>> Log: >>> Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 >>> release, and add lld 3.9.0. Also completely revamp the build system for >>> clang, llvm, lldb and their related tools. > ... >> Unfortunately, this commit seems to have done away with the -clang >> pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= >> elsewhere as FreeBSD-clang has disappeared from my newly built >> repository. =( > > Sorry about that. I have submitted the following review to make amends: > > https://reviews.freebsd.org/D8666 > > -Dimitry > Thanks! I had a brief moment of panic where I thought perhaps this meant clang would be omitted from the upgraded system as the old -clang package got removed upon upgrade. Of course, I was pleasantly surprised to find that the lack of PACKAGE= just meant a fallback to the -runtime package -- this design I like, even though the -clang package is desired. =) Kyle Evans From owner-svn-src-head@freebsd.org Mon Nov 28 20:13:58 2016 Return-Path: Delivered-To: svn-src-head@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 1C060C587B3; Mon, 28 Nov 2016 20:13:58 +0000 (UTC) (envelope-from dim@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 EAD0516AF; Mon, 28 Nov 2016 20:13:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKDva0049930; Mon, 28 Nov 2016 20:13:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKDux3049923; Mon, 28 Nov 2016 20:13:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611282013.uASKDux3049923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 28 Nov 2016 20:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309262 - in head: release/packages usr.bin/clang usr.bin/clang/lld usr.bin/clang/lldb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:13:58 -0000 Author: dim Date: Mon Nov 28 20:13:56 2016 New Revision: 309262 URL: https://svnweb.freebsd.org/changeset/base/309262 Log: Fix packaging for clang, lldb and lld 3.9.0 During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE directive in the usr.bin/clang/*.mk files got dropped accidentally. Restore it, with a few minor changes and additions: * Correct license in clang.ucl to NCSA * Add PACKAGE=clang for clang and most of the "ll" tools * Put lldb in its own package * Put lld in its own package Reviewed by: gjb, jmallett X-MFC-With: 309124 Differential Revision: https://reviews.freebsd.org/D8666 Added: head/release/packages/lld.ucl (contents, props changed) head/release/packages/lldb.ucl (contents, props changed) Modified: head/release/packages/clang.ucl head/usr.bin/clang/clang.prog.mk head/usr.bin/clang/lld/Makefile head/usr.bin/clang/lldb/Makefile head/usr.bin/clang/llvm.prog.mk Modified: head/release/packages/clang.ucl ============================================================================== --- head/release/packages/clang.ucl Mon Nov 28 20:11:13 2016 (r309261) +++ head/release/packages/clang.ucl Mon Nov 28 20:13:56 2016 (r309262) @@ -11,7 +11,7 @@ maintainer = "re@FreeBSD.org" www = "https://www.FreeBSD.org" prefix = "/" licenselogic = "single" -licenses = [ BSD2CLAUSE ] +licenses = [ NCSA ] desc = < Delivered-To: svn-src-head@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 2701DC58CAF; Mon, 28 Nov 2016 20:26:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBFBB1165; Mon, 28 Nov 2016 20:26:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id A582B6B7C; Mon, 28 Nov 2016 20:26:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 28 Nov 2016 20:26:45 +0000 From: Glen Barber To: Kyle Evans Cc: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... Message-ID: <20161128202645.GI33978@FreeBSD.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6cMF9JLEeZkfJjkP" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-STABLE amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer X-Spidey-Sense: Uh oh, Peter logged in User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:26:50 -0000 --6cMF9JLEeZkfJjkP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 28, 2016 at 01:50:44PM -0600, Kyle Evans wrote: > On Mon, Nov 28, 2016 at 1:44 PM, Dimitry Andric wrote: > > On 28 Nov 2016, at 03:20, Kyle Evans wrote: > >> > >> On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrot= e: > >>> Author: dim > >>> Date: Thu Nov 24 22:54:55 2016 > >>> New Revision: 309124 > >>> URL: https://svnweb.freebsd.org/changeset/base/309124 > >>> > >>> Log: > >>> Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3= =2E9.0 > >>> release, and add lld 3.9.0. Also completely revamp the build system= for > >>> clang, llvm, lldb and their related tools. > > ... > >> Unfortunately, this commit seems to have done away with the -clang > >> pkgbase pkg [1], and doesn't seem to have revived the PACKAGE=3D > >> elsewhere as FreeBSD-clang has disappeared from my newly built > >> repository. =3D( > > > > Sorry about that. I have submitted the following review to make amends: > > > > https://reviews.freebsd.org/D8666 > > >=20 > Thanks! I had a brief moment of panic where I thought perhaps this > meant clang would be omitted from the upgraded system as the old > -clang package got removed upon upgrade. >=20 > Of course, I was pleasantly surprised to find that the lack of > PACKAGE=3D just meant a fallback to the -runtime package -- this design > I like, even though the -clang package is desired. =3D) >=20 There is a small potential downside to this, however - you may need to manually install the clang package after upgrading again. This is being worked on, though. Glen --6cMF9JLEeZkfJjkP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYPJMFAAoJEAMUWKVHj+KTPgAP/R1FYqoTJ1/++ceJ8NSsX9Gl 96K7+sYrJmXjfe0yjTdW6JyRzoq+b5p+ywbaqILOoUTqFIzzVu1rcKqVGDJnJSJ/ seuuvygoKqoB3KuNMkK3L/XyxzJ4T5XaP0+DwGPc5kZ9OJXVvOl950VmcpRZdI4x 3kPfd/6aXihx7IKsOFv+5fIge1FowEq/snECFJxe5FforiK3DJVjS3ITO4SvQBFV 7RnFgQqvBCf/n49kCdFtrSyBamkELMWX6CPlkyyV3/vcytcde14oFr/LSLoUDQYI DCbFSTN6Ld3nzH+qJqGxLFAVUry2M3OvqpkNQBlNmLjQrznrTvGMdRDGEVyW4dD+ 8AVov84ZWAzP5ZGAuOoAK803jy6PtIxw734Lv7J+W4+BPp2jDgEY6SjQgKq7AKYo 6CT4xffkK0J68jgu8krUn9qg0MDyWOwwy1Ck2MBMsN9/vYDVbC6U9RFxCnWUITmn /6dAoIEHJe7zEjSpMdZ5h+/l6VoLkd5bCIEGgdIr80pajhtPArMb4uqgLFeGF29Z muO+d5OgeX+sFAde4kHEqcwz5iflZucYVfloRNl4f7ZbE+GIAyvjcQV/BJgFb7hx KgMk4f8YczyNojLxQT6JN3cQMTMzoRo84W/A5oQ/4yux2JrFjlsoZCU4UF3wsBJR wUmVURoflnuDO6V/FXbI =9Eyd -----END PGP SIGNATURE----- --6cMF9JLEeZkfJjkP-- From owner-svn-src-head@freebsd.org Mon Nov 28 20:27:59 2016 Return-Path: Delivered-To: svn-src-head@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 BEBFBC58D3D; Mon, 28 Nov 2016 20:27:59 +0000 (UTC) (envelope-from cognet@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 7586D1307; Mon, 28 Nov 2016 20:27:59 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKRwUu054395; Mon, 28 Nov 2016 20:27:58 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKRw2K054394; Mon, 28 Nov 2016 20:27:58 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282027.uASKRw2K054394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309266 - head/sys/contrib/ck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:27:59 -0000 Author: cognet Date: Mon Nov 28 20:27:58 2016 New Revision: 309266 URL: https://svnweb.freebsd.org/changeset/base/309266 Log: Import Concurrency Kit in the kernel. CK is a toolkit providing different lockfree algorithms/data structures. More information can be found here : www.concurrencykit.org Added: head/sys/contrib/ck/ - copied from r309265, vendor-sys/ck/dist/ From owner-svn-src-head@freebsd.org Mon Nov 28 20:33:32 2016 Return-Path: Delivered-To: svn-src-head@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 1A286C5913C; Mon, 28 Nov 2016 20:33:32 +0000 (UTC) (envelope-from cognet@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 D65ED18EA; Mon, 28 Nov 2016 20:33:31 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKXVA2058305; Mon, 28 Nov 2016 20:33:31 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKXUqA058302; Mon, 28 Nov 2016 20:33:30 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282033.uASKXUqA058302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309267 - in head/sys/contrib/ck/include: . gcc/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:33:32 -0000 Author: cognet Date: Mon Nov 28 20:33:30 2016 New Revision: 309267 URL: https://svnweb.freebsd.org/changeset/base/309267 Log: Add FreeBSD-specific files. Added: head/sys/contrib/ck/include/ck_md.h (contents, props changed) head/sys/contrib/ck/include/gcc/arm/ck_pr_armv4.h (contents, props changed) Modified: head/sys/contrib/ck/include/ck_pr.h Added: head/sys/contrib/ck/include/ck_md.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/include/ck_md.h Mon Nov 28 20:33:30 2016 (r309267) @@ -0,0 +1,71 @@ +/* + * Copyright 2011-2012 Samy Al Bahra. + * 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 CK_MD_H +#define CK_MD_H + +#ifndef CK_MD_CACHELINE +#define CK_MD_CACHELINE (64) +#endif + +#ifndef CK_MD_PAGESIZE +#define CK_MD_PAGESIZE (4096) +#endif + +#ifndef CK_MD_RTM_DISABLE +#define CK_MD_RTM_DISABLE +#endif /* CK_MD_RTM_DISABLE */ + +#ifndef CK_MD_POINTER_PACK_DISABLE +#define CK_MD_POINTER_PACK_DISABLE +#endif /* CK_MD_POINTER_PACK_DISABLE */ + +#ifndef CK_MD_VMA_BITS_UNKNOWN +#define CK_MD_VMA_BITS_UNKNOWN +#endif /* CK_MD_VMA_BITS_UNKNOWN */ + +#ifndef CK_MD_RMO +#define CK_MD_RMO +#endif /* CK_MD_RMO */ + +#define CK_VERSION "0.5.2" +#define CK_GIT_SHA "" + +/* + * CK expects those, which are normally defined by the build system. + */ +#if defined(__i386__) && !defined(__x86__) +#define __x86__ +#elif defined(__sparc64__) && !defined(__sparcv9__) +#define __sparcv9__ +#elif defined(__powerpc64__) && !defined(__ppc64__) +#define __ppc64__ +#elif defined(__powerpc__) && !defined(__ppc__) +#define __ppc__ +#endif +#endif /* CK_MD_H */ Modified: head/sys/contrib/ck/include/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/ck_pr.h Mon Nov 28 20:27:58 2016 (r309266) +++ head/sys/contrib/ck/include/ck_pr.h Mon Nov 28 20:33:30 2016 (r309267) @@ -46,7 +46,11 @@ #elif defined(__ppc__) #include "gcc/ppc/ck_pr.h" #elif defined(__arm__) +#if __ARM_ARCH >= 6 #include "gcc/arm/ck_pr.h" +#else +#include "gcc/arm/ck_pr_armv4.h" +#endif #elif defined(__aarch64__) #include "gcc/aarch64/ck_pr.h" #elif !defined(__GNUC__) Added: head/sys/contrib/ck/include/gcc/arm/ck_pr_armv4.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/include/gcc/arm/ck_pr_armv4.h Mon Nov 28 20:33:30 2016 (r309267) @@ -0,0 +1,350 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2016 Olivier Houchard. + * 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 CK_PR_ARM_H +#define CK_PR_ARM_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +#include +#include + +#include + +/* + * armv4/v5 CPUs lack any instruction that would let us implement an atomic CAS + * so we have to give atomicity by disabling interrupts. This only works in + * the kernel, obviously. + */ +#define __with_interrupts_disabled(expr) \ + do { \ + u_int cpsr_save, tmp; \ + \ + __asm __volatile( \ + "mrs %0, cpsr;" \ + "orr %1, %0, %2;" \ + "msr cpsr_fsxc, %1;" \ + : "=r" (cpsr_save), "=r" (tmp) \ + : "I" (PSR_I | PSR_F) \ + : "cc" ); \ + (expr); \ + __asm __volatile( \ + "msr cpsr_fsxc, %0" \ + : /* no output */ \ + : "r" (cpsr_save) \ + : "cc" ); \ + } while(0) +/* + * The following represent supported atomic operations. + * These operations may be emulated. + */ +#include "ck_f_pr.h" + +/* + * Minimum interface requirement met. + */ +#define CK_F_PR + +CK_CC_INLINE static void +ck_pr_stall(void) +{ + + __asm__ __volatile__("" ::: "memory"); + return; +} + +#define CK_PR_FENCE(T, I) \ + CK_CC_INLINE static void \ + ck_pr_fence_strict_##T(void) \ + { \ + I; \ + } + +/* + * ARM CPUs prior to armv6 didn't reorder instructions, and we don't + * support any SMP system, so a compiler barrier should be enough for fences + */ +CK_PR_FENCE(atomic, ck_pr_stall()) +CK_PR_FENCE(atomic_store, ck_pr_stall()) +CK_PR_FENCE(atomic_load, ck_pr_stall()) +CK_PR_FENCE(store_atomic, ck_pr_stall()) +CK_PR_FENCE(load_atomic, ck_pr_stall()) +CK_PR_FENCE(store, ck_pr_stall()) +CK_PR_FENCE(store_load, ck_pr_stall()) +CK_PR_FENCE(load, ck_pr_stall()) +CK_PR_FENCE(load_store, ck_pr_stall()) +CK_PR_FENCE(memory, ck_pr_stall()) +CK_PR_FENCE(acquire, ck_pr_stall()) +CK_PR_FENCE(release, ck_pr_stall()) +CK_PR_FENCE(acqrel, ck_pr_stall()) +CK_PR_FENCE(lock, ck_pr_stall()) +CK_PR_FENCE(unlock, ck_pr_stall()) + +#undef CK_PR_FENCE + +#define CK_PR_LOAD(S, M, T, C, I) \ + CK_CC_INLINE static T \ + ck_pr_md_load_##S(const M *target) \ + { \ + long r = 0; \ + __asm__ __volatile__(I " %0, [%1];" \ + : "=r" (r) \ + : "r" (target) \ + : "memory"); \ + return ((T)r); \ + } + +CK_PR_LOAD(ptr, void, void *, uint32_t, "ldr") + +#define CK_PR_LOAD_S(S, T, I) CK_PR_LOAD(S, T, T, T, I) + +CK_PR_LOAD_S(32, uint32_t, "ldr") +CK_PR_LOAD_S(16, uint16_t, "ldrh") +CK_PR_LOAD_S(8, uint8_t, "ldrb") +CK_PR_LOAD_S(uint, unsigned int, "ldr") +CK_PR_LOAD_S(int, int, "ldr") +CK_PR_LOAD_S(short, short, "ldrh") +CK_PR_LOAD_S(char, char, "ldrb") + +#undef CK_PR_LOAD_S +#undef CK_PR_LOAD + +#define CK_PR_STORE(S, M, T, C, I) \ + CK_CC_INLINE static void \ + ck_pr_md_store_##S(M *target, T v) \ + { \ + __asm__ __volatile__(I " %1, [%0]" \ + : \ + : "r" (target), \ + "r" (v) \ + : "memory"); \ + return; \ + } + +CK_PR_STORE(ptr, void, const void *, uint32_t, "str") + +#define CK_PR_STORE_S(S, T, I) CK_PR_STORE(S, T, T, T, I) + +CK_PR_STORE_S(32, uint32_t, "str") +CK_PR_STORE_S(16, uint16_t, "strh") +CK_PR_STORE_S(8, uint8_t, "strb") +CK_PR_STORE_S(uint, unsigned int, "str") +CK_PR_STORE_S(int, int, "str") +CK_PR_STORE_S(short, short, "strh") +CK_PR_STORE_S(char, char, "strb") + +#undef CK_PR_STORE_S +#undef CK_PR_STORE + +#define CK_PR_CAS(N, M, T) \ +CK_CC_INLINE static bool \ +ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ +{ \ + bool ret; \ + __with_interrupts_disabled( \ + { \ + *(T *)value = *(T *)target; \ + if (*(T *)target == compare) { \ + *(T *)target = set; \ + ret = true; \ + } else \ + ret = false; \ + } \ + ); \ + return ret; \ +} \ +CK_CC_INLINE static bool \ +ck_pr_cas_##N(M *target, T compare, T set) \ +{ \ + bool ret; \ + __with_interrupts_disabled( \ + { \ + if (*(T *)target == compare) { \ + *(T *)target = set; \ + ret = true; \ + } else \ + ret = false; \ + } \ + ); \ + return ret; \ +} + +CK_PR_CAS(ptr, void, void *) + +#define CK_PR_CAS_S(N, T) CK_PR_CAS(N, T, T) +CK_PR_CAS_S(32, uint32_t) +CK_PR_CAS_S(uint, unsigned int) +CK_PR_CAS_S(int, int) +CK_PR_CAS_S(16, uint16_t) +CK_PR_CAS_S(8, uint8_t) +CK_PR_CAS_S(short, short) +CK_PR_CAS_S(char, char) + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W) \ + CK_CC_INLINE static T \ + ck_pr_fas_##N(M *target, T v) \ + { \ + T previous = 0; \ + __with_interrupts_disabled( \ + { \ + previous = *(T *)target; \ + *(T *)target = v; \ + } \ + ); \ + return (previous); \ + } + +CK_PR_FAS(32, uint32_t, uint32_t, "") +CK_PR_FAS(ptr, void, void *, "") +CK_PR_FAS(int, int, int, "") +CK_PR_FAS(uint, unsigned int, unsigned int, "") +CK_PR_FAS(16, uint16_t, uint16_t, "h") +CK_PR_FAS(8, uint8_t, uint8_t, "b") +CK_PR_FAS(short, short, short, "h") +CK_PR_FAS(char, char, char, "b") + + +#undef CK_PR_FAS + +#define CK_PR_UNARY(O, N, M, T, I, W) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target) \ + { \ + __with_interrupts_disabled( \ + { \ + I; \ + } \ + ); \ + return; \ + } + +CK_PR_UNARY(inc, ptr, void, void *, (*(int *)target)++, "") +CK_PR_UNARY(dec, ptr, void, void *, (*(int *)target)--, "") +CK_PR_UNARY(not, ptr, void, void *, *(int *)target = !(*(int*)target), "") +CK_PR_UNARY(neg, ptr, void, void *, *(int *)target = -(*(int *)target), "") + +#define CK_PR_UNARY_S(S, T, W) \ + CK_PR_UNARY(inc, S, T, T, *target++, W) \ + CK_PR_UNARY(dec, S, T, T, *target--, W) \ + CK_PR_UNARY(not, S, T, T, *target = !*target, W) \ + CK_PR_UNARY(neg, S, T, T, *target = -*target, W) \ + +CK_PR_UNARY_S(32, uint32_t, "") +CK_PR_UNARY_S(uint, unsigned int, "") +CK_PR_UNARY_S(int, int, "") +CK_PR_UNARY_S(16, uint16_t, "h") +CK_PR_UNARY_S(8, uint8_t, "b") +CK_PR_UNARY_S(short, short, "h") +CK_PR_UNARY_S(char, char, "b") + +#undef CK_PR_UNARY_S +#undef CK_PR_UNARY + +#define CK_PR_BINARY(O, N, M, T, I, W) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target, T delta) \ + { \ + __with_interrupts_disabled( \ + { \ + I; \ + } \ + ); \ + return; \ + } + +CK_PR_BINARY(and, ptr, void, uintptr_t, *((uintptr_t *)target) &= delta, "") +CK_PR_BINARY(add, ptr, void, uintptr_t, *((uintptr_t *)target) += delta, "") +CK_PR_BINARY(or, ptr, void, uintptr_t, *((uintptr_t *)target) |= delta, "") +CK_PR_BINARY(sub, ptr, void, uintptr_t, *((uintptr_t *)target) -= delta, "") +CK_PR_BINARY(xor, ptr, void, uintptr_t, *((uintptr_t *)target) ^= delta, "") + +#define CK_PR_BINARY_S(S, T, W) \ + CK_PR_BINARY(and, S, T, T, *target &= delta, W) \ + CK_PR_BINARY(add, S, T, T, *target += delta, W) \ + CK_PR_BINARY(or, S, T, T, *target |= delta, W) \ + CK_PR_BINARY(sub, S, T, T, *target -= delta, W) \ + CK_PR_BINARY(xor, S, T, T, *target ^= delta, W) + +CK_PR_BINARY_S(32, uint32_t, "") +CK_PR_BINARY_S(uint, unsigned int, "") +CK_PR_BINARY_S(int, int, "") +CK_PR_BINARY_S(16, uint16_t, "h") +CK_PR_BINARY_S(8, uint8_t, "b") +CK_PR_BINARY_S(short, short, "h") +CK_PR_BINARY_S(char, char, "b") + +#undef CK_PR_BINARY_S +#undef CK_PR_BINARY + +CK_CC_INLINE static void * +ck_pr_faa_ptr(void *target, uintptr_t delta) +{ + uintptr_t previous; + __with_interrupts_disabled( + { + previous = *(uintptr_t *)target; + *(uintptr_t *)target += delta; + } + ); + return (void *)(previous); +} + +#define CK_PR_FAA(S, T, W) \ + CK_CC_INLINE static T \ + ck_pr_faa_##S(T *target, T delta) \ + { \ + T previous = 0; \ + __with_interrupts_disabled( \ + { \ + previous = *target; \ + *target += delta; \ + } \ + ); \ + return (previous); \ + } + +CK_PR_FAA(32, uint32_t, "") +CK_PR_FAA(uint, unsigned int, "") +CK_PR_FAA(int, int, "") +CK_PR_FAA(16, uint16_t, "h") +CK_PR_FAA(8, uint8_t, "b") +CK_PR_FAA(short, short, "h") +CK_PR_FAA(char, char, "b") + +#undef CK_PR_FAA + +#undef __with_interrupts_disabled + +#endif /* CK_PR_ARM_H */ + From owner-svn-src-head@freebsd.org Mon Nov 28 20:44:13 2016 Return-Path: Delivered-To: svn-src-head@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 4DF15C59369; Mon, 28 Nov 2016 20:44:13 +0000 (UTC) (envelope-from cognet@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 1D7211DCA; Mon, 28 Nov 2016 20:44:13 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKiCAY062270; Mon, 28 Nov 2016 20:44:12 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKiCfZ062269; Mon, 28 Nov 2016 20:44:12 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282044.uASKiCfZ062269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309268 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:44:13 -0000 Author: cognet Date: Mon Nov 28 20:44:12 2016 New Revision: 309268 URL: https://svnweb.freebsd.org/changeset/base/309268 Log: Hook CK to the kernel build. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 28 20:33:30 2016 (r309267) +++ head/sys/conf/files Mon Nov 28 20:44:12 2016 (r309268) @@ -305,6 +305,17 @@ compat/freebsd32/freebsd32_ioctl.c optio compat/freebsd32/freebsd32_misc.c optional compat_freebsd32 compat/freebsd32/freebsd32_syscalls.c optional compat_freebsd32 compat/freebsd32/freebsd32_sysent.c optional compat_freebsd32 +contrib/ck/src/ck_array.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_centralized.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_combining.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_dissemination.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_mcs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_tournament.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_epoch.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_hp.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_hs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_ht.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_rhs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" contrib/dev/acpica/common/ahids.c optional acpi acpi_debug contrib/dev/acpica/common/ahuuids.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug From owner-svn-src-head@freebsd.org Mon Nov 28 21:00:20 2016 Return-Path: Delivered-To: svn-src-head@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 A3B60C59ABA; Mon, 28 Nov 2016 21:00:20 +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 6620818F0; Mon, 28 Nov 2016 21:00:20 +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 uASL0JPM066687; Mon, 28 Nov 2016 21:00:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASL0Jvb066685; Mon, 28 Nov 2016 21:00:19 GMT (envelope-from des@FreeBSD.org) Message-Id: <201611282100.uASL0Jvb066685@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: Mon, 28 Nov 2016 21:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309269 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 21:00:20 -0000 Author: des Date: Mon Nov 28 21:00:19 2016 New Revision: 309269 URL: https://svnweb.freebsd.org/changeset/base/309269 Log: Use malloc()ed buffers instead of stack buffers in gr_copy() and pw_copy(). This allows pw(8) to operate on passwd and group files with longer lines than could be accomodated by a stack buffer. It doesn't take more than a few hundred users to exceed 8192 bytes in /etc/group. MFC after: 3 weeks Sponsored by: The University of Oslo Modified: head/lib/libutil/gr_util.c head/lib/libutil/pw_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Mon Nov 28 20:44:12 2016 (r309268) +++ head/lib/libutil/gr_util.c Mon Nov 28 21:00:19 2016 (r309269) @@ -164,11 +164,12 @@ gr_tmp(int mfd) int gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr) { - char buf[8192], *end, *line, *p, *q, *r, t; + char *buf, *end, *line, *p, *q, *r, *tmp; struct group *fgr; const struct group *sgr; - size_t len; + size_t len, size; int eof, readlen; + char t; if (old_gr == NULL && gr == NULL) return(-1); @@ -186,6 +187,10 @@ gr_copy(int ffd, int tfd, const struct g if (sgr == NULL) sgr = gr; + /* initialize the buffer */ + if ((buf = malloc(size = 1024)) == NULL) + goto err; + eof = 0; len = 0; p = q = end = buf; @@ -199,10 +204,16 @@ gr_copy(int ffd, int tfd, const struct g if (q >= end) { if (eof) break; - if ((size_t)(q - p) >= sizeof(buf)) { - warnx("group line too long"); - errno = EINVAL; /* hack */ - goto err; + while ((size_t)(q - p) >= size) { + if ((tmp = realloc(buf, size * 2)) == NULL) { + warnx("group line too long"); + goto err; + } + p = tmp + (p - buf); + q = tmp + (q - buf); + end = tmp + (end - buf); + buf = tmp; + size = size * 2; } if (p < end) { q = memmove(buf, p, end -p); @@ -210,7 +221,7 @@ gr_copy(int ffd, int tfd, const struct g } else { p = q = end = buf; } - readlen = read(ffd, end, sizeof(buf) - (end -buf)); + readlen = read(ffd, end, size - (end - buf)); if (readlen == -1) goto err; else @@ -219,7 +230,7 @@ gr_copy(int ffd, int tfd, const struct g break; end += len; len = end - buf; - if (len < (ssize_t)sizeof(buf)) { + if (len < size) { eof = 1; if (len > 0 && buf[len -1] != '\n') ++len, *end++ = '\n'; @@ -281,7 +292,7 @@ gr_copy(int ffd, int tfd, const struct g if (write(tfd, q, end - q) != end - q) goto err; q = buf; - readlen = read(ffd, buf, sizeof(buf)); + readlen = read(ffd, buf, size); if (readlen == 0) break; else @@ -303,12 +314,12 @@ gr_copy(int ffd, int tfd, const struct g write(tfd, "\n", 1) != 1) goto err; done: - if (line != NULL) - free(line); + free(line); + free(buf); return (0); err: - if (line != NULL) - free(line); + free(line); + free(buf); return (-1); } Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Mon Nov 28 20:44:12 2016 (r309268) +++ head/lib/libutil/pw_util.c Mon Nov 28 21:00:19 2016 (r309269) @@ -427,11 +427,12 @@ pw_make_v7(const struct passwd *pw) int pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw) { - char buf[8192], *end, *line, *p, *q, *r, t; + char *buf, *end, *line, *p, *q, *r, *tmp; struct passwd *fpw; const struct passwd *spw; - size_t len; + size_t len, size; int eof, readlen; + char t; if (old_pw == NULL && pw == NULL) return (-1); @@ -449,6 +450,10 @@ pw_copy(int ffd, int tfd, const struct p if (spw == NULL) spw = pw; + /* initialize the buffer */ + if ((buf = malloc(size = 1024)) == NULL) + goto err; + eof = 0; len = 0; p = q = end = buf; @@ -462,10 +467,16 @@ pw_copy(int ffd, int tfd, const struct p if (q >= end) { if (eof) break; - if ((size_t)(q - p) >= sizeof(buf)) { - warnx("passwd line too long"); - errno = EINVAL; /* hack */ - goto err; + while ((size_t)(q - p) >= size) { + if ((tmp = realloc(buf, size * 2)) == NULL) { + warnx("passwd line too long"); + goto err; + } + p = tmp + (p - buf); + q = tmp + (q - buf); + end = tmp + (end - buf); + buf = tmp; + size = size * 2; } if (p < end) { q = memmove(buf, p, end - p); @@ -473,7 +484,7 @@ pw_copy(int ffd, int tfd, const struct p } else { p = q = end = buf; } - readlen = read(ffd, end, sizeof(buf) - (end - buf)); + readlen = read(ffd, end, size - (end - buf)); if (readlen == -1) goto err; else @@ -482,7 +493,7 @@ pw_copy(int ffd, int tfd, const struct p break; end += len; len = end - buf; - if (len < (ssize_t)sizeof(buf)) { + if (len < size) { eof = 1; if (len > 0 && buf[len - 1] != '\n') ++len, *end++ = '\n'; @@ -545,7 +556,7 @@ pw_copy(int ffd, int tfd, const struct p if (write(tfd, q, end - q) != end - q) goto err; q = buf; - readlen = read(ffd, buf, sizeof(buf)); + readlen = read(ffd, buf, size); if (readlen == 0) break; else @@ -567,12 +578,12 @@ pw_copy(int ffd, int tfd, const struct p write(tfd, "\n", 1) != 1) goto err; done: - if (line != NULL) - free(line); + free(line); + free(buf); return (0); err: - if (line != NULL) - free(line); + free(line); + free(buf); return (-1); } From owner-svn-src-head@freebsd.org Mon Nov 28 21:16:04 2016 Return-Path: Delivered-To: svn-src-head@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 8646EC59FA1; Mon, 28 Nov 2016 21:16:04 +0000 (UTC) (envelope-from cognet@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 55D6D1195; Mon, 28 Nov 2016 21:16:04 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASLG3P1074542; Mon, 28 Nov 2016 21:16:03 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASLG3hI074541; Mon, 28 Nov 2016 21:16:03 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282116.uASLG3hI074541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 21:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309270 - head/sys/contrib/ck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 21:16:04 -0000 Author: cognet Date: Mon Nov 28 21:16:03 2016 New Revision: 309270 URL: https://svnweb.freebsd.org/changeset/base/309270 Log: Add a FREEBSD-Xlist file for CK. Added: head/sys/contrib/ck/FREEBSD-Xlist Added: head/sys/contrib/ck/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/FREEBSD-Xlist Mon Nov 28 21:16:03 2016 (r309270) @@ -0,0 +1,10 @@ +#$FreeBSD$ +*/LICENSE +*/Makefile.in +*/README +*/build +*/configure +*/doc +*/regressions +*/tools +*/include/ck_md.h.in From owner-svn-src-head@freebsd.org Mon Nov 28 21:29:02 2016 Return-Path: Delivered-To: svn-src-head@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 9CE9DC5A296; Mon, 28 Nov 2016 21:29:02 +0000 (UTC) (envelope-from imp@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 6C9D41910; Mon, 28 Nov 2016 21:29:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASLT1Xx078699; Mon, 28 Nov 2016 21:29:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASLT1G7078698; Mon, 28 Nov 2016 21:29:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201611282129.uASLT1G7078698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Nov 2016 21:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309271 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 21:29:02 -0000 Author: imp Date: Mon Nov 28 21:29:01 2016 New Revision: 309271 URL: https://svnweb.freebsd.org/changeset/base/309271 Log: Trying to autodetect legacy setups lead to problems when people overrode the disk image creation routine. For now, just always bring in the legecy defines / routines. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Mon Nov 28 21:16:03 2016 (r309270) +++ head/tools/tools/nanobsd/nanobsd.sh Mon Nov 28 21:29:01 2016 (r309271) @@ -44,9 +44,9 @@ do_installworld=true do_image=true do_copyout_partition=true do_native_xtools=false -# Don't do the legacy build unless we detect 'old' variables being -# set. -do_legacy=false + +# Pull in legacy stuff for now automatically +. "${topdir}/legacy.sh" set +e args=`getopt BKXWbc:fhiknqvw $*` @@ -134,15 +134,6 @@ if [ $# -gt 0 ] ; then usage fi -if [ -n "$NANO_HEADS" -o -n "$NANO_SECTS" ]; then - do_legacy=true -fi - -# If this uses the old, legacy image system, pull that in as well -if $do_legacy ; then - . "${topdir}/legacy.sh" -fi - ####################################################################### # And then it is as simple as that... From owner-svn-src-head@freebsd.org Tue Nov 29 00:16:21 2016 Return-Path: Delivered-To: svn-src-head@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 1CA05C5848B; Tue, 29 Nov 2016 00:16:21 +0000 (UTC) (envelope-from jhb@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 D69A81C34; Tue, 29 Nov 2016 00:16:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAT0GKjl045898; Tue, 29 Nov 2016 00:16:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT0GKPi045897; Tue, 29 Nov 2016 00:16:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611290016.uAT0GKPi045897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 29 Nov 2016 00:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309274 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 00:16:21 -0000 Author: jhb Date: Tue Nov 29 00:16:19 2016 New Revision: 309274 URL: https://svnweb.freebsd.org/changeset/base/309274 Log: Use the correct name for the GCC macro indicating max_align_t is defined. MFC after: 3 days Modified: head/include/stddef.h Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Mon Nov 28 22:35:10 2016 (r309273) +++ head/include/stddef.h Tue Nov 29 00:16:19 2016 (r309274) @@ -66,7 +66,7 @@ typedef ___wchar_t wchar_t; #ifndef __CLANG_MAX_ALIGN_T_DEFINED typedef __max_align_t max_align_t; #define __CLANG_MAX_ALIGN_T_DEFINED -#define __GCC_MAX_ALIGN_T +#define _GCC_MAX_ALIGN_T #endif #endif From owner-svn-src-head@freebsd.org Tue Nov 29 04:32:16 2016 Return-Path: Delivered-To: svn-src-head@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 170A2C5B163; Tue, 29 Nov 2016 04:32:16 +0000 (UTC) (envelope-from jchandra@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 D3EF019DA; Tue, 29 Nov 2016 04:32:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAT4WFbv050561; Tue, 29 Nov 2016 04:32:15 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT4WF8c050560; Tue, 29 Nov 2016 04:32:15 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201611290432.uAT4WF8c050560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Tue, 29 Nov 2016 04:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309276 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 04:32:16 -0000 Author: jchandra Date: Tue Nov 29 04:32:14 2016 New Revision: 309276 URL: https://svnweb.freebsd.org/changeset/base/309276 Log: Fix interrupt clear in pl011 uart receive function Clear the interrupt state before reading the input char from the input FIFO. In the current code there is a window between the read to the data register and the write to the the ICR, during which an input char will not cause an interrupt. This fixes the issue by which the serial port input on QEMU freezes when using the emulated pl011 serial port. Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Tue Nov 29 01:08:09 2016 (r309275) +++ head/sys/dev/uart/uart_dev_pl011.c Tue Nov 29 04:32:14 2016 (r309276) @@ -443,6 +443,8 @@ uart_pl011_bus_receive(struct uart_softc sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; break; } + + __uart_setreg(bas, UART_ICR, (UART_RXREADY | RIS_RTIM)); xc = __uart_getreg(bas, UART_DR); rx = xc & 0xff; @@ -451,8 +453,6 @@ uart_pl011_bus_receive(struct uart_softc if (xc & DR_PE) rx |= UART_STAT_PARERR; - __uart_setreg(bas, UART_ICR, (UART_RXREADY | RIS_RTIM)); - uart_rx_put(sc, rx); ints = __uart_getreg(bas, UART_MIS); } From owner-svn-src-head@freebsd.org Tue Nov 29 10:43:59 2016 Return-Path: Delivered-To: svn-src-head@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 A0C93C5CD04; Tue, 29 Nov 2016 10:43:59 +0000 (UTC) (envelope-from oleg@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 6FD051897; Tue, 29 Nov 2016 10:43:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATAhwLh000758; Tue, 29 Nov 2016 10:43:58 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATAhwPj000757; Tue, 29 Nov 2016 10:43:58 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201611291043.uATAhwPj000757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Tue, 29 Nov 2016 10:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309281 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 10:43:59 -0000 Author: oleg Date: Tue Nov 29 10:43:58 2016 New Revision: 309281 URL: https://svnweb.freebsd.org/changeset/base/309281 Log: Fix 'ipfw delete set N': do not emit meaningless 'rule 0 not found' warning if set was already empty. MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Nov 29 08:20:55 2016 (r309280) +++ head/sbin/ipfw/ipfw2.c Tue Nov 29 10:43:58 2016 (r309281) @@ -3221,7 +3221,7 @@ ipfw_delete(char *av[]) exitval = EX_UNAVAILABLE; warn("rule %u: setsockopt(IP_FW_XDEL)", rt.start_rule); - } else if (rt.new_set == 0) { + } else if (rt.new_set == 0 && do_set == 0) { exitval = EX_UNAVAILABLE; if (rt.start_rule != rt.end_rule) warnx("no rules rules in %u-%u range", From owner-svn-src-head@freebsd.org Tue Nov 29 11:13:44 2016 Return-Path: Delivered-To: svn-src-head@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 6D029C59DE1; Tue, 29 Nov 2016 11:13: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 3C93F103B; Tue, 29 Nov 2016 11:13:44 +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 uATBDhgH013300; Tue, 29 Nov 2016 11:13:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATBDh1T013298; Tue, 29 Nov 2016 11:13:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611291113.uATBDh1T013298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Nov 2016 11:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309282 - in head/sys/cam: . scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 11:13:44 -0000 Author: mav Date: Tue Nov 29 11:13:43 2016 New Revision: 309282 URL: https://svnweb.freebsd.org/changeset/base/309282 Log: Explicitly initialize cdai.flags. In SES driver uninitialized value caused unreliable physpath reporting. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Nov 29 10:43:58 2016 (r309281) +++ head/sys/cam/cam_xpt.c Tue Nov 29 11:13:43 2016 (r309282) @@ -1124,6 +1124,7 @@ xpt_getattr(char *buf, size_t len, const memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; + cdai.flags = CDAI_FLAG_NONE; cdai.bufsiz = len; if (!strcmp(attr, "GEOM::ident")) Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 10:43:58 2016 (r309281) +++ head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 11:13:43 2016 (r309282) @@ -1066,6 +1066,7 @@ ses_set_physpath(enc_softc_t *enc, enc_e */ xpt_setup_ccb(&cdai.ccb_h, enc->periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; + cdai.flags = CDAI_FLAG_NONE; cdai.buftype = CDAI_TYPE_SCSI_DEVID; cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; cdai.buf = devid = malloc(cdai.bufsiz, M_SCSIENC, M_WAITOK|M_ZERO); From owner-svn-src-head@freebsd.org Tue Nov 29 12:13:24 2016 Return-Path: Delivered-To: svn-src-head@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 00CD2C58EC2; Tue, 29 Nov 2016 12:13:24 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (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 C35911231; Tue, 29 Nov 2016 12:13:23 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id 144so8286291pfv.0; Tue, 29 Nov 2016 04:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EgPnju4ae8yNzcoC7X6fEZHb2St3Jxws4j161JmyOAg=; b=kH9Ux7Mv3jRqNwZ3JO2bBjtfTO5wNWtf/nFCazMBBwRkwv6cl0V2h64tLpZU7LxdXD W6qozNa7Ff4Np7QGTEWccuiHyX1Ypktk3fZdxMKXBCFetTYenBGWm4StFHPjErGKaO5Y wQMQJKB8vPGa7RdijRO4aW0ZNzOkL9l4v4Vk2N9yAJSd9dz7hp3TRqSf+Su1BMuRZboC FhO0Tjo6+PeJTUPKVRQmZ5UU79Nuf+DGWg5pRFGgoc1lMcSwqbN972YA69/ZXfSOfYxs OQrN9jKWYd0FecHDfsx2PaawfXFyQ9aXvEAKk5FEzBde3KZCLh+EGK1estCkRJqabqLb lasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=EgPnju4ae8yNzcoC7X6fEZHb2St3Jxws4j161JmyOAg=; b=OiXUOQinBKasnLndBZ/nci+wvN30/I04hUXGjN3WPHRXCLffWOiG1eNnljD4OpHLhJ 8/87rhRcrkhwc2TNLv4/wtJAgpXlgatUfSOuBFnHsZ0W2+CL1RdVWUhR52n0MSrjnTjZ 5KxYfnafFbePJBYDKwLGHlXsA3jcUx++kSvm3UiqpZRXO5Xm1kvg0Aha9836xz5UFBXP Qh3KLa7YtiY4/eryL4NqHRk1J2jPNlCzIiEsaHtdyrW5r5RctWcpgKFn+ePpfGnx/Ece gDE3kyhSU2s+vAh4ERpqyaVrcnofiqzcD90hBYAjpVi7/Cu5IW9X0B2F5PklppLR8CRQ YKwg== X-Gm-Message-State: AKaTC00CZXVb0ikjAvF8+heZNhjsy3g1KycI/PnzZYUEQFd3ujGP0i120kM1iBATTyJdTA== X-Received: by 10.99.3.202 with SMTP id 193mr49297041pgd.157.1480421603366; Tue, 29 Nov 2016 04:13:23 -0800 (PST) Received: from ox ([2601:641:c000:b800:c070:29ff:2e7:9e08]) by smtp.gmail.com with ESMTPSA id i194sm77063704pgc.46.2016.11.29.04.13.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2016 04:13:22 -0800 (PST) Sender: Navdeep Parhar Date: Tue, 29 Nov 2016 04:13:18 -0800 From: Navdeep Parhar To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305852 - in head/sys: dev/cxgbe dev/cxgbe/firmware modules/cxgbe modules/cxgbe/if_cc modules/cxgbe/if_ccv Message-ID: <20161129121318.GB16760@ox> Mail-Followup-To: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201609160008.u8G08bWr033156@repo.freebsd.org> <20161118160937.GL57876@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161118160937.GL57876@zxy.spb.ru> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:13:24 -0000 On Fri, Nov 18, 2016 at 07:09:37PM +0300, Slawa Olhovchenkov wrote: > On Fri, Sep 16, 2016 at 12:08:37AM +0000, Navdeep Parhar wrote: > > > Author: np > > Date: Fri Sep 16 00:08:37 2016 > > New Revision: 305852 > > URL: https://svnweb.freebsd.org/changeset/base/305852 > > > > Log: > > cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will > > come up as 't6nex' nexus devices with 'cc' ports hanging off them. > > > > The T6 firmware and configuration files will be added as soon as they > > are released. For now the driver will try to work with whatever > > firmware and configuration is on the card's flash. > > > > Sponsored by: Chelsio Communications > > No MFC planed? T6 support will be MFC'd late this week to 11-STABLE and 10-STABLE. Regards, Navdeep From owner-svn-src-head@freebsd.org Tue Nov 29 12:46:43 2016 Return-Path: Delivered-To: svn-src-head@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 E86B8C59FC4; Tue, 29 Nov 2016 12:46:43 +0000 (UTC) (envelope-from andrew@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 A98B51519; Tue, 29 Nov 2016 12:46:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCkgww049138; Tue, 29 Nov 2016 12:46:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCkgO1049137; Tue, 29 Nov 2016 12:46:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611291246.uATCkgO1049137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 29 Nov 2016 12:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309283 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:46:44 -0000 Author: andrew Date: Tue Nov 29 12:46:42 2016 New Revision: 309283 URL: https://svnweb.freebsd.org/changeset/base/309283 Log: Mark the Broadcom code as FDT only, there is no ACPI support for the Raspberry Pi 3. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Nov 29 11:13:43 2016 (r309282) +++ head/sys/conf/files.arm64 Tue Nov 29 12:46:42 2016 (r309283) @@ -49,22 +49,22 @@ arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_fdt.c optional fdt arm/arm/pmu.c standard -arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ +arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq fdt \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_rng.c optional random soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_rng.c optional random soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 arm64/acpica/acpi_machdep.c optional acpi arm64/acpica/OsdEnvironment.c optional acpi From owner-svn-src-head@freebsd.org Tue Nov 29 12:49:21 2016 Return-Path: Delivered-To: svn-src-head@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 D0C0AC5A173; Tue, 29 Nov 2016 12:49:21 +0000 (UTC) (envelope-from kadesai@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 AB50A172B; Tue, 29 Nov 2016 12:49:21 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCnKoA049272; Tue, 29 Nov 2016 12:49:20 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCnK0k049268; Tue, 29 Nov 2016 12:49:20 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291249.uATCnK0k049268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309284 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:49:21 -0000 Author: kadesai Date: Tue Nov 29 12:49:20 2016 New Revision: 309284 URL: https://svnweb.freebsd.org/changeset/base/309284 Log: Problem statement: MFI linked list in megaraid_sas driver is used for mfi-mpt pass-through commands. This list can be corrupted due to many possible race conditions in driver and eventually we may see kernel panic. One example - MFI frame is freed from calling process as driver send command via polling method and interrupt for that command comes after driver free mfi frame (actually even after some other context reuse the mfi frame). When driver receive MPT frame in ISR, driver will be using the index of MFI and access that MFI frame and finally in-used MFI frames list will be corrupted. High level description of new solution - Free MFI and MPT command from same context. Free both the command either from process (from where mfi-mpt pass-through was called) or from ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which will do MFI/MPT list. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:46:42 2016 (r309283) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:49:20 2016 (r309284) @@ -153,7 +153,6 @@ extern void mrsas_cam_detach(struct mrsa extern void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); extern void mrsas_free_frame(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); extern int mrsas_alloc_mfi_cmds(struct mrsas_softc *sc); -extern void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); extern struct mrsas_mpt_cmd *mrsas_get_mpt_cmd(struct mrsas_softc *sc); extern int mrsas_passthru(struct mrsas_softc *sc, void *arg, u_long ioctlCmd); extern uint8_t MR_ValidateMapInfo(struct mrsas_softc *sc); @@ -674,16 +673,14 @@ mrsas_register_aen(struct mrsas_softc *s sc->aen_cmd); if (ret_val) { - printf("mrsas: Failed to abort " - "previous AEN command\n"); + printf("mrsas: Failed to abort previous AEN command\n"); return ret_val; } } } cmd = mrsas_get_mfi_cmd(sc); - if (!cmd) - return -ENOMEM; + return ENOMEM; dcmd = &cmd->frame->dcmd; @@ -953,8 +950,7 @@ mrsas_ich_startup(void *arg) /* * Intialize a counting Semaphore to take care no. of concurrent IOCTLs */ - sema_init(&sc->ioctl_count_sema, - MRSAS_MAX_MFI_CMDS - 5, + sema_init(&sc->ioctl_count_sema, MRSAS_MAX_IOCTL_CMDS, IOCTL_SEMA_DESCRIPTION); /* Create a /dev entry for mrsas controller. */ @@ -1070,7 +1066,7 @@ mrsas_detach(device_t dev) mtx_destroy(&sc->raidmap_lock); /* Wait for all the semaphores to be released */ - while (sema_value(&sc->ioctl_count_sema) != (MRSAS_MAX_MFI_CMDS - 5)) + while (sema_value(&sc->ioctl_count_sema) != MRSAS_MAX_IOCTL_CMDS) pause("mr_shutdown", hz); /* Destroy the counting semaphore created for Ioctl */ @@ -1592,9 +1588,16 @@ mrsas_complete_cmd(struct mrsas_softc *s break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; - mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); - cmd_mpt->flags = 0; - mrsas_release_mpt_cmd(cmd_mpt); + /* + * Make sure NOT TO release the mfi command from the called + * function's context if it is fired with issue_polled call. + * And also make sure that the issue_polled call should only be + * used if INTERRUPT IS DISABLED. + */ + if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + mrsas_release_mfi_cmd(cmd_mfi); + else + mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); break; } @@ -2995,7 +2998,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, if (mpt_cmd->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { mfi_cmd = sc->mfi_cmd_list[mpt_cmd->sync_cmd_idx]; mrsas_release_mfi_cmd(mfi_cmd); - mrsas_release_mpt_cmd(mpt_cmd); } } @@ -3177,17 +3179,33 @@ out: * mrsas_release_mfi_cmd: Return a cmd to free command pool * input: Command packet for return to free cmd pool * - * This function returns the MFI command to the command list. + * This function returns the MFI & MPT command to the command list. */ void -mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd) +mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd_mfi) { - struct mrsas_softc *sc = cmd->sc; + struct mrsas_softc *sc = cmd_mfi->sc; + struct mrsas_mpt_cmd *cmd_mpt; + mtx_lock(&sc->mfi_cmd_pool_lock); - cmd->ccb_ptr = NULL; - cmd->cmd_id.frame_count = 0; - TAILQ_INSERT_TAIL(&(sc->mrsas_mfi_cmd_list_head), cmd, next); + /* + * Release the mpt command (if at all it is allocated + * associated with the mfi command + */ + if (cmd_mfi->cmd_id.context.smid) { + mtx_lock(&sc->mpt_cmd_pool_lock); + /* Get the mpt cmd from mfi cmd frame's smid value */ + cmd_mpt = sc->mpt_cmd_list[cmd_mfi->cmd_id.context.smid-1]; + cmd_mpt->flags = 0; + cmd_mpt->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; + TAILQ_INSERT_HEAD(&(sc->mrsas_mpt_cmd_list_head), cmd_mpt, next); + mtx_unlock(&sc->mpt_cmd_pool_lock); + } + /* Release the mfi command */ + cmd_mfi->ccb_ptr = NULL; + cmd_mfi->cmd_id.frame_count = 0; + TAILQ_INSERT_HEAD(&(sc->mrsas_mfi_cmd_list_head), cmd_mfi, next); mtx_unlock(&sc->mfi_cmd_pool_lock); return; @@ -3253,8 +3271,6 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3869,8 +3885,6 @@ megasas_sync_pd_seq_num(struct mrsas_sof dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3947,8 +3961,6 @@ mrsas_get_ld_map_info(struct mrsas_softc retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3975,9 +3987,8 @@ mrsas_sync_map_info(struct mrsas_softc * cmd = mrsas_get_mfi_cmd(sc); if (!cmd) { - device_printf(sc->mrsas_dev, - "Cannot alloc for sync map info cmd\n"); - return 1; + device_printf(sc->mrsas_dev, "Cannot alloc for sync map info cmd\n"); + return ENOMEM; } map = sc->ld_drv_map[sc->map_id & 1]; num_lds = map->raidMap.ldCount; @@ -4077,7 +4088,11 @@ mrsas_get_pd_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; @@ -4108,7 +4123,8 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else + + if (!sc->mask_interrupts) mrsas_release_mfi_cmd(cmd); return (retcode); @@ -4170,7 +4186,11 @@ mrsas_get_ld_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); dcmd->pad_0 = 0; - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; @@ -4196,7 +4216,7 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else + if (!sc->mask_interrupts) mrsas_release_mfi_cmd(cmd); return (retcode); Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:46:42 2016 (r309283) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:49:20 2016 (r309284) @@ -1256,7 +1256,8 @@ enum MR_EVT_ARGS { #define HOST_DIAG_WRITE_ENABLE 0x80 #define HOST_DIAG_RESET_ADAPTER 0x4 #define MRSAS_TBOLT_MAX_RESET_TRIES 3 -#define MRSAS_MAX_MFI_CMDS 32 +#define MRSAS_MAX_MFI_CMDS 16 +#define MRSAS_MAX_IOCTL_CMDS 3 /* * Invader Defines Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:46:42 2016 (r309283) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:49:20 2016 (r309284) @@ -679,7 +679,7 @@ mrsas_release_mpt_cmd(struct mrsas_mpt_c mtx_lock(&sc->mpt_cmd_pool_lock); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; - TAILQ_INSERT_TAIL(&(sc->mrsas_mpt_cmd_list_head), cmd, next); + TAILQ_INSERT_HEAD(&(sc->mrsas_mpt_cmd_list_head), cmd, next); mtx_unlock(&sc->mpt_cmd_pool_lock); return; From owner-svn-src-head@freebsd.org Tue Nov 29 12:53:07 2016 Return-Path: Delivered-To: svn-src-head@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 76AF5C5A44D; Tue, 29 Nov 2016 12:53:07 +0000 (UTC) (envelope-from kadesai@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 38AE61C93; Tue, 29 Nov 2016 12:53:07 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCr6s0053305; Tue, 29 Nov 2016 12:53:06 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCr6pJ053301; Tue, 29 Nov 2016 12:53:06 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291253.uATCr6pJ053301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309285 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:53:07 -0000 Author: kadesai Date: Tue Nov 29 12:53:05 2016 New Revision: 309285 URL: https://svnweb.freebsd.org/changeset/base/309285 Log: Use a variable to indicate Gen3 controllers and remove all PCI ids based checks used for gen3 controllers. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:53:05 2016 (r309285) @@ -832,6 +832,15 @@ mrsas_attach(device_t dev) sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { + sc->mrsas_gen3_ctrl = 1; + } + mrsas_get_tunables(sc); /* @@ -1632,12 +1641,7 @@ mrsas_complete_cmd(struct mrsas_softc *s */ if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) { if (sc->msix_enable) { - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) + if (sc->mrsas_gen3_ctrl) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1658,12 +1662,7 @@ mrsas_complete_cmd(struct mrsas_softc *s /* Clear response interrupt */ if (sc->msix_enable) { - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -2461,12 +2460,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -3512,12 +3506,7 @@ mrsas_build_mptmfi_passthru(struct mrsas io_req = mpt_cmd->io_request; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:53:05 2016 (r309285) @@ -2795,6 +2795,7 @@ struct mrsas_softc { LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; + u_int8_t mrsas_gen3_ctrl; u_int8_t secure_jbod_support; u_int8_t use_seqnum_jbod_fp; u_int8_t max256vdSupport; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:53:05 2016 (r309285) @@ -877,12 +877,7 @@ mrsas_setup_io(struct mrsas_softc *sc, s cmd->request_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -911,12 +906,7 @@ mrsas_setup_io(struct mrsas_softc *sc, s cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_LD_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -1192,12 +1182,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se io_request = cmd->io_request; sgl_ptr = (pMpi25IeeeSgeChain64_t)&io_request->SGL; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1208,12 +1193,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se sgl_ptr->Address = segs[i].ds_addr; sgl_ptr->Length = segs[i].ds_len; sgl_ptr->Flags = 0; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1223,12 +1203,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se (nseg > sc->max_sge_in_main_msg)) { pMpi25IeeeSgeChain64_t sg_chain; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1237,12 +1212,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se } else cmd->io_request->ChainOffset = sc->chain_offset_io_request; sg_chain = sgl_ptr; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) + if (sc->mrsas_gen3_ctrl) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas_fp.c Tue Nov 29 12:53:05 2016 (r309285) @@ -747,15 +747,6 @@ mr_spanset_get_phy_params(struct mrsas_s u_int64_t *pdBlock = &io_info->pdBlock; u_int16_t *pDevHandle = &io_info->devHandle; u_int32_t logArm, rowMod, armQ, arm; - u_int8_t do_invader = 0; - - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) - do_invader = 1; /* Get row and span from io_info for Uneven Span IO. */ row = io_info->start_row; @@ -782,7 +773,7 @@ mr_spanset_get_phy_params(struct mrsas_s *pDevHandle = MR_PdDevHandleGet(pd, map); else { *pDevHandle = MR_PD_INVALID; - if ((raid->level >= 5) && ((!do_invader) || (do_invader && + if ((raid->level >= 5) && ((!sc->mrsas_gen3_ctrl) || (sc->mrsas_gen3_ctrl && raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE; else if (raid->level == 1) { @@ -965,12 +956,7 @@ MR_BuildRaidContext(struct mrsas_softc * regSize += stripSize; } pRAID_Context->timeoutValue = map->raidMap.fpPdIoTimeoutSec; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) + if (sc->mrsas_gen3_ctrl) pRAID_Context->regLockFlags = (isRead) ? raid->regTypeReqOnRead : raid->regTypeReqOnWrite; else pRAID_Context->regLockFlags = (isRead) ? REGION_TYPE_SHARED_READ : raid->regTypeReqOnWrite; @@ -1453,15 +1439,6 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int64_t *pdBlock = &io_info->pdBlock; u_int16_t *pDevHandle = &io_info->devHandle; u_int32_t rowMod, armQ, arm, logArm; - u_int8_t do_invader = 0; - - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) - do_invader = 1; row = mega_div64_32(stripRow, raid->rowDataSize); @@ -1501,7 +1478,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, *pDevHandle = MR_PdDevHandleGet(pd, map); else { *pDevHandle = MR_PD_INVALID; /* set dev handle as invalid. */ - if ((raid->level >= 5) && ((!do_invader) || (do_invader && + if ((raid->level >= 5) && ((!sc->mrsas_gen3_ctrl) || (sc->mrsas_gen3_ctrl && raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE; else if (raid->level == 1) { From owner-svn-src-head@freebsd.org Tue Nov 29 12:55:02 2016 Return-Path: Delivered-To: svn-src-head@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 CDF31C5A4F4; Tue, 29 Nov 2016 12:55:02 +0000 (UTC) (envelope-from kadesai@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 839CD1E1D; Tue, 29 Nov 2016 12:55:02 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCt1Yb053432; Tue, 29 Nov 2016 12:55:01 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCt1uf053430; Tue, 29 Nov 2016 12:55:01 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291255.uATCt1uf053430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309286 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:55:02 -0000 Author: kadesai Date: Tue Nov 29 12:55:01 2016 New Revision: 309286 URL: https://svnweb.freebsd.org/changeset/base/309286 Log: Add sanity check in IO and IOCTL path not to process command further if controller is in HW_CRITICAL_ERROR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:53:05 2016 (r309285) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:55:01 2016 (r309286) @@ -1359,9 +1359,11 @@ mrsas_ioctl(struct cdev *dev, u_long cmd if (!sc) return ENOENT; - if (sc->remove_in_progress) { + if (sc->remove_in_progress || + (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) { mrsas_dprint(sc, MRSAS_INFO, - "Driver remove or shutdown called.\n"); + "Either driver remove or shutdown called or " + "HW is in unrecoverable critical error state.\n"); return ENOENT; } mtx_lock_spin(&sc->ioctl_lock); Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:53:05 2016 (r309285) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:55:01 2016 (r309286) @@ -260,6 +260,17 @@ mrsas_action(struct cam_sim *sim, union struct ccb_hdr *ccb_h = &(ccb->ccb_h); u_int32_t device_id; + /* + * Check if the system going down + * or the adapter is in unrecoverable critical error + */ + if (sc->remove_in_progress || + (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) { + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + xpt_done(ccb); + return; + } + switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { From owner-svn-src-head@freebsd.org Tue Nov 29 12:56:55 2016 Return-Path: Delivered-To: svn-src-head@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 17BE4C5A5C0; Tue, 29 Nov 2016 12:56:55 +0000 (UTC) (envelope-from kadesai@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 DF0EE1FC3; Tue, 29 Nov 2016 12:56:54 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCusrj053526; Tue, 29 Nov 2016 12:56:54 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCurmi053524; Tue, 29 Nov 2016 12:56:53 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291256.uATCurmi053524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309287 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:56:55 -0000 Author: kadesai Date: Tue Nov 29 12:56:53 2016 New Revision: 309287 URL: https://svnweb.freebsd.org/changeset/base/309287 Log: Update controller properties(read OCR capability bit) when MR_EVT_CTRL_PROP_CHANGED recieved. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:55:01 2016 (r309286) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:56:53 2016 (r309287) @@ -3250,7 +3250,11 @@ mrsas_get_ctrl_info(struct mrsas_softc * dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; else @@ -3261,6 +3265,8 @@ mrsas_get_ctrl_info(struct mrsas_softc * sc->use_seqnum_jbod_fp = sc->ctrl_info->adapterOperations3.useSeqNumJbodFP; + sc->disableOnlineCtrlReset = + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; dcmd_timeout: mrsas_free_ctlr_info_cmd(sc); @@ -3268,6 +3274,9 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + if (!sc->mask_interrupts) + mrsas_release_mfi_cmd(cmd); + return (retcode); } @@ -4379,7 +4388,6 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_1); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_PD_REMOVED: fail_aen = mrsas_get_pd_list(sc); @@ -4387,13 +4395,11 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_1); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_LD_OFFLINE: case MR_EVT_CFG_CLEARED: case MR_EVT_LD_DELETED: mrsas_bus_scan_sim(sc, sc->sim_0); - doscan = 0; break; case MR_EVT_LD_CREATED: fail_aen = mrsas_get_ld_list(sc); @@ -4401,15 +4407,18 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_0); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED: case MR_EVT_FOREIGN_CFG_IMPORTED: case MR_EVT_LD_STATE_CHANGE: doscan = 1; break; + case MR_EVT_CTRL_PROP_CHANGED: + fail_aen = mrsas_get_ctrl_info(sc); + if (fail_aen) + goto skip_register_aen; + break; default: - doscan = 0; break; } } else { Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:55:01 2016 (r309286) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:56:53 2016 (r309287) @@ -1449,6 +1449,7 @@ enum MR_PD_QUERY_TYPE { #define MR_EVT_LD_DELETED 0x008b #define MR_EVT_FOREIGN_CFG_IMPORTED 0x00db #define MR_EVT_LD_OFFLINE 0x00fc +#define MR_EVT_CTRL_PROP_CHANGED 0x012f #define MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED 0x0152 enum MR_PD_STATE { From owner-svn-src-head@freebsd.org Tue Nov 29 12:58:29 2016 Return-Path: Delivered-To: svn-src-head@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 C99F3C5A674; Tue, 29 Nov 2016 12:58:29 +0000 (UTC) (envelope-from kadesai@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 9935A11A1; Tue, 29 Nov 2016 12:58:29 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCwS3X053622; Tue, 29 Nov 2016 12:58:28 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCwSuV053621; Tue, 29 Nov 2016 12:58:28 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291258.uATCwSuV053621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309288 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:58:29 -0000 Author: kadesai Date: Tue Nov 29 12:58:28 2016 New Revision: 309288 URL: https://svnweb.freebsd.org/changeset/base/309288 Log: Clean up reference to AEN command if abort AEN is succesful as the command is aborted. Did the same by setting sc->aen_cmd = NULL when aborting AEN is successful. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:56:53 2016 (r309287) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:58:28 2016 (r309288) @@ -675,7 +675,8 @@ mrsas_register_aen(struct mrsas_softc *s if (ret_val) { printf("mrsas: Failed to abort previous AEN command\n"); return ret_val; - } + } else + sc->aen_cmd = NULL; } } cmd = mrsas_get_mfi_cmd(sc); From owner-svn-src-head@freebsd.org Tue Nov 29 12:59:39 2016 Return-Path: Delivered-To: svn-src-head@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 7D310C5A756; Tue, 29 Nov 2016 12:59:39 +0000 (UTC) (envelope-from kadesai@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 4CBC71346; Tue, 29 Nov 2016 12:59:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCxcuK053701; Tue, 29 Nov 2016 12:59:38 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCxci0053700; Tue, 29 Nov 2016 12:59:38 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291259.uATCxci0053700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309289 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:59:39 -0000 Author: kadesai Date: Tue Nov 29 12:59:38 2016 New Revision: 309289 URL: https://svnweb.freebsd.org/changeset/base/309289 Log: Process outstanding reply descriptors from all the reply descriptor post queues before initiating OCR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:58:28 2016 (r309288) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:59:38 2016 (r309289) @@ -3139,6 +3139,11 @@ mrsas_wait_for_outstanding(struct mrsas_ if (fw_state == MFI_STATE_FAULT) { mrsas_dprint(sc, MRSAS_OCR, "Found FW in FAULT state, will reset adapter.\n"); + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) + mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); retval = 1; goto out; } From owner-svn-src-head@freebsd.org Tue Nov 29 13:01:33 2016 Return-Path: Delivered-To: svn-src-head@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 0A2DFC5A952; Tue, 29 Nov 2016 13:01:33 +0000 (UTC) (envelope-from kadesai@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 ACE9B1702; Tue, 29 Nov 2016 13:01:32 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD1VLK054714; Tue, 29 Nov 2016 13:01:31 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD1VZ6054711; Tue, 29 Nov 2016 13:01:31 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291301.uATD1VZ6054711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309290 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:01:33 -0000 Author: kadesai Date: Tue Nov 29 13:01:31 2016 New Revision: 309290 URL: https://svnweb.freebsd.org/changeset/base/309290 Log: This patch will add task management support in driver. Below is high level description: If a SCSI IO times out, then before initiating OCR, now the driver will try to send a target reset to the particular target for which the IO is timed out. If that also fails, then the driver will initiate OCR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:59:38 2016 (r309289) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:01:31 2016 (r309290) @@ -110,6 +110,7 @@ int mrsas_issue_polled(struct mrsas_soft int mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t reset_reason); int mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_int8_t check_reason); int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); +int mrsas_reset_targets(struct mrsas_softc *sc); int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); @@ -306,28 +307,11 @@ mrsas_enable_intr(struct mrsas_softc *sc static int mrsas_clear_intr(struct mrsas_softc *sc) { - u_int32_t status, fw_status, fw_state; + u_int32_t status; /* Read received interrupt */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); - /* - * If FW state change interrupt is received, write to it again to - * clear - */ - if (status & MRSAS_FW_STATE_CHNG_INTERRUPT) { - fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, - outbound_scratch_pad)); - fw_state = fw_status & MFI_STATE_MASK; - if (fw_state == MFI_STATE_FAULT) { - device_printf(sc->mrsas_dev, "FW is in FAULT state!\n"); - if (sc->ocr_thread_active) - wakeup(&sc->ocr_chan); - } - mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), status); - mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); - return (1); - } /* Not our interrupt, so just return */ if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) return (0); @@ -882,6 +866,7 @@ mrsas_attach(device_t dev) TAILQ_INIT(&sc->mrsas_mfi_cmd_list_head); mrsas_atomic_set(&sc->fw_outstanding, 0); + mrsas_atomic_set(&sc->target_reset_outstanding, 0); sc->io_cmds_highwater = 0; @@ -1556,7 +1541,10 @@ mrsas_complete_cmd(struct mrsas_softc *s PLD_LOAD_BALANCE_INFO lbinfo; u_int32_t device_id; int threshold_reply_count = 0; - +#if TM_DEBUG + MR_TASK_MANAGE_REQUEST *mr_tm_req; + MPI2_SCSI_TASK_MANAGE_REQUEST *mpi_tm_req; +#endif /* If we have a hardware error, not need to continue */ if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) @@ -1583,6 +1571,16 @@ mrsas_complete_cmd(struct mrsas_softc *s extStatus = scsi_io_req->RaidContext.exStatus; switch (scsi_io_req->Function) { + case MPI2_FUNCTION_SCSI_TASK_MGMT: +#if TM_DEBUG + mr_tm_req = (MR_TASK_MANAGE_REQUEST *) cmd_mpt->io_request; + mpi_tm_req = (MPI2_SCSI_TASK_MANAGE_REQUEST *) + &mr_tm_req->TmRequest; + device_printf(sc->mrsas_dev, "TM completion type 0x%X, " + "TaskMID: 0x%X", mpi_tm_req->TaskType, mpi_tm_req->TaskMID); +#endif + wakeup_one((void *)&sc->ocr_chan); + break; case MPI2_FUNCTION_SCSI_IO_REQUEST: /* Fast Path IO. */ device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; @@ -2585,7 +2583,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc memset(cmd, 0, sizeof(struct mrsas_mpt_cmd)); cmd->index = i + 1; cmd->ccb_ptr = NULL; - callout_init(&cmd->cm_callout, 0); + callout_init_mtx(&cmd->cm_callout, &sc->sim_lock, 0); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; cmd->sc = sc; cmd->io_request = (MRSAS_RAID_SCSI_IO_REQUEST *) (io_req_base + offset); @@ -2780,6 +2778,7 @@ mrsas_ocr_thread(void *arg) { struct mrsas_softc *sc; u_int32_t fw_status, fw_state; + u_int8_t tm_target_reset_failed = 0; sc = (struct mrsas_softc *)arg; @@ -2802,20 +2801,57 @@ mrsas_ocr_thread(void *arg) fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; - if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset) { - device_printf(sc->mrsas_dev, "%s started due to %s!\n", - sc->disableOnlineCtrlReset ? "Kill Adapter" : "OCR", - sc->do_timedout_reset ? "IO Timeout" : - "FW fault detected"); - mtx_lock_spin(&sc->ioctl_lock); - sc->reset_in_progress = 1; - sc->reset_count++; - mtx_unlock_spin(&sc->ioctl_lock); + if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset || + mrsas_atomic_read(&sc->target_reset_outstanding)) { + + /* First, freeze further IOs to come to the SIM */ mrsas_xpt_freeze(sc); - mrsas_reset_ctrl(sc, sc->do_timedout_reset); - mrsas_xpt_release(sc); - sc->reset_in_progress = 0; - sc->do_timedout_reset = 0; + + /* If this is an IO timeout then go for target reset */ + if (mrsas_atomic_read(&sc->target_reset_outstanding)) { + device_printf(sc->mrsas_dev, "Initiating Target RESET " + "because of SCSI IO timeout!\n"); + + /* Let the remaining IOs to complete */ + msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, + "mrsas_reset_targets", 5 * hz); + + /* Try to reset the target device */ + if (mrsas_reset_targets(sc) == FAIL) + tm_target_reset_failed = 1; + } + + /* If this is a DCMD timeout or FW fault, + * then go for controller reset + */ + if (fw_state == MFI_STATE_FAULT || tm_target_reset_failed || + (sc->do_timedout_reset == MFI_DCMD_TIMEOUT_OCR)) { + if (tm_target_reset_failed) + device_printf(sc->mrsas_dev, "Initiaiting OCR because of " + "TM FAILURE!\n"); + else + device_printf(sc->mrsas_dev, "Initiaiting OCR " + "because of %s!\n", sc->do_timedout_reset ? + "DCMD IO Timeout" : "FW fault"); + + mtx_lock_spin(&sc->ioctl_lock); + sc->reset_in_progress = 1; + mtx_unlock_spin(&sc->ioctl_lock); + sc->reset_count++; + + /* Try to reset the controller */ + mrsas_reset_ctrl(sc, sc->do_timedout_reset); + + sc->do_timedout_reset = 0; + sc->reset_in_progress = 0; + tm_target_reset_failed = 0; + mrsas_atomic_set(&sc->target_reset_outstanding, 0); + memset(sc->target_reset_pool, 0, + sizeof(sc->target_reset_pool)); + } + + /* Now allow IOs to come to the SIM */ + mrsas_xpt_release(sc); } } mtx_unlock(&sc->sim_lock); Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:59:38 2016 (r309289) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:01:31 2016 (r309290) @@ -205,7 +205,9 @@ typedef struct _RAID_CONTEXT { #define MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD (0x0100) #define MPI2_SCSIIO_EEDPFLAGS_INSERT_OP (0x0004) #define MPI2_FUNCTION_SCSI_IO_REQUEST (0x00) /* SCSI IO */ -#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) +#define MPI2_FUNCTION_SCSI_TASK_MGMT (0x01) +#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x03) +#define MPI2_REQ_DESCRIPT_FLAGS_FP_IO (0x06) #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00) #define MPI2_SGE_FLAGS_64_BIT_ADDRESSING (0x02) #define MPI2_SCSIIO_CONTROL_WRITE (0x01000000) @@ -314,6 +316,91 @@ typedef union { } MPI2_SCSI_IO_CDB_UNION, MPI2_POINTER PTR_MPI2_SCSI_IO_CDB_UNION, Mpi2ScsiIoCdb_t, MPI2_POINTER pMpi2ScsiIoCdb_t; +/**************************************************************************** + * * SCSI Task Management messages + * ****************************************************************************/ + +/*SCSI Task Management Request Message */ +typedef struct _MPI2_SCSI_TASK_MANAGE_REQUEST { + u_int16_t DevHandle; /*0x00 */ + u_int8_t ChainOffset; /*0x02 */ + u_int8_t Function; /*0x03 */ + u_int8_t Reserved1; /*0x04 */ + u_int8_t TaskType; /*0x05 */ + u_int8_t Reserved2; /*0x06 */ + u_int8_t MsgFlags; /*0x07 */ + u_int8_t VP_ID; /*0x08 */ + u_int8_t VF_ID; /*0x09 */ + u_int16_t Reserved3; /*0x0A */ + u_int8_t LUN[8]; /*0x0C */ + u_int32_t Reserved4[7]; /*0x14 */ + u_int16_t TaskMID; /*0x30 */ + u_int16_t Reserved5; /*0x32 */ +} MPI2_SCSI_TASK_MANAGE_REQUEST; + +/*SCSI Task Management Reply Message */ +typedef struct _MPI2_SCSI_TASK_MANAGE_REPLY { + u_int16_t DevHandle; /*0x00 */ + u_int8_t MsgLength; /*0x02 */ + u_int8_t Function; /*0x03 */ + u_int8_t ResponseCode; /*0x04 */ + u_int8_t TaskType; /*0x05 */ + u_int8_t Reserved1; /*0x06 */ + u_int8_t MsgFlags; /*0x07 */ + u_int8_t VP_ID; /*0x08 */ + u_int8_t VF_ID; /*0x09 */ + u_int16_t Reserved2; /*0x0A */ + u_int16_t Reserved3; /*0x0C */ + u_int16_t IOCStatus; /*0x0E */ + u_int32_t IOCLogInfo; /*0x10 */ + u_int32_t TerminationCount; /*0x14 */ + u_int32_t ResponseInfo; /*0x18 */ +} MPI2_SCSI_TASK_MANAGE_REPLY; + +typedef struct _MR_TM_REQUEST { + char request[128]; +} MR_TM_REQUEST; + +typedef struct _MR_TM_REPLY { + char reply[128]; +} MR_TM_REPLY; + +/* SCSI Task Management Request Message */ +typedef struct _MR_TASK_MANAGE_REQUEST { + /*To be type casted to struct MPI2_SCSI_TASK_MANAGE_REQUEST */ + MR_TM_REQUEST TmRequest; + union { + struct { + u_int32_t isTMForLD:1; + u_int32_t isTMForPD:1; + u_int32_t reserved1:30; + u_int32_t reserved2; + } tmReqFlags; + MR_TM_REPLY TMReply; + } uTmReqReply; +} MR_TASK_MANAGE_REQUEST; + +/* TaskType values */ +#define MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01) +#define MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02) +#define MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) +#define MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) +#define MPI2_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) +#define MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) +#define MPI2_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08) +#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_TASK_SET (0x09) +#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT (0x0A) + +/* ResponseCode values */ +#define MPI2_SCSITASKMGMT_RSP_TM_COMPLETE (0x00) +#define MPI2_SCSITASKMGMT_RSP_INVALID_FRAME (0x02) +#define MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04) +#define MPI2_SCSITASKMGMT_RSP_TM_FAILED (0x05) +#define MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08) +#define MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09) +#define MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG (0x0A) +#define MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80) + /* * RAID SCSI IO Request Message Total SGE count will be one less than * _MPI2_SCSI_IO_REQUEST @@ -584,7 +671,7 @@ Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2 #define MAX_RAIDMAP_PHYSICAL_DEVICES (MAX_PHYSICAL_DEVICES) #define MR_DCMD_LD_MAP_GET_INFO 0x0300e101 #define MR_DCMD_SYSTEM_PD_MAP_GET_INFO 0x0200e102 - +#define MR_DCMD_PD_MFI_TASK_MGMT 0x0200e100 #define MRSAS_MAX_PD_CHANNELS 1 #define MRSAS_MAX_LD_CHANNELS 1 @@ -599,7 +686,7 @@ Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2 #define VD_EXT_DEBUG 0 - +#define TM_DEBUG 1 /******************************************************************* * RAID map related structures @@ -659,7 +746,8 @@ typedef struct _MR_LD_RAID { u_int32_t fpWriteAcrossStripe:1; u_int32_t fpReadAcrossStripe:1; u_int32_t fpNonRWCapable:1; - u_int32_t reserved4:7; + u_int32_t tmCapable:1; + u_int32_t reserved4:6; } capability; u_int32_t reserved6; u_int64_t size; @@ -876,7 +964,11 @@ struct IO_REQUEST_INFO { struct MR_PD_CFG_SEQ { u_int16_t seqNum; u_int16_t devHandle; - u_int8_t reserved[4]; + struct { + u_int8_t tmCapable:1; + u_int8_t reserved:7; + } capability; + u_int8_t reserved[3]; } __packed; struct MR_PD_CFG_SEQ_NUM_SYNC { @@ -1396,6 +1488,7 @@ struct mrsas_mpt_cmd { union ccb *ccb_ptr; struct callout cm_callout; struct mrsas_softc *sc; + boolean_t tmCapable; TAILQ_ENTRY(mrsas_mpt_cmd) next; }; @@ -2472,8 +2565,7 @@ struct mrsas_irq_context { enum MEGASAS_OCR_REASON { FW_FAULT_OCR = 0, - SCSIIO_TIMEOUT_OCR = 1, - MFI_DCMD_TIMEOUT_OCR = 2, + MFI_DCMD_TIMEOUT_OCR = 1, }; /* Controller management info added to support Linux Emulator */ @@ -2748,6 +2840,9 @@ struct mrsas_softc { u_int8_t do_timedout_reset; u_int32_t reset_in_progress; u_int32_t reset_count; + mrsas_atomic_t target_reset_outstanding; +#define MRSAS_MAX_TM_TARGETS (MRSAS_MAX_PD + MRSAS_MAX_LD_IDS) + struct mrsas_mpt_cmd *target_reset_pool[MRSAS_MAX_TM_TARGETS]; bus_dma_tag_t jbodmap_tag[2]; bus_dmamap_t jbodmap_dmamap[2]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:59:38 2016 (r309289) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 13:01:31 2016 (r309290) @@ -95,6 +95,11 @@ static void mrsas_freeze_simq(struct mrs static void mrsas_cam_poll(struct cam_sim *sim); static void mrsas_action(struct cam_sim *sim, union ccb *ccb); static void mrsas_scsiio_timeout(void *data); +static int mrsas_track_scsiio(struct mrsas_softc *sc, target_id_t id, u_int32_t bus_id); +static void mrsas_tm_response_code(struct mrsas_softc *sc, + MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply); +static int mrsas_issue_tm(struct mrsas_softc *sc, + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc); static void mrsas_data_load_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); @@ -105,6 +110,10 @@ struct mrsas_mpt_cmd *mrsas_get_mpt_cmd( MRSAS_REQUEST_DESCRIPTOR_UNION * mrsas_get_request_desc(struct mrsas_softc *sc, u_int16_t index); +extern void +mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, + u_int8_t extStatus); +extern int mrsas_reset_targets(struct mrsas_softc *sc); extern u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); extern u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map, @@ -125,6 +134,9 @@ extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); extern int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); +extern MR_LD_RAID *MR_LdRaidGet(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); +extern void mrsas_disable_intr(struct mrsas_softc *sc); +extern void mrsas_enable_intr(struct mrsas_softc *sc); /* @@ -386,6 +398,10 @@ mrsas_scsiio_timeout(void *data) { struct mrsas_mpt_cmd *cmd; struct mrsas_softc *sc; + u_int32_t target_id; + + if (!data) + return; cmd = (struct mrsas_mpt_cmd *)data; sc = cmd->sc; @@ -394,6 +410,7 @@ mrsas_scsiio_timeout(void *data) printf("command timeout with NULL ccb\n"); return; } + /* * Below callout is dummy entry so that it will be cancelled from * mrsas_cmd_done(). Now Controller will go to OCR/Kill Adapter based @@ -401,15 +418,25 @@ mrsas_scsiio_timeout(void *data) * context. */ #if (__FreeBSD_version >= 1000510) - callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 180, 0, mrsas_scsiio_timeout, cmd, 0); #else - callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + callout_reset(&cmd->cm_callout, (180000 * hz) / 1000, mrsas_scsiio_timeout, cmd); #endif - sc->do_timedout_reset = SCSIIO_TIMEOUT_OCR; - if (sc->ocr_thread_active) - wakeup(&sc->ocr_chan); + + if (cmd->ccb_ptr->cpi.bus_id == 0) + target_id = cmd->ccb_ptr->ccb_h.target_id; + else + target_id = (cmd->ccb_ptr->ccb_h.target_id + (MRSAS_MAX_PD - 1)); + + /* Save the cmd to be processed for TM, if it is not there in the array */ + if (sc->target_reset_pool[target_id] == NULL) { + sc->target_reset_pool[target_id] = cmd; + mrsas_atomic_inc(&sc->target_reset_outstanding); + } + + return; } /* @@ -596,10 +623,10 @@ mrsas_startio(struct mrsas_softc *sc, st * Start timer for IO timeout. Default timeout value is 90 second. */ #if (__FreeBSD_version >= 1000510) - callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 180, 0, mrsas_scsiio_timeout, cmd, 0); #else - callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + callout_reset(&cmd->cm_callout, (180000 * hz) / 1000, mrsas_scsiio_timeout, cmd); #endif mrsas_atomic_inc(&sc->fw_outstanding); @@ -788,8 +815,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s struct ccb_scsiio *csio = &(ccb->csio); struct IO_REQUEST_INFO io_info; MR_DRV_RAID_MAP_ALL *map_ptr; + MR_LD_RAID *raid; u_int8_t fp_possible; - u_int32_t start_lba_hi, start_lba_lo, ld_block_size; + u_int32_t start_lba_hi, start_lba_lo, ld_block_size, ld; u_int32_t datalength = 0; start_lba_lo = 0; @@ -868,8 +896,8 @@ mrsas_setup_io(struct mrsas_softc *sc, s map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; ld_block_size = MR_LdBlockSizeGet(device_id, map_ptr, sc); - if ((MR_TargetIdToLdGet(device_id, map_ptr) >= MAX_LOGICAL_DRIVES_EXT) || - (!sc->fast_path_io)) { + ld = MR_TargetIdToLdGet(device_id, map_ptr); + if ((ld >= MAX_LOGICAL_DRIVES_EXT) || (!sc->fast_path_io)) { io_request->RaidContext.regLockFlags = 0; fp_possible = 0; } else { @@ -877,6 +905,10 @@ mrsas_setup_io(struct mrsas_softc *sc, s fp_possible = io_info.fpOkForIo; } + raid = MR_LdRaidGet(ld, map_ptr); + /* Store the TM capability value in cmd */ + cmd->tmCapable = raid->capability.tmCapable; + cmd->request_desc->SCSIIO.MSIxIndex = sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; @@ -886,7 +918,7 @@ mrsas_setup_io(struct mrsas_softc *sc, s start_lba_lo, ld_block_size); io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + (MPI2_REQ_DESCRIPT_FLAGS_FP_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); if (sc->mrsas_gen3_ctrl) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) @@ -948,12 +980,20 @@ mrsas_build_ldio_nonrw(struct mrsas_soft union ccb *ccb) { struct ccb_hdr *ccb_h = &(ccb->ccb_h); - u_int32_t device_id; + u_int32_t device_id, ld; + MR_DRV_RAID_MAP_ALL *map_ptr; + MR_LD_RAID *raid; MRSAS_RAID_SCSI_IO_REQUEST *io_request; io_request = cmd->io_request; device_id = ccb_h->target_id; + map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; + ld = MR_TargetIdToLdGet(device_id, map_ptr); + raid = MR_LdRaidGet(ld, map_ptr); + /* Store the TM capability value in cmd */ + cmd->tmCapable = raid->capability.tmCapable; + /* FW path for LD Non-RW (SCSI management commands) */ io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id; @@ -1003,8 +1043,6 @@ mrsas_build_syspdio(struct mrsas_softc * MRSAS_RAID_SCSI_IO_REQUEST *io_request; struct MR_PD_CFG_SEQ_NUM_SYNC *pd_sync; - pd_sync = (void *)sc->jbodmap_mem[(sc->pd_seq_map_id - 1) & 1]; - io_request = cmd->io_request; device_id = ccb_h->target_id; local_map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; @@ -1018,6 +1056,8 @@ mrsas_build_syspdio(struct mrsas_softc * if (sc->use_seqnum_jbod_fp && sc->pd_list[device_id].driveType == 0x00) { //printf("Using Drv seq num\n"); + pd_sync = (void *)sc->jbodmap_mem[(sc->pd_seq_map_id - 1) & 1]; + cmd->tmCapable = pd_sync->seq[device_id].capability.tmCapable; io_request->RaidContext.VirtualDiskTgtId = device_id + 255; io_request->RaidContext.configSeqNum = pd_sync->seq[device_id].seqNum; io_request->DevHandle = pd_sync->seq[device_id].devHandle; @@ -1066,7 +1106,7 @@ mrsas_build_syspdio(struct mrsas_softc * io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + (MPI2_REQ_DESCRIPT_FLAGS_FP_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } @@ -1276,9 +1316,10 @@ mrsas_xpt_release(struct mrsas_softc *sc void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd) { - callout_stop(&cmd->cm_callout); mrsas_unmap_request(sc, cmd); + mtx_lock(&sc->sim_lock); + callout_stop(&cmd->cm_callout); xpt_done(cmd->ccb_ptr); cmd->ccb_ptr = NULL; mtx_unlock(&sc->sim_lock); @@ -1376,3 +1417,269 @@ mrsas_bus_scan_sim(struct mrsas_softc *s return (0); } + +/* + * mrsas_track_scsiio: Track IOs for a given target in the mpt_cmd_list + * input: Adapter instance soft state + * Target ID of target + * Bus ID of the target + * + * This function checks for any pending IO in the whole mpt_cmd_list pool + * with the bus_id and target_id passed in arguments. If some IO is found + * that means target reset is not successfully completed. + * + * Returns FAIL if IOs pending to the target device, else return SUCCESS + */ +static int +mrsas_track_scsiio(struct mrsas_softc *sc, target_id_t tgt_id, u_int32_t bus_id) +{ + int i; + struct mrsas_mpt_cmd *mpt_cmd = NULL; + + for (i = 0 ; i < sc->max_fw_cmds; i++) { + mpt_cmd = sc->mpt_cmd_list[i]; + + /* + * Check if the target_id and bus_id is same as the timeout IO + */ + if (mpt_cmd->ccb_ptr) { + /* bus_id = 1 denotes a VD */ + if (bus_id == 1) + tgt_id = (mpt_cmd->ccb_ptr->ccb_h.target_id - (MRSAS_MAX_PD - 1)); + + if (mpt_cmd->ccb_ptr->cpi.bus_id == bus_id && + mpt_cmd->ccb_ptr->ccb_h.target_id == tgt_id) { + device_printf(sc->mrsas_dev, + "IO commands pending to target id %d\n", tgt_id); + return FAIL; + } + } + } + + return SUCCESS; +} + +#if TM_DEBUG +/* + * mrsas_tm_response_code: Prints TM response code received from FW + * input: Adapter instance soft state + * MPI reply returned from firmware + * + * Returns nothing. + */ +static void +mrsas_tm_response_code(struct mrsas_softc *sc, + MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply) +{ + char *desc; + + switch (mpi_reply->ResponseCode) { + case MPI2_SCSITASKMGMT_RSP_TM_COMPLETE: + desc = "task management request completed"; + break; + case MPI2_SCSITASKMGMT_RSP_INVALID_FRAME: + desc = "invalid frame"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED: + desc = "task management request not supported"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_FAILED: + desc = "task management request failed"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED: + desc = "task management request succeeded"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN: + desc = "invalid lun"; + break; + case 0xA: + desc = "overlapped tag attempted"; + break; + case MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC: + desc = "task queued, however not sent to target"; + break; + default: + desc = "unknown"; + break; + } + device_printf(sc->mrsas_dev, "response_code(%01x): %s\n", + mpi_reply->ResponseCode, desc); + device_printf(sc->mrsas_dev, + "TerminationCount/DevHandle/Function/TaskType/IOCStat/IOCLoginfo\n" + "0x%x/0x%x/0x%x/0x%x/0x%x/0x%x\n", + mpi_reply->TerminationCount, mpi_reply->DevHandle, + mpi_reply->Function, mpi_reply->TaskType, + mpi_reply->IOCStatus, mpi_reply->IOCLogInfo); +} +#endif + +/* + * mrsas_issue_tm: Fires the TM command to FW and waits for completion + * input: Adapter instance soft state + * reqest descriptor compiled by mrsas_reset_targets + * + * Returns FAIL if TM command TIMEDOUT from FW else SUCCESS. + */ +static int +mrsas_issue_tm(struct mrsas_softc *sc, + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc) +{ + int sleep_stat; + + mrsas_fire_cmd(sc, req_desc->addr.u.low, req_desc->addr.u.high); + sleep_stat = msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, "tm_sleep", 50*hz); + + if (sleep_stat == EWOULDBLOCK) { + device_printf(sc->mrsas_dev, "tm cmd TIMEDOUT\n"); + return FAIL; + } + + return SUCCESS; +} + +/* + * mrsas_reset_targets : Gathers info to fire a target reset command + * input: Adapter instance soft state + * + * This function compiles data for a target reset command to be fired to the FW + * and then traverse the target_reset_pool to see targets with TIMEDOUT IOs. + * + * Returns SUCCESS or FAIL + */ +int mrsas_reset_targets(struct mrsas_softc *sc) +{ + struct mrsas_mpt_cmd *tm_mpt_cmd = NULL; + struct mrsas_mpt_cmd *tgt_mpt_cmd = NULL; + MR_TASK_MANAGE_REQUEST *mr_request; + MPI2_SCSI_TASK_MANAGE_REQUEST *tm_mpi_request; + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; + int retCode = FAIL, count, i, outstanding; + u_int32_t MSIxIndex, bus_id; + target_id_t tgt_id; +#if TM_DEBUG + MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply; +#endif + + outstanding = mrsas_atomic_read(&sc->fw_outstanding); + + if (!outstanding) { + device_printf(sc->mrsas_dev, "NO IOs pending...\n"); + mrsas_atomic_set(&sc->target_reset_outstanding, 0); + retCode = SUCCESS; + goto return_status; + } else if (sc->adprecovery != MRSAS_HBA_OPERATIONAL) { + device_printf(sc->mrsas_dev, "Controller is not operational\n"); + goto return_status; + } else { + /* Some more error checks will be added in future */ + } + + /* Get an mpt frame and an index to fire the TM cmd */ + tm_mpt_cmd = mrsas_get_mpt_cmd(sc); + if (!tm_mpt_cmd) { + retCode = FAIL; + goto return_status; + } + + req_desc = mrsas_get_request_desc(sc, (tm_mpt_cmd->index) - 1); + if (!req_desc) { + device_printf(sc->mrsas_dev, "Cannot get request_descriptor for tm.\n"); + retCode = FAIL; + goto release_mpt; + } + memset(req_desc, 0, sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION)); + + req_desc->HighPriority.SMID = tm_mpt_cmd->index; + req_desc->HighPriority.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + req_desc->HighPriority.MSIxIndex = 0; + req_desc->HighPriority.LMID = 0; + req_desc->HighPriority.Reserved1 = 0; + tm_mpt_cmd->request_desc = req_desc; + + mr_request = (MR_TASK_MANAGE_REQUEST *) tm_mpt_cmd->io_request; + memset(mr_request, 0, sizeof(MR_TASK_MANAGE_REQUEST)); + + tm_mpi_request = (MPI2_SCSI_TASK_MANAGE_REQUEST *) &mr_request->TmRequest; + tm_mpi_request->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; + tm_mpi_request->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; + tm_mpi_request->TaskMID = 0; /* smid task */ + tm_mpi_request->LUN[1] = 0; + + /* Traverse the tm_mpt pool to get valid entries */ + for (i = 0 ; i < MRSAS_MAX_TM_TARGETS; i++) { + if(!sc->target_reset_pool[i]) { + continue; + } else { + tgt_mpt_cmd = sc->target_reset_pool[i]; + } + + tgt_id = i; + + /* See if the target is tm capable or NOT */ + if (!tgt_mpt_cmd->tmCapable) { + device_printf(sc->mrsas_dev, "Task management NOT SUPPORTED for " + "CAM target:%d\n", tgt_id); + + retCode = FAIL; + goto release_mpt; + } + + tm_mpi_request->DevHandle = tgt_mpt_cmd->io_request->DevHandle; + + if (i < (MRSAS_MAX_PD - 1)) { + mr_request->uTmReqReply.tmReqFlags.isTMForPD = 1; + bus_id = 0; + } else { + mr_request->uTmReqReply.tmReqFlags.isTMForLD = 1; + bus_id = 1; + } + + device_printf(sc->mrsas_dev, "TM will be fired for " + "CAM target:%d and bus_id %d\n", tgt_id, bus_id); + + sc->ocr_chan = (void *)&tm_mpt_cmd; + retCode = mrsas_issue_tm(sc, req_desc); + if (retCode == FAIL) + goto release_mpt; + +#if TM_DEBUG + mpi_reply = + (MPI2_SCSI_TASK_MANAGE_REPLY *) &mr_request->uTmReqReply.TMReply; + mrsas_tm_response_code(sc, mpi_reply); +#endif + mrsas_atomic_dec(&sc->target_reset_outstanding); + sc->target_reset_pool[i] = NULL; + + /* Check for pending cmds in the mpt_cmd_pool with the tgt_id */ + mrsas_disable_intr(sc); + /* Wait for 1 second to complete parallel ISR calling same + * mrsas_complete_cmd() + */ + msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, "mrsas_reset_wakeup", + 1 * hz); + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) + mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); + retCode = mrsas_track_scsiio(sc, tgt_id, bus_id); + mrsas_enable_intr(sc); + + if (retCode == FAIL) + goto release_mpt; + } + + device_printf(sc->mrsas_dev, "Number of targets outstanding " + "after reset: %d\n", mrsas_atomic_read(&sc->target_reset_outstanding)); + +release_mpt: + mrsas_release_mpt_cmd(tm_mpt_cmd); +return_status: + device_printf(sc->mrsas_dev, "target reset %s!!\n", + (retCode == SUCCESS) ? "SUCCESS" : "FAIL"); + + return retCode; +} + From owner-svn-src-head@freebsd.org Tue Nov 29 13:02:49 2016 Return-Path: Delivered-To: svn-src-head@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 BAD96C5AA46; Tue, 29 Nov 2016 13:02:49 +0000 (UTC) (envelope-from kadesai@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 7D5FB1A4C; Tue, 29 Nov 2016 13:02:49 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD2mju057707; Tue, 29 Nov 2016 13:02:48 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD2mqi057706; Tue, 29 Nov 2016 13:02:48 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291302.uATD2mqi057706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309291 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:02:49 -0000 Author: kadesai Date: Tue Nov 29 13:02:48 2016 New Revision: 309291 URL: https://svnweb.freebsd.org/changeset/base/309291 Log: Wait for AEN task to be completed(if in queue) before resetting the controller and return without processing event in AEN thread, if controller reset is in progress. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:01:31 2016 (r309290) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:02:48 2016 (r309291) @@ -2839,6 +2839,14 @@ mrsas_ocr_thread(void *arg) mtx_unlock_spin(&sc->ioctl_lock); sc->reset_count++; + /* + * Wait for the AEN task to be completed if it is running. + */ + mtx_unlock(&sc->sim_lock); + taskqueue_drain(sc->ev_tq, &sc->ev_task); + mtx_lock(&sc->sim_lock); + + taskqueue_block(sc->ev_tq); /* Try to reset the controller */ mrsas_reset_ctrl(sc, sc->do_timedout_reset); @@ -2848,6 +2856,7 @@ mrsas_ocr_thread(void *arg) mrsas_atomic_set(&sc->target_reset_outstanding, 0); memset(sc->target_reset_pool, 0, sizeof(sc->target_reset_pool)); + taskqueue_unblock(sc->ev_tq); } /* Now allow IOs to come to the SIM */ @@ -3034,8 +3043,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, } } - sc->aen_cmd = NULL; - /* Reset load balance info */ memset(sc->load_balance_info, 0, sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); @@ -3050,17 +3057,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, megasas_setup_jbod_map(sc); - memset(sc->pd_list, 0, - MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); - if (mrsas_get_pd_list(sc) != SUCCESS) { - device_printf(sc->mrsas_dev, "Get PD list failed from OCR.\n" - "Will get the latest PD LIST after OCR on event.\n"); - } - memset(sc->ld_ids, 0xff, MRSAS_MAX_LD_IDS); - if (mrsas_get_ld_list(sc) != SUCCESS) { - device_printf(sc->mrsas_dev, "Get LD lsit failed from OCR.\n" - "Will get the latest LD LIST after OCR on event.\n"); - } mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; @@ -4422,6 +4418,11 @@ mrsas_aen_handler(struct mrsas_softc *sc printf("invalid instance!\n"); return; } + if (sc->remove_in_progress || sc->reset_in_progress) { + device_printf(sc->mrsas_dev, "Returning from %s, line no %d\n", + __func__, __LINE__); + return; + } if (sc->evt_detail_mem) { switch (sc->evt_detail_mem->code) { case MR_EVT_PD_INSERTED: @@ -4536,8 +4537,7 @@ mrsas_complete_aen(struct mrsas_softc *s sc->aen_cmd = NULL; mrsas_release_mfi_cmd(cmd); - if (!sc->remove_in_progress) - taskqueue_enqueue(sc->ev_tq, &sc->ev_task); + taskqueue_enqueue(sc->ev_tq, &sc->ev_task); return; } From owner-svn-src-head@freebsd.org Tue Nov 29 13:03:44 2016 Return-Path: Delivered-To: svn-src-head@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 DD5F4C5AADF; Tue, 29 Nov 2016 13:03:44 +0000 (UTC) (envelope-from kadesai@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 B811F1BEC; Tue, 29 Nov 2016 13:03:44 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD3hIF057783; Tue, 29 Nov 2016 13:03:43 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD3hUh057780; Tue, 29 Nov 2016 13:03:43 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291303.uATD3hUh057780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309292 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:03:45 -0000 Author: kadesai Date: Tue Nov 29 13:03:43 2016 New Revision: 309292 URL: https://svnweb.freebsd.org/changeset/base/309292 Log: This patch will unblock SYNCHRONIZE_CACHE command to firmware, i.e. don't block the SYNCHRONIZE_CACHE command at driver instead of passing it to firmware for all Gen3 controllers. For Thunderbolt controller, keep the legacy behavior i.e. return the SYNCHRONIZE_CACHE command with success status from driver itself. There is Sysctl parameter 'block_sync_cache' is provided to enable customers either to block/unblock these commands to facilitate legacy behavior if there is a compatibility issue. Default value for module parameter is to unblock this command. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:02:48 2016 (r309291) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:03:43 2016 (r309292) @@ -432,6 +432,11 @@ mrsas_setup_sysctl(struct mrsas_softc *s OID_AUTO, "reset_in_progress", CTLFLAG_RD, &sc->reset_in_progress, 0, "ocr in progress status"); + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "block_sync_cache", CTLFLAG_RW, + &sc->block_sync_cache, 0, + "Block SYNC CACHE at driver. "); + } /* @@ -451,6 +456,7 @@ mrsas_get_tunables(struct mrsas_softc *s sc->mrsas_fw_fault_check_delay = 1; sc->reset_count = 0; sc->reset_in_progress = 0; + sc->block_sync_cache = 0; /* * Grab the global variables. @@ -2438,12 +2444,21 @@ mrsas_ioc_init(struct mrsas_softc *sc) u_int8_t max_wait = MRSAS_IOC_INIT_WAIT_TIME; bus_addr_t phys_addr; int i, retcode = 0; + u_int32_t scratch_pad_2; /* Allocate memory for the IOC INIT command */ if (mrsas_alloc_ioc_cmd(sc)) { device_printf(sc->mrsas_dev, "Cannot allocate IOC command.\n"); return (1); } + + if (!sc->block_sync_cache) { + scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + sc->fw_sync_cache_support = (scratch_pad_2 & + MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; + } + IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:02:48 2016 (r309291) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:03:43 2016 (r309292) @@ -1334,7 +1334,6 @@ enum MR_EVT_ARGS { MR_EVT_ARGS_GENERIC, }; - /* * Thunderbolt (and later) Defines */ @@ -2085,6 +2084,11 @@ struct mrsas_ctrl_info { #define MR_MAX_MSIX_REG_ARRAY 16 /* + * SYNC CACHE offset define + */ +#define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 + +/* * FW reports the maximum of number of commands that it can accept (maximum * commands that can be outstanding) at any time. The driver must report a * lower number to the mid layer because it can issue a few internal commands @@ -2840,6 +2844,8 @@ struct mrsas_softc { u_int8_t do_timedout_reset; u_int32_t reset_in_progress; u_int32_t reset_count; + u_int32_t block_sync_cache; + u_int8_t fw_sync_cache_support; mrsas_atomic_t target_reset_outstanding; #define MRSAS_MAX_TM_TARGETS (MRSAS_MAX_PD + MRSAS_MAX_LD_IDS) struct mrsas_mpt_cmd *target_reset_pool[MRSAS_MAX_TM_TARGETS]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 13:02:48 2016 (r309291) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 13:03:43 2016 (r309292) @@ -459,7 +459,8 @@ mrsas_startio(struct mrsas_softc *sc, st MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; u_int8_t cmd_type; - if ((csio->cdb_io.cdb_bytes[0]) == SYNCHRONIZE_CACHE) { + if ((csio->cdb_io.cdb_bytes[0]) == SYNCHRONIZE_CACHE && + (!sc->fw_sync_cache_support)) { ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); return (0); From owner-svn-src-head@freebsd.org Tue Nov 29 13:04:42 2016 Return-Path: Delivered-To: svn-src-head@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 3DCABC5AB71; Tue, 29 Nov 2016 13:04:42 +0000 (UTC) (envelope-from kadesai@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 F2F811D61; Tue, 29 Nov 2016 13:04:41 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD4fCi057859; Tue, 29 Nov 2016 13:04:41 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD4fmU057858; Tue, 29 Nov 2016 13:04:41 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291304.uATD4fmU057858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309293 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:04:42 -0000 Author: kadesai Date: Tue Nov 29 13:04:40 2016 New Revision: 309293 URL: https://svnweb.freebsd.org/changeset/base/309293 Log: This patch will add code to refire IOCTL commands after OCR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:03:43 2016 (r309292) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:04:40 2016 (r309293) @@ -2927,6 +2927,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd; struct mrsas_mpt_cmd *mpt_cmd; union mrsas_evt_class_locale class_locale; + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) { device_printf(sc->mrsas_dev, @@ -3054,7 +3055,22 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, mpt_cmd = sc->mpt_cmd_list[j]; if (mpt_cmd->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { mfi_cmd = sc->mfi_cmd_list[mpt_cmd->sync_cmd_idx]; - mrsas_release_mfi_cmd(mfi_cmd); + /* If not an IOCTL then release the command else re-fire */ + if (!mfi_cmd->sync_cmd) { + mrsas_release_mfi_cmd(mfi_cmd); + } else { + req_desc = mrsas_get_request_desc(sc, + mfi_cmd->cmd_id.context.smid - 1); + mrsas_dprint(sc, MRSAS_OCR, + "Re-fire command DCMD opcode 0x%x index %d\n ", + mfi_cmd->frame->dcmd.opcode, j); + if (!req_desc) + device_printf(sc->mrsas_dev, + "Cannot build MPT cmd.\n"); + else + mrsas_fire_cmd(sc, req_desc->addr.u.low, + req_desc->addr.u.high); + } } } @@ -3081,6 +3097,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, class_locale.members.locale = MR_EVT_LOCALE_ALL; class_locale.members.class = MR_EVT_CLASS_DEBUG; + mtx_unlock(&sc->sim_lock); if (mrsas_register_aen(sc, sc->last_seq_num, class_locale.word)) { device_printf(sc->mrsas_dev, @@ -3090,6 +3107,8 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, "or the controller does not support AEN.\n" "Please contact to the SUPPORT TEAM if the problem persists\n"); } + mtx_lock(&sc->sim_lock); + /* Adapter reset completed successfully */ device_printf(sc->mrsas_dev, "Reset successful\n"); retval = SUCCESS; @@ -3208,8 +3227,10 @@ mrsas_wait_for_outstanding(struct mrsas_ mrsas_dprint(sc, MRSAS_OCR, "[%2d]waiting for %d " "commands to complete\n", i, outstanding); count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); } DELAY(1000 * 1000); } From owner-svn-src-head@freebsd.org Tue Nov 29 13:05:44 2016 Return-Path: Delivered-To: svn-src-head@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 A9ED3C5ABDC; Tue, 29 Nov 2016 13:05:44 +0000 (UTC) (envelope-from kadesai@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 798041ED6; Tue, 29 Nov 2016 13:05:44 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD5hZK057941; Tue, 29 Nov 2016 13:05:43 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD5hgU057940; Tue, 29 Nov 2016 13:05:43 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291305.uATD5hgU057940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309294 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:05:44 -0000 Author: kadesai Date: Tue Nov 29 13:05:43 2016 New Revision: 309294 URL: https://svnweb.freebsd.org/changeset/base/309294 Log: This patch upgrades driver version to 06.712.04.00-fbsd Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:04:40 2016 (r309293) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:05:43 2016 (r309294) @@ -106,7 +106,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.709.07.00-fbsd" +#define MRSAS_VERSION "06.712.04.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 From owner-svn-src-head@freebsd.org Tue Nov 29 13:11:01 2016 Return-Path: Delivered-To: svn-src-head@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 CEF25C5ADEA; Tue, 29 Nov 2016 13:11:01 +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 8576112EB; Tue, 29 Nov 2016 13:11:01 +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 uATDB0TR058191; Tue, 29 Nov 2016 13:11:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATDB05i058190; Tue, 29 Nov 2016 13:11:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611291311.uATDB05i058190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 29 Nov 2016 13:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309295 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:11:01 -0000 Author: avg Date: Tue Nov 29 13:11:00 2016 New Revision: 309295 URL: https://svnweb.freebsd.org/changeset/base/309295 Log: bhyve: stability and performance improvement for dbgport The TCP server implementation in dbgport does not track clients, so it may try to write to a disconected socket resulting in SIGPIPE. Avoid that by setting SO_NOSIGPIPE socket option. Because dbgport emulates an I/O port to guest, the communication is done byte by byte. Reduce latency of the TCP/IP transfers by using TCP_NODELAY option. In my tests that change improves performance of kgdb commands with lots of output (e.g. info threads) by two orders of magnitude. A general note. Since we have a uart emulation in bhyve, that can be used for the console and gdb access to guests. So, bvmconsole and bvmdebug could be de-orbited now. But there are many existing deployments that still dependend on those. Discussed with: julian, jhb MFC after: 2 weeks Sponsored by: Panzura Modified: head/usr.sbin/bhyve/dbgport.c Modified: head/usr.sbin/bhyve/dbgport.c ============================================================================== --- head/usr.sbin/bhyve/dbgport.c Tue Nov 29 13:05:43 2016 (r309294) +++ head/usr.sbin/bhyve/dbgport.c Tue Nov 29 13:11:00 2016 (r309295) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,8 +56,9 @@ static int dbg_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - char ch; int nwritten, nread, printonce; + int on = 1; + char ch; if (bytes == 2 && in) { *eax = BVM_DBG_SIG; @@ -74,8 +76,16 @@ again: printonce = 1; } conn_fd = accept4(listen_fd, NULL, NULL, SOCK_NONBLOCK); - if (conn_fd < 0 && errno != EINTR) + if (conn_fd >= 0) { + /* Avoid EPIPE after the client drops off. */ + (void)setsockopt(conn_fd, SOL_SOCKET, SO_NOSIGPIPE, + &on, sizeof(on)); + /* Improve latency for one byte at a time tranfers. */ + (void)setsockopt(conn_fd, IPPROTO_TCP, TCP_NODELAY, + &on, sizeof(on)); + } else if (errno != EINTR) { perror("accept"); + } } if (in) { From owner-svn-src-head@freebsd.org Tue Nov 29 13:32:24 2016 Return-Path: Delivered-To: svn-src-head@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 A0A97C5B793; Tue, 29 Nov 2016 13:32:24 +0000 (UTC) (envelope-from andrew@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 7031F1DDE; Tue, 29 Nov 2016 13:32:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATDWNcP069784; Tue, 29 Nov 2016 13:32:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATDWNEf069783; Tue, 29 Nov 2016 13:32:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611291332.uATDWNEf069783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 29 Nov 2016 13:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309296 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:32:24 -0000 Author: andrew Date: Tue Nov 29 13:32:23 2016 New Revision: 309296 URL: https://svnweb.freebsd.org/changeset/base/309296 Log: We only use the cpu0 variable in the FDT code. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Tue Nov 29 13:11:00 2016 (r309295) +++ head/sys/arm64/arm64/mp_machdep.c Tue Nov 29 13:32:23 2016 (r309296) @@ -106,12 +106,14 @@ struct pcb stoppcbs[MAXCPU]; static device_t cpu_list[MAXCPU]; +#ifdef FDT /* * Not all systems boot from the first CPU in the device tree. To work around * this we need to find which CPU we have booted from so when we later * enable the secondary CPUs we skip this one. */ static int cpu0 = -1; +#endif void mpentry(unsigned long cpuid); void init_secondary(uint64_t); From owner-svn-src-head@freebsd.org Tue Nov 29 13:48:37 2016 Return-Path: Delivered-To: svn-src-head@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 86C5BC5BD42; Tue, 29 Nov 2016 13:48:37 +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 316AA151F; Tue, 29 Nov 2016 13:48:37 +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 uATDmaef073975; Tue, 29 Nov 2016 13:48:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATDma5j073974; Tue, 29 Nov 2016 13:48:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611291348.uATDma5j073974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Nov 2016 13:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309297 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:48:37 -0000 Author: mav Date: Tue Nov 29 13:48:36 2016 New Revision: 309297 URL: https://svnweb.freebsd.org/changeset/base/309297 Log: Make SES status updates more aggressive. - On control request update all status pages, since they may also be affected if user enables/disables enclosure slots. - Periodically update element descriptors too, since there is some hardware where they are changed dynamically. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 13:32:23 2016 (r309296) +++ head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 13:48:36 2016 (r309297) @@ -550,6 +550,7 @@ static int ses_set_timed_completion(enc_ static int ses_putstatus(enc_softc_t *, int, struct ses_comstat *); #endif +static void ses_poll_status(enc_softc_t *); static void ses_print_addl_data(enc_softc_t *, enc_element_t *); /*=========================== SES cleanup routines ===========================*/ @@ -1475,11 +1476,7 @@ out: if (err) ses_cache_free(enc, enc_cache); else { - enc_update_request(enc, SES_UPDATE_GETSTATUS); - if (ses->ses_flags & SES_FLAG_DESC) - enc_update_request(enc, SES_UPDATE_GETELMDESCS); - if (ses->ses_flags & SES_FLAG_ADDLSTATUS) - enc_update_request(enc, SES_UPDATE_GETELMADDLSTATUS); + ses_poll_status(enc); enc_update_request(enc, SES_PUBLISH_CACHE); } ENC_DLOG(enc, "%s: exiting with err %d\n", __func__, err); @@ -1869,7 +1866,7 @@ ses_process_control_request(enc_softc_t * o Some SCSI status error. */ ses_terminate_control_requests(&ses->ses_pending_requests, error); - enc_update_request(enc, SES_UPDATE_GETSTATUS); + ses_poll_status(enc); return (0); } @@ -2801,6 +2798,8 @@ ses_poll_status(enc_softc_t *enc) ses = enc->enc_private; enc_update_request(enc, SES_UPDATE_GETSTATUS); + if (ses->ses_flags & SES_FLAG_DESC) + enc_update_request(enc, SES_UPDATE_GETELMDESCS); if (ses->ses_flags & SES_FLAG_ADDLSTATUS) enc_update_request(enc, SES_UPDATE_GETELMADDLSTATUS); } From owner-svn-src-head@freebsd.org Tue Nov 29 18:40:26 2016 Return-Path: Delivered-To: svn-src-head@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 34228C5CD6A; Tue, 29 Nov 2016 18:40:26 +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 DE2991C10; Tue, 29 Nov 2016 18:40:25 +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 uATIePMU089834; Tue, 29 Nov 2016 18:40:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATIeO8R089831; Tue, 29 Nov 2016 18:40:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611291840.uATIeO8R089831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 29 Nov 2016 18:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309298 - in head/lib/msun: arm mips riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 18:40:26 -0000 Author: emaste Date: Tue Nov 29 18:40:24 2016 New Revision: 309298 URL: https://svnweb.freebsd.org/changeset/base/309298 Log: libm: remove duplicate version script entries These symbols already appear in the common lib/msun/Symbol.map. Duplicate entries produce an error with LLVM's LLD linker. Reviewed by: br MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8627 Modified: head/lib/msun/arm/Symbol.map head/lib/msun/mips/Symbol.map head/lib/msun/riscv/Symbol.map Modified: head/lib/msun/arm/Symbol.map ============================================================================== --- head/lib/msun/arm/Symbol.map Tue Nov 29 13:48:36 2016 (r309297) +++ head/lib/msun/arm/Symbol.map Tue Nov 29 18:40:24 2016 (r309298) @@ -5,13 +5,8 @@ FBSD_1.0 { }; FBSD_1.3 { - feclearexcept; - fegetexceptflag; fesetexceptflag; feraiseexcept; - fetestexcept; - fegetround; - fesetround; fegetenv; feholdexcept; feupdateenv; Modified: head/lib/msun/mips/Symbol.map ============================================================================== --- head/lib/msun/mips/Symbol.map Tue Nov 29 13:48:36 2016 (r309297) +++ head/lib/msun/mips/Symbol.map Tue Nov 29 18:40:24 2016 (r309298) @@ -5,13 +5,8 @@ FBSD_1.0 { }; FBSD_1.3 { - feclearexcept; - fegetexceptflag; fesetexceptflag; feraiseexcept; - fetestexcept; - fegetround; - fesetround; fegetenv; feholdexcept; feupdateenv; Modified: head/lib/msun/riscv/Symbol.map ============================================================================== --- head/lib/msun/riscv/Symbol.map Tue Nov 29 13:48:36 2016 (r309297) +++ head/lib/msun/riscv/Symbol.map Tue Nov 29 18:40:24 2016 (r309298) @@ -5,13 +5,8 @@ FBSD_1.0 { }; FBSD_1.3 { - feclearexcept; - fegetexceptflag; fesetexceptflag; feraiseexcept; - fetestexcept; - fegetround; - fesetround; fegetenv; feholdexcept; feupdateenv; From owner-svn-src-head@freebsd.org Tue Nov 29 22:14:44 2016 Return-Path: Delivered-To: svn-src-head@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 6D522C5CC81; Tue, 29 Nov 2016 22:14:44 +0000 (UTC) (envelope-from mm@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 35A0B1AAC; Tue, 29 Nov 2016 22:14:44 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATMEhM8079914; Tue, 29 Nov 2016 22:14:43 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATMEgQH079904; Tue, 29 Nov 2016 22:14:42 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201611292214.uATMEgQH079904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 29 Nov 2016 22:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309300 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar/test lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 22:14:44 -0000 Author: mm Date: Tue Nov 29 22:14:42 2016 New Revision: 309300 URL: https://svnweb.freebsd.org/changeset/base/309300 Log: MFV r309299: Sync libarchive with vendor. Important vendor bugfixes (relevant to FreeBSD): #821: tar -P cannot extract hardlinks through symlinks #825: Add sanity check of tar "uid, "gid" and "mtime" fields PR: 213255 Reported by: Tijl Coosemans MFC after: 1 week Added: head/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_compat_gtar_2.tar.uu head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.c head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.tar.uu head/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_read_format_raw.bufr.uu Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/test/test_compat_gtar.c head/contrib/libarchive/libarchive/test/test_read_format_raw.c head/contrib/libarchive/libarchive/test/test_sparse_basic.c head/contrib/libarchive/tar/test/test_symlink_dir.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/NEWS Tue Nov 29 22:14:42 2016 (r309300) @@ -1,3 +1,5 @@ +Oct 26, 2016: Remove liblzmadec support + Oct 23, 2016: libarchive 3.2.2 released Security release Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_acl.c Tue Nov 29 22:14:42 2016 (r309300) @@ -94,6 +94,7 @@ archive_acl_clear(struct archive_acl *ac acl->acl_text = NULL; } acl->acl_p = NULL; + acl->acl_types = 0; acl->acl_state = 0; /* Not counting. */ } @@ -284,8 +285,11 @@ acl_new_entry(struct archive_acl *acl, aq = NULL; while (ap != NULL) { if (ap->type == type && ap->tag == tag && ap->id == id) { - ap->permset = permset; - return (ap); + if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER && + tag != ARCHIVE_ENTRY_ACL_GROUP)) { + ap->permset = permset; + return (ap); + } } aq = ap; ap = ap->next; Modified: head/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_entry.c Tue Nov 29 22:14:42 2016 (r309300) @@ -1442,6 +1442,15 @@ archive_entry_acl_add_entry_w(struct arc } /* + * Return a bitmask of ACL types in an archive entry ACL list + */ +int +archive_entry_acl_types(struct archive_entry *entry) +{ + return ((&entry->acl)->acl_types); +} + +/* * Return a count of entries matching "want_type". */ int Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_entry.h Tue Nov 29 22:14:42 2016 (r309300) @@ -508,6 +508,9 @@ __LA_DECL const wchar_t *archive_entry_a __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, int /* flags */); +/* Return bitmask of ACL types in an archive entry */ +__LA_DECL int archive_entry_acl_types(struct archive_entry *); + /* Return a count of entries matching 'want_type' */ __LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */); Modified: head/contrib/libarchive/libarchive/archive_entry_acl.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_acl.3 Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_entry_acl.3 Tue Nov 29 22:14:42 2016 (r309300) @@ -33,7 +33,8 @@ .Nm archive_entry_acl_next , .Nm archive_entry_acl_next_w , .Nm archive_entry_acl_reset , -.Nm archive_entry_acl_text_w +.Nm archive_entry_acl_text_w , +.Nm archive_entry_acl_types .Nd functions for manipulating Access Control Lists in archive entry descriptions .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -85,6 +86,8 @@ Streaming Archive Library (libarchive, - .Fn archive_entry_acl_reset "struct archive_entry *a" "int type" .Ft const wchar_t * .Fn archive_entry_acl_text_w "struct archive_entry *a" "int flags" +.Ft int +.Fn archive_entry_acl_types "struct archive_entry *a" .\" enum? .Sh DESCRIPTION An @@ -192,6 +195,11 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4 +ACL entries cannot be mixed, this function is a very efficient way to detect if +an ACL already contains POSIX.1e or NFSv4 ACL entries. .Sh RETURN VALUES .Fn archive_entry_acl_count and @@ -225,6 +233,9 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries. .Sh SEE ALSO .Xr archive_entry 3 .Xr libarchive 3 , Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Nov 29 22:14:42 2016 (r309300) @@ -125,6 +125,10 @@ static int setup_xattrs(struct archive_r struct archive_entry *, int *fd); static int setup_sparse(struct archive_read_disk *, struct archive_entry *, int *fd); +#if defined(HAVE_LINUX_FIEMAP_H) +static int setup_sparse_fiemap(struct archive_read_disk *, + struct archive_entry *, int *fd); +#endif int archive_read_disk_entry_from_file(struct archive *_a, @@ -1124,7 +1128,7 @@ setup_xattrs(struct archive_read_disk *a #if defined(HAVE_LINUX_FIEMAP_H) /* - * Linux sparse interface. + * Linux FIEMAP sparse interface. * * The FIEMAP ioctl returns an "extent" for each physical allocation * on disk. We need to process those to generate a more compact list @@ -1139,7 +1143,7 @@ setup_xattrs(struct archive_read_disk *a */ static int -setup_sparse(struct archive_read_disk *a, +setup_sparse_fiemap(struct archive_read_disk *a, struct archive_entry *entry, int *fd) { char buff[4096]; @@ -1191,7 +1195,7 @@ setup_sparse(struct archive_read_disk *a /* When something error happens, it is better we * should return ARCHIVE_OK because an earlier * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */ - goto exit_setup_sparse; + goto exit_setup_sparse_fiemap; } if (fm->fm_mapped_extents == 0) { if (iters == 0) { @@ -1226,14 +1230,24 @@ setup_sparse(struct archive_read_disk *a } else break; } -exit_setup_sparse: +exit_setup_sparse_fiemap: return (exit_sts); } -#elif defined(SEEK_HOLE) && defined(SEEK_DATA) && defined(_PC_MIN_HOLE_SIZE) +#if !defined(SEEK_HOLE) || !defined(SEEK_DATA) +static int +setup_sparse(struct archive_read_disk *a, + struct archive_entry *entry, int *fd) +{ + return setup_sparse_fiemap(a, entry, fd); +} +#endif +#endif /* defined(HAVE_LINUX_FIEMAP_H) */ + +#if defined(SEEK_HOLE) && defined(SEEK_DATA) /* - * FreeBSD and Solaris sparse interface. + * SEEK_HOLE sparse interface (FreeBSD, Linux, Solaris) */ static int @@ -1241,8 +1255,8 @@ setup_sparse(struct archive_read_disk *a struct archive_entry *entry, int *fd) { int64_t size; - off_t initial_off; /* FreeBSD/Solaris only, so off_t okay here */ - off_t off_s, off_e; /* FreeBSD/Solaris only, so off_t okay here */ + off_t initial_off; + off_t off_s, off_e; int exit_sts = ARCHIVE_OK; int check_fully_sparse = 0; @@ -1268,8 +1282,10 @@ setup_sparse(struct archive_read_disk *a } if (*fd >= 0) { +#ifdef _PC_MIN_HOLE_SIZE if (fpathconf(*fd, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif initial_off = lseek(*fd, 0, SEEK_CUR); if (initial_off != 0) lseek(*fd, 0, SEEK_SET); @@ -1280,8 +1296,10 @@ setup_sparse(struct archive_read_disk *a if (path == NULL) path = archive_entry_pathname(entry); +#ifdef _PC_MIN_HOLE_SIZE if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif *fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (*fd < 0) { archive_set_error(&a->archive, errno, @@ -1292,6 +1310,19 @@ setup_sparse(struct archive_read_disk *a initial_off = 0; } +#ifndef _PC_MIN_HOLE_SIZE + /* Check if the underlying filesystem supports seek hole */ + off_s = lseek(*fd, 0, SEEK_HOLE); + if (off_s < 0) +#if defined(HAVE_LINUX_FIEMAP_H) + return setup_sparse_fiemap(a, entry, fd); +#else + goto exit_setup_sparse; +#endif + else if (off_s > 0) + lseek(*fd, 0, SEEK_SET); +#endif + off_s = 0; size = archive_entry_size(entry); while (off_s < size) { @@ -1341,7 +1372,7 @@ exit_setup_sparse: return (exit_sts); } -#else +#elif !defined(HAVE_LINUX_FIEMAP_H) /* * Generic (stub) sparse support. Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Tue Nov 29 22:14:42 2016 (r309300) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include -#elif HAVE_LZMADEC_H -#include #endif #include "archive.h" @@ -82,19 +80,6 @@ static ssize_t xz_filter_read(struct arc static int xz_filter_close(struct archive_read_filter *); static int xz_lzma_bidder_init(struct archive_read_filter *); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -struct private_data { - lzmadec_stream stream; - unsigned char *out_block; - size_t out_block_size; - int64_t total_out; - char eof; /* True = found end of compressed data. */ -}; - -/* Lzma-only filter */ -static ssize_t lzma_filter_read(struct archive_read_filter *, const void **); -static int lzma_filter_close(struct archive_read_filter *); #endif /* @@ -178,8 +163,6 @@ archive_read_support_filter_lzma(struct bidder->free = NULL; #if HAVE_LZMA_H && HAVE_LIBLZMA return (ARCHIVE_OK); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, "Using external lzma program for lzma decompression"); @@ -763,175 +746,6 @@ xz_filter_close(struct archive_read_filt #else -#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -/* - * If we have the older liblzmadec library, then we can handle - * LZMA streams but not XZ streams. - */ - -/* - * Setup the callbacks. - */ -static int -lzma_bidder_init(struct archive_read_filter *self) -{ - static const size_t out_block_size = 64 * 1024; - void *out_block; - struct private_data *state; - ssize_t ret, avail_in; - - self->code = ARCHIVE_FILTER_LZMA; - self->name = "lzma"; - - state = (struct private_data *)calloc(sizeof(*state), 1); - out_block = (unsigned char *)malloc(out_block_size); - if (state == NULL || out_block == NULL) { - archive_set_error(&self->archive->archive, ENOMEM, - "Can't allocate data for lzma decompression"); - free(out_block); - free(state); - return (ARCHIVE_FATAL); - } - - self->data = state; - state->out_block_size = out_block_size; - state->out_block = out_block; - self->read = lzma_filter_read; - self->skip = NULL; /* not supported */ - self->close = lzma_filter_close; - - /* Prime the lzma library with 18 bytes of input. */ - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 18, &avail_in); - if (state->stream.next_in == NULL) - return (ARCHIVE_FATAL); - state->stream.avail_in = avail_in; - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Initialize compression library. */ - ret = lzmadec_init(&(state->stream)); - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - if (ret == LZMADEC_OK) - return (ARCHIVE_OK); - - /* Library setup failed: Clean up. */ - archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, - "Internal error initializing lzma library"); - - /* Override the error message if we know what really went wrong. */ - switch (ret) { - case LZMADEC_HEADER_ERROR: - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Internal error initializing compression library: " - "invalid header"); - break; - case LZMADEC_MEM_ERROR: - archive_set_error(&self->archive->archive, ENOMEM, - "Internal error initializing compression library: " - "out of memory"); - break; - } - - free(state->out_block); - free(state); - self->data = NULL; - return (ARCHIVE_FATAL); -} - -/* - * Return the next block of decompressed data. - */ -static ssize_t -lzma_filter_read(struct archive_read_filter *self, const void **p) -{ - struct private_data *state; - size_t decompressed; - ssize_t avail_in, ret; - - state = (struct private_data *)self->data; - - /* Empty our output buffer. */ - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Try to fill the output buffer. */ - while (state->stream.avail_out > 0 && !state->eof) { - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 1, &avail_in); - if (state->stream.next_in == NULL && avail_in < 0) { - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "truncated lzma input"); - return (ARCHIVE_FATAL); - } - state->stream.avail_in = avail_in; - - /* Decompress as much as we can in one pass. */ - ret = lzmadec_decode(&(state->stream), avail_in == 0); - switch (ret) { - case LZMADEC_STREAM_END: /* Found end of stream. */ - state->eof = 1; - /* FALL THROUGH */ - case LZMADEC_OK: /* Decompressor made some progress. */ - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - break; - case LZMADEC_BUF_ERROR: /* Insufficient input data? */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Insufficient compressed data"); - return (ARCHIVE_FATAL); - default: - /* Return an error. */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Lzma decompression failed"); - return (ARCHIVE_FATAL); - } - } - - decompressed = state->stream.next_out - state->out_block; - state->total_out += decompressed; - if (decompressed == 0) - *p = NULL; - else - *p = state->out_block; - return (decompressed); -} - -/* - * Clean up the decompressor. - */ -static int -lzma_filter_close(struct archive_read_filter *self) -{ - struct private_data *state; - int ret; - - state = (struct private_data *)self->data; - ret = ARCHIVE_OK; - switch (lzmadec_end(&(state->stream))) { - case LZMADEC_OK: - break; - default: - archive_set_error(&(self->archive->archive), - ARCHIVE_ERRNO_MISC, - "Failed to clean up %s compressor", - self->archive->archive.compression_name); - ret = ARCHIVE_FATAL; - } - - free(state->out_block); - free(state); - return (ret); -} - -#else - /* * * If we have no suitable library on this system, we can't actually do @@ -953,9 +767,6 @@ lzma_bidder_init(struct archive_read_fil return (r); } -#endif /* HAVE_LZMADEC_H */ - - static int xz_bidder_init(struct archive_read_filter *self) { @@ -984,5 +795,4 @@ lzip_bidder_init(struct archive_read_fil return (r); } - #endif /* HAVE_LZMA_H */ Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Nov 29 22:14:42 2016 (r309300) @@ -294,6 +294,46 @@ archive_read_format_tar_cleanup(struct a return (ARCHIVE_OK); } +static int +validate_number_field(const char* p_field, size_t i_size) +{ + unsigned char marker = (unsigned char)p_field[0]; + /* octal? */ + if ((marker >= '0' && marker <= '7') || marker == ' ') { + size_t i = 0; + int octal_found = 0; + for (i = 0; i < i_size; ++i) { + switch (p_field[i]) + { + case ' ': /* skip any leading spaces and trailing space*/ + if (octal_found == 0 || i == i_size - 1) { + continue; + } + break; + case '\0': /* null is allowed only at the end */ + if (i != i_size - 1) { + return 0; + } + break; + /* rest must be octal digits */ + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + ++octal_found; + break; + } + } + return octal_found > 0; + } + /* base 256 (i.e. binary number) */ + else if (marker == 128 || marker == 255 || marker == 0) { + /* nothing to check */ + return 1; + } + /* not a number field */ + else { + return 0; + } +} static int archive_read_format_tar_bid(struct archive_read *a, int best_bid) @@ -346,23 +386,23 @@ archive_read_format_tar_bid(struct archi return (0); bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ - /* Sanity check: Look at first byte of mode field. */ - switch (255 & (unsigned)header->mode[0]) { - case 0: case 255: - /* Base-256 value: No further verification possible! */ - break; - case ' ': /* Not recommended, but not illegal, either. */ - break; - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - /* Octal Value. */ - /* TODO: Check format of remainder of this field. */ - break; - default: - /* Not a valid mode; bail out here. */ - return (0); + /* + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. + * These are usually octal numbers but GNU tar encodes "big" values as + * base256 and leading zeroes are sometimes replaced by spaces. + * Even the null terminator is sometimes omitted. Anyway, must be checked + * to avoid false positives. + */ + if (bid > 0 && + (validate_number_field(header->mode, sizeof(header->mode)) == 0 || + validate_number_field(header->uid, sizeof(header->uid)) == 0 || + validate_number_field(header->gid, sizeof(header->gid)) == 0 || + validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || + validate_number_field(header->size, sizeof(header->size)) == 0 || + validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || + validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { + bid = 0; } - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ return (bid); } Modified: head/contrib/libarchive/libarchive/archive_read_support_format_xar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_xar.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_support_format_xar.c Tue Nov 29 22:14:42 2016 (r309300) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include -#elif HAVE_LZMADEC_H -#include #endif #ifdef HAVE_ZLIB_H #include @@ -334,9 +332,6 @@ struct xar { #if HAVE_LZMA_H && HAVE_LIBLZMA lzma_stream lzstream; int lzstream_valid; -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - lzmadec_stream lzstream; - int lzstream_valid; #endif /* * For Checksum data. @@ -1526,34 +1521,6 @@ decompression_init(struct archive_read * xar->lzstream.total_in = 0; xar->lzstream.total_out = 0; break; -#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC) - case LZMA: - if (xar->lzstream_valid) - lzmadec_end(&(xar->lzstream)); - r = lzmadec_init(&(xar->lzstream)); - if (r != LZMADEC_OK) { - switch (r) { - case LZMADEC_HEADER_ERROR: - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Internal error initializing " - "compression library: " - "invalid header"); - break; - case LZMADEC_MEM_ERROR: - archive_set_error(&a->archive, - ENOMEM, - "Internal error initializing " - "compression library: " - "out of memory"); - break; - } - return (ARCHIVE_FATAL); - } - xar->lzstream_valid = 1; - xar->lzstream.total_in = 0; - xar->lzstream.total_out = 0; - break; #endif /* * Unsupported compression. @@ -1563,9 +1530,7 @@ decompression_init(struct archive_read * case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) -#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC) case LZMA: -#endif case XZ: #endif switch (xar->entry_encoding) { @@ -1685,46 +1650,12 @@ decompress(struct archive_read *a, const *used = avail_in - xar->lzstream.avail_in; *outbytes = avail_out - xar->lzstream.avail_out; break; -#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC) - case LZMA: - xar->lzstream.next_in = (unsigned char *)(uintptr_t)b; - xar->lzstream.avail_in = avail_in; - xar->lzstream.next_out = (unsigned char *)outbuff; - xar->lzstream.avail_out = avail_out; - r = lzmadec_decode(&(xar->lzstream), 0); - switch (r) { - case LZMADEC_STREAM_END: /* Found end of stream. */ - switch (lzmadec_end(&(xar->lzstream))) { - case LZMADEC_OK: - break; - default: - archive_set_error(&(a->archive), - ARCHIVE_ERRNO_MISC, - "Failed to clean up lzmadec decompressor"); - return (ARCHIVE_FATAL); - } - xar->lzstream_valid = 0; - /* FALLTHROUGH */ - case LZMADEC_OK: /* Decompressor made some progress. */ - break; - default: - archive_set_error(&(a->archive), - ARCHIVE_ERRNO_MISC, - "lzmadec decompression failed(%d)", - r); - return (ARCHIVE_FATAL); - } - *used = avail_in - xar->lzstream.avail_in; - *outbytes = avail_out - xar->lzstream.avail_out; - break; #endif #if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) -#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC) case LZMA: -#endif case XZ: #endif case NONE: Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Tue Nov 29 22:14:42 2016 (r309300) @@ -336,14 +336,19 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) -static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); +static void fsobj_error(int *, struct archive_string *, int, const char *, + const char *); +static int check_symlinks_fsobj(char *, int *, struct archive_string *, + int); static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); -static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); +static struct fixup_entry *current_fixup(struct archive_write_disk *, + const char *pathname); #if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *ad); #endif -static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); +static int cleanup_pathname_fsobj(char *, int *, struct archive_string *, + int); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); @@ -374,11 +379,14 @@ static struct archive_vtable *archive_wr static int _archive_write_disk_close(struct archive *); static int _archive_write_disk_free(struct archive *); -static int _archive_write_disk_header(struct archive *, struct archive_entry *); +static int _archive_write_disk_header(struct archive *, + struct archive_entry *); static int64_t _archive_write_disk_filter_bytes(struct archive *, int); static int _archive_write_disk_finish_entry(struct archive *); -static ssize_t _archive_write_disk_data(struct archive *, const void *, size_t); -static ssize_t _archive_write_disk_data_block(struct archive *, const void *, size_t, int64_t); +static ssize_t _archive_write_disk_data(struct archive *, const void *, + size_t); +static ssize_t _archive_write_disk_data_block(struct archive *, const void *, + size_t, int64_t); static int lazy_stat(struct archive_write_disk *a) @@ -649,7 +657,8 @@ _archive_write_disk_header(struct archiv if (a->restore_pwd >= 0) { r = fchdir(a->restore_pwd); if (r != 0) { - archive_set_error(&a->archive, errno, "chdir() failure"); + archive_set_error(&a->archive, errno, + "chdir() failure"); ret = ARCHIVE_FATAL; } close(a->restore_pwd); @@ -697,7 +706,8 @@ _archive_write_disk_header(struct archiv } if (archive_entry_birthtime_is_set(entry)) { fe->birthtime = archive_entry_birthtime(entry); - fe->birthtime_nanos = archive_entry_birthtime_nsec(entry); + fe->birthtime_nanos = archive_entry_birthtime_nsec( + entry); } else { /* If birthtime is unset, use mtime. */ fe->birthtime = fe->mtime; @@ -723,7 +733,8 @@ _archive_write_disk_header(struct archiv return (ARCHIVE_FATAL); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { - memcpy(fe->mac_metadata, metadata, metadata_size); + memcpy(fe->mac_metadata, metadata, + metadata_size); fe->mac_metadata_size = metadata_size; fe->fixup |= TODO_MAC_METADATA; } @@ -1480,7 +1491,8 @@ _archive_write_disk_data_block(struct ar return (r); if ((size_t)r < size) { archive_set_error(&a->archive, 0, - "Too much data: Truncating file at %ju bytes", (uintmax_t)a->filesize); + "Too much data: Truncating file at %ju bytes", + (uintmax_t)a->filesize); return (ARCHIVE_WARN); } #if ARCHIVE_VERSION_NUMBER < 3999000 @@ -2005,8 +2017,9 @@ restore_entry(struct archive_write_disk if (en) { /* Everything failed; give up here. */ - archive_set_error(&a->archive, en, "Can't create '%s'", - a->name); + if ((&a->archive)->error == NULL) + archive_set_error(&a->archive, en, "Can't create '%s'", + a->name); return (ARCHIVE_FAILED); } @@ -2043,19 +2056,32 @@ create_filesystem_object(struct archive_ if (linkname_copy == NULL) { return (EPERM); } - /* TODO: consider using the cleaned-up path as the link target? */ - r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags); + /* + * TODO: consider using the cleaned-up path as the link + * target? + */ + r = cleanup_pathname_fsobj(linkname_copy, &error_number, + &error_string, a->flags); if (r != ARCHIVE_OK) { - archive_set_error(&a->archive, error_number, "%s", error_string.s); + archive_set_error(&a->archive, error_number, "%s", + error_string.s); free(linkname_copy); - /* EPERM is more appropriate than error_number for our callers */ + /* + * EPERM is more appropriate than error_number for our + * callers + */ return (EPERM); } - r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); + r = check_symlinks_fsobj(linkname_copy, &error_number, + &error_string, a->flags); if (r != ARCHIVE_OK) { - archive_set_error(&a->archive, error_number, "%s", error_string.s); + archive_set_error(&a->archive, error_number, "%s", + error_string.s); free(linkname_copy); - /* EPERM is more appropriate than error_number for our callers */ + /* + * EPERM is more appropriate than error_number for our + * callers + */ return (EPERM); } free(linkname_copy); @@ -2076,8 +2102,8 @@ create_filesystem_object(struct archive_ a->todo = 0; a->deferred = 0; } else if (r == 0 && a->filesize > 0) { - a->fd = open(a->name, - O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW); + a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY + | O_CLOEXEC | O_NOFOLLOW); __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; @@ -2388,6 +2414,17 @@ current_fixup(struct archive_write_disk return (a->current_fixup); } +/* Error helper for new *_fsobj functions */ +static void +fsobj_error(int *a_eno, struct archive_string *a_estr, + int err, const char *errstr, const char *path) +{ + if (a_eno) + *a_eno = err; + if (a_estr) + archive_string_sprintf(a_estr, errstr, path); +} + /* * TODO: Someday, integrate this with the deep dir support; they both * scan the path and both can be optimized by comparing against other @@ -2400,7 +2437,8 @@ current_fixup(struct archive_write_disk * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. */ static int -check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) +check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, + int flags) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ @@ -2433,7 +2471,8 @@ check_symlinks_fsobj(char *path, int *er * - if it's a directory and it's not the last chunk, cd into it * As we go: * head points to the current (relative) path - * tail points to the temporary \0 terminating the segment we're currently examining + * tail points to the temporary \0 terminating the segment we're + * currently examining * c holds what used to be in *tail * last is 1 if this is the last tail */ @@ -2455,7 +2494,9 @@ check_symlinks_fsobj(char *path, int *er * Exiting the loop with break is okay; continue is not. */ while (!last) { - /* Skip the separator we just consumed, plus any adjacent ones */ + /* + * Skip the separator we just consumed, plus any adjacent ones + */ while (*tail == '/') ++tail; /* Skip the next path element. */ @@ -2474,19 +2515,20 @@ check_symlinks_fsobj(char *path, int *er if (errno == ENOENT) { break; } else { - /* Treat any other error as fatal - best to be paranoid here - * Note: This effectively disables deep directory - * support when security checks are enabled. - * Otherwise, very long pathnames that trigger - * an error here could evade the sandbox. - * TODO: We could do better, but it would probably - * require merging the symlink checks with the - * deep-directory editing. */ - if (error_number) *error_number = errno; - if (error_string) - archive_string_sprintf(error_string, - "Could not stat %s", - path); + /* + * Treat any other error as fatal - best to be + * paranoid here. + * Note: This effectively disables deep + * directory support when security checks are + * enabled. Otherwise, very long pathnames that + * trigger an error here could evade the + * sandbox. + * TODO: We could do better, but it would + * probably require merging the symlink checks + * with the deep-directory editing. + */ + fsobj_error(a_eno, a_estr, errno, + "Could not stat %s", path); res = ARCHIVE_FAILED; break; } @@ -2494,11 +2536,8 @@ check_symlinks_fsobj(char *path, int *er if (!last) { if (chdir(head) != 0) { tail[0] = c; - if (error_number) *error_number = errno; - if (error_string) - archive_string_sprintf(error_string, - "Could not chdir %s", - path); + fsobj_error(a_eno, a_estr, errno, + "Could not chdir %s", path); res = (ARCHIVE_FATAL); break; } @@ -2514,11 +2553,9 @@ check_symlinks_fsobj(char *path, int *er */ if (unlink(head)) { tail[0] = c; - if (error_number) *error_number = errno; - if (error_string) - archive_string_sprintf(error_string, - "Could not remove symlink %s", - path); + fsobj_error(a_eno, a_estr, errno, + "Could not remove symlink %s", + path); res = ARCHIVE_FAILED; break; } @@ -2529,13 +2566,14 @@ check_symlinks_fsobj(char *path, int *er * symlink with another symlink. */ tail[0] = c; - /* FIXME: not sure how important this is to restore + /* + * FIXME: not sure how important this is to + * restore + */ + /* if (!S_ISLNK(path)) { - if (error_number) *error_number = 0; - if (error_string) - archive_string_sprintf(error_string, - "Removing symlink %s", - path); + fsobj_error(a_eno, a_estr, 0, + "Removing symlink %s", path); } */ /* Symlink gone. No more problem! */ @@ -2545,22 +2583,60 @@ check_symlinks_fsobj(char *path, int *er /* User asked us to remove problems. */ if (unlink(head) != 0) { tail[0] = c; - if (error_number) *error_number = 0; - if (error_string) - archive_string_sprintf(error_string, - "Cannot remove intervening symlink %s", - path); + fsobj_error(a_eno, a_estr, 0, + "Cannot remove intervening " + "symlink %s", path); res = ARCHIVE_FAILED; break; } tail[0] = c; + } else if ((flags & + ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) { + /* + * We are not the last element and we want to + * follow symlinks if they are a directory. + * + * This is needed to extract hardlinks over + * symlinks. + */ + r = stat(head, &st); + if (r != 0) { + tail[0] = c; + if (errno == ENOENT) { + break; + } else { + fsobj_error(a_eno, a_estr, + errno, + "Could not stat %s", path); + res = (ARCHIVE_FAILED); + break; + } + } else if (S_ISDIR(st.st_mode)) { + if (chdir(head) != 0) { + tail[0] = c; + fsobj_error(a_eno, a_estr, + errno, + "Could not chdir %s", path); + res = (ARCHIVE_FATAL); + break; + } + /* + * Our view is now from inside + * this dir: + */ + head = tail + 1; + } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 30 00:26:37 2016 Return-Path: Delivered-To: svn-src-head@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 B4993C5DAA2; Wed, 30 Nov 2016 00:26:37 +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 1F2E61EEC; Wed, 30 Nov 2016 00:26:37 +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 uAU0QaW8032342; Wed, 30 Nov 2016 00:26:36 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU0QaOi032337; Wed, 30 Nov 2016 00:26:36 GMT (envelope-from np@FreeBSD.org) Message-Id: <201611300026.uAU0QaOi032337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 30 Nov 2016 00:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309302 - in head/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware modules/cxgbe modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 00:26:37 -0000 Author: np Date: Wed Nov 30 00:26:35 2016 New Revision: 309302 URL: https://svnweb.freebsd.org/changeset/base/309302 Log: cxgbe(4): Include firmware for T6 cards in the driver. Update all firmwares to 1.16.12.0. Obtained from: Chelsio Communications MFC after: 3 days Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw_cfg.txt (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt (contents, props changed) head/sys/modules/cxgbe/t6_firmware/ head/sys/modules/cxgbe/t6_firmware/Makefile (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt head/sys/dev/cxgbe/t4_main.c head/sys/modules/cxgbe/Makefile head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 30 00:21:57 2016 (r309301) +++ head/sys/conf/files Wed Nov 30 00:26:35 2016 (r309302) @@ -1381,7 +1381,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1405,10 +1405,34 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" +t6fw_cfg.c optional cxgbe \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t6fw_cfg.fw:t6fw_cfg t6fw.fw:t6fw -mt6fw_cfg -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "t6fw_cfg.c" +t6fw_cfg.fwo optional cxgbe \ + dependency "t6fw_cfg.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t6fw_cfg.fwo" +t6fw_cfg.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t6fw_cfg.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t6fw_cfg.fw" +t6fw.fwo optional cxgbe \ + dependency "t6fw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t6fw.fwo" +t6fw.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "t6fw.fw" dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Nov 30 00:21:57 2016 (r309301) +++ head/sys/dev/cxgbe/common/common.h Wed Nov 30 00:26:35 2016 (r309302) @@ -578,7 +578,8 @@ int t4_config_rss_range(struct adapter * int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode, unsigned int flags); int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid, - unsigned int flags, unsigned int defq); + unsigned int flags, unsigned int defq, unsigned int skeyidx, + unsigned int skey); int t4_read_rss(struct adapter *adapter, u16 *entries); void t4_fw_tp_pio_rw(struct adapter *adap, u32 *vals, unsigned int nregs, unsigned int start_index, unsigned int rw); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Nov 30 00:21:57 2016 (r309301) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Nov 30 00:26:35 2016 (r309302) @@ -4754,7 +4754,7 @@ int t4_config_glbl_rss(struct adapter *a c.u.manual.mode_pkd = cpu_to_be32(V_FW_RSS_GLB_CONFIG_CMD_MODE(mode)); } else if (mode == FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL) { - c.u.basicvirtual.mode_pkd = + c.u.basicvirtual.mode_keymode = cpu_to_be32(V_FW_RSS_GLB_CONFIG_CMD_MODE(mode)); c.u.basicvirtual.synmapen_to_hashtoeplitz = cpu_to_be32(flags); } else @@ -4769,11 +4769,14 @@ int t4_config_glbl_rss(struct adapter *a * @viid: the VI id * @flags: RSS flags * @defq: id of the default RSS queue for the VI. + * @skeyidx: RSS secret key table index for non-global mode + * @skey: RSS vf_scramble key for VI. * * Configures VI-specific RSS properties. */ int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid, - unsigned int flags, unsigned int defq) + unsigned int flags, unsigned int defq, unsigned int skeyidx, + unsigned int skey) { struct fw_rss_vi_config_cmd c; @@ -4784,6 +4787,10 @@ int t4_config_vi_rss(struct adapter *ada c.retval_len16 = cpu_to_be32(FW_LEN16(c)); c.u.basicvirtual.defaultq_to_udpen = cpu_to_be32(flags | V_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(defq)); + c.u.basicvirtual.secretkeyidx_pkd = cpu_to_be32( + V_FW_RSS_VI_CONFIG_CMD_SECRETKEYIDX(skeyidx)); + c.u.basicvirtual.secretkeyxor = cpu_to_be32(skey); + return t4_wr_mbox(adapter, mbox, &c, sizeof(c), NULL); } @@ -4902,11 +4909,11 @@ void t4_write_rss_key(struct adapter *ad if (idx >= 0 && idx < rss_key_addr_cnt) { if (rss_key_addr_cnt > 16) t4_write_reg(adap, A_TP_RSS_CONFIG_VRT, - V_KEYWRADDRX(idx >> 4) | + vrt | V_KEYWRADDRX(idx >> 4) | V_T6_VFWRADDR(idx) | F_KEYWREN); else t4_write_reg(adap, A_TP_RSS_CONFIG_VRT, - V_KEYWRADDR(idx) | F_KEYWREN); + vrt| V_KEYWRADDR(idx) | F_KEYWREN); } } @@ -5794,8 +5801,10 @@ const char *t4_get_port_type_description "KR4_100G", "CR4_QSFP", "CR_QSFP", - "CR2_QSFP", + "CR_SFP28", "SFP28", + "KR_SFP28", + "CR2_QSFP", }; if (port_type < ARRAY_SIZE(port_type_description)) Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu Wed Nov 30 00:26:35 2016 (r309302) @@ -0,0 +1,9594 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, 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 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. + */ +begin-base64 644 t4fw +AAAEKQEQDAAAAQkE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I8IAACPOMAfiAgAAJYIAACWOMAfiAgAAJcIAACYuMAfiAgAAJ4IAACeOMA +figgAAJ8IAACguMAfiggAAKYIAHy6eMAfjAgAwAAIAMVhOMCboQgAxWEIAMVhOMChAggAxWIIAbc +NOMChAwgBtxAIAbfsOMGSsQgCAAAIAgOYOMGTjQgCA5gIAkofuMGXJQgCSiAIAkpTOMHdrQgCwAA +IAsAAOMHd4AgCwAAIAsAAOMHd4AgCwAAIAufuOMHd4AAAAAAAAAAAAAAAAAgABOGIAATeCAAF2Ig +ABN4IAAW3SAAE3ggABQqIAAWdSAAFfogABN4IAAVqSAAFWIgABT1IAATZSAAFJ8gABN4IAATeCAA +E3ggABRKAAAAAP///////w/8///w////APwgAKuTIACs+iAArSogAKzwIACssSAArKcgAKxxIACs +ZyAArFYgAKwCIACtKCAAq/ggAKvLIACtKiAAq8EAAAAAARAYAQAEAAAAAAAAAAAAAAAAAAoAAAAK +AAAAFAAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEA +AQACAAMABAAFAAYABwAIAAkACgAOABEAFQAZAB4AIwAtADwAUABkAMgBLAGQAfQAAAAAAAAAAAAA +AAAAAAAAAAAAAQABAAIAAgADAAMAAwADAAQABAAEAAQABAAFAAUABQAFAAUABQAGAAYABwAHAAAA +AgAAAAYAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKA +AAADgAAABQEAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAA +AcAAAAKAAAADgAD/AAECAgAAAAAAAAAAAAAAECBAAAAAAAAAAAAAAAAAAAQAAgABAACAAEAAIAAQ +AAggQIAAAAAAAAAAAAAAAAAAIAipByAIqQcgCKjDIAiokCAIqGIgCKg2IAioNiAIqdAgCKnQIAio +NiAIqdAgCKnQIAioNiAIqDYgCKfrIAip0CAIqdAgCKnQIAip0CAIq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/+sJB/83gAf/600H/+tMB//rdAf/52UH/+w +3B//qjggCwBgH/+vXAAA/4AAAB4gH/+TMB//r2gf/69kH/+vyCALBnAEAAAIBQAAAIP/AACBAAAA +ABAAACoAAAAgAAmsIAMMCB//iZAf/4VAH/+HRB//sKBnRSMB782riZi63P4QMlR2H/+AAAAAPygg +Aw7Mz////yALB2AQAAAAP////wIAAABAAAAA//9//yALCIAf/7CQIAAjuCALCLAgCwkgCAAAAAD/ +//8gCwmQ9////yALC4AgACBg//7//yALFmCAAAAAIAMM4AwAAAAAAEAAAAD//wAAgAD/+///D/aA +ACALGdAgCxoAAAEAAAAEAAAgC3QwH/+t4CAAMnggADRYIAAwECALGpAgAC1AIAsbICALG3AgCxwA +BAEACOAAAAAgCxyAIAscQFMAAAAgCxygUgAAACALHOBRAAAAIAHp3B//qqQgCx9wIAsf0CALH6Ag +CyJQH/+uDCALIqAf/52MH/+tsCALJJAUAAAAgAAAAngAAACAAAAGgACwAAAACgAA4zCS///wAIAA +sQDhAZoAAAIAACALJFAf/5sEAAB+QB//reQA/8AAH/+t8B//k7QBAAAAKAAAACYAAAAgCyTAH/+T +8AYAAAAFgAAAH/+p/CsAAAAgAE04IAt24B//q5gDgAAAB////zUAAAADAAAAAD///4BAAAAID/// +H////yAAAAAAAMAAH/+tyD0AAAAf/5l8BwAAAIEEAQCBBAAAH/+sFAAAOpjDAAAAAAAP/wBDAAAA +AAgABAAAAB//q8wgC3dAH/+zNB//sbAf/5jcAAYAAOEAegAf/5lMH/+t1CCgAAAf/6wsH/+dnB// +nYggC3dwAAMHgCALd+Af/5toACAAAABAAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugANAAAA4AMA +AIP/tgAP////D//4AP8AAAAgC3ggIAsmICALJlAgC3iwAA8AAAAKAAD//wAPA//AAIP/wAAgC3kw +IAt5oB//rrAf/7Ig/2DwAB//sgAf/5LwBIAACB//gFAARAAA/x///wDAAAABgMIAAACBAPAAAACB +gAAA/3///x/84HQf/6jU/7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/hQAAwLDA +2g39NO3GCC3FTgAA+kBoHaAbxQD8AAIdoA0VAFhr3WP/oQAAAAArEhb6QGgdoAwFAO0SGCXYYQAA +WGvWY/+EwKBZoLkc0taPyPn/wciSAJ0AY/+32iBb6/lj+GyKJ40cwMDqrCAu2ASAAFhgzNKg6xIY +KmcCgACjzCvGndEPAAAAAAAA/9+gDaAGBQD/4UgNoAVFAMCgWaCkHNLAj8ge0sH5/8a4kgCdAP/j +8A2gBgUAAAAA/+OUDaALBQDA2g39NP2BBhXv45IAAAAAbBAEFNMlgiAkQn8T0yQEIgwDIgLRDwAA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 30 02:00:31 2016 Return-Path: Delivered-To: svn-src-head@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 45109C5C761; Wed, 30 Nov 2016 02:00: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 14B3F1BD0; Wed, 30 Nov 2016 02:00:31 +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 uAU20Utl069283; Wed, 30 Nov 2016 02:00:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU20UGb069282; Wed, 30 Nov 2016 02:00:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611300200.uAU20UGb069282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Nov 2016 02:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309306 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:00:31 -0000 Author: emaste Date: Wed Nov 30 02:00:30 2016 New Revision: 309306 URL: https://svnweb.freebsd.org/changeset/base/309306 Log: netmap: add cast to fix powerpc64 LINT kernel Attempt to fix powerpc64 LINT kernel broken by r308000. Netmap's use of a uint64_t wchan seems odd, but in the interest of minimizing this change just cast through uintptr_t to silence the compiler warning. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8669 Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Wed Nov 30 01:41:40 2016 (r309305) +++ head/sys/dev/netmap/netmap_freebsd.c Wed Nov 30 02:00:30 2016 (r309306) @@ -1024,7 +1024,7 @@ nm_os_kthread_wakeup_worker(struct nm_kt mtx_lock(&nmk->worker_lock); nmk->scheduled++; if (nmk->worker_ctx.cfg.wchan) { - wakeup((void *)nmk->worker_ctx.cfg.wchan); + wakeup((void *)(uintptr_t)nmk->worker_ctx.cfg.wchan); } mtx_unlock(&nmk->worker_lock); } @@ -1090,8 +1090,8 @@ nm_kthread_worker(void *data) continue; } else if (nmk->run) { /* wait on event with one second timeout */ - msleep_spin((void *)ctx->cfg.wchan, &nmk->worker_lock, - "nmk_ev", hz); + msleep_spin((void *)(uintptr_t)ctx->cfg.wchan, + &nmk->worker_lock, "nmk_ev", hz); nmk->scheduled++; } mtx_unlock(&nmk->worker_lock); From owner-svn-src-head@freebsd.org Wed Nov 30 02:14:54 2016 Return-Path: Delivered-To: svn-src-head@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 DD2F5C5CC81; Wed, 30 Nov 2016 02:14:54 +0000 (UTC) (envelope-from mjg@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 AD18113C4; Wed, 30 Nov 2016 02:14:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU2Erf8077245; Wed, 30 Nov 2016 02:14:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU2Er5q077244; Wed, 30 Nov 2016 02:14:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201611300214.uAU2Er5q077244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 30 Nov 2016 02:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309307 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:14:55 -0000 Author: mjg Date: Wed Nov 30 02:14:53 2016 New Revision: 309307 URL: https://svnweb.freebsd.org/changeset/base/309307 Log: vfs: avoid VOP_ISLOCKED in the common case in lookup Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Nov 30 02:00:30 2016 (r309306) +++ head/sys/kern/vfs_lookup.c Wed Nov 30 02:14:53 2016 (r309307) @@ -807,10 +807,9 @@ unionlookup: * If we have a shared lock we may need to upgrade the lock for the * last operation. */ - if (dp != vp_crossmp && - VOP_ISLOCKED(dp) == LK_SHARED && - (cnp->cn_flags & ISLASTCN) && (cnp->cn_flags & LOCKPARENT)) - vn_lock(dp, LK_UPGRADE|LK_RETRY); + if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) && + dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED) + vn_lock(dp, LK_UPGRADE|LK_RETRY); if ((dp->v_iflag & VI_DOOMED) != 0) { error = ENOENT; goto bad; From owner-svn-src-head@freebsd.org Wed Nov 30 02:17:05 2016 Return-Path: Delivered-To: svn-src-head@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 32822C5CD39; Wed, 30 Nov 2016 02:17:05 +0000 (UTC) (envelope-from mjg@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 0254A15D7; Wed, 30 Nov 2016 02:17:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU2H4Sa077367; Wed, 30 Nov 2016 02:17:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU2H4ht077366; Wed, 30 Nov 2016 02:17:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201611300217.uAU2H4ht077366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 30 Nov 2016 02:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309308 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:17:05 -0000 Author: mjg Date: Wed Nov 30 02:17:03 2016 New Revision: 309308 URL: https://svnweb.freebsd.org/changeset/base/309308 Log: vfs: fix a whitespace nit in r309307 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Nov 30 02:14:53 2016 (r309307) +++ head/sys/kern/vfs_lookup.c Wed Nov 30 02:17:03 2016 (r309308) @@ -809,7 +809,7 @@ unionlookup: */ if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) && dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED) - vn_lock(dp, LK_UPGRADE|LK_RETRY); + vn_lock(dp, LK_UPGRADE|LK_RETRY); if ((dp->v_iflag & VI_DOOMED) != 0) { error = ENOENT; goto bad; From owner-svn-src-head@freebsd.org Wed Nov 30 02:35:53 2016 Return-Path: Delivered-To: svn-src-head@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 24F4BC5C7FF; Wed, 30 Nov 2016 02:35:53 +0000 (UTC) (envelope-from jhibbits@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 E1929121D; Wed, 30 Nov 2016 02:35:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU2ZqMu085003; Wed, 30 Nov 2016 02:35:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU2ZqvM085002; Wed, 30 Nov 2016 02:35:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201611300235.uAU2ZqvM085002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 30 Nov 2016 02:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309309 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:35:53 -0000 Author: jhibbits Date: Wed Nov 30 02:35:51 2016 New Revision: 309309 URL: https://svnweb.freebsd.org/changeset/base/309309 Log: Bring the powerpc DDB disassembler into the 21st century Bring in the most recent copy of NetBSD's db_disasm, to fix bugs and add more instructions. * Fix several bugs in the disassembler, most notably the disassembly of the rlwi* instructions, the original reason for bringing in this change. * Add more registers to the SPR list * Add more instructions to the opcode table Obtained from: NetBSD MFC after: 2 weeks Modified: head/sys/powerpc/powerpc/db_disasm.c Modified: head/sys/powerpc/powerpc/db_disasm.c ============================================================================== --- head/sys/powerpc/powerpc/db_disasm.c Wed Nov 30 02:17:03 2016 (r309308) +++ head/sys/powerpc/powerpc/db_disasm.c Wed Nov 30 02:35:51 2016 (r309309) @@ -1,13 +1,14 @@ -/* $FreeBSD$ */ -/* $NetBSD: db_disasm.c,v 1.12 2002/01/05 22:07:26 jhawk Exp $ */ +/* $NetBSD: db_disasm.c,v 1.28 2013/07/04 23:00:23 joerg Exp $ */ /* $OpenBSD: db_disasm.c,v 1.2 1996/12/28 06:21:48 rahnds Exp $ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include #include -#include #include #include @@ -20,11 +21,13 @@ enum function_mask { Op_B = 0x00000002, Op_BI = 0x00000004, Op_BO = 0x00000008, + Op_BC = Op_BI | Op_BO, Op_CRM = 0x00000010, - Op_D = 0x00000020, /* yes, Op_S and Op_D are the same */ - Op_S = 0x00000020, - Op_FM = 0x00000040, - Op_IMM = 0x00000080, + Op_D = 0x00000020, + Op_ST = 0x00000020, /* Op_S for store-operations, same as D */ + Op_S = 0x00000040, /* S-field is swapped with A-field */ + Op_FM = Op_D | Op_S, /* kludge (reduce Op_s) */ + Op_dA = 0x00000080, Op_LK = 0x00000100, Op_Rc = 0x00000200, Op_AA = Op_LK | Op_Rc, /* kludge (reduce Op_s) */ @@ -37,10 +40,10 @@ enum function_mask { Op_const = 0x00004000, Op_SIMM = Op_const | Op_sign, Op_UIMM = Op_const, - Op_d = Op_const | Op_sign, Op_crbA = 0x00008000, Op_crbB = 0x00010000, Op_WS = Op_crbB, /* kludge, same field as crbB */ + Op_rSH = Op_crbB, /* kludge, same field as crbB */ Op_crbD = 0x00020000, Op_crfD = 0x00040000, Op_crfS = 0x00080000, @@ -50,7 +53,7 @@ enum function_mask { Op_dcr = Op_spr, /* out of bits - cheat with Op_spr */ Op_tbr = 0x00800000, - Op_L = 0x01000000, + Op_BP = 0x01000000, Op_BD = 0x02000000, Op_LI = 0x04000000, Op_C = 0x08000000, @@ -67,7 +70,7 @@ enum function_mask { }; struct opcode { - char *name; + const char *name; u_int32_t mask; u_int32_t code; enum function_mask func; @@ -78,7 +81,7 @@ typedef void (op_class_func) (instr_t, v u_int32_t extract_field(u_int32_t value, u_int32_t base, u_int32_t width); void disasm_fields(const struct opcode *popcode, instr_t instr, vm_offset_t loc, - char *disasm_str); + char *disasm_str, size_t slen); void dis_ppc(const struct opcode *opcodeset, instr_t instr, vm_offset_t loc); op_class_func op_ill, op_base; @@ -89,7 +92,7 @@ op_class_func op_cl_x3e, op_cl_x3f; op_class_func *opcodes_base[] = { /*x00*/ op_ill, op_ill, op_base, op_ill, /*x04*/ op_ill, op_ill, op_ill, op_base, -/*x08*/ op_base, op_base, op_ill, op_base, +/*x08*/ op_base, op_base, op_base, op_base, /*x0C*/ op_base, op_base, op_base/*XXX*/, op_base/*XXX*/, /*x10*/ op_base, op_base, op_base, op_cl_x13, /*x14*/ op_base, op_base, op_ill, op_base, @@ -118,14 +121,16 @@ const struct opcode opcodes[] = { { "twi", 0xfc000000, 0x0c000000, Op_TO | Op_A | Op_SIMM }, { "mulli", 0xfc000000, 0x1c000000, Op_D | Op_A | Op_SIMM }, { "subfic", 0xfc000000, 0x20000000, Op_D | Op_A | Op_SIMM }, - { "cmpli", 0xfc000000, 0x28000000, Op_crfD | Op_L | Op_A | Op_SIMM }, - { "cmpi", 0xfc000000, 0x2c000000, Op_crfD | Op_L | Op_A | Op_SIMM }, + { "cmplwi", 0xfc200000, 0x28000000, Op_crfD | Op_A | Op_SIMM }, + { "cmpldi", 0xfc200000, 0x28200000, Op_crfD | Op_A | Op_SIMM }, + { "cmpwi", 0xfc200000, 0x2c000000, Op_crfD | Op_A | Op_SIMM }, + { "cmpdi", 0xfc200000, 0x2c200000, Op_crfD | Op_A | Op_SIMM }, { "addic", 0xfc000000, 0x30000000, Op_D | Op_A | Op_SIMM }, { "addic.", 0xfc000000, 0x34000000, Op_D | Op_A | Op_SIMM }, { "addi", 0xfc000000, 0x38000000, Op_D | Op_A | Op_SIMM }, { "addis", 0xfc000000, 0x3c000000, Op_D | Op_A | Op_SIMM }, - { "bc", 0xfc000000, 0x40000000, Op_BO | Op_BI | Op_BD | Op_AA | Op_LK }, - { "sc", 0xffffffff, 0x44000002, Op_BO | Op_BI | Op_BD | Op_AA | Op_LK }, + { "b", 0xfc000000, 0x40000000, Op_BC | Op_BD | Op_AA | Op_LK }, /* bc */ + { "sc", 0xffffffff, 0x44000002, 0 }, { "b", 0xfc000000, 0x48000000, Op_LI | Op_AA | Op_LK }, { "rlwimi", 0xfc000000, 0x50000000, Op_S | Op_A | Op_SH | Op_MB | Op_ME | Op_Rc }, @@ -140,33 +145,33 @@ const struct opcode opcodes[] = { { "andi.", 0xfc000000, 0x70000000, Op_S | Op_A | Op_UIMM }, { "andis.", 0xfc000000, 0x74000000, Op_S | Op_A | Op_UIMM }, - { "lwz", 0xfc000000, 0x80000000, Op_D | Op_A | Op_d }, - { "lwzu", 0xfc000000, 0x84000000, Op_D | Op_A | Op_d }, - { "lbz", 0xfc000000, 0x88000000, Op_D | Op_A | Op_d }, - { "lbzu", 0xfc000000, 0x8c000000, Op_D | Op_A | Op_d }, - { "stw", 0xfc000000, 0x90000000, Op_S | Op_A | Op_d }, - { "stwu", 0xfc000000, 0x94000000, Op_S | Op_A | Op_d }, - { "stb", 0xfc000000, 0x98000000, Op_S | Op_A | Op_d }, - { "stbu", 0xfc000000, 0x9c000000, Op_S | Op_A | Op_d }, - - { "lhz", 0xfc000000, 0xa0000000, Op_D | Op_A | Op_d }, - { "lhzu", 0xfc000000, 0xa4000000, Op_D | Op_A | Op_d }, - { "lha", 0xfc000000, 0xa8000000, Op_D | Op_A | Op_d }, - { "lhau", 0xfc000000, 0xac000000, Op_D | Op_A | Op_d }, - { "sth", 0xfc000000, 0xb0000000, Op_S | Op_A | Op_d }, - { "sthu", 0xfc000000, 0xb4000000, Op_S | Op_A | Op_d }, - { "lmw", 0xfc000000, 0xb8000000, Op_D | Op_A | Op_d }, - { "stmw", 0xfc000000, 0xbc000000, Op_S | Op_A | Op_d }, - - { "lfs", 0xfc000000, 0xc0000000, Op_D | Op_A | Op_d }, - { "lfsu", 0xfc000000, 0xc4000000, Op_D | Op_A | Op_d }, - { "lfd", 0xfc000000, 0xc8000000, Op_D | Op_A | Op_d }, - { "lfdu", 0xfc000000, 0xcc000000, Op_D | Op_A | Op_d }, - - { "stfs", 0xfc000000, 0xd0000000, Op_S | Op_A | Op_d }, - { "stfsu", 0xfc000000, 0xd4000000, Op_S | Op_A | Op_d }, - { "stfd", 0xfc000000, 0xd8000000, Op_S | Op_A | Op_d }, - { "stfdu", 0xfc000000, 0xdc000000, Op_S | Op_A | Op_d }, + { "lwz", 0xfc000000, 0x80000000, Op_D | Op_dA }, + { "lwzu", 0xfc000000, 0x84000000, Op_D | Op_dA }, + { "lbz", 0xfc000000, 0x88000000, Op_D | Op_dA }, + { "lbzu", 0xfc000000, 0x8c000000, Op_D | Op_dA }, + { "stw", 0xfc000000, 0x90000000, Op_ST | Op_dA }, + { "stwu", 0xfc000000, 0x94000000, Op_ST | Op_dA }, + { "stb", 0xfc000000, 0x98000000, Op_ST | Op_dA }, + { "stbu", 0xfc000000, 0x9c000000, Op_ST | Op_dA }, + + { "lhz", 0xfc000000, 0xa0000000, Op_D | Op_dA }, + { "lhzu", 0xfc000000, 0xa4000000, Op_D | Op_dA }, + { "lha", 0xfc000000, 0xa8000000, Op_D | Op_dA }, + { "lhau", 0xfc000000, 0xac000000, Op_D | Op_dA }, + { "sth", 0xfc000000, 0xb0000000, Op_ST | Op_dA }, + { "sthu", 0xfc000000, 0xb4000000, Op_ST | Op_dA }, + { "lmw", 0xfc000000, 0xb8000000, Op_D | Op_dA }, + { "stmw", 0xfc000000, 0xbc000000, Op_ST | Op_dA }, + + { "lfs", 0xfc000000, 0xc0000000, Op_D | Op_dA }, + { "lfsu", 0xfc000000, 0xc4000000, Op_D | Op_dA }, + { "lfd", 0xfc000000, 0xc8000000, Op_D | Op_dA }, + { "lfdu", 0xfc000000, 0xcc000000, Op_D | Op_dA }, + + { "stfs", 0xfc000000, 0xd0000000, Op_ST | Op_dA }, + { "stfsu", 0xfc000000, 0xd4000000, Op_ST | Op_dA }, + { "stfd", 0xfc000000, 0xd8000000, Op_ST | Op_dA }, + { "stfdu", 0xfc000000, 0xdc000000, Op_ST | Op_dA }, { "", 0x0, 0x0, 0 } }; @@ -174,10 +179,10 @@ const struct opcode opcodes[] = { const struct opcode opcodes_13[] = { /* 0x13 << 2 */ { "mcrf", 0xfc0007fe, 0x4c000000, Op_crfD | Op_crfS }, - { "bclr", 0xfc0007fe, 0x4c000020, Op_BO | Op_BI | Op_LK }, + { "b", 0xfc0007fe, 0x4c000020, Op_BC | Op_LK }, /* bclr */ { "crnor", 0xfc0007fe, 0x4c000042, Op_crbD | Op_crbA | Op_crbB }, { "rfi", 0xfc0007fe, 0x4c000064, 0 }, - { "crandc", 0xfc0007fe, 0x4c000102, Op_BO | Op_BI | Op_LK }, + { "crandc", 0xfc0007fe, 0x4c000102, Op_crbD | Op_crbA | Op_crbB }, { "isync", 0xfc0007fe, 0x4c00012c, 0 }, { "crxor", 0xfc0007fe, 0x4c000182, Op_crbD | Op_crbA | Op_crbB }, { "crnand", 0xfc0007fe, 0x4c0001c2, Op_crbD | Op_crbA | Op_crbB }, @@ -185,7 +190,7 @@ const struct opcode opcodes_13[] = { { "creqv", 0xfc0007fe, 0x4c000242, Op_crbD | Op_crbA | Op_crbB }, { "crorc", 0xfc0007fe, 0x4c000342, Op_crbD | Op_crbA | Op_crbB }, { "cror", 0xfc0007fe, 0x4c000382, Op_crbD | Op_crbA | Op_crbB }, - { "bcctr", 0xfc0007fe, 0x4c000420, Op_BO | Op_BI | Op_LK }, + { "b", 0xfc0007fe, 0x4c000420, Op_BC | Op_LK }, /* bcctr */ { "", 0x0, 0x0, 0 } }; @@ -203,12 +208,16 @@ const struct opcode opcodes_1e[] = { /* 1f * 4 = 7c */ const struct opcode opcodes_1f[] = { /* 1f << 2 */ - { "cmp", 0xfc0007fe, 0x7c000000, Op_S | Op_A | Op_B | Op_me | Op_Rc }, + { "cmpw", 0xfc2007fe, 0x7c000000, Op_crfD | Op_A | Op_B }, + { "cmpd", 0xfc2007fe, 0x7c200000, Op_crfD | Op_A | Op_B }, { "tw", 0xfc0007fe, 0x7c000008, Op_TO | Op_A | Op_B }, { "subfc", 0xfc0003fe, 0x7c000010, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mulhdu", 0xfc0007fe, 0x7c000012, Op_D | Op_A | Op_B | Op_Rc }, { "addc", 0xfc0003fe, 0x7c000014, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mulhwu", 0xfc0007fe, 0x7c000016, Op_D | Op_A | Op_B | Op_Rc }, + { "isellt", 0xfc0007ff, 0x7c00001e, Op_D | Op_A | Op_B }, + { "iselgt", 0xfc0007ff, 0x7c00005e, Op_D | Op_A | Op_B }, + { "iseleq", 0xfc0007ff, 0x7c00009e, Op_D | Op_A | Op_B }, { "mfcr", 0xfc0007fe, 0x7c000026, Op_D }, { "lwarx", 0xfc0007fe, 0x7c000028, Op_D | Op_A | Op_B }, @@ -218,7 +227,8 @@ const struct opcode opcodes_1f[] = { { "cntlzw", 0xfc0007fe, 0x7c000034, Op_D | Op_A | Op_Rc }, { "sld", 0xfc0007fe, 0x7c000036, Op_D | Op_A | Op_B | Op_Rc }, { "and", 0xfc0007fe, 0x7c000038, Op_D | Op_A | Op_B | Op_Rc }, - { "cmpl", 0xfc0007fe, 0x7c000040, Op_crfD | Op_L | Op_A | Op_B }, + { "cmplw", 0xfc2007fe, 0x7c000040, Op_crfD | Op_A | Op_B }, + { "cmpld", 0xfc2007fe, 0x7c200040, Op_crfD | Op_A | Op_B }, { "subf", 0xfc0003fe, 0x7c000050, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "ldux", 0xfc0007fe, 0x7c00006a, Op_D | Op_A | Op_B }, { "dcbst", 0xfc0007fe, 0x7c00006c, Op_A | Op_B }, @@ -240,24 +250,24 @@ const struct opcode opcodes_1f[] = { { "adde", 0xfc0003fe, 0x7c000114, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mtcrf", 0xfc0007fe, 0x7c000120, Op_S | Op_CRM }, { "mtmsr", 0xfc0007fe, 0x7c000124, Op_S }, - { "stdx", 0xfc0007fe, 0x7c00012a, Op_S | Op_A | Op_B }, - { "stwcx.", 0xfc0007ff, 0x7c00012d, Op_S | Op_A | Op_B }, - { "stwx", 0xfc0007fe, 0x7c00012e, Op_S | Op_A | Op_B }, - { "wrteei", 0xfc0003fe, 0x7c000146 }, /* XXX: out of flags! */ - { "stdux", 0xfc0007fe, 0x7c00016a, Op_S | Op_A | Op_B }, - { "stwux", 0xfc0007fe, 0x7c00016e, Op_S | Op_A | Op_B }, + { "stdx", 0xfc0007fe, 0x7c00012a, Op_ST | Op_A | Op_B }, + { "stwcx.", 0xfc0007ff, 0x7c00012d, Op_ST | Op_A | Op_B }, + { "stwx", 0xfc0007fe, 0x7c00012e, Op_ST | Op_A | Op_B }, + { "wrteei", 0xfc0003fe, 0x7c000146, 0 }, /* XXX: out of flags! */ + { "stdux", 0xfc0007fe, 0x7c00016a, Op_ST | Op_A | Op_B }, + { "stwux", 0xfc0007fe, 0x7c00016e, Op_ST | Op_A | Op_B }, { "subfze", 0xfc0003fe, 0x7c000190, Op_D | Op_A | Op_OE | Op_Rc }, { "addze", 0xfc0003fe, 0x7c000194, Op_D | Op_A | Op_OE | Op_Rc }, { "mtsr", 0xfc0007fe, 0x7c0001a4, Op_S | Op_SR }, - { "stdcx.", 0xfc0007ff, 0x7c0001ad, Op_S | Op_A | Op_B }, - { "stbx", 0xfc0007fe, 0x7c0001ae, Op_S | Op_A | Op_B }, + { "stdcx.", 0xfc0007ff, 0x7c0001ad, Op_ST | Op_A | Op_B }, + { "stbx", 0xfc0007fe, 0x7c0001ae, Op_ST | Op_A | Op_B }, { "subfme", 0xfc0003fe, 0x7c0001d0, Op_D | Op_A | Op_OE | Op_Rc }, { "mulld", 0xfc0003fe, 0x7c0001d2, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "addme", 0xfc0003fe, 0x7c0001d4, Op_D | Op_A | Op_OE | Op_Rc }, { "mullw", 0xfc0003fe, 0x7c0001d6, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mtsrin", 0xfc0007fe, 0x7c0001e4, Op_S | Op_B }, { "dcbtst", 0xfc0007fe, 0x7c0001ec, Op_A | Op_B }, - { "stbux", 0xfc0007fe, 0x7c0001ee, Op_S | Op_A | Op_B }, + { "stbux", 0xfc0007fe, 0x7c0001ee, Op_ST | Op_A | Op_B }, { "add", 0xfc0003fe, 0x7c000214, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "dcbt", 0xfc0007fe, 0x7c00022c, Op_A | Op_B }, { "lhzx", 0xfc0007ff, 0x7c00022e, Op_D | Op_A | Op_B }, @@ -274,11 +284,11 @@ const struct opcode opcodes_1f[] = { { "mftb", 0xfc0007fe, 0x7c0002e6, Op_D | Op_tbr }, { "lwaux", 0xfc0007fe, 0x7c0002ea, Op_D | Op_A | Op_B }, { "lhaux", 0xfc0007fe, 0x7c0002ee, Op_D | Op_A | Op_B }, - { "sthx", 0xfc0007fe, 0x7c00032e, Op_S | Op_A | Op_B }, + { "sthx", 0xfc0007fe, 0x7c00032e, Op_ST | Op_A | Op_B }, { "orc", 0xfc0007fe, 0x7c000338, Op_S | Op_A | Op_B | Op_Rc }, - { "ecowx", 0xfc0007fe, 0x7c00036c, Op_S | Op_A | Op_B | Op_Rc }, + { "ecowx", 0xfc0007fe, 0x7c00036c, Op_ST | Op_A | Op_B | Op_Rc }, { "slbie", 0xfc0007fc, 0x7c000364, Op_B }, - { "sthux", 0xfc0007fe, 0x7c00036e, Op_S | Op_A | Op_B }, + { "sthux", 0xfc0007fe, 0x7c00036e, Op_ST | Op_A | Op_B }, { "or", 0xfc0007fe, 0x7c000378, Op_S | Op_A | Op_B | Op_Rc }, { "mtdcr", 0xfc0007fe, 0x7c000386, Op_S | Op_dcr }, { "divdu", 0xfc0003fe, 0x7c000392, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, @@ -304,27 +314,27 @@ const struct opcode opcodes_1f[] = { { "lfdx", 0xfc0007fe, 0x7c0004ae, Op_D | Op_A | Op_B }, { "lfdux", 0xfc0007fe, 0x7c0004ee, Op_D | Op_A | Op_B }, { "mfsrin", 0xfc0007fe, 0x7c000526, Op_D | Op_B }, - { "stswx", 0xfc0007fe, 0x7c00052a, Op_S | Op_A | Op_B }, - { "stwbrx", 0xfc0007fe, 0x7c00052c, Op_S | Op_A | Op_B }, - { "stfsx", 0xfc0007fe, 0x7c00052e, Op_S | Op_A | Op_B }, - { "stfsux", 0xfc0007fe, 0x7c00056e, Op_S | Op_A | Op_B }, - { "stswi", 0xfc0007fe, 0x7c0005aa, Op_S | Op_A | Op_NB }, - { "stfdx", 0xfc0007fe, 0x7c0005ae, Op_S | Op_A | Op_B }, - { "stfdux", 0xfc0007fe, 0x7c0005ee, Op_S | Op_A | Op_B }, + { "stswx", 0xfc0007fe, 0x7c00052a, Op_ST | Op_A | Op_B }, + { "stwbrx", 0xfc0007fe, 0x7c00052c, Op_ST | Op_A | Op_B }, + { "stfsx", 0xfc0007fe, 0x7c00052e, Op_ST | Op_A | Op_B }, + { "stfsux", 0xfc0007fe, 0x7c00056e, Op_ST | Op_A | Op_B }, + { "stswi", 0xfc0007fe, 0x7c0005aa, Op_ST | Op_A | Op_NB }, + { "stfdx", 0xfc0007fe, 0x7c0005ae, Op_ST | Op_A | Op_B }, + { "stfdux", 0xfc0007fe, 0x7c0005ee, Op_ST | Op_A | Op_B }, { "lhbrx", 0xfc0007fe, 0x7c00062c, Op_D | Op_A | Op_B }, { "sraw", 0xfc0007fe, 0x7c000630, Op_S | Op_A | Op_B }, { "srad", 0xfc0007fe, 0x7c000634, Op_S | Op_A | Op_B | Op_Rc }, - { "srawi", 0xfc0007fe, 0x7c000670, Op_S | Op_A | Op_B | Op_Rc }, + { "srawi", 0xfc0007fe, 0x7c000670, Op_S | Op_A | Op_rSH | Op_Rc }, { "sradi", 0xfc0007fc, 0x7c000674, Op_S | Op_A | Op_sh }, { "eieio", 0xfc0007fe, 0x7c0006ac, 0 }, { "tlbsx", 0xfc0007fe, 0x7c000724, Op_S | Op_A | Op_B | Op_Rc }, - { "sthbrx", 0xfc0007fe, 0x7c00072c, Op_S | Op_A | Op_B }, - { "extsh", 0xfc0007fe, 0x7c000734, Op_S | Op_A | Op_B | Op_Rc }, + { "sthbrx", 0xfc0007fe, 0x7c00072c, Op_ST | Op_A | Op_B }, + { "extsh", 0xfc0007fe, 0x7c000734, Op_S | Op_A | Op_Rc }, { "tlbre", 0xfc0007fe, 0x7c000764, Op_D | Op_A | Op_WS }, { "extsb", 0xfc0007fe, 0x7c000774, Op_S | Op_A | Op_Rc }, { "icbi", 0xfc0007fe, 0x7c0007ac, Op_A | Op_B }, { "tlbwe", 0xfc0007fe, 0x7c0007a4, Op_S | Op_A | Op_WS }, - { "stfiwx", 0xfc0007fe, 0x7c0007ae, Op_S | Op_A | Op_B }, + { "stfiwx", 0xfc0007fe, 0x7c0007ae, Op_ST | Op_A | Op_B }, { "extsw", 0xfc0007fe, 0x7c0007b4, Op_S | Op_A | Op_Rc }, { "dcbz", 0xfc0007fe, 0x7c0007ec, Op_A | Op_B }, { "", 0x0, 0x0, 0 } @@ -354,8 +364,8 @@ const struct opcode opcodes_3b[] = { }; /* 3e * 4 = f8 */ const struct opcode opcodes_3e[] = { - { "std", 0xfc000003, 0xf8000000, Op_S | Op_A | Op_ds }, - { "stdu", 0xfc000003, 0xf8000001, Op_S | Op_A | Op_ds }, + { "std", 0xfc000003, 0xf8000000, Op_ST | Op_A | Op_ds }, + { "stdu", 0xfc000003, 0xf8000001, Op_ST | Op_A | Op_ds }, { "", 0x0, 0x0, 0 } }; @@ -384,7 +394,7 @@ const struct opcode opcodes_3f[] = { { "mcrfs", 0xfc0007fe, 0xfc000080, Op_D | Op_B | Op_Rc }, { "mtfsb0", 0xfc0007fe, 0xfc00008c, Op_crfD | Op_Rc }, { "fmr", 0xfc0007fe, 0xfc000090, Op_D | Op_B | Op_Rc }, - { "mtfsfi", 0xfc0007fe, 0xfc00010c, Op_crfD | Op_IMM | Op_Rc }, + { "mtfsfi", 0xfc0007fe, 0xfc00010c, 0 }, /* XXX: out of flags! */ { "fnabs", 0xfc0007fe, 0xfc000110, Op_D | Op_B | Op_Rc }, { "fabs", 0xfc0007fe, 0xfc000210, Op_D | Op_B | Op_Rc }, @@ -399,10 +409,11 @@ const struct opcode opcodes_3f[] = { struct specialreg { int reg; - char *name; + const char *name; }; const struct specialreg sprregs[] = { + { 0x000, "mq" }, { 0x001, "xer" }, { 0x008, "lr" }, { 0x009, "ctr" }, @@ -412,7 +423,11 @@ const struct specialreg sprregs[] = { { 0x019, "sdr1" }, { 0x01a, "srr0" }, { 0x01b, "srr1" }, +#ifdef BOOKE_PPC4XX { 0x100, "usprg0" }, +#else + { 0x100, "vrsave" }, +#endif { 0x110, "sprg0" }, { 0x111, "sprg1" }, { 0x112, "sprg2" }, @@ -442,6 +457,22 @@ const struct specialreg sprregs[] = { { 0x21d, "dbat2l" }, { 0x21e, "dbat3u" }, { 0x21f, "dbat3l" }, + { 0x230, "ibat4u" }, + { 0x231, "ibat4l" }, + { 0x232, "ibat5u" }, + { 0x233, "ibat5l" }, + { 0x234, "ibat6u" }, + { 0x235, "ibat6l" }, + { 0x236, "ibat7u" }, + { 0x237, "ibat7l" }, + { 0x238, "dbat4u" }, + { 0x239, "dbat4l" }, + { 0x23a, "dbat5u" }, + { 0x23b, "dbat5l" }, + { 0x23c, "dbat6u" }, + { 0x23d, "dbat6l" }, + { 0x23e, "dbat7u" }, + { 0x23f, "dbat7l" }, { 0x3b0, "zpr" }, { 0x3b1, "pid" }, { 0x3b3, "ccr0" }, @@ -463,12 +494,22 @@ const struct specialreg sprregs[] = { { 0x3db, "pit" }, { 0x3de, "srr2" }, { 0x3df, "srr3" }, +#ifdef BOOKE_PPC4XX { 0x3f0, "dbsr" }, { 0x3f2, "dbcr0" }, { 0x3f4, "iac1" }, { 0x3f5, "iac2" }, { 0x3f6, "dac1" }, { 0x3f7, "dac2" }, +#else + { 0x3f0, "hid0" }, + { 0x3f1, "hid1" }, + { 0x3f2, "iabr" }, + { 0x3f3, "hid2" }, + { 0x3f5, "dabr" }, + { 0x3f6, "msscr0" }, + { 0x3f7, "msscr1" }, +#endif { 0x3f9, "l2cr" }, { 0x3fa, "dccr" }, { 0x3fb, "iccr" }, @@ -553,6 +594,11 @@ const struct specialreg dcrregs[] = { { 0, NULL } }; +static const char *condstr[8] = { + "ge", "le", "ne", "ns", "lt", "gt", "eq", "so" +}; + + void op_ill(instr_t instr, vm_offset_t loc) { @@ -570,154 +616,264 @@ const struct opcode * search_op(const st void disasm_fields(const struct opcode *popcode, instr_t instr, vm_offset_t loc, - char *disasm_str) + char *disasm_str, size_t slen) { char * pstr; enum function_mask func; + int len; + +#define ADD_LEN(s) do { \ + len = (s); \ + slen -= len; \ + pstr += len; \ + } while(0) +#define APP_PSTR(fmt, arg) ADD_LEN(snprintf(pstr, slen, (fmt), (arg))) +#define APP_PSTRS(fmt) ADD_LEN(snprintf(pstr, slen, "%s", (fmt))) pstr = disasm_str; func = popcode->func; + if (func & Op_BC) { + u_int BO, BI; + BO = extract_field(instr, 31 - 10, 5); + BI = extract_field(instr, 31 - 15, 5); + func &= ~Op_BC; + if (BO & 4) { + /* standard, no decrement */ + if (BO & 16) { + if (popcode->code == 0x40000000) { + APP_PSTRS("c"); + func |= Op_BO | Op_BI; + } + } + else { + APP_PSTRS(condstr[((BO & 8) >> 1) + (BI & 3)]); + if (BI >= 4) + func |= Op_crfS; + } + } + else { + /* decrement and branch */ + if (BO & 2) + APP_PSTRS("dz"); + else + APP_PSTRS("dnz"); + if ((BO & 24) == 0) + APP_PSTRS("f"); + else if ((BO & 24) == 8) + APP_PSTRS("t"); + else + func |= Op_BI; + } + if (popcode->code == 0x4c000020) + APP_PSTRS("lr"); + else if (popcode->code == 0x4c000420) + APP_PSTRS("ctr"); + if ((BO & 20) != 20 && (func & Op_BO) == 0) + func |= Op_BP; /* branch prediction hint */ + } if (func & Op_OE) { u_int OE; - /* also for Op_S (they are the same) */ OE = extract_field(instr, 31 - 21, 1); if (OE) { - pstr += sprintf(pstr, "o"); + APP_PSTRS("o"); } func &= ~Op_OE; } switch (func & Op_LKM) { case Op_Rc: - if (instr & 0x1) { - pstr += sprintf(pstr, "."); - } + if (instr & 0x1) + APP_PSTRS("."); break; case Op_AA: + if (instr & 0x1) + APP_PSTRS("l"); if (instr & 0x2) { - pstr += sprintf(pstr, "a"); + APP_PSTRS("a"); loc = 0; /* Absolute address */ } + break; case Op_LK: - if (instr & 0x1) { - pstr += sprintf(pstr, "l"); - } + if (instr & 0x1) + APP_PSTRS("l"); break; default: func &= ~Op_LKM; } - pstr += sprintf(pstr, "\t"); + if (func & Op_BP) { + int y; + y = (instr & 0x200000) != 0; + if (popcode->code == 0x40000000) { + int BD; + BD = extract_field(instr, 31 - 29, 14); + BD = BD << 18; + BD = BD >> 16; + BD += loc; + if ((vm_offset_t)BD < loc) + y ^= 1; + } + APP_PSTR("%c", y ? '+' : '-'); + func &= ~Op_BP; + } + APP_PSTRS("\t"); /* XXX: special cases here, out of flags in a 32bit word. */ if (strcmp(popcode->name, "wrteei") == 0) { int E; E = extract_field(instr, 31 - 16, 5); - pstr += sprintf(pstr, "%d", E); + APP_PSTR("%d", E); return; } + else if (strcmp(popcode->name, "mtfsfi") == 0) { + u_int UI; + UI = extract_field(instr, 31 - 8, 3); + APP_PSTR("crf%u, ", UI); + UI = extract_field(instr, 31 - 19, 4); + APP_PSTR("0x%x", UI); + } /* XXX: end of special cases here. */ - if (func & Op_D) { + if ((func & Op_FM) == Op_FM) { + u_int FM; + FM = extract_field(instr, 31 - 14, 8); + APP_PSTR("0x%x, ", FM); + func &= ~Op_FM; + } + if (func & Op_D) { /* Op_ST is the same */ u_int D; - /* also for Op_S (they are the same) */ D = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "r%d, ", D); + APP_PSTR("r%d, ", D); func &= ~Op_D; } if (func & Op_crbD) { u_int crbD; crbD = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "crb%d, ", crbD); + APP_PSTR("crb%d, ", crbD); func &= ~Op_crbD; } if (func & Op_crfD) { u_int crfD; crfD = extract_field(instr, 31 - 8, 3); - pstr += sprintf(pstr, "crf%d, ", crfD); + APP_PSTR("crf%d, ", crfD); func &= ~Op_crfD; } - if (func & Op_L) { - u_int L; - L = extract_field(instr, 31 - 10, 1); - if (L) { - pstr += sprintf(pstr, "L, "); - } - func &= ~Op_L; - } - if (func & Op_FM) { - u_int FM; - FM = extract_field(instr, 31 - 10, 8); - pstr += sprintf(pstr, "%d, ", FM); - func &= ~Op_FM; - } if (func & Op_TO) { u_int TO; TO = extract_field(instr, 31 - 10, 1); - pstr += sprintf(pstr, "%d, ", TO); + APP_PSTR("%d, ", TO); func &= ~Op_TO; } if (func & Op_crfS) { u_int crfS; crfS = extract_field(instr, 31 - 13, 3); - pstr += sprintf(pstr, "%d, ", crfS); + APP_PSTR("crf%d, ", crfS); func &= ~Op_crfS; } + if (func & Op_CRM) { + u_int CRM; + CRM = extract_field(instr, 31 - 19, 8); + APP_PSTR("0x%x, ", CRM); + func &= ~Op_CRM; + } if (func & Op_BO) { u_int BO; BO = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "%d, ", BO); + APP_PSTR("%d, ", BO); func &= ~Op_BO; } + if (func & Op_BI) { + u_int BI; + BI = extract_field(instr, 31 - 15, 5); + APP_PSTR("%d, ", BI); + func &= ~Op_BI; + } + if (func & Op_dA) { /* register A indirect with displacement */ + u_int A; + A = extract_field(instr, 31 - 31, 16); + if (A & 0x8000) { + APP_PSTRS("-"); + A = 0x10000-A; + } + APP_PSTR("0x%x", A); + A = extract_field(instr, 31 - 15, 5); + APP_PSTR("(r%d)", A); + func &= ~Op_dA; + } + if (func & Op_spr) { + u_int spr; + u_int sprl; + u_int sprh; + const struct specialreg *regs; + int i; + sprl = extract_field(instr, 31 - 15, 5); + sprh = extract_field(instr, 31 - 20, 5); + spr = sprh << 5 | sprl; + + /* ugly hack - out of bitfields in the function mask */ + if (popcode->name[2] == 'd') /* m.Dcr */ + regs = dcrregs; + else + regs = sprregs; + for (i = 0; regs[i].name != NULL; i++) + if (spr == regs[i].reg) + break; + if (regs[i].name == NULL) + APP_PSTR("[unknown special reg (%d)]", spr); + else + APP_PSTR("%s", regs[i].name); + + if (popcode->name[1] == 't') /* spr is destination */ + APP_PSTRS(", "); + func &= ~Op_spr; + } + if (func & Op_SR) { + u_int SR; + SR = extract_field(instr, 31 - 15, 3); + APP_PSTR("sr%d", SR); + if (popcode->name[1] == 't') /* SR is destination */ + APP_PSTRS(", "); + func &= ~Op_SR; + } if (func & Op_A) { u_int A; A = extract_field(instr, 31 - 15, 5); - pstr += sprintf(pstr, "r%d, ", A); + APP_PSTR("r%d, ", A); func &= ~Op_A; } - if (func & Op_B) { - u_int B; - B = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, "r%d, ", B); - func &= ~Op_B; + if (func & Op_S) { + u_int D; + D = extract_field(instr, 31 - 10, 5); + APP_PSTR("r%d, ", D); + func &= ~Op_S; } if (func & Op_C) { u_int C; C = extract_field(instr, 31 - 25, 5); - pstr += sprintf(pstr, "r%d, ", C); + APP_PSTR("r%d, ", C); func &= ~Op_C; } - if (func & Op_BI) { - u_int BI; - BI = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "%d, ", BI); - func &= ~Op_BI; + if (func & Op_B) { + u_int B; + B = extract_field(instr, 31 - 20, 5); + APP_PSTR("r%d", B); + func &= ~Op_B; } if (func & Op_crbA) { u_int crbA; crbA = extract_field(instr, 31 - 15, 5); - pstr += sprintf(pstr, "%d, ", crbA); + APP_PSTR("%d, ", crbA); func &= ~Op_crbA; } if (func & Op_crbB) { u_int crbB; crbB = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, "%d, ", crbB); + APP_PSTR("%d, ", crbB); func &= ~Op_crbB; } - if (func & Op_CRM) { - u_int CRM; - CRM = extract_field(instr, 31 - 19, 8); - pstr += sprintf(pstr, "0x%x, ", CRM); - func &= ~Op_CRM; - } if (func & Op_LI) { - int LI; + u_int LI; LI = extract_field(instr, 31 - 29, 24); - /* Need to sign extend and shift up 2, then add addr */ - LI = LI << 8; - LI = LI >> 6; - LI += loc; - pstr += sprintf (pstr, "0x%x, ", LI); + APP_PSTR("0x%x", LI); func &= ~Op_LI; } switch (func & Op_SIMM) { @@ -725,7 +881,7 @@ disasm_fields(const struct opcode *popco case Op_SIMM: /* same as Op_d */ IMM = extract_field(instr, 31 - 31, 16); if (IMM & 0x8000) { - pstr += sprintf(pstr, "-"); + APP_PSTRS("-"); IMM = 0x10000-IMM; } func &= ~Op_SIMM; @@ -735,95 +891,71 @@ disasm_fields(const struct opcode *popco func &= ~Op_UIMM; goto common; common: - pstr += sprintf(pstr, "0x%x", IMM); + APP_PSTR("0x%x", IMM); break; default: - break; + ; } if (func & Op_BD) { u_int BD; BD = extract_field(instr, 31 - 29, 14); - pstr += sprintf(pstr, "0x%x, ", BD); + /* Need to sign extend and shift up 2, then add addr */ + APP_PSTR("0x%x", BD); func &= ~Op_BD; } if (func & Op_ds) { u_int ds; ds = extract_field(instr, 31 - 29, 14) << 2; - pstr += sprintf(pstr, "0x%x, ", ds); + APP_PSTR("0x%x", ds); func &= ~Op_ds; } - if (func & Op_spr) { - u_int spr; - u_int sprl; - u_int sprh; - const struct specialreg *regs; - int i; - sprl = extract_field(instr, 31 - 15, 5); - sprh = extract_field(instr, 31 - 20, 5); - spr = sprh << 5 | sprl; - - /* ugly hack - out of bitfields in the function mask */ - if (popcode->name[2] == 'd') /* m.Dcr */ - regs = dcrregs; - else - regs = sprregs; - for (i = 0; regs[i].name != NULL; i++) - if (spr == regs[i].reg) - break; - if (regs[i].reg == 0) - pstr += sprintf(pstr, "[unknown special reg (%d)]", spr); - else - pstr += sprintf(pstr, "%s", regs[i].name); - func &= ~Op_spr; - } - if (func & Op_me) { u_int me, mel, meh; mel = extract_field(instr, 31 - 25, 4); meh = extract_field(instr, 31 - 26, 1); me = meh << 4 | mel; - pstr += sprintf(pstr, ", 0x%x", me); + APP_PSTR(", 0x%x", me); func &= ~Op_me; } - if ((func & Op_MB) && (func & Op_sh_mb_sh)) { - u_int MB; - u_int ME; - MB = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, ", %d", MB); - ME = extract_field(instr, 31 - 25, 5); - pstr += sprintf(pstr, ", %d", ME); - } if ((func & Op_SH) && (func & Op_sh_mb_sh)) { u_int SH; SH = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, ", %d", SH); + APP_PSTR("%d", SH); + } + if ((func & Op_MB) && (func & Op_sh_mb_sh)) { + u_int MB; + u_int ME; + MB = extract_field(instr, 31 - 25, 5); + APP_PSTR(", %d", MB); + ME = extract_field(instr, 31 - 30, 5); + APP_PSTR(", %d", ME); } if ((func & Op_sh) && ! (func & Op_sh_mb_sh)) { u_int sh, shl, shh; shl = extract_field(instr, 31 - 19, 4); shh = extract_field(instr, 31 - 20, 1); sh = shh << 4 | shl; - pstr += sprintf(pstr, ", %d", sh); + APP_PSTR(", %d", sh); } if ((func & Op_mb) && ! (func & Op_sh_mb_sh)) { u_int mb, mbl, mbh; mbl = extract_field(instr, 31 - 25, 4); mbh = extract_field(instr, 31 - 26, 1); mb = mbh << 4 | mbl; - pstr += sprintf(pstr, ", %d", mb); + APP_PSTR(", %d", mb); } if ((func & Op_me) && ! (func & Op_sh_mb_sh)) { u_int me, mel, meh; mel = extract_field(instr, 31 - 25, 4); meh = extract_field(instr, 31 - 26, 1); me = meh << 4 | mel; - pstr += sprintf(pstr, ", %d", me); + APP_PSTR(", %d", me); } if (func & Op_tbr) { u_int tbr; u_int tbrl; u_int tbrh; - char *reg; + const char *reg; tbrl = extract_field(instr, 31 - 15, 5); tbrh = extract_field(instr, 31 - 20, 5); tbr = tbrh << 5 | tbrl; @@ -836,34 +968,25 @@ disasm_fields(const struct opcode *popco reg = "tbu"; break; default: - reg = NULL; + reg = 0; } - if (reg == NULL) - pstr += sprintf(pstr, ", [unknown tbr %d ]", tbr); + if (reg == 0) + APP_PSTR(", [unknown tbr %d ]", tbr); else - pstr += sprintf(pstr, ", %s", reg); + APP_PSTR(", %s", reg); func &= ~Op_tbr; } - if (func & Op_SR) { - u_int SR; - SR = extract_field(instr, 31 - 15, 3); - pstr += sprintf(pstr, ", sr%d", SR); - func &= ~Op_SR; - } if (func & Op_NB) { u_int NB; NB = extract_field(instr, 31 - 20, 5); if (NB == 0) NB = 32; - pstr += sprintf(pstr, ", %d", NB); - func &= ~Op_SR; - } - if (func & Op_IMM) { - u_int IMM; - IMM = extract_field(instr, 31 - 19, 4); - pstr += sprintf(pstr, ", %d", IMM); + APP_PSTR(", %d", NB); func &= ~Op_SR; } +#undef ADD_LEN +#undef APP_PSTR +#undef APP_PSTRS } void @@ -920,14 +1043,15 @@ dis_ppc(const struct opcode *opcodeset, const struct opcode *op; int found = 0; int i; - char disasm_str[30]; + char disasm_str[80]; for (i = 0, op = &opcodeset[0]; found == 0 && op->mask != 0; i++, op = &opcodeset[i]) { if ((instr & op->mask) == op->code) { found = 1; - disasm_fields(op, instr, loc, disasm_str); + disasm_fields(op, instr, loc, disasm_str, + sizeof disasm_str); db_printf("%s%s\n", op->name, disasm_str); return; } From owner-svn-src-head@freebsd.org Wed Nov 30 05:12:00 2016 Return-Path: Delivered-To: svn-src-head@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 9A64EC5C3BE; Wed, 30 Nov 2016 05:12:00 +0000 (UTC) (envelope-from sephe@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 39EC913AC; Wed, 30 Nov 2016 05:12:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU5BxEq047027; Wed, 30 Nov 2016 05:11:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU5BxNO047026; Wed, 30 Nov 2016 05:11:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300511.uAU5BxNO047026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 05:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309310 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 05:12:00 -0000 Author: sephe Date: Wed Nov 30 05:11:59 2016 New Revision: 309310 URL: https://svnweb.freebsd.org/changeset/base/309310 Log: hyperv/hn: Nuke the unused TX taskqueue CPU binding tunable. It was an experimental tunable, and is now deemed to be road blocker for further changes. Time to retire it. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8654 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 02:35:51 2016 (r309309) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 05:11:59 2016 (r309310) @@ -424,11 +424,6 @@ static int hn_use_txdesc_bufring = 1; SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD, &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors"); -/* Bind TX taskqueue to the target CPU */ -static int hn_bind_tx_taskq = -1; -SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, - &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); - #ifdef HN_IFSTART_SUPPORT /* Use ifnet.if_start instead of ifnet.if_transmit */ static int hn_use_if_start = 0; @@ -906,20 +901,8 @@ hn_attach(device_t dev) if (hn_tx_taskq == NULL) { sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &sc->hn_tx_taskq); - if (hn_bind_tx_taskq >= 0) { - int cpu = hn_bind_tx_taskq; - cpuset_t cpu_set; - - if (cpu > mp_ncpus - 1) - cpu = mp_ncpus - 1; - CPU_SETOF(cpu, &cpu_set); - taskqueue_start_threads_cpuset(&sc->hn_tx_taskq, 1, - PI_NET, &cpu_set, "%s tx", - device_get_nameunit(dev)); - } else { - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, - "%s tx", device_get_nameunit(dev)); - } + taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", + device_get_nameunit(dev)); } else { sc->hn_tx_taskq = hn_tx_taskq; } @@ -5360,18 +5343,7 @@ hn_tx_taskq_create(void *arg __unused) hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &hn_tx_taskq); - if (hn_bind_tx_taskq >= 0) { - int cpu = hn_bind_tx_taskq; - cpuset_t cpu_set; - - if (cpu > mp_ncpus - 1) - cpu = mp_ncpus - 1; - CPU_SETOF(cpu, &cpu_set); - taskqueue_start_threads_cpuset(&hn_tx_taskq, 1, PI_NET, - &cpu_set, "hn tx"); - } else { - taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); - } + taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); } SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_tx_taskq_create, NULL); From owner-svn-src-head@freebsd.org Wed Nov 30 05:28:41 2016 Return-Path: Delivered-To: svn-src-head@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 4FE6CC5C8F4; Wed, 30 Nov 2016 05:28:41 +0000 (UTC) (envelope-from sephe@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 0B7AC1950; Wed, 30 Nov 2016 05:28:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU5Se2D053574; Wed, 30 Nov 2016 05:28:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU5Sec8053572; Wed, 30 Nov 2016 05:28:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300528.uAU5Sec8053572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 05:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309311 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 05:28:41 -0000 Author: sephe Date: Wed Nov 30 05:28:39 2016 New Revision: 309311 URL: https://svnweb.freebsd.org/changeset/base/309311 Log: hyperv/hn: Allow multiple TX taskqueues. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8655 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 05:11:59 2016 (r309310) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 05:28:39 2016 (r309311) @@ -416,6 +416,10 @@ static int hn_share_tx_taskq = 0; SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_taskq, CTLFLAG_RDTUN, &hn_share_tx_taskq, 0, "Enable shared TX taskqueue"); +static int hn_tx_taskq_cnt = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_cnt, CTLFLAG_RDTUN, + &hn_tx_taskq_cnt, 0, "# of TX taskqueues"); + #ifndef HN_USE_TXDESC_BUFRING static int hn_use_txdesc_bufring = 0; #else @@ -465,7 +469,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); static u_int hn_cpu_index; /* next CPU for channel */ -static struct taskqueue *hn_tx_taskq; /* shared TX taskqueue */ +static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { @@ -898,13 +902,21 @@ hn_attach(device_t dev) /* * Setup taskqueue for transmission. */ - if (hn_tx_taskq == NULL) { - sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &sc->hn_tx_taskq); - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", - device_get_nameunit(dev)); + if (hn_tx_taskque == NULL) { + int i; + + sc->hn_tx_taskqs = + malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), + M_DEVBUF, M_WAITOK); + for (i = 0; i < hn_tx_taskq_cnt; ++i) { + sc->hn_tx_taskqs[i] = taskqueue_create("hn_tx", + M_WAITOK, taskqueue_thread_enqueue, + &sc->hn_tx_taskqs[i]); + taskqueue_start_threads(&sc->hn_tx_taskqs[i], 1, PI_NET, + "%s tx%d", device_get_nameunit(dev), i); + } } else { - sc->hn_tx_taskq = hn_tx_taskq; + sc->hn_tx_taskqs = hn_tx_taskque; } /* @@ -1204,8 +1216,13 @@ hn_detach(device_t dev) hn_destroy_rx_data(sc); hn_destroy_tx_data(sc); - if (sc->hn_tx_taskq != hn_tx_taskq) - taskqueue_free(sc->hn_tx_taskq); + if (sc->hn_tx_taskqs != hn_tx_taskque) { + int i; + + for (i = 0; i < hn_tx_taskq_cnt; ++i) + taskqueue_free(sc->hn_tx_taskqs[i]); + free(sc->hn_tx_taskqs, M_DEVBUF); + } taskqueue_free(sc->hn_mgmt_taskq0); if (sc->hn_xact != NULL) { @@ -3295,7 +3312,7 @@ hn_tx_ring_create(struct hn_softc *sc, i M_WAITOK, &txr->hn_tx_lock); #endif - txr->hn_tx_taskq = sc->hn_tx_taskq; + txr->hn_tx_taskq = sc->hn_tx_taskqs[id % hn_tx_taskq_cnt]; #ifdef HN_IFSTART_SUPPORT if (hn_use_if_start) { @@ -5334,6 +5351,15 @@ hn_chan_callback(struct vmbus_channel *c static void hn_tx_taskq_create(void *arg __unused) { + int i; + + /* + * Fix the # of TX taskqueues. + */ + if (hn_tx_taskq_cnt <= 0) + hn_tx_taskq_cnt = 1; + else if (hn_tx_taskq_cnt > mp_ncpus) + hn_tx_taskq_cnt = mp_ncpus; if (vm_guest != VM_GUEST_HV) return; @@ -5341,9 +5367,14 @@ hn_tx_taskq_create(void *arg __unused) if (!hn_share_tx_taskq) return; - hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &hn_tx_taskq); - taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); + hn_tx_taskque = malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), + M_DEVBUF, M_WAITOK); + for (i = 0; i < hn_tx_taskq_cnt; ++i) { + hn_tx_taskque[i] = taskqueue_create("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &hn_tx_taskque[i]); + taskqueue_start_threads(&hn_tx_taskque[i], 1, PI_NET, + "hn tx%d", i); + } } SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_tx_taskq_create, NULL); @@ -5352,8 +5383,13 @@ static void hn_tx_taskq_destroy(void *arg __unused) { - if (hn_tx_taskq != NULL) - taskqueue_free(hn_tx_taskq); + if (hn_tx_taskque != NULL) { + int i; + + for (i = 0; i < hn_tx_taskq_cnt; ++i) + taskqueue_free(hn_tx_taskque[i]); + free(hn_tx_taskque, M_DEVBUF); + } } SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_tx_taskq_destroy, NULL); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Nov 30 05:11:59 2016 (r309310) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Nov 30 05:28:39 2016 (r309311) @@ -192,7 +192,7 @@ struct hn_softc { int hn_chim_szmax; int hn_cpu; - struct taskqueue *hn_tx_taskq; + struct taskqueue **hn_tx_taskqs; struct sysctl_oid *hn_tx_sysctl_tree; struct sysctl_oid *hn_rx_sysctl_tree; struct vmbus_xact_ctx *hn_xact; From owner-svn-src-head@freebsd.org Wed Nov 30 05:39:58 2016 Return-Path: Delivered-To: svn-src-head@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 92432C5CB42; Wed, 30 Nov 2016 05:39:58 +0000 (UTC) (envelope-from jakub@ixsystems.com) Received: from mx.ixsystems.com (mail.ixsystems.com [12.229.62.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN ".", Issuer "." (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 244241EDA; Wed, 30 Nov 2016 05:39:58 +0000 (UTC) (envelope-from jakub@ixsystems.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx.ixsystems.com (Postfix) with ESMTP id 3tSSmg6bK1zCs4F; Mon, 28 Nov 2016 18:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ixsystems.com; h= x-mailer:references:message-id:content-transfer-encoding:date :date:in-reply-to:from:from:subject:subject:mime-version :content-type:content-type:received:received:received:received :received:received:received; s=dkim; t=1480388030; x=1482202431; bh=hCXKvsRvN+beCkw8PVA/gnARr52oB92qL/OIapyuFaE=; b=eeoSFg74r9PE 81Xy03vvTyA50R9XDkAKz2gzEbBIQQG6OSgPLJqUL9oZxSBN0zAkr/wKoKZu8StL 6U/vmO0FRRrZBuimr05dRSdbcTVEl6nj6C3ojvbX4nMt7gf6/8lJky08gZrSJUiT FgYq5UL/k9SgcdgyzZ1y81XcZeKikhdW+8uQaPme2X299KvgD5ZlRnSBRRZhK2pO SfNAbl9StHCRvCcA/eQwWqwKy9FP6XGD+e+XPzadEnaRsYGjf+zR+C+CqazDduxE p9vSZJK7mTVz4Gi2H8GmVr/wKOPK/aCeG74t6NVQ9kJ+asNodY1El2nGY7FOGIEN nMYn108QUg== X-Amavis-Modified: Mail body modified (using disclaimer) - mx.ixsystems.com X-Virus-Scanned: Scrollout F1 at ixsystems.com Received: from mx.ixsystems.com ([127.0.0.1]) by localhost (mx.ixsystems.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X0VAuMUryfQI; Mon, 28 Nov 2016 18:53:50 -0800 (PST) Received: from zimbra.ixsystems.com (unknown [10.246.0.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.ixsystems.com (Postfix) with ESMTPS id 3tSSm733FHzCs7r; Mon, 28 Nov 2016 18:53:27 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id 203B1C4E0DD; Thu, 24 Nov 2016 14:27:10 -0800 (PST) Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7mmTssxD37CL; Thu, 24 Nov 2016 14:27:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id 3E642C4E130; Thu, 24 Nov 2016 14:27:09 -0800 (PST) X-Virus-Scanned: amavisd-new at ixsystems.com Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kcxlAuZqb47J; Thu, 24 Nov 2016 14:27:09 -0800 (PST) Received: from [172.20.0.30] (vpn.ixsystems.com [10.249.0.2]) by zimbra.ixsystems.com (Postfix) with ESMTPSA id EB664C4E0DD; Thu, 24 Nov 2016 14:27:07 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: svn commit: r309121 - head/usr.sbin/bhyve From: Jakub Klama In-Reply-To: <1480026232.1889.63.camel@freebsd.org> Date: Thu, 24 Nov 2016 23:27:04 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7F692FF4-4F36-4ED8-AF26-4684D41CB3AE@ixsystems.com> References: <201611242216.uAOMGIi0065703@repo.freebsd.org> <1480026232.1889.63.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3226) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 05:39:58 -0000 > Wiadomo=C5=9B=C4=87 napisana przez Ian Lepore w dniu = 24.11.2016, o godz. 23:23: >=20 > On Thu, 2016-11-24 at 22:16 +0000, Jakub Wojciech Klama wrote: >> Author: jceel >> Date: Thu Nov 24 22:16:18 2016 >> New Revision: 309121 >> URL: https://svnweb.freebsd.org/changeset/base/309121 >>=20 >> Log: >> virtio_console: handle short writes to an Unix domain socket >> gracefully. >>=20 >> writev() can do a short write. Retrying it results in a very >> convoluted >> and complex code, so we iterate over iovec and do regular >> stream_write() >> instead. >>=20 >=20 > Doesn't pwritev(2) simplify iterating to handle short writes? >=20 Correct me if I'm wrong, but pwritev(2) is a writev(2) with offset. = We're writing to an Unix domain socket here, which is not seekable. Thanks, Jakub From owner-svn-src-head@freebsd.org Wed Nov 30 07:16:30 2016 Return-Path: Delivered-To: svn-src-head@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 99D78C5DEB5; Wed, 30 Nov 2016 07:16:30 +0000 (UTC) (envelope-from matthew@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 746C716A0; Wed, 30 Nov 2016 07:16:30 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7GT4d097455; Wed, 30 Nov 2016 07:16:29 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7GTPr097452; Wed, 30 Nov 2016 07:16:29 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201611300716.uAU7GTPr097452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Wed, 30 Nov 2016 07:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309314 - in head: . release/scripts share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:16:30 -0000 Author: matthew (ports committer) Date: Wed Nov 30 07:16:29 2016 New Revision: 309314 URL: https://svnweb.freebsd.org/changeset/base/309314 Log: Allow a user-overridable setting 'PKG_CMD' to control the command used to create a repo during 'make packages' This would have been useful for a situation I found myself in where pkg(8) had been upgraded to a version that wanted the FBSD_1.5 ABI version but libc.so.7 had not been upgraded, and only provided FBSD_1.4. I found I needed to update libc in order to run pkg, and I also needed to use pkg to update libc... Which is why pkg-static exists, but there's currently no way to tell the build system to use pkg-static instead of pkg. This creates a variable PKG_CMD, default value 'pkg', that can be overridden from the command line. Reviewed by: gjb Approved by: gjb Differential Revision: https://reviews.freebsd.org/D8120 Modified: head/Makefile.inc1 head/release/scripts/make-pkg-package.sh head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 30 06:26:37 2016 (r309313) +++ head/Makefile.inc1 Wed Nov 30 07:16:29 2016 (r309314) @@ -1379,7 +1379,8 @@ packages: .PHONY package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \ - PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \ + PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \ + WSTAGEDIR=${WSTAGEDIR} \ sh ${.CURDIR}/release/scripts/make-pkg-package.sh real-packages: stage-packages create-packages sign-packages .PHONY @@ -1417,11 +1418,11 @@ create-world-packages: _pkgbootstrap .PH /^name/ { printf("===> Creating %s-", $$2); next } \ /^version/ { print $$2; next } \ ' ${WSTAGEDIR}/$${pkgname}.ucl ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${WSTAGEDIR}/$${pkgname}.ucl \ -p ${WSTAGEDIR}/$${pkgname}.plist \ -r ${WSTAGEDIR} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ done create-kernel-packages: _pkgbootstrap .PHONY @@ -1445,11 +1446,11 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" @@ -1474,25 +1475,25 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .endfor .endif sign-packages: _pkgbootstrap .PHONY - @[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ - unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ + unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ - ln -s ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest + ln -s ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest # # Modified: head/release/scripts/make-pkg-package.sh ============================================================================== --- head/release/scripts/make-pkg-package.sh Wed Nov 30 06:26:37 2016 (r309313) +++ head/release/scripts/make-pkg-package.sh Wed Nov 30 07:16:29 2016 (r309314) @@ -8,6 +8,7 @@ eval $(make -C ${SRCDIR} TARGET=${TARGET export WRKDIRPREFIX=/tmp/ports.${TARGET} export WSTAGEDIR=${WSTAGEDIR} export REPODIR=${REPODIR} +export PKG_CMD=${PKG_CMD} export PKG_VERSION=${PKG_VERSION} export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR) @@ -15,11 +16,11 @@ make -C ${PORTSDIR}/ports-mgmt/pkg TARGE CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \ stage create-manifest -pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh \ +${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh \ create -v -m ${WRKDIR}/.metadir/ \ -r ${WRKDIR}/stage \ -p ${WRKDIR}/.PLIST.mktmp \ - -o ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} -mkdir -p ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ -cd ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ + -o ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} +mkdir -p ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ +cd ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ ln -s ../pkg-*.txz Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Nov 30 06:26:37 2016 (r309313) +++ head/share/mk/bsd.own.mk Wed Nov 30 07:16:29 2016 (r309314) @@ -116,6 +116,9 @@ # NLSMODE National Language Support files mode. [${NOBINMODE}] # # INCLUDEDIR Base path for standard C include files [/usr/include] +# +# PKG_CMD Program for creating and manipulating packages. +# [pkg] .if !target(____) ____: @@ -249,6 +252,8 @@ XZ_CMD?= xz -T ${XZ_THREADS} XZ_CMD?= xz .endif +PKG_CMD?= pkg + # Pointer to the top directory into which tests are installed. Should not be # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests From owner-svn-src-head@freebsd.org Wed Nov 30 07:45:06 2016 Return-Path: Delivered-To: svn-src-head@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 E3BD3C5C81E; Wed, 30 Nov 2016 07:45:06 +0000 (UTC) (envelope-from sephe@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 994391674; Wed, 30 Nov 2016 07:45:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7j5eY010036; Wed, 30 Nov 2016 07:45:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7j5eT010034; Wed, 30 Nov 2016 07:45:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300745.uAU7j5eT010034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 07:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309316 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:45:07 -0000 Author: sephe Date: Wed Nov 30 07:45:05 2016 New Revision: 309316 URL: https://svnweb.freebsd.org/changeset/base/309316 Log: hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8658 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_if.m Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 07:22:46 2016 (r309315) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 07:45:05 2016 (r309316) @@ -97,6 +97,8 @@ static int vmbus_probe_guid_method(dev const struct hyperv_guid *); static uint32_t vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu); +static struct taskqueue *vmbus_get_eventtq_method(device_t, device_t, + int); static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); @@ -172,6 +174,7 @@ static device_method_t vmbus_methods[] = DEVMETHOD(vmbus_get_version, vmbus_get_version_method), DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method), + DEVMETHOD(vmbus_get_event_taskq, vmbus_get_eventtq_method), DEVMETHOD_END }; @@ -1126,6 +1129,15 @@ vmbus_get_vcpu_id_method(device_t bus, d return (VMBUS_PCPU_GET(sc, vcpuid, cpu)); } +static struct taskqueue * +vmbus_get_eventtq_method(device_t bus, device_t dev __unused, int cpu) +{ + const struct vmbus_softc *sc = device_get_softc(bus); + + KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu%d", cpu)); + return (VMBUS_PCPU_GET(sc, event_tq, cpu)); +} + #ifdef NEW_PCIB #define VTPM_BASE_ADDR 0xfed40000 #define FOUR_GB (1ULL << 32) Modified: head/sys/dev/hyperv/vmbus/vmbus_if.m ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 07:22:46 2016 (r309315) +++ head/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 07:45:05 2016 (r309316) @@ -33,6 +33,7 @@ INTERFACE vmbus; HEADER { struct hyperv_guid; + struct taskqueue; }; METHOD uint32_t get_version { @@ -51,3 +52,9 @@ METHOD uint32_t get_vcpu_id { device_t dev; int cpu; }; + +METHOD struct taskqueue * get_event_taskq { + device_t bus; + device_t dev; + int cpu; +}; From owner-svn-src-head@freebsd.org Wed Nov 30 07:54:29 2016 Return-Path: Delivered-To: svn-src-head@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 A2816C5CB96; Wed, 30 Nov 2016 07:54:29 +0000 (UTC) (envelope-from sephe@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 7D4591C93; Wed, 30 Nov 2016 07:54:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7sSwA013919; Wed, 30 Nov 2016 07:54:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7sS1C013918; Wed, 30 Nov 2016 07:54:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300754.uAU7sS1C013918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 07:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309318 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:54:29 -0000 Author: sephe Date: Wed Nov 30 07:54:28 2016 New Revision: 309318 URL: https://svnweb.freebsd.org/changeset/base/309318 Log: hyperv/hn: Allow TX to share event taskqueues. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8659 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 07:51:46 2016 (r309317) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 07:54:28 2016 (r309318) @@ -169,6 +169,8 @@ do { \ #define HN_PKTSIZE(m, align) \ roundup2((m)->m_pkthdr.len + HN_RNDIS_PKT_LEN, (align)) +#define HN_RING_IDX2CPU(sc, idx) (((sc)->hn_cpu + (idx)) % mp_ncpus) + struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; @@ -411,15 +413,19 @@ SYSCTL_INT(_hw_hn, OID_AUTO, lro_entry_c #endif #endif -/* Use shared TX taskqueue */ -static int hn_share_tx_taskq = 0; -SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_taskq, CTLFLAG_RDTUN, - &hn_share_tx_taskq, 0, "Enable shared TX taskqueue"); - static int hn_tx_taskq_cnt = 1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_cnt, CTLFLAG_RDTUN, &hn_tx_taskq_cnt, 0, "# of TX taskqueues"); +#define HN_TX_TASKQ_M_INDEP 0 +#define HN_TX_TASKQ_M_GLOBAL 1 +#define HN_TX_TASKQ_M_EVTTQ 2 + +static int hn_tx_taskq_mode = HN_TX_TASKQ_M_INDEP; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_mode, CTLFLAG_RDTUN, + &hn_tx_taskq_mode, 0, "TX taskqueue modes: " + "0 - independent, 1 - share global tx taskqs, 2 - share event taskqs"); + #ifndef HN_USE_TXDESC_BUFRING static int hn_use_txdesc_bufring = 0; #else @@ -902,7 +908,7 @@ hn_attach(device_t dev) /* * Setup taskqueue for transmission. */ - if (hn_tx_taskque == NULL) { + if (hn_tx_taskq_mode == HN_TX_TASKQ_M_INDEP) { int i; sc->hn_tx_taskqs = @@ -915,7 +921,7 @@ hn_attach(device_t dev) taskqueue_start_threads(&sc->hn_tx_taskqs[i], 1, PI_NET, "%s tx%d", device_get_nameunit(dev), i); } - } else { + } else if (hn_tx_taskq_mode == HN_TX_TASKQ_M_GLOBAL) { sc->hn_tx_taskqs = hn_tx_taskque; } @@ -1216,7 +1222,7 @@ hn_detach(device_t dev) hn_destroy_rx_data(sc); hn_destroy_tx_data(sc); - if (sc->hn_tx_taskqs != hn_tx_taskque) { + if (sc->hn_tx_taskqs != NULL && sc->hn_tx_taskqs != hn_tx_taskque) { int i; for (i = 0; i < hn_tx_taskq_cnt; ++i) @@ -3312,7 +3318,12 @@ hn_tx_ring_create(struct hn_softc *sc, i M_WAITOK, &txr->hn_tx_lock); #endif - txr->hn_tx_taskq = sc->hn_tx_taskqs[id % hn_tx_taskq_cnt]; + if (hn_tx_taskq_mode == HN_TX_TASKQ_M_EVTTQ) { + txr->hn_tx_taskq = VMBUS_GET_EVENT_TASKQ( + device_get_parent(dev), dev, HN_RING_IDX2CPU(sc, id)); + } else { + txr->hn_tx_taskq = sc->hn_tx_taskqs[id % hn_tx_taskq_cnt]; + } #ifdef HN_IFSTART_SUPPORT if (hn_use_if_start) { @@ -4205,7 +4216,7 @@ hn_chan_attach(struct hn_softc *sc, stru } /* Bind this channel to a proper CPU. */ - vmbus_chan_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus); + vmbus_chan_cpu_set(chan, HN_RING_IDX2CPU(sc, idx)); /* * Open this channel @@ -5361,10 +5372,23 @@ hn_tx_taskq_create(void *arg __unused) else if (hn_tx_taskq_cnt > mp_ncpus) hn_tx_taskq_cnt = mp_ncpus; + /* + * Fix the TX taskqueue mode. + */ + switch (hn_tx_taskq_mode) { + case HN_TX_TASKQ_M_INDEP: + case HN_TX_TASKQ_M_GLOBAL: + case HN_TX_TASKQ_M_EVTTQ: + break; + default: + hn_tx_taskq_mode = HN_TX_TASKQ_M_INDEP; + break; + } + if (vm_guest != VM_GUEST_HV) return; - if (!hn_share_tx_taskq) + if (hn_tx_taskq_mode != HN_TX_TASKQ_M_GLOBAL) return; hn_tx_taskque = malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), From owner-svn-src-head@freebsd.org Wed Nov 30 08:10:50 2016 Return-Path: Delivered-To: svn-src-head@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 8A0C5C5D3B0; Wed, 30 Nov 2016 08:10:50 +0000 (UTC) (envelope-from sephe@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 52D661554; Wed, 30 Nov 2016 08:10:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU8Anws018644; Wed, 30 Nov 2016 08:10:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU8AnWN018628; Wed, 30 Nov 2016 08:10:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300810.uAU8AnWN018628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 08:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309319 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 08:10:50 -0000 Author: sephe Date: Wed Nov 30 08:10:49 2016 New Revision: 309319 URL: https://svnweb.freebsd.org/changeset/base/309319 Log: hypver/vmbus: Remove extra assertion. It is asserted by vmbus_chan_gpadl_connect() now. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8660 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Nov 30 07:54:28 2016 (r309318) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Nov 30 08:10:49 2016 (r309319) @@ -405,8 +405,6 @@ vmbus_chan_open_br(struct vmbus_channel /* * Connect the bufrings, both RX and TX, to this channel. */ - KASSERT(chan->ch_bufring_gpadl == 0, - ("bufring GPADL is still connected")); error = vmbus_chan_gpadl_connect(chan, cbr->cbr_paddr, txbr_size + rxbr_size, &chan->ch_bufring_gpadl); if (error) { From owner-svn-src-head@freebsd.org Wed Nov 30 08:21:17 2016 Return-Path: Delivered-To: svn-src-head@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 1C3B2C5D769; Wed, 30 Nov 2016 08:21:17 +0000 (UTC) (envelope-from sephe@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 D14251B63; Wed, 30 Nov 2016 08:21:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU8LGl0024498; Wed, 30 Nov 2016 08:21:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU8LGOQ024497; Wed, 30 Nov 2016 08:21:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300821.uAU8LGOQ024497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 08:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309320 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 08:21:17 -0000 Author: sephe Date: Wed Nov 30 08:21:15 2016 New Revision: 309320 URL: https://svnweb.freebsd.org/changeset/base/309320 Log: hyperv/storvsc: Don't use timedwait. The timeout is unnecessary. Reviewed by: jhb MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8656 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Nov 30 08:10:49 2016 (r309319) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Nov 30 08:21:15 2016 (r309320) @@ -413,13 +413,7 @@ storvsc_send_multichannel_request(struct VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, vstor_packet, VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request); - /* wait for 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - if (ret != 0) { - printf("Storvsc_error: create multi-channel timeout, %d\n", - ret); - return; - } + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) { @@ -486,10 +480,7 @@ hv_storvsc_channel_init(struct storvsc_s if (ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) { @@ -516,11 +507,7 @@ hv_storvsc_channel_init(struct storvsc_s if (ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO) { ret = EINVAL; @@ -555,11 +542,7 @@ hv_storvsc_channel_init(struct storvsc_s if ( ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); /* TODO: Check returned version */ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || @@ -588,11 +571,7 @@ hv_storvsc_channel_init(struct storvsc_s goto cleanup; } - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) @@ -672,12 +651,7 @@ hv_storvsc_host_reset(struct storvsc_sof goto cleanup; } - ret = sema_timedwait(&request->synch_sema, 5 * hz); /* KYS 5 seconds */ - - if (ret) { - goto cleanup; - } - + sema_wait(&request->synch_sema); /* * At this point, all outstanding requests in the adapter From owner-svn-src-head@freebsd.org Wed Nov 30 09:27:09 2016 Return-Path: Delivered-To: svn-src-head@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 F1B2EC5ABCC; Wed, 30 Nov 2016 09:27:09 +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 C0D1F1C02; Wed, 30 Nov 2016 09:27:09 +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 uAU9R8TD049960; Wed, 30 Nov 2016 09:27:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU9R8vh049955; Wed, 30 Nov 2016 09:27:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611300927.uAU9R8vh049955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Nov 2016 09:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309321 - in head: sbin/geom/class/mirror sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 09:27:10 -0000 Author: mav Date: Wed Nov 30 09:27:08 2016 New Revision: 309321 URL: https://svnweb.freebsd.org/changeset/base/309321 Log: Add `gmirror create` subcommand, alike to gstripe, gconcat, etc. It is quite specific mode of operation without storing on-disk metadata. It can be useful in some cases in combination with some external control tools handling mirror creation and disks hot-plug. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/mirror/gmirror.8 head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Wed Nov 30 08:21:15 2016 (r309320) +++ head/sbin/geom/class/mirror/geom_mirror.c Wed Nov 30 09:27:08 2016 (r309321) @@ -79,6 +79,16 @@ struct g_command class_commands[] = { "[-adfFhnv] [-b balance] [-s slice] name\n" "[-v] -p priority name prov" }, + { "create", G_FLAG_VERBOSE, NULL, + { + { 'b', "balance", GMIRROR_BALANCE, G_TYPE_STRING }, + { 'F', "nofailsync", NULL, G_TYPE_BOOL }, + { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 's', "slice", GMIRROR_SLICE, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + "[-Fnv] [-b balance] [-s slice] name prov ..." + }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, Modified: head/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- head/sbin/geom/class/mirror/gmirror.8 Wed Nov 30 08:21:15 2016 (r309320) +++ head/sbin/geom/class/mirror/gmirror.8 Wed Nov 30 09:27:08 2016 (r309321) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2013 +.Dd November 27, 2016 .Dt GMIRROR 8 .Os .Sh NAME @@ -43,6 +43,13 @@ .Op Fl v .Ar prov ... .Nm +.Cm create +.Op Fl Fnv +.Op Fl b Ar balance +.Op Fl s Ar slice +.Ar name +.Ar prov ... +.Nm .Cm configure .Op Fl adfFhnv .Op Fl b Ar balance @@ -170,6 +177,12 @@ Defaults to 4096 bytes. .El .It Cm clear Clear metadata on the given providers. +.It Cm create +Similar to +.Cm label, +but creates mirror without storing on-disk metadata in last sector. +This special "manual" operation mode assumes some external control to manage +mirror detection after reboot, device hot-plug and other external events. .It Cm configure Configure the given device. .Pp Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Nov 30 08:21:15 2016 (r309320) +++ head/sys/geom/mirror/g_mirror.c Wed Nov 30 09:27:08 2016 (r309321) @@ -700,6 +700,8 @@ g_mirror_clear_metadata(struct g_mirror_ g_topology_assert_not(); sx_assert(&disk->d_softc->sc_lock, SX_LOCKED); + if (disk->d_softc->sc_type != G_MIRROR_TYPE_AUTOMATIC) + return (0); error = g_mirror_write_metadata(disk, NULL); if (error == 0) { G_MIRROR_DEBUG(2, "Metadata on %s cleared.", @@ -765,6 +767,8 @@ g_mirror_update_metadata(struct g_mirror sc = disk->d_softc; sx_assert(&sc->sc_lock, SX_LOCKED); + if (sc->sc_type != G_MIRROR_TYPE_AUTOMATIC) + return; if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_WIPE) == 0) g_mirror_fill_metadata(sc, disk, &md); error = g_mirror_write_metadata(disk, &md); @@ -2942,8 +2946,9 @@ end: return (error); } -static struct g_geom * -g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md) +struct g_geom * +g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md, + u_int type) { struct g_mirror_softc *sc; struct g_geom *gp; @@ -2966,6 +2971,7 @@ g_mirror_create(struct g_class *mp, cons gp->access = g_mirror_access; gp->dumpconf = g_mirror_dumpconf; + sc->sc_type = type; sc->sc_id = md->md_mid; sc->sc_slice = md->md_slice; sc->sc_balance = md->md_balance; @@ -3142,6 +3148,8 @@ g_mirror_taste(struct g_class *mp, struc sc = gp->softc; if (sc == NULL) continue; + if (sc->sc_type != G_MIRROR_TYPE_AUTOMATIC) + continue; if (sc->sc_sync.ds_geom == gp) continue; if (strcmp(md.md_name, sc->sc_name) != 0) @@ -3154,7 +3162,7 @@ g_mirror_taste(struct g_class *mp, struc break; } if (gp == NULL) { - gp = g_mirror_create(mp, &md); + gp = g_mirror_create(mp, &md, G_MIRROR_TYPE_AUTOMATIC); if (gp == NULL) { G_MIRROR_DEBUG(0, "Cannot create device %s.", md.md_name); @@ -3302,6 +3310,19 @@ g_mirror_dumpconf(struct sbuf *sb, const } else { g_topology_unlock(); sx_xlock(&sc->sc_lock); + sbuf_printf(sb, "%s", indent); + switch (sc->sc_type) { + case G_MIRROR_TYPE_AUTOMATIC: + sbuf_printf(sb, "AUTOMATIC"); + break; + case G_MIRROR_TYPE_MANUAL: + sbuf_printf(sb, "MANUAL"); + break; + default: + sbuf_printf(sb, "UNKNOWN"); + break; + } + sbuf_printf(sb, "\n"); sbuf_printf(sb, "%s%u\n", indent, (u_int)sc->sc_id); sbuf_printf(sb, "%s%u\n", indent, sc->sc_syncid); sbuf_printf(sb, "%s%u\n", indent, sc->sc_genid); Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Wed Nov 30 08:21:15 2016 (r309320) +++ head/sys/geom/mirror/g_mirror.h Wed Nov 30 09:27:08 2016 (r309321) @@ -165,11 +165,15 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 +#define G_MIRROR_TYPE_MANUAL 0 +#define G_MIRROR_TYPE_AUTOMATIC 1 + /* Bump syncid on first write. */ #define G_MIRROR_BUMP_SYNCID 0x1 /* Bump genid immediately. */ #define G_MIRROR_BUMP_GENID 0x2 struct g_mirror_softc { + u_int sc_type; /* Device type (manual/automatic). */ u_int sc_state; /* Device state. */ uint32_t sc_slice; /* Slice size. */ uint8_t sc_balance; /* Balance algorithm. */ @@ -220,7 +224,11 @@ struct g_mirror_softc { }; #define sc_name sc_geom->name +struct g_mirror_metadata; + u_int g_mirror_ndisks(struct g_mirror_softc *sc, int state); +struct g_geom * g_mirror_create(struct g_class *mp, + const struct g_mirror_metadata *md, u_int type); #define G_MIRROR_DESTROY_SOFT 0 #define G_MIRROR_DESTROY_DELAYED 1 #define G_MIRROR_DESTROY_HARD 2 Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Wed Nov 30 08:21:15 2016 (r309320) +++ head/sys/geom/mirror/g_mirror_ctl.c Wed Nov 30 09:27:08 2016 (r309321) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -301,6 +302,182 @@ g_mirror_ctl_configure(struct gctl_req * } static void +g_mirror_create_orphan(struct g_consumer *cp) +{ + + KASSERT(1 == 0, ("%s called while creating %s.", __func__, + cp->provider->name)); +} + +static void +g_mirror_ctl_create(struct gctl_req *req, struct g_class *mp) +{ + struct g_mirror_metadata md; + struct g_geom *gp; + struct g_consumer *cp; + struct g_provider *pp; + struct g_mirror_softc *sc; + struct sbuf *sb; + const char *name; + char param[16]; + int *nargs; + intmax_t *val; + int *ival; + const char *sval; + int bal; + unsigned attached, no, sectorsize; + off_t mediasize; + + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); + if (nargs == NULL) { + gctl_error(req, "No '%s' argument.", "nargs"); + return; + } + if (*nargs <= 2) { + gctl_error(req, "Too few arguments."); + return; + } + + strlcpy(md.md_magic, G_MIRROR_MAGIC, sizeof(md.md_magic)); + md.md_version = G_MIRROR_VERSION; + name = gctl_get_asciiparam(req, "arg0"); + if (name == NULL) { + gctl_error(req, "No 'arg%u' argument.", 0); + return; + } + strlcpy(md.md_name, name, sizeof(md.md_name)); + md.md_mid = arc4random(); + md.md_all = *nargs - 1; + md.md_genid = 0; + md.md_syncid = 1; + md.md_sync_offset = 0; + val = gctl_get_paraml(req, "slice", sizeof(*val)); + if (val == NULL) { + gctl_error(req, "No slice argument."); + return; + } + md.md_slice = *val; + sval = gctl_get_asciiparam(req, "balance"); + if (sval == NULL) { + gctl_error(req, "No balance argument."); + return; + } + bal = balance_id(sval); + if (bal < 0) { + gctl_error(req, "Invalid balance algorithm."); + return; + } + md.md_balance = bal; + md.md_mflags = 0; + md.md_dflags = 0; + ival = gctl_get_paraml(req, "noautosync", sizeof(*ival)); + if (ival != NULL && *ival) + md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOAUTOSYNC; + ival = gctl_get_paraml(req, "nofailsync", sizeof(*ival)); + if (ival != NULL && *ival) + md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOFAILSYNC; + /* These fields not used in manual mode. */ + bzero(md.md_provider, sizeof(md.md_provider)); + md.md_provsize = 0; + + g_topology_lock(); + mediasize = OFF_MAX; + sectorsize = 0; + gp = g_new_geomf(mp, "%s", md.md_name); + gp->orphan = g_mirror_create_orphan; + cp = g_new_consumer(gp); + for (no = 1; no < *nargs; no++) { + snprintf(param, sizeof(param), "arg%u", no); + name = gctl_get_asciiparam(req, param); + if (name == NULL) { + gctl_error(req, "No 'arg%u' argument.", no); +err: + g_destroy_consumer(cp); + g_destroy_geom(gp); + g_topology_unlock(); + return; + } + if (strncmp(name, "/dev/", strlen("/dev/")) == 0) + name += strlen("/dev/"); + pp = g_provider_by_name(name); + if (pp == NULL) { + G_MIRROR_DEBUG(1, "Disk %s is invalid.", name); + gctl_error(req, "Disk %s is invalid.", name); + goto err; + } + g_attach(cp, pp); + if (g_access(cp, 1, 0, 0) != 0) { + G_MIRROR_DEBUG(1, "Can't open disk %s.", name); + gctl_error(req, "Can't open disk %s.", name); +err2: + g_detach(cp); + goto err; + } + if (pp->mediasize == 0 || pp->sectorsize == 0) { + G_MIRROR_DEBUG(1, "Disk %s has no media.", name); + gctl_error(req, "Disk %s has no media.", name); + g_access(cp, -1, 0, 0); + goto err2; + } + if (pp->mediasize < mediasize) + mediasize = pp->mediasize; + if (pp->sectorsize > sectorsize) + sectorsize = pp->sectorsize; + g_access(cp, -1, 0, 0); + g_detach(cp); + } + g_destroy_consumer(cp); + g_destroy_geom(gp); + md.md_mediasize = mediasize; + md.md_sectorsize = sectorsize; + md.md_mediasize -= (md.md_mediasize % md.md_sectorsize); + + gp = g_mirror_create(mp, &md, G_MIRROR_TYPE_MANUAL); + if (gp == NULL) { + gctl_error(req, "Can't create %s.", md.md_name); + g_topology_unlock(); + return; + } + + sc = gp->softc; + g_topology_unlock(); + sx_xlock(&sc->sc_lock); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_TASTING; + sb = sbuf_new_auto(); + sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); + for (attached = 0, no = 1; no < *nargs; no++) { + snprintf(param, sizeof(param), "arg%u", no); + name = gctl_get_asciiparam(req, param); + if (strncmp(name, "/dev/", strlen("/dev/")) == 0) + name += strlen("/dev/"); + pp = g_provider_by_name(name); + if (pp == NULL) { + G_MIRROR_DEBUG(1, "Provider %s disappear?!", name); + sbuf_printf(sb, " %s", name); + continue; + } + md.md_did = arc4random(); + md.md_priority = no - 1; + if (g_mirror_add_disk(sc, pp, &md) != 0) { + G_MIRROR_DEBUG(1, "Disk %u (%s) not attached to %s.", + no, pp->name, gp->name); + sbuf_printf(sb, " %s", pp->name); + continue; + } + attached++; + } + sbuf_finish(sb); + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_TASTING; + if (md.md_all != attached || + (sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + g_mirror_destroy(gp->softc, G_MIRROR_DESTROY_HARD); + gctl_error(req, "%s", sbuf_data(sb)); + } else + sx_xunlock(&sc->sc_lock); + sbuf_delete(sb); +} + +static void g_mirror_ctl_rebuild(struct gctl_req *req, struct g_class *mp) { struct g_mirror_metadata md; @@ -401,6 +578,7 @@ g_mirror_ctl_insert(struct gctl_req *req struct g_provider *provider; struct g_consumer *consumer; } *disks; + off_t mdsize; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -462,16 +640,6 @@ g_mirror_ctl_insert(struct gctl_req *req gctl_error(req, "Unknown provider %s.", name); continue; } - if (sc->sc_provider->mediasize > - pp->mediasize - pp->sectorsize) { - gctl_error(req, "Provider %s too small.", name); - continue; - } - if ((sc->sc_provider->sectorsize % pp->sectorsize) != 0) { - gctl_error(req, "Invalid sectorsize of provider %s.", - name); - continue; - } cp = g_new_consumer(sc->sc_geom); if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); @@ -479,9 +647,40 @@ g_mirror_ctl_insert(struct gctl_req *req continue; } if (g_access(cp, 0, 1, 1) != 0) { + gctl_error(req, "Cannot access provider %s.", name); +err: g_detach(cp); g_destroy_consumer(cp); - gctl_error(req, "Cannot access provider %s.", name); + continue; + } + mdsize = (sc->sc_type == G_MIRROR_TYPE_AUTOMATIC) ? + pp->sectorsize : 0; + if (sc->sc_provider->mediasize > pp->mediasize - mdsize) { + gctl_error(req, "Provider %s too small.", name); +err2: + g_access(cp, 0, -1, -1); + goto err; + } + if ((sc->sc_provider->sectorsize % pp->sectorsize) != 0) { + gctl_error(req, "Invalid sectorsize of provider %s.", + name); + goto err2; + } + if (sc->sc_type != G_MIRROR_TYPE_AUTOMATIC) { + g_access(cp, 0, -1, -1); + g_detach(cp); + g_destroy_consumer(cp); + g_topology_unlock(); + sc->sc_ndisks++; + g_mirror_fill_metadata(sc, NULL, &md); + md.md_priority = *priority; + if (*inactive) + md.md_dflags |= G_MIRROR_DISK_FLAG_INACTIVE; + if (g_mirror_add_disk(sc, pp, &md) != 0) { + sc->sc_ndisks--; + gctl_error(req, "Disk %s not inserted.", name); + } + g_topology_lock(); continue; } disks[n].provider = pp; @@ -872,6 +1071,8 @@ g_mirror_config(struct gctl_req *req, st g_topology_unlock(); if (strcmp(verb, "configure") == 0) g_mirror_ctl_configure(req, mp); + else if (strcmp(verb, "create") == 0) + g_mirror_ctl_create(req, mp); else if (strcmp(verb, "rebuild") == 0) g_mirror_ctl_rebuild(req, mp); else if (strcmp(verb, "insert") == 0) From owner-svn-src-head@freebsd.org Wed Nov 30 09:45:19 2016 Return-Path: Delivered-To: svn-src-head@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 53E68C5D305; Wed, 30 Nov 2016 09:45:19 +0000 (UTC) (envelope-from andrew@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 261FD1762; Wed, 30 Nov 2016 09:45:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU9jIfo058099; Wed, 30 Nov 2016 09:45:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU9jImi058097; Wed, 30 Nov 2016 09:45:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611300945.uAU9jImi058097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 09:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309322 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 09:45:19 -0000 Author: andrew Date: Wed Nov 30 09:45:18 2016 New Revision: 309322 URL: https://svnweb.freebsd.org/changeset/base/309322 Log: Only include FDT headders when building for FDT. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Wed Nov 30 09:27:08 2016 (r309321) +++ head/sys/arm/arm/gic.c Wed Nov 30 09:45:18 2016 (r309322) @@ -61,8 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT #include #include +#endif #include From owner-svn-src-head@freebsd.org Wed Nov 30 09:47:30 2016 Return-Path: Delivered-To: svn-src-head@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 41114C5D3B1; Wed, 30 Nov 2016 09:47:30 +0000 (UTC) (envelope-from andrew@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 1DFDE1944; Wed, 30 Nov 2016 09:47:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU9lTM4058214; Wed, 30 Nov 2016 09:47:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU9lTPM058212; Wed, 30 Nov 2016 09:47:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611300947.uAU9lTPM058212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 09:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309323 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 09:47:30 -0000 Author: andrew Date: Wed Nov 30 09:47:29 2016 New Revision: 309323 URL: https://svnweb.freebsd.org/changeset/base/309323 Log: Move the FDT specific parts of the GIC diver softc to the FDT attachment. This allows the driver to be built in a kernel with no FDT support, e.g. on arm64 with just ACPI. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.h head/sys/arm/arm/gic_fdt.c Modified: head/sys/arm/arm/gic.h ============================================================================== --- head/sys/arm/arm/gic.h Wed Nov 30 09:45:18 2016 (r309322) +++ head/sys/arm/arm/gic.h Wed Nov 30 09:47:29 2016 (r309323) @@ -75,9 +75,6 @@ struct arm_gic_softc { #endif #ifdef INTRNG - /* FDT child data */ - pcell_t addr_cells; - pcell_t size_cells; int nranges; struct arm_gic_range * ranges; #endif Modified: head/sys/arm/arm/gic_fdt.c ============================================================================== --- head/sys/arm/arm/gic_fdt.c Wed Nov 30 09:45:18 2016 (r309322) +++ head/sys/arm/arm/gic_fdt.c Wed Nov 30 09:47:29 2016 (r309323) @@ -60,6 +60,12 @@ struct arm_gic_devinfo { }; #endif +struct arm_gic_fdt_softc { + struct arm_gic_softc base; + pcell_t addr_cells; + pcell_t size_cells; +}; + static device_probe_t gic_fdt_probe; static device_attach_t gic_fdt_attach; static ofw_bus_get_devinfo_t gic_ofw_get_devinfo; @@ -102,7 +108,7 @@ static device_method_t gic_fdt_methods[] }; DEFINE_CLASS_1(gic, gic_fdt_driver, gic_fdt_methods, - sizeof(struct arm_gic_softc), arm_gic_driver); + sizeof(struct arm_gic_fdt_softc), arm_gic_driver); static devclass_t gic_fdt_devclass; @@ -128,7 +134,7 @@ static int gic_fdt_attach(device_t dev) { #ifdef INTRNG - struct arm_gic_softc *sc = device_get_softc(dev); + struct arm_gic_fdt_softc *sc = device_get_softc(dev); phandle_t pxref; intptr_t xref; #endif @@ -164,14 +170,14 @@ gic_fdt_attach(device_t dev) goto cleanup; } } else { - if (sc->gic_res[2] == NULL) { + if (sc->base.gic_res[2] == NULL) { device_printf(dev, "not root PIC must have defined interrupt\n"); intr_pic_deregister(dev, xref); goto cleanup; } - if (bus_setup_intr(dev, sc->gic_res[2], INTR_TYPE_CLK, - arm_gic_intr, NULL, sc, &sc->gic_intrhand)) { + if (bus_setup_intr(dev, sc->base.gic_res[2], INTR_TYPE_CLK, + arm_gic_intr, NULL, sc, &sc->base.gic_intrhand)) { device_printf(dev, "could not setup irq handler\n"); intr_pic_deregister(dev, xref); goto cleanup; @@ -209,7 +215,7 @@ gic_fdt_get_resource_list(device_t bus, } static int -arm_gic_fill_ranges(phandle_t node, struct arm_gic_softc *sc) +arm_gic_fill_ranges(phandle_t node, struct arm_gic_fdt_softc *sc) { pcell_t host_cells; cell_t *base_ranges; @@ -229,42 +235,42 @@ arm_gic_fill_ranges(phandle_t node, stru nbase_ranges = OF_getproplen(node, "ranges"); if (nbase_ranges < 0) return (-1); - sc->nranges = nbase_ranges / sizeof(cell_t) / + sc->base.nranges = nbase_ranges / sizeof(cell_t) / (sc->addr_cells + host_cells + sc->size_cells); - if (sc->nranges == 0) + if (sc->base.nranges == 0) return (0); - sc->ranges = malloc(sc->nranges * sizeof(sc->ranges[0]), + sc->base.ranges = malloc(sc->base.nranges * sizeof(sc->base.ranges[0]), M_DEVBUF, M_WAITOK); base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); OF_getencprop(node, "ranges", base_ranges, nbase_ranges); - for (i = 0, j = 0; i < sc->nranges; i++) { - sc->ranges[i].bus = 0; + for (i = 0, j = 0; i < sc->base.nranges; i++) { + sc->base.ranges[i].bus = 0; for (k = 0; k < sc->addr_cells; k++) { - sc->ranges[i].bus <<= 32; - sc->ranges[i].bus |= base_ranges[j++]; + sc->base.ranges[i].bus <<= 32; + sc->base.ranges[i].bus |= base_ranges[j++]; } - sc->ranges[i].host = 0; + sc->base.ranges[i].host = 0; for (k = 0; k < host_cells; k++) { - sc->ranges[i].host <<= 32; - sc->ranges[i].host |= base_ranges[j++]; + sc->base.ranges[i].host <<= 32; + sc->base.ranges[i].host |= base_ranges[j++]; } - sc->ranges[i].size = 0; + sc->base.ranges[i].size = 0; for (k = 0; k < sc->size_cells; k++) { - sc->ranges[i].size <<= 32; - sc->ranges[i].size |= base_ranges[j++]; + sc->base.ranges[i].size <<= 32; + sc->base.ranges[i].size |= base_ranges[j++]; } } free(base_ranges, M_DEVBUF); - return (sc->nranges); + return (sc->base.nranges); } static bool arm_gic_add_children(device_t dev) { - struct arm_gic_softc *sc; + struct arm_gic_fdt_softc *sc; struct arm_gic_devinfo *dinfo; phandle_t child, node; device_t cdev; From owner-svn-src-head@freebsd.org Wed Nov 30 10:17:04 2016 Return-Path: Delivered-To: svn-src-head@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 5DE05C5DADD; Wed, 30 Nov 2016 10:17:04 +0000 (UTC) (envelope-from andrew@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 2D6251A0B; Wed, 30 Nov 2016 10:17:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUAH31W070300; Wed, 30 Nov 2016 10:17:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUAH3Na070299; Wed, 30 Nov 2016 10:17:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611301017.uAUAH3Na070299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 10:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309324 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 10:17:04 -0000 Author: andrew Date: Wed Nov 30 10:17:03 2016 New Revision: 309324 URL: https://svnweb.freebsd.org/changeset/base/309324 Log: Mark the Alpine ethernet driver as FDT only. It calls alpine_serdes_resource_get which is defined in an FDT only file. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 30 09:47:29 2016 (r309323) +++ head/sys/conf/files Wed Nov 30 10:17:03 2016 (r309324) @@ -719,13 +719,13 @@ dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/aic7xxx/aic7xxx_reg_print.c optional ahc ahc_reg_pretty_print -dev/al_eth/al_eth.c optional al_eth \ +dev/al_eth/al_eth.c optional al_eth fdt \ no-depend \ compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" -dev/al_eth/al_init_eth_lm.c optional al_eth \ +dev/al_eth/al_init_eth_lm.c optional al_eth fdt \ no-depend \ compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" -dev/al_eth/al_init_eth_kr.c optional al_eth \ +dev/al_eth/al_init_eth_kr.c optional al_eth fdt \ no-depend \ compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" contrib/alpine-hal/al_hal_iofic.c optional al_iofic \ From owner-svn-src-head@freebsd.org Wed Nov 30 14:02:37 2016 Return-Path: Delivered-To: svn-src-head@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 91CD1C5DE3C; Wed, 30 Nov 2016 14:02:37 +0000 (UTC) (envelope-from rwatson@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 614E61F7F; Wed, 30 Nov 2016 14:02:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUE2aDm062825; Wed, 30 Nov 2016 14:02:36 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUE2a80062824; Wed, 30 Nov 2016 14:02:36 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201611301402.uAUE2a80062824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 30 Nov 2016 14:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309326 - head/usr.bin/login X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 14:02:37 -0000 Author: rwatson Date: Wed Nov 30 14:02:36 2016 New Revision: 309326 URL: https://svnweb.freebsd.org/changeset/base/309326 Log: Clarify warning message when failing to configure audit on user login: when au_user_mask() fails, it's not a failure to set the audit mask, but to calculate the audit mask -- and hence a condfiguration-file issue (of some sort). MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/usr.bin/login/login_audit.c Modified: head/usr.bin/login/login_audit.c ============================================================================== --- head/usr.bin/login/login_audit.c Wed Nov 30 12:06:03 2016 (r309325) +++ head/usr.bin/login/login_audit.c Wed Nov 30 14:02:36 2016 (r309326) @@ -80,7 +80,7 @@ au_login_success(void) /* Compute and set the user's preselection mask. */ if (au_user_mask(pwd->pw_name, &aumask) == -1) - errx(1, "could not set audit mask"); + errx(1, "could not calculate audit mask"); /* Set the audit info for the user. */ auinfo.ai_auid = uid; From owner-svn-src-head@freebsd.org Wed Nov 30 14:17:08 2016 Return-Path: Delivered-To: svn-src-head@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 00BC3C5D23E; Wed, 30 Nov 2016 14:17:08 +0000 (UTC) (envelope-from andrew@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 C481F1881; Wed, 30 Nov 2016 14:17:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUEH64M066827; Wed, 30 Nov 2016 14:17:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUEH6CP066826; Wed, 30 Nov 2016 14:17:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611301417.uAUEH6CP066826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 14:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309327 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 14:17:08 -0000 Author: andrew Date: Wed Nov 30 14:17:06 2016 New Revision: 309327 URL: https://svnweb.freebsd.org/changeset/base/309327 Log: Fix the alloc function the ThunderX PCIe driver calls, the previous function may not exist when FDT is removed from the kernel. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/cavium/thunder_pcie_common.c Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Wed Nov 30 14:02:36 2016 (r309326) +++ head/sys/arm64/cavium/thunder_pcie_common.c Wed Nov 30 14:17:06 2016 (r309327) @@ -204,7 +204,7 @@ thunder_pcie_alloc_resource(device_t dev end = start + count - 1; } - return (pci_host_generic_alloc_resource(dev, child, type, rid, start, - end, count, flags)); + return (pci_host_generic_core_alloc_resource(dev, child, type, rid, + start, end, count, flags)); } #endif From owner-svn-src-head@freebsd.org Wed Nov 30 14:18:53 2016 Return-Path: Delivered-To: svn-src-head@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 CCE64C5D2B3; Wed, 30 Nov 2016 14:18:53 +0000 (UTC) (envelope-from andrew@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 9C9CF1A18; Wed, 30 Nov 2016 14:18:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUEIqf8066972; Wed, 30 Nov 2016 14:18:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUEIqDk066971; Wed, 30 Nov 2016 14:18:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611301418.uAUEIqDk066971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 14:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309328 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 14:18:53 -0000 Author: andrew Date: Wed Nov 30 14:18:52 2016 New Revision: 309328 URL: https://svnweb.freebsd.org/changeset/base/309328 Log: Fix the PCI host generic FDT driver to call into the common code and not recurse into itself. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Wed Nov 30 14:17:06 2016 (r309327) +++ head/sys/dev/pci/pci_host_generic_fdt.c Wed Nov 30 14:18:52 2016 (r309328) @@ -152,7 +152,7 @@ pci_host_generic_attach(device_t dev) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); - error = pci_host_generic_attach(dev); + error = pci_host_generic_core_attach(dev); if (error != 0) return (error); @@ -327,15 +327,15 @@ pci_host_generic_alloc_resource(device_t #if defined(NEW_PCIB) && defined(PCI_RES_BUS) if (type == PCI_RES_BUS) { - return (pci_host_generic_alloc_resource(dev, child, type, rid, + return (pci_host_generic_core_alloc_resource(dev, child, type, rid, start, end, count, flags)); } #endif /* For PCIe devices that do not have FDT nodes, use PCIB method */ if ((int)ofw_bus_get_node(child) <= 0) - return (pci_host_generic_alloc_resource(dev, child, type, rid, - start, end, count, flags)); + return (pci_host_generic_core_alloc_resource(dev, child, type, + rid, start, end, count, flags)); /* For other devices use OFW method */ sc = device_get_softc(dev); @@ -377,8 +377,8 @@ pci_host_generic_alloc_resource(device_t } } - return (bus_generic_alloc_resource(dev, child, type, rid, start, end, - count, flags)); + return (bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags)); } static int From owner-svn-src-head@freebsd.org Wed Nov 30 18:34:42 2016 Return-Path: Delivered-To: svn-src-head@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 3248DC5D1D6; Wed, 30 Nov 2016 18:34:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01BB61687; Wed, 30 Nov 2016 18:34:41 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUIYfOe075428; Wed, 30 Nov 2016 18:34:41 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUIYfQs075427; Wed, 30 Nov 2016 18:34:41 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611301834.uAUIYfQs075427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 18:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309331 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 18:34:42 -0000 Author: vangyzen Date: Wed Nov 30 18:34:40 2016 New Revision: 309331 URL: https://svnweb.freebsd.org/changeset/base/309331 Log: Include limits.h for CHAR_MAX This was needed on stable/10. Apparently, sys/param.h supplies CHAR_MAX on head. Include limits.h anyway, for consistency, and because C says so. Sponsored by: Dell EMC Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Wed Nov 30 18:26:22 2016 (r309330) +++ head/usr.bin/locale/locale.c Wed Nov 30 18:34:40 2016 (r309331) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Wed Nov 30 19:06:48 2016 Return-Path: Delivered-To: svn-src-head@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 54E33C5DD11; Wed, 30 Nov 2016 19:06:48 +0000 (UTC) (envelope-from dim@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 24C931808; Wed, 30 Nov 2016 19:06:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUJ6lQk087764; Wed, 30 Nov 2016 19:06:47 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUJ6lKX087763; Wed, 30 Nov 2016 19:06:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611301906.uAUJ6lKX087763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 30 Nov 2016 19:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309332 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 19:06:48 -0000 Author: dim Date: Wed Nov 30 19:06:47 2016 New Revision: 309332 URL: https://svnweb.freebsd.org/changeset/base/309332 Log: Cleanup old debug dirs in delete-old-dirs target Any .debug or .symbols files under /usr/lib/debug which correspond to OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up by the delete-old target. Make this also apply to any OLD_DIRS entries. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D8683 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 30 18:34:40 2016 (r309331) +++ head/Makefile.inc1 Wed Nov 30 19:06:47 2016 (r309332) @@ -2404,6 +2404,11 @@ delete-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done @echo ">>> Old directories removed" @@ -2418,6 +2423,11 @@ check-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done delete-old: delete-old-files delete-old-dirs .PHONY From owner-svn-src-head@freebsd.org Wed Nov 30 19:57:22 2016 Return-Path: Delivered-To: svn-src-head@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 1DEC1C5DC1E; Wed, 30 Nov 2016 19:57:22 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0288E1082; Wed, 30 Nov 2016 19:57:22 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 548691FA5; Wed, 30 Nov 2016 19:57:21 +0000 (UTC) To: des@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308996 - head/lib/libfetch In-Reply-To: <201611221330.uAMDU7fg052989@repo.freebsd.org> Message-Id: <20161130195721.548691FA5@freefall.freebsd.org> Date: Wed, 30 Nov 2016 19:57:21 +0000 (UTC) From: jbeich@freebsd.org (Jan Beich) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 19:57:22 -0000 Dag-Erling Smørgrav writes: > conn_t * > fetch_connect(const char *host, int port, int af, int verbose) > { [...] > + fetch_info("resolved"); Can you hide it behind "verbose" flag to avoid confusion? $ pkg The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest, please wait... resolved resolved [...] $ fetch -q http://example.com resolved From owner-svn-src-head@freebsd.org Wed Nov 30 20:41:01 2016 Return-Path: Delivered-To: svn-src-head@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 32F7AC5E865 for ; Wed, 30 Nov 2016 20:41:01 +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 1775B1962 for ; Wed, 30 Nov 2016 20:41:00 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 4a9ac7e5-b73d-11e6-9ec7-5d8fa496b077 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 4a9ac7e5-b73d-11e6-9ec7-5d8fa496b077; Wed, 30 Nov 2016 20:40:55 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uAUKepYb001753; Wed, 30 Nov 2016 13:40:51 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480538451.1889.187.camel@freebsd.org> Subject: Re: svn commit: r309121 - head/usr.sbin/bhyve From: Ian Lepore To: Jakub Klama Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 30 Nov 2016 13:40:51 -0700 In-Reply-To: <7F692FF4-4F36-4ED8-AF26-4684D41CB3AE@ixsystems.com> References: <201611242216.uAOMGIi0065703@repo.freebsd.org> <1480026232.1889.63.camel@freebsd.org> <7F692FF4-4F36-4ED8-AF26-4684D41CB3AE@ixsystems.com> Content-Type: text/plain; charset="iso-8859-2" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 20:41:01 -0000 On Thu, 2016-11-24 at 23:27 +0100, Jakub Klama wrote: > > > > Wiadomo¶æ napisana przez Ian Lepore w dniu > > 24.11.2016, o godz. 23:23: > > > > On Thu, 2016-11-24 at 22:16 +0000, Jakub Wojciech Klama wrote: > > > > > > Author: jceel > > > Date: Thu Nov 24 22:16:18 2016 > > > New Revision: 309121 > > > URL: https://svnweb.freebsd.org/changeset/base/309121 > > > > > > Log: > > >  virtio_console: handle short writes to an Unix domain socket > > > gracefully. > > > > > >  writev() can do a short write.  Retrying it results in a very > > > convoluted > > >  and complex code, so we iterate over iovec and do regular > > > stream_write() > > >  instead. > > > > > Doesn't pwritev(2) simplify iterating to handle short writes? > > > Correct me if I'm wrong, but pwritev(2) is a writev(2) with offset. > We're writing to an Unix domain socket here, which is not seekable. > > Thanks, > Jakub > > My bad, I was under the impression the offset was an offset into the iovec, not into the file.  So, ummm... nevermind. :) -- Ian From owner-svn-src-head@freebsd.org Wed Nov 30 21:59:53 2016 Return-Path: Delivered-To: svn-src-head@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 A47BCC5E28F; Wed, 30 Nov 2016 21:59:53 +0000 (UTC) (envelope-from cem@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 58BBF1E70; Wed, 30 Nov 2016 21:59:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAULxqG0057528; Wed, 30 Nov 2016 21:59:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAULxqBP057526; Wed, 30 Nov 2016 21:59:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201611302159.uAULxqBP057526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 30 Nov 2016 21:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309338 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 21:59:53 -0000 Author: cem Date: Wed Nov 30 21:59:52 2016 New Revision: 309338 URL: https://svnweb.freebsd.org/changeset/base/309338 Log: ioat(4): Fix 'bogus completion_pending' KASSERT Fix ioat_release to only set is_completion_pending if DMAs were actually queued. Otherwise, the spurious flag could trigger an assert in the reset path on INVARIANTS kernels. Reviewed by: bdrewery, Suraj Raju @ Isilon Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Wed Nov 30 21:53:06 2016 (r309337) +++ head/sys/dev/ioat/ioat.c Wed Nov 30 21:59:52 2016 (r309338) @@ -947,6 +947,7 @@ ioat_acquire(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); mtx_lock(&ioat->submit_lock); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); + ioat->acq_head = ioat->head; } int @@ -976,12 +977,15 @@ ioat_release(bus_dmaengine_t dmaengine) CTR4(KTR_IOAT, "%s channel=%u dispatch2 hw_head=%u head=%u", __func__, ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); - ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head); - - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); + if (ioat->acq_head != ioat->head) { + ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, + (uint16_t)ioat->hw_head); + + if (!ioat->is_completion_pending) { + ioat->is_completion_pending = TRUE; + callout_reset(&ioat->poll_timer, 1, + ioat_poll_timer_callback, ioat); + } } mtx_unlock(&ioat->submit_lock); } Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Wed Nov 30 21:53:06 2016 (r309337) +++ head/sys/dev/ioat/ioat_internal.h Wed Nov 30 21:59:52 2016 (r309338) @@ -483,6 +483,7 @@ struct ioat_softc { boolean_t resetting_cleanup; /* cleanup_lock */ uint32_t head; + uint32_t acq_head; uint32_t tail; uint32_t hw_head; uint32_t ring_size_order; From owner-svn-src-head@freebsd.org Wed Nov 30 22:00:26 2016 Return-Path: Delivered-To: svn-src-head@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 86CA0C5E2FA; Wed, 30 Nov 2016 22:00:26 +0000 (UTC) (envelope-from gjb@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 6157A1FFD; Wed, 30 Nov 2016 22:00:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUM0Pd1057638; Wed, 30 Nov 2016 22:00:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUM0PJx057635; Wed, 30 Nov 2016 22:00:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201611302200.uAUM0PJx057635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 30 Nov 2016 22:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309339 - in head: . release/scripts share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 22:00:26 -0000 Author: gjb Date: Wed Nov 30 22:00:25 2016 New Revision: 309339 URL: https://svnweb.freebsd.org/changeset/base/309339 Log: Revert r309314, which breaks installing ports. Requested by: antoine Differential Revision: https://reviews.freebsd.org/D8120 (related) Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 head/release/scripts/make-pkg-package.sh head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 30 21:59:52 2016 (r309338) +++ head/Makefile.inc1 Wed Nov 30 22:00:25 2016 (r309339) @@ -1379,8 +1379,7 @@ packages: .PHONY package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \ - PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \ - WSTAGEDIR=${WSTAGEDIR} \ + PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \ sh ${.CURDIR}/release/scripts/make-pkg-package.sh real-packages: stage-packages create-packages sign-packages .PHONY @@ -1418,11 +1417,11 @@ create-world-packages: _pkgbootstrap .PH /^name/ { printf("===> Creating %s-", $$2); next } \ /^version/ { print $$2; next } \ ' ${WSTAGEDIR}/$${pkgname}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${WSTAGEDIR}/$${pkgname}.ucl \ -p ${WSTAGEDIR}/$${pkgname}.plist \ -r ${WSTAGEDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ done create-kernel-packages: _pkgbootstrap .PHONY @@ -1446,11 +1445,11 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" @@ -1475,25 +1474,25 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .endfor .endif sign-packages: _pkgbootstrap .PHONY - @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ - unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + @[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ + unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ - ln -s ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest + ln -s ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest # # Modified: head/release/scripts/make-pkg-package.sh ============================================================================== --- head/release/scripts/make-pkg-package.sh Wed Nov 30 21:59:52 2016 (r309338) +++ head/release/scripts/make-pkg-package.sh Wed Nov 30 22:00:25 2016 (r309339) @@ -8,7 +8,6 @@ eval $(make -C ${SRCDIR} TARGET=${TARGET export WRKDIRPREFIX=/tmp/ports.${TARGET} export WSTAGEDIR=${WSTAGEDIR} export REPODIR=${REPODIR} -export PKG_CMD=${PKG_CMD} export PKG_VERSION=${PKG_VERSION} export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR) @@ -16,11 +15,11 @@ make -C ${PORTSDIR}/ports-mgmt/pkg TARGE CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \ stage create-manifest -${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh \ +pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh \ create -v -m ${WRKDIR}/.metadir/ \ -r ${WRKDIR}/stage \ -p ${WRKDIR}/.PLIST.mktmp \ - -o ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} -mkdir -p ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ -cd ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ + -o ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} +mkdir -p ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ +cd ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ ln -s ../pkg-*.txz Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Nov 30 21:59:52 2016 (r309338) +++ head/share/mk/bsd.own.mk Wed Nov 30 22:00:25 2016 (r309339) @@ -116,9 +116,6 @@ # NLSMODE National Language Support files mode. [${NOBINMODE}] # # INCLUDEDIR Base path for standard C include files [/usr/include] -# -# PKG_CMD Program for creating and manipulating packages. -# [pkg] .if !target(____) ____: @@ -252,8 +249,6 @@ XZ_CMD?= xz -T ${XZ_THREADS} XZ_CMD?= xz .endif -PKG_CMD?= pkg - # Pointer to the top directory into which tests are installed. Should not be # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests From owner-svn-src-head@freebsd.org Thu Dec 1 00:19:23 2016 Return-Path: Delivered-To: svn-src-head@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 D9DDFC5D8D6; Thu, 1 Dec 2016 00:19:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 617EC13C1; Thu, 1 Dec 2016 00:19:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 60B4410420A1; Thu, 1 Dec 2016 11:19:20 +1100 (AEDT) Date: Thu, 1 Dec 2016 11:19:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eric van Gyzen cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309331 - head/usr.bin/locale In-Reply-To: <201611301834.uAUIYfQs075427@repo.freebsd.org> Message-ID: <20161201082459.T1285@besplex.bde.org> References: <201611301834.uAUIYfQs075427@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=kj9zAlcOel0A:10 a=jWiCfzBZR5YcepJ51wAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 00:19:24 -0000 On Wed, 30 Nov 2016, Eric van Gyzen wrote: > Log: > Include limits.h for CHAR_MAX > > This was needed on stable/10. Apparently, sys/param.h supplies CHAR_MAX > on head. Include limits.h anyway, for consistency, and because C says so. sys/param.actually supplies CHAR_MAX (undocumented namespace pollution) in all versions of FreeBSD. The function that uses this has many bugs, but most are only style bugs due to various magic. X char * X format_grouping(const char *binary) X { X static char rval[64]; X const char *cp; X size_t len; X X rval[0] = '\0'; X for (cp = binary; *cp != '\0'; ++cp) { X char group[sizeof("127;")]; This hard-codes CHAR_MAX is 127. This works accidentally on POSIX >= 2100 since POSIX now specifies 8-bit chars, and even if chars are unsigned so that CHAR_MAX is 255, that fits in the same space as 127. X snprintf(group, sizeof(group), "%hhd;", *cp); X len = strlcat(rval, group, sizeof(rval)); X if (len >= sizeof(rval)) { X len = sizeof(rval) - 1; X break; X } I don't like the error handling. It is too careful, yet not careful enough to be correct. Use of snprintf() with no error handling instead of sprintf() has no effect unless there are bugs, but there are bugs. The first few are: - if chars are signed, then *cp may be negative. This is an invalid format, but we should check it. Negative chars are converted to garbage starting with a minus sign. group[] is too small to hold large ones. We defend against buffer overruns by using snprintf(), but don't check for errors. Truncation gives further garbage. - %hhd is a bogus format if chars are signed. Then hh in it has no effect - %hhd is a broken format if chars are unsigned. It says to convert the arg to signed char. On non-exotic machines with CHAR_MAX = 255, this corrupts values between 128 and 255 to negative ones. Large values are unlikely/physically impossible, but CHAR_MAX is a magic sentinel value which I think we want to print as itself (users also need to know what CHAR_MAX is to decode it). - on exotic machines, CHAR_MAX can be UINT_MAX. Then char promotes to u_int and %d format would give undefined behaviour if the value exceeds INT_MAX. %hhd is no better for avoiding the undefined behviour, and when it works normally it corrupts large values as for the non-exotic case. X if (*cp == CHAR_MAX) { X break; X } X } X X /* Remove the trailing ';'. */ X rval[len - 1] = '\0'; This writes outside of rval when binary is the null string. Possible for at least invalid formats. len should be initialized to 0 in this case, but it actually uninitialized, so compilers will warn at high WARNS even if this case is unreachable. X X return (rval); X } Untested fixes and cleanups: Y diff -u2 locale.c~ locale.c Y --- locale.c~ 2016-11-25 08:26:48.000000000 +0000 Y +++ locale.c 2016-12-01 00:09:23.603179000 +0000 Y @@ -495,27 +495,27 @@ Y static char rval[64]; Y const char *cp; Y - size_t len; Y + size_t roff; Y + int len; Y Y rval[0] = '\0'; Y + roff = 0; Y for (cp = binary; *cp != '\0'; ++cp) { Y - char group[sizeof("127;")]; Y - snprintf(group, sizeof(group), "%hhd;", *cp); Y - len = strlcat(rval, group, sizeof(rval)); Y - if (len >= sizeof(rval)) { Y - len = sizeof(rval) - 1; Y - break; Y - } Y - if (*cp == CHAR_MAX) { Y - break; Y - } Y + if (*cp < 0) Y + break; /* garbage input */ Y + len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp); Y + if (len < 0 || len >= sizeof(rval) - roff) Y + break; /* insufficient space for output */ Y + roff += len; Y + if (*cp == CHAR_MAX) Y + break; /* special termination */ Y } Y Y - /* Remove the trailing ';'. */ Y - rval[len - 1] = '\0'; Y + /* Truncate at the last successfully snprintf()ed semicolon. */ Y + if (roff != 0) Y + rval[roff - 1] = '\0'; Y Y - return (rval); Y + return (&rval[0]); Y } Y Y - Y /* Y * keyword value lookup helper (via localeconv()) It was much easier to just use snprintf(). The error handling can be further simplified by checking if rval[] is large enough up front. It needs to have size strlen("255;") * strlen(binary) + 1, where 255 is POSIX CHAR_MAX hard-coded. Bruce From owner-svn-src-head@freebsd.org Thu Dec 1 01:32:14 2016 Return-Path: Delivered-To: svn-src-head@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 67AC6C5DDFA; Thu, 1 Dec 2016 01:32:14 +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 4243B1986; Thu, 1 Dec 2016 01:32:14 +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 uB11WDSr046955; Thu, 1 Dec 2016 01:32:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB11WD9v046953; Thu, 1 Dec 2016 01:32:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612010132.uB11WD9v046953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 1 Dec 2016 01:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309341 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 01:32:14 -0000 Author: pfg Date: Thu Dec 1 01:32:13 2016 New Revision: 309341 URL: https://svnweb.freebsd.org/changeset/base/309341 Log: indent(1): Avoid out of bound access of array in_buffer Work-around a somewhat complex interaction within the code. From Piotr's commit [1]: When pr_comment() calls dump_line() for the first line of a multiline comment, it doesn't include any indentation - it starts with the "/*". This is consistent for both boxed and not boxed comments. Where the logic diverges is in how it treats the rest of the lines of the comment. For box comments indent assumes that it must not change anything, so lines are dumped as they were, including the indentation where it exists. For the rest of comments, it will first remove the indentation to store plain text of the comment and then add it again where indent thinks it's appropriate -- this is part of comment re-indenting process. For continuations of multi-line comments, the code that handles comments in dump_line() will use pad_output() to create indentation from the beginning of the line (what indent calls the first column) and then write string pointed by s_com afterwards. But if it's a box comment, the string will include original indentation, unless it's the first line of the comment. This is why tab characters from s_com have to be considered when calculating how much padding is needed and the "while (*com_st == '\t') com_st++, target += 8;" does that. In dump_line(), /target/ is initially set to ps.com_col, so it always assumes that indentation needs to be produced in this function, regardless of which line of a box comment it is. But for the first line of a box comment it is not true, so pr_comment() signals it by setting ps.n_comment_delta, the negative comment delta, to a negative number which is then added to /target/ in dump_line() on all lines except the first one, so that the function produces adequate indentation in this special case. The bug was in how that negative offset was calculated: pr_comment() used count_spaces() on in_buffer, which pr_comment() expected to contain non-null terminated sequence of characters, originating from whatever originally was on the left side of the comment. Understanding that count_spaces() requires a string, pr_comment() temporarily set buf_ptr[-2] to 0 in hope that it would nul-terminate the right thing in in_buffer and calling count_spaces() would be safe and do the expected thing. This was false whenever buf_ptr would point into save_com, an entirely different char array than in_buffer. The short-term fix is to recognize whether buf_ptr points into in_buffer or save_com. Reference: [1] https://github.com/pstef/freebsd_indent/commit/ea486a2aa3b056b146bdfbb8e94843159750f200 Taken from: Piotr Stefaniak Modified: head/usr.bin/indent/io.c head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Wed Nov 30 22:20:23 2016 (r309340) +++ head/usr.bin/indent/io.c Thu Dec 1 01:32:13 2016 (r309341) @@ -225,8 +225,9 @@ dump_line(void) char *com_st = s_com; target += ps.comment_delta; - while (*com_st == '\t') - com_st++, target += 8; /* ? */ + while (*com_st == '\t') /* consider original indentation in + * case this is a box comment */ + com_st++, target += 8; while (target <= 0) if (*com_st == ' ') target++, com_st++; Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Wed Nov 30 22:20:23 2016 (r309340) +++ head/usr.bin/indent/pr_comment.c Thu Dec 1 01:32:13 2016 (r309341) @@ -147,9 +147,16 @@ pr_comment(void) } } if (ps.box_com) { - buf_ptr[-2] = 0; - ps.n_comment_delta = 1 - count_spaces(1, in_buffer); - buf_ptr[-2] = '/'; + /* + * Find out how much indentation there was originally, because that + * much will have to be ignored by pad_output() in dump_line(). This + * is a box comment, so nothing changes -- not even indentation. + * + * The comment we're about to read usually comes from in_buffer, + * unless it has been copied into save_com. + */ + char *start = buf_ptr >= save_com && buf_ptr < save_com + sc_size ? bp_save : buf_ptr; + ps.n_comment_delta = 1 - count_spaces_until(1, in_buffer, start - 2); } else { ps.n_comment_delta = 0; From owner-svn-src-head@freebsd.org Thu Dec 1 01:48:58 2016 Return-Path: Delivered-To: svn-src-head@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 03137C5E7F2; Thu, 1 Dec 2016 01:48:58 +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 C6F5F146A; Thu, 1 Dec 2016 01:48:57 +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 uB11muAS051387; Thu, 1 Dec 2016 01:48:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB11muut051386; Thu, 1 Dec 2016 01:48:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612010148.uB11muut051386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 1 Dec 2016 01:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309342 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 01:48:58 -0000 Author: pfg Date: Thu Dec 1 01:48:56 2016 New Revision: 309342 URL: https://svnweb.freebsd.org/changeset/base/309342 Log: indent(1): Don't ignore newlines after comments that follow braces. indent.c has a special loop that stores tokens from between an if () and the next statement into a buffer. The loop ignored all newlines, but that resulted in not calling dump_line() when it was needed to produce the final line of the buffered up comment. Taken from: Piotr Stefaniak Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Thu Dec 1 01:32:13 2016 (r309341) +++ head/usr.bin/indent/indent.c Thu Dec 1 01:48:56 2016 (r309342) @@ -335,8 +335,10 @@ main(int argc, char **argv) switch (type_code) { case newline: ++line_no; - if (sc_end != NULL) - goto sw_buffer; /* dump comment, if any */ + if (sc_end != NULL) { /* dump comment, if any */ + *sc_end++ = '\n'; /* newlines are needed in this case */ + goto sw_buffer; + } flushed_nl = true; case form_feed: break; /* form feeds and newlines found here will be From owner-svn-src-head@freebsd.org Thu Dec 1 01:56:36 2016 Return-Path: Delivered-To: svn-src-head@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 33BEEC5ED07; Thu, 1 Dec 2016 01:56:36 +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 036C81AD0; Thu, 1 Dec 2016 01:56:35 +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 uB11uZ1L055377; Thu, 1 Dec 2016 01:56:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB11uZXK055376; Thu, 1 Dec 2016 01:56:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612010156.uB11uZXK055376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 1 Dec 2016 01:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309343 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 01:56:36 -0000 Author: pfg Date: Thu Dec 1 01:56:34 2016 New Revision: 309343 URL: https://svnweb.freebsd.org/changeset/base/309343 Log: indent(1): Don't unnecessarily add a blank before a comment ends. pr_comment() did avoid adding surplus space character when a comment contained it at the end. Now it's also paying attention to tabs. Taken from: Piotr Stefaniak Modified: head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Thu Dec 1 01:48:56 2016 (r309342) +++ head/usr.bin/indent/pr_comment.c Thu Dec 1 01:56:34 2016 (r309343) @@ -293,7 +293,7 @@ pr_comment(void) s_com = e_com; *e_com++ = ' '; } - if (e_com[-1] != ' ' && !ps.box_com) + if (e_com[-1] != ' ' && e_com[-1] != '\t' && !ps.box_com) *e_com++ = ' '; /* ensure blank before end */ *e_com++ = '*', *e_com++ = '/', *e_com = '\0'; ps.just_saw_decl = l_just_saw_decl; From owner-svn-src-head@freebsd.org Thu Dec 1 02:21:38 2016 Return-Path: Delivered-To: svn-src-head@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 08750C5E34D; Thu, 1 Dec 2016 02:21:38 +0000 (UTC) (envelope-from cem@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 CC5F41D9F; Thu, 1 Dec 2016 02:21:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB12Lbov067203; Thu, 1 Dec 2016 02:21:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB12Lb6x067202; Thu, 1 Dec 2016 02:21:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612010221.uB12Lb6x067202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 1 Dec 2016 02:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309344 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 02:21:38 -0000 Author: cem Date: Thu Dec 1 02:21:36 2016 New Revision: 309344 URL: https://svnweb.freebsd.org/changeset/base/309344 Log: Remove a death threat from the FreeBSD sources Reported by: koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, ngie@, cem@ Maintainer timeout: des@ Modified: head/lib/libutil/flopen.c Modified: head/lib/libutil/flopen.c ============================================================================== --- head/lib/libutil/flopen.c Thu Dec 1 01:56:34 2016 (r309343) +++ head/lib/libutil/flopen.c Thu Dec 1 02:21:36 2016 (r309344) @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); /* * Reliably open and lock a file. * - * DO NOT, UNDER PAIN OF DEATH, modify this code without first reading the - * revision history and discussing your changes with . - * Don't be fooled by the code's apparent simplicity; there would be no - * need for this function if it was as easy to get right as you think. + * Please do not modify this code without first reading the revision history + * and discussing your changes with . Don't be fooled by the + * code's apparent simplicity; there would be no need for this function if it + * was easy to get right. */ int flopen(const char *path, int flags, ...) @@ -108,7 +108,11 @@ flopen(const char *path, int flags, ...) errno = serrno; return (-1); } -#ifdef DONT_EVEN_THINK_ABOUT_IT + /* + * The following change is provided as a specific example to + * avoid. + */ +#if 0 if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) { serrno = errno; (void)close(fd); From owner-svn-src-head@freebsd.org Thu Dec 1 02:35:16 2016 Return-Path: Delivered-To: svn-src-head@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 9BEE0C5EF35; Thu, 1 Dec 2016 02:35:16 +0000 (UTC) (envelope-from loos@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 6B83D1A2F; Thu, 1 Dec 2016 02:35:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB12ZFLc071334; Thu, 1 Dec 2016 02:35:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB12ZFFN071333; Thu, 1 Dec 2016 02:35:15 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612010235.uB12ZFFN071333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 1 Dec 2016 02:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309345 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 02:35:16 -0000 Author: loos Date: Thu Dec 1 02:35:15 2016 New Revision: 309345 URL: https://svnweb.freebsd.org/changeset/base/309345 Log: The RX_FREEBUFFER registers are a write to increment field. Writing the full queue size to it every time was makeing it overflow with a lot of bogus values. This fixes the interrupt storms on irq 40. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 02:21:36 2016 (r309344) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 02:35:15 2016 (r309345) @@ -1760,7 +1760,7 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) sc->rx.queue_adds += added; sc->rx.avail_queue_len -= added; sc->rx.active_queue_len += added; - cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), sc->rx.active_queue_len); + cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), added); if (sc->rx.active_queue_len > sc->rx.max_active_queue_len) { sc->rx.max_active_queue_len = sc->rx.active_queue_len; } From owner-svn-src-head@freebsd.org Thu Dec 1 03:07:59 2016 Return-Path: Delivered-To: svn-src-head@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 DC551C5E965; Thu, 1 Dec 2016 03:07:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (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 AD39811ED; Thu, 1 Dec 2016 03:07:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id 144so11054306pfv.0; Wed, 30 Nov 2016 19:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TsaIeffNhhqXio7V8tGRMkWapp5FuF6Vj4f8Wx1SVl8=; b=sz7HJojE1bMbgpDNl2Ogp119tolaSppbeLWxsIJPMwlHy2YcBfSLYj6eygX94CNjNm dIFLXzUt+iaIeS8oAi/mv3t/4UK9szNwWi8L0Ao5DIJ79jiiPIBNHExc6Q9Egd+bpuxn WVhZPu1Eva3lTp2AZeFCuLamK/Jom7VJy0Y+VvEFqzxkRp1ObnEVxQ+MF2g+cY+YRJVH zTzijoNnuE8srsCAqSziEft+OemHPtFQC78aUNtS9pFOioTnlkXyakEFfcOt0laLwwEd X/BMlCcxuxU7BUhP+4K9RZb8gb25bEbYKwPIeyhMraz+xlhwkTe4WxL+SWLGp95dEvqa KYgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TsaIeffNhhqXio7V8tGRMkWapp5FuF6Vj4f8Wx1SVl8=; b=HOP8qnt//MPHSXMFIMR8N7bENagFEE0eZ55PzdZUmLlS03euDb00FdpoCzeKHwaYlb FzxXX67Yjy48hjd0VDq8r4+CSjq6VQb1MlaVQFxCNfF5ts0IZp2fQqKcDw2a9xNKndo8 nEImZumGfP3VstDFZZ7JdthG8HZ2CacOIaMnCcAOe2liNMuqrYgE7t1E9WDE8he3B1a/ Dd/VrKXgN/5AgaJOmn5LCoAJIUftMP5P/A8vlFuSe2GTpTlwWbk3SbCcjkOjVXHPAwK8 kIw2g1KndOgUoUDAo9cIkDiAnkdOgcqErQoFtw8nOdVHH/w7FD5wP6cxm3bq8Q99CnWD 2OtA== X-Gm-Message-State: AKaTC03fNxp24DBy5Ver29/6a+VHOMdJ4BQCM67yhBs5SB+gwX3SURFQobnQdsbm2j0tPQ== X-Received: by 10.99.37.195 with SMTP id l186mr64510827pgl.91.1480561679135; Wed, 30 Nov 2016 19:07:59 -0800 (PST) Received: from ?IPv6:2607:fb90:80a6:d7d:3150:ed8c:ca08:27e4? ([2607:fb90:80a6:d7d:3150:ed8c:ca08:27e4]) by smtp.gmail.com with ESMTPSA id 72sm102541894pfw.37.2016.11.30.19.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 19:07:58 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r309344 - head/lib/libutil From: Ngie Cooper X-Mailer: iPhone Mail (14B100) In-Reply-To: <201612010221.uB12Lb6x067202@repo.freebsd.org> Date: Wed, 30 Nov 2016 19:07:57 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> To: "Conrad E. Meyer" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:08:00 -0000 > On Nov 30, 2016, at 18:21, Conrad E. Meyer wrote: >=20 > Author: cem > Date: Thu Dec 1 02:21:36 2016 > New Revision: 309344 > URL: https://svnweb.freebsd.org/changeset/base/309344 >=20 > Log: > Remove a death threat from the FreeBSD sources >=20 > Reported by: koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, ngie@, ce= m@ > Maintainer timeout: des@ Really?? I wish you hadn't added me to this list.. I don't in any way endors= e the way that you went about dealing with this disagreement. You kind of ju= st pissed all over what des@ did out of spite. > Modified: > head/lib/libutil/flopen.c >=20 > Modified: head/lib/libutil/flopen.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/lib/libutil/flopen.c Thu Dec 1 01:56:34 2016 (r309343) > +++ head/lib/libutil/flopen.c Thu Dec 1 02:21:36 2016 (r309344) > @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); > /* > * Reliably open and lock a file. > * > - * DO NOT, UNDER PAIN OF DEATH, modify this code without first reading th= e > - * revision history and discussing your changes with . > - * Don't be fooled by the code's apparent simplicity; there would be no > - * need for this function if it was as easy to get right as you think. > + * Please do not modify this code without first reading the revision hist= ory > + * and discussing your changes with . Don't be fooled b= y the > + * code's apparent simplicity; there would be no need for this function i= f it > + * was easy to get right. > */ > int > flopen(const char *path, int flags, ...) > @@ -108,7 +108,11 @@ flopen(const char *path, int flags, ...) > errno =3D serrno; > return (-1); > } > -#ifdef DONT_EVEN_THINK_ABOUT_IT > + /* > + * The following change is provided as a specific example to > + * avoid. > + */ > +#if 0 > if (fcntl(fd, F_SETFD, FD_CLOEXEC) !=3D 0) { > serrno =3D errno; > (void)close(fd); >=20 From owner-svn-src-head@freebsd.org Thu Dec 1 03:27:18 2016 Return-Path: Delivered-To: svn-src-head@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 2B878C5E61D; Thu, 1 Dec 2016 03:27:18 +0000 (UTC) (envelope-from sephe@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 E066B1F98; Thu, 1 Dec 2016 03:27:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB13RHQF092077; Thu, 1 Dec 2016 03:27:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB13RGZB092074; Thu, 1 Dec 2016 03:27:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612010327.uB13RGZB092074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Dec 2016 03:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309346 - in head/sys: conf dev/hyperv/netvsc modules/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:27:18 -0000 Author: sephe Date: Thu Dec 1 03:27:16 2016 New Revision: 309346 URL: https://svnweb.freebsd.org/changeset/base/309346 Log: hyperv/hn: Add HN_DEBUG kernel option. If bufring is used for per-TX ring descs, don't update "available" counter, which is only used to help debugging. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8674 Modified: head/sys/conf/options head/sys/dev/hyperv/netvsc/if_hn.c head/sys/modules/hyperv/netvsc/Makefile Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Dec 1 02:35:15 2016 (r309345) +++ head/sys/conf/options Thu Dec 1 03:27:16 2016 (r309346) @@ -1001,3 +1001,5 @@ EVDEV_SUPPORT opt_evdev.h EVDEV_DEBUG opt_evdev.h UINPUT_DEBUG opt_evdev.h +# Hyper-V network driver +HN_DEBUG opt_hn.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 02:35:15 2016 (r309345) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 03:27:16 2016 (r309346) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_inet.h" +#include "opt_hn.h" #include #include @@ -1428,10 +1429,12 @@ hn_txdesc_put(struct hn_tx_ring *txr, st txr->hn_txdesc_avail++; SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); mtx_unlock_spin(&txr->hn_txlist_spin); -#else +#else /* HN_USE_TXDESC_BUFRING */ +#ifdef HN_DEBUG atomic_add_int(&txr->hn_txdesc_avail, 1); - buf_ring_enqueue(txr->hn_txdesc_br, txd); #endif + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif /* !HN_USE_TXDESC_BUFRING */ return 1; } @@ -1457,8 +1460,10 @@ hn_txdesc_get(struct hn_tx_ring *txr) if (txd != NULL) { #ifdef HN_USE_TXDESC_BUFRING +#ifdef HN_DEBUG atomic_subtract_int(&txr->hn_txdesc_avail, 1); #endif +#endif /* HN_USE_TXDESC_BUFRING */ KASSERT(txd->m == NULL && txd->refs == 0 && STAILQ_EMPTY(&txd->agg_list) && txd->chim_index == HN_NVS_CHIM_IDX_INVALID && @@ -3467,9 +3472,11 @@ hn_tx_ring_create(struct hn_softc *sc, i if (txr->hn_tx_sysctl_tree != NULL) { child = SYSCTL_CHILDREN(txr->hn_tx_sysctl_tree); +#ifdef HN_DEBUG SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", CTLFLAG_RD, &txr->hn_txdesc_avail, 0, "# of available TX descs"); +#endif #ifdef HN_IFSTART_SUPPORT if (!hn_use_if_start) #endif Modified: head/sys/modules/hyperv/netvsc/Makefile ============================================================================== --- head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 02:35:15 2016 (r309345) +++ head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 03:27:16 2016 (r309346) @@ -5,7 +5,7 @@ KMOD= hv_netvsc SRCS= hn_nvs.c hn_rndis.c if_hn.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h +SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h opt_hn.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc From owner-svn-src-head@freebsd.org Thu Dec 1 03:34:05 2016 Return-Path: Delivered-To: svn-src-head@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 AC20EC5ED03; Thu, 1 Dec 2016 03:34:05 +0000 (UTC) (envelope-from loos@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 7BC9F16AF; Thu, 1 Dec 2016 03:34:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB13Y4Rr096021; Thu, 1 Dec 2016 03:34:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB13Y4To096019; Thu, 1 Dec 2016 03:34:04 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612010334.uB13Y4To096019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 1 Dec 2016 03:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309347 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:34:05 -0000 Author: loos Date: Thu Dec 1 03:34:04 2016 New Revision: 309347 URL: https://svnweb.freebsd.org/changeset/base/309347 Log: MDIO_PHYACCESS_ACK is only valid for read access, remove it from miibus_writereg. Reduce the DELAY() between reads while waiting for MII access. Spotted by: yongari Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 03:27:16 2016 (r309346) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 03:34:04 2016 (r309347) @@ -1512,9 +1512,6 @@ cpswp_miibus_writereg(device_t dev, int return (0); } - if ((cpsw_read_4(sc->swsc, sc->phyaccess) & MDIO_PHYACCESS_ACK) == 0) - device_printf(dev, "Failed to write to PHY.\n"); - return (0); } Modified: head/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswvar.h Thu Dec 1 03:27:16 2016 (r309346) +++ head/sys/arm/ti/cpsw/if_cpswvar.h Thu Dec 1 03:34:04 2016 (r309347) @@ -33,8 +33,8 @@ #define CPSW_INTR_COUNT 4 /* MII BUS */ -#define CPSW_MIIBUS_RETRIES 5 -#define CPSW_MIIBUS_DELAY 1000 +#define CPSW_MIIBUS_RETRIES 20 +#define CPSW_MIIBUS_DELAY 100 #define CPSW_MAX_ALE_ENTRIES 1024 From owner-svn-src-head@freebsd.org Thu Dec 1 03:39:36 2016 Return-Path: Delivered-To: svn-src-head@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 2B03CC5F157; Thu, 1 Dec 2016 03:39:36 +0000 (UTC) (envelope-from sephe@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 EEDD31A3B; Thu, 1 Dec 2016 03:39:35 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB13dZQG096240; Thu, 1 Dec 2016 03:39:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB13dZOS096239; Thu, 1 Dec 2016 03:39:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612010339.uB13dZOS096239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Dec 2016 03:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309348 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:39:36 -0000 Author: sephe Date: Thu Dec 1 03:39:34 2016 New Revision: 309348 URL: https://svnweb.freebsd.org/changeset/base/309348 Log: hyperv/hn: Don't hold txdesc, if no BPFs are attached. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8675 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 03:34:04 2016 (r309347) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 03:39:34 2016 (r309348) @@ -1924,17 +1924,20 @@ done: static int hn_txpkt(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd) { - int error, send_failed = 0; + int error, send_failed = 0, has_bpf; again: - /* - * Make sure that this txd and any aggregated txds are not freed - * before ETHER_BPF_MTAP. - */ - hn_txdesc_hold(txd); + has_bpf = bpf_peers_present(ifp->if_bpf); + if (has_bpf) { + /* + * Make sure that this txd and any aggregated txds are not + * freed before ETHER_BPF_MTAP. + */ + hn_txdesc_hold(txd); + } error = txr->hn_sendpkt(txr, txd); if (!error) { - if (bpf_peers_present(ifp->if_bpf)) { + if (has_bpf) { const struct hn_txdesc *tmp_txd; ETHER_BPF_MTAP(ifp, txd->m); @@ -1957,7 +1960,8 @@ again: txr->hn_pkts += txr->hn_stat_pkts; txr->hn_sends++; } - hn_txdesc_put(txr, txd); + if (has_bpf) + hn_txdesc_put(txr, txd); if (__predict_false(error)) { int freed; From owner-svn-src-head@freebsd.org Thu Dec 1 04:35:42 2016 Return-Path: Delivered-To: svn-src-head@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 D27FEC5F57D; Thu, 1 Dec 2016 04:35:42 +0000 (UTC) (envelope-from imp@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 A26751E17; Thu, 1 Dec 2016 04:35:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB14Zfvo020007; Thu, 1 Dec 2016 04:35:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB14Zfgu020006; Thu, 1 Dec 2016 04:35:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010435.uB14Zfgu020006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 04:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309350 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 04:35:42 -0000 Author: imp Date: Thu Dec 1 04:35:41 2016 New Revision: 309350 URL: https://svnweb.freebsd.org/changeset/base/309350 Log: If the kenv variable rc_debug is set, turn on rc_debug. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Dec 1 04:35:38 2016 (r309349) +++ head/etc/rc.subr Thu Dec 1 04:35:41 2016 (r309350) @@ -2119,6 +2119,12 @@ _echoonce() esac } +# If the loader env variable rc.debug is set, turn on debugging. rc.conf will +# still override this, but /etc/defaults/rc.conf.a +if kenv -q rc.debug > /dev/null ; then + rc_debug=YES +fi + fi # [ -z "${_rc_subr_loaded}" ] _rc_subr_loaded=: From owner-svn-src-head@freebsd.org Thu Dec 1 04:35:44 2016 Return-Path: Delivered-To: svn-src-head@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 458AFC5F582; Thu, 1 Dec 2016 04:35:44 +0000 (UTC) (envelope-from imp@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 156901E1D; Thu, 1 Dec 2016 04:35:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB14ZhNU020051; Thu, 1 Dec 2016 04:35:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB14Zh21020050; Thu, 1 Dec 2016 04:35:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010435.uB14Zh21020050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 04:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309351 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 04:35:44 -0000 Author: imp Date: Thu Dec 1 04:35:43 2016 New Revision: 309351 URL: https://svnweb.freebsd.org/changeset/base/309351 Log: Revert the 'performance' setting to 'NONE' from C2. C2 has issues with USB in places, as well as having the potential for reducing performance. Since this is used even when powerd isn't enabled, these two problems can cause on servers. Supermicro X9 motherboards, for example, have problems with the virtual IPMI USB keyboards and mice attaching and detaching repeatedly. Since there are issues on some CPUs with C2, fail safe by defaulting to not altering it. MFC After: 3 days Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Dec 1 04:35:41 2016 (r309350) +++ head/etc/defaults/rc.conf Thu Dec 1 04:35:43 2016 (r309351) @@ -672,7 +672,7 @@ devfs_system_ruleset="" # The name (NOT devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) devfs_load_rulesets="YES" # Enable to always load the default rulesets -performance_cx_lowest="C2" # Online CPU idle state +performance_cx_lowest="NONE" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="Cmax" # Offline CPU idle state economy_cpu_freq="NONE" # Offline CPU frequency From owner-svn-src-head@freebsd.org Thu Dec 1 04:35:39 2016 Return-Path: Delivered-To: svn-src-head@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 50649C5F578; Thu, 1 Dec 2016 04:35:39 +0000 (UTC) (envelope-from imp@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 205061E16; Thu, 1 Dec 2016 04:35:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB14Zcmi019962; Thu, 1 Dec 2016 04:35:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB14ZcfB019961; Thu, 1 Dec 2016 04:35:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010435.uB14ZcfB019961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 04:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309349 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 04:35:39 -0000 Author: imp Date: Thu Dec 1 04:35:38 2016 New Revision: 309349 URL: https://svnweb.freebsd.org/changeset/base/309349 Log: Simplify test. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu Dec 1 03:39:34 2016 (r309348) +++ head/sbin/devd/devd.cc Thu Dec 1 04:35:38 2016 (r309349) @@ -1193,7 +1193,7 @@ devdlog(int priority, const char* fmt, . va_start(argp, fmt); if (no_daemon) vfprintf(stderr, fmt, argp); - else if ((! quiet_mode) || (priority <= LOG_WARNING)) + else if (quiet_mode == 0 || priority <= LOG_WARNING) vsyslog(priority, fmt, argp); va_end(argp); } From owner-svn-src-head@freebsd.org Thu Dec 1 05:16:28 2016 Return-Path: Delivered-To: svn-src-head@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 EE888C6097D; Thu, 1 Dec 2016 05:16:28 +0000 (UTC) (envelope-from imp@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 BAEA825C8; Thu, 1 Dec 2016 05:16:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB15GRti035990; Thu, 1 Dec 2016 05:16:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB15GRa2035988; Thu, 1 Dec 2016 05:16:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010516.uB15GRa2035988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 05:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309352 - in head/etc: . defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 05:16:29 -0000 Author: imp Date: Thu Dec 1 05:16:27 2016 New Revision: 309352 URL: https://svnweb.freebsd.org/changeset/base/309352 Log: Finish incomplete comments in prior revision. I was going to fix this after I tested it, but didn't. Modified: head/etc/defaults/rc.conf head/etc/rc.subr Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Dec 1 04:35:43 2016 (r309351) +++ head/etc/defaults/rc.conf Thu Dec 1 05:16:27 2016 (r309352) @@ -21,6 +21,8 @@ ### Important initial Boot-time options #################### ############################################################## +# rc_debug can't be set here without interferring with rc.subr's setting it +# when the kenv variable rc.debug is set. #rc_debug="NO" # Set to YES to enable debugging output from rc.d rc_info="NO" # Enables display of informational messages at boot. rc_startmsgs="YES" # Show "Starting foo:" messages at boot Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Dec 1 04:35:43 2016 (r309351) +++ head/etc/rc.subr Thu Dec 1 05:16:27 2016 (r309352) @@ -2120,7 +2120,8 @@ _echoonce() } # If the loader env variable rc.debug is set, turn on debugging. rc.conf will -# still override this, but /etc/defaults/rc.conf.a +# still override this, but /etc/defaults/rc.conf can't unconditionally set this +# since it would undo what we've done here. if kenv -q rc.debug > /dev/null ; then rc_debug=YES fi From owner-svn-src-head@freebsd.org Thu Dec 1 05:37:30 2016 Return-Path: Delivered-To: svn-src-head@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 56AC2C62264; Thu, 1 Dec 2016 05:37:30 +0000 (UTC) (envelope-from sephe@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 315431CE1; Thu, 1 Dec 2016 05:37:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB15bTUE044509; Thu, 1 Dec 2016 05:37:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB15bTRS044507; Thu, 1 Dec 2016 05:37:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612010537.uB15bTRS044507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Dec 2016 05:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309353 - in head/sys: dev/hyperv/netvsc modules/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 05:37:30 -0000 Author: sephe Date: Thu Dec 1 05:37:29 2016 New Revision: 309353 URL: https://svnweb.freebsd.org/changeset/base/309353 Log: hyperv/hn: Add 'options RSS' support. Reviewed by: adrian MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8676 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/modules/hyperv/netvsc/Makefile Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 05:16:27 2016 (r309352) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 05:37:29 2016 (r309353) @@ -55,9 +55,10 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_hn.h" #include "opt_inet6.h" #include "opt_inet.h" -#include "opt_hn.h" +#include "opt_rss.h" #include #include @@ -87,6 +88,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef RSS +#include +#endif #include #include @@ -170,7 +174,11 @@ do { \ #define HN_PKTSIZE(m, align) \ roundup2((m)->m_pkthdr.len + HN_RNDIS_PKT_LEN, (align)) +#ifdef RSS +#define HN_RING_IDX2CPU(sc, idx) rss_getcpu((idx) % rss_getnumbuckets()) +#else #define HN_RING_IDX2CPU(sc, idx) (((sc)->hn_cpu + (idx)) % mp_ncpus) +#endif struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING @@ -276,8 +284,10 @@ static int hn_ndis_version_sysctl(SYSC static int hn_caps_sysctl(SYSCTL_HANDLER_ARGS); static int hn_hwassist_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rxfilter_sysctl(SYSCTL_HANDLER_ARGS); +#ifndef RSS static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS); +#endif static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS); @@ -321,7 +331,9 @@ static int hn_create_rx_data(struct hn static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); static int hn_set_rxfilter(struct hn_softc *); +#ifndef RSS static int hn_rss_reconfig(struct hn_softc *); +#endif static void hn_rss_ind_fixup(struct hn_softc *); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); @@ -478,6 +490,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts static u_int hn_cpu_index; /* next CPU for channel */ static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ +#ifndef RSS static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, @@ -486,6 +499,7 @@ hn_rss_key_default[NDIS_HASH_KEYSIZE_TOE 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa }; +#endif /* !RSS */ static device_method_t hn_methods[] = { /* Device interface */ @@ -783,6 +797,7 @@ hn_get_txswq_depth(const struct hn_tx_ri return hn_tx_swq_depth; } +#ifndef RSS static int hn_rss_reconfig(struct hn_softc *sc) { @@ -821,6 +836,7 @@ hn_rss_reconfig(struct hn_softc *sc) } return (0); } +#endif /* !RSS */ static void hn_rss_ind_fixup(struct hn_softc *sc) @@ -969,6 +985,10 @@ hn_attach(device_t dev) } else if (ring_cnt > mp_ncpus) { ring_cnt = mp_ncpus; } +#ifdef RSS + if (ring_cnt > rss_getnumbuckets()) + ring_cnt = rss_getnumbuckets(); +#endif tx_ring_cnt = hn_tx_ring_cnt; if (tx_ring_cnt <= 0 || tx_ring_cnt > ring_cnt) @@ -1068,12 +1088,17 @@ hn_attach(device_t dev) hn_rss_hash_sysctl, "A", "RSS hash"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rss_ind_size", CTLFLAG_RD, &sc->hn_rss_ind_size, 0, "RSS indirect entry count"); +#ifndef RSS + /* + * Don't allow RSS key/indirect table changes, if RSS is defined. + */ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_key", CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, hn_rss_key_sysctl, "IU", "RSS key"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_ind", CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, hn_rss_ind_sysctl, "IU", "RSS indirect table"); +#endif SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rndis_agg_size", CTLFLAG_RD, &sc->hn_rndis_agg_size, 0, "RNDIS offered packet transmission aggregation size limit"); @@ -2905,6 +2930,8 @@ hn_rxfilter_sysctl(SYSCTL_HANDLER_ARGS) return sysctl_handle_string(oidp, filter_str, sizeof(filter_str), req); } +#ifndef RSS + static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS) { @@ -2966,6 +2993,8 @@ back: return (error); } +#endif /* !RSS */ + static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS) { @@ -4085,8 +4114,17 @@ hn_transmit(struct ifnet *ifp, struct mb /* * Select the TX ring based on flowid */ - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) - idx = m->m_pkthdr.flowid % sc->hn_tx_ring_inuse; + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { +#ifdef RSS + uint32_t bid; + + if (rss_hash2bucket(m->m_pkthdr.flowid, M_HASHTYPE_GET(m), + &bid) == 0) + idx = bid % sc->hn_tx_ring_inuse; + else +#endif + idx = m->m_pkthdr.flowid % sc->hn_tx_ring_inuse; + } txr = &sc->hn_tx_ring[idx]; error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); @@ -4542,7 +4580,11 @@ hn_synth_attach(struct hn_softc *sc, int */ if (bootverbose) if_printf(sc->hn_ifp, "setup default RSS key\n"); +#ifdef RSS + rss_getkey(rss->rss_key); +#else memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key)); +#endif sc->hn_flags |= HN_FLAG_HAS_RSSKEY; } @@ -4555,8 +4597,16 @@ hn_synth_attach(struct hn_softc *sc, int if_printf(sc->hn_ifp, "setup default RSS indirect " "table\n"); } - for (i = 0; i < NDIS_HASH_INDCNT; ++i) - rss->rss_ind[i] = i % nchan; + for (i = 0; i < NDIS_HASH_INDCNT; ++i) { + uint32_t subidx; + +#ifdef RSS + subidx = rss_get_indirection_to_bucket(i); +#else + subidx = i; +#endif + rss->rss_ind[i] = subidx % nchan; + } sc->hn_flags |= HN_FLAG_HAS_RSSIND; } else { /* @@ -4633,6 +4683,14 @@ hn_set_ring_inuse(struct hn_softc *sc, i sc->hn_tx_ring_inuse = sc->hn_tx_ring_cnt; sc->hn_rx_ring_inuse = ring_cnt; +#ifdef RSS + if (sc->hn_rx_ring_inuse != rss_getnumbuckets()) { + if_printf(sc->hn_ifp, "# of RX rings (%d) does not match " + "# of RSS buckets (%d)\n", sc->hn_rx_ring_inuse, + rss_getnumbuckets()); + } +#endif + if (bootverbose) { if_printf(sc->hn_ifp, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); Modified: head/sys/modules/hyperv/netvsc/Makefile ============================================================================== --- head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 05:16:27 2016 (r309352) +++ head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 05:37:29 2016 (r309353) @@ -5,7 +5,8 @@ KMOD= hv_netvsc SRCS= hn_nvs.c hn_rndis.c if_hn.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h opt_hn.h +SRCS+= bus_if.h device_if.h vmbus_if.h +SRCS+= opt_hn.h opt_inet.h opt_inet6.h opt_rss.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc From owner-svn-src-head@freebsd.org Thu Dec 1 07:50:47 2016 Return-Path: Delivered-To: svn-src-head@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 2CDC5C5F32C; Thu, 1 Dec 2016 07:50:47 +0000 (UTC) (envelope-from peter@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 D71101CEC; Thu, 1 Dec 2016 07:50:46 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB17okZg001236; Thu, 1 Dec 2016 07:50:46 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB17oidw001220; Thu, 1 Dec 2016 07:50:44 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201612010750.uB17oidw001220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Thu, 1 Dec 2016 07:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309356 - in head/contrib/subversion: . subversion/include subversion/include/private subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x subversion/libsvn_ra_serf s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 07:50:47 -0000 Author: peter Date: Thu Dec 1 07:50:44 2016 New Revision: 309356 URL: https://svnweb.freebsd.org/changeset/base/309356 Log: Update from subversion 1.9.4 to 1.9.5. This includes a security fix for a component that we do not build, and two potentially useful client side fixes for reintegrate merges and tree conflict handling. See CHANGES for full details. Modified: head/contrib/subversion/CHANGES head/contrib/subversion/README head/contrib/subversion/build-outputs.mk head/contrib/subversion/configure head/contrib/subversion/configure.ac head/contrib/subversion/get-deps.sh head/contrib/subversion/subversion/include/private/svn_sqlite.h head/contrib/subversion/subversion/include/svn_version.h head/contrib/subversion/subversion/libsvn_client/merge.c head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c head/contrib/subversion/subversion/libsvn_fs_fs/caching.c head/contrib/subversion/subversion/libsvn_fs_fs/fs.c head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c head/contrib/subversion/subversion/libsvn_fs_fs/pack.c head/contrib/subversion/subversion/libsvn_fs_fs/pack.h head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.h head/contrib/subversion/subversion/libsvn_fs_fs/transaction.c head/contrib/subversion/subversion/libsvn_fs_fs/tree.c head/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h head/contrib/subversion/subversion/libsvn_ra_serf/xml.c head/contrib/subversion/subversion/libsvn_repos/reporter.c head/contrib/subversion/subversion/libsvn_repos/repos.c head/contrib/subversion/subversion/libsvn_subr/config_file.c head/contrib/subversion/subversion/libsvn_subr/deprecated.c head/contrib/subversion/subversion/libsvn_subr/gpg_agent.c head/contrib/subversion/subversion/libsvn_subr/internal_statements.h head/contrib/subversion/subversion/libsvn_subr/sqlite.c head/contrib/subversion/subversion/libsvn_subr/sysinfo.c head/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c head/contrib/subversion/subversion/libsvn_subr/xml.c head/contrib/subversion/subversion/libsvn_wc/conflicts.c head/contrib/subversion/subversion/libsvn_wc/update_editor.c head/contrib/subversion/subversion/libsvn_wc/wc-checks.h head/contrib/subversion/subversion/libsvn_wc/wc-metadata.h head/contrib/subversion/subversion/libsvn_wc/wc-queries.h head/contrib/subversion/subversion/svn/info-cmd.c head/contrib/subversion/subversion/svn/merge-cmd.c head/contrib/subversion/subversion/svnserve/serve.c Directory Properties: head/contrib/subversion/ (props changed) Modified: head/contrib/subversion/CHANGES ============================================================================== --- head/contrib/subversion/CHANGES Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/CHANGES Thu Dec 1 07:50:44 2016 (r309356) @@ -1,3 +1,54 @@ +Version 1.9.5 +(29 Nov 2016, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.5 + + User-visible changes: + - Client-side bugfixes: + * fix accessing non-existent paths during reintegrate merge (r1766699 et al) + * fix handling of newly secured subdirectories in working copy (r1724448) + * info: remove trailing whitespace in --show-item=revision (issue #4660) + * fix recording wrong revisions for tree conflicts (r1734106) + * gpg-agent: improve discovery of gpg-agent sockets (r1766327) + * gpg-agent: fix file descriptor leak (r1766323) + * resolve: fix --accept=mine-full for binary files (issue #4647) + * merge: fix possible crash (issue #4652) + * resolve: fix possible crash (r1748514) + * fix potential crash in Win32 crash reporter (r1663253 et al) + + - Server-side bugfixes: + * fsfs: fix "offset too large" error during pack (issue #4657) + * svnserve: enable hook script environments (r1769152) + * fsfs: fix possible data reconstruction error (issue #4658) + * fix source of spurious 'incoming edit' tree conflicts (r1770108) + * fsfs: improve caching for large directories (r1721285) + * fsfs: fix crash when encountering all-zero checksums (r1759686) + * fsfs: fix potential source of repository corruptions (r1756266) + * mod_dav_svn: fix excessive memory usage with mod_headers/mod_deflate + (issue #3084) + * mod_dav_svn: reduce memory usage during GET requests (r1757529 et al) + * fsfs: fix unexpected "database is locked" errors (r1741096 et al) + * fsfs: fix opening old repositories without db/format files (r1720015) + + - Client-side and server-side bugfixes: + * fix possible crash when reading invalid configuration files (r1715777) + + - Bindings bugfixes: + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: fix possible stack corruption (r1683266, r1683267) + + Developer-visible changes: + - General: + * add zlib discovery through pkg-config (issue #4655) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + * ruby: fix test failures with ruby >= 2.2 (r1766621) + * fix link error with --disable-keychain on OS X (r1765385) + * swig: enable building with SWIG >= 3.0.6 (r1721488 et al) + * swig: fix building with -Wdate-time in $CPPFLAGS (r1722164) + * update serf download URI in build scripts (r1700130 et al) + * raise minimal httpd version from 2.0 to 2.2 (r1754193) + + Version 1.9.4 (28 Apr 2016, from /branches/1.9.x) http://svn.apache.org/repos/asf/subversion/tags/1.9.4 @@ -14,6 +65,8 @@ http://svn.apache.org/repos/asf/subversi * ra_serf: fix deleting directories with many files (issue #4557) - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * improve documentation for AuthzSVNGroupsFile and groups-db (r1730856) * fsfs: reduce peak memory usage when listing large directories (r1725180) * fsfs: fix a rare source of incomplete dump files and reports (r1717876) @@ -31,8 +84,7 @@ http://svn.apache.org/repos/asf/subversi * fix ruby test suite to work with test-unit gem (r1714790) * allow building against KDE4 without conflict with KDE5 (r1734926) * fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432) - * build system tweaks: - * tweak how symbolic error names in maintainer mode (r1735179) + * tweak getting symbolic error names in maintainer mode (r1735179) * fix inconsistent behavior of inherited property API (r1717874 et al) - API changes: @@ -882,12 +934,44 @@ http://svn.apache.org/repos/asf/subversi * javahl: allow compiling with a C++11 compiler (r1684412) +Version 1.8.17 +(29 Nov 2016, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.17 + + User-visible changes: + - Client-side bugfixes: + * fix handling of newly secured subdirectories in working copy (r1724448) + * ra_serf: fix deleting directories with many files (issue #4557) + * svnlook: properly remove tempfiles on diff errors (r1711346) + * gpg-agent: properly handle passwords with percent characters (issue #4611) + * merge: fix crash when merging to a local add (r1702299 et al) + + - Server-side bugfixes: + * fsfs: fix possible data reconstruction error (issue #4658) + + - Client-side and server-side bugfixes: + * fix potential memory access bugs (r1722860 et al) + + - Bindings bugfixes: + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * swig-pl: fix possible stack corruption (r1683266) + + Developer-visible changes: + - General: + * fix inconsistent behavior of inherited property API (r1717875, r1717878) + * fix patch filter invocation in svn_client_patch() (r1706783) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + + Version 1.8.16 (28 Apr 2016, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.16 User-visible changes: - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) * dump: don't write broken dump files in some ambiguously encoded fsfs repositories (issue #4554) @@ -1641,7 +1725,7 @@ http://svn.apache.org/repos/asf/subversi * fix bug in mergeinfo recording during foreign-repos merge (r1430310) * fix spurious merge conflicts for binary files with keywords (issue #4221) * fix patching symlinks with 'svn patch' (issue #4273) - * make 'svn switch' refresh lock information (issue #3376) + * make 'svn switch' refresh lock information (issue #3378) * fix 'svn diff' output doesn't apply as patch without fuzz (issue #3362) * fix mergeinfo recording for multiple-revision-range merge (issue #4306) * fix diffs shown by 'show-diff' conflict prompt option (r1438879) Modified: head/contrib/subversion/README ============================================================================== --- head/contrib/subversion/README Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/README Thu Dec 1 07:50:44 2016 (r309356) @@ -2,7 +2,7 @@ Subversion, a version control system. ===================================== -$LastChangedDate: 2012-02-10 14:58:53 +0000 (Fri, 10 Feb 2012) $ +$LastChangedDate: 2016-05-31 16:08:20 +0000 (Tue, 31 May 2016) $ Contents: @@ -36,10 +36,10 @@ II. DOCUMENTATION It is written in DocBook XML, and the sources can be found at: - http://svnbook.googlecode.com/svn/trunk/ + http://svn.code.sf.net/p/svnbook/source/trunk/ If you wish to build the documentation from source, read the - src/en/README file within the book source. + en/README file within the book source. Modified: head/contrib/subversion/build-outputs.mk ============================================================================== --- head/contrib/subversion/build-outputs.mk Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/build-outputs.mk Thu Dec 1 07:50:44 2016 (r309356) @@ -3351,7 +3351,7 @@ subversion/tests/libsvn_diff/diff-diff3- subversion/tests/libsvn_diff/parse-diff-test.lo: subversion/tests/libsvn_diff/parse-diff-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h -subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/s vn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version. h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/svn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs/locks-test.lo: subversion/tests/libsvn_fs/locks-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h @@ -3363,7 +3363,7 @@ subversion/tests/libsvn_fs_base/strings- subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_poo ls.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/pack.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs_fs/fs-fs-private-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-private-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subver sion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/index.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h Modified: head/contrib/subversion/configure ============================================================================== --- head/contrib/subversion/configure Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/configure Thu Dec 1 07:50:44 2016 (r309356) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.9.4. +# Generated by GNU Autoconf 2.69 for subversion 1.9.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.9.4' -PACKAGE_STRING='subversion 1.9.4' +PACKAGE_VERSION='1.9.5' +PACKAGE_STRING='subversion 1.9.5' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1471,7 +1471,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.9.4 to adapt to many kinds of systems. +\`configure' configures subversion 1.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1537,7 +1537,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.9.4:";; + short | recursive ) echo "Configuration of subversion 1.9.5:";; esac cat <<\_ACEOF @@ -1751,7 +1751,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.9.4 +subversion configure 1.9.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2295,7 +2295,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.9.4, which was +It was created by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.4" >&5 -$as_echo "$as_me: Configuring Subversion 1.9.4" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.5" >&5 +$as_echo "$as_me: Configuring Subversion 1.9.5" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -7422,7 +7422,10 @@ _ACEOF localedir='${datadir}/locale' -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -22550,68 +22553,34 @@ fi zlib_found=no + zlib_skip=no # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; - if test "$withval" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 -$as_echo_n "checking for inflate in -lz... " >&6; } -if ${ac_cv_lib_z_inflate+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$withval" = "yes"; then + zlib_skip=no + elif test "$withval" = "no"; then + zlib_skip=yes + else + zlib_skip=no + zlib_prefix="$withval" + fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflate (); -int -main () -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflate=yes -else - ac_cv_lib_z_inflate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 -$as_echo "$ac_cv_lib_z_inflate" >&6; } -if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" fi -fi - + if test "$zlib_skip" = "yes"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi - elif test "$withval" = "no" ; then - as_fn_error $? "cannot compile without zlib." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 -$as_echo "$as_me: zlib library configuration" >&6;} - zlib_prefix=$withval - save_cppflags="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" - for ac_header in zlib.h + if test -n "$zlib_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via prefix" >&5 +$as_echo "$as_me: zlib library configuration via prefix" >&6;} + save_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" + for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -22619,9 +22588,9 @@ if test "x$ac_cv_header_zlib_h" = xyes; #define HAVE_ZLIB_H 1 _ACEOF - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + save_ldflags="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22658,24 +22627,86 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="yes" + + zlib_found="yes" + SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" + SVN_ZLIB_LIBS="` + input_flags="-L$zlib_prefix/lib" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +` -lz" + fi - LDFLAGS="$save_ldflags" + LDFLAGS="$save_ldflags" fi done - CPPFLAGS="$save_cppflags" + CPPFLAGS="$save_cppflags" + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via pkg-config" >&5 +$as_echo "$as_me: zlib library configuration via pkg-config" >&6;} + if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib library" >&5 +$as_echo_n "checking for zlib library... " >&6; } + if $PKG_CONFIG zlib --exists; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + zlib_found=yes + SVN_ZLIB_INCLUDES=`$PKG_CONFIG zlib --cflags` + SVN_ZLIB_LIBS=`$PKG_CONFIG zlib --libs` + SVN_ZLIB_LIBS="` + input_flags="$SVN_ZLIB_LIBS" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +`" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi -else - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" + if test "$zlib_found" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 +$as_echo "$as_me: zlib library configuration" >&6;} + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22712,46 +22743,22 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" -fi + zlib_found="builtin" + SVN_ZLIB_LIBS="-lz" fi - fi - if test "$zlib_found" = "no"; then - as_fn_error $? "subversion requires zlib" "$LINENO" 5 - fi - - if test "$zlib_found" = "yes"; then - SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" - LDFLAGS="$LDFLAGS ` - input_flags="-L$zlib_prefix/lib" - output_flags="" - filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" - for flag in $input_flags; do - filter="no" - for dir in $filtered_dirs; do - if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then - filter="yes" - break - fi - done - if test "$filter" = "no"; then - output_flags="$output_flags $flag" fi - done - if test -n "$output_flags"; then - printf "%s" "${output_flags# }" - fi -`" fi - SVN_ZLIB_LIBS="-lz" + if test "$zlib_found" = "no"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi @@ -23785,15 +23792,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24274,15 +24280,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24763,15 +24768,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -25255,15 +25259,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -26152,6 +26155,9 @@ SWIG_CPPFLAGS="$CPPFLAGS" SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'` + SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-Wdate-time //'` + + cat >>confdefs.h <<_ACEOF @@ -26750,7 +26756,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.9.4, which was +This file was extended by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26816,7 +26822,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.9.4 +subversion config.status 1.9.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/subversion/configure.ac ============================================================================== --- head/contrib/subversion/configure.ac Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/configure.ac Thu Dec 1 07:50:44 2016 (r309356) @@ -199,7 +199,10 @@ localedir='${datadir}/locale' AC_SUBST(localedir) dnl For SVN_LOCALE_DIR, we have to expand it to something. See SVN_BINDIR. -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -1504,6 +1507,7 @@ fi # Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. SWIG_CPPFLAGS="$CPPFLAGS" SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ]) +SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ]) AC_SUBST([SWIG_CPPFLAGS]) dnl Since this is used only on Unix-y systems, define the path separator as '/' Modified: head/contrib/subversion/get-deps.sh ============================================================================== --- head/contrib/subversion/get-deps.sh Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/get-deps.sh Thu Dec 1 07:50:44 2016 (r309356) @@ -89,7 +89,7 @@ get_serf() { test -d $BASEDIR/serf && return cd $TEMPDIR - $HTTP_FETCH http://serf.googlecode.com/svn/src_releases/$SERF.tar.bz2 + $HTTP_FETCH https://archive.apache.org/dist/serf/$SERF.tar.bz2 cd $BASEDIR bzip2 -dc $TEMPDIR/$SERF.tar.bz2 | tar -xf - Modified: head/contrib/subversion/subversion/include/private/svn_sqlite.h ============================================================================== --- head/contrib/subversion/subversion/include/private/svn_sqlite.h Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/include/private/svn_sqlite.h Thu Dec 1 07:50:44 2016 (r309356) @@ -555,6 +555,9 @@ svn_sqlite__hotcopy(const char *src_path const char *dst_path, apr_pool_t *scratch_pool); +/* Backported version of SVN_ERR_SQLITE_ROLLBACK_FAILED. */ +#define SVN_SQLITE__ERR_ROLLBACK_FAILED (SVN_ERR_MISC_CATEGORY_START + 44) + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: head/contrib/subversion/subversion/include/svn_version.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_version.h Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/include/svn_version.h Thu Dec 1 07:50:44 2016 (r309356) @@ -70,7 +70,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 4 +#define SVN_VER_PATCH 5 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -93,7 +93,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1740329)" +#define SVN_VER_TAG " (r1770682)" /** Number tag: a string describing the version. @@ -117,7 +117,7 @@ extern "C" { * file version. Its value remains 0 in the repository except in release * tags where it is the revision from which the tag was created. */ -#define SVN_VER_REVISION 1740329 +#define SVN_VER_REVISION 1770682 /* Version strings composed from the above definitions. */ Modified: head/contrib/subversion/subversion/libsvn_client/merge.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/merge.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_client/merge.c Thu Dec 1 07:50:44 2016 (r309356) @@ -1295,6 +1295,15 @@ record_skip(merge_cmd_baton_t *merge_b, return SVN_NO_ERROR; } +/* Forward declaration */ +static svn_client__merge_path_t * +find_nearest_ancestor_with_intersecting_ranges( + svn_revnum_t *start, + svn_revnum_t *end, + const apr_array_header_t *children_with_mergeinfo, + svn_boolean_t path_is_own_ancestor, + const char *local_abspath); + /* Record a tree conflict in the WC, unless this is a dry run or a record- * only merge, or if a tree conflict is already flagged for the VICTIM_PATH. * (The latter can happen if a merge-tracking-aware merge is doing multiple @@ -1366,11 +1375,45 @@ record_tree_conflict(merge_cmd_baton_t * reason = svn_wc_conflict_reason_moved_here; } - SVN_ERR(make_conflict_versions(&left, &right, local_abspath, - merge_left_node_kind, - merge_right_node_kind, - &merge_b->merge_source, merge_b->target, - result_pool, scratch_pool)); + if (HONOR_MERGEINFO(merge_b) && merge_b->merge_source.ancestral) + { + struct merge_source_t *source; + svn_client__pathrev_t *loc1; + svn_client__pathrev_t *loc2; + svn_merge_range_t range = + {SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, TRUE}; + + /* We are honoring mergeinfo so do not blindly record + * a conflict describing the merge of + * SOURCE->LOC1->URL@SOURCE->LOC1->REV through + * SOURCE->LOC2->URL@SOURCE->LOC2->REV + * but figure out the actual revision range merged. */ + (void)find_nearest_ancestor_with_intersecting_ranges( + &(range.start), &(range.end), + merge_b->notify_begin.nodes_with_mergeinfo, + action != svn_wc_conflict_action_delete, + local_abspath); + loc1 = svn_client__pathrev_dup(merge_b->merge_source.loc1, + scratch_pool); + loc2 = svn_client__pathrev_dup(merge_b->merge_source.loc2, + scratch_pool); + loc1->rev = range.start; + loc2->rev = range.end; + source = merge_source_create(loc1, loc2, + merge_b->merge_source.ancestral, + scratch_pool); + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + source, merge_b->target, + result_pool, scratch_pool)); + } + else + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + &merge_b->merge_source, merge_b->target, + result_pool, scratch_pool)); /* Fix up delete of file, add of dir replacement (or other way around) */ if (existing_conflict != NULL && existing_conflict->src_left_version) @@ -10956,7 +10999,7 @@ find_unsynced_ranges(const svn_client__p potentially_unmerged_ranges->nelts - 1, svn_merge_range_t *))->end; log_find_operative_baton_t log_baton; - const char *old_session_url; + const char *old_session_url = NULL; svn_error_t *err; log_baton.merged_catalog = merged_catalog; @@ -10967,14 +11010,22 @@ find_unsynced_ranges(const svn_client__p = svn_client__pathrev_fspath(target_loc, scratch_pool); log_baton.result_pool = result_pool; - SVN_ERR(svn_client__ensure_ra_session_url( - &old_session_url, ra_session, target_loc->url, scratch_pool)); + /* Reparent the session to TARGET_LOC if this target location + * exists within the unmerged revision range. */ + if (target_loc->rev <= youngest_rev && target_loc->rev >= oldest_rev) + SVN_ERR(svn_client__ensure_ra_session_url( + &old_session_url, ra_session, target_loc->url, scratch_pool)); + err = get_log(ra_session, "", youngest_rev, oldest_rev, TRUE, /* discover_changed_paths */ log_find_operative_revs, &log_baton, scratch_pool); - SVN_ERR(svn_error_compose_create( - err, svn_ra_reparent(ra_session, old_session_url, scratch_pool))); + if (old_session_url) + err = svn_error_compose_create(err, + svn_ra_reparent(ra_session, + old_session_url, + scratch_pool)); + SVN_ERR(err); } return SVN_NO_ERROR; Modified: head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Thu Dec 1 07:50:44 2016 (r309356) @@ -1571,6 +1571,17 @@ read_plain_window(svn_stringbuf_t **nwin return SVN_NO_ERROR; } +/* Skip SIZE bytes from the PLAIN representation RS. */ +static svn_error_t * +skip_plain_window(rep_state_t *rs, + apr_size_t size) +{ + /* Update RS. */ + rs->current += (apr_off_t)size; + + return SVN_NO_ERROR; +} + /* Get the undeltified window that is a result of combining all deltas from the current desired representation identified in *RB with its base representation. Store the window in *RESULT. */ @@ -1628,9 +1639,18 @@ get_combined_window(svn_stringbuf_t **re Also note that we may have short-cut reading the delta chain -- in which case SRC_OPS is 0 and it might not be a PLAIN rep. */ source = buf; - if (source == NULL && rb->src_state != NULL && window->src_ops) - SVN_ERR(read_plain_window(&source, rb->src_state, window->sview_len, - pool, iterpool)); + if (source == NULL && rb->src_state != NULL) + { + /* Even if we don't need the source rep now, we still must keep + * its read offset in sync with what we might need for the next + * window. */ + if (window->src_ops) + SVN_ERR(read_plain_window(&source, rb->src_state, + window->sview_len, + pool, iterpool)); + else + SVN_ERR(skip_plain_window(rb->src_state, window->sview_len)); + } /* Combine this window with the current one. */ new_pool = svn_pool_create(rb->pool); Modified: head/contrib/subversion/subversion/libsvn_fs_fs/caching.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/caching.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/caching.c Thu Dec 1 07:50:44 2016 (r309356) @@ -430,7 +430,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f svn_fs_fs__deserialize_dir_entries, sizeof(pair_cache_key_t), apr_pstrcat(pool, prefix, "DIR", SVN_VA_NULL), - SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, no_handler, fs->pool, pool)); @@ -806,7 +806,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_ APR_HASH_KEY_STRING, apr_pstrcat(pool, prefix, "TXNDIR", SVN_VA_NULL), - 0, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, TRUE, pool, pool)); Modified: head/contrib/subversion/subversion/libsvn_fs_fs/fs.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/fs.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/fs.c Thu Dec 1 07:50:44 2016 (r309356) @@ -452,7 +452,7 @@ fs_pack(svn_fs_t *fs, apr_pool_t *common_pool) { SVN_ERR(fs_open(fs, path, common_pool_lock, pool, common_pool)); - return svn_fs_fs__pack(fs, notify_func, notify_baton, + return svn_fs_fs__pack(fs, 0, notify_func, notify_baton, cancel_func, cancel_baton, pool); } Modified: head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Thu Dec 1 07:50:44 2016 (r309356) @@ -492,6 +492,7 @@ read_format(int *pformat, svn_error_clear(err); *pformat = 1; *max_files_per_dir = 0; + *use_log_addressing = FALSE; return SVN_NO_ERROR; } Modified: head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Thu Dec 1 07:50:44 2016 (r309356) @@ -764,7 +764,11 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_md5, str, scratch_pool)); - memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); /* The remaining fields are only used for formats >= 4, so check that. */ str = svn_cstring_tokenize(" ", &string); @@ -778,8 +782,16 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_sha1, str, scratch_pool)); + + /* We do have a valid SHA1 but it might be all 0. + We cannot be sure where that came from (Alas! legacy), so let's not + claim we know the SHA1 in that case. */ rep->has_sha1 = checksum != NULL; - memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); /* Read the uniquifier. */ str = svn_cstring_tokenize("/", &string); Modified: head/contrib/subversion/subversion/libsvn_fs_fs/pack.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/pack.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/pack.c Thu Dec 1 07:50:44 2016 (r309356) @@ -335,21 +335,40 @@ static svn_error_t * reset_pack_context(pack_context_t *context, apr_pool_t *pool) { + const char *temp_dir; + apr_array_clear(context->changes); - SVN_ERR(svn_io_file_trunc(context->changes_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->changes_file, pool)); apr_array_clear(context->file_props); - SVN_ERR(svn_io_file_trunc(context->file_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->file_props_file, pool)); apr_array_clear(context->dir_props); - SVN_ERR(svn_io_file_trunc(context->dir_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->dir_props_file, pool)); apr_array_clear(context->rev_offsets); apr_array_clear(context->path_order); apr_array_clear(context->references); apr_array_clear(context->reps); - SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->reps_file, pool)); svn_pool_clear(context->info_pool); + /* The new temporary files must live at least as long as any other info + * object in CONTEXT. */ + SVN_ERR(svn_io_temp_dir(&temp_dir, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->changes_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->file_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->dir_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->reps_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + context->paths = svn_prefix_tree__create(context->info_pool); + return SVN_NO_ERROR; } @@ -1410,21 +1429,20 @@ append_revision(pack_context_t *context, apr_off_t offset = 0; apr_pool_t *iterpool = svn_pool_create(pool); svn_fs_fs__revision_file_t *rev_file; - apr_finfo_t finfo; - - /* Get the size of the file. */ - const char *path = svn_dirent_join(context->shard_dir, - apr_psprintf(iterpool, "%ld", - context->start_rev), - pool); - SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool)); + svn_filesize_t revdata_size; - /* Copy all the bits from the rev file to the end of the pack file. */ + /* Copy all non-index contents the rev file to the end of the pack file. */ SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs, context->start_rev, pool, iterpool)); + + SVN_ERR(svn_fs_fs__auto_read_footer(rev_file)); + revdata_size = rev_file->l2p_offset; + + SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL, 0, + iterpool)); SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file, - finfo.size, iterpool)); + revdata_size, iterpool)); /* mark the start of a new revision */ SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index, @@ -1432,7 +1450,7 @@ append_revision(pack_context_t *context, /* read the phys-to-log index file until we covered the whole rev file. * That index contains enough info to build both target indexes from it. */ - while (offset < finfo.size) + while (offset < revdata_size) { /* read one cluster */ int i; @@ -1456,7 +1474,7 @@ append_revision(pack_context_t *context, /* process entry while inside the rev file */ offset = entry->offset; - if (offset < finfo.size) + if (offset < revdata_size) { entry->offset += context->pack_offset; offset += entry->size; @@ -1470,7 +1488,7 @@ append_revision(pack_context_t *context, } svn_pool_destroy(iterpool); - context->pack_offset += finfo.size; + context->pack_offset += revdata_size; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Dec 1 09:14:59 2016 Return-Path: Delivered-To: svn-src-head@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 7756BC6094A; Thu, 1 Dec 2016 09:14:59 +0000 (UTC) (envelope-from n_hibma@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 3198519DD; Thu, 1 Dec 2016 09:14:59 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB19EwXd035159; Thu, 1 Dec 2016 09:14:58 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB19EwW2035158; Thu, 1 Dec 2016 09:14:58 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201612010914.uB19EwW2035158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 1 Dec 2016 09:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309357 - head/usr.sbin/i2c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 09:14:59 -0000 Author: n_hibma Date: Thu Dec 1 09:14:58 2016 New Revision: 309357 URL: https://svnweb.freebsd.org/changeset/base/309357 Log: Speling fixes and fix line endings for err_msg output. In some cases there was not \n, in other cases there was. Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Thu Dec 1 07:50:44 2016 (r309356) +++ head/usr.sbin/i2c/i2c.c Thu Dec 1 09:14:58 2016 (r309357) @@ -310,7 +310,7 @@ i2c_write(char *dev, struct options i2c_ error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } } @@ -335,7 +335,7 @@ i2c_write(char *dev, struct options i2c_ cmd.last = 0; error = ioctl(fd, I2CWRITE, &cmd); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -350,7 +350,7 @@ i2c_write(char *dev, struct options i2c_ error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } } @@ -371,7 +371,7 @@ i2c_write(char *dev, struct options i2c_ cmd.last = 0; error = ioctl(fd, I2CWRITE, &cmd); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -394,7 +394,7 @@ i2c_write(char *dev, struct options i2c_ error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -416,7 +416,7 @@ err1: fprintf(stderr, "error sending stop condtion\n"); err2: if (err_msg) - fprintf(stderr, "%s", err_msg); + fprintf(stderr, "%s\n", err_msg); close(fd); return (1); @@ -458,7 +458,7 @@ i2c_read(char *dev, struct options i2c_o error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } @@ -466,7 +466,7 @@ i2c_read(char *dev, struct options i2c_o cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion\n"; + err_msg = "error sending stop condtion"; goto err2; } } @@ -491,7 +491,7 @@ i2c_read(char *dev, struct options i2c_o } error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion\n"; + err_msg = "error sending stop condtion"; goto err2; } @@ -513,7 +513,7 @@ err1: fprintf(stderr, "error sending stop condtion\n"); err2: if (err_msg) - fprintf(stderr, "%s", err_msg); + fprintf(stderr, "%s\n", err_msg); close(fd); return (1); From owner-svn-src-head@freebsd.org Thu Dec 1 14:28:38 2016 Return-Path: Delivered-To: svn-src-head@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 A60E0C601D9; Thu, 1 Dec 2016 14:28:38 +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 5D15E18EB; Thu, 1 Dec 2016 14:28:38 +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 uB1ESbqp063180; Thu, 1 Dec 2016 14:28:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1ESbnh063179; Thu, 1 Dec 2016 14:28:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612011428.uB1ESbnh063179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Dec 2016 14:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309360 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 14:28:38 -0000 Author: emaste Date: Thu Dec 1 14:28:37 2016 New Revision: 309360 URL: https://svnweb.freebsd.org/changeset/base/309360 Log: EFI loaders: parse rela relocations on amd64 Prior to this change the loader self relocation code interpreted amd64's rela relocations as if they were rel relocations, discarding the addend. This "works" because GNU ld 2.17.50 stores the addend value in both the r_addend field of the relocation (as expected) and at the target of the relocation. Other linkers, and possibly other versions of GNU ld, won't have this behaviour, so interpret the relocations correctly. Reported by: George Rimar Reviewed by: andrew MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8681 Modified: head/sys/boot/common/self_reloc.c Modified: head/sys/boot/common/self_reloc.c ============================================================================== --- head/sys/boot/common/self_reloc.c Thu Dec 1 12:32:52 2016 (r309359) +++ head/sys/boot/common/self_reloc.c Thu Dec 1 14:28:37 2016 (r309360) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__amd64__) #define ElfW_Rel Elf64_Rela #define ElfW_Dyn Elf64_Dyn #define ELFW_R_TYPE ELF64_R_TYPE @@ -40,10 +40,6 @@ __FBSDID("$FreeBSD$"); #define ElfW_Rel Elf32_Rel #define ElfW_Dyn Elf32_Dyn #define ELFW_R_TYPE ELF32_R_TYPE -#elif defined(__amd64__) -#define ElfW_Rel Elf64_Rel -#define ElfW_Dyn Elf64_Dyn -#define ELFW_R_TYPE ELF64_R_TYPE #else #error architecture not supported #endif @@ -99,7 +95,9 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * } /* - * Perform the actual relocation. + * Perform the actual relocation. We rely on the object having been + * linked at 0, so that the difference between the load and link + * address is the same as the load address. */ for (; relsz > 0; relsz -= relent) { switch (ELFW_R_TYPE(rel->r_info)) { @@ -110,12 +108,7 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * case RELOC_TYPE_RELATIVE: newaddr = (Elf_Addr *)(rel->r_offset + baseaddr); #ifdef ELF_RELA - /* - * For R_AARCH64_RELATIVE we need to calculate the - * delta between the address we are run from and the - * address we are linked at. As the latter is 0 we - * just use the address we are run from for this. - */ + /* Addend relative to the base address. */ *newaddr = baseaddr + rel->r_addend; #else /* Address relative to the base address. */ From owner-svn-src-head@freebsd.org Thu Dec 1 14:31:06 2016 Return-Path: Delivered-To: svn-src-head@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 A7496C603EB; Thu, 1 Dec 2016 14:31:06 +0000 (UTC) (envelope-from danfe@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 5D2251CC8; Thu, 1 Dec 2016 14:31:06 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1EV5ed063981; Thu, 1 Dec 2016 14:31:05 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1EV54J063980; Thu, 1 Dec 2016 14:31:05 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201612011431.uB1EV54J063980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Thu, 1 Dec 2016 14:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309361 - head/sys/x86/cpufreq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 14:31:06 -0000 Author: danfe (ports committer) Date: Thu Dec 1 14:31:05 2016 New Revision: 309361 URL: https://svnweb.freebsd.org/changeset/base/309361 Log: - Mention mismatching numbers in MSR vs. ACPI _PSS count warning: seeing actual numbers would help debugging (also, `MSR' and `ACPI' are standard abbreviations and thus should be properly capitalized) - Rephrase unsupported AMD CPUs message and wrap as an overly long line: `sorry' 1) is wrongly spelled after period (starts with a small letter) and 2) carries emotional "tinge" that is unnecessary and even bogus in debug message; `implemented' is not the best word as `supported' suits better in this context - Improve readability when reporting resulted P-state transition (debug) Approved by: jhb Modified: head/sys/x86/cpufreq/hwpstate.c Modified: head/sys/x86/cpufreq/hwpstate.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate.c Thu Dec 1 14:28:37 2016 (r309360) +++ head/sys/x86/cpufreq/hwpstate.c Thu Dec 1 14:31:05 2016 (r309361) @@ -198,7 +198,7 @@ hwpstate_goto_pstate(device_t dev, int p } DELAY(100); } - HWPSTATE_DEBUG(dev, "result P%d-state on cpu%d\n", + HWPSTATE_DEBUG(dev, "result: P%d-state on cpu%d\n", (int)msr, PCPU_GET(cpuid)); if (msr != id) { HWPSTATE_DEBUG(dev, "error: loop is not enough.\n"); @@ -367,7 +367,8 @@ hwpstate_probe(device_t dev) */ msr = rdmsr(MSR_AMD_10H_11H_LIMIT); if (sc->cfnum != 1 + AMD_10H_11H_GET_PSTATE_MAX_VAL(msr)) { - HWPSTATE_DEBUG(dev, "msr and acpi _PSS count mismatch.\n"); + HWPSTATE_DEBUG(dev, "MSR (%jd) and ACPI _PSS (%d)" + " count mismatch\n", (intmax_t)msr, sc->cfnum); error = TRUE; } } @@ -427,7 +428,8 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did; break; default: - HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family 0x%02x CPU's are not implemented yet. sorry.\n", family); + HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family" + " 0x%02x CPUs are not supported yet\n", family); return (ENXIO); } hwpstate_set[i].pstate_id = i; From owner-svn-src-head@freebsd.org Thu Dec 1 15:46:28 2016 Return-Path: Delivered-To: svn-src-head@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 DFC3AC61DBC; Thu, 1 Dec 2016 15:46:28 +0000 (UTC) (envelope-from mm@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 A822614E0; Thu, 1 Dec 2016 15:46:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1FkR58095097; Thu, 1 Dec 2016 15:46:27 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1FkRYZ095087; Thu, 1 Dec 2016 15:46:27 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612011546.uB1FkRYZ095087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 1 Dec 2016 15:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309363 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 15:46:29 -0000 Author: mm Date: Thu Dec 1 15:46:26 2016 New Revision: 309363 URL: https://svnweb.freebsd.org/changeset/base/309363 Log: MFC r309362: Sync libarchive with vendor. Small improvements, style fixes, bugfixes. Restores compatibility with tar archives created with Perl Archive::Tar (1) MFC after: 1 week Reported by: Matthew Seaman (1) Added: head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c - copied unchanged from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu - copied unchanged from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu Modified: head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/tar/creation_set.c head/contrib/libarchive/tar/test/main.c head/contrib/libarchive/tar/test/test_copy.c head/contrib/libarchive/tar/write.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/libarchive/archive.h Thu Dec 1 15:46:26 2016 (r309363) @@ -562,7 +562,7 @@ __LA_DECL la_int64_t archive_read_head * we cannot say whether there are encrypted entries, then * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. * In general, this function will return values below zero when the - * reader is uncertain or totally uncapable of encryption support. + * reader is uncertain or totally incapable of encryption support. * When this function returns 0 you can be sure that the reader * supports encryption detection but no encrypted entries have * been found yet. @@ -984,12 +984,12 @@ __LA_DECL int archive_read_disk_can_desc __LA_DECL int archive_read_disk_current_filesystem(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *); -/* Request that the access time of the entry visited by travesal be restored. */ +/* Request that the access time of the entry visited by traversal be restored. */ __LA_DECL int archive_read_disk_set_atime_restored(struct archive *); /* * Set behavior. The "flags" argument selects optional behavior. */ -/* Request that the access time of the entry visited by travesal be restored. +/* Request that the access time of the entry visited by traversal be restored. * This is the same as archive_read_disk_set_atime_restored. */ #define ARCHIVE_READDISK_RESTORE_ATIME (0x0001) /* Default: Do not skip an entry which has nodump flags. */ @@ -1124,7 +1124,7 @@ __LA_DECL int archive_match_time_exclude /* * Flags to tell a matching type of time stamps. These are used for - * following functinos. + * following functions. */ /* Time flag: mtime to be tested. */ #define ARCHIVE_MATCH_MTIME (0x0100) @@ -1144,7 +1144,7 @@ __LA_DECL int archive_match_include_date const char *_datestr); __LA_DECL int archive_match_include_date_w(struct archive *, int _flag, const wchar_t *_datestr); -/* Set inclusion time by a particluar file. */ +/* Set inclusion time by a particular file. */ __LA_DECL int archive_match_include_file_time(struct archive *, int _flag, const char *_pathname); __LA_DECL int archive_match_include_file_time_w(struct archive *, Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Thu Dec 1 15:46:26 2016 (r309363) @@ -75,6 +75,8 @@ __FBSDID("$FreeBSD$"); #define MTREE_HAS_OPTIONAL 0x0800 #define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */ +#define MTREE_HASHTABLE_SIZE 1024 + struct mtree_option { struct mtree_option *next; char *value; @@ -86,6 +88,8 @@ struct mtree_entry { char *name; char full; char used; + unsigned int name_hash; + struct mtree_entry *hashtable_next; }; struct mtree { @@ -98,6 +102,7 @@ struct mtree { const char *archive_format_name; struct mtree_entry *entries; struct mtree_entry *this_entry; + struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE]; struct archive_string current_dir; struct archive_string contents_name; @@ -110,6 +115,7 @@ struct mtree { static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); static int detect_form(struct archive_read *, int *); +static unsigned int hash(const char *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, struct mtree *, struct mtree_entry *, int *); @@ -862,11 +868,12 @@ process_add_entry(struct archive_read *a struct mtree_option **global, const char *line, ssize_t line_len, struct mtree_entry **last_entry, int is_form_d) { - struct mtree_entry *entry; + struct mtree_entry *entry, *ht_iter; struct mtree_option *iter; const char *next, *eq, *name, *end; size_t name_len, len; int r, i; + unsigned int ht_idx; if ((entry = malloc(sizeof(*entry))) == NULL) { archive_set_error(&a->archive, errno, "Can't allocate memory"); @@ -877,6 +884,8 @@ process_add_entry(struct archive_read *a entry->name = NULL; entry->used = 0; entry->full = 0; + entry->name_hash = 0; + entry->hashtable_next = NULL; /* Add this entry to list. */ if (*last_entry == NULL) @@ -929,6 +938,16 @@ process_add_entry(struct archive_read *a memcpy(entry->name, name, name_len); entry->name[name_len] = '\0'; parse_escapes(entry->name, entry); + entry->name_hash = hash(entry->name); + + ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE; + if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) { + while (ht_iter->hashtable_next) + ht_iter = ht_iter->hashtable_next; + ht_iter->hashtable_next = entry; + } else { + mtree->entry_hashtable[ht_idx] = entry; + } for (iter = *global; iter != NULL; iter = iter->next) { r = add_option(a, &entry->options, iter->value, @@ -1122,9 +1141,10 @@ parse_file(struct archive_read *a, struc * with pathname canonicalization, which is a very * tricky subject.) */ - for (mp = mentry->next; mp != NULL; mp = mp->next) { + for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) { if (mp->full && !mp->used - && strcmp(mentry->name, mp->name) == 0) { + && mentry->name_hash == mp->name_hash + && strcmp(mentry->name, mp->name) == 0) { /* Later lines override earlier ones. */ mp->used = 1; r1 = parse_line(a, entry, mtree, mp, @@ -2000,3 +2020,19 @@ readline(struct archive_read *a, struct find_off = u - mtree->line.s; } } + +static unsigned int +hash(const char *p) +{ + /* A 32-bit version of Peter Weinberger's (PJW) hash algorithm, + as used by ELF for hashing function names. */ + unsigned g, h = 0; + while (*p != '\0') { + h = (h << 4) + *p++; + if ((g = h & 0xF0000000) != 0) { + h ^= g >> 24; + h &= 0x0FFFFFFF; + } + } + return h; +} Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Thu Dec 1 15:46:26 2016 (r309363) @@ -294,8 +294,14 @@ archive_read_format_tar_cleanup(struct a return (ARCHIVE_OK); } +/* + * Validate number field + * + * Flags: + * 1 - allow double \0 at field end + */ static int -validate_number_field(const char* p_field, size_t i_size) +validate_number_field(const char* p_field, size_t i_size, int flags) { unsigned char marker = (unsigned char)p_field[0]; /* octal? */ @@ -305,14 +311,24 @@ validate_number_field(const char* p_fiel for (i = 0; i < i_size; ++i) { switch (p_field[i]) { - case ' ': /* skip any leading spaces and trailing space*/ + case ' ': + /* skip any leading spaces and trailing space */ if (octal_found == 0 || i == i_size - 1) { continue; } break; - case '\0': /* null is allowed only at the end */ + case '\0': + /* + * null should be allowed only at the end + * + * Perl Archive::Tar terminates some fields + * with two nulls. We must allow this to stay + * compatible. + */ if (i != i_size - 1) { - return 0; + if (((flags & 1) == 0) + || i != i_size - 2) + return 0; } break; /* rest must be octal digits */ @@ -390,18 +406,25 @@ archive_read_format_tar_bid(struct archi * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. * These are usually octal numbers but GNU tar encodes "big" values as * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be checked - * to avoid false positives. + * Even the null terminator is sometimes omitted. Anyway, must be + * checked to avoid false positives. + * + * Perl Archive::Tar does not follow the spec and terminates mode, uid, + * gid, rdevmajor and rdevminor with a double \0. For compatibility + * reasons we allow this deviation. */ - if (bid > 0 && - (validate_number_field(header->mode, sizeof(header->mode)) == 0 || - validate_number_field(header->uid, sizeof(header->uid)) == 0 || - validate_number_field(header->gid, sizeof(header->gid)) == 0 || - validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || - validate_number_field(header->size, sizeof(header->size)) == 0 || - validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || - validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { - bid = 0; + if (bid > 0 && ( + validate_number_field(header->mode, sizeof(header->mode), 1) == 0 + || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 + || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime), + 0) == 0 + || validate_number_field(header->size, sizeof(header->size), 0) == 0 + || validate_number_field(header->rdevmajor, + sizeof(header->rdevmajor), 1) == 0 + || validate_number_field(header->rdevminor, + sizeof(header->rdevminor), 1) == 0)) { + bid = 0; } return (bid); Copied: head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c (from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c Thu Dec 1 15:46:26 2016 (r309363, copy of r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2016 Martin Matuska + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD"); + +/* + * Verify our ability to read sample files created by Perl module Archive::Tar + */ + +DEFINE_TEST(test_compat_perl_archive_tar) +{ + char name[] = "test_compat_perl_archive_tar.tar"; + struct archive_entry *ae; + struct archive *a; + int r; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + extract_reference_file(name); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, + 10240)); + + /* Read first entry. */ + assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae)); + if (r != ARCHIVE_OK) { + archive_read_free(a); + return; + } + assertEqualString("file1", archive_entry_pathname(ae)); + assertEqualInt(1480603099, archive_entry_mtime(ae)); + assertEqualInt(1000, archive_entry_uid(ae)); + assertEqualString("john", archive_entry_uname(ae)); + assertEqualInt(1000, archive_entry_gid(ae)); + assertEqualString("john", archive_entry_gname(ae)); + assertEqualInt(0100644, archive_entry_mode(ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Copied: head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu (from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu Thu Dec 1 15:46:26 2016 (r309363, copy of r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu) @@ -0,0 +1,49 @@ +begin 644 test_compat_perl_archive_tar.tar +M9FEL93$````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#`P,#8T-```,#`Q-S4P```P,#$W-3```"`@("`@("`@("`U +M`#$S,#(P,#,R-S,S`"`Q,3$R,P`@,``````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````!Ufilter_count); @@ -308,7 +308,7 @@ cset_auto_compress(struct creation_set * cset->filters = v; return (1); } else { - /* Put previos filters back. */ + /* Put previous filters back. */ cset->filters = old_filters; cset->filter_count = old_filter_count; return (0); Modified: head/contrib/libarchive/tar/test/main.c ============================================================================== --- head/contrib/libarchive/tar/test/main.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/tar/test/main.c Thu Dec 1 15:46:26 2016 (r309363) @@ -521,7 +521,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (0); /* Standard: return 0 for end-of-string. */ cnt = utf8_count[ch]; - /* Invalide sequence or there are not plenty bytes. */ + /* Invalid sequence or there are not plenty bytes. */ if (n < (size_t)cnt) return (-1); @@ -560,7 +560,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (-1); } - /* The code point larger than 0x10FFFF is not leagal + /* The code point larger than 0x10FFFF is not legal * Unicode values. */ if (wc > 0x10FFFF) return (-1); Modified: head/contrib/libarchive/tar/test/test_copy.c ============================================================================== --- head/contrib/libarchive/tar/test/test_copy.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/tar/test/test_copy.c Thu Dec 1 15:46:26 2016 (r309363) @@ -285,7 +285,7 @@ copy_basic(void) /* NOTE: for proper operation on cygwin-1.5 and windows, the * length of the name of the directory below, "plain", must be - * less than or equal to the lengthe of the name of the original + * less than or equal to the length of the name of the original * directory, "original" This restriction derives from the * extremely limited pathname lengths on those platforms. */ @@ -327,7 +327,7 @@ copy_ustar(void) /* NOTE: for proper operation on cygwin-1.5 and windows, the * length of the name of the directory below, "ustar", must be - * less than or equal to the lengthe of the name of the original + * less than or equal to the length of the name of the original * directory, "original" This restriction derives from the * extremely limited pathname lengths on those platforms. */ Modified: head/contrib/libarchive/tar/write.c ============================================================================== --- head/contrib/libarchive/tar/write.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/tar/write.c Thu Dec 1 15:46:26 2016 (r309363) @@ -527,7 +527,7 @@ write_archive(struct archive *a, struct struct archive *disk = bsdtar->diskreader; /* - * This tricky code here is to correctly read the cotents + * This tricky code here is to correctly read the contents * of the entry because the disk reader bsdtar->diskreader * is pointing at does not have any information about the * entry by this time and using archive_read_data_block() Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Thu Dec 1 15:39:33 2016 (r309362) +++ head/lib/libarchive/tests/Makefile Thu Dec 1 15:46:26 2016 (r309363) @@ -71,6 +71,7 @@ TESTS_SRCS= \ test_compat_lzop.c \ test_compat_mac.c \ test_compat_pax_libarchive_2x.c \ + test_compat_perl_archive_tar.c \ test_compat_solaris_tar_acl.c \ test_compat_solaris_pax_sparse.c \ test_compat_star_acl_posix1e.c \ @@ -348,6 +349,7 @@ ${PACKAGE}FILES+= test_compat_lzop_3.tar ${PACKAGE}FILES+= test_compat_mac-1.tar.Z.uu ${PACKAGE}FILES+= test_compat_mac-2.tar.Z.uu ${PACKAGE}FILES+= test_compat_pax_libarchive_2x.tar.Z.uu +${PACKAGE}FILES+= test_compat_perl_archive_tar.tar.uu ${PACKAGE}FILES+= test_compat_solaris_pax_sparse_1.pax.Z.uu ${PACKAGE}FILES+= test_compat_solaris_pax_sparse_2.pax.Z.uu ${PACKAGE}FILES+= test_compat_solaris_tar_acl.tar.uu From owner-svn-src-head@freebsd.org Thu Dec 1 16:32:16 2016 Return-Path: Delivered-To: svn-src-head@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 1E979C60E48 for ; Thu, 1 Dec 2016 16:32:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 F0A081CD1 for ; Thu, 1 Dec 2016 16:32:15 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: b6b4de07-b7e3-11e6-9f67-d3961ed5a660 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 outbound1.ore.mailhop.org (Halon) with ESMTPSA id b6b4de07-b7e3-11e6-9f67-d3961ed5a660; Thu, 01 Dec 2016 16:32:13 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB1GW7IP003818; Thu, 1 Dec 2016 09:32:07 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480609927.1889.189.camel@freebsd.org> Subject: Re: svn commit: r309344 - head/lib/libutil From: Ian Lepore To: Ngie Cooper , "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 01 Dec 2016 09:32:07 -0700 In-Reply-To: <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:32:16 -0000 On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: > > > > On Nov 30, 2016, at 18:21, Conrad E. Meyer wrote: > > > > Author: cem > > Date: Thu Dec  1 02:21:36 2016 > > New Revision: 309344 > > URL: https://svnweb.freebsd.org/changeset/base/309344 > > > > Log: > >  Remove a death threat from the FreeBSD sources > > > >  Reported by:    koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, > > ngie@, cem@ > >  Maintainer timeout:    des@ > Really?? I wish you hadn't added me to this list.. I don't in any way > endorse the way that you went about dealing with this disagreement. > You kind of just pissed all over what des@ did out of spite. > > Really?  Well then feel free to ADD my name to the list of people who found that comment, and the subsequent non-response to the complaints about it, completely inappropriate.   -- Ian > > > > > > Modified: > >  head/lib/libutil/flopen.c > > > > Modified: head/lib/libutil/flopen.c > > =================================================================== > > =========== > > --- head/lib/libutil/flopen.c    Thu Dec  1 01:56:34 > > 2016    (r309343) > > +++ head/lib/libutil/flopen.c    Thu Dec  1 02:21:36 > > 2016    (r309344) > > @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); > > /* > >  * Reliably open and lock a file. > >  * > > - * DO NOT, UNDER PAIN OF DEATH, modify this code without first > > reading the > > - * revision history and discussing your changes with > org>. > > - * Don't be fooled by the code's apparent simplicity; there would > > be no > > - * need for this function if it was as easy to get right as you > > think. > > + * Please do not modify this code without first reading the > > revision history > > + * and discussing your changes with .  Don't be > > fooled by the > > + * code's apparent simplicity; there would be no need for this > > function if it > > + * was easy to get right. > >  */ > > int > > flopen(const char *path, int flags, ...) > > @@ -108,7 +108,11 @@ flopen(const char *path, int flags, ...) > >            errno = serrno; > >            return (-1); > >        } > > -#ifdef DONT_EVEN_THINK_ABOUT_IT > > +        /* > > +         * The following change is provided as a specific example > > to > > +         * avoid. > > +         */ > > +#if 0 > >        if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) { > >            serrno = errno; > >            (void)close(fd); > > > From owner-svn-src-head@freebsd.org Thu Dec 1 16:36:36 2016 Return-Path: Delivered-To: svn-src-head@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 ACE8BC60F67 for ; Thu, 1 Dec 2016 16:36:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 509B41EC8 for ; Thu, 1 Dec 2016 16:36:35 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 4e1c8f3f-b7e4-11e6-9673-39b5816e8152 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 outbound1.eu.mailhop.org (Halon) with ESMTPSA id 4e1c8f3f-b7e4-11e6-9673-39b5816e8152; Thu, 01 Dec 2016 16:36:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB1GaMNu003826; Thu, 1 Dec 2016 09:36:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480610182.1889.192.camel@freebsd.org> Subject: Re: svn commit: r309350 - head/etc From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 01 Dec 2016 09:36:22 -0700 In-Reply-To: <201612010435.uB14Zfgu020006@repo.freebsd.org> References: <201612010435.uB14Zfgu020006@repo.freebsd.org> 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:36:36 -0000 On Thu, 2016-12-01 at 04:35 +0000, Warner Losh wrote: > Author: imp > Date: Thu Dec  1 04:35:41 2016 > New Revision: 309350 > URL: https://svnweb.freebsd.org/changeset/base/309350 > > Log: >   If the kenv variable rc_debug is set, turn on rc_debug. > > Modified: >   head/etc/rc.subr > > Modified: head/etc/rc.subr > ===================================================================== > ========= > --- head/etc/rc.subr Thu Dec  1 04:35:38 2016 (r309349) > +++ head/etc/rc.subr Thu Dec  1 04:35:41 2016 (r309350) > @@ -2119,6 +2119,12 @@ _echoonce() >   esac >  } >   > +# If the loader env variable rc.debug is set, turn on debugging. > rc.conf will > +# still override this, but /etc/defaults/rc.conf.a > +if kenv -q rc.debug > /dev/null ; then > + rc_debug=YES > +fi > + >  fi # [ -z "${_rc_subr_loaded}" ] >   >  _rc_subr_loaded=: > The commit message says rc_debug but the env var in your code is rc.debug.  I think rc_debug would be better -- easier than remembering two different names for the same functionality. BTW, thanks for this, it's a great idea. -- Ian From owner-svn-src-head@freebsd.org Thu Dec 1 16:48:15 2016 Return-Path: Delivered-To: svn-src-head@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 083DBC61429; Thu, 1 Dec 2016 16:48:15 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id EE72D1822; Thu, 1 Dec 2016 16:48:14 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id EC84A17BAD; Thu, 1 Dec 2016 08:48:07 -0800 (PST) Date: Thu, 1 Dec 2016 08:48:07 -0800 From: hiren panchasara To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309351 - head/etc/defaults Message-ID: <20161201164807.GE27291@strugglingcoder.info> References: <201612010435.uB14Zh21020050@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="10jrOL3x2xqLmOsH" Content-Disposition: inline In-Reply-To: <201612010435.uB14Zh21020050@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:48:15 -0000 --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 12/01/16 at 04:35P, Warner Losh wrote: > Author: imp > Date: Thu Dec 1 04:35:43 2016 > New Revision: 309351 > URL: https://svnweb.freebsd.org/changeset/base/309351 >=20 > Log: > Revert the 'performance' setting to 'NONE' from C2. Just a note that this commit reverts r282110. Cheers, Hiren --10jrOL3x2xqLmOsH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYQFRFXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lVuAH/0szA/r+Wz158bGbtawLxZ43 v5TgaH+wsrBa8NnPtIOISloIEwHshes0e6H1SQf4Ow6ligDi89pJ1ANCDdJyYKSZ grENUh0CAMHenJDJgfC9RDG1IqxjzrJIAxQ31j4gRd6OgRB2TPgxdjXsbwkfrrJM Dds8tnwaBcSGojfPhJvZ88WNFZVdHyEfstmagEPSogL5Os7TB5pYbn5z6oEXSppU bCWGUK3gKfOSxZjQwo4zhBTXwD6h82Wr01/YDVeMx3gVmPlTcBmzJh0Rjzut6Ar5 +sqT6Ul1YIt0/7Vf4vI9yS6Tv+E7tznW2JOIbeQapv+3xC+2rOjAA7adsxwLijM= =25wp -----END PGP SIGNATURE----- --10jrOL3x2xqLmOsH-- From owner-svn-src-head@freebsd.org Thu Dec 1 16:54:03 2016 Return-Path: Delivered-To: svn-src-head@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 F255AC617D2; Thu, 1 Dec 2016 16:54:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1D241DC2; Thu, 1 Dec 2016 16:54:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1Gs2XC023356; Thu, 1 Dec 2016 16:54:02 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1Gs2s4023355; Thu, 1 Dec 2016 16:54:02 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612011654.uB1Gs2s4023355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Dec 2016 16:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309364 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:54:04 -0000 Author: vangyzen Date: Thu Dec 1 16:54:02 2016 New Revision: 309364 URL: https://svnweb.freebsd.org/changeset/base/309364 Log: locale: fix buffer management Also, handle signed and unsigned chars, and more gracefully handle invalid input. Submitted by: bde in response to r309331 MFC after: 1 week Sponsored by: Dell EMC Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Thu Dec 1 15:46:26 2016 (r309363) +++ head/usr.bin/locale/locale.c Thu Dec 1 16:54:02 2016 (r309364) @@ -495,29 +495,29 @@ format_grouping(const char *binary) { static char rval[64]; const char *cp; - size_t len; + size_t roff; + int len; rval[0] = '\0'; + roff = 0; for (cp = binary; *cp != '\0'; ++cp) { - char group[sizeof("127;")]; - snprintf(group, sizeof(group), "%hhd;", *cp); - len = strlcat(rval, group, sizeof(rval)); - if (len >= sizeof(rval)) { - len = sizeof(rval) - 1; - break; - } - if (*cp == CHAR_MAX) { - break; - } + if (*cp < 0) + break; /* garbage input */ + len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp); + if (len < 0 || (unsigned)len >= sizeof(rval) - roff) + break; /* insufficient space for output */ + roff += len; + if (*cp == CHAR_MAX) + break; /* special termination */ } - /* Remove the trailing ';'. */ - rval[len - 1] = '\0'; + /* Truncate at the last successfully snprintf()ed semicolon. */ + if (roff != 0) + rval[roff - 1] = '\0'; - return (rval); + return (&rval[0]); } - /* * keyword value lookup helper (via localeconv()) */ From owner-svn-src-head@freebsd.org Thu Dec 1 16:54:42 2016 Return-Path: Delivered-To: svn-src-head@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 34F4BC6186B; Thu, 1 Dec 2016 16:54:42 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 231A51FE4; Thu, 1 Dec 2016 16:54:41 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 4DD8217BC3; Thu, 1 Dec 2016 08:54:41 -0800 (PST) Date: Thu, 1 Dec 2016 08:54:41 -0800 From: hiren panchasara To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309351 - head/etc/defaults Message-ID: <20161201165441.GF27291@strugglingcoder.info> References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zs/RYxT/hKAHzkfQ" Content-Disposition: inline In-Reply-To: <20161201164807.GE27291@strugglingcoder.info> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:54:42 -0000 --Zs/RYxT/hKAHzkfQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 12/01/16 at 08:48P, hiren panchasara wrote: > On 12/01/16 at 04:35P, Warner Losh wrote: > > Author: imp > > Date: Thu Dec 1 04:35:43 2016 > > New Revision: 309351 > > URL: https://svnweb.freebsd.org/changeset/base/309351 > >=20 > > Log: > > Revert the 'performance' setting to 'NONE' from C2. >=20 > Just a note that this commit reverts r282110. Ah, my bad. performance_cx_lowest has more history than that. :-)=20 (HIGH -> Cmax -> C2 -> NONE) Cheers, Hiren --Zs/RYxT/hKAHzkfQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYQFXRXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lv5gIAJLwn53t7uLQAZx/6CZhJYW7 kGzdNmng6IR1ZpZJ6EXCQLe/wPSi2yvvxscuWBgMgWhEsSm/BsiqXsBX7F79iga7 X6zlw3gleadA3IFG0l5vdVtEQ4eqL9ikJg94510FVoMFEhcx1iapbHm4M4j0xQmD Y3l7VAU+/yHDCjvThgjPO5CWlD+o1QizHIIshSltTjAVyEG0oF6Jv/xp/m3vNDia DRnJaH7zb199BuPoPv+B81ddxaZnSVaHIJS4B3ddXDEIuREYRDImhCiqWf/EeRcq 5Zsus7EWkY+8QIbSyOjpiq+cQV3f90Hv50N3uiZwL1dZqOOTVkVbjeS0ydNpEjY= =xO0l -----END PGP SIGNATURE----- --Zs/RYxT/hKAHzkfQ-- From owner-svn-src-head@freebsd.org Thu Dec 1 16:58:18 2016 Return-Path: Delivered-To: svn-src-head@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 BE838C619F0; Thu, 1 Dec 2016 16:58:18 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id A9D171235; Thu, 1 Dec 2016 16:58:18 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id CFE0C5648E; Thu, 1 Dec 2016 10:58:17 -0600 (CST) Subject: Re: svn commit: r309331 - head/usr.bin/locale To: Bruce Evans References: <201611301834.uAUIYfQs075427@repo.freebsd.org> <20161201082459.T1285@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: Date: Thu, 1 Dec 2016 10:58:13 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161201082459.T1285@besplex.bde.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:58:18 -0000 On 11/30/2016 18:19, Bruce Evans wrote: > On Wed, 30 Nov 2016, Eric van Gyzen wrote: > >> Log: >> Include limits.h for CHAR_MAX >> >> This was needed on stable/10. Apparently, sys/param.h supplies CHAR_MAX >> on head. Include limits.h anyway, for consistency, and because C >> says so. > > sys/param.actually supplies CHAR_MAX (undocumented namespace pollution) in > all versions of FreeBSD. Yes, I was too terse. I meant, locale.c gets CHAR_MAX from sys/param.h on head (and 11), but does not include sys/param.h on 10. > Untested fixes and cleanups: > > Y diff -u2 locale.c~ locale.c Thanks. Committed. Eric From owner-svn-src-head@freebsd.org Thu Dec 1 17:01:25 2016 Return-Path: Delivered-To: svn-src-head@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 7B4F5C61CF7; Thu, 1 Dec 2016 17:01:25 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD571614; Thu, 1 Dec 2016 17:01:25 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id D47A15F2; Thu, 1 Dec 2016 11:01:17 -0600 (CST) Date: Thu, 1 Dec 2016 11:01:16 -0600 From: Mark Linimon To: Ian Lepore Cc: Ngie Cooper , "Conrad E. Meyer" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r309344 - head/lib/libutil Message-ID: <20161201170116.GA20872@lonesome.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1480609927.1889.189.camel@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:01:25 -0000 On Thu, Dec 01, 2016 at 09:32:07AM -0700, Ian Lepore wrote: > On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: > > Really?? I wish you hadn't added me to this list.. I don't in any way > > endorse the way that you went about dealing with this disagreement. > > Really?  Well then feel free to ADD my name to the list of people who > found that comment, and the subsequent non-response to the complaints > about it, completely inappropriate.   I expressed an opinion on an IRC channel that I found the comment offensive. But I would rather my permission had been asked ahead of time before having that comment attached to a public commit log. I think this is part of the point that ngie is trying to make. I'm well-known for my wish that core took a more active, public, stance on such matters, but I think here that two wrongs may not have made a right. mcl From owner-svn-src-head@freebsd.org Thu Dec 1 17:26:39 2016 Return-Path: Delivered-To: svn-src-head@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 3BC9CC607C2; Thu, 1 Dec 2016 17:26:39 +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 F0B551630; Thu, 1 Dec 2016 17:26:38 +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 uB1HQcSB035592; Thu, 1 Dec 2016 17:26:38 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1HQbkC035589; Thu, 1 Dec 2016 17:26:37 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201612011726.uB1HQbkC035589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 1 Dec 2016 17:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309365 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:26:39 -0000 Author: alc Date: Thu Dec 1 17:26:37 2016 New Revision: 309365 URL: https://svnweb.freebsd.org/changeset/base/309365 Log: During vm_page_cache()'s call to vm_radix_insert(), if vm_page_alloc() was called to allocate a new page of radix trie nodes, there could be a call to vm_radix_remove() on the same trie (of PG_CACHED pages) as the in-progress vm_radix_insert(). With the removal of PG_CACHED pages, we can simplify vm_radix_insert() and vm_radix_remove() by removing the flags on the root of the trie that were used to detect this case and the code for restarting vm_radix_insert() when it happened. Reviewed by: kib, markj Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8664 Modified: head/sys/vm/_vm_radix.h head/sys/vm/vm_object.c head/sys/vm/vm_radix.c Modified: head/sys/vm/_vm_radix.h ============================================================================== --- head/sys/vm/_vm_radix.h Thu Dec 1 16:54:02 2016 (r309364) +++ head/sys/vm/_vm_radix.h Thu Dec 1 17:26:37 2016 (r309365) @@ -36,12 +36,8 @@ */ struct vm_radix { uintptr_t rt_root; - uint8_t rt_flags; }; -#define RT_INSERT_INPROG 0x01 -#define RT_TRIE_MODIFIED 0x02 - #ifdef _KERNEL static __inline boolean_t Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Dec 1 16:54:02 2016 (r309364) +++ head/sys/vm/vm_object.c Thu Dec 1 17:26:37 2016 (r309365) @@ -205,7 +205,6 @@ vm_object_zinit(void *mem, int size, int object->type = OBJT_DEAD; object->ref_count = 0; object->rtree.rt_root = 0; - object->rtree.rt_flags = 0; object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Thu Dec 1 16:54:02 2016 (r309364) +++ head/sys/vm/vm_radix.c Thu Dec 1 17:26:37 2016 (r309365) @@ -341,8 +341,6 @@ vm_radix_insert(struct vm_radix *rtree, index = page->pindex; -restart: - /* * The owner of record for root is not really important because it * will never be used. @@ -360,32 +358,10 @@ restart: panic("%s: key %jx is already present", __func__, (uintmax_t)index); clev = vm_radix_keydiff(m->pindex, index); - - /* - * During node allocation the trie that is being - * walked can be modified because of recursing radix - * trie operations. - * If this is the case, the recursing functions signal - * such situation and the insert operation must - * start from scratch again. - * The freed radix node will then be in the UMA - * caches very likely to avoid the same situation - * to happen. - */ - rtree->rt_flags |= RT_INSERT_INPROG; tmp = vm_radix_node_get(vm_radix_trimkey(index, clev + 1), 2, clev); - rtree->rt_flags &= ~RT_INSERT_INPROG; - if (tmp == NULL) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; + if (tmp == NULL) return (ENOMEM); - } - if ((rtree->rt_flags & RT_TRIE_MODIFIED) != 0) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; - tmp->rn_count = 0; - vm_radix_node_put(tmp); - goto restart; - } *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); vm_radix_addpage(tmp, m->pindex, clev, m); @@ -409,21 +385,9 @@ restart: */ newind = rnode->rn_owner; clev = vm_radix_keydiff(newind, index); - - /* See the comments above. */ - rtree->rt_flags |= RT_INSERT_INPROG; tmp = vm_radix_node_get(vm_radix_trimkey(index, clev + 1), 2, clev); - rtree->rt_flags &= ~RT_INSERT_INPROG; - if (tmp == NULL) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; + if (tmp == NULL) return (ENOMEM); - } - if ((rtree->rt_flags & RT_TRIE_MODIFIED) != 0) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; - tmp->rn_count = 0; - vm_radix_node_put(tmp); - goto restart; - } *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); slot = vm_radix_slot(newind, clev); @@ -708,20 +672,6 @@ vm_radix_remove(struct vm_radix *rtree, vm_page_t m; int i, slot; - /* - * Detect if a page is going to be removed from a trie which is - * already undergoing another trie operation. - * Right now this is only possible for vm_radix_remove() recursing - * into vm_radix_insert(). - * If this is the case, the caller must be notified about this - * situation. It will also takecare to update the RT_TRIE_MODIFIED - * accordingly. - * The RT_TRIE_MODIFIED bit is set here because the remove operation - * will always succeed. - */ - if ((rtree->rt_flags & RT_INSERT_INPROG) != 0) - rtree->rt_flags |= RT_TRIE_MODIFIED; - rnode = vm_radix_getroot(rtree); if (vm_radix_isleaf(rnode)) { m = vm_radix_topage(rnode); @@ -776,9 +726,6 @@ vm_radix_reclaim_allnodes(struct vm_radi { struct vm_radix_node *root; - KASSERT((rtree->rt_flags & RT_INSERT_INPROG) == 0, - ("vm_radix_reclaim_allnodes: unexpected trie recursion")); - root = vm_radix_getroot(rtree); if (root == NULL) return; From owner-svn-src-head@freebsd.org Thu Dec 1 17:28:46 2016 Return-Path: Delivered-To: svn-src-head@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 B8FEFC60837; Thu, 1 Dec 2016 17:28:46 +0000 (UTC) (envelope-from cem@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 88B7C17D9; Thu, 1 Dec 2016 17:28:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1HSjiQ035694; Thu, 1 Dec 2016 17:28:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1HSjBZ035693; Thu, 1 Dec 2016 17:28:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612011728.uB1HSjBZ035693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 1 Dec 2016 17:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309366 - head/lib/libcapsicum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:28:46 -0000 Author: cem Date: Thu Dec 1 17:28:45 2016 New Revision: 309366 URL: https://svnweb.freebsd.org/changeset/base/309366 Log: capsicum_helpers: Squash errors from closed fds Squash EBADF from closed stdin, stdout, or stderr in caph_limit_stdio(). Any program used during special shell scripts may commonly be forked from a parent process with closed standard stream. Do the common sense thing for this common use. Reported by: Iblis Lin Reviewed by: oshogbo@ (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8657 Modified: head/lib/libcapsicum/capsicum_helpers.h Modified: head/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.h Thu Dec 1 17:26:37 2016 (r309365) +++ head/lib/libcapsicum/capsicum_helpers.h Thu Dec 1 17:28:45 2016 (r309366) @@ -94,12 +94,12 @@ caph_limit_stdout(void) static __inline int caph_limit_stdio(void) { + const int iebadf = CAPH_IGNORE_EBADF; - if (caph_limit_stdin() == -1 || caph_limit_stdout() == -1 || - caph_limit_stderr() == -1) { + if (caph_limit_stream(STDIN_FILENO, CAPH_READ | iebadf) == -1 || + caph_limit_stream(STDOUT_FILENO, CAPH_WRITE | iebadf) == -1 || + caph_limit_stream(STDERR_FILENO, CAPH_WRITE | iebadf) == -1) return (-1); - } - return (0); } From owner-svn-src-head@freebsd.org Thu Dec 1 17:33:24 2016 Return-Path: Delivered-To: svn-src-head@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 DE947C60BC2; Thu, 1 Dec 2016 17:33:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 AD4761E53; Thu, 1 Dec 2016 17:33:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id c4so12241660pfb.3; Thu, 01 Dec 2016 09:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b+UZPQpj8mbJg7yr9rF7WSN5dE46SDA/LHYekYT5lq0=; b=XFO5pPtP4Q+R3915250PXmmZrhoaoRxSBwssyMGujaSONiZtia6XmD/O20t6PGUDsz KSoSBPr0sFdt4umWrn2M5HfYz3JWCuNfkEq71/ZhjUBwmtogagNsSxAR7AolxBXo2vyA hXlcZIq49fZSEpIlUGnrHkiUO3gA9cuAk+14E7KHGaCqtChVtjw7jGGA+iWna7p47hfC bLQy4pgOExU0hNTHFvPy3fdI9eyQLxIL1IWehpb2FsI1VSgMPaJe6d8y3+t/yOJCBZry Omioe0vPW0O/COej/jLOWWAUQQqeUNrBTxILeJ+OUT2+02gPeeKqEW3HFS+bdg/VfXyq l7Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b+UZPQpj8mbJg7yr9rF7WSN5dE46SDA/LHYekYT5lq0=; b=BrrnPrQ8k2DNznkFHmo2dQ0zBc4AeMxMS0mMLf07XrMUVHhSUmk4bJHuzN7NqXHuIn vreAn4ISk240nnPviVaEn1hs91tWp1jctrbaTySCBREMGwWy/VSsjP7XN14tCLxD6W4D ZEo/liTai9N1uPXjdJDX9rXLyn+jnTMJMleVWqDMoP4ZCTlWGC+/PE7B/6z8Ju9ulfWr y1jTTocS3LepN0qoOhMEN+PjMv3Jf4+4naKVtAibYyzepbEozNXnp7l1Qn8NQdjhPivN Cusw8OB76p4LFlEST+VLB+N/XoFtN8Wp0+BHTGB5MlCmIcwgNMpKOTIU28ZRoZF4e3RW 0JJA== X-Gm-Message-State: AKaTC03k7GSdaklxACiSe6Lb3iQB7rT2153HG0ASWLAuoL01KQgYKmSaVYpIa6tWWxwusw== X-Received: by 10.99.237.69 with SMTP id m5mr71056363pgk.94.1480613604320; Thu, 01 Dec 2016 09:33:24 -0800 (PST) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q26sm1533523pfk.94.2016.12.01.09.33.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 09:33:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309344 - head/lib/libutil From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20161201170116.GA20872@lonesome.com> Date: Thu, 1 Dec 2016 09:33:22 -0800 Cc: Ian Lepore , "Conrad E. Meyer" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> <20161201170116.GA20872@lonesome.com> To: Mark Linimon X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:33:25 -0000 > On Dec 1, 2016, at 9:01 AM, Mark Linimon wrote: >=20 > On Thu, Dec 01, 2016 at 09:32:07AM -0700, Ian Lepore wrote: >> On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: >>> Really?? I wish you hadn't added me to this list.. I don't in any = way >>> endorse the way that you went about dealing with this disagreement. >>=20 >> Really? Well then feel free to ADD my name to the list of people who >> found that comment, and the subsequent non-response to the complaints >> about it, completely inappropriate. =20 >=20 > I expressed an opinion on an IRC channel that I found the comment > offensive. >=20 > But I would rather my permission had been asked ahead of time before > having that comment attached to a public commit log. I think this is > part of the point that ngie is trying to make. >=20 > I'm well-known for my wish that core took a more active, public, = stance > on such matters, but I think here that two wrongs may not have made a > right. Yes. And more importantly, the new comment doesn=E2=80=99t tell me *why* I = shouldn=E2=80=99t use FD_CLOEXEC. The owness is still on the reader to = figure out why using `fcntl(fd, F_SETFD, FD_CLOEXEC)` is wrong. All the new commit does is makes the commit that des@ made more = palatable and benign to readers. Thanks, -Ngie= From owner-svn-src-head@freebsd.org Thu Dec 1 17:36:32 2016 Return-Path: Delivered-To: svn-src-head@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 BA900C60DA1; Thu, 1 Dec 2016 17:36:32 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 955F81098; Thu, 1 Dec 2016 17:36:32 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1HaVcH039473; Thu, 1 Dec 2016 17:36:31 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1HaVEq039471; Thu, 1 Dec 2016 17:36:31 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612011736.uB1HaVEq039471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Dec 2016 17:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309367 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:36:32 -0000 Author: vangyzen Date: Thu Dec 1 17:36:31 2016 New Revision: 309367 URL: https://svnweb.freebsd.org/changeset/base/309367 Log: locale: enable more warnings; fix them Do not set WARNS, so it gets the current default of 6. Fix the warnings by sprinkling static, const, or strdup. Make some constant data tables const. Fix whitespace. MFC after: 1 week Sponsored by: Dell EMC Modified: head/usr.bin/locale/Makefile head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/Makefile ============================================================================== --- head/usr.bin/locale/Makefile Thu Dec 1 17:28:45 2016 (r309366) +++ head/usr.bin/locale/Makefile Thu Dec 1 17:36:31 2016 (r309367) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= locale -WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../lib/libc/locale .include Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Thu Dec 1 17:28:45 2016 (r309366) +++ head/usr.bin/locale/locale.c Thu Dec 1 17:36:31 2016 (r309367) @@ -57,8 +57,8 @@ void list_charmaps(void); void list_locales(void); const char *lookup_localecat(int); char *kwval_lconv(int); -int kwval_lookup(char *, char **, int *, int *); -void showdetails(char *); +int kwval_lookup(const char *, char **, int *, int *); +void showdetails(const char *); void showkeywordslist(char *substring); void showlocale(void); void usage(void); @@ -66,13 +66,12 @@ void usage(void); /* Global variables */ static StringList *locales = NULL; -int all_locales = 0; -int all_charmaps = 0; -int prt_categories = 0; -int prt_keywords = 0; -int more_params = 0; +static int all_locales = 0; +static int all_charmaps = 0; +static int prt_categories = 0; +static int prt_keywords = 0; -struct _lcinfo { +static const struct _lcinfo { const char *name; int id; } lcinfo [] = { @@ -110,7 +109,7 @@ struct _lcinfo { #define KW_INT_P_SIGN_POSN (KW_ZERO+21) #define KW_INT_N_SIGN_POSN (KW_ZERO+22) -struct _kwinfo { +static const struct _kwinfo { const char *name; int isstr; /* true - string, false - number */ int catid; /* LC_* */ @@ -224,7 +223,7 @@ struct _kwinfo { }; #define NKWINFO (nitems(kwinfo)) -const char *boguslocales[] = { "UTF-8" }; +static const char *boguslocales[] = { "UTF-8" }; #define NBOGUS (nitems(boguslocales)) int @@ -296,7 +295,7 @@ main(int argc, char *argv[]) } else { uint i; for (i = 0; i < nitems(kwinfo); i++) - showdetails ((char *)kwinfo [i].name); + showdetails(kwinfo[i].name); } exit(0); } @@ -341,7 +340,7 @@ list_locales(void) static int scmp(const void *s1, const void *s2) { - return strcmp(*(const char **)s1, *(const char **)s2); + return strcmp(*(const char * const *)s1, *(const char * const *)s2); } /* @@ -378,7 +377,7 @@ list_charmaps(void) /* add US-ASCII, if not yet added */ if (sl_find(charmaps, "US-ASCII") == NULL) - sl_add(charmaps, "US-ASCII"); + sl_add(charmaps, strdup("US-ASCII")); /* sort the list */ qsort(charmaps->sl_str, charmaps->sl_cur, sizeof(char *), scmp); @@ -437,10 +436,10 @@ init_locales_list(void) * we also list 'C' for constistency */ if (sl_find(locales, "POSIX") == NULL) - sl_add(locales, "POSIX"); + sl_add(locales, strdup("POSIX")); if (sl_find(locales, "C") == NULL) - sl_add(locales, "C"); + sl_add(locales, strdup("C")); /* make output nicer, sort the list */ qsort(locales->sl_str, locales->sl_cur, sizeof(char *), scmp); @@ -606,7 +605,7 @@ kwval_lconv(int id) * keyword value and properties lookup */ int -kwval_lookup(char *kwname, char **kwval, int *cat, int *isstr) +kwval_lookup(const char *kwname, char **kwval, int *cat, int *isstr) { int rval; size_t i; @@ -634,7 +633,7 @@ kwval_lookup(char *kwname, char **kwval, * command line options specified. */ void -showdetails(char *kw) +showdetails(const char *kw) { int isstr, cat, tmpval; char *kwval; @@ -649,9 +648,9 @@ showdetails(char *kw) } if (prt_categories) { - if (prt_keywords) + if (prt_keywords) printf("%-20s ", lookup_localecat(cat)); - else + else printf("%-20s\t%s\n", kw, lookup_localecat(cat)); } From owner-svn-src-head@freebsd.org Thu Dec 1 18:32:22 2016 Return-Path: Delivered-To: svn-src-head@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 7DCDAC6134B for ; Thu, 1 Dec 2016 18:32:22 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 18FE61FC1 for ; Thu, 1 Dec 2016 18:32:21 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 7ca46bdd-b7f4-11e6-9673-39b5816e8152 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 outbound1.eu.mailhop.org (Halon) with ESMTPSA id 7ca46bdd-b7f4-11e6-9673-39b5816e8152; Thu, 01 Dec 2016 18:32:18 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB1IWCdu004011; Thu, 1 Dec 2016 11:32:12 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480617132.1889.196.camel@freebsd.org> Subject: Re: svn commit: r309344 - head/lib/libutil From: Ian Lepore To: "Ngie Cooper (yaneurabeya)" , Mark Linimon Cc: "Conrad E. Meyer" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Date: Thu, 01 Dec 2016 11:32:12 -0700 In-Reply-To: <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> <20161201170116.GA20872@lonesome.com> <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 18:32:22 -0000 On Thu, 2016-12-01 at 09:33 -0800, Ngie Cooper (yaneurabeya) wrote: > > > > On Dec 1, 2016, at 9:01 AM, Mark Linimon > > wrote: > > > > On Thu, Dec 01, 2016 at 09:32:07AM -0700, Ian Lepore wrote: > > > > > > On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: > > > > > > > > Really?? I wish you hadn't added me to this list.. I don't in > > > > any way > > > > endorse the way that you went about dealing with this > > > > disagreement. > > > Really?  Well then feel free to ADD my name to the list of people > > > who > > > found that comment, and the subsequent non-response to the > > > complaints > > > about it, completely inappropriate.   > > I expressed an opinion on an IRC channel that I found the comment > > offensive. > > > > But I would rather my permission had been asked ahead of time > > before > > having that comment attached to a public commit log.  I think this > > is > > part of the point that ngie is trying to make. > > > > I'm well-known for my wish that core took a more active, public, > > stance > > on such matters, but I think here that two wrongs may not have made > > a > > right. > Yes. > > And more importantly, the new comment doesn¢t tell me *why* I > shouldn¢t use FD_CLOEXEC. The owness is still on the reader to figure > out why using `fcntl(fd, F_SETFD, FD_CLOEXEC)` is wrong. > > All the new commit does is makes the commit that des@ made more > palatable and benign to readers. And how is that a bad thing, compared to the prior situation?  Insult has been removed and information has been added.  You complain that the information that was added was incomplete.  Well, there is one person who could fix that, and he has apparently chosen not to.  So perhaps your ongoing complaint should be directed accordingly. -- Ian From owner-svn-src-head@freebsd.org Thu Dec 1 19:19:21 2016 Return-Path: Delivered-To: svn-src-head@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 9A082C612B7; Thu, 1 Dec 2016 19:19:21 +0000 (UTC) (envelope-from tsoome@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 5C50819B7; Thu, 1 Dec 2016 19:19:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1JJKaR080637; Thu, 1 Dec 2016 19:19:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1JJKrL080636; Thu, 1 Dec 2016 19:19:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201612011919.uB1JJKrL080636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Dec 2016 19:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309369 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 19:19:21 -0000 Author: tsoome Date: Thu Dec 1 19:19:20 2016 New Revision: 309369 URL: https://svnweb.freebsd.org/changeset/base/309369 Log: libstand: dosfs cstyle cleanup for return keyword. Reviewed by: bapt, imp, allanjude Approved by: imp (mentor), allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D8678 Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Thu Dec 1 19:06:09 2016 (r309368) +++ head/lib/libstand/dosfs.c Thu Dec 1 19:19:20 2016 (r309369) @@ -204,7 +204,7 @@ dos_mount(DOS_FS *fs, struct open_file * if (buf != NULL) free(buf); (void)dosunmount(fs); - return(err); + return (err); } free(buf); @@ -219,7 +219,7 @@ dos_mount(DOS_FS *fs, struct open_file * fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff; fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff; } - return 0; + return (0); } /* @@ -231,10 +231,10 @@ dos_unmount(DOS_FS *fs) int err; if (fs->links) - return(EBUSY); + return (EBUSY); if ((err = dosunmount(fs))) - return(err); - return 0; + return (err); + return (0); } /* @@ -244,7 +244,7 @@ static int dosunmount(DOS_FS *fs) { free(fs); - return(0); + return (0); } /* @@ -285,7 +285,7 @@ dos_open(const char *path, struct open_f fd->f_fsdata = (void *)f; out: - return(err); + return (err); } /* @@ -307,7 +307,7 @@ dos_read(struct open_file *fd, void *buf twiddle(4); nb = (u_int)nbyte; if ((size = fsize(f->fs, &f->de)) == -1) - return EINVAL; + return (EINVAL); if (nb > (n = size - f->offset)) nb = n; off = f->offset; @@ -344,7 +344,7 @@ dos_read(struct open_file *fd, void *buf out: if (resid) *resid = nbyte - nb + cnt; - return(err); + return (err); } /* @@ -370,16 +370,16 @@ dos_seek(struct open_file *fd, off_t off break; default: errno = EINVAL; - return(-1); + return (-1); } off += offset; if (off < 0 || off > size) { errno = EINVAL; - return(-1); + return (-1); } f->offset = (u_int)off; f->c = 0; - return(off); + return (off); } /* @@ -394,7 +394,7 @@ dos_close(struct open_file *fd) f->fs->links--; free(f); dos_unmount(fs); - return 0; + return (0); } /* @@ -411,7 +411,7 @@ dos_stat(struct open_file *fd, struct st sb->st_uid = 0; sb->st_gid = 0; if ((sb->st_size = fsize(f->fs, &f->de)) == -1) - return EINVAL; + return (EINVAL); return (0); } @@ -501,7 +501,7 @@ dos_readdir(struct open_file *fd, struct d->d_reclen = sizeof(*d); d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG; memcpy(d->d_name, fn, sizeof(d->d_name)); - return(0); + return (0); } /* @@ -516,41 +516,41 @@ parsebs(DOS_FS *fs, DOS_BS *bs) bs->jmp[0] != 0xe9 && (bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) || bs->bpb.media < 0xf0) - return EINVAL; + return (EINVAL); if (cv2(bs->bpb.secsiz) != SECSIZ) - return EINVAL; + return (EINVAL); if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1)) - return EINVAL; + return (EINVAL); fs->bsize = secbyt(fs->spc); fs->bshift = ffs(fs->bsize) - 1; if ((fs->spf = cv2(bs->bpb.spf))) { if (bs->bpb.fats != 2) - return EINVAL; + return (EINVAL); if (!(fs->dirents = cv2(bs->bpb.dirents))) - return EINVAL; + return (EINVAL); } else { if (!(fs->spf = cv4(bs->bpb.lspf))) - return EINVAL; + return (EINVAL); if (!bs->bpb.fats || bs->bpb.fats > 16) - return EINVAL; + return (EINVAL); if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS) - return EINVAL; + return (EINVAL); } if (!(fs->lsnfat = cv2(bs->bpb.ressec))) - return EINVAL; + return (EINVAL); fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats; fs->lsndta = fs->lsndir + entsec(fs->dirents); if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs))) - return EINVAL; + return (EINVAL); if (fs->lsndta > sc) - return EINVAL; + return (EINVAL); if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS) - return EINVAL; + return (EINVAL); fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32; sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1; if (fs->xclus > sc) fs->xclus = sc; - return 0; + return (0); } /* @@ -575,17 +575,17 @@ namede(DOS_FS *fs, const char *path, DOS if (!(s = strchr(path, '/'))) s = strchr(path, 0); if ((n = s - path) > 255) - return ENAMETOOLONG; + return (ENAMETOOLONG); memcpy(name, path, n); name[n] = 0; path = s; if (!(de->attr & FA_DIR)) - return ENOTDIR; + return (ENOTDIR); if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de))) - return err; + return (err); } *dep = de; - return 0; + return (0); } /* @@ -604,7 +604,7 @@ lookup(DOS_FS *fs, u_int clus, const cha for (ent = 0; ent < 2; ent++) if (!strcasecmp(name, dotstr[ent])) { *dep = dot + ent; - return 0; + return (0); } if (!clus && fs->fatsz == 32) clus = fs->rdcl; @@ -617,13 +617,13 @@ lookup(DOS_FS *fs, u_int clus, const cha else if (okclus(fs, clus)) lsec = blklsn(fs, clus); else - return EINVAL; + return (EINVAL); for (sec = 0; sec < nsec; sec++) { if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1)))) - return err; + return (err); for (ent = 0; ent < DEPSEC; ent++) { if (!*dir[ent].de.name) - return ENOENT; + return (ENOENT); if (*dir[ent].de.name != 0xe5) { if ((dir[ent].de.attr & FA_MASK) == FA_XDE) { x = dir[ent].xde.seq; @@ -651,7 +651,7 @@ lookup(DOS_FS *fs, u_int clus, const cha } if (ok) { *dep = &dir[ent].de; - return 0; + return (0); } } } @@ -661,11 +661,11 @@ lookup(DOS_FS *fs, u_int clus, const cha if (!clus) break; if ((err = fatget(fs, &clus))) - return err; + return (err); if (fatend(fs->fatsz, clus)) break; } - return ENOENT; + return (ENOENT); } /* @@ -739,11 +739,11 @@ fsize(DOS_FS *fs, DOS_DE *de) size = fs->dirents * sizeof(DOS_DE); else { if ((n = fatcnt(fs, c)) == -1) - return n; + return (n); size = blkbyt(fs, n); } } - return size; + return (size); } /* @@ -756,8 +756,8 @@ fatcnt(DOS_FS *fs, u_int c) for (n = 0; okclus(fs, c); n++) if (fatget(fs, &c)) - return -1; - return fatend(fs->fatsz, c) ? n : -1; + return (-1); + return (fatend(fs->fatsz, c) ? n : -1); } /* @@ -815,7 +815,7 @@ fatget(DOS_FS *fs, u_int *c) static int fatend(u_int sz, u_int c) { - return c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7); + return (c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7)); } /* @@ -834,7 +834,7 @@ ioread(DOS_FS *fs, u_int offset, void *b if ((n = SECSIZ - off) > nbyte) n = nbyte; if ((err = ioget(fs->fd, bytsec(offset), off, s, n))) - return err; + return (err); offset += SECSIZ; s += n; nbyte -= n; @@ -842,15 +842,15 @@ ioread(DOS_FS *fs, u_int offset, void *b n = nbyte & (SECSIZ - 1); if (nbyte -= n) { if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte))) - return err; + return (err); offset += nbyte; s += nbyte; } if (n) { if ((err = ioget(fs->fd, bytsec(offset), 0, s, n))) - return err; + return (err); } - return 0; + return (0); } /* From owner-svn-src-head@freebsd.org Thu Dec 1 21:08:43 2016 Return-Path: Delivered-To: svn-src-head@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 6127EC61266; Thu, 1 Dec 2016 21:08:43 +0000 (UTC) (envelope-from rstone@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 309E313D1; Thu, 1 Dec 2016 21:08:43 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1L8gBs026076; Thu, 1 Dec 2016 21:08:42 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1L8g19026075; Thu, 1 Dec 2016 21:08:42 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201612012108.uB1L8g19026075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 1 Dec 2016 21:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309372 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 21:08:43 -0000 Author: rstone Date: Thu Dec 1 21:08:42 2016 New Revision: 309372 URL: https://svnweb.freebsd.org/changeset/base/309372 Log: Fix a false positive in a buf_ring assert buf_ring contains an assert that checks whether an item being enqueued already exists on the ring. There is a subtle bug in this assert. An item can be returned by a peek() function and freed, and then the consumer thread can be preempted before calling advance(). If this happens the item appears to still be on the queue, but another thread may allocate the item from the free pool and wind up trying to enqueue it again, causing the assert to trigger incorrectly. Fix this by skipping the head of the consumer's portion of the ring, as this index is what will be returned by peek(). Sponsored by: Dell EMC Isilon MFC After: 1 week Differential Revision: https://reviews.freebsd.org/D8685 Reviewed by: hselasky Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Thu Dec 1 20:36:48 2016 (r309371) +++ head/sys/sys/buf_ring.h Thu Dec 1 21:08:42 2016 (r309372) @@ -67,11 +67,13 @@ buf_ring_enqueue(struct buf_ring *br, vo uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; - for (i = br->br_cons_head; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if(br->br_ring[i] == buf) - panic("buf=%p already enqueue at %d prod=%d cons=%d", - buf, i, br->br_prod_tail, br->br_cons_tail); + if (br->br_cons_head != br->br_prod_head) { + for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; + i = ((i + 1) & br->br_cons_mask)) + if(br->br_ring[i] == buf) + panic("buf=%p already enqueue at %d prod=%d cons=%d", + buf, i, br->br_prod_tail, br->br_cons_tail); + } #endif critical_enter(); do { From owner-svn-src-head@freebsd.org Thu Dec 1 21:41:42 2016 Return-Path: Delivered-To: svn-src-head@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 D9F58C61FE8 for ; Thu, 1 Dec 2016 21:41:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (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 ABDC0195D for ; Thu, 1 Dec 2016 21:41:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id m5so311070163ioe.3 for ; Thu, 01 Dec 2016 13:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9D9ZSTqAF5Glu9GpOe0YOBuqDAgxeZURoWricEHCePU=; b=U2Av6UqPOuirpjLgqEb6J+naiPJOe/AznbeeTbvWXxEsCmOFSk4j3rHys+mk/i00zo QIKRhE78hvJrxzF+X/0adse0PGh9c27v9zdXODHIFHo32WJMdqQc+cXn1ems2s3t7tTD 4/741OaNkOLXb0yEAdYnCol+dxiTJlWDhM08pgi06YAScfSXAC64JOMi2KvLALktrvvG 7u7S89l+SHgoQXAZuE8LaMM6D/G/Zp1zIHAUZld/UpXT3/NciM9maXo7FJG98LZutQ/m C8sK9JSS+GiD3VjJxz3kt9VJrfeK1gABgX3JHeEGh2bAC6FEPdywz8oqoU8Gk4+kyszo iTJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9D9ZSTqAF5Glu9GpOe0YOBuqDAgxeZURoWricEHCePU=; b=eB2iwpYETPNman50OxY0Vq+3dUjrlckDbExDEBP0EGgdca+llbGlMURzFF81wKm+8a kQvPNI4SwH9Rvp8Q6LVbcKO4aWcYn01D6k2g06iQvnmrbKgpfuBPFYZS2h6TmyRPO6/m lhHmW5uu0iuVRwzG5hlJ+EYX9pXuEgi5XG5OxV+l7vLC1hmkO87Mg8EdnaH+HxI+msXd STL6FkZhZtSfeMIH+6+2VgCVjmLBrPJgsLhhsNCgWHasos/jsCU1mcxKGijGJWKo8Iqd 9oPGHKz/otp1BzYKWy0epBMQQL49RE3nxgqgkvYBRoi2iayaOQhfhGzGE5J8XZil85+N KJPw== X-Gm-Message-State: AKaTC01cCnZ1FCJFIytCSpGktPVNtPfXRkDPTE5IUrV5qalI+9kYxI/2pXzjrM8BF0OEWxOurYY0mhBCNFHuoQ== X-Received: by 10.36.84.138 with SMTP id t132mr35191448ita.103.1480628502004; Thu, 01 Dec 2016 13:41:42 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Thu, 1 Dec 2016 13:41:41 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <20161201164807.GE27291@strugglingcoder.info> References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> From: Warner Losh Date: Thu, 1 Dec 2016 14:41:41 -0700 X-Google-Sender-Auth: ZMWV2R-qg6DwPeAZbuR09usPZOg Message-ID: Subject: Re: svn commit: r309351 - head/etc/defaults To: hiren panchasara Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 21:41:43 -0000 On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara wrote: > On 12/01/16 at 04:35P, Warner Losh wrote: >> Author: imp >> Date: Thu Dec 1 04:35:43 2016 >> New Revision: 309351 >> URL: https://svnweb.freebsd.org/changeset/base/309351 >> >> Log: >> Revert the 'performance' setting to 'NONE' from C2. > > Just a note that this commit reverts r282110. Yea, it's good for laptops, bad for servers. At least there's some Intel CPUs that this causes corruption with USB. That's being sorted out, but until that's done we need to fail more safe for our primary market. Warner From owner-svn-src-head@freebsd.org Thu Dec 1 22:12:59 2016 Return-Path: Delivered-To: svn-src-head@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 EF467C61ABD; Thu, 1 Dec 2016 22:12:59 +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 B00651A4C; Thu, 1 Dec 2016 22:12:59 +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 uB1MCwqb054485; Thu, 1 Dec 2016 22:12:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1MCwcl054481; Thu, 1 Dec 2016 22:12:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612012212.uB1MCwcl054481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Dec 2016 22:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309373 - in head: contrib/netbsd-tests/lib/libc/sys lib/libc/tests/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:13:00 -0000 Author: bdrewery Date: Thu Dec 1 22:12:58 2016 New Revision: 309373 URL: https://svnweb.freebsd.org/changeset/base/309373 Log: Fix setrlimit_test:setrlimit_memlock when the system has exceeded vm.max_wired. This uses the same fix as r294894 did for the mlock test. The code from that commit is moved into a common object file which PROGS supports building first. Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8689 Added: head/lib/libc/tests/sys/mlock_helper.c (contents, props changed) Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c head/lib/libc/tests/sys/Makefile Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Thu Dec 1 21:08:42 2016 (r309372) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Thu Dec 1 22:12:58 2016 (r309373) @@ -50,86 +50,13 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/0 #include #define _KMEMUSER #include + +void set_vm_max_wired(int); +void restore_vm_max_wired(void); #endif static long page = 0; -#ifdef __FreeBSD__ -#define VM_MAX_WIRED "vm.max_wired" - -static void -vm_max_wired_sysctl(int *old_value, int *new_value) -{ - size_t old_len; - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); - - if (old_value == NULL) - printf("Setting the new value to %d\n", *new_value); - else { - ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, - new_value, new_len) == 0, - "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); - } - - ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len, - new_value, new_len) == 0, - "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); - - if (old_value != NULL) - printf("Saved the old value (%d)\n", *old_value); -} - -static void -set_vm_max_wired(int new_value) -{ - FILE *fp; - int old_value; - - fp = fopen(VM_MAX_WIRED, "w"); - if (fp == NULL) { - atf_tc_skip("could not open %s for writing: %s", - VM_MAX_WIRED, strerror(errno)); - return; - } - - vm_max_wired_sysctl(&old_value, NULL); - - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, - "saving %s failed", VM_MAX_WIRED); - - fclose(fp); - - vm_max_wired_sysctl(NULL, &new_value); -} - -static void -restore_vm_max_wired(void) -{ - FILE *fp; - int saved_max_wired; - - fp = fopen(VM_MAX_WIRED, "r"); - if (fp == NULL) { - perror("fopen failed\n"); - return; - } - - if (fscanf(fp, "%d", &saved_max_wired) != 1) { - perror("fscanf failed\n"); - fclose(fp); - return; - } - - fclose(fp); - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); - - if (saved_max_wired == 0) /* This will cripple the test host */ - return; - - vm_max_wired_sysctl(NULL, &saved_max_wired); -} -#endif - ATF_TC(mlock_clip); ATF_TC_HEAD(mlock_clip, tc) { Modified: head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c Thu Dec 1 21:08:42 2016 (r309372) +++ head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c Thu Dec 1 22:12:58 2016 (r309373) @@ -50,6 +50,11 @@ __RCSID("$NetBSD: t_setrlimit.c,v 1.5 20 #include #include +#ifdef __FreeBSD__ +void set_vm_max_wired(int); +void restore_vm_max_wired(void); +#endif + static void sighandler(int); static const char path[] = "setrlimit"; @@ -235,10 +240,18 @@ sighandler(int signo) _exit(EXIT_SUCCESS); } +#ifdef __FreeBSD__ +ATF_TC_WITH_CLEANUP(setrlimit_memlock); +#else ATF_TC(setrlimit_memlock); +#endif ATF_TC_HEAD(setrlimit_memlock, tc) { atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_MEMLOCK"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(setrlimit_memlock, tc) @@ -249,6 +262,11 @@ ATF_TC_BODY(setrlimit_memlock, tc) pid_t pid; int sta; +#ifdef __FreeBSD__ + /* Set max_wired really really high to avoid EAGAIN */ + set_vm_max_wired(INT_MAX); +#endif + page = sysconf(_SC_PAGESIZE); ATF_REQUIRE(page >= 0); @@ -292,6 +310,14 @@ ATF_TC_BODY(setrlimit_memlock, tc) atf_tc_fail("RLIMIT_MEMLOCK not enforced"); } +#ifdef __FreeBSD__ +ATF_TC_CLEANUP(setrlimit_memlock, tc) +{ + + restore_vm_max_wired(); +} +#endif + ATF_TC(setrlimit_nofile_1); ATF_TC_HEAD(setrlimit_nofile_1, tc) { Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Thu Dec 1 21:08:42 2016 (r309372) +++ head/lib/libc/tests/sys/Makefile Thu Dec 1 22:12:58 2016 (r309373) @@ -68,6 +68,9 @@ LIBADD.timer_create_test+= rt .include "../Makefile.netbsd-tests" +SRCS.mlock_test+= mlock_helper.c +SRCS.setrlimit_test+= mlock_helper.c + .if ${COMPILER_TYPE} == "gcc" WARNS?= 3 .else Added: head/lib/libc/tests/sys/mlock_helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/sys/mlock_helper.c Thu Dec 1 22:12:58 2016 (r309373) @@ -0,0 +1,114 @@ +/*- + * Copyright (C) 2016 Bryan Drewery + * 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. + */ + +/* + * Helper for mlock(3) to avoid EAGAIN errors + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#define VM_MAX_WIRED "vm.max_wired" + +static void +vm_max_wired_sysctl(int *old_value, int *new_value) +{ + size_t old_len; + size_t new_len = (new_value == NULL ? 0 : sizeof(int)); + + if (old_value == NULL) + printf("Setting the new value to %d\n", *new_value); + else { + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + } + + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + + if (old_value != NULL) + printf("Saved the old value (%d)\n", *old_value); +} + +void +set_vm_max_wired(int new_value) +{ + FILE *fp; + int old_value; + + fp = fopen(VM_MAX_WIRED, "w"); + if (fp == NULL) { + atf_tc_skip("could not open %s for writing: %s", + VM_MAX_WIRED, strerror(errno)); + return; + } + + vm_max_wired_sysctl(&old_value, NULL); + + ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, + "saving %s failed", VM_MAX_WIRED); + + fclose(fp); + + vm_max_wired_sysctl(NULL, &new_value); +} + +void +restore_vm_max_wired(void) +{ + FILE *fp; + int saved_max_wired; + + fp = fopen(VM_MAX_WIRED, "r"); + if (fp == NULL) { + perror("fopen failed\n"); + return; + } + + if (fscanf(fp, "%d", &saved_max_wired) != 1) { + perror("fscanf failed\n"); + fclose(fp); + return; + } + + fclose(fp); + printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); + + if (saved_max_wired == 0) /* This will cripple the test host */ + return; + + vm_max_wired_sysctl(NULL, &saved_max_wired); +} From owner-svn-src-head@freebsd.org Thu Dec 1 22:20:29 2016 Return-Path: Delivered-To: svn-src-head@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 B4223C61C1D; Thu, 1 Dec 2016 22:20:29 +0000 (UTC) (envelope-from ken@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 830521D44; Thu, 1 Dec 2016 22:20:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1MKSHv054948; Thu, 1 Dec 2016 22:20:28 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1MKSbR054941; Thu, 1 Dec 2016 22:20:28 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201612012220.uB1MKSbR054941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 1 Dec 2016 22:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:20:29 -0000 Author: ken Date: Thu Dec 1 22:20:27 2016 New Revision: 309374 URL: https://svnweb.freebsd.org/changeset/base/309374 Log: Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support. This adds support to camcontrol(8) and libcam(3) for getting and setting the time on SCSI protocol drives. This is more commonly found on tape drives, but is a SPC (SCSI Primary Commands) command, and may be found on any device that speaks SCSI. The new camcontrol timestamp subcommand allows getting the current device time or setting the time to the current system time or any arbitrary time. sbin/camcontrol/Makefile: Add timestamp.c. sbin/camcontrol/camcontrol.8: Document the new timestamp subcommand. sbin/camcontrol/camcontrol.c: Add the timestamp subcommand to camcontrol. sbin/camcontrol/camcontrol.h: Add the timestamp() function prototype. sbin/camcontrol/timestamp.c: Timestamp setting and reporting functionality. sys/cam/scsi/scsi_all.c: Add two new CCB building functions, scsi_set_timestamp() and scsi_report_timestamp(). Also, add a new helper function, scsi_create_timestamp(). sys/cam/scsi/scsi_all.h: Add CDB and parameter data for the the set and report timestamp commands. Add function declarations for the new CCB building and helper functions. Submitted by: Sam Klopsch Sponsored by: Spectra Logic MFC After: 2 weeks Added: head/sbin/camcontrol/timestamp.c (contents, props changed) Modified: head/sbin/camcontrol/Makefile head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/Makefile Thu Dec 1 22:20:27 2016 (r309374) @@ -4,7 +4,7 @@ PACKAGE=runtime PROG= camcontrol SRCS= camcontrol.c util.c .if !defined(RELEASE_CRUNCH) -SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c zone.c +SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c .else CFLAGS+= -DMINIMALISTIC .endif Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/camcontrol.8 Thu Dec 1 22:20:27 2016 (r309374) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2016 +.Dd November 30, 2016 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -343,6 +343,11 @@ .Op Fl S Ar power_src .Op Fl T Ar timer .Nm +.Ic timestamp +.Op device id +.Op generic args +.Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac +.Nm .Ic help .Sh DESCRIPTION The @@ -2417,6 +2422,54 @@ supports, and a number of parameters abo whether it is enabled and what the timer value is. .El .El +.It Ic timestamp +Issue REPORT TIMESTAMP or SET TIMESTAMP +.Tn SCSI +commands. Either the +.Fl r +option or the +.Fl s +option must be specified. +.Bl -tag -width 6n +.It Fl r +Report the device's timestamp. +If no more arguments are specified, the timestamp will be reported using +the national representation of the date and time, followed by the time +zone. +.Bl -tag -width 9n +.It Fl f Ar format +Specify the strftime format string, as documented in strftime(3), to be used +to format the reported timestamp. +.It Fl m +Report the timestamp as milliseconds since the epoch. +.It Fl U +Report the timestamp using the national representation of the date and +time, but override the system time zone and use UTC instead. +.El +.El +.Bl -tag -width 6n +.It Fl s +Set the device's timestamp. Either the +.Fl f +and +.Fl T +options or the +.Fl U +option must be specified. +.Bl -tag -width 9n +.It Fl f Ar format +Specify the strptime format string, as documented in strptime(3). +The time must also be specified with the +.Fl T +option. +.It Fl T +Provide the time in the format specified with the +.Fl f +option. +.It Fl U +Set the timestamp to the host system's time in UTC. +.El +.El .It Ic help Print out verbose usage information. .El @@ -2730,6 +2783,18 @@ camcontrol epc ada0 -c list Display the ATA Power Conditions log (Log Address 0x08) for drive .Pa ada0 . +.Pp +.Bd -literal -offset indent +camcontrol timestamp sa0 -s -f "%A %c" \e + -T "Wednesday Wed Oct 26 21:43:57 2016" +.Ed +.Pp +Set the timestamp of drive +.Pa sa0 +using a +.Xr strptime 3 +format string followed by a time string +that was created using this format string. .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/camcontrol.c Thu Dec 1 22:20:27 2016 (r309374) @@ -103,7 +103,8 @@ typedef enum { CAM_CMD_OPCODES = 0x00000024, CAM_CMD_REPROBE = 0x00000025, CAM_CMD_ZONE = 0x00000026, - CAM_CMD_EPC = 0x00000027 + CAM_CMD_EPC = 0x00000027, + CAM_CMD_TIMESTAMP = 0x00000028 } cam_cmdmask; typedef enum { @@ -234,6 +235,7 @@ static struct camcontrol_opts option_tab {"opcodes", CAM_CMD_OPCODES, CAM_ARG_NONE, "No:s:T"}, {"zone", CAM_CMD_ZONE, CAM_ARG_NONE, "ac:l:No:P:"}, {"epc", CAM_CMD_EPC, CAM_ARG_NONE, "c:dDeHp:Pr:sS:T:"}, + {"timestamp", CAM_CMD_TIMESTAMP, CAM_ARG_NONE, "f:mrsUT:"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -8922,6 +8924,9 @@ usage(int printlong) " camcontrol epc [dev_id][generic_args]<-c cmd> [-d] [-D] [-e]\n" " [-H] [-p power_cond] [-P] [-r rst_src] [-s]\n" " [-S power_src] [-T timer]\n" +" camcontrol timestamp [dev_id][generic_args] <-r [-f format|-m|-U]>|\n" +" <-s <-f format -T time | -U >>\n" +" \n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!printlong) @@ -8966,6 +8971,7 @@ usage(int printlong) "opcodes send the SCSI REPORT SUPPORTED OPCODES command\n" "zone manage Zoned Block (Shingled) devices\n" "epc send ATA Extended Power Conditions commands\n" +"timestamp report or set the device's timestamp\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -9157,6 +9163,17 @@ usage(int printlong) "-s save mode (timer, state, restore)\n" "-S power_src set power source: battery, nonbattery (source)\n" "-T timer set timer, seconds, .1 sec resolution (timer)\n" +"timestamp arguments:\n" +"-r report the timestamp of the device\n" +"-f format report the timestamp of the device with the given\n" +" strftime(3) format string\n" +"-m report the timestamp of the device as milliseconds since\n" +" January 1st, 1970\n" +"-U report the time with UTC instead of the local time zone\n" +"-s set the timestamp of the device\n" +"-f format the format of the time string passed into strptime(3)\n" +"-T time the time value passed into strptime(3)\n" +"-U set the timestamp of the device to UTC time\n" ); #endif /* MINIMALISTIC */ } @@ -9520,6 +9537,10 @@ main(int argc, char **argv) error = epc(cam_dev, argc, argv, combinedopt, retry_count, timeout, arglist & CAM_ARG_VERBOSE); break; + case CAM_CMD_TIMESTAMP: + error = timestamp(cam_dev, argc, argv, combinedopt, + retry_count, timeout, arglist & CAM_ARG_VERBOSE); + break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); Modified: head/sbin/camcontrol/camcontrol.h ============================================================================== --- head/sbin/camcontrol/camcontrol.h Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/camcontrol.h Thu Dec 1 22:20:27 2016 (r309374) @@ -81,6 +81,9 @@ int zone(struct cam_device *device, int int retry_count, int timeout, int verbosemode); int epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout, int verbosemode); +int timestamp(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout, + int verbosemode); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, int datalen); Added: head/sbin/camcontrol/timestamp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/camcontrol/timestamp.c Thu Dec 1 22:20:27 2016 (r309374) @@ -0,0 +1,494 @@ +/*- + * Copyright (c) 2016 Spectra Logic Corporation + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * Authors: Ken Merry (Spectra Logic Corporation) + * Reid Linnemann (Spectra Logic Corporation) + * Samuel Klopsch (Spectra Logic Corporation) + */ +/* + * SCSI tape drive timestamp support + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "camcontrol.h" + +#define TIMESTAMP_REPORT 0 +#define TIMESTAMP_SET 1 +#define MIL "milliseconds" +#define UTC "utc" + +static int set_restore_flags(struct cam_device *device, uint8_t *flags, + int set_flag, int retry_count, int timeout); +static int report_timestamp(struct cam_device *device, uint64_t *ts, + int retry_count, int timeout); +static int set_timestamp(struct cam_device *device, char *format_string, + char *timestamp_string, + int retry_count, int timeout); + +static int +set_restore_flags(struct cam_device *device, uint8_t *flags, int set_flag, + int retry_count, int timeout) +{ + unsigned long blk_desc_length, hdr_and_blk_length; + int error = 0; + struct scsi_control_ext_page *control_page = NULL; + struct scsi_mode_header_10 *mode_hdr = NULL; + struct scsi_mode_sense_10 *cdb = NULL; + union ccb *ccb = NULL; + unsigned long mode_buf_size = sizeof(struct scsi_mode_header_10) + + sizeof(struct scsi_mode_blk_desc) + + sizeof(struct scsi_control_ext_page); + uint8_t mode_buf[mode_buf_size]; + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + error = 1; + goto bailout; + } + /* + * Get the control extension subpage, we'll send it back modified to + * enable SCSI control over the tape drive's timestamp + */ + scsi_mode_sense_len(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*dbd*/ 0, + /*page_control*/ SMS_PAGE_CTRL_CURRENT, + /*page*/ SCEP_PAGE_CODE, + /*param_buf*/ &mode_buf[0], + /*param_len*/ mode_buf_size, + /*minimum_cmd_size*/ 10, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + /* + * scsi_mode_sense_len does not have a subpage argument at the moment, + * so we have to manually set the subpage code before calling + * cam_send_ccb(). + */ + cdb = (struct scsi_mode_sense_10 *)ccb->csio.cdb_io.cdb_bytes; + cdb->subpage = SCEP_SUBPAGE_CODE; + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Mode Sense"); + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + + mode_hdr = (struct scsi_mode_header_10 *)&mode_buf[0]; + blk_desc_length = scsi_2btoul(mode_hdr->blk_desc_len); + hdr_and_blk_length = sizeof(struct scsi_mode_header_10)+blk_desc_length; + /* + * Create the control page at the correct point in the mode_buf, it + * starts after the header and the blk description. + */ + control_page = (struct scsi_control_ext_page *)&mode_buf + [hdr_and_blk_length]; + if (set_flag != 0) { + *flags = control_page->flags; + /* + * Set the SCSIP flag to enable SCSI to change the + * tape drive's timestamp. + */ + control_page->flags |= SCEP_SCSIP; + } else { + control_page->flags = *flags; + } + + scsi_mode_select_len(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*scsi_page_fmt*/ 1, + /*save_pages*/ 0, + /*param_buf*/ &mode_buf[0], + /*param_len*/ mode_buf_size, + /*minimum_cmd_size*/ 10, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Mode Select"); + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + +bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + return error; +} + +static int +report_timestamp(struct cam_device *device, uint64_t *ts, + int retry_count, int timeout) +{ + int error = 0; + struct scsi_report_timestamp_data *report_buf = malloc( + sizeof(struct scsi_report_timestamp_data)); + uint8_t temp_timestamp[8]; + uint32_t report_buf_size = sizeof( + struct scsi_report_timestamp_data); + union ccb *ccb = NULL; + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + error = 1; + goto bailout; + } + + scsi_report_timestamp(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*pdf*/ 0, + /*buf*/ report_buf, + /*buf_len*/ report_buf_size, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Report Timestamp"); + goto bailout; + } + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + + bzero(temp_timestamp, sizeof(temp_timestamp)); + memcpy(&temp_timestamp[2], &report_buf->timestamp, 6); + + *ts = scsi_8btou64(temp_timestamp); + +bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + return error; +} + +static int +set_timestamp(struct cam_device *device, char *format_string, + char *timestamp_string, int retry_count, + int timeout) +{ + struct scsi_set_timestamp_parameters ts_p; + time_t time_value; + struct tm time_struct; + uint8_t flags = 0; + int error = 0; + uint64_t ts = 0; + union ccb *ccb = NULL; + int do_restore_flags = 0; + + error = set_restore_flags(device, &flags, /*set_flag*/ 1, retry_count, + timeout); + if (error != 0) + goto bailout; + + do_restore_flags = 1; + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + error = 1; + goto bailout; + } + + if (strcmp(format_string, UTC) == 0) { + time(&time_value); + ts = (uint64_t) time_value; + } else { + bzero(&time_struct, sizeof(struct tm)); + strptime(timestamp_string, format_string, &time_struct); + time_value = mktime(&time_struct); + ts = (uint64_t) time_value; + } + /* Convert time from seconds to milliseconds */ + ts *= 1000; + scsi_create_timestamp(ts_p.timestamp, ts); + + scsi_set_timestamp(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*buf*/ &ts_p, + /*buf_len*/ sizeof(ts_p), + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Set Timestamp"); + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + + printf("Timestamp set to %ju\n", (uintmax_t)ts); + +bailout: + if (do_restore_flags != 0) + error = set_restore_flags(device, &flags, /*set_flag*/ 0, + retry_count, timeout); + if (ccb != NULL) + cam_freeccb(ccb); + + return error; +} + +int +timestamp(struct cam_device *device, int argc, char **argv, char *combinedopt, + int retry_count, int timeout, int verbosemode __unused) +{ + int c; + uint64_t ts; + char *format_string = NULL; + char *timestamp_string = NULL; + int action = -1; + int error = 0; + int single_arg = 0; + int do_utc = 0; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'r': { + if (action != -1) { + warnx("Use only one -r or only one -s"); + error =1; + goto bailout; + } + action = TIMESTAMP_REPORT; + break; + } + case 's': { + if (action != -1) { + warnx("Use only one -r or only one -s"); + error = 1; + goto bailout; + } + action = TIMESTAMP_SET; + break; + } + case 'f': { + single_arg++; + format_string = strdup(optarg); + if (format_string == NULL) { + warn("Error allocating memory for format " + "argument"); + error = 1; + goto bailout; + } + break; + } + case 'm': { + single_arg++; + format_string = strdup(MIL); + if (format_string == NULL) { + warn("Error allocating memory"); + error = 1; + goto bailout; + } + break; + } + case 'U': { + do_utc = 1; + break; + } + case 'T': + timestamp_string = strdup(optarg); + if (timestamp_string == NULL) { + warn("Error allocating memory for format " + "argument"); + error = 1; + goto bailout; + } + break; + default: + break; + } + } + + if (action == -1) { + warnx("Must specify an action, either -r or -s"); + error = 1; + goto bailout; + } + + if (single_arg > 1) { + warnx("Select only one: %s", + (action == TIMESTAMP_REPORT) ? + "-f format or -m for the -r flag" : + "-f format -T time or -U for the -s flag"); + error = 1; + goto bailout; + } + + if (action == TIMESTAMP_SET) { + if ((format_string == NULL) + && (do_utc == 0)) { + warnx("Must specify either -f format or -U for " + "setting the timestamp"); + error = 1; + } else if ((format_string != NULL) + && (do_utc != 0)) { + warnx("Must specify only one of -f or -U to set " + "the timestamp"); + error = 1; + } else if ((format_string != NULL) + && (strcmp(format_string, MIL) == 0)) { + warnx("-m is not allowed for setting the " + "timestamp"); + error = 1; + } else if ((do_utc == 0) + && (timestamp_string == NULL)) { + warnx("Must specify the time (-T) to set as the " + "timestamp"); + error = 1; + } + if (error != 0) + goto bailout; + } else if (action == TIMESTAMP_REPORT) { + if (format_string == NULL) { + format_string = strdup("%c %Z"); + if (format_string == NULL) { + warn("Error allocating memory for format " + "string"); + error = 1; + goto bailout; + } + } + } + + if (action == TIMESTAMP_REPORT) { + error = report_timestamp(device, &ts, retry_count, + timeout); + if (error != 0) { + goto bailout; + } else if (strcmp(format_string, MIL) == 0) { + printf("Timestamp in milliseconds: %ju\n", + (uintmax_t)ts); + } else { + char temp_timestamp_string[100]; + time_t time_var = ts / 1000; + const struct tm *restrict cur_time; + + setlocale(LC_TIME, ""); + if (do_utc != 0) + cur_time = gmtime(&time_var); + else + cur_time = localtime(&time_var); + + strftime(temp_timestamp_string, + sizeof(temp_timestamp_string), format_string, + cur_time); + printf("Formatted timestamp: %s\n", + temp_timestamp_string); + } + } else if (action == TIMESTAMP_SET) { + if (do_utc != 0) { + format_string = strdup(UTC); + if (format_string == NULL) { + warn("Error allocating memory for format " + "string"); + error = 1; + goto bailout; + } + } + + error = set_timestamp(device, format_string, timestamp_string, + retry_count, timeout); + } + +bailout: + free(format_string); + free(timestamp_string); + + return (error); +} Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Dec 1 22:12:58 2016 (r309373) +++ head/sys/cam/scsi/scsi_all.c Thu Dec 1 22:20:27 2016 (r309374) @@ -7947,6 +7947,32 @@ scsi_report_target_group(struct ccb_scsi } void +scsi_report_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t pdf, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_timestamp *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_timestamp *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_IN; + scsi_cmd->service_action = REPORT_TIMESTAMP | pdf; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + +void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, void *buf, u_int32_t alloc_len, @@ -7971,6 +7997,45 @@ scsi_set_target_group(struct ccb_scsiio scsi_ulto4b(alloc_len, scsi_cmd->length); } +void +scsi_create_timestamp(uint8_t *timestamp_6b_buf, + uint64_t timestamp) +{ + uint8_t buf[8]; + scsi_u64to8b(timestamp, buf); + /* + * Using memcopy starting at buf[2] because the set timestamp parameters + * only has six bytes for the timestamp to fit into, and we don't have a + * scsi_u64to6b function. + */ + memcpy(timestamp_6b_buf, &buf[2], 6); +} + +void +scsi_set_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_timestamp *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*data_ptr*/(u_int8_t *) buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_timestamp *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_OUT; + scsi_cmd->service_action = SET_TIMESTAMP; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + /* * Syncronize the media to the contents of the cache for * the given lba/count pair. Specifying 0/0 means sync Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Dec 1 22:12:58 2016 (r309373) +++ head/sys/cam/scsi/scsi_all.h Thu Dec 1 22:20:27 2016 (r309374) @@ -702,7 +702,9 @@ struct scsi_control_page { struct scsi_control_ext_page { uint8_t page_code; +#define SCEP_PAGE_CODE 0x0a uint8_t subpage_code; +#define SCEP_SUBPAGE_CODE 0x01 uint8_t page_length[2]; uint8_t flags; #define SCEP_TCMOS 0x04 /* Timestamp Changeable by */ @@ -2971,6 +2973,31 @@ struct scsi_target_group uint8_t control; }; +struct scsi_timestamp +{ + uint8_t opcode; + uint8_t service_action; + uint8_t reserved1[4]; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; + +struct scsi_set_timestamp_parameters +{ + uint8_t reserved1[4]; + uint8_t timestamp[6]; + uint8_t reserved2[4]; +}; + +struct scsi_report_timestamp_parameter_data +{ + uint8_t length[2]; + uint8_t reserved1[2]; + uint8_t timestamp[6]; + uint8_t reserved2[2]; +}; + struct scsi_target_port_descriptor { uint8_t reserved[2]; uint8_t relative_target_port_identifier[2]; @@ -3966,12 +3993,29 @@ void scsi_report_target_group(struct cc u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_report_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + u_int8_t pdf, + void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, void *buf, u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_create_timestamp(uint8_t *timestamp_6b_buf, + uint64_t timestamp); + +void scsi_set_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_synchronize_cache(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, From owner-svn-src-head@freebsd.org Thu Dec 1 22:45:24 2016 Return-Path: Delivered-To: svn-src-head@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 7956EC618C5 for ; Thu, 1 Dec 2016 22:45:24 +0000 (UTC) (envelope-from rshen@bjmu.edu.cn) Received: from bjmu.edu.cn (sun440.bjmu.edu.cn [202.112.176.43]) by mx1.freebsd.org (Postfix) with ESMTP id C24B01251 for ; Thu, 1 Dec 2016 22:45:22 +0000 (UTC) (envelope-from rshen@bjmu.edu.cn) Received: from yahoo2.com.cn (unknown [117.92.186.171]) by coremail (Coremail) with SMTP id AQAAfwD3KMBApUBYomYIAA--.8197S2; Fri, 02 Dec 2016 06:33:36 +0800 (CST) Reply-To: <3277904354@qq.com> Date: Fri, 2 Dec 2016 06:44:27 +0800 From: =?utf-8?B?5Zue5aSN?= To: Subject: =?utf-8?B?5Zue5aSN?= Message-ID: <20161202064438847664@bjmu.edu.cn> X-mailer: Foxmail 6, 13, 102, 15 [cn] Mime-Version: 1.0 X-CM-TRANSID: AQAAfwD3KMBApUBYomYIAA--.8197S2 Authentication-Results: coremail; spf=neutral smtp.mail=rshen@bjmu.edu .cn; X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRUUUUUUUUU = X-CM-SenderInfo: qwwrkj46emz3oohg3hdfq/ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:45:24 -0000 5Zue5aSNIA== From owner-svn-src-head@freebsd.org Thu Dec 1 22:50:48 2016 Return-Path: Delivered-To: svn-src-head@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 90336C61B04; Thu, 1 Dec 2016 22:50:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (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 49D531511; Thu, 1 Dec 2016 22:50:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id w33so235637505qtc.3; Thu, 01 Dec 2016 14:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uJs9+Eh4l6p5V3QIoJy8M4hJvlF9LY4hhl5MyKWX7Y8=; b=YmnKguSxuYuYorF3gh+EoWSjd1inD3vCNih7oOLC6M559efLWsPebCyyUFHZdMWaol BL9uLFruVln+BPYGush/3dhwww+SKvhxTSScdzNZaonz3wD6EMCnZKAgYw8TAgGWbUb0 0untLFlSciOdUPIAi56RUscawcl3H7XLjWjhimj6Bh5fAJBY4DIzcqoBalbA7n3xoYHF QgMAMUyS4Z2OwjzVeGjFOiB4cK5IAoWeP/HjIqn3KqbR9VUCc0p30qLehfW/v76ABEok 63Q1n7+7CR+I0S9sHWDr8QW+A3OVWX9hW/aZ2fGBhUzHJrK5/AIV+jXzF802CnP1t4Wn UOCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uJs9+Eh4l6p5V3QIoJy8M4hJvlF9LY4hhl5MyKWX7Y8=; b=WULE+dwL1n2hYzdPC/sTxVinaeHhChs4aZ9D7oczChVnOonl+c2ZqtkSVslzTY8ArW GEcjwAP7DX8EZ6+5qEOz9r2ocqR7ozbRBgm6fYX3rWdrYh3wmCESgT/Bxk9Jrn6fKL6/ Z92Fl0JlG4vULniXWxiD6agz5svyEyXqJM9RBhAlO19RhwSYzoPvbdn82eno2bFoeQre m1WO0fX+AbotO+wbRPLr8J7JpfLivWrPwBzxATkYSA0JNncpRfp3gDz33yR59ppwiO5B kg7f66u7/YrqG90n+CG0QK1Z1+r93dwAjahnYJa9UvYgEGRHHLc6KW/zECoR7k79iFZL vmng== X-Gm-Message-State: AKaTC00pkMvgwRblnAtOHmcT5fnnASl/i1s8wKAJQz01c1Gq3T1Fmpgow3PtYOjcchhuoJbEOVHLC7AvQ4TZVQ== X-Received: by 10.237.38.37 with SMTP id z34mr40530092qtc.73.1480632647160; Thu, 01 Dec 2016 14:50:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.83.133 with HTTP; Thu, 1 Dec 2016 14:50:46 -0800 (PST) In-Reply-To: <1480617132.1889.196.camel@freebsd.org> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> <20161201170116.GA20872@lonesome.com> <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> <1480617132.1889.196.camel@freebsd.org> From: Ngie Cooper Date: Thu, 1 Dec 2016 14:50:46 -0800 Message-ID: Subject: Re: svn commit: r309344 - head/lib/libutil To: Ian Lepore Cc: Mark Linimon , "Conrad E. Meyer" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:50:48 -0000 On Thu, Dec 1, 2016 at 10:32 AM, Ian Lepore wrote: ... > And how is that a bad thing, compared to the prior situation? Insult > has been removed and information has been added. You complain that the > information that was added was incomplete. Well, there is one person > who could fix that, and he has apparently chosen not to. So perhaps > your ongoing complaint should be directed accordingly. Maybe. But this is a useless bikeshed. I've said my piece. -Ngie From owner-svn-src-head@freebsd.org Thu Dec 1 23:30:34 2016 Return-Path: Delivered-To: svn-src-head@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 F1B19C61843; Thu, 1 Dec 2016 23:30:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id BDB171A87; Thu, 1 Dec 2016 23:30:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id DC3E67859BC; Fri, 2 Dec 2016 10:30:31 +1100 (AEDT) Date: Fri, 2 Dec 2016 10:30:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eric van Gyzen cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309364 - head/usr.bin/locale In-Reply-To: <201612011654.uB1Gs2s4023355@repo.freebsd.org> Message-ID: <20161202094516.Q1025@besplex.bde.org> References: <201612011654.uB1Gs2s4023355@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=K7JSJ2eI c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=kj9zAlcOel0A:10 a=Yu1A3NVHZ7LbY86qSIgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 23:30:35 -0000 On Thu, 1 Dec 2016, Eric van Gyzen wrote: > Log: > locale: fix buffer management > > Also, handle signed and unsigned chars, and more gracefully handle > invalid input. > > Submitted by: bde in response to r309331 > MFC after: 1 week > Sponsored by: Dell EMC Thanks. > Modified: head/usr.bin/locale/locale.c > ============================================================================== > --- head/usr.bin/locale/locale.c Thu Dec 1 15:46:26 2016 (r309363) > +++ head/usr.bin/locale/locale.c Thu Dec 1 16:54:02 2016 (r309364) > @@ -495,29 +495,29 @@ format_grouping(const char *binary) > { > static char rval[64]; > const char *cp; > - size_t len; > + size_t roff; > + int len; > ... > + if (*cp < 0) > + break; /* garbage input */ > + len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp); > + if (len < 0 || (unsigned)len >= sizeof(rval) - roff) > + break; /* insufficient space for output */ I don't like casting len to fix compiler warnings, and intentionally left out this cast. len < 0 ensures that there is no sign extension bug or dependency on sign extension bugs. snprintf() returns < 0 if an encoding error occurs, and the check is mainly to detect this unlikely error (the comment is too short to describe this), but the check also allows compilers to easily see that there is no sign extension bug and only low-quality ones warn. I used the bogus type size_t instead of int for roff since I didn't want to fight possible compiler warnings about sign extension in the expression sizeof(rval) - roff. Here it is not so easy to see that roff <= sizeof(rval). You didn't do anything to avoid bad -Wtautological-compare compiler warnings for (*cp < 0). I think such warnings occur at high WARNS on arches with unsigned char. These warnings are bad since the comparison is only tautological on some arches so it is not really tautological. Avoiding it requires code like '#if CHAR_MIN < 0', but that is equally tautological and only escapes the warning because cpp expressions are weaker than C expressions. clang -Wall -Wtautological-compare doesn't actually warn for either (*cp < 0) (where cp is unsigned char *) or (1 < 0). gcc-4.2.1 -Wall warns for the former but not for the latter. This seems sort of backwards, but ISTR discussions in gcc lists ~20 years ago about it being intentional. Warning for (1 < 0) mainly breaks conditional compilation where the condtions are intentially written using C const expressions instead of cpp expressions since cpp is harder to work with. (*cp < 0) is more likely to be a bug. Bruce From owner-svn-src-head@freebsd.org Fri Dec 2 00:00:53 2016 Return-Path: Delivered-To: svn-src-head@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 81A5DC628D2; Fri, 2 Dec 2016 00:00:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 536BC1A50; Fri, 2 Dec 2016 00:00:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id j65so454378431iof.0; Thu, 01 Dec 2016 16:00:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Qo+m2sRUaqxfQq6+L+bDw7EdL5fxy3G+C4tDWquptPM=; b=ytbo5LFzgYql6RlW6VPb7ejEpNVAiIit0W7GdqoOqE3N5I5lCaCWmfN+WPFBRmfGlL a5pSMNxitybO6oHT3cqv+MYWS+5zn6l4PbUS9Uxof91ZoBCe3/QARh0JU5LhvJFKEwT2 fjbEbf6LjzZ0ggwJXWozfBSh0lwqDDXsDHHTJzng7jJcknR4ZJvf7mc+EsEtmzBukTy7 EvyW7TmrMxITxHORWhtB/dDDbwjwxlCSiUfcO88Pz7WcgXQyzD8O5nh2wCUpse5cUvBl pbvKWk+taH4wxJVlzTukvx5VvGNydYXnM8yo1jC861q9xCGZ9NgyxBjfPo3anPxKoofM f0RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Qo+m2sRUaqxfQq6+L+bDw7EdL5fxy3G+C4tDWquptPM=; b=fAaatYBtvZ/pmAHz/b2EH6smUWKo5aJg2Eos4bdYCBZxPPwZUcDQEdy6bHEL0HzlGe qarUngYKGSkSj3fq2g0i0lq+kea3tc6aHAQL+TIRqQRoL6SpT1+s8Z8vWSzXBUSi7r+d 1O8yrR/Mv5Y3pNsjDvbBfV3H9gV+WfeEWK4b1JDMUGSv8xvKXqzYjEmu7A+CuAYiDgpj fHoOjP6Imk6rAHJXjWp4cemT/cN3K78CzAvQJbwRMs0npxTMvMdbTs1t9RrBzIJ3mQmC tmxTGSXFoET83A8l5g4VZRdwiLnt9bHLq6HBYnX1bDleKl/qsJAUAmeSCjerVVrb4RVd aJ+g== X-Gm-Message-State: AKaTC02wPw0C6K32Bb6dggWT5ppKy6pcrcOoWRCMjZV+J1D74ADFFAv1xfSs8GudYyC7N6WRxqnPC7NiUFCNRQ== X-Received: by 10.107.181.77 with SMTP id e74mr2680818iof.99.1480636852685; Thu, 01 Dec 2016 16:00:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.150.129 with HTTP; Thu, 1 Dec 2016 16:00:52 -0800 (PST) In-Reply-To: References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> From: Adrian Chadd Date: Thu, 1 Dec 2016 16:00:52 -0800 Message-ID: Subject: Re: svn commit: r309351 - head/etc/defaults To: Warner Losh Cc: hiren panchasara , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 00:00:53 -0000 +1 for reverting it from now (from the causer of the pain...) -a On 1 December 2016 at 13:41, Warner Losh wrote: > On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara > wrote: >> On 12/01/16 at 04:35P, Warner Losh wrote: >>> Author: imp >>> Date: Thu Dec 1 04:35:43 2016 >>> New Revision: 309351 >>> URL: https://svnweb.freebsd.org/changeset/base/309351 >>> >>> Log: >>> Revert the 'performance' setting to 'NONE' from C2. >> >> Just a note that this commit reverts r282110. > > Yea, it's good for laptops, bad for servers. At least there's some > Intel CPUs that this causes corruption with USB. That's being sorted > out, but until that's done we need to fail more safe for our primary > market. > > Warner > From owner-svn-src-head@freebsd.org Fri Dec 2 01:25:52 2016 Return-Path: Delivered-To: svn-src-head@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 AC928C61610; Fri, 2 Dec 2016 01:25: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 872DA15C2; Fri, 2 Dec 2016 01:25: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 uB21Pp9B032019; Fri, 2 Dec 2016 01:25:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB21PpaF032015; Fri, 2 Dec 2016 01:25:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612020125.uB21PpaF032015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 01:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309380 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 01:25:52 -0000 Author: pfg Date: Fri Dec 2 01:25:51 2016 New Revision: 309380 URL: https://svnweb.freebsd.org/changeset/base/309380 Log: indent(1): Fix indent's confusion about custom FreeBSD macros. Teach indent(1) about storage-class specifiers. Don't assume "in_parameter_declaration" state if "in_decl" hasn't been set. Don't set "in_decl" for storage-class specifiers. That set of changes helps with recognizing the difference between file scope declarations like this: static LIST_HEAD(, alq) ald_active; static int ald_shuttingdown = 0; struct thread *ald_thread; and old style function declarators like this: static int do_execve(td, args, mac_p) struct thread *td; struct image_args *args; struct mac *mac_p; { Unfortunately, at the same time this change makes indent(1) require explicit int in declarations like "static a;", in order to understand that it's part of a declaration. On the other hand, declarations like in the first example are no longer indented as if ald_shuttingdown and ald_thread were parameters of a function named LIST_HEAD. Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_codes.h head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Dec 2 00:23:10 2016 (r309379) +++ head/usr.bin/indent/indent.c Fri Dec 2 01:25:51 2016 (r309380) @@ -920,8 +920,11 @@ check_type: } goto copy_id; /* move the token into line */ - case decl: /* we have a declaration type (int, register, - * etc.) */ + case storage: + prefix_blankline_requested = 0; + goto copy_id; + + case decl: /* we have a declaration type (int, etc.) */ parse(decl); /* let parser worry about indentation */ if (ps.last_token == rparen && ps.tos <= 1) { ps.in_parameter_declaration = 1; Modified: head/usr.bin/indent/indent_codes.h ============================================================================== --- head/usr.bin/indent/indent_codes.h Fri Dec 2 00:23:10 2016 (r309379) +++ head/usr.bin/indent/indent_codes.h Fri Dec 2 01:25:51 2016 (r309380) @@ -69,3 +69,4 @@ #define elsehead 31 #define period 32 #define strpfx 33 +#define storage 34 Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Dec 2 00:23:10 2016 (r309379) +++ head/usr.bin/indent/lexi.c Fri Dec 2 01:25:51 2016 (r309380) @@ -70,6 +70,7 @@ struct templ { */ struct templ specials[] = { + {"auto", 10}, {"break", 9}, {"case", 8}, {"char", 4}, @@ -79,7 +80,7 @@ struct templ specials[] = {"double", 4}, {"else", 6}, {"enum", 3}, - {"extern", 4}, + {"extern", 10}, {"float", 4}, {"for", 5}, {"global", 4}, @@ -88,14 +89,14 @@ struct templ specials[] = {"int", 4}, {"long", 4}, {"offsetof", 1}, - {"register", 4}, + {"register", 10}, {"return", 9}, {"short", 4}, {"sizeof", 2}, - {"static", 4}, + {"static", 10}, {"struct", 3}, {"switch", 7}, - {"typedef", 4}, + {"typedef", 10}, {"union", 3}, {"unsigned", 4}, {"void", 4}, @@ -312,6 +313,9 @@ lexi(void) case 6: /* do, else */ return (sp_nparen); + case 10: /* storage class specifier */ + return (storage); + default: /* all others are treated like any other * identifier */ return (ident); @@ -323,7 +327,8 @@ lexi(void) if (*tp++ == ')' && (*tp == ';' || *tp == ',')) goto not_proc; strncpy(ps.procname, token, sizeof ps.procname - 1); - ps.in_parameter_declaration = 1; + if (ps.in_decl) + ps.in_parameter_declaration = 1; rparen_count = 1; not_proc:; } From owner-svn-src-head@freebsd.org Fri Dec 2 01:52:33 2016 Return-Path: Delivered-To: svn-src-head@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 73E82C61E75; Fri, 2 Dec 2016 01:52:33 +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 362ED1388; Fri, 2 Dec 2016 01:52:33 +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 uB21qWcZ043813; Fri, 2 Dec 2016 01:52:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB21qWkb043812; Fri, 2 Dec 2016 01:52:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612020152.uB21qWkb043812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 01:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309382 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 01:52:33 -0000 Author: pfg Date: Fri Dec 2 01:52:32 2016 New Revision: 309382 URL: https://svnweb.freebsd.org/changeset/base/309382 Log: indent(1): Do not define opchar unless it will be used. "opchar" is only used once depending on "undef" macro being defined. Conditionalize it in the same way. Submitted by: Piotr Sephaniak Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Dec 2 01:38:40 2016 (r309381) +++ head/usr.bin/indent/lexi.c Fri Dec 2 01:52:32 2016 (r309382) @@ -57,7 +57,9 @@ __FBSDID("$FreeBSD$"); #include "indent.h" #define alphanum 1 +#ifdef undef #define opchar 3 +#endif struct templ { const char *rwd; From owner-svn-src-head@freebsd.org Fri Dec 2 02:25:28 2016 Return-Path: Delivered-To: svn-src-head@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 E145AC6274B; Fri, 2 Dec 2016 02:25:28 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 90F1F1142; Fri, 2 Dec 2016 02:25:27 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id CdXLcSRvrKQ1GCdXMcia4w; Thu, 01 Dec 2016 19:25:21 -0700 X-Authority-Analysis: v=2.2 cv=RsK1FGuK c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n5n_aSjo0skA:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=q2U9Gq7pqrimPw9a1TIA:9 a=X8FCfygWxkzDMqUL:21 a=HV8EdFySohd3zm9c:21 a=pynXk66uh0YmACDl:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Bn2pgwyD2vrAyMmN8A2t:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 976C4C64; Thu, 1 Dec 2016 17:11:36 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id uB22PIQl039020; Thu, 1 Dec 2016 18:25:18 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201612020225.uB22PIQl039020@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Martin Matuska cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309300 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar/test lib/libarchive/tests In-Reply-To: Message from Martin Matuska of "Tue, 29 Nov 2016 22:14:42 +0000." <201611292214.uATMEgQH079904@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Dec 2016 18:25:18 -0800 X-CMAE-Envelope: MS4wfBuonkZQIrdWp+8IpGq6JZp5QQ5uyRBzNJR9HmNMMz/4jEensFfk4G1S4tmXNjhK2rShjRO7Rbh8jMYxyLnHWswG4yyIBiEWvQ2vxMVcx6zkmCkU8rmn mFbb4Hd5PR2XnZCZqIkcFEqppyNZJ3oudOqjtDrgeCjq8FG5GzLUgXjeCqtiT/i50ag554b4VveRttCAKG/+CtR1YYA5DVWSFCzSMQOhCi2yXo/KP9PwpBGh 4qCSwsXy96sFR52wBb7r+6t3B5A3tMUBz0Ss3DfZwUzoOuGm5G/Y0BCEgMYoPwdA X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 02:25:29 -0000 In message <201611292214.uATMEgQH079904@repo.freebsd.org>, Martin Matuska write s: > Author: mm > Date: Tue Nov 29 22:14:42 2016 > New Revision: 309300 > URL: https://svnweb.freebsd.org/changeset/base/309300 > > Log: > MFV r309299: > Sync libarchive with vendor. > > Important vendor bugfixes (relevant to FreeBSD): > #821: tar -P cannot extract hardlinks through symlinks > #825: Add sanity check of tar "uid, "gid" and "mtime" fields > > PR: 213255 > Reported by: Tijl Coosemans > MFC after: 1 week > > Added: > head/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_compat_gtar_2.tar.uu > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_compat_star_acl_posix1e.c > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_compat_star_acl_posix1e.tar.uu > head/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_read_format_raw.bufr.uu > Modified: > head/contrib/libarchive/NEWS > head/contrib/libarchive/libarchive/archive_acl.c > head/contrib/libarchive/libarchive/archive_entry.c > head/contrib/libarchive/libarchive/archive_entry.h > head/contrib/libarchive/libarchive/archive_entry_acl.3 > head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c > head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c > head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > head/contrib/libarchive/libarchive/archive_read_support_format_xar.c > head/contrib/libarchive/libarchive/archive_write_disk_posix.c > head/contrib/libarchive/libarchive/test/test_compat_gtar.c > head/contrib/libarchive/libarchive/test/test_read_format_raw.c > head/contrib/libarchive/libarchive/test/test_sparse_basic.c > head/contrib/libarchive/tar/test/test_symlink_dir.c > head/lib/libarchive/tests/Makefile > Directory Properties: > head/contrib/libarchive/ (props changed) > [...] > Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar. > c > ============================================================================= > = > --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > Tue Nov 29 21:53:16 2016 (r309299) > +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > Tue Nov 29 22:14:42 2016 (r309300) > @@ -294,6 +294,46 @@ archive_read_format_tar_cleanup(struct a > return (ARCHIVE_OK); > } > > +static int > +validate_number_field(const char* p_field, size_t i_size) > +{ > + unsigned char marker = (unsigned char)p_field[0]; > + /* octal? */ > + if ((marker >= '0' && marker <= '7') || marker == ' ') { > + size_t i = 0; > + int octal_found = 0; > + for (i = 0; i < i_size; ++i) { > + switch (p_field[i]) > + { > + case ' ': /* skip any leading spaces and trailing space > */ > + if (octal_found == 0 || i == i_size - 1) { > + continue; > + } > + break; > + case '\0': /* null is allowed only at the end */ > + if (i != i_size - 1) { > + return 0; > + } > + break; > + /* rest must be octal digits */ > + case '0': case '1': case '2': case '3': > + case '4': case '5': case '6': case '7': > + ++octal_found; > + break; > + } > + } > + return octal_found > 0; > + } > + /* base 256 (i.e. binary number) */ > + else if (marker == 128 || marker == 255 || marker == 0) { > + /* nothing to check */ > + return 1; > + } > + /* not a number field */ > + else { > + return 0; > + } > +} > > static int > archive_read_format_tar_bid(struct archive_read *a, int best_bid) > @@ -346,23 +386,23 @@ archive_read_format_tar_bid(struct archi > return (0); > bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ > > - /* Sanity check: Look at first byte of mode field. */ > - switch (255 & (unsigned)header->mode[0]) { > - case 0: case 255: > - /* Base-256 value: No further verification possible! */ > - break; > - case ' ': /* Not recommended, but not illegal, either. */ > - break; > - case '0': case '1': case '2': case '3': > - case '4': case '5': case '6': case '7': > - /* Octal Value. */ > - /* TODO: Check format of remainder of this field. */ > - break; > - default: > - /* Not a valid mode; bail out here. */ > - return (0); > + /* > + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. > + * These are usually octal numbers but GNU tar encodes "big" values as > + * base256 and leading zeroes are sometimes replaced by spaces. > + * Even the null terminator is sometimes omitted. Anyway, must be check > ed > + * to avoid false positives. > + */ > + if (bid > 0 && > + (validate_number_field(header->mode, sizeof(header->mode)) == 0 > || > + validate_number_field(header->uid, sizeof(header->uid)) == 0 | > | > + validate_number_field(header->gid, sizeof(header->gid)) == 0 | > | > + validate_number_field(header->mtime, sizeof(header->mtime)) == > 0 || > + validate_number_field(header->size, sizeof(header->size)) == 0 > || > + validate_number_field(header->rdevmajor, sizeof(header->rdevma > jor)) == 0 || > + validate_number_field(header->rdevminor, sizeof(header->rdevmi > nor)) == 0)) { > + bid = 0; > } > - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ > > return (bid); > } > Hi, This broke extract of older tarballs and compatibility with Perl Archive::Tar. You can test this by trying to extract ports/net/tcpview. The following patch fixes it: https://github.com/libarchive/libarchive/commit/2d2b3e928605f795515b03f060fd638c265b0778#diff-845deb76aa98ded5cb2860ded3e19dfb The relevant part of the patch follows: diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c index 0ee511e..b977cb7 100644 --- libarchive/archive_read_support_format_tar.c +++ libarchive/archive_read_support_format_tar.c @@ -294,8 +294,14 @@ archive_read_format_tar_cleanup(struct archive_read *a) return (ARCHIVE_OK); } +/* + * Validate number field + * + * Flags: + * 1 - allow double \0 at field end + */ static int -validate_number_field(const char* p_field, size_t i_size) +validate_number_field(const char* p_field, size_t i_size, int flags) { unsigned char marker = (unsigned char)p_field[0]; /* octal? */ @@ -305,14 +311,24 @@ validate_number_field(const char* p_field, size_t i_size) for (i = 0; i < i_size; ++i) { switch (p_field[i]) { - case ' ': /* skip any leading spaces and trailing space*/ + case ' ': + /* skip any leading spaces and trailing space */ if (octal_found == 0 || i == i_size - 1) { continue; } break; - case '\0': /* null is allowed only at the end */ + case '\0': + /* + * null should be allowed only at the end + * + * Perl Archive::Tar terminates some fields + * with two nulls. We must allow this to stay + * compatible. + */ if (i != i_size - 1) { - return 0; + if (((flags & 1) == 0) + || i != i_size - 2) + return 0; } break; /* rest must be octal digits */ @@ -390,18 +406,25 @@ archive_read_format_tar_bid(struct archive_read *a, int best_bid) * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. * These are usually octal numbers but GNU tar encodes "big" values as * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be checked - * to avoid false positives. + * Even the null terminator is sometimes omitted. Anyway, must be + * checked to avoid false positives. + * + * Perl Archive::Tar does not follow the spec and terminates mode, uid, + * gid, rdevmajor and rdevminor with a double \0. For compatibility + * reasons we allow this deviation. */ - if (bid > 0 && - (validate_number_field(header->mode, sizeof(header->mode)) == 0 || - validate_number_field(header->uid, sizeof(header->uid)) == 0 || - validate_number_field(header->gid, sizeof(header->gid)) == 0 || - validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || - validate_number_field(header->size, sizeof(header->size)) == 0 || - validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || - validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { - bid = 0; + if (bid > 0 && ( + validate_number_field(header->mode, sizeof(header->mode), 1) == 0 + || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 + || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime), + 0) == 0 + || validate_number_field(header->size, sizeof(header->size), 0) == 0 + || validate_number_field(header->rdevmajor, + sizeof(header->rdevmajor), 1) == 0 + || validate_number_field(header->rdevminor, + sizeof(header->rdevminor), 1) == 0)) { + bid = 0; } return (bid); Updating to git 2d2b3e928605f795515b03f060fd638c265b0778 or later probably makes the most sense. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Dec 2 02:46:36 2016 Return-Path: Delivered-To: svn-src-head@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 4DDFDC62C92; Fri, 2 Dec 2016 02:46:36 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EC0431B81; Fri, 2 Dec 2016 02:46:35 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id CdrncbTunIwqSCdrocdIXH; Thu, 01 Dec 2016 19:46:29 -0700 X-Authority-Analysis: v=2.2 cv=cNuQihWN c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n5n_aSjo0skA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=dPdGhu47XFbj6EuJ0X4A:9 a=N4WJNfBsDPN8pCut:21 a=5hvrOP4l-_IyPNkK:21 a=pynXk66uh0YmACDl:21 a=CjuIK1q_8ugA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Bn2pgwyD2vrAyMmN8A2t:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 5F5AFC7B; Thu, 1 Dec 2016 17:32:44 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id uB22kPal051798; Thu, 1 Dec 2016 18:46:25 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201612020246.uB22kPal051798@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Martin Matuska , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309300 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar/test lib/libarchive/tests In-Reply-To: Message from Cy Schubert of "Thu, 01 Dec 2016 18:25:18 -0800." <201612020225.uB22PIQl039020@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Dec 2016 18:46:25 -0800 X-CMAE-Envelope: MS4wfEizk5up1OXAZWECNpCHdLpi/W4xDMK55jro6rSToR8XNzsF41D1WjQai/V9jlQKJdcMwsWH5AOVSLCHQDkBiYWw/xn5bvqwbKO8WyXgJdvrlBykQqf1 x8/U+vCKnZTZ+rcL6AhGmrHk1MWzecSAIbgQ4XOi9z14NwjNgfwKsGLgUpOEY+1YMwYBJNVfBZVtH76ED61uQfIRDHgCjWSWedhuLV0aWt/E3omxYvc0UYfi OUZNF/KWFn+R6A+3ytoJtdV0DZNn28ksF7asDgVWrhN16iQMZNKOPGvqmeble50S X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 02:46:36 -0000 In message <201612020225.uB22PIQl039020@slippy.cwsent.com>, Cy Schubert writes: > In message <201611292214.uATMEgQH079904@repo.freebsd.org>, Martin Matuska > write > s: > > Author: mm > > Date: Tue Nov 29 22:14:42 2016 > > New Revision: 309300 > > URL: https://svnweb.freebsd.org/changeset/base/309300 > > > > Log: > > MFV r309299: > > Sync libarchive with vendor. > > > > Important vendor bugfixes (relevant to FreeBSD): > > #821: tar -P cannot extract hardlinks through symlinks > > #825: Add sanity check of tar "uid, "gid" and "mtime" fields > > > > PR: 213255 > > Reported by: Tijl Coosemans > > MFC after: 1 week > > > > Added: > > head/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_compat_gtar_2.tar.uu > > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_compat_star_acl_posix1e.c > > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar. > uu > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_compat_star_acl_posix1e.tar.uu > > head/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_read_format_raw.bufr.uu > > Modified: > > head/contrib/libarchive/NEWS > > head/contrib/libarchive/libarchive/archive_acl.c > > head/contrib/libarchive/libarchive/archive_entry.c > > head/contrib/libarchive/libarchive/archive_entry.h > > head/contrib/libarchive/libarchive/archive_entry_acl.3 > > head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c > > head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c > > head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > > head/contrib/libarchive/libarchive/archive_read_support_format_xar.c > > head/contrib/libarchive/libarchive/archive_write_disk_posix.c > > head/contrib/libarchive/libarchive/test/test_compat_gtar.c > > head/contrib/libarchive/libarchive/test/test_read_format_raw.c > > head/contrib/libarchive/libarchive/test/test_sparse_basic.c > > head/contrib/libarchive/tar/test/test_symlink_dir.c > > head/lib/libarchive/tests/Makefile > > Directory Properties: > > head/contrib/libarchive/ (props changed) > > > [...] > > Modified: head/contrib/libarchive/libarchive/archive_read_support_format_ta > r. > > c > > =========================================================================== > == > > = > > --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > > Tue Nov 29 21:53:16 2016 (r309299) > > +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > > Tue Nov 29 22:14:42 2016 (r309300) > > @@ -294,6 +294,46 @@ archive_read_format_tar_cleanup(struct a > > return (ARCHIVE_OK); > > } > > > > +static int > > +validate_number_field(const char* p_field, size_t i_size) > > +{ > > + unsigned char marker = (unsigned char)p_field[0]; > > + /* octal? */ > > + if ((marker >= '0' && marker <= '7') || marker == ' ') { > > + size_t i = 0; > > + int octal_found = 0; > > + for (i = 0; i < i_size; ++i) { > > + switch (p_field[i]) > > + { > > + case ' ': /* skip any leading spaces and trailing space > > */ > > + if (octal_found == 0 || i == i_size - 1) { > > + continue; > > + } > > + break; > > + case '\0': /* null is allowed only at the end */ > > + if (i != i_size - 1) { > > + return 0; > > + } > > + break; > > + /* rest must be octal digits */ > > + case '0': case '1': case '2': case '3': > > + case '4': case '5': case '6': case '7': > > + ++octal_found; > > + break; > > + } > > + } > > + return octal_found > 0; > > + } > > + /* base 256 (i.e. binary number) */ > > + else if (marker == 128 || marker == 255 || marker == 0) { > > + /* nothing to check */ > > + return 1; > > + } > > + /* not a number field */ > > + else { > > + return 0; > > + } > > +} > > > > static int > > archive_read_format_tar_bid(struct archive_read *a, int best_bid) > > @@ -346,23 +386,23 @@ archive_read_format_tar_bid(struct archi > > return (0); > > bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ > > > > - /* Sanity check: Look at first byte of mode field. */ > > - switch (255 & (unsigned)header->mode[0]) { > > - case 0: case 255: > > - /* Base-256 value: No further verification possible! */ > > - break; > > - case ' ': /* Not recommended, but not illegal, either. */ > > - break; > > - case '0': case '1': case '2': case '3': > > - case '4': case '5': case '6': case '7': > > - /* Octal Value. */ > > - /* TODO: Check format of remainder of this field. */ > > - break; > > - default: > > - /* Not a valid mode; bail out here. */ > > - return (0); > > + /* > > + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. > > + * These are usually octal numbers but GNU tar encodes "big" values as > > + * base256 and leading zeroes are sometimes replaced by spaces. > > + * Even the null terminator is sometimes omitted. Anyway, must be check > > ed > > + * to avoid false positives. > > + */ > > + if (bid > 0 && > > + (validate_number_field(header->mode, sizeof(header->mode)) == 0 > > || > > + validate_number_field(header->uid, sizeof(header->uid)) == 0 | > > | > > + validate_number_field(header->gid, sizeof(header->gid)) == 0 | > > | > > + validate_number_field(header->mtime, sizeof(header->mtime)) == > > 0 || > > + validate_number_field(header->size, sizeof(header->size)) == 0 > > || > > + validate_number_field(header->rdevmajor, sizeof(header->rdevma > > jor)) == 0 || > > + validate_number_field(header->rdevminor, sizeof(header->rdevmi > > nor)) == 0)) { > > + bid = 0; > > } > > - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ > > > > return (bid); > > } > > > > Hi, > > This broke extract of older tarballs and compatibility with Perl > Archive::Tar. You can test this by trying to extract ports/net/tcpview. > > The following patch fixes it: > > https://github.com/libarchive/libarchive/commit/2d2b3e928605f795515b03f060fd6 > 38c265b0778#diff-845deb76aa98ded5cb2860ded3e19dfb > > The relevant part of the patch follows: > > diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archiv > e_read_support_format_tar.c > index 0ee511e..b977cb7 100644 > --- libarchive/archive_read_support_format_tar.c > +++ libarchive/archive_read_support_format_tar.c > @@ -294,8 +294,14 @@ archive_read_format_tar_cleanup(struct archive_read *a) > return (ARCHIVE_OK); > } > > +/* > + * Validate number field > + * > + * Flags: > + * 1 - allow double \0 at field end > + */ > static int > -validate_number_field(const char* p_field, size_t i_size) > +validate_number_field(const char* p_field, size_t i_size, int flags) > { > unsigned char marker = (unsigned char)p_field[0]; > /* octal? */ > @@ -305,14 +311,24 @@ validate_number_field(const char* p_field, size_t i_siz > e) > for (i = 0; i < i_size; ++i) { > switch (p_field[i]) > { > - case ' ': /* skip any leading spaces and trailing space > */ > + case ' ': > + /* skip any leading spaces and trailing space * > / > if (octal_found == 0 || i == i_size - 1) { > continue; > } > break; > - case '\0': /* null is allowed only at the end */ > + case '\0': > + /* > + * null should be allowed only at the end > + * > + * Perl Archive::Tar terminates some fields > + * with two nulls. We must allow this to stay > + * compatible. > + */ > if (i != i_size - 1) { > - return 0; > + if (((flags & 1) == 0) > + || i != i_size - 2) > + return 0; > } > break; > /* rest must be octal digits */ > @@ -390,18 +406,25 @@ archive_read_format_tar_bid(struct archive_read *a, int > best_bid) > * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. > * These are usually octal numbers but GNU tar encodes "big" values as > * base256 and leading zeroes are sometimes replaced by spaces. > - * Even the null terminator is sometimes omitted. Anyway, must be check > ed > - * to avoid false positives. > + * Even the null terminator is sometimes omitted. Anyway, must be > + * checked to avoid false positives. > + * > + * Perl Archive::Tar does not follow the spec and terminates mode, uid, > + * gid, rdevmajor and rdevminor with a double \0. For compatibility > + * reasons we allow this deviation. > */ > - if (bid > 0 && > - (validate_number_field(header->mode, sizeof(header->mode)) == 0 > || > - validate_number_field(header->uid, sizeof(header->uid)) == 0 | > | > - validate_number_field(header->gid, sizeof(header->gid)) == 0 | > | > - validate_number_field(header->mtime, sizeof(header->mtime)) == > 0 || > - validate_number_field(header->size, sizeof(header->size)) == 0 > || > - validate_number_field(header->rdevmajor, sizeof(header->rdevma > jor)) == 0 || > - validate_number_field(header->rdevminor, sizeof(header->rdevmi > nor)) == 0)) { > - bid = 0; > + if (bid > 0 && ( > + validate_number_field(header->mode, sizeof(header->mode), 1) == 0 > + || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 > + || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 > + || validate_number_field(header->mtime, sizeof(header->mtime), > + 0) == 0 > + || validate_number_field(header->size, sizeof(header->size), 0) == > 0 > + || validate_number_field(header->rdevmajor, > + sizeof(header->rdevmajor), 1) == 0 > + || validate_number_field(header->rdevminor, > + sizeof(header->rdevminor), 1) == 0)) { > + bid = 0; > } > > return (bid); > > Updating to git 2d2b3e928605f795515b03f060fd638c265b0778 or later probably > makes the most sense. Sorry for the spam. I'm a day out of date. :( -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Dec 2 05:49:24 2016 Return-Path: Delivered-To: svn-src-head@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 08E14C5E5FE; Fri, 2 Dec 2016 05:49:24 +0000 (UTC) (envelope-from araujo@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 CC8591887; Fri, 2 Dec 2016 05:49:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25nNUa037702; Fri, 2 Dec 2016 05:49:23 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25nNs4037701; Fri, 2 Dec 2016 05:49:23 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201612020549.uB25nNs4037701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Dec 2016 05:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309392 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:49:24 -0000 Author: araujo Date: Fri Dec 2 05:49:22 2016 New Revision: 309392 URL: https://svnweb.freebsd.org/changeset/base/309392 Log: String terminators are called NUL, not NULL, also the variable mentioned in the comment is p and not u. Obtained from: OpenBSD (r1.34) Modified: head/usr.sbin/ypldap/aldap.c Modified: head/usr.sbin/ypldap/aldap.c ============================================================================== --- head/usr.sbin/ypldap/aldap.c Fri Dec 2 05:47:52 2016 (r309391) +++ head/usr.sbin/ypldap/aldap.c Fri Dec 2 05:49:22 2016 (r309392) @@ -1206,7 +1206,7 @@ isu8cont(unsigned char c) /* * Parse a LDAP value * notes: - * the argument u should be a NULL terminated sequence of ASCII bytes. + * the argument p should be a NUL-terminated sequence of ASCII bytes. */ char * parseval(char *p, size_t len) From owner-svn-src-head@freebsd.org Fri Dec 2 06:07:29 2016 Return-Path: Delivered-To: svn-src-head@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 69A76C5EAF5; Fri, 2 Dec 2016 06:07:29 +0000 (UTC) (envelope-from araujo@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 2A669113D; Fri, 2 Dec 2016 06:07:29 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB267SP8045634; Fri, 2 Dec 2016 06:07:28 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB267SI7045630; Fri, 2 Dec 2016 06:07:28 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201612020607.uB267SI7045630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Dec 2016 06:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309393 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:07:29 -0000 Author: araujo Date: Fri Dec 2 06:07:27 2016 New Revision: 309393 URL: https://svnweb.freebsd.org/changeset/base/309393 Log: Use memset(3) instead of bzero(3). Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37) Modified: head/usr.sbin/ypldap/ldapclient.c head/usr.sbin/ypldap/yp.c head/usr.sbin/ypldap/ypldap.c head/usr.sbin/ypldap/ypldap_dns.c Modified: head/usr.sbin/ypldap/ldapclient.c ============================================================================== --- head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 06:07:27 2016 (r309393) @@ -363,7 +363,7 @@ ldapclient(int pipe_main2client[2]) return (pid); } - bzero(&env, sizeof(env)); + memset(&env, 0, sizeof(env)); TAILQ_INIT(&env.sc_idms); if ((pw = getpwnam(YPLDAP_USER)) == NULL) @@ -437,7 +437,7 @@ client_build_req(struct idm *idm, struct char **ldap_attrs; int i, k; - bzero(ir, sizeof(*ir)); + memset(ir, 0, sizeof(*ir)); for (i = min_attr; i < max_attr; i++) { if (idm->idm_flags & F_FIXED_ATTR(i)) { if (strlcat(ir->ir_line, idm->idm_attrs[i], @@ -594,7 +594,7 @@ client_try_idm(struct env *env, struct i aldap_freemsg(m); } - bzero(attrs, sizeof(attrs)); + memset(attrs, 0, sizeof(attrs)); for (i = 0, j = 0; i < ATTR_MAX; i++) { if (idm->idm_flags & F_FIXED_ATTR(i)) continue; @@ -611,7 +611,7 @@ client_try_idm(struct env *env, struct i idm->idm_filters[FILTER_USER], 0, ATTR_MAX, IMSG_PW_ENTRY) == -1) goto bad; - bzero(attrs, sizeof(attrs)); + memset(attrs, 0, sizeof(attrs)); for (i = ATTR_GR_MIN, j = 0; i < ATTR_GR_MAX; i++) { if (idm->idm_flags & F_FIXED_ATTR(i)) continue; Modified: head/usr.sbin/ypldap/yp.c ============================================================================== --- head/usr.sbin/ypldap/yp.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/yp.c Fri Dec 2 06:07:27 2016 (r309393) @@ -342,7 +342,7 @@ ypproc_match_2_svc(ypreq_key *arg, struc log_debug("argument too long"); return (NULL); } - bzero(key, sizeof(key)); + memset(key, 0, sizeof(key)); (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); if (strcmp(arg->map, "passwd.byname") == 0 || @@ -486,7 +486,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct if (strcmp(arg->map, "passwd.byname") == 0 || strcmp(arg->map, "master.passwd.byname") == 0) { - bzero(key, sizeof(key)); + memset(key, 0, sizeof(key)); (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); ukey.ue_line = key; @@ -517,7 +517,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct } else if (strcmp(arg->map, "group.byname") == 0) { - bzero(key, sizeof(key)); + memset(key, 0, sizeof(key)); (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); @@ -567,7 +567,7 @@ ypproc_master_2_svc(ypreq_nokey *arg, st static struct ypresp_master res; static char master[YPMAXPEER + 1]; - bzero(&res, sizeof(res)); + memset(&res, 0, sizeof(res)); if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1) return (&res); @@ -620,7 +620,7 @@ yp_make_val(struct ypresp_val *res, char { static char buf[LINE_WIDTH]; - bzero(buf, sizeof(buf)); + memset(buf, 0, sizeof(buf)); if (replacecolon) line[strlen(line)] = ':'; @@ -640,8 +640,8 @@ yp_make_keyval(struct ypresp_key_val *re static char keybuf[YPMAXRECORD+1]; static char buf[LINE_WIDTH]; - bzero(keybuf, sizeof(keybuf)); - bzero(buf, sizeof(buf)); + memset(keybuf, 0, sizeof(keybuf)); + memset(buf, 0, sizeof(buf)); (void)strlcpy(keybuf, key, sizeof(keybuf)); res->key.keydat_len = strlen(keybuf); Modified: head/usr.sbin/ypldap/ypldap.c ============================================================================== --- head/usr.sbin/ypldap/ypldap.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/ypldap.c Fri Dec 2 06:07:27 2016 (r309393) @@ -609,7 +609,7 @@ main(int argc, char *argv[]) #warning disabling privilege revocation in debug mode #endif - bzero(&tv, sizeof(tv)); + memset(&tv, 0, sizeof(tv)); evtimer_set(&ev_timer, main_init_timer, &env); evtimer_add(&ev_timer, &tv); Modified: head/usr.sbin/ypldap/ypldap_dns.c ============================================================================== --- head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 06:07:27 2016 (r309393) @@ -212,7 +212,7 @@ host_dns(const char *s, struct ypldap_ad struct sockaddr_in6 *sa_in6; struct ypldap_addr *h; - bzero(&hints, sizeof(hints)); + memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ error = getaddrinfo(s, NULL, &hints, &res0); From owner-svn-src-head@freebsd.org Fri Dec 2 06:08:27 2016 Return-Path: Delivered-To: svn-src-head@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 669F5C5EB9C; Fri, 2 Dec 2016 06:08:27 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (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 245FD12CD; Fri, 2 Dec 2016 06:08:27 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22b.google.com with SMTP id t125so212315312ywc.1; Thu, 01 Dec 2016 22:08:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CHhVi54oOOD0mip0SmfQF1KpVBdHHPseClaZ78YP6Kk=; b=f09ObRzYFX/fq9c9FbINIu4t4zJXq4Su/zgoUO5K638CyIxDPT0KCxoLsbFs3RFDrm ChQwCkuJX/fk9TxImqWoKxyeiONtv1wMCwjjMyB74wXQw3ajPjIJFD8hmkMBK8j+lgkk N5wPvEyZFylCLjwym/J60fbHTnPmMEXZx0f4cTdQPwBPmHogJ3ZKjMcSV2rleUM928Nd xsPniTYgxpyI13Wn4GMYBUxXLVuV8/6Kf+3SG5a8BczVgdBiAsBA53WJZ+t6J/lSJHHG 6UkaCWUGGEhw+wzP9/O/vp9xX+b6xv5+YPmFlmX2gbEfupw03dh8Wy76E4bapOhdUOxg 1khQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=CHhVi54oOOD0mip0SmfQF1KpVBdHHPseClaZ78YP6Kk=; b=dRZbELhwm07Z4otU41IQGwGpUQpcyYL3lT6xZI5q4YFdOAy+nBwFfKwEnjwnZfmb4T I79r43AAlnZzjD9bwMebmSgoSlWz9e78vH5iAZd8rCG7mUA5+8zToTS7HXypdADcRVnk EWlA54AcNuDjpKNN1T2j8/tRI4AkknReS0nRVukpk3a9dBQxg/WzV0r/IZl35hz/EpPy b7TlSo8e2mpioe0q28AELiBeKDWaoZccLdZat7l9D/4YFhYyi5k4EouRm5HUrQwc5LHm 240eAzGalTKCOIRVcVg2OGz5OwcC7kR2jbiGSRh+t0QfZLkbQG9MnFfoJUWJaxaYTnUb t2FQ== X-Gm-Message-State: AKaTC00QeUbfUmJ3pKGwb4Ptq6foykQ4UviUrs5xAuErfwQazbA2QGKdTn+ZW7MioPimik5AzDGQRHjmYCyqCA== X-Received: by 10.13.237.67 with SMTP id w64mr47889444ywe.167.1480658906117; Thu, 01 Dec 2016 22:08:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.13.195.3 with HTTP; Thu, 1 Dec 2016 22:08:25 -0800 (PST) Reply-To: araujo@freebsd.org In-Reply-To: <201612020607.uB267SI7045630@repo.freebsd.org> References: <201612020607.uB267SI7045630@repo.freebsd.org> From: Marcelo Araujo Date: Fri, 2 Dec 2016 14:08:25 +0800 Message-ID: Subject: Re: svn commit: r309393 - head/usr.sbin/ypldap To: Marcelo Araujo Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:08:27 -0000 Forgot MFC after two weeks in my last two commits, so noted in my todo list. Br, 2016-12-02 14:07 GMT+08:00 Marcelo Araujo : > Author: araujo > Date: Fri Dec 2 06:07:27 2016 > New Revision: 309393 > URL: https://svnweb.freebsd.org/changeset/base/309393 > > Log: > Use memset(3) instead of bzero(3). > > Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37) > > Modified: > head/usr.sbin/ypldap/ldapclient.c > head/usr.sbin/ypldap/yp.c > head/usr.sbin/ypldap/ypldap.c > head/usr.sbin/ypldap/ypldap_dns.c > > Modified: head/usr.sbin/ypldap/ldapclient.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 05:49:22 2016 > (r309392) > +++ head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 06:07:27 2016 > (r309393) > @@ -363,7 +363,7 @@ ldapclient(int pipe_main2client[2]) > return (pid); > } > > - bzero(&env, sizeof(env)); > + memset(&env, 0, sizeof(env)); > TAILQ_INIT(&env.sc_idms); > > if ((pw = getpwnam(YPLDAP_USER)) == NULL) > @@ -437,7 +437,7 @@ client_build_req(struct idm *idm, struct > char **ldap_attrs; > int i, k; > > - bzero(ir, sizeof(*ir)); > + memset(ir, 0, sizeof(*ir)); > for (i = min_attr; i < max_attr; i++) { > if (idm->idm_flags & F_FIXED_ATTR(i)) { > if (strlcat(ir->ir_line, idm->idm_attrs[i], > @@ -594,7 +594,7 @@ client_try_idm(struct env *env, struct i > aldap_freemsg(m); > } > > - bzero(attrs, sizeof(attrs)); > + memset(attrs, 0, sizeof(attrs)); > for (i = 0, j = 0; i < ATTR_MAX; i++) { > if (idm->idm_flags & F_FIXED_ATTR(i)) > continue; > @@ -611,7 +611,7 @@ client_try_idm(struct env *env, struct i > idm->idm_filters[FILTER_USER], 0, ATTR_MAX, IMSG_PW_ENTRY) == > -1) > goto bad; > > - bzero(attrs, sizeof(attrs)); > + memset(attrs, 0, sizeof(attrs)); > for (i = ATTR_GR_MIN, j = 0; i < ATTR_GR_MAX; i++) { > if (idm->idm_flags & F_FIXED_ATTR(i)) > continue; > > Modified: head/usr.sbin/ypldap/yp.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/yp.c Fri Dec 2 05:49:22 2016 (r309392) > +++ head/usr.sbin/ypldap/yp.c Fri Dec 2 06:07:27 2016 (r309393) > @@ -342,7 +342,7 @@ ypproc_match_2_svc(ypreq_key *arg, struc > log_debug("argument too long"); > return (NULL); > } > - bzero(key, sizeof(key)); > + memset(key, 0, sizeof(key)); > (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); > > if (strcmp(arg->map, "passwd.byname") == 0 || > @@ -486,7 +486,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct > > if (strcmp(arg->map, "passwd.byname") == 0 || > strcmp(arg->map, "master.passwd.byname") == 0) { > - bzero(key, sizeof(key)); > + memset(key, 0, sizeof(key)); > (void)strncpy(key, arg->key.keydat_val, > arg->key.keydat_len); > ukey.ue_line = key; > @@ -517,7 +517,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct > > > } else if (strcmp(arg->map, "group.byname") == 0) { > - bzero(key, sizeof(key)); > + memset(key, 0, sizeof(key)); > (void)strncpy(key, arg->key.keydat_val, > arg->key.keydat_len); > > @@ -567,7 +567,7 @@ ypproc_master_2_svc(ypreq_nokey *arg, st > static struct ypresp_master res; > static char master[YPMAXPEER + 1]; > > - bzero(&res, sizeof(res)); > + memset(&res, 0, sizeof(res)); > if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1) > return (&res); > > @@ -620,7 +620,7 @@ yp_make_val(struct ypresp_val *res, char > { > static char buf[LINE_WIDTH]; > > - bzero(buf, sizeof(buf)); > + memset(buf, 0, sizeof(buf)); > > if (replacecolon) > line[strlen(line)] = ':'; > @@ -640,8 +640,8 @@ yp_make_keyval(struct ypresp_key_val *re > static char keybuf[YPMAXRECORD+1]; > static char buf[LINE_WIDTH]; > > - bzero(keybuf, sizeof(keybuf)); > - bzero(buf, sizeof(buf)); > + memset(keybuf, 0, sizeof(keybuf)); > + memset(buf, 0, sizeof(buf)); > > (void)strlcpy(keybuf, key, sizeof(keybuf)); > res->key.keydat_len = strlen(keybuf); > > Modified: head/usr.sbin/ypldap/ypldap.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/ypldap.c Fri Dec 2 05:49:22 2016 > (r309392) > +++ head/usr.sbin/ypldap/ypldap.c Fri Dec 2 06:07:27 2016 > (r309393) > @@ -609,7 +609,7 @@ main(int argc, char *argv[]) > #warning disabling privilege revocation in debug mode > #endif > > - bzero(&tv, sizeof(tv)); > + memset(&tv, 0, sizeof(tv)); > evtimer_set(&ev_timer, main_init_timer, &env); > evtimer_add(&ev_timer, &tv); > > > Modified: head/usr.sbin/ypldap/ypldap_dns.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 05:49:22 2016 > (r309392) > +++ head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 06:07:27 2016 > (r309393) > @@ -212,7 +212,7 @@ host_dns(const char *s, struct ypldap_ad > struct sockaddr_in6 *sa_in6; > struct ypldap_addr *h; > > - bzero(&hints, sizeof(hints)); > + memset(&hints, 0, sizeof(hints)); > hints.ai_family = PF_UNSPEC; > hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ > error = getaddrinfo(s, NULL, &hints, &res0); > > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Dec 2 06:16:00 2016 Return-Path: Delivered-To: svn-src-head@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 C7A12C5EF25; Fri, 2 Dec 2016 06:16:00 +0000 (UTC) (envelope-from marcel@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 9736E1873; Fri, 2 Dec 2016 06:16:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB26Fxem049432; Fri, 2 Dec 2016 06:15:59 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB26Fxs1049431; Fri, 2 Dec 2016 06:15:59 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201612020615.uB26Fxs1049431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 2 Dec 2016 06:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309394 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:16:00 -0000 Author: marcel Date: Fri Dec 2 06:15:59 2016 New Revision: 309394 URL: https://svnweb.freebsd.org/changeset/base/309394 Log: Fix use-after-free bugs in pfsync(4) Use after free happens for state that is deleted. The reference count is what prevents the state from being freed. When the state is dequeued, the reference count is dropped and the memory freed. We can't dereference the next pointer or re-queue the state. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8671 Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Dec 2 06:07:27 2016 (r309393) +++ head/sys/netpfil/pf/if_pfsync.c Fri Dec 2 06:15:59 2016 (r309394) @@ -1509,7 +1509,7 @@ pfsync_sendout(int schedswi) struct ip *ip; struct pfsync_header *ph; struct pfsync_subheader *subh; - struct pf_state *st; + struct pf_state *st, *st_next; struct pfsync_upd_req_item *ur; int offset; int q, count = 0; @@ -1559,7 +1559,7 @@ pfsync_sendout(int schedswi) offset += sizeof(*subh); count = 0; - TAILQ_FOREACH(st, &sc->sc_qs[q], sync_list) { + TAILQ_FOREACH_SAFE(st, &sc->sc_qs[q], sync_list, st_next) { KASSERT(st->sync_state == q, ("%s: st->sync_state == q", __func__)); @@ -1931,6 +1931,8 @@ pfsync_delete_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); + pf_ref_state(st); + switch (st->sync_state) { case PFSYNC_S_INS: /* We never got to tell the world so just forget about it. */ @@ -1950,6 +1952,9 @@ pfsync_delete_state(struct pf_state *st) default: panic("%s: unexpected sync state %d", __func__, st->sync_state); } + + pf_release_state(st); + PFSYNC_UNLOCK(sc); } From owner-svn-src-head@freebsd.org Fri Dec 2 08:02:32 2016 Return-Path: Delivered-To: svn-src-head@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 42F0DC61B0A; Fri, 2 Dec 2016 08:02:32 +0000 (UTC) (envelope-from tuexen@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 0BC6C16C4; Fri, 2 Dec 2016 08:02:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB282VMn092935; Fri, 2 Dec 2016 08:02:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB282VAi092934; Fri, 2 Dec 2016 08:02:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612020802.uB282VAi092934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 2 Dec 2016 08:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309397 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:02:32 -0000 Author: tuexen Date: Fri Dec 2 08:02:31 2016 New Revision: 309397 URL: https://svnweb.freebsd.org/changeset/base/309397 Log: Fix the handling of TCP FIN-segments in the CLOSED state When a TCP segment with the FIN bit set was received in the CLOSED state, a TCP RST-ACK-segment is sent. When computing SEG.ACK for this, the FIN counts as one byte. This accounting was missing and is fixed by this patch. Reviewed by: hiren MFC after: 1 month Sponsored by: Netflix, Inc. Differential Revision: https://svn.freebsd.org/base/head Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Dec 2 06:27:54 2016 (r309396) +++ head/sys/netinet/tcp_input.c Fri Dec 2 08:02:31 2016 (r309397) @@ -3357,6 +3357,8 @@ tcp_dropwithreset(struct mbuf *m, struct } else { if (th->th_flags & TH_SYN) tlen++; + if (th->th_flags & TH_FIN) + tlen++; tcp_respond(tp, mtod(m, void *), th, m, th->th_seq+tlen, (tcp_seq)0, TH_RST|TH_ACK); } From owner-svn-src-head@freebsd.org Fri Dec 2 08:11:34 2016 Return-Path: Delivered-To: svn-src-head@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 E3125C61C07; Fri, 2 Dec 2016 08:11:34 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x241.google.com (mail-ua0-x241.google.com [IPv6:2607:f8b0:400c:c08::241]) (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 B47661A59; Fri, 2 Dec 2016 08:11:34 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x241.google.com with SMTP id 20so23916331uak.0; Fri, 02 Dec 2016 00:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fgWf/SQqnxAjOmJ95ecsj5sL7V653hdKW12szq2ax6g=; b=00rG8UgUx4z1nLPQdUbg/MNajpA7k9COe3hEyeVSDaVeLJplrNVcyz2FX0iqeenwpt f8oUaUD4Z40cUu4sMgDqpHiGZVcvzgy2p4aHeMAGnY9iSgwII6y383KBWqjFlG+JxknC 1E6+SXe+HoG3nYYrbHF9AKETj/XZ5Fq4UctnwlQnWkeJHu4NhibvIWP9sEfjb+nktgUM F1wDUcdH9B70qYGWX1E4T65j/fAUJ50O7CeCGfO6Dom3yZ5x1Z2kfsQgBBzfN8O4Odg4 dUz5LeuCdZCYLl6V3c2+mAWS/aDi+9UlrJXUUT4DeSwunz0Y/FhjVOoWz1On0dL7h6RN ZC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fgWf/SQqnxAjOmJ95ecsj5sL7V653hdKW12szq2ax6g=; b=jdYMKMdekdlKCDMK1M9aLYYSTshgakQuz0/7Xn3sFhwzvKUDoke/cnY4en2VgOYcOm XMUHljd1RTME2wwtsOTEi012o1fo5NeQ18iCeoQtjf9N8B2zDbfz+MIojCDbNz5Q0h4F 2y52E/MmD8ZszoZb08SEmNxEVdEKv0+sCtsSzAerBW8OI5UKNx4SLkoeS25ue7UZfgbl +1Kv0+5nCiJ6xoqUJxE1DjeOG1fiZ2PfSuAVwANpCtDYkdBEUwZsocUUJGVF1TiSLGUo SJ2cexWIYf7wmVVs0iZ4DFHv/pBZEcd59APSYBuLxCHbfBCvzlYQ6kuHcbYZhn6KnwYh U/vQ== X-Gm-Message-State: AKaTC0163zXyi30NU0g8N+0Moaq5mKCQKdG3OmuioanSo/qrL64Ii6fH/o+TJjGp7pAoLj0Z3humUWBjCdKQ3w== X-Received: by 10.159.55.168 with SMTP id q37mr32967920uaq.63.1480666293502; Fri, 02 Dec 2016 00:11:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.5.198 with HTTP; Fri, 2 Dec 2016 00:11:32 -0800 (PST) In-Reply-To: <201612012108.uB1L8g19026075@repo.freebsd.org> References: <201612012108.uB1L8g19026075@repo.freebsd.org> From: Sepherosa Ziehau Date: Fri, 2 Dec 2016 16:11:32 +0800 Message-ID: Subject: Re: svn commit: r309372 - head/sys/sys To: Ryan Stone Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:11:35 -0000 peek_clear_sc is added to address the issue you mentioned. IMHO, this commit weakens the proper assertion. On Fri, Dec 2, 2016 at 5:08 AM, Ryan Stone wrote: > Author: rstone > Date: Thu Dec 1 21:08:42 2016 > New Revision: 309372 > URL: https://svnweb.freebsd.org/changeset/base/309372 > > Log: > Fix a false positive in a buf_ring assert > > buf_ring contains an assert that checks whether an item being > enqueued already exists on the ring. There is a subtle bug in > this assert. An item can be returned by a peek() function and > freed, and then the consumer thread can be preempted before > calling advance(). If this happens the item appears to still be > on the queue, but another thread may allocate the item from the > free pool and wind up trying to enqueue it again, causing the > assert to trigger incorrectly. > > Fix this by skipping the head of the consumer's portion of the > ring, as this index is what will be returned by peek(). > > Sponsored by: Dell EMC Isilon > MFC After: 1 week > Differential Revision: https://reviews.freebsd.org/D8685 > Reviewed by: hselasky > > Modified: > head/sys/sys/buf_ring.h > > Modified: head/sys/sys/buf_ring.h > ============================================================================== > --- head/sys/sys/buf_ring.h Thu Dec 1 20:36:48 2016 (r309371) > +++ head/sys/sys/buf_ring.h Thu Dec 1 21:08:42 2016 (r309372) > @@ -67,11 +67,13 @@ buf_ring_enqueue(struct buf_ring *br, vo > uint32_t prod_head, prod_next, cons_tail; > #ifdef DEBUG_BUFRING > int i; > - for (i = br->br_cons_head; i != br->br_prod_head; > - i = ((i + 1) & br->br_cons_mask)) > - if(br->br_ring[i] == buf) > - panic("buf=%p already enqueue at %d prod=%d cons=%d", > - buf, i, br->br_prod_tail, br->br_cons_tail); > + if (br->br_cons_head != br->br_prod_head) { > + for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; > + i = ((i + 1) & br->br_cons_mask)) > + if(br->br_ring[i] == buf) > + panic("buf=%p already enqueue at %d prod=%d cons=%d", > + buf, i, br->br_prod_tail, br->br_cons_tail); > + } > #endif > critical_enter(); > do { > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Fri Dec 2 08:21:09 2016 Return-Path: Delivered-To: svn-src-head@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 68CD9C62018; Fri, 2 Dec 2016 08:21:09 +0000 (UTC) (envelope-from hselasky@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 43907135A; Fri, 2 Dec 2016 08:21:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB28L88f000196; Fri, 2 Dec 2016 08:21:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB28L8s2000195; Fri, 2 Dec 2016 08:21:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612020821.uB28L8s2000195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Dec 2016 08:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309400 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:21:09 -0000 Author: hselasky Date: Fri Dec 2 08:21:08 2016 New Revision: 309400 URL: https://svnweb.freebsd.org/changeset/base/309400 Log: Fix for endless recursion in the ACPI GPE handler during boot. When handling a GPE ACPI interrupt object the EcSpaceHandler() function can be called which checks the EC_EVENT_SCI bit and then recurse on the EcGpeQueryHandler() function. If there are multiple GPE events pending the EC_EVENT_SCI bit will be set at the next call to EcSpaceHandler() causing it to recurse again via the EcGpeQueryHandler() function. This leads to a slow never ending recursion during boot which prevents proper system startup, because the EC_EVENT_SCI bit never gets cleared in this scenario. The behaviour is reproducible with the ALASKA AMI in combination with a newer Skylake based mainboard in the following way: Enter BIOS and adjust the clock one hour forward. Save and exit the BIOS. System fails to boot due to the above mentioned bug in EcGpeQueryHandler() which was observed recursing multiple times. This patch adds a simple recursion guard to the EcGpeQueryHandler() function and also also adds logic to detect if new GPE events occurred during the execution of EcGpeQueryHandler() and then loop on this function instead of recursing. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:15:52 2016 (r309399) +++ head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:21:08 2016 (r309400) @@ -613,16 +613,14 @@ EcCheckStatus(struct acpi_ec_softc *sc, } static void -EcGpeQueryHandler(void *Context) +EcGpeQueryHandlerSub(struct acpi_ec_softc *sc) { - struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; UINT8 Data; ACPI_STATUS Status; int retry; char qxx[5]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); /* Serialize user access with EcSpaceHandler(). */ Status = EcLock(sc); @@ -647,7 +645,6 @@ EcGpeQueryHandler(void *Context) EC_EVENT_INPUT_BUFFER_EMPTY))) break; } - sc->ec_sci_pend = FALSE; if (ACPI_FAILURE(Status)) { EcUnlock(sc); device_printf(sc->ec_dev, "GPE query failed: %s\n", @@ -678,6 +675,29 @@ EcGpeQueryHandler(void *Context) } } +static void +EcGpeQueryHandler(void *Context) +{ + struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; + int pending; + + KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); + + do { + /* Read the current pending count */ + pending = atomic_load_acq_int(&sc->ec_sci_pend); + + /* Call GPE handler function */ + EcGpeQueryHandlerSub(sc); + + /* + * Try to reset the pending count to zero. If this fails we + * know another GPE event has occurred while handling the + * current GPE event and need to loop. + */ + } while (!atomic_cmpset_int(&sc->ec_sci_pend, pending, 0)); +} + /* * The GPE handler is called when IBE/OBF or SCI events occur. We are * called from an unknown lock context. @@ -706,13 +726,14 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT * It will run the query and _Qxx method later, under the lock. */ EcStatus = EC_GET_CSR(sc); - if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { + if ((EcStatus & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec gpe queueing query handler"); Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); - if (ACPI_SUCCESS(Status)) - sc->ec_sci_pend = TRUE; - else + if (ACPI_FAILURE(Status)) { printf("EcGpeHandler: queuing GPE query handler failed\n"); + atomic_store_rel_int(&sc->ec_sci_pend, 0); + } } return (ACPI_REENABLE_GPE); } @@ -759,7 +780,8 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY * we call it directly here since our thread taskq is not active yet. */ if (cold || rebooting || sc->ec_suspending) { - if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { + if ((EC_GET_CSR(sc) & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec running gpe handler directly"); EcGpeQueryHandler(sc); } From owner-svn-src-head@freebsd.org Fri Dec 2 09:29:24 2016 Return-Path: Delivered-To: svn-src-head@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 03E12C5F66C; Fri, 2 Dec 2016 09:29:24 +0000 (UTC) (envelope-from hselasky@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 C76D218EB; Fri, 2 Dec 2016 09:29:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29TM6J030969; Fri, 2 Dec 2016 09:29:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29TM9v030968; Fri, 2 Dec 2016 09:29:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612020929.uB29TM9v030968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Dec 2016 09:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309404 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:29:24 -0000 Author: hselasky Date: Fri Dec 2 09:29:22 2016 New Revision: 309404 URL: https://svnweb.freebsd.org/changeset/base/309404 Log: Fix return value from ng_uncallout(). callout_stop() recently started returning -1 when the callout is already stopped, which is not handled by the netgraph code. Properly filter the return value. Netgraph callers only want to know if the callout was cancelled and not draining or already stopped. Discussed with: julian, glebius MFC after: 2 weeks Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Fri Dec 2 09:26:51 2016 (r309403) +++ head/sys/netgraph/ng_base.c Fri Dec 2 09:29:22 2016 (r309404) @@ -3825,7 +3825,11 @@ ng_uncallout(struct callout *c, node_p n } c->c_arg = NULL; - return (rval); + /* + * Callers only want to know if the callout was cancelled and + * not draining or stopped. + */ + return (rval > 0); } /* From owner-svn-src-head@freebsd.org Fri Dec 2 09:30:14 2016 Return-Path: Delivered-To: svn-src-head@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 ECCECC5F70A; Fri, 2 Dec 2016 09:30:14 +0000 (UTC) (envelope-from mm@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 C79971A7C; Fri, 2 Dec 2016 09:30:14 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29UD7H031067; Fri, 2 Dec 2016 09:30:13 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29UDQR031063; Fri, 2 Dec 2016 09:30:13 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612020930.uB29UDQR031063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 2 Dec 2016 09:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309405 - head/contrib/libarchive/libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:30:15 -0000 Author: mm Date: Fri Dec 2 09:30:13 2016 New Revision: 309405 URL: https://svnweb.freebsd.org/changeset/base/309405 Log: MFV r309403: Sync libarchive with vendor. Vendor bugfixes: Fix for heap-buffer-overflow in archive_le16dec() Fix for heap-buffer-overflow in uudecode_bidder_bid() Reworked fix for compatibility with archives created by Perl Archive::Tar MFC after: 1 week Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Fri Dec 2 09:29:22 2016 (r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Fri Dec 2 09:30:13 2016 (r309405) @@ -312,6 +312,7 @@ uudecode_bidder_bid(struct archive_read_ avail -= len; if (l == 6) { + /* "begin " */ if (!uuchar[*b]) return (0); /* Get a length of decoded bytes. */ @@ -352,8 +353,8 @@ uudecode_bidder_bid(struct archive_read_ b += nl; if (avail && uuchar[*b]) return (firstline+30); - } - if (l == 13) { + } else if (l == 13) { + /* "begin-base64 " */ while (len-nl > 0) { if (!base64[*b++]) return (0); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Fri Dec 2 09:29:22 2016 (r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Fri Dec 2 09:30:13 2016 (r309405) @@ -645,12 +645,13 @@ cab_read_header(struct archive_read *a) cab = (struct cab *)(a->format->data); if (cab->found_header == 0 && p[0] == 'M' && p[1] == 'Z') { - /* This is an executable? Must be self-extracting... */ + /* This is an executable? Must be self-extracting... */ err = cab_skip_sfx(a); if (err < ARCHIVE_WARN) return (err); - if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL) + /* Re-read header after processing the SFX. */ + if ((p = __archive_read_ahead(a, 42, NULL)) == NULL) return (truncated_error(a)); } Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Fri Dec 2 09:29:22 2016 (r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Fri Dec 2 09:30:13 2016 (r309405) @@ -297,58 +297,50 @@ archive_read_format_tar_cleanup(struct a /* * Validate number field * - * Flags: - * 1 - allow double \0 at field end + * This has to be pretty lenient in order to accomodate the enormous + * variety of tar writers in the world: + * = POSIX ustar requires octal values with leading zeros and + * specific termination on fields + * = Many writers use different termination (in particular, libarchive + * omits terminator bytes to squeeze one or two more digits) + * = Many writers pad with space and omit leading zeros + * = GNU tar and star write base-256 values if numbers are too + * big to be represented in octal + * + * This should tolerate all variants in use. It will reject a field + * where the writer just left garbage after a trailing NUL. */ static int -validate_number_field(const char* p_field, size_t i_size, int flags) +validate_number_field(const char* p_field, size_t i_size) { unsigned char marker = (unsigned char)p_field[0]; - /* octal? */ - if ((marker >= '0' && marker <= '7') || marker == ' ') { + if (marker == 128 || marker == 255 || marker == 0) { + /* Base-256 marker, there's nothing we can check. */ + return 1; + } else { + /* Must be octal */ size_t i = 0; - int octal_found = 0; - for (i = 0; i < i_size; ++i) { - switch (p_field[i]) - { - case ' ': - /* skip any leading spaces and trailing space */ - if (octal_found == 0 || i == i_size - 1) { - continue; - } - break; - case '\0': - /* - * null should be allowed only at the end - * - * Perl Archive::Tar terminates some fields - * with two nulls. We must allow this to stay - * compatible. - */ - if (i != i_size - 1) { - if (((flags & 1) == 0) - || i != i_size - 2) - return 0; - } - break; - /* rest must be octal digits */ - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - ++octal_found; - break; + /* Skip any leading spaces */ + while (i < i_size && p_field[i] == ' ') { + ++i; + } + /* Must be at least one octal digit. */ + if (i >= i_size || p_field[i] < '0' || p_field[i] > '7') { + return 0; + } + /* Skip remaining octal digits. */ + while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') { + ++i; + } + /* Any remaining characters must be space or NUL padding. */ + while (i < i_size) { + if (p_field[i] != ' ' && p_field[i] != 0) { + return 0; } + ++i; } - return octal_found > 0; - } - /* base 256 (i.e. binary number) */ - else if (marker == 128 || marker == 255 || marker == 0) { - /* nothing to check */ return 1; } - /* not a number field */ - else { - return 0; - } } static int @@ -404,26 +396,15 @@ archive_read_format_tar_bid(struct archi /* * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. - * These are usually octal numbers but GNU tar encodes "big" values as - * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be - * checked to avoid false positives. - * - * Perl Archive::Tar does not follow the spec and terminates mode, uid, - * gid, rdevmajor and rdevminor with a double \0. For compatibility - * reasons we allow this deviation. */ if (bid > 0 && ( - validate_number_field(header->mode, sizeof(header->mode), 1) == 0 - || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 - || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 - || validate_number_field(header->mtime, sizeof(header->mtime), - 0) == 0 - || validate_number_field(header->size, sizeof(header->size), 0) == 0 - || validate_number_field(header->rdevmajor, - sizeof(header->rdevmajor), 1) == 0 - || validate_number_field(header->rdevminor, - sizeof(header->rdevminor), 1) == 0)) { + validate_number_field(header->mode, sizeof(header->mode)) == 0 + || validate_number_field(header->uid, sizeof(header->uid)) == 0 + || validate_number_field(header->gid, sizeof(header->gid)) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime)) == 0 + || validate_number_field(header->size, sizeof(header->size)) == 0 + || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 + || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { bid = 0; } From owner-svn-src-head@freebsd.org Fri Dec 2 09:41:56 2016 Return-Path: Delivered-To: svn-src-head@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 43481C5FCAD; Fri, 2 Dec 2016 09:41:56 +0000 (UTC) (envelope-from hselasky@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 1E10D12A6; Fri, 2 Dec 2016 09:41:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29ftLA037891; Fri, 2 Dec 2016 09:41:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29ftOi037889; Fri, 2 Dec 2016 09:41:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612020941.uB29ftOi037889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Dec 2016 09:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309406 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:41:56 -0000 Author: hselasky Date: Fri Dec 2 09:41:54 2016 New Revision: 309406 URL: https://svnweb.freebsd.org/changeset/base/309406 Log: Remove useless NULL checks. NULL is not returned when allocating memory passing the M_WAITOK flag. Submitted by: trasz @ Differential Revision: https://reviews.freebsd.org/D5772 Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri Dec 2 09:30:13 2016 (r309405) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri Dec 2 09:41:54 2016 (r309406) @@ -854,8 +854,6 @@ mlx5e_create_main_flow_table(struct mlx5 u8 *dmac; g = malloc(9 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 2; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; @@ -939,8 +937,6 @@ mlx5e_create_vlan_flow_table(struct mlx5 struct mlx5_flow_table_group *g; g = malloc(2 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 12; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Dec 2 09:30:13 2016 (r309405) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Dec 2 09:41:54 2016 (r309406) @@ -656,10 +656,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, goto err_rq_wq_destroy; rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (rq->mbuf == NULL) { - err = -ENOMEM; - goto err_lro_init; - } for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i); uint32_t byte_count = rq->wqe_sz - MLX5E_NET_IP_ALIGN; @@ -686,7 +682,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, err_rq_mbuf_free: free(rq->mbuf, M_MLX5EN); -err_lro_init: tcp_lro_free(&rq->lro); err_rq_wq_destroy: mlx5_wq_destroy(&rq->wq_ctrl); @@ -897,8 +892,6 @@ mlx5e_alloc_sq_db(struct mlx5e_sq *sq) int x; sq->mbuf = malloc(wq_sz * sizeof(sq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (sq->mbuf == NULL) - return (-ENOMEM); /* Create DMA descriptor MAPs */ for (x = 0; x != wq_sz; x++) { @@ -1486,9 +1479,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr int err; c = malloc(sizeof(*c), M_MLX5EN, M_WAITOK | M_ZERO); - if (c == NULL) - return (-ENOMEM); - c->priv = priv; c->ix = ix; c->cpu = 0; @@ -1699,8 +1689,6 @@ mlx5e_open_channels(struct mlx5e_priv *p priv->channel = malloc(priv->params.num_channels * sizeof(struct mlx5e_channel *), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv->channel == NULL) - return (-ENOMEM); mlx5e_build_channel_param(priv, &cparam); for (i = 0; i < priv->params.num_channels; i++) { @@ -2879,10 +2867,6 @@ mlx5e_create_ifp(struct mlx5_core_dev *m return (NULL); } priv = malloc(sizeof(*priv), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv == NULL) { - mlx5_core_err(mdev, "malloc() failed\n"); - return (NULL); - } mlx5e_priv_mtx_init(priv); ifp = priv->ifp = if_alloc(IFT_ETHER); From owner-svn-src-head@freebsd.org Fri Dec 2 09:51:13 2016 Return-Path: Delivered-To: svn-src-head@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 A4045C5FE6D; Fri, 2 Dec 2016 09:51:13 +0000 (UTC) (envelope-from julian@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 7E9E316BA; Fri, 2 Dec 2016 09:51:13 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29pCRw042578; Fri, 2 Dec 2016 09:51:12 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29pCMc042577; Fri, 2 Dec 2016 09:51:12 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020951.uB29pCMc042577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 09:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309407 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:51:13 -0000 Author: julian Date: Fri Dec 2 09:51:12 2016 New Revision: 309407 URL: https://svnweb.freebsd.org/changeset/base/309407 Log: A little light wordsmithing only. Sponsored by: FreeBSD Modified: head/share/man/man4/ng_checksum.4 Modified: head/share/man/man4/ng_checksum.4 ============================================================================== --- head/share/man/man4/ng_checksum.4 Fri Dec 2 09:41:54 2016 (r309406) +++ head/share/man/man4/ng_checksum.4 Fri Dec 2 09:51:12 2016 (r309407) @@ -29,26 +29,26 @@ .Os .Sh NAME .Nm ng_checksum -.Nd IP checksum node type +.Nd reconstructing IP checksums node type .Sh SYNOPSIS .In netgraph/ng_checksum.h .Sh DESCRIPTION The .Nm checksum -node can calculate and prepare for calculation in hardware -IPv4 header, TCP, UDP checksum. +node can calculate, or prepare for calculation in hardware, +IPv4 header, TCP and UDP checksums. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are processed according to settings specified -in config and then forwarded to +in config and then forwarded to the .Ar out -hook, if it exists and connected. Otherwise they are reflected back to the +hook, if it exists and is connected. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El @@ -56,13 +56,13 @@ hook without any changes. This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_CHECKSUM_SETDLT Pq Ic setdlt -Sets data link type on the +Sets the data link type on the .Va in hook. Currently, supported types are .Cm DLT_RAW (raw IP datagrams) and .Cm DLT_EN10MB -(Ethernet). DLT_ definitions can be found in +(Ethernet). DLT_ definitions can be found in the .In net/bpf.h header. Currently used values are .Cm DLT_EN10MB @@ -70,11 +70,11 @@ header. Currently used values are .Cm DLT_RAW = 12. .It Dv NGM_CHECKSUM_GETDLT Pq Ic getdlt -This control message obtains data link type on the +This control message obtains the data link type on the .Va in hook. .It Dv NGM_CHECKSUM_SETCONFIG Pq Ic setconfig -Sets node configuration. The following +Sets the node configuration. The following .Vt "struct ng_checksum_config" must be supplied as an argument: .Bd -literal -offset 4n @@ -87,23 +87,24 @@ struct ng_checksum_config { The .Va csum_flags can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node need calculate the corresponding checksum. +(other values are ignored) for instructing the node to calculate the corresponding checksum. .Pp The .Va csum_offload -can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node what checksum can calculate in hardware. +value can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing the node what checksums should be requested from the hardware. .Pp -Also processed any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 sets before on mbuf. +The node also takes into account any combination of +CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 already +flagged on the mbuf. .It Dv NGM_CHECKSUM_GETCONFIG Pq Ic getconfig -This control message obtains current node configuration, -returned as +This control message obtains the current node configuration returned as a .Vt "struct ng_checksum_config" . .It Dv NGM_CHECKSUM_GET_STATS Pq Ic getstats Returns node statistics as a .Vt "struct ng_checksum_stats" . .It Dv NGM_CHECKSUM_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clear the node statistics. .It Dv NGM_CHECKSUM_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_CHECKSUM_GET_STATS , @@ -118,14 +119,15 @@ control message, or when all hooks have script: .Bd -literal -offset 4n /usr/sbin/ngctl -f- <<-SEQ - msg checksum-1: "setdlt 1" - ngctl msg checksum-1: "setconfig { csum_flags=0 csum_offload=6 }" + msg checksum-1: setdlt 1 + msg checksum-1: setconfig { csum_flags=0 csum_offload=6 } +SEQ .Ed .Pp -Set data link type to +Set the data link type to .Cm DLT_EN10MB -(Ethernet), not set additional checksum flags, set hardware -can calculate CSUM_IP_UDP|CSUM_IP_TCP. +(Ethernet), do not set additional checksum flags +and request that the hardware calculate CSUM_IP_UDP|CSUM_IP_TCP. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_patch 4 , From owner-svn-src-head@freebsd.org Fri Dec 2 10:47:11 2016 Return-Path: Delivered-To: svn-src-head@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 72946C610CD; Fri, 2 Dec 2016 10:47:11 +0000 (UTC) (envelope-from julian@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 414AE1543; Fri, 2 Dec 2016 10:47:11 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2AlAT5063532; Fri, 2 Dec 2016 10:47:10 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2AlAIV063529; Fri, 2 Dec 2016 10:47:10 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612021047.uB2AlAIV063529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 10:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309408 - in head: share/man/man4 sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 10:47:11 -0000 Author: julian Date: Fri Dec 2 10:47:10 2016 New Revision: 309408 URL: https://svnweb.freebsd.org/changeset/base/309408 Log: Changes to allow the patching of packets with an offset (and other changes.. see man page) PR: 206185 Submitted by: Dmitry Vagin MFC after: 1 week Relnotes: yes (also ng_checksum node) Modified: head/share/man/man4/ng_patch.4 head/sys/netgraph/ng_patch.c head/sys/netgraph/ng_patch.h Modified: head/share/man/man4/ng_patch.4 ============================================================================== --- head/share/man/man4/ng_patch.4 Fri Dec 2 09:51:12 2016 (r309407) +++ head/share/man/man4/ng_patch.4 Fri Dec 2 10:47:10 2016 (r309408) @@ -1,5 +1,6 @@ .\" Copyright (c) 2010 Maxim Ignatenko .\" Copyright (c) 2010 Vadim Goncharov +.\" Copyright (c) 2015 Dmitry Vagin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 17, 2015 .Dt NG_PATCH 4 .Os .Sh NAME @@ -47,33 +48,52 @@ A negation operation is the one exceptio and second operand (the .Va value ) is not used. -There may be several modification operations, they are all applied -to a packet sequentially in order they were specified by user. -Data payload of packet is viewed as array of bytes, with zero offset -corresponding to the very first byte of packet headers, and +If there is more than one modification operation, they are applied +to packets sequentially in the order they were specified by the user. +The data payload of a packet is viewed as an array of bytes, with a zero offset +corresponding to the very first byte of packet headers, and the .Va length bytes beginning from .Va offset -are taken as a single integer in network byte order. +as a single integer in network byte order. An additional offset can be optionally +requested at configuration time to account for packet type. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are modified according to rules specified -in config and then forwarded to +in the configuration and then forwarded to the .Ar out -hook, if it exists and connected. +hook, if it exists. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo +.It Dv NGM_PATCH_SETDLT Pq Ic setdlt +Sets the data link type on the +.Va in +hook (to help calculate relative offset). Currently, supported types are +.Cm DLT_RAW +(raw IP datagrams , no offset applied, the default) and +.Cm DLT_EN10MB +(Ethernet). DLT_ definitions can be found in +.In net/bpf.h . +If you want to work on the link layer header you must use no additional offset by specifying +.Cm DLT_RAW . +If +.Cm EN10MB +is specified, then the optional additional offset will take into account the Ethernet header and a QinQ header if present. +.It Dv NGM_PATCH_GETDLT Pq Ic getdlt +This control message returns the data link type of the +.Va in +hook. .It Dv NGM_PATCH_SETCONFIG Pq Ic setconfig This command sets the sequence of modify operations that will be applied to incoming data on a hook. @@ -82,10 +102,10 @@ The following must be supplied as an argument: .Bd -literal -offset 4n struct ng_patch_op { - uint64_t value; uint32_t offset; uint16_t length; /* 1,2,4 or 8 bytes */ uint16_t mode; + uint64_t value; }; /* Patching modes */ #define NG_PATCH_MODE_SET 1 @@ -103,6 +123,7 @@ struct ng_patch_op { struct ng_patch_config { uint32_t count; uint32_t csum_flags; + uint32_t relative_offset; struct ng_patch_op ops[]; }; .Ed @@ -116,14 +137,14 @@ The .Nm node does not do any checksum correction by itself. .It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig -This control message obtains current set of modify operations, -returned as +This control message returns the current set of modify operations, +in the form of a .Vt "struct ng_patch_config" . .It Dv NGM_PATCH_GET_STATS Pq Ic getstats -Returns node statistics as a +Returns the node's statistics as a .Vt "struct ng_patch_stats" . .It Dv NGM_PATCH_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clears the node's statistics. .It Dv NGM_PATCH_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_PATCH_GET_STATS , @@ -134,19 +155,20 @@ This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when all hooks have been disconnected. .Sh EXAMPLES -The +This .Nm -node allows to modify TTL and TOS/DSCP fields in IP packets. -Suppose you have two adjacent simplex links to remote network +node was designed to modify TTL and TOS/DSCP fields in IP packets. +As an example, +suppose you have two adjacent simplex links to a remote network (e.g.\& satellite), so that the packets expiring in between will generate unwanted ICMP-replies which have to go forth, not back. Thus you need to raise TTL of every packet entering link by 2 to ensure the TTL will not reach zero there. -So you setup +To achieve this you can set an .Xr ipfw 8 -rule with +rule to use the .Cm netgraph -action to inject packets going to other end of simplex link by the +action to inject packets which are going to the simplex link into the patch node, by using the following .Xr ngctl 8 script: @@ -160,11 +182,11 @@ SEQ /sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net .Ed .Pp -Here +Here the .Dq Li ttl_add node of type .Nm -configured to add (mode +is configured to add (mode .Dv NG_PATCH_MODE_ADD ) a .Va value @@ -218,13 +240,15 @@ The node type was implemented in .Fx 8.1 . .Sh AUTHORS -.An Maxim Ignatenko Aq Mt gelraen.ua@gmail.com +.An "Maxim Ignatenko" Aq gelraen.ua@gmail.com . +.Pp +Relative offset code by +.An "DMitry Vagin" .Pp -.An -nosplit This manual page was written by -.An Vadim Goncharov Aq Mt vadimnuclight@tpu.ru . +.An "Vadim Goncharov" Aq vadimnuclight@tpu.ru . .Sh BUGS -Node blindly tries to apply every patching operation to each packet +The node blindly tries to apply every patching operation to each packet (except those which offset if greater than length of the packet), so be sure that you supply only the right packets to it (e.g. changing bytes in the ARP packets meant to be in IP header could corrupt @@ -232,6 +256,6 @@ them and make your machine unreachable f .Pp .Em !!! WARNING !!! .Pp -Output path of the IP stack assumes correct fields and lengths in the -packets - changing them by mistake to incorrect values can cause +The output path of the IP stack assumes correct fields and lengths in the +packets - changing them by to incorrect values can cause unpredictable results including kernel panics. Modified: head/sys/netgraph/ng_patch.c ============================================================================== --- head/sys/netgraph/ng_patch.c Fri Dec 2 09:51:12 2016 (r309407) +++ head/sys/netgraph/ng_patch.c Fri Dec 2 10:47:10 2016 (r309408) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2010 Maxim Ignatenko + * Copyright (c) 2010 Maxim Ignatenko + * Copyright (c) 2015 Dmitry Vagin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,11 +35,28 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include + #include #include -#include #include +#include + +/* private data */ +struct ng_patch_priv { + hook_p in; + hook_p out; + uint8_t dlt; /* DLT_XXX from bpf.h */ + struct ng_patch_stats stats; + struct ng_patch_config *conf; +}; + +typedef struct ng_patch_priv *priv_p; + +/* Netgraph methods */ static ng_constructor_t ng_patch_constructor; static ng_rcvmsg_t ng_patch_rcvmsg; static ng_shutdown_t ng_patch_shutdown; @@ -46,6 +64,8 @@ static ng_newhook_t ng_patch_newhook; static ng_rcvdata_t ng_patch_rcvdata; static ng_disconnect_t ng_patch_disconnect; +#define ERROUT(x) { error = (x); goto done; } + static int ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, const u_char *buf) @@ -59,7 +79,7 @@ ng_patch_config_getlen(const struct ng_p } static const struct ng_parse_struct_field ng_patch_op_type_fields[] - = NG_PATCH_OP_TYPE_INFO; + = NG_PATCH_OP_TYPE; static const struct ng_parse_type ng_patch_op_type = { &ng_parse_struct_type, &ng_patch_op_type_fields @@ -75,14 +95,14 @@ static const struct ng_parse_type ng_pat }; static const struct ng_parse_struct_field ng_patch_config_type_fields[] - = NG_PATCH_CONFIG_TYPE_INFO; + = NG_PATCH_CONFIG_TYPE; static const struct ng_parse_type ng_patch_config_type = { &ng_parse_struct_type, &ng_patch_config_type_fields }; static const struct ng_parse_struct_field ng_patch_stats_fields[] - = NG_PATCH_STATS_TYPE_INFO; + = NG_PATCH_STATS_TYPE; static const struct ng_parse_type ng_patch_stats_type = { &ng_parse_struct_type, &ng_patch_stats_fields @@ -91,6 +111,20 @@ static const struct ng_parse_type ng_pat static const struct ng_cmdlist ng_patch_cmdlist[] = { { NGM_PATCH_COOKIE, + NGM_PATCH_GETDLT, + "getdlt", + NULL, + &ng_parse_uint8_type + }, + { + NGM_PATCH_COOKIE, + NGM_PATCH_SETDLT, + "setdlt", + &ng_parse_uint8_type, + NULL + }, + { + NGM_PATCH_COOKIE, NGM_PATCH_GETCONFIG, "getconfig", NULL, @@ -141,38 +175,16 @@ static struct ng_type typestruct = { NETGRAPH_INIT(patch, &typestruct); -union patch_val { - uint8_t v1; - uint16_t v2; - uint32_t v4; - uint64_t v8; -}; - -/* private data */ -struct ng_patch_priv { - hook_p in; - hook_p out; - struct ng_patch_config *config; - union patch_val *val; - struct ng_patch_stats stats; -}; -typedef struct ng_patch_priv *priv_p; - -#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ - (count) * sizeof(struct ng_patch_op)) - -static void do_patch(priv_p conf, struct mbuf *m); - static int ng_patch_constructor(node_p node) { priv_p privdata; privdata = malloc(sizeof(*privdata), M_NETGRAPH, M_WAITOK | M_ZERO); + privdata->dlt = DLT_RAW; + NG_NODE_SET_PRIVATE(node, privdata); - privdata->in = NULL; - privdata->out = NULL; - privdata->config = NULL; + return (0); } @@ -188,7 +200,8 @@ ng_patch_newhook(node_p node, hook_p hoo privp->out = hook; } else return (EINVAL); - return(0); + + return (0); } static int @@ -196,308 +209,341 @@ ng_patch_rcvmsg(node_p node, item_p item { const priv_p privp = NG_NODE_PRIVATE(node); struct ng_patch_config *conf, *newconf; - union patch_val *newval; struct ng_mesg *msg; - struct ng_mesg *resp; - int i, clear, error; + struct ng_mesg *resp = NULL; + int i, error = 0; - clear = error = 0; - resp = NULL; NGI_GET_MSG(item, msg); - switch (msg->header.typecookie) { - case NGM_PATCH_COOKIE: - switch (msg->header.cmd) { + + if (msg->header.typecookie != NGM_PATCH_COOKIE) + ERROUT(EINVAL); + + switch (msg->header.cmd) + { case NGM_PATCH_GETCONFIG: - if (privp->config == NULL) - break; + if (privp->conf == NULL) + ERROUT(0); + NG_MKRESPONSE(resp, msg, - NG_PATCH_CONF_SIZE(privp->config->count), - M_WAITOK); - bcopy(privp->config, resp->data, - NG_PATCH_CONF_SIZE(privp->config->count)); - break; - case NGM_PATCH_SETCONFIG: - { - if (msg->header.arglen < - sizeof(struct ng_patch_config)) { - error = EINVAL; - break; - } + NG_PATCH_CONF_SIZE(privp->conf->count), M_WAITOK); - conf = (struct ng_patch_config *)msg->data; - if (msg->header.arglen < - NG_PATCH_CONF_SIZE(conf->count)) { - error = EINVAL; - break; - } + if (resp == NULL) + ERROUT(ENOMEM); - for(i = 0; i < conf->count; i++) { - switch(conf->ops[i].length) { - case 1: - case 2: - case 4: - case 8: - break; - default: - error = EINVAL; - break; + bcopy(privp->conf, resp->data, + NG_PATCH_CONF_SIZE(privp->conf->count)); + + conf = (struct ng_patch_config *) resp->data; + + for (i = 0; i < conf->count; i++) { + switch (conf->ops[i].length) + { + case 1: + conf->ops[i].val.v8 = conf->ops[i].val.v1; + break; + case 2: + conf->ops[i].val.v8 = conf->ops[i].val.v2; + break; + case 4: + conf->ops[i].val.v8 = conf->ops[i].val.v4; + break; + case 8: + break; } - if (error != 0) - break; } - conf->csum_flags &= CSUM_IP | CSUM_TCP | CSUM_UDP | - CSUM_SCTP; + break; + + case NGM_PATCH_SETCONFIG: + conf = (struct ng_patch_config *) msg->data; - if (error == 0) { - newconf = malloc( - NG_PATCH_CONF_SIZE(conf->count), - M_NETGRAPH, M_WAITOK); - newval = malloc(conf->count * - sizeof(union patch_val), M_NETGRAPH, - M_WAITOK); - for(i = 0; i < conf->count; i++) { - switch (conf->ops[i].length) { + if (msg->header.arglen < sizeof(struct ng_patch_config) || + msg->header.arglen < NG_PATCH_CONF_SIZE(conf->count)) + ERROUT(EINVAL); + + for (i = 0; i < conf->count; i++) { + switch (conf->ops[i].length) + { case 1: - newval[i].v1 = - conf->ops[i].value; + conf->ops[i].val.v1 = (uint8_t) conf->ops[i].val.v8; break; case 2: - newval[i].v2 = - conf->ops[i].value; + conf->ops[i].val.v2 = (uint16_t) conf->ops[i].val.v8; break; case 4: - newval[i].v4 = - conf->ops[i].value; + conf->ops[i].val.v4 = (uint32_t) conf->ops[i].val.v8; break; case 8: - newval[i].v8 = - conf->ops[i].value; break; - } + default: + ERROUT(EINVAL); } - bcopy(conf, newconf, - NG_PATCH_CONF_SIZE(conf->count)); - if (privp->val != NULL) - free(privp->val, M_NETGRAPH); - privp->val = newval; - if (privp->config != NULL) - free(privp->config, M_NETGRAPH); - privp->config = newconf; } + + conf->csum_flags &= NG_PATCH_CSUM_IPV4|NG_PATCH_CSUM_IPV6; + conf->relative_offset = !!conf->relative_offset; + + newconf = malloc(NG_PATCH_CONF_SIZE(conf->count), M_NETGRAPH, M_WAITOK | M_ZERO); + + bcopy(conf, newconf, NG_PATCH_CONF_SIZE(conf->count)); + + if (privp->conf) + free(privp->conf, M_NETGRAPH); + + privp->conf = newconf; + break; - } - case NGM_PATCH_GETCLR_STATS: - clear = 1; - /* FALLTHROUGH */ + case NGM_PATCH_GET_STATS: - NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats), - M_WAITOK); - bcopy(&(privp->stats), resp->data, - sizeof(struct ng_patch_stats)); - if (clear == 0) - break; - /* else FALLTHROUGH */ case NGM_PATCH_CLR_STATS: - bzero(&(privp->stats), sizeof(struct ng_patch_stats)); + case NGM_PATCH_GETCLR_STATS: + if (msg->header.cmd != NGM_PATCH_CLR_STATS) { + NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + bcopy(&(privp->stats), resp->data, sizeof(struct ng_patch_stats)); + } + + if (msg->header.cmd != NGM_PATCH_GET_STATS) + bzero(&(privp->stats), sizeof(struct ng_patch_stats)); + break; - default: - error = EINVAL; + + case NGM_PATCH_GETDLT: + NG_MKRESPONSE(resp, msg, sizeof(uint8_t), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + *((uint8_t *) resp->data) = privp->dlt; + break; - } - break; - default: - error = EINVAL; - break; + + case NGM_PATCH_SETDLT: + if (msg->header.arglen != sizeof(uint8_t)) + ERROUT(EINVAL); + + switch (*(uint8_t *) msg->data) + { + case DLT_EN10MB: + case DLT_RAW: + privp->dlt = *(uint8_t *) msg->data; + break; + + default: + ERROUT(EINVAL); + } + + break; + + default: + ERROUT(EINVAL); } +done: NG_RESPOND_MSG(error, node, item, resp); NG_FREE_MSG(msg); - return(error); + + return (error); } static void -do_patch(priv_p privp, struct mbuf *m) +do_patch(priv_p privp, struct mbuf *m, int global_offset) { - struct ng_patch_config *conf; - uint64_t buf; - int i, patched; + int i, offset, patched = 0; + union ng_patch_op_val val; + + for (i = 0; i < privp->conf->count; i++) { + offset = global_offset + privp->conf->ops[i].offset; - conf = privp->config; - patched = 0; - for(i = 0; i < conf->count; i++) { - if (conf->ops[i].offset + conf->ops[i].length > - m->m_pkthdr.len) + if (offset + privp->conf->ops[i].length > m->m_pkthdr.len) continue; /* for "=" operation we don't need to copy data from mbuf */ - if (conf->ops[i].mode != NG_PATCH_MODE_SET) { - m_copydata(m, conf->ops[i].offset, - conf->ops[i].length, (caddr_t)&buf); - } + if (privp->conf->ops[i].mode != NG_PATCH_MODE_SET) + m_copydata(m, offset, privp->conf->ops[i].length, (caddr_t) &val); - switch (conf->ops[i].length) { - case 1: - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint8_t *)&buf) = privp->val[i].v1; - break; - case NG_PATCH_MODE_ADD: - *((uint8_t *)&buf) += privp->val[i].v1; - break; - case NG_PATCH_MODE_SUB: - *((uint8_t *)&buf) -= privp->val[i].v1; - break; - case NG_PATCH_MODE_MUL: - *((uint8_t *)&buf) *= privp->val[i].v1; - break; - case NG_PATCH_MODE_DIV: - *((uint8_t *)&buf) /= privp->val[i].v1; - break; - case NG_PATCH_MODE_NEG: - *((int8_t *)&buf) = - *((int8_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint8_t *)&buf) &= privp->val[i].v1; - break; - case NG_PATCH_MODE_OR: - *((uint8_t *)&buf) |= privp->val[i].v1; - break; - case NG_PATCH_MODE_XOR: - *((uint8_t *)&buf) ^= privp->val[i].v1; - break; - case NG_PATCH_MODE_SHL: - *((uint8_t *)&buf) <<= privp->val[i].v1; - break; - case NG_PATCH_MODE_SHR: - *((uint8_t *)&buf) >>= privp->val[i].v1; - break; - } - break; - case 2: - *((int16_t *)&buf) = ntohs(*((int16_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint16_t *)&buf) = privp->val[i].v2; - break; - case NG_PATCH_MODE_ADD: - *((uint16_t *)&buf) += privp->val[i].v2; - break; - case NG_PATCH_MODE_SUB: - *((uint16_t *)&buf) -= privp->val[i].v2; - break; - case NG_PATCH_MODE_MUL: - *((uint16_t *)&buf) *= privp->val[i].v2; - break; - case NG_PATCH_MODE_DIV: - *((uint16_t *)&buf) /= privp->val[i].v2; - break; - case NG_PATCH_MODE_NEG: - *((int16_t *)&buf) = - *((int16_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint16_t *)&buf) &= privp->val[i].v2; - break; - case NG_PATCH_MODE_OR: - *((uint16_t *)&buf) |= privp->val[i].v2; - break; - case NG_PATCH_MODE_XOR: - *((uint16_t *)&buf) ^= privp->val[i].v2; - break; - case NG_PATCH_MODE_SHL: - *((uint16_t *)&buf) <<= privp->val[i].v2; - break; - case NG_PATCH_MODE_SHR: - *((uint16_t *)&buf) >>= privp->val[i].v2; - break; - } - *((int16_t *)&buf) = htons(*((int16_t *)&buf)); - break; - case 4: - *((int32_t *)&buf) = ntohl(*((int32_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint32_t *)&buf) = privp->val[i].v4; - break; - case NG_PATCH_MODE_ADD: - *((uint32_t *)&buf) += privp->val[i].v4; - break; - case NG_PATCH_MODE_SUB: - *((uint32_t *)&buf) -= privp->val[i].v4; - break; - case NG_PATCH_MODE_MUL: - *((uint32_t *)&buf) *= privp->val[i].v4; - break; - case NG_PATCH_MODE_DIV: - *((uint32_t *)&buf) /= privp->val[i].v4; - break; - case NG_PATCH_MODE_NEG: - *((int32_t *)&buf) = - *((int32_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint32_t *)&buf) &= privp->val[i].v4; - break; - case NG_PATCH_MODE_OR: - *((uint32_t *)&buf) |= privp->val[i].v4; - break; - case NG_PATCH_MODE_XOR: - *((uint32_t *)&buf) ^= privp->val[i].v4; - break; - case NG_PATCH_MODE_SHL: - *((uint32_t *)&buf) <<= privp->val[i].v4; - break; - case NG_PATCH_MODE_SHR: - *((uint32_t *)&buf) >>= privp->val[i].v4; - break; - } - *((int32_t *)&buf) = htonl(*((int32_t *)&buf)); - break; - case 8: - *((int64_t *)&buf) = be64toh(*((int64_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint64_t *)&buf) = privp->val[i].v8; - break; - case NG_PATCH_MODE_ADD: - *((uint64_t *)&buf) += privp->val[i].v8; - break; - case NG_PATCH_MODE_SUB: - *((uint64_t *)&buf) -= privp->val[i].v8; - break; - case NG_PATCH_MODE_MUL: - *((uint64_t *)&buf) *= privp->val[i].v8; - break; - case NG_PATCH_MODE_DIV: - *((uint64_t *)&buf) /= privp->val[i].v8; - break; - case NG_PATCH_MODE_NEG: - *((int64_t *)&buf) = - *((int64_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint64_t *)&buf) &= privp->val[i].v8; - break; - case NG_PATCH_MODE_OR: - *((uint64_t *)&buf) |= privp->val[i].v8; + switch (privp->conf->ops[i].length) + { + case 1: + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v1 = privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_ADD: + val.v1 += privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SUB: + val.v1 -= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_MUL: + val.v1 *= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_DIV: + val.v1 /= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_NEG: + *((int8_t *) &val) = - *((int8_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v1 &= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_OR: + val.v1 |= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_XOR: + val.v1 ^= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SHL: + val.v1 <<= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SHR: + val.v1 >>= privp->conf->ops[i].val.v1; + break; + } break; - case NG_PATCH_MODE_XOR: - *((uint64_t *)&buf) ^= privp->val[i].v8; + + case 2: + val.v2 = ntohs(val.v2); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v2 = privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_ADD: + val.v2 += privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SUB: + val.v2 -= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_MUL: + val.v2 *= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_DIV: + val.v2 /= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_NEG: + *((int16_t *) &val) = - *((int16_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v2 &= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_OR: + val.v2 |= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_XOR: + val.v2 ^= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SHL: + val.v2 <<= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SHR: + val.v2 >>= privp->conf->ops[i].val.v2; + break; + } + + val.v2 = htons(val.v2); + break; - case NG_PATCH_MODE_SHL: - *((uint64_t *)&buf) <<= privp->val[i].v8; + + case 4: + val.v4 = ntohl(val.v4); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v4 = privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_ADD: + val.v4 += privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SUB: + val.v4 -= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_MUL: + val.v4 *= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_DIV: + val.v4 /= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_NEG: + *((int32_t *) &val) = - *((int32_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v4 &= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_OR: + val.v4 |= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_XOR: + val.v4 ^= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SHL: + val.v4 <<= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SHR: + val.v4 >>= privp->conf->ops[i].val.v4; + break; + } + + val.v4 = htonl(val.v4); + break; - case NG_PATCH_MODE_SHR: - *((uint64_t *)&buf) >>= privp->val[i].v8; + + case 8: + val.v8 = be64toh(val.v8); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v8 = privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_ADD: + val.v8 += privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SUB: + val.v8 -= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_MUL: + val.v8 *= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_DIV: + val.v8 /= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_NEG: + *((int64_t *) &val) = - *((int64_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v8 &= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_OR: + val.v8 |= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_XOR: + val.v8 ^= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SHL: + val.v8 <<= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SHR: + val.v8 >>= privp->conf->ops[i].val.v8; + break; + } + + val.v8 = htobe64(val.v8); + break; - } - *((int64_t *)&buf) = htobe64(*((int64_t *)&buf)); - break; } - m_copyback(m, conf->ops[i].offset, conf->ops[i].length, - (caddr_t)&buf); + m_copyback(m, offset, privp->conf->ops[i].length, (caddr_t) &val); patched = 1; } - if (patched > 0) + + if (patched) privp->stats.patched++; } @@ -506,41 +552,107 @@ ng_patch_rcvdata(hook_p hook, item_p ite { const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct mbuf *m; - hook_p target; - int error; + hook_p out; + int pullup_len = 0; + int error = 0; priv->stats.received++; + NGI_GET_M(item, m); - if (priv->config != NULL && hook == priv->in && - (m->m_flags & M_PKTHDR) != 0) { - m = m_unshare(m,M_NOWAIT); - if (m == NULL) { - priv->stats.dropped++; - NG_FREE_ITEM(item); - return (ENOMEM); + +#define PULLUP_CHECK(mbuf, length) do { \ + pullup_len += length; \ + if (((mbuf)->m_pkthdr.len < pullup_len) || \ + (pullup_len > MHLEN)) { \ + error = EINVAL; \ + goto bypass; \ + } \ + if ((mbuf)->m_len < pullup_len && \ + (((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \ + error = ENOBUFS; \ + goto drop; \ + } \ +} while (0) + + if (priv->conf && hook == priv->in && + m && (m->m_flags & M_PKTHDR)) { + + m = m_unshare(m, M_NOWAIT); + + if (m == NULL) + ERROUT(ENOMEM); + + if (priv->conf->relative_offset) { + struct ether_header *eh; + struct ng_patch_vlan_header *vh; + uint16_t etype; + + switch (priv->dlt) + { + case DLT_EN10MB: + PULLUP_CHECK(m, sizeof(struct ether_header)); + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + + for (;;) { /* QinQ support */ + switch (etype) + { + case 0x8100: + case 0x88A8: + case 0x9100: + PULLUP_CHECK(m, sizeof(struct ng_patch_vlan_header)); + vh = (struct ng_patch_vlan_header *) mtodo(m, + pullup_len - sizeof(struct ng_patch_vlan_header)); + etype = ntohs(vh->etype); + break; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Dec 2 11:30:22 2016 Return-Path: Delivered-To: svn-src-head@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 93E40C61D7F; Fri, 2 Dec 2016 11:30:22 +0000 (UTC) (envelope-from n_hibma@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 638001A0E; Fri, 2 Dec 2016 11:30:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2BULRR079897; Fri, 2 Dec 2016 11:30:21 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2BULRo079896; Fri, 2 Dec 2016 11:30:21 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201612021130.uB2BULRo079896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Fri, 2 Dec 2016 11:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309409 - head/usr.sbin/i2c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 11:30:22 -0000 Author: n_hibma Date: Fri Dec 2 11:30:21 2016 New Revision: 309409 URL: https://svnweb.freebsd.org/changeset/base/309409 Log: More typos in strings. Submitted by: bde MFC after: 3 days Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Fri Dec 2 10:47:10 2016 (r309408) +++ head/usr.sbin/i2c/i2c.c Fri Dec 2 11:30:21 2016 (r309409) @@ -413,7 +413,7 @@ err1: cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) - fprintf(stderr, "error sending stop condtion\n"); + fprintf(stderr, "error sending stop condition\n"); err2: if (err_msg) fprintf(stderr, "%s\n", err_msg); @@ -466,7 +466,7 @@ i2c_read(char *dev, struct options i2c_o cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion"; + err_msg = "error sending stop condition"; goto err2; } } @@ -491,7 +491,7 @@ i2c_read(char *dev, struct options i2c_o } error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion"; + err_msg = "error sending stop condition"; goto err2; } @@ -510,7 +510,7 @@ err1: cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) - fprintf(stderr, "error sending stop condtion\n"); + fprintf(stderr, "error sending stop condition\n"); err2: if (err_msg) fprintf(stderr, "%s\n", err_msg); From owner-svn-src-head@freebsd.org Fri Dec 2 11:32:12 2016 Return-Path: Delivered-To: svn-src-head@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 AB92DC61E27; Fri, 2 Dec 2016 11:32:12 +0000 (UTC) (envelope-from n_hibma@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 7AC0F1DB8; Fri, 2 Dec 2016 11:32:12 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2BWBpX083451; Fri, 2 Dec 2016 11:32:11 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2BWBZv083450; Fri, 2 Dec 2016 11:32:11 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201612021132.uB2BWBZv083450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Fri, 2 Dec 2016 11:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309410 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 11:32:12 -0000 Author: n_hibma Date: Fri Dec 2 11:32:11 2016 New Revision: 309410 URL: https://svnweb.freebsd.org/changeset/base/309410 Log: Fix man page: - It should say 'read' in the I2CREAD section. - last in the struct indicates the last command in a sequence, not the reverse. Reviewed by: imp MFC after: 3 days Modified: head/share/man/man4/iic.4 Modified: head/share/man/man4/iic.4 ============================================================================== --- head/share/man/man4/iic.4 Fri Dec 2 11:30:21 2016 (r309409) +++ head/share/man/man4/iic.4 Fri Dec 2 11:32:11 2016 (r309410) @@ -104,7 +104,8 @@ element is the number of bytes to write. The .Va last element is a boolean flag. -It is non-zero when additional write commands will follow. +It must be zero when additional read commands will follow, or non-zero if this +is the last command. The .Va buf element is a pointer to the data to write to the bus. @@ -120,11 +121,12 @@ The element is ignored. The .Va count -element is the number of bytes to write. +element is the number of bytes to read. The .Va last element is a boolean flag. -It is non-zero when additional write commands will follow. +It must be zero when additional read commands will follow, or non-zero if this +is the last command. The .Va buf element is a pointer to where to store the data read from the bus. From owner-svn-src-head@freebsd.org Fri Dec 2 14:23:28 2016 Return-Path: Delivered-To: svn-src-head@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 88AA6C62098; Fri, 2 Dec 2016 14:23:28 +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 4967314A8; Fri, 2 Dec 2016 14:23:28 +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 uB2ENR3o054181; Fri, 2 Dec 2016 14:23:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2ENRwi054177; Fri, 2 Dec 2016 14:23:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612021423.uB2ENRwi054177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Dec 2016 14:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309411 - in head/libexec/rtld-elf: . aarch64 riscv sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 14:23:28 -0000 Author: emaste Date: Fri Dec 2 14:23:26 2016 New Revision: 309411 URL: https://svnweb.freebsd.org/changeset/base/309411 Log: Retire long-broken/unused static rtld support rtld-elf has some vestigial support for building as a static executable. r45501 introduced a partial implementation with a prescient note that it "might never be enabled." r153515 introduced ELF symbol versioning support, and removed part of the unused build infrastructure for static rtld. GNU ld populates rela relocation addends and GOT entries with the same values, and rtld's run-time dynamic executable check relied on this. Alternate toolchains may not populate the GOT entries, which caused RTLD_IS_DYNAMIC to return false. Simplify rtld by just removing the unused check. If we want to restore static rtld support later on we ought to introduce a build-time #ifdef flag. PR: 214972 Reviewed by: kan MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8687 Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h head/libexec/rtld-elf/riscv/rtld_machdep.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/sparc64/rtld_machdep.h Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_machdep.h Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.h Fri Dec 2 14:23:26 2016 (r309411) @@ -45,7 +45,6 @@ struct Struct_Obj_Entry; asm volatile("adr %0, _DYNAMIC" : "=&r"(_dynamic_addr)); \ (const Elf_Dyn *)_dynamic_addr; \ }) -#define RTLD_IS_DYNAMIC() (1) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, Modified: head/libexec/rtld-elf/riscv/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Dec 2 14:23:26 2016 (r309411) @@ -52,7 +52,6 @@ uint64_t set_gp(struct Struct_Obj_Entry __asm __volatile("lla %0, _DYNAMIC" : "=r"(_dynamic_addr)); \ (const Elf_Dyn *)_dynamic_addr; \ }) -#define RTLD_IS_DYNAMIC() (1) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/rtld.c Fri Dec 2 14:23:26 2016 (r309411) @@ -200,9 +200,6 @@ Elf_Sym sym_zero; /* For resolving unde extern Elf_Dyn _DYNAMIC; #pragma weak _DYNAMIC -#ifndef RTLD_IS_DYNAMIC -#define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) -#endif int dlclose(void *) __exported; char *dlerror(void) __exported; @@ -1920,22 +1917,20 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * #ifdef PIC objtmp.relocbase = mapbase; #endif - if (RTLD_IS_DYNAMIC()) { - objtmp.dynamic = rtld_dynamic(&objtmp); - digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname, &dyn_runpath); - assert(objtmp.needed == NULL); + + objtmp.dynamic = rtld_dynamic(&objtmp); + digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname, &dyn_runpath); + assert(objtmp.needed == NULL); #if !defined(__mips__) - /* MIPS has a bogus DT_TEXTREL. */ - assert(!objtmp.textrel); + /* MIPS has a bogus DT_TEXTREL. */ + assert(!objtmp.textrel); #endif + /* + * Temporarily put the dynamic linker entry into the object list, so + * that symbols can be found. + */ + relocate_objects(&objtmp, true, &objtmp, 0, NULL); - /* - * Temporarily put the dynamic linker entry into the object list, so - * that symbols can be found. - */ - - relocate_objects(&objtmp, true, &objtmp, 0, NULL); - } ehdr = (Elf_Ehdr *)mapbase; objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); Modified: head/libexec/rtld-elf/sparc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/sparc64/rtld_machdep.h Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/sparc64/rtld_machdep.h Fri Dec 2 14:23:26 2016 (r309411) @@ -37,7 +37,6 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ Elf_Dyn *rtld_dynamic_addr(void); #define rtld_dynamic(obj) rtld_dynamic_addr() -#define RTLD_IS_DYNAMIC() (rtld_dynamic_addr() != NULL) Elf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr, const struct Struct_Obj_Entry *, From owner-svn-src-head@freebsd.org Fri Dec 2 14:44:41 2016 Return-Path: Delivered-To: svn-src-head@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 0801CC62857; Fri, 2 Dec 2016 14:44:41 +0000 (UTC) (envelope-from imp@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 D00F61F36; Fri, 2 Dec 2016 14:44:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2EieRU062067; Fri, 2 Dec 2016 14:44:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2Eicfr062056; Fri, 2 Dec 2016 14:44:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612021444.uB2Eicfr062056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Dec 2016 14:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309412 - in head: . sys/boot sys/boot/efi/boot1 sys/boot/i386/boot2 sys/boot/i386/pxeldr sys/boot/i386/zfsboot sys/boot/pc98/boot0.5 sys/boot/pc98/boot2 sys/boot/pc98/pc98boot sys/boot... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 14:44:41 -0000 Author: imp Date: Fri Dec 2 14:44:38 2016 New Revision: 309412 URL: https://svnweb.freebsd.org/changeset/base/309412 Log: dd is currently a bootstrap tool. It really doesn't have any business being a bootstrap tool. However, for reproducible build output, FreeBSD added dd status=none because it was otherwise difficult to suppress the status information, but retain any errors that might happen. There's no real reason that dd has to be a build tool, other than we use status=none unconditional. Remove dd from a bootstrap tool entirely by only using status=none when available. This may also help efforts to build the system on non-FreeBSD hosts as well. Differential Revision: https://reviews.freebsd.org/D8605 Modified: head/Makefile.inc1 head/sys/boot/Makefile.inc head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/pc98/boot0.5/Makefile head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/pc98boot/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/sparc64/boot1/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Dec 2 14:23:26 2016 (r309411) +++ head/Makefile.inc1 Fri Dec 2 14:44:38 2016 (r309412) @@ -1631,11 +1631,6 @@ ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libne _cat= bin/cat .endif -# r264059 support for status= -.if ${BOOTSTRAPPING} < 1100017 -_dd= bin/dd -.endif - # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support .if ${BOOTSTRAPPING} < 1100078 @@ -1718,7 +1713,6 @@ bootstrap-tools: .PHONY ${_groff} \ ${_dtc} \ ${_cat} \ - ${_dd} \ ${_kbdcontrol} \ usr.bin/lorder \ ${_libopenbsd} \ Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/Makefile.inc Fri Dec 2 14:44:38 2016 (r309412) @@ -15,3 +15,10 @@ CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none .endif + +# The boot loader build uses dd status=none, where possible, for reproducible +# build output (since performance varies from run to run). Trouble is that +# option was recently (10.3) added to FreeBSD and is non-standard. Only use it +# when this test succeeds rather than require dd to be a bootstrap tool. +DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true +DD=dd ${DD_NOSTATUS} Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/efi/boot1/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -124,8 +124,7 @@ boot1.efifat: boot1.efi uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc \ - status=none + ${DD} if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES= boot1.efi boot1.efifat Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/boot2/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -72,14 +72,14 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync status=none + ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 status=none + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/pxeldr/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none + ${DD} if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync rm ${.TARGET}.tmp LDFLAGS+=${LDFLAGS_BIN} Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/zfsboot/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -70,7 +70,7 @@ BOOT2SIZE= 131072 zfsboot2: zfsboot.ld @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync status=none + ${DD} if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ Modified: head/sys/boot/pc98/boot0.5/Makefile ============================================================================== --- head/sys/boot/pc98/boot0.5/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/pc98/boot0.5/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -18,7 +18,7 @@ LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin - cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168 + cat ${BOOT}.bin /dev/zero | ${DD} of=${BOOT} bs=1 count=7168 ${BOOT}.bin: ${BOOT}.out ${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET} Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/pc98/boot2/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -78,14 +78,14 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=276 count=1 + ${DD} if=/dev/zero of=${.TARGET} bs=276 count=1 boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: head/sys/boot/pc98/pc98boot/Makefile ============================================================================== --- head/sys/boot/pc98/pc98boot/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/pc98/pc98boot/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -20,6 +20,6 @@ ${BOOT}: ${BOOT0} ${BOOT05} ${BOOT}.part cat ${BOOT0} ${BOOT}.part ${BOOT05} > ${.TARGET} ${BOOT}.part: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 .include Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -30,8 +30,8 @@ boot1.hfs: boot1.elf bootinfo.txt uudecode ${.CURDIR}/hfs.tmpl.bz2.uu mv hfs.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - dd if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc - dd if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ + ${DD} if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc CLEANFILES= boot1.hfs Modified: head/sys/boot/sparc64/boot1/Makefile ============================================================================== --- head/sys/boot/sparc64/boot1/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/sparc64/boot1/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -19,8 +19,8 @@ LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N ${FILES}: boot1.aout @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=/dev/zero of=${.TARGET} bs=512 count=16 - dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=16 + ${DD} if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} From owner-svn-src-head@freebsd.org Fri Dec 2 14:44:46 2016 Return-Path: Delivered-To: svn-src-head@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 97968C628B6; Fri, 2 Dec 2016 14:44:46 +0000 (UTC) (envelope-from imp@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 59EA11F7A; Fri, 2 Dec 2016 14:44:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2EijDc062121; Fri, 2 Dec 2016 14:44:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2EijxT062120; Fri, 2 Dec 2016 14:44:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612021444.uB2EijxT062120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Dec 2016 14:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309413 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 14:44:46 -0000 Author: imp Date: Fri Dec 2 14:44:45 2016 New Revision: 309413 URL: https://svnweb.freebsd.org/changeset/base/309413 Log: Flag the vendor specific pages as such. This allows different decoding for the same page number as different vendors encode vendor specific pages differently. Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Fri Dec 2 14:44:38 2016 (r309412) +++ head/sbin/nvmecontrol/logpage.c Fri Dec 2 14:44:45 2016 (r309413) @@ -793,23 +793,23 @@ print_hgst_info_log(void *buf, uint32_t */ static struct logpage_function { uint8_t log_page; + const char *vendor; print_fn_t print_fn; size_t size; } logfuncs[] = { - {NVME_LOG_ERROR, print_log_error, + {NVME_LOG_ERROR, NULL, print_log_error, 0}, - {NVME_LOG_HEALTH_INFORMATION, print_log_health, + {NVME_LOG_HEALTH_INFORMATION, NULL, print_log_health, sizeof(struct nvme_health_information_page)}, - {NVME_LOG_FIRMWARE_SLOT, print_log_firmware, + {NVME_LOG_FIRMWARE_SLOT, NULL, print_log_firmware, sizeof(struct nvme_firmware_page)}, - {INTEL_LOG_TEMP_STATS, print_intel_temp_stats, + {INTEL_LOG_TEMP_STATS, "intel", print_intel_temp_stats, sizeof(struct intel_log_temp_stats)}, - {INTEL_LOG_ADD_SMART, print_intel_add_smart, + {INTEL_LOG_ADD_SMART, "intel", print_intel_add_smart, DEFAULT_SIZE}, - {HGST_INFO_LOG, print_hgst_info_log, + {HGST_INFO_LOG, "hgst", print_hgst_info_log, DEFAULT_SIZE}, - {0, NULL, - 0}, + {0, NULL, NULL, 0}, }; static void @@ -830,11 +830,12 @@ logpage(int argc, char *argv[]) char cname[64]; uint32_t size; void *buf; + const char *vendor = NULL; struct logpage_function *f; struct nvme_controller_data cdata; print_fn_t print_fn; - while ((ch = getopt(argc, argv, "p:x")) != -1) { + while ((ch = getopt(argc, argv, "p:xv:")) != -1) { switch (ch) { case 'p': /* TODO: Add human-readable ASCII page IDs */ @@ -850,6 +851,9 @@ logpage(int argc, char *argv[]) case 'x': hexflag = true; break; + case 'v': + vendor = optarg; + break; } } @@ -893,18 +897,21 @@ logpage(int argc, char *argv[]) size = DEFAULT_SIZE; if (!hexflag) { /* - * See if there is a pretty print function for the - * specified log page. If one isn't found, we - * just revert to the default (print_hex). + * See if there is a pretty print function for the specified log + * page. If one isn't found, we just revert to the default + * (print_hex). If there was a vendor specified bt the user, and + * the page is vendor specific, don't match the print function + * unless the vendors match. */ - f = logfuncs; - while (f->log_page > 0) { - if (log_page == f->log_page) { - print_fn = f->print_fn; - size = f->size; - break; - } - f++; + for (f = logfuncs; f->log_page > 0; f++) { + if (f->vendor != NULL && vendor != NULL && + strcmp(f->vendor, vendor) != 0) + continue; + if (log_page != f->log_page) + continue; + print_fn = f->print_fn; + size = f->size; + break; } } From owner-svn-src-head@freebsd.org Fri Dec 2 15:38:35 2016 Return-Path: Delivered-To: svn-src-head@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 BD9DCC63872; Fri, 2 Dec 2016 15:38:35 +0000 (UTC) (envelope-from rstone@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 8D631129D; Fri, 2 Dec 2016 15:38:35 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2FcYma083893; Fri, 2 Dec 2016 15:38:34 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2FcYRM083892; Fri, 2 Dec 2016 15:38:34 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201612021538.uB2FcYRM083892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Fri, 2 Dec 2016 15:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309414 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 15:38:35 -0000 Author: rstone Date: Fri Dec 2 15:38:34 2016 New Revision: 309414 URL: https://svnweb.freebsd.org/changeset/base/309414 Log: Revert r309372 The bug intended to be fixed by r309372 was already addressed by r296178, so revert my change. Reported by: seph Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Fri Dec 2 14:44:45 2016 (r309413) +++ head/sys/sys/buf_ring.h Fri Dec 2 15:38:34 2016 (r309414) @@ -67,13 +67,11 @@ buf_ring_enqueue(struct buf_ring *br, vo uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; - if (br->br_cons_head != br->br_prod_head) { - for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if(br->br_ring[i] == buf) - panic("buf=%p already enqueue at %d prod=%d cons=%d", - buf, i, br->br_prod_tail, br->br_cons_tail); - } + for (i = br->br_cons_head; i != br->br_prod_head; + i = ((i + 1) & br->br_cons_mask)) + if(br->br_ring[i] == buf) + panic("buf=%p already enqueue at %d prod=%d cons=%d", + buf, i, br->br_prod_tail, br->br_cons_tail); #endif critical_enter(); do { From owner-svn-src-head@freebsd.org Fri Dec 2 16:00:14 2016 Return-Path: Delivered-To: svn-src-head@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 B5BEAC63D8D; Fri, 2 Dec 2016 16:00:14 +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 731941CF2; Fri, 2 Dec 2016 16:00:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-230-194.lns20.per1.internode.on.net [121.45.230.194]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id uB2G07m9072144 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 2 Dec 2016 08:00:10 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests To: Jilles Tjoelker References: <201611230757.uAN7vqmC008888@repo.freebsd.org> <20161127204305.GA58954@stack.nl> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Julian Elischer Message-ID: <4de52b2a-fef9-f043-2409-c77bafc599fe@freebsd.org> Date: Sat, 3 Dec 2016 00:00:01 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161127204305.GA58954@stack.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:00:14 -0000 On 28/11/2016 4:43 AM, Jilles Tjoelker wrote: > On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: >> Author: julian >> Date: Wed Nov 23 07:57:52 2016 >> New Revision: 309035 >> URL: https://svnweb.freebsd.org/changeset/base/309035 >> Log: >> This little BSD licensed library has been kicking around for years. >> It allows one to trivially convert an absolute path to a relative path >> and the reverse. The test programs themselves are very useful in scripts >> but the real use comes shortly with the -r and -a arguments to ln. >> These are sometimes known as the --relative and --absolute flags and >> can force a symlink to be relative when you only have an absolue path. >> Another place these are sometimes used is to add -a and -r args to 'realpath'. >> Incredibly useful in Makefiles. >> I was going to just add the files in with 'ln' but a library makes more sense. >> The test programs may come out in their own right some day for scripting. >> released under a BSD 2-clause: >> * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. >> * Copyright (c) 1999 Tama Communications Corporation. All rights reserved. >> The test directry does not conform to any framework. >> Not connected to build. >> doc people may want to play with the manual pages. >> Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yamaguchi. >> MFC after: 1 month >> Relnotes: yes >> Sponsored by: Panzura, Tama Communications Corporation > Consider making this a static-only library or a part of an existing > library such as libc or libutil, since the overhead of a shared object > is rather big compared to the amount of code here. yeah I was thinking of making it part of libc but libc is already such a kitchen sink and there are only two planned users. ln and realpath. A static library is one idea for sure. (or even just a .o). The actual real target for this is the build itself. Currently we are making lots of symlinks that should be relative but we only really have absolute information. This allows symlink -sr to dynamically generate the correct relative symlink, given absolute args. e.g. /usr/lib/libm.so -> /lib/libm.so.5 should really be ../../lib/libm.so.5 so that when it is read from outside a jail it still refers to the right place. I'm waiting for a gap in my work schedule to get ln and realpath changes in place. > > Thanks for not linking this to the build right away. > From owner-svn-src-head@freebsd.org Fri Dec 2 16:18:38 2016 Return-Path: Delivered-To: svn-src-head@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 642BAC62523; Fri, 2 Dec 2016 16:18:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 364FF1B2B; Fri, 2 Dec 2016 16:18:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5DF5C10A74C; Fri, 2 Dec 2016 11:18:36 -0500 (EST) From: John Baldwin To: Warner Losh Cc: hiren panchasara , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r309351 - head/etc/defaults Date: Fri, 02 Dec 2016 08:18:13 -0800 Message-ID: <3180246.4fqia12Gik@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 02 Dec 2016 11:18:36 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:18:38 -0000 On Thursday, December 01, 2016 02:41:41 PM Warner Losh wrote: > On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara > wrote: > > On 12/01/16 at 04:35P, Warner Losh wrote: > >> Author: imp > >> Date: Thu Dec 1 04:35:43 2016 > >> New Revision: 309351 > >> URL: https://svnweb.freebsd.org/changeset/base/309351 > >> > >> Log: > >> Revert the 'performance' setting to 'NONE' from C2. > > > > Just a note that this commit reverts r282110. > > Yea, it's good for laptops, bad for servers. At least there's some > Intel CPUs that this causes corruption with USB. That's being sorted > out, but until that's done we need to fail more safe for our primary > market. It's also good for some servers as you need some cores in C-states to get the maximum Turbo Boost on other cores (though that may have been more true for earlier generations of i7 CPUs than more recent generations). -- John Baldwin From owner-svn-src-head@freebsd.org Fri Dec 2 16:28:20 2016 Return-Path: Delivered-To: svn-src-head@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 0FCD5C62A28; Fri, 2 Dec 2016 16:28:20 +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 D3A4112EF; Fri, 2 Dec 2016 16:28:19 +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 uB2GSJ1G004893; Fri, 2 Dec 2016 16:28:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2GSJVP004892; Fri, 2 Dec 2016 16:28:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021628.uB2GSJVP004892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309415 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:28:20 -0000 Author: pfg Date: Fri Dec 2 16:28:18 2016 New Revision: 309415 URL: https://svnweb.freebsd.org/changeset/base/309415 Log: indent(1): Optimize parser stack usage. When special else-if processing is enabled (-ei), we can assume "else if" and "if" to be equivalent for indentation purposes. This reduction saves a lot of stack space in case of a long "if-else-if ... else-if" sequence; with this change, Postgres/src/bin/psql/tab-complete.c as of 9.6beta3 requires minimum of the stack length to be 31 instead of 444. Submitted by: Piotr Sephaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Fri Dec 2 15:38:34 2016 (r309414) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:28:18 2016 (r309415) @@ -94,7 +94,13 @@ parse(int tk) /* tk: the code for the co case ifstmt: /* scanned if (...) */ if (ps.p_stack[ps.tos] == elsehead && ps.else_if) /* "else if ..." */ - ps.i_l_follow = ps.il[ps.tos]; + /* + * Note that the stack pointer here is decremented, effectively + * reducing "else if" to "if". This saves a lot of stack space + * in case of a long "if-else-if ... else-if" sequence. + */ + ps.i_l_follow = ps.il[ps.tos--]; + /* the rest is the same as for dolit and forstmt */ case dolit: /* 'do' */ case forstmt: /* for (...) */ From owner-svn-src-head@freebsd.org Fri Dec 2 16:29:31 2016 Return-Path: Delivered-To: svn-src-head@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 9ADFCC62AFC; Fri, 2 Dec 2016 16:29:31 +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 6AB201519; Fri, 2 Dec 2016 16:29:31 +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 uB2GTUIN004977; Fri, 2 Dec 2016 16:29:30 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2GTUCZ004976; Fri, 2 Dec 2016 16:29:30 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201612021629.uB2GTUCZ004976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 2 Dec 2016 16:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309416 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:29:31 -0000 Author: alc Date: Fri Dec 2 16:29:30 2016 New Revision: 309416 URL: https://svnweb.freebsd.org/changeset/base/309416 Log: Eliminate a stale comment; vm_radix_prealloc() was replaced in r254141. MFC after: 3 days Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Fri Dec 2 16:28:18 2016 (r309415) +++ head/sys/vm/vm_radix.c Fri Dec 2 16:29:30 2016 (r309416) @@ -308,8 +308,6 @@ SYSINIT(vm_radix_reserve_kva, SI_SUB_KME /* * Initialize the UMA slab zone. - * Until vm_radix_prealloc() is called, the zone will be served by the - * UMA boot-time pre-allocated pool of pages. */ void vm_radix_init(void) From owner-svn-src-head@freebsd.org Fri Dec 2 16:32:15 2016 Return-Path: Delivered-To: svn-src-head@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 EE809C62CEF; Fri, 2 Dec 2016 16:32:15 +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 BE39A1935; Fri, 2 Dec 2016 16:32:15 +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 uB2GWESk008616; Fri, 2 Dec 2016 16:32:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2GWEIV008615; Fri, 2 Dec 2016 16:32:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021632.uB2GWEIV008615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309417 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:32:16 -0000 Author: pfg Date: Fri Dec 2 16:32:14 2016 New Revision: 309417 URL: https://svnweb.freebsd.org/changeset/base/309417 Log: indent(1): Remove an extra newline added in a previous commit. It doesn't math the remaining of the case statement. Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Fri Dec 2 16:29:30 2016 (r309416) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:32:14 2016 (r309417) @@ -100,7 +100,6 @@ parse(int tk) /* tk: the code for the co * in case of a long "if-else-if ... else-if" sequence. */ ps.i_l_follow = ps.il[ps.tos--]; - /* the rest is the same as for dolit and forstmt */ case dolit: /* 'do' */ case forstmt: /* for (...) */ From owner-svn-src-head@freebsd.org Fri Dec 2 16:41:09 2016 Return-Path: Delivered-To: svn-src-head@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 5D6E7C62F1A; Fri, 2 Dec 2016 16:41:09 +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 2D3071CBF; Fri, 2 Dec 2016 16:41:09 +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 uB2Gf8m7011762; Fri, 2 Dec 2016 16:41:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2Gf8YK011761; Fri, 2 Dec 2016 16:41:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021641.uB2Gf8YK011761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309418 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:41:09 -0000 Author: pfg Date: Fri Dec 2 16:41:08 2016 New Revision: 309418 URL: https://svnweb.freebsd.org/changeset/base/309418 Log: indent(1): Avoid out-of-bound accesses of arrays. ps.paren_indents: When ps.paren_level was 0, this was accessing paren_indents[-1]. in_buffer: This fragment checks if "*/" was read, but there's no guarantee that there is more than one byte in the array (actually, this happens frequently for the "{" in things like "int main(void) {"). Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/io.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Fri Dec 2 16:32:14 2016 (r309417) +++ head/usr.bin/indent/io.c Fri Dec 2 16:41:08 2016 (r309418) @@ -278,7 +278,8 @@ inhibit_newline: *(e_com = s_com = combuf + 1) = '\0'; ps.ind_level = ps.i_l_follow; ps.paren_level = ps.p_l_follow; - paren_target = -ps.paren_indents[ps.paren_level - 1]; + if (ps.paren_level > 0) + paren_target = -ps.paren_indents[ps.paren_level - 1]; not_first_line = 1; } @@ -371,7 +372,7 @@ fill_buffer(void) } buf_ptr = in_buffer; buf_end = p; - if (p[-2] == '/' && p[-3] == '*') { + if (p - in_buffer > 2 && p[-2] == '/' && p[-3] == '*') { if (in_buffer[3] == 'I' && strncmp(in_buffer, "/**INDENT**", 11) == 0) fill_buffer(); /* flush indent error message */ else { From owner-svn-src-head@freebsd.org Fri Dec 2 16:42:46 2016 Return-Path: Delivered-To: svn-src-head@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 C163CC63087; Fri, 2 Dec 2016 16:42:46 +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 913AA104F; Fri, 2 Dec 2016 16:42:46 +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 uB2GgjkC012705; Fri, 2 Dec 2016 16:42:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2Ggj1Q012704; Fri, 2 Dec 2016 16:42:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021642.uB2Ggj1Q012704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309419 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:42:46 -0000 Author: pfg Date: Fri Dec 2 16:42:45 2016 New Revision: 309419 URL: https://svnweb.freebsd.org/changeset/base/309419 Log: indent(1): Avoid out-of-bound accesses of array ps.p_stack. Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Fri Dec 2 16:41:08 2016 (r309418) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:42:45 2016 (r309419) @@ -172,7 +172,7 @@ parse(int tk) /* tk: the code for the co case rbrace: /* scanned a } */ /* stack should have or */ - if (ps.p_stack[ps.tos - 1] == lbrace) { + if (ps.tos > 0 && ps.p_stack[ps.tos - 1] == lbrace) { ps.ind_level = ps.i_l_follow = ps.il[--ps.tos]; ps.p_stack[ps.tos] = stmt; } From owner-svn-src-head@freebsd.org Fri Dec 2 17:15:17 2016 Return-Path: Delivered-To: svn-src-head@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 A189CC63E97 for ; Fri, 2 Dec 2016 17:15:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (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 760B031F for ; Fri, 2 Dec 2016 17:15:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id m5so354808365ioe.3 for ; Fri, 02 Dec 2016 09:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nOxnbYDUZ2tSSrnvXkah79znpHH2W8gWCBOKXu8xtwM=; b=gKPxSLXGafZkCnLSh/hLr7emuM7t9GG5lKGNUu4YpRAkAVWLo882ZaDeSjYOJak0t0 5CM+Dq5LAFVeSJu4ou8uvxJ9HdmZM7xVs5i9rhYMoLgGq2jgrXRWzcbjLm/yW85/W2AU ahOofg+L0ozy/Jssf12tFC7i1t9et9eohvyieHHbVZC19pSjjHXXGI9m7e1AoNBKz1Ew afKAlYFWajkNfgfUaJPA8k3ZM0VRpjlpqJherZaY3tIXFxgdV1s06+h1BSgUujm4JOsm OfZUrB984PrlaElpGWzs6QqtLMFJjfyRbLRTIdVplfLXXteu3O/st5fBjb7BZV1wg/b7 vLVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nOxnbYDUZ2tSSrnvXkah79znpHH2W8gWCBOKXu8xtwM=; b=KD/vDAfbwTyiqQrYDB8sgP2HHdM6XScDUmHR9I++mXbbgfWjP8Q4N8BKDiu+QR+VgO avQNLcAi6rIYXT+eAQ6T5QRDxzyP3SrX4KEKRh1zcEi+3cuXMbfRFrhrgZOJMZ3M7Dpr rsGRxwLegBFG1DAztSBKumajUxbCUxdqvBEfTn3W4WFeuURbBOjhIsVB+jrEzfoTnqoN 9zNcb+gHWm8pL0cjQF4Bke9a92gyZE1OPpmxLM/Vmxrn5E3yYp/LpCuawUDQcrGKnzay WzUEzyNk89CGGiJu4C+LN80eP6eIAGPxSDZbh3Ojot9WKAxw+cftSoRQj1KKn86Ex30h nt2g== X-Gm-Message-State: AKaTC033GTUg7QmHT8tRsooXIwJZwq/5VOdXLSOajzhXzmDDcHESqVrgVm2M4XfauWPx8RirWeZFpfdOVKj47A== X-Received: by 10.36.200.68 with SMTP id w65mr3583771itf.85.1480698916574; Fri, 02 Dec 2016 09:15:16 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Fri, 2 Dec 2016 09:15:15 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <3180246.4fqia12Gik@ralph.baldwin.cx> References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> <3180246.4fqia12Gik@ralph.baldwin.cx> From: Warner Losh Date: Fri, 2 Dec 2016 10:15:15 -0700 X-Google-Sender-Auth: Z1PQwPRAM0rbKrujnX68vLdAYgM Message-ID: Subject: Re: svn commit: r309351 - head/etc/defaults To: John Baldwin Cc: hiren panchasara , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 17:15:17 -0000 On Fri, Dec 2, 2016 at 9:18 AM, John Baldwin wrote: > On Thursday, December 01, 2016 02:41:41 PM Warner Losh wrote: >> On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara >> wrote: >> > On 12/01/16 at 04:35P, Warner Losh wrote: >> >> Author: imp >> >> Date: Thu Dec 1 04:35:43 2016 >> >> New Revision: 309351 >> >> URL: https://svnweb.freebsd.org/changeset/base/309351 >> >> >> >> Log: >> >> Revert the 'performance' setting to 'NONE' from C2. >> > >> > Just a note that this commit reverts r282110. >> >> Yea, it's good for laptops, bad for servers. At least there's some >> Intel CPUs that this causes corruption with USB. That's being sorted >> out, but until that's done we need to fail more safe for our primary >> market. > > It's also good for some servers as you need some cores in C-states > to get the maximum Turbo Boost on other cores (though that may have > been more true for earlier generations of i7 CPUs than more recent > generations). Once the corruption issues are solved, we can and should put this back. Adrian is working on that. Warner From owner-svn-src-head@freebsd.org Fri Dec 2 17:18:57 2016 Return-Path: Delivered-To: svn-src-head@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 8F42BC63F7D; Fri, 2 Dec 2016 17:18:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3E94813; Fri, 2 Dec 2016 17:18:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uB2HIlla070541 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 2 Dec 2016 19:18:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uB2HIlla070541 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uB2HIlgW070540; Fri, 2 Dec 2016 19:18:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Dec 2016 19:18:46 +0200 From: Konstantin Belousov To: Julian Elischer Cc: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests Message-ID: <20161202171846.GF54029@kib.kiev.ua> References: <201611230757.uAN7vqmC008888@repo.freebsd.org> <20161127204305.GA58954@stack.nl> <4de52b2a-fef9-f043-2409-c77bafc599fe@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4de52b2a-fef9-f043-2409-c77bafc599fe@freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 17:18:57 -0000 On Sat, Dec 03, 2016 at 12:00:01AM +0800, Julian Elischer wrote: > On 28/11/2016 4:43 AM, Jilles Tjoelker wrote: > > On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: > >> Author: julian > >> Date: Wed Nov 23 07:57:52 2016 > >> New Revision: 309035 > >> URL: https://svnweb.freebsd.org/changeset/base/309035 > >> Log: > >> This little BSD licensed library has been kicking around for years. > >> It allows one to trivially convert an absolute path to a relative path > >> and the reverse. The test programs themselves are very useful in scripts > >> but the real use comes shortly with the -r and -a arguments to ln. > >> These are sometimes known as the --relative and --absolute flags and > >> can force a symlink to be relative when you only have an absolue path. > >> Another place these are sometimes used is to add -a and -r args to 'realpath'. > >> Incredibly useful in Makefiles. > >> I was going to just add the files in with 'ln' but a library makes more sense. > >> The test programs may come out in their own right some day for scripting. > >> released under a BSD 2-clause: > >> * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. > >> * Copyright (c) 1999 Tama Communications Corporation. All rights reserved. > >> The test directry does not conform to any framework. > >> Not connected to build. > >> doc people may want to play with the manual pages. > >> Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yamaguchi. > >> MFC after: 1 month > >> Relnotes: yes > >> Sponsored by: Panzura, Tama Communications Corporation > > Consider making this a static-only library or a part of an existing > > library such as libc or libutil, since the overhead of a shared object > > is rather big compared to the amount of code here. > > yeah I was thinking of making it part of libc but libc is already > such a kitchen sink and there are only two planned users. > ln and realpath. > A static library is one idea for sure. (or even just a .o). Note that libutil was mentioned, which is the kitchen sink both by design and by purpose. > > The actual real target for this is the build itself. Currently we are > making > lots of symlinks that should be relative but we only really have > absolute information. > This allows symlink -sr to dynamically generate the correct relative > symlink, > given absolute args. > e.g. /usr/lib/libm.so -> /lib/libm.so.5 should really be > ../../lib/libm.so.5 > so that when it is read from outside a jail it still refers to the > right place. > > I'm waiting for a gap in my work schedule to get ln and realpath > changes in place. > > > > > > > Thanks for not linking this to the build right away. > > > From owner-svn-src-head@freebsd.org Fri Dec 2 18:03:17 2016 Return-Path: Delivered-To: svn-src-head@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 07E15C6302E; Fri, 2 Dec 2016 18:03:17 +0000 (UTC) (envelope-from mjg@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 B29D31EA; Fri, 2 Dec 2016 18:03:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2I3FSj046713; Fri, 2 Dec 2016 18:03:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2I3Fmt046712; Fri, 2 Dec 2016 18:03:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612021803.uB2I3Fmt046712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 2 Dec 2016 18:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309425 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 18:03:17 -0000 Author: mjg Date: Fri Dec 2 18:03:15 2016 New Revision: 309425 URL: https://svnweb.freebsd.org/changeset/base/309425 Log: vfs: provide fake locking primitives for the crossmp vnode Since the vnode is only expected to be shared locked, we can save a little overhead by only pretending we are locking in the first place. Reviewed by: kib Tested by: pho Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Fri Dec 2 17:08:27 2016 (r309424) +++ head/sys/kern/vfs_lookup.c Fri Dec 2 18:03:15 2016 (r309425) @@ -79,6 +79,64 @@ uma_zone_t namei_zone; /* Placeholder vnode for mp traversal. */ static struct vnode *vp_crossmp; +static int +crossmp_vop_islocked(struct vop_islocked_args *ap) +{ + + return (LK_SHARED); +} + +static int +crossmp_vop_lock1(struct vop_lock1_args *ap) +{ + struct vnode *vp; + struct lock *lk; + const char *file; + int flags, line; + + vp = ap->a_vp; + lk = vp->v_vnlock; + flags = ap->a_flags; + file = ap->a_file; + line = ap->a_line; + + if ((flags & LK_SHARED) == 0) + panic("invalid lock request for crossmp"); + + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, file, line, + flags & LK_INTERLOCK ? &VI_MTX(vp)->lock_object : NULL); + WITNESS_LOCK(&lk->lock_object, 0, file, line); + if ((flags & LK_INTERLOCK) != 0) + VI_UNLOCK(vp); + LOCK_LOG_LOCK("SLOCK", &lk->lock_object, 0, 0, ap->a_file, line); + return (0); +} + +static int +crossmp_vop_unlock(struct vop_unlock_args *ap) +{ + struct vnode *vp; + struct lock *lk; + int flags; + + vp = ap->a_vp; + lk = vp->v_vnlock; + flags = ap->a_flags; + + if ((flags & LK_INTERLOCK) != 0) + VI_UNLOCK(vp); + WITNESS_UNLOCK(&lk->lock_object, 0, LOCK_FILE, LOCK_LINE); + LOCK_LOG_LOCK("SUNLOCK", &lk->lock_object, 0, 0, LOCK_FILE, + LOCK_LINE); + return (0); +} + +static struct vop_vector crossmp_vnodeops = { + .vop_islocked = crossmp_vop_islocked, + .vop_lock1 = crossmp_vop_lock1, + .vop_unlock = crossmp_vop_unlock, +}; + struct nameicap_tracker { struct vnode *dp; TAILQ_ENTRY(nameicap_tracker) nm_link; @@ -95,10 +153,7 @@ nameiinit(void *dummy __unused) UMA_ALIGN_PTR, 0); nt_zone = uma_zcreate("rentr", sizeof(struct nameicap_tracker), NULL, NULL, NULL, NULL, sizeof(void *), 0); - getnewvnode("crossmp", NULL, &dead_vnodeops, &vp_crossmp); - vn_lock(vp_crossmp, LK_EXCLUSIVE); - VN_LOCK_ASHARE(vp_crossmp); - VOP_UNLOCK(vp_crossmp, 0); + getnewvnode("crossmp", NULL, &crossmp_vnodeops, &vp_crossmp); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL); From owner-svn-src-head@freebsd.org Fri Dec 2 19:47:25 2016 Return-Path: Delivered-To: svn-src-head@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 DE269C63D23; Fri, 2 Dec 2016 19:47:25 +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 B85C49EE; Fri, 2 Dec 2016 19:47:25 +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 uB2JlOHk087894; Fri, 2 Dec 2016 19:47:24 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JlN6o087881; Fri, 2 Dec 2016 19:47:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021947.uB2JlN6o087881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 19:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309439 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:47:26 -0000 Author: pfg Date: Fri Dec 2 19:47:23 2016 New Revision: 309439 URL: https://svnweb.freebsd.org/changeset/base/309439 Log: ext2fs: renumber the license clauses to avoid skipping #3. This is to keep consistency with other files, and help license-checking utilities determine the number of clauses that apply. No functional change. Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_mount.h head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_balloc.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_bmap.c Fri Dec 2 19:47:23 2016 (r309439) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_extern.h Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_inode.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_lookup.c Fri Dec 2 19:47:23 2016 (r309439) @@ -21,7 +21,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_mount.h ============================================================================== --- head/sys/fs/ext2fs/ext2_mount.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_mount.h Fri Dec 2 19:47:23 2016 (r309439) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_subr.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_subr.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_vnops.c Fri Dec 2 19:47:23 2016 (r309439) @@ -21,7 +21,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/fs.h Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/inode.h Fri Dec 2 19:47:23 2016 (r309439) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@freebsd.org Sat Dec 3 00:24:35 2016 Return-Path: Delivered-To: svn-src-head@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 AC339C62753; Sat, 3 Dec 2016 00:24:35 +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 5756E1F80; Sat, 3 Dec 2016 00:24:35 +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 uB30OYB8002034; Sat, 3 Dec 2016 00:24:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30OY7G002033; Sat, 3 Dec 2016 00:24:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612030024.uB30OY7G002033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 3 Dec 2016 00:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309451 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:24:35 -0000 Author: pfg Date: Sat Dec 3 00:24:34 2016 New Revision: 309451 URL: https://svnweb.freebsd.org/changeset/base/309451 Log: Document undocumented indent(1) options badp/nbadp, bs/nbs, and lc. Submitted by: Piotr Stefaniak Differential Revision: https://reviews.freebsd.org/D8690 Modified: head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sat Dec 3 00:18:38 2016 (r309450) +++ head/usr.bin/indent/indent.1 Sat Dec 3 00:24:34 2016 (r309451) @@ -30,7 +30,7 @@ .\" @(#)indent.1 8.1 (Berkeley) 7/1/93 .\" $FreeBSD$ .\" -.Dd August 3, 2016 +.Dd December 2, 2016 .Dt INDENT 1 .Os .Sh NAME @@ -41,6 +41,7 @@ .Op Ar input-file Op Ar output-file .Op Fl bacc | Fl nbacc .Op Fl bad | Fl nbad +.Op Fl badp | Fl nbadp .Op Fl bap | Fl nbap .Bk -words .Op Fl ei | Fl ei @@ -50,6 +51,7 @@ .Op Fl \&bc | Fl nbc .Op Fl \&bl .Op Fl \&br +.Op Fl bs | Fl nbs .Op Fl c Ns Ar n .Op Fl \&cd Ns Ar n .Bk -words @@ -143,6 +145,14 @@ is specified, a blank line is forced aft declarations. Default: .Fl nbad . +.It Fl badp , nbadp +This is vaguely similar to +.Fl bad +, except that it only applies to the first set of declarations +in a procedure (just after the first `{') and it causes a blank +line to be generated even if there are no declarations. +The default is +.Fl nbadp. .It Fl bap , nbap If .Fl bap @@ -182,6 +192,10 @@ if (...) { code } .Ed +.It Fl bs , nbs +Whether a blank should always be inserted after sizeof. +The default is +.Fl nbs. .It Fl c Ns Ar n The column in which comments on code start. The default is 33. @@ -324,6 +338,10 @@ The default is .It Fl l Ns Ar n Maximum length of an output line. The default is 78. +.It Fl lc Ns Ar n +Maximum length of an output line in a block comment. +The default is 0, which means to limit block comment lines in accordance with +.Fl l. .It Fl \&ldi Ns Ar n Specifies the indentation, in character positions, of local variable names From owner-svn-src-head@freebsd.org Sat Dec 3 01:14:22 2016 Return-Path: Delivered-To: svn-src-head@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 D1773C637FB; Sat, 3 Dec 2016 01:14:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABFC282E; Sat, 3 Dec 2016 01:14:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB31ELrH023261; Sat, 3 Dec 2016 01:14:21 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB31EL1P023258; Sat, 3 Dec 2016 01:14:21 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612030114.uB31EL1P023258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 3 Dec 2016 01:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309460 - in head: lib/libc/sys share/man/man3 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:14:22 -0000 Author: vangyzen Date: Sat Dec 3 01:14:21 2016 New Revision: 309460 URL: https://svnweb.freebsd.org/changeset/base/309460 Log: thr_set_name(): silently truncate the given name as needed Instead of failing with ENAMETOOLONG, which is swallowed by pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1 bytes. This is more likely what the user wants, and saves the caller from truncating it before the call (which was the only recourse). Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2) so the user might find the documentation for this behavior. Reviewed by: jilles MFC after: 3 days Sponsored by: Dell EMC Modified: head/lib/libc/sys/thr_set_name.2 head/share/man/man3/pthread_set_name_np.3 head/sys/kern/kern_thr.c Modified: head/lib/libc/sys/thr_set_name.2 ============================================================================== --- head/lib/libc/sys/thr_set_name.2 Sat Dec 3 01:10:45 2016 (r309459) +++ head/lib/libc/sys/thr_set_name.2 Sat Dec 3 01:14:21 2016 (r309460) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd December 2, 2016 .Dt THR_SET_NAME 2 .Os .Sh NAME @@ -43,37 +43,34 @@ .Sh DESCRIPTION The .Fn thr_set_name -sets the user-visible name for the kernel thread with the identifier +system call sets the user-visible name for the thread with the identifier .Va id -in the current process, to the NUL-terminated string +in the current process to the NUL-terminated string .Va name . +The name will be silently truncated to fit into a buffer of +.Dv MAXCOMLEN + 1 +bytes. The thread name can be seen in the output of the .Xr ps 1 and .Xr top 1 commands, in the kernel debuggers and kernel tracing facility outputs, -also in userland debuggers and program core files, as notes. +and in userland debuggers and program core files, as notes. .Sh RETURN VALUES If successful, .Fn thr_set_name -will return zero, otherwise \-1 is returned, and +returns zero; otherwise, \-1 is returned, and .Va errno is set to indicate the error. .Sh ERRORS The .Fn thr_set_name -operation may return the following errors: +system call may return the following errors: .Bl -tag -width Er .It Bq Er EFAULT The memory pointed to by the .Fa name argument is not valid. -.It Bq Er ENAMETOOLONG -The string pointed to by the -.Fa name -argument exceeds -.Dv MAXCOMLEN + 1 -bytes in length. .It Bq Er ESRCH The thread with the identifier .Fa id @@ -92,6 +89,6 @@ does not exist in the current process. .Xr ktr 9 .Sh STANDARDS The -.Fn thr_new -system call is non-standard and is used by +.Fn thr_set_name +system call is non-standard and is used by the .Lb libthr . Modified: head/share/man/man3/pthread_set_name_np.3 ============================================================================== --- head/share/man/man3/pthread_set_name_np.3 Sat Dec 3 01:10:45 2016 (r309459) +++ head/share/man/man3/pthread_set_name_np.3 Sat Dec 3 01:14:21 2016 (r309460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd December 2, 2016 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME @@ -35,18 +35,19 @@ .Sh SYNOPSIS .In pthread_np.h .Ft void -.Fn pthread_set_name_np "pthread_t tid" "const char *name" +.Fn pthread_set_name_np "pthread_t thread" "const char *name" .Sh DESCRIPTION The .Fn pthread_set_name_np -function sets internal name for thread specified by -.Fa tid -argument to string value specified by +function applies a copy of the given .Fa name -argument. +to the given +.Fa thread . .Sh ERRORS Because of the debugging nature of this function, all errors that may appear inside are silently ignored. +.Sh SEE ALSO +.Xr thr_set_name 2 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat Dec 3 01:10:45 2016 (r309459) +++ head/sys/kern/kern_thr.c Sat Dec 3 01:14:21 2016 (r309460) @@ -578,8 +578,11 @@ sys_thr_set_name(struct thread *td, stru error = 0; name[0] = '\0'; if (uap->name != NULL) { - error = copyinstr(uap->name, name, sizeof(name), - NULL); + error = copyinstr(uap->name, name, sizeof(name), NULL); + if (error == ENAMETOOLONG) { + error = copyin(uap->name, name, sizeof(name) - 1); + name[sizeof(name) - 1] = '\0'; + } if (error) return (error); } From owner-svn-src-head@freebsd.org Sat Dec 3 01:55:39 2016 Return-Path: Delivered-To: svn-src-head@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 BF23BC633A5; Sat, 3 Dec 2016 01:55:39 +0000 (UTC) (envelope-from loos@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 99DB01D8; Sat, 3 Dec 2016 01:55:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB31tc25039225; Sat, 3 Dec 2016 01:55:38 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB31tcUq039224; Sat, 3 Dec 2016 01:55:38 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612030155.uB31tcUq039224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 3 Dec 2016 01:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309461 - head/sys/dev/etherswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:55:39 -0000 Author: loos Date: Sat Dec 3 01:55:38 2016 New Revision: 309461 URL: https://svnweb.freebsd.org/changeset/base/309461 Log: Allow simultaneous access to switch device, there is no reason to prevent it. Remove bogus wrappers and use the kernel defaults. While here, use DEVMETHOD_END. Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/etherswitch.c Modified: head/sys/dev/etherswitch/etherswitch.c ============================================================================== --- head/sys/dev/etherswitch/etherswitch.c Sat Dec 3 01:14:21 2016 (r309460) +++ head/sys/dev/etherswitch/etherswitch.c Sat Dec 3 01:55:38 2016 (r309461) @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -45,19 +44,11 @@ #include "etherswitch_if.h" -#define BUFSIZE 1024 - struct etherswitch_softc { device_t sc_dev; - int sc_count; - struct cdev *sc_devnode; - struct sx sc_lock; }; -#define SWITCH_LOCK(sc) sx_xlock(&(sc)->sc_lock) -#define SWITCH_UNLOCK(sc) sx_xunlock(&(sc)->sc_lock) - static int etherswitch_probe(device_t); static int etherswitch_attach(device_t); static int etherswitch_detach(device_t); @@ -72,7 +63,7 @@ static device_method_t etherswitch_metho DEVMETHOD(device_attach, etherswitch_attach), DEVMETHOD(device_detach, etherswitch_detach), - { 0, 0 } + DEVMETHOD_END }; driver_t etherswitch_driver = { @@ -81,19 +72,11 @@ driver_t etherswitch_driver = { sizeof(struct etherswitch_softc), }; -static d_open_t etherswitchopen; -static d_close_t etherswitchclose; -static d_write_t etherswitchwrite; -static d_read_t etherswitchread; static d_ioctl_t etherswitchioctl; static struct cdevsw etherswitch_cdevsw = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE, - .d_open = etherswitchopen, - .d_close = etherswitchclose, - .d_read = etherswitchread, - .d_write = etherswitchwrite, .d_ioctl = etherswitchioctl, .d_name = "etherswitch", }; @@ -119,13 +102,11 @@ etherswitch_attach(device_t dev) struct etherswitch_softc *sc = (struct etherswitch_softc *)device_get_softc(dev); sc->sc_dev = dev; - sx_init(&sc->sc_lock, "etherswitch"); sc->sc_devnode = make_dev(ðerswitch_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "etherswitch%d", device_get_unit(dev)); if (sc->sc_devnode == NULL) { device_printf(dev, "failed to create character device\n"); - sx_destroy(&sc->sc_lock); return (ENXIO); } sc->sc_devnode->si_drv1 = sc; @@ -140,61 +121,11 @@ etherswitch_detach(device_t dev) if (sc->sc_devnode) destroy_dev(sc->sc_devnode); - sx_destroy(&sc->sc_lock); - - return (0); -} - -static int -etherswitchopen(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count > 0) { - SWITCH_UNLOCK(sc); - return (EBUSY); - } - - sc->sc_count++; - SWITCH_UNLOCK(sc); - - return (0); -} - -static int -etherswitchclose(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count == 0) { - SWITCH_UNLOCK(sc); - return (EINVAL); - } - - sc->sc_count--; - - if (sc->sc_count < 0) - panic("%s: etherswitch_count < 0!", __func__); - SWITCH_UNLOCK(sc); return (0); } static int -etherswitchwrite(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int -etherswitchread(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int etherswitchioctl(struct cdev *cdev, u_long cmd, caddr_t data, int flags, struct thread *td) { struct etherswitch_softc *sc = cdev->si_drv1; From owner-svn-src-head@freebsd.org Sat Dec 3 02:09:24 2016 Return-Path: Delivered-To: svn-src-head@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 648C7C63A14; Sat, 3 Dec 2016 02:09:24 +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 2E6C3A5C; Sat, 3 Dec 2016 02:09:24 +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 uB329NrU043255; Sat, 3 Dec 2016 02:09:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB329Ngb043254; Sat, 3 Dec 2016 02:09:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030209.uB329Ngb043254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309462 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:09:24 -0000 Author: ngie Date: Sat Dec 3 02:09:23 2016 New Revision: 309462 URL: https://svnweb.freebsd.org/changeset/base/309462 Log: Fix test coredump_phnum_test:coredump_phnum require.config specification The requirement is set via `atf_set "require.config" "allow_sysctl_side_effects"', not `atf_set "require.config" "allow_sysctl_side_effects"' X-MFC with: r308177 Pointyhat to: cmeyer Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 01:55:38 2016 (r309461) +++ head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:09:23 2016 (r309462) @@ -32,8 +32,8 @@ atf_test_case coredump_phnum cleanup coredump_phnum_head() { - atf_set "allow_sysctl_side_effects" "1" atf_set "descr" "More than 65534 segments" + atf_set "require.config" "allow_sysctl_side_effects" atf_set "require.progs" "readelf procstat" atf_set "require.user" "root" } From owner-svn-src-head@freebsd.org Sat Dec 3 02:17:51 2016 Return-Path: Delivered-To: svn-src-head@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 6E57BC63080; Sat, 3 Dec 2016 02:17:51 +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 3E1B91079; Sat, 3 Dec 2016 02:17:51 +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 uB32HosN047390; Sat, 3 Dec 2016 02:17:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32HoWZ047389; Sat, 3 Dec 2016 02:17:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030217.uB32HoWZ047389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309463 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:17:51 -0000 Author: ngie Date: Sat Dec 3 02:17:50 2016 New Revision: 309463 URL: https://svnweb.freebsd.org/changeset/base/309463 Log: Expect :coredump_phnum to fail The number of program headers on my system (GENERIC-NODEBUG) don't match the expected (hardcoded) number in the test PR: 215019 Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:09:23 2016 (r309462) +++ head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:17:50 2016 (r309463) @@ -39,6 +39,8 @@ coredump_phnum_head() } coredump_phnum_body() { + atf_expect_fail "the value parsed doesn't always match the value obtained on the running system; bug # 215019" + # Set up core dumping cat > coredump_phnum_restore_state.sh <<-EOF #!/bin/sh From owner-svn-src-head@freebsd.org Sat Dec 3 02:24:16 2016 Return-Path: Delivered-To: svn-src-head@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 8AF0CC634F9; Sat, 3 Dec 2016 02:24:16 +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 5AB86166F; Sat, 3 Dec 2016 02:24:16 +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 uB32OFTK051360; Sat, 3 Dec 2016 02:24:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32OFLd051359; Sat, 3 Dec 2016 02:24:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030224.uB32OFLd051359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309464 - head/tests/sys/acl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:24:16 -0000 Author: ngie Date: Sat Dec 3 02:24:15 2016 New Revision: 309464 URL: https://svnweb.freebsd.org/changeset/base/309464 Log: Expect 01:main to fail Changes were made to ZFS in the past year with respect to how ACLs are handled, causing failures in this test. Mark it TODO so (hopefully) someone more knowledgeable (like mav or trasz) will fix the code or the test. PR: 212323 Modified: head/tests/sys/acl/01.sh Modified: head/tests/sys/acl/01.sh ============================================================================== --- head/tests/sys/acl/01.sh Sat Dec 3 02:17:50 2016 (r309463) +++ head/tests/sys/acl/01.sh Sat Dec 3 02:24:15 2016 (r309464) @@ -81,7 +81,7 @@ perl $TESTDIR/run $TESTDIR/tools-nfs4-ps if [ $? -eq 0 ]; then echo "ok 3" else - echo "not ok 3" + echo "not ok 3 # TODO: fails due to ACL changes in ZFS; bug 212323" fi echo "ok 4" From owner-svn-src-head@freebsd.org Sat Dec 3 02:45:19 2016 Return-Path: Delivered-To: svn-src-head@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 DB26DC63314; Sat, 3 Dec 2016 02:45:19 +0000 (UTC) (envelope-from adrian@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 B5CE23F9; Sat, 3 Dec 2016 02:45:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB32jIhS059275; Sat, 3 Dec 2016 02:45:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32jI4L059273; Sat, 3 Dec 2016 02:45:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612030245.uB32jI4L059273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 3 Dec 2016 02:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309465 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:45:20 -0000 Author: adrian Date: Sat Dec 3 02:45:18 2016 New Revision: 309465 URL: https://svnweb.freebsd.org/changeset/base/309465 Log: [net80211] prepare for 11ac aware NICs that want to know per-vdev channel and centre frequencies. * ic_freq is the centre of the primary channel, not the centre of the HT40/HT80/etc channel. Add a method to access that. * Add a method to access the centre of the primary channel, including knowing the centre of the 5/10/20/40/80, versus the primary channel. Ie, it's the centre of the 40, 80, 160MHz channel. * Add a method to access the centre frequency of the secondary 80MHz channel - we don't support VHT yet, but when we do. * Add methods to access the current channel and the per-dev desired channel. Ideally drivers that do full offload with a per-vap channel configuration should use the vap channel, NOT ic_curchan. Non-offload drivers that require net80211 to change the channel should be accessing ic_curchan. Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Dec 3 02:24:15 2016 (r309464) +++ head/sys/net80211/ieee80211.c Sat Dec 3 02:45:18 2016 (r309465) @@ -1170,6 +1170,53 @@ ieee80211_add_channel_ht40(struct ieee80 } /* + * Fetch the center frequency for the primary channel. + */ +uint32_t +ieee80211_get_channel_center_freq(const struct ieee80211_channel *c) +{ + + return (c->ic_freq); +} + +/* + * Fetch the center frequency for the primary BAND channel. + * + * For 5, 10, 20MHz channels it'll be the normally configured channel + * frequency. + * + * For 40MHz, 80MHz, 160Mhz channels it'll the the centre of the + * wide channel, not the centre of the primary channel (that's ic_freq). + * + * For 80+80MHz channels this will be the centre of the primary + * 80MHz channel; the secondary 80MHz channel will be center_freq2(). + */ + +uint32_t +ieee80211_get_channel_center_freq1(const struct ieee80211_channel *c) +{ + + if (IEEE80211_IS_CHAN_HT40U(c)) { + return (c->ic_freq + 10); + } + if (IEEE80211_IS_CHAN_HT40D(c)) { + return (c->ic_freq - 10); + } + + return (c->ic_freq); +} + +/* + * For now, no 80+80 support; this is zero. + */ +uint32_t +ieee80211_get_channel_center_freq2(const struct ieee80211_channel *c) +{ + + return (0); +} + +/* * Adds channels into specified channel list (ieee[] array must be sorted). * Channels are already sorted. */ Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Dec 3 02:24:15 2016 (r309464) +++ head/sys/net80211/ieee80211_var.h Sat Dec 3 02:45:18 2016 (r309465) @@ -668,6 +668,9 @@ int ieee80211_add_channel(struct ieee802 uint8_t, uint16_t, int8_t, uint32_t, const uint8_t[]); int ieee80211_add_channel_ht40(struct ieee80211_channel[], int, int *, uint8_t, int8_t, uint32_t); +uint32_t ieee80211_get_channel_center_freq(const struct ieee80211_channel *); +uint32_t ieee80211_get_channel_center_freq1(const struct ieee80211_channel *); +uint32_t ieee80211_get_channel_center_freq2(const struct ieee80211_channel *); int ieee80211_add_channel_list_2ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); int ieee80211_add_channel_list_5ghz(struct ieee80211_channel[], int, int *, @@ -684,6 +687,10 @@ uint32_t ieee80211_mac_hash(const struct const uint8_t addr[IEEE80211_ADDR_LEN]); char ieee80211_channel_type_char(const struct ieee80211_channel *c); +#define ieee80211_get_current_channel(_ic) ((_ic)->ic_curchan) +#define ieee80211_get_home_channel(_ic) ((_ic)->ic_bsschan) +#define ieee80211_get_vap_desired_channel(_iv) ((_iv)->iv_des_chan) + void ieee80211_radiotap_attach(struct ieee80211com *, struct ieee80211_radiotap_header *th, int tlen, uint32_t tx_radiotap, From owner-svn-src-head@freebsd.org Sat Dec 3 02:47:43 2016 Return-Path: Delivered-To: svn-src-head@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 1B2AAC63487; Sat, 3 Dec 2016 02:47:43 +0000 (UTC) (envelope-from adrian@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 C68C19A6; Sat, 3 Dec 2016 02:47:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB32lflw059450; Sat, 3 Dec 2016 02:47:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32lfin059449; Sat, 3 Dec 2016 02:47:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612030247.uB32lfin059449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 3 Dec 2016 02:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309467 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:47:43 -0000 Author: adrian Date: Sat Dec 3 02:47:41 2016 New Revision: 309467 URL: https://svnweb.freebsd.org/changeset/base/309467 Log: [ath] use the correct AMPDU frame limit for the given node, rather than the global config. This is important in hostap, ibss, (11s at some magical future date, etc) where different nodes may have smaller limits. Oops! MFC after: 1 week Relnotes: Yes Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Sat Dec 3 02:47:16 2016 (r309466) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Dec 3 02:47:41 2016 (r309467) @@ -529,6 +529,29 @@ ath_compute_num_delims(struct ath_softc } /* + * XXX TODO: put into net80211 + */ +static int +ath_rx_ampdu_to_byte(char a) +{ + switch (a) { + case IEEE80211_HTCAP_MAXRXAMPDU_16K: + return 16384; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_32K: + return 32768; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_64K: + return 65536; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_8K: + default: + return 8192; + break; + } +} + +/* * Fetch the aggregation limit. * * It's the lowest of the four rate series 4ms frame length. @@ -540,6 +563,8 @@ static int ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf) { + struct ieee80211vap *vap = ni->ni_vap; + #define MS(_v, _f) (((_v) & _f) >> _f##_S) int amin = ATH_AGGR_MAXSIZE; int i; @@ -548,25 +573,15 @@ ath_get_aggr_limit(struct ath_softc *sc, if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE) amin = sc->sc_aggr_limit; + /* Check the vap configured transmit limit */ + amin = MIN(amin, ath_rx_ampdu_to_byte(vap->iv_ampdu_limit)); + /* * Check the HTCAP field for the maximum size the node has * negotiated. If it's smaller than what we have, cap it there. */ - switch (MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU)) { - case IEEE80211_HTCAP_MAXRXAMPDU_16K: - amin = MIN(amin, 16384); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_32K: - amin = MIN(amin, 32768); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_64K: - amin = MIN(amin, 65536); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_8K: - default: - amin = MIN(amin, 8192); - break; - } + amin = MIN(amin, ath_rx_ampdu_to_byte(MS(ni->ni_htparam, + IEEE80211_HTCAP_MAXRXAMPDU))); for (i = 0; i < ATH_RC_NUM; i++) { if (bf->bf_state.bfs_rc[i].tries == 0) From owner-svn-src-head@freebsd.org Sat Dec 3 03:13:33 2016 Return-Path: Delivered-To: svn-src-head@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 A4B54C605F9; Sat, 3 Dec 2016 03:13:33 +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 745F5237; Sat, 3 Dec 2016 03:13:33 +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 uB33DWZC072303; Sat, 3 Dec 2016 03:13:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB33DWtl072302; Sat, 3 Dec 2016 03:13:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030313.uB33DWtl072302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309472 - head/contrib/netbsd-tests/games X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:13:33 -0000 Author: ngie Date: Sat Dec 3 03:13:32 2016 New Revision: 309472 URL: https://svnweb.freebsd.org/changeset/base/309472 Log: Restore pathing for factor(1), which unnecessarily diverged in r278616 factor lives in /usr/games/, not /usr/bin, in NetBSD. The correct way to handle this is do on-the-fly manipulation of the test script via ATF_TESTS_SH_SED_, not by modify the pathing directly in the test script. This is being done to resolve an unnecessary conflict made when pulling back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10. No functional change MFC after: now Modified: head/contrib/netbsd-tests/games/t_factor.sh Modified: head/contrib/netbsd-tests/games/t_factor.sh ============================================================================== --- head/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:05:44 2016 (r309471) +++ head/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:13:32 2016 (r309472) @@ -37,7 +37,7 @@ expect() { atf_test_case overflow1 overflow1_head() { atf_set "descr" "Tests for overflow conditions" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } overflow1_body() { expect '8675309' '8675309: 8675309' @@ -56,7 +56,7 @@ atf_test_case loop1 loop1_head() { atf_set "descr" "Tests some cases that once locked the program" \ "in an infinite loop" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } loop1_body() { expect '2147483647111311' '2147483647111311: 3 3 3 131 607148331103' From owner-svn-src-head@freebsd.org Sat Dec 3 03:56:21 2016 Return-Path: Delivered-To: svn-src-head@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 F0542C63768; Sat, 3 Dec 2016 03:56:21 +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 BFD3F1A28; Sat, 3 Dec 2016 03:56:21 +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 uB33uKLk088463; Sat, 3 Dec 2016 03:56:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB33uKWx088462; Sat, 3 Dec 2016 03:56:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030356.uB33uKWx088462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309474 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:56:22 -0000 Author: ngie Date: Sat Dec 3 03:56:20 2016 New Revision: 309474 URL: https://svnweb.freebsd.org/changeset/base/309474 Log: Don't build :strvis_locale if VIS_NOLOCALE is undefined The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower in conditionally running the test instead of backporting the newer version of libc-vis MFC after: now Modified: head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_vis.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:15:09 2016 (r309473) +++ head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:56:20 2016 (r309474) @@ -144,6 +144,9 @@ ATF_TC_BODY(strunvis_hex, tc) } } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TC(strvis_locale); ATF_TC_HEAD(strvis_locale, tc) { @@ -172,6 +175,9 @@ ATF_TC_BODY(strvis_locale, tc) setlocale(LC_CTYPE, ol); free(ol); } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ ATF_TP_ADD_TCS(tp) { @@ -180,7 +186,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TP_ADD_TC(tp, strvis_locale); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ return atf_no_error(); } From owner-svn-src-head@freebsd.org Sat Dec 3 05:00:31 2016 Return-Path: Delivered-To: svn-src-head@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 336EAC4AA37; Sat, 3 Dec 2016 05:00:31 +0000 (UTC) (envelope-from kevans91@ksu.edu) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0043.outbound.protection.outlook.com [104.47.40.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A79131089; Sat, 3 Dec 2016 05:00:29 +0000 (UTC) (envelope-from kevans91@ksu.edu) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ksu.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7iXOC88RAQE3aeLhYCGKsvwhN2U2Akn5hqHnxeB1+aY=; b=qU97gb7TTZ/4SvD5Beaq9xybGC6jqc1FRyEoRCc/GmHaQSFxGNAtPvRehghuSE6TXM4HOMs4yFVtPDCX8jHhkNsLS+8obMS1Wa3TYiFk7a/bD0EuAjwFhdA7ZO+7LdOBPEhRfCLPg9UnjCXEcKfh6ai+6xKcFUzVXpANrR+kDuM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kevans91@ksu.edu; Received: from mail-yw0-f174.google.com (209.85.161.174) by CY1PR0501MB1324.namprd05.prod.outlook.com (10.160.226.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.5; Sat, 3 Dec 2016 04:45:09 +0000 Received: by mail-yw0-f174.google.com with SMTP id a10so228332472ywa.3; Fri, 02 Dec 2016 20:45:09 -0800 (PST) X-Gm-Message-State: AKaTC02tVK8Reyu+YeF+fMDoUaB15hmiYBrrodIieWpWKteuTrghCI7q06FQLx8CuK2EhxDjKC+wzodzT5zb6Q== X-Received: by 10.13.247.65 with SMTP id h62mr49054579ywf.56.1480740303642; Fri, 02 Dec 2016 20:45:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.5.12 with HTTP; Fri, 2 Dec 2016 20:44:43 -0800 (PST) In-Reply-To: <201612012220.uB1MKSbR054941@repo.freebsd.org> References: <201612012220.uB1MKSbR054941@repo.freebsd.org> From: Kyle Evans Date: Fri, 2 Dec 2016 22:44:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi To: "Kenneth D. Merry" CC: , , Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.161.174] X-ClientProxiedBy: BN3PR16CA0006.namprd16.prod.outlook.com (10.165.112.144) To CY1PR0501MB1324.namprd05.prod.outlook.com (10.160.226.141) X-MS-Office365-Filtering-Correlation-Id: 7cf0b403-6735-430e-a8d2-08d41b372969 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0501MB1324; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 3:Y1ik/7L7Rk/7BEGBPSavMJAAys7pU22+XkVyvR5SB/G1BoBHddDNvqydDhpAjKHTk/+OW7FNlalpq4oDkup4Z9xtB7RranlzXA+1RHD3sz4dDfKJBQjAD/+A3IZH59kC7t5SDuyxBaiQuX+/ssTPZ8AGB5DohvRl/AFIzhXJdeYBSr7jzAShAwQrqxVMc5yFVYvJbytKfbf4wH3HvBK3ExMGNPrsJl+/OE+41K/DLMDeGs2vzK7bV4utXSi4HbiWN+8EEzlU9ahjyuCmRPoDTA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 25:EDi8nsmejSesKBsmber8amS8XD82hQJKDjWp6bHkvRZRg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xl3ISvtFBpN4VrohoDKtAhKaj36HaBoqkM+C4dzT9wLGQkJvMhEQg1xtWaSOgh1sdqN+4M0z2yjGTX3H36YdqJzQ==; 20:2Ybv8gfUyF7DsIu768jHpox/wSCiaL9LJn0ijwBEF/DoR2LWrFxT8HcPn76d6iHOYAmD0+bAsOib6JjgfSmqWaIwReN9GTfBPNNe1CHVQNLQIye6BIBtlgnp08t9+6ekLF8FRVmTuNzAeqo7mmnIBqRY9XvuYFx70aCJYl2Aduj8ECrLyhbaue05WhcufvgA4fj1PwJLkOvYiTY8d3LZQV3eJAF9vY1Ta2jGxvQeofqruuCSOyc++V27UB2vubWZ0g+QPT0EqkQZROjL8Ko4FaOHbWY6S6VJDI2hPz5tz5mXMfz/k/Oj2YOZ+LCAt61oWaMsVUJ/wiyLDFdx/FkdN+xmVAEt5mGmWYzrsvbSSVtxDWb5hAYvIOpbwshLJJgXALAxjiCHBOFPU6Ni2Y60ilzsTOlaMfJbbKwKsdbJ/rB+QkNl/ipnJgOWS1edFDHYbXQtSX7lk7lErJwIosB86ziZ8YP5meRH2pW3qPSEZKiay2kZm09uC6xS8dGCjrJH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148); SRVR:CY1PR0501MB1324; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0501MB1324; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 4:YhB2alo8Y+ZMQM2udDBN4rdUfSQ5ikyTndXJZWz8DR07YgBjuuQQBwirDWlShSTbzcOA3/tby5gpRjuqjjITK+d74WZvgSZ3tTEnb1NCL8BELSOnBS8sMUTr1f1CAXhODsxXAaqmKed/nQmydXzaI6L5wuhJZfBBRmfrp0JkWa7XlyVdIILcKpLZkQ+8ZVO6oQajxFfGUhTHpuG2ZLJBx+fJuPT6wfxglP0ed2valQoz5EeXcgpHcEQE8DVFsw2RttaJeHkn+o4RQJC0AiSFcKDm8pT2FQV6JAw7V4Ik6l+tXDjB8/nDKPp0QwtIbYdSULF8s9nbruBgKNHZgDCOUpQ7356pAtNGVb44zf94sl/vpY7dA29nWc+Ie+pfzT3JMtljLyC0qwKS/RU2meYU7949THp+ucM3WTdx5W5abrBzz2OlytW0KhVaPwc10M9xNAVOD3P4XaMhS0FvnZwXqyajUi3/CAhtraXjtBUtURzi5cWs5vBgxsmlB0UM7Wi3zrACb1Gz4xTOKpKhRzbTQqaPbP5/7Frh4xhkM2enw7hd+sLLz0M+UMoP2E+TuNqOH4WsumoWZS8GYqnRjNM9qFILAlo/db5eDNR3z013Dzk+iu/y6OrG/v/XfvalD+OM2jeYqG8ykCzLRRWINaVabg== X-Forefront-PRVS: 0145758B1D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(13624006)(24454002)(377454003)(38730400001)(9896002)(68736007)(450100001)(122856001)(5820100001)(9686002)(69596002)(4326007)(90282001)(106356001)(105586002)(229853002)(97736004)(42186005)(8676002)(66066001)(92566002)(81156014)(86362001)(81166006)(50466002)(47776003)(61266001)(59536001)(55446002)(23676002)(305945005)(189998001)(89122001)(88552002)(39450400002)(63696999)(7736002)(2950100002)(3846002)(7846002)(54356999)(6116002)(50986999)(101416001)(6916009)(76176999)(75432002)(110136003)(2906002)(93516999)(61726006)(5660300001)(55456009); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0501MB1324; H:mail-yw0-f174.google.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: ksu.edu does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjA1MDFNQjEzMjQ7MjM6Q0RDeGZmMHQ1VytJQUR6cVplalo0VWlG?= =?utf-8?B?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K?= =?utf-8?Q?9H3xhQmZfG8bc=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 6:E6ASrq26vNz+H6Ogjg2bz+48gTsA0BitRyAG1glk/AdVbwtsrzFCt2NSupqZEmrpRgFY+65H1jbsmZVAgLtnf+hyf7L/YZbOGHrIm9Xa+AduxvL93EOH5MtGm4b3Rlw39YiMOgvDv+yeUZ8wWF8Al/VmVGYAorf1rgS1Y5ehpfqn/k6xH6lHErur5k4hHSuVfKjoP0h96pVe/22bH2tzMViyQaHyCaiYKCF5l0RDXEmM3CfSHsTakzOzhwBiId08/enth2FAKlgm/FybS1hcG2tL56fhsp+LQQH7oe9xJxVFU8DGX3x7mUCIdFplFckvWGR/QTMmCZfx43ny1BH9uoY0aT9R061LaY71sH9ziAczl47kYf7TBJob/7pG9h++uz2xKfQh262gXWbD2eCnWgpQd42zP4AT0gwC2M9OvW87qUlRe8QxX/kUOPpesEX93gD64yx+UiKCNnmpcLvoVA==; 5:2HQnJB4mRgNp0zSopWFlkQCzaEJ6baGKmKHR5eX6VYaGiWmZUCAEUUkRX/x2LAdVoAgdQx0eAne3PfHp3QuKPh7XKtOHs3MIiSDJMH4DBo47BNKlMGP/HHTG5Yb90iYXM4l12Cghq8OUTVYoq1dRGXfKZ3BUeOg9FIq1tbdePkw=; 24:AXLcKAHbnlO0/lY/SG9ZyP2GilpJR2hHw2ruUHYx21DIj1C12uflBJFfSBcavTRfC8J7xSN6ld/aYx/Tv5VoTcIQBdez016UK/ohwbDSeBc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 7:jj6RNO4WJMme3IIbS4AvV39CU4mNdahDjXONMAW4AsQ6rjcIh1/jTp4fFX90c3jINQFB3WmrXApE811jBeAvPASBqON5u5kIiFCHFGDtfHyEDozUSZpuM+BiLKMWTIiWCl7poL9YSSuAcCymvga+hLS2/ELeXoyRaGDaWfGJX0zwg6ivMpSBO8B742UPrWE2jsJVvqG69ubcbfLMNoH6C+SqTCMU/Ybe010XBJD5J8/+j8vDxntux6E+OODnxYBs/iG6voRNGiZa5ZFzOuMcOmfnLIksfSWDfD2buj1JZwflqhbZtgbc8HhXgUCi4qLZ4EBSMqIln12gDuqZAqVoD3nzgRGhyzPv1tFqXCETq3gGqyNIA9mg8F23f5F8yxSTFUEmFnl19x2689kxPbYtk2nWIsz0CnjLF3DmIPuZL01FmtFxjFC8v+qkIvI+ccnvixl73F6yhj3dE5XCr4IHxg==; 20:W8eynyrhVGjdD4iZDKNYTytJk/8lW4XI68PTt8n/NwC+lXDUe2G+Dfv1wmrgbXYi9ZujAD4f/2Ym/TNNTP9F0y70BlCAVySF6a9xGDHaGJlqKCAcMJcUAPA+p0IHteDXqBvjkqKAsUMtNhHXHdmKJ9aBOMc0g4C7xB2FRArDmC8= X-OriginatorOrg: ksu.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2016 04:45:09.7994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1324 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:00:31 -0000 On Thu, Dec 1, 2016 at 4:20 PM, Kenneth D. Merry wrote: > Author: ken > Date: Thu Dec 1 22:20:27 2016 > New Revision: 309374 > URL: https://svnweb.freebsd.org/changeset/base/309374 > > Log: > Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support. > > This adds support to camcontrol(8) and libcam(3) for getting and setting > the time on SCSI protocol drives. This is more commonly found on tape > drives, but is a SPC (SCSI Primary Commands) command, and may be found > on any device that speaks SCSI. > > The new camcontrol timestamp subcommand allows getting the current device > time or setting the time to the current system time or any arbitrary time. > > sbin/camcontrol/Makefile: > Add timestamp.c. > > sbin/camcontrol/camcontrol.8: > Document the new timestamp subcommand. > > sbin/camcontrol/camcontrol.c: > Add the timestamp subcommand to camcontrol. > > sbin/camcontrol/camcontrol.h: > Add the timestamp() function prototype. > > sbin/camcontrol/timestamp.c: > Timestamp setting and reporting functionality. > > sys/cam/scsi/scsi_all.c: > Add two new CCB building functions, scsi_set_timestamp() and > scsi_report_timestamp(). Also, add a new helper function, > scsi_create_timestamp(). > > sys/cam/scsi/scsi_all.h: > Add CDB and parameter data for the the set and report timestamp > commands. > > Add function declarations for the new CCB building and helper > functions. > > Submitted by: Sam Klopsch > Sponsored by: Spectra Logic > MFC After: 2 weeks > > Added: > head/sbin/camcontrol/timestamp.c (contents, props changed) > Modified: > head/sbin/camcontrol/Makefile > head/sbin/camcontrol/camcontrol.8 > head/sbin/camcontrol/camcontrol.c > head/sbin/camcontrol/camcontrol.h > head/sys/cam/scsi/scsi_all.c > head/sys/cam/scsi/scsi_all.h > > Modified: head/sbin/camcontrol/Makefile > ... > +timestamp(struct cam_device *device, int argc, char **argv, char *combinedopt, > + int retry_count, int timeout, int verbosemode __unused) > +{ > + int c; > + uint64_t ts; > + char *format_string = NULL; > + char *timestamp_string = NULL; > + int action = -1; > + int error = 0; > + int single_arg = 0; > + int do_utc = 0; > + > + if (action == TIMESTAMP_REPORT) { > + error = report_timestamp(device, &ts, retry_count, > + timeout); > + if (error != 0) { > + goto bailout; > + } else if (strcmp(format_string, MIL) == 0) { > + printf("Timestamp in milliseconds: %ju\n", > + (uintmax_t)ts); > + } else { > + char temp_timestamp_string[100]; > + time_t time_var = ts / 1000; Hi, FWIW: Building -CURRENT on mips.mips (w/ freebsd-wifi-build), mips-gcc gets upset at the above line with the following error: /wifi-build/src/sbin/camcontrol/timestamp.c: In function 'timestamp': /wifi-build/src/sbin/camcontrol/timestamp.c:459:25: error: 'ts' may be used uninitialized in this function [-Werror=maybe-uninitialized] time_t time_var = ts / 1000; I understand that this is a bogus error because at this point it pretty much *has* to be set by the report_timestamp call just prior, but is there a clean way to trick GCC into agreeing, or is it just a matter of explicitly initializing it to 0 before the report_timestamp call? Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Sat Dec 3 05:29:14 2016 Return-Path: Delivered-To: svn-src-head@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 06225C64544; Sat, 3 Dec 2016 05:29:14 +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 C9C921FD3; Sat, 3 Dec 2016 05:29:13 +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 uB35TC7e025017; Sat, 3 Dec 2016 05:29:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB35TCal025016; Sat, 3 Dec 2016 05:29:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612030529.uB35TCal025016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Dec 2016 05:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309476 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:29:14 -0000 Author: bdrewery Date: Sat Dec 3 05:29:12 2016 New Revision: 309476 URL: https://svnweb.freebsd.org/changeset/base/309476 Log: Create the /usr/lib/include symlink as relative. This ugly code is done to avoid assuming LIBDIR is 2 components deep. Reported by: jhb Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Dec 3 03:59:24 2016 (r309475) +++ head/include/Makefile Sat Dec 3 05:29:12 2016 (r309476) @@ -108,7 +108,7 @@ NEWVERS_SH= ${SYSDIR}/conf/newvers.sh PARAM_H= ${SYSDIR}/sys/param.h MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh -SYMLINKS+= ${INCLUDEDIR} ${LIBDIR}/include +SYMLINKS+= ${LIBDIR:C,[^/]+,..,g:C,^/,,}${INCLUDEDIR} ${LIBDIR}/include osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \ From owner-svn-src-head@freebsd.org Sat Dec 3 05:29:36 2016 Return-Path: Delivered-To: svn-src-head@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 99EF1C64622; Sat, 3 Dec 2016 05:29: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 4F6FE210; Sat, 3 Dec 2016 05:29:36 +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 uB35TZ5Q025120; Sat, 3 Dec 2016 05:29:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB35TZOe025117; Sat, 3 Dec 2016 05:29:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612030529.uB35TZOe025117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Dec 2016 05:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309478 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:29:36 -0000 Author: bdrewery Date: Sat Dec 3 05:29:35 2016 New Revision: 309478 URL: https://svnweb.freebsd.org/changeset/base/309478 Log: DIRDEPS_BUILD: Fix '/' in group names creating a bad cookie. This is reworking the change in r296585 but to still properly install the files. This limits the change to only the DIRDEPS_BUILD logic for what it considers the name of the staging set, which is what the cookie name is based off of. Sponsored by: Dell EMC Isilon MFC after: 1 week Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk head/share/mk/bsd.incs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Sat Dec 3 05:29:31 2016 (r309477) +++ head/share/mk/bsd.confs.mk Sat Dec 3 05:29:35 2016 (r309478) @@ -24,8 +24,8 @@ ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} ${group}DIR?= ${CONFDIR} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} _${group}CONFS= .for cnf in ${${group}} Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Sat Dec 3 05:29:31 2016 (r309477) +++ head/share/mk/bsd.files.mk Sat Dec 3 05:29:35 2016 (r309478) @@ -28,8 +28,8 @@ ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${SHAREMODE} ${group}DIR?= ${BINDIR} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} .if defined(NO_ROOT) .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Sat Dec 3 05:29:31 2016 (r309477) +++ head/share/mk/bsd.incs.mk Sat Dec 3 05:29:35 2016 (r309478) @@ -33,9 +33,9 @@ ${group}OWN?= ${BINOWN} ${group}GRP?= ${BINGRP} ${group}MODE?= ${NOBINMODE} ${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SYMLINKS_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP} _${group}INCS= .for header in ${${group}} From owner-svn-src-head@freebsd.org Sat Dec 3 05:29:33 2016 Return-Path: Delivered-To: svn-src-head@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 20EF8C64617; Sat, 3 Dec 2016 05:29:33 +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 C79051EE; Sat, 3 Dec 2016 05:29:32 +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 uB35TVx3025070; Sat, 3 Dec 2016 05:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB35TVDQ025067; Sat, 3 Dec 2016 05:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612030529.uB35TVDQ025067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Dec 2016 05:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309477 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:29:33 -0000 Author: bdrewery Date: Sat Dec 3 05:29:31 2016 New Revision: 309477 URL: https://svnweb.freebsd.org/changeset/base/309477 Log: Revert r296585. This broke installing dtrace test files. It was poorly tested. Reported by: markj Pointyhat to: bdrewery MFC after: 1 week Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk head/share/mk/bsd.incs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Sat Dec 3 05:29:12 2016 (r309476) +++ head/share/mk/bsd.confs.mk Sat Dec 3 05:29:31 2016 (r309477) @@ -6,10 +6,8 @@ CONFGROUPS?= CONFS -_CONFGROUPS= ${CONFGROUPS:C,[/*],_,g} - .if !target(buildconfig) -.for group in ${_CONFGROUPS} +.for group in ${CONFGROUPS} buildconfig: ${${group}} .endfor .endif @@ -19,7 +17,7 @@ all: buildconfig .endif .if !target(installconfig) -.for group in ${_CONFGROUPS} +.for group in ${CONFGROUPS} .if defined(${group}) && !empty(${group}) ${group}OWN?= ${SHAREOWN} Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Sat Dec 3 05:29:12 2016 (r309476) +++ head/share/mk/bsd.files.mk Sat Dec 3 05:29:31 2016 (r309477) @@ -9,9 +9,7 @@ ____: FILESGROUPS?= FILES -_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g:u} - -.for group in ${_FILESGROUPS} +.for group in ${FILESGROUPS} # Add in foo.yes and remove duplicates from all the groups ${${group}}:= ${${group}} ${${group}.yes} ${${group}}:= ${${group}:O:u} @@ -22,7 +20,7 @@ buildfiles: ${${group}} all: buildfiles .endif -.for group in ${_FILESGROUPS} +.for group in ${FILESGROUPS} .if defined(${group}) && !empty(${group}) installfiles: installfiles-${group} Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Sat Dec 3 05:29:12 2016 (r309476) +++ head/share/mk/bsd.incs.mk Sat Dec 3 05:29:31 2016 (r309477) @@ -8,8 +8,6 @@ INCSGROUPS?= INCS -_INCSGROUPS= ${INCSGROUPS:C,[/*],_,g} - .if defined(NO_ROOT) .if !defined(TAGS) || ! ${TAGS:Mpackage=*} TAGS+= package=${PACKAGE:Uruntime} @@ -18,7 +16,7 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif .if !target(buildincludes) -.for group in ${_INCSGROUPS} +.for group in ${INCSGROUPS} buildincludes: ${${group}} .endfor .endif @@ -28,7 +26,7 @@ all: buildincludes .endif .if !target(installincludes) -.for group in ${_INCSGROUPS} +.for group in ${INCSGROUPS} .if defined(${group}) && !empty(${group}) ${group}OWN?= ${BINOWN} From owner-svn-src-head@freebsd.org Sat Dec 3 05:38:45 2016 Return-Path: Delivered-To: svn-src-head@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 A2A87C648EF; Sat, 3 Dec 2016 05:38:45 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86F35AB1; Sat, 3 Dec 2016 05:38:45 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OHL00A00GVXHA00@mr11p00im-asmtp004.me.com>; Sat, 03 Dec 2016 05:38:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1480743503; bh=3Ob/M+uh5pIJ/jfWk1Ttzkuu1cFkPcBZvWK1Za5sk4E=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=uugDXZ983mPgfv2Hu3AgKOiuW3fY03k4zeBhzjfRhm1TL222tdMaYOAkr9dN7sH1h O4dvEv8+JJJsxp/2jtdTZpuW/gAIglFtv9BQmTuY/Vmncc31ALHXOoHnrH6/EhZ7Ws /FckjL4jwGRab8B4GraxVQcL3UmdI26dRuJwFvMjyTrfKYCuZDzojnYX9QZiO2MzF1 QbtO7DKHbW8HA7m6lxh5DJGJjzjZ5Kh3A0/yRlsWxefQsdePool2g5ddqNqJaKk8t9 d0IbMxY0rq3F40kzNoOUR1oVJC32VVf+sLOQWm3LTl8xKSOjTXqlAFsPc5dY6sUjHq jlGFn6Pn0/p2Q== Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OHL00EKOGZXBB30@mr11p00im-asmtp004.me.com>; Sat, 03 Dec 2016 05:38:23 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-03_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612030099 User-Agent: Microsoft-MacOutlook/f.1c.1.161117 Date: Fri, 02 Dec 2016 21:38:19 -0800 Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi From: Ravi Pokala Sender: "Pokala, Ravi" To: Kyle Evans , "Kenneth D. Merry" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi References: <201612012220.uB1MKSbR054941@repo.freebsd.org> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:38:45 -0000 -----Original Message----- > From: on behalf of Kyle Evans > Date: 2016-12-02, Friday at 20:44 > To: "Kenneth D. Merry" > Cc: , , > Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi > >> [...] >> + >> + if (action == TIMESTAMP_REPORT) { >> + error = report_timestamp(device, &ts, retry_count, >> + timeout); >> + if (error != 0) { >> + goto bailout; >> + } else if (strcmp(format_string, MIL) == 0) { >> + printf("Timestamp in milliseconds: %ju\n", >> + (uintmax_t)ts); >> + } else { >> + char temp_timestamp_string[100]; >> + time_t time_var = ts / 1000; > > Hi, > > FWIW: Building -CURRENT on mips.mips (w/ freebsd-wifi-build), > mips-gcc gets upset at the above line with the following error: > > /wifi-build/src/sbin/camcontrol/timestamp.c: In function 'timestamp': > /wifi-build/src/sbin/camcontrol/timestamp.c:459:25: error: 'ts' may be > used uninitialized in this function [-Werror=maybe-uninitialized] > time_t time_var = ts / 1000; Interesting. I just did a tinderbox build earlier this evening, and this wasn't reported. > I understand that this is a bogus error because at this point it > pretty much *has* to be set by the report_timestamp call just prior, > but is there a clean way to trick GCC into agreeing, or is it just a > matter of explicitly initializing it to 0 before the report_timestamp > call? Actually, it's a valid warning. While all paths to that point in timestamp() go through report_timestamp(), not all paths through report_timestamp() set *ts. Specifically, if cam_getccb() or cam_send_ccb() fail, or the request was not completed, report_timestamp() does 'goto bailout' without setting *ts. I'm disappointed that `clang' (on i386 and amd64) didn't notice this; I was under the impression `clang' did more of that type of deep path analysis than `gcc'. -Ravi (rpokala@) > Thanks, > > Kyle Evans From owner-svn-src-head@freebsd.org Sat Dec 3 14:26:59 2016 Return-Path: Delivered-To: svn-src-head@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 D83B0C64C15; Sat, 3 Dec 2016 14:26:59 +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 8DF0116B5; Sat, 3 Dec 2016 14:26:59 +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 uB3EQwiC041564; Sat, 3 Dec 2016 14:26:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3EQwTk041562; Sat, 3 Dec 2016 14:26:58 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612031426.uB3EQwTk041562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 3 Dec 2016 14:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309479 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 14:27:00 -0000 Author: avos Date: Sat Dec 3 14:26:58 2016 New Revision: 309479 URL: https://svnweb.freebsd.org/changeset/base/309479 Log: rsu: remove unused structures / variables. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 05:29:35 2016 (r309478) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 14:26:58 2016 (r309479) @@ -2937,9 +2937,6 @@ rsu_init(struct rsu_softc *sc) /* Ensure the mbuf queue is drained */ rsu_drain_mbufq(sc); - /* Init host async commands ring. */ - sc->cmdq.cur = sc->cmdq.next = sc->cmdq.queued = 0; - /* Reset power management state. */ rsu_write_1(sc, R92S_USB_HRPWM, 0); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 3 05:29:35 2016 (r309478) +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 3 14:26:58 2016 (r309479) @@ -625,8 +625,6 @@ struct r92s_add_ba_req { #define RSU_RX_LIST_COUNT 100 #define RSU_TX_LIST_COUNT 32 -#define RSU_HOST_CMD_RING_COUNT 32 - #define RSU_RXBUFSZ (8 * 1024) #define RSU_TXBUFSZ \ ((sizeof(struct r92s_tx_desc) + IEEE80211_MAX_LEN + 3) & ~3) @@ -700,27 +698,6 @@ struct rsu_tx_radiotap_header { struct rsu_softc; -struct rsu_host_cmd { - void (*cb)(struct rsu_softc *, void *); - uint8_t data[256]; -}; - -struct rsu_cmd_newstate { - enum ieee80211_state state; - int arg; -}; - -struct rsu_cmd_key { - struct ieee80211_key key; -}; - -struct rsu_host_cmd_ring { - struct rsu_host_cmd cmd[RSU_HOST_CMD_RING_COUNT]; - int cur; - int next; - int queued; -}; - enum { RSU_BULK_RX, RSU_BULK_TX_BE_BK, /* = WME_AC_BE/BK */ @@ -755,12 +732,9 @@ struct rsu_softc { struct mbufq sc_snd; device_t sc_dev; struct usb_device *sc_udev; - int (*sc_newstate)(struct ieee80211com *, - enum ieee80211_state, int); - struct usbd_interface *sc_iface; + struct timeout_task calib_task; struct task tx_task; - const uint8_t *qid2idx; struct mtx sc_mtx; int sc_ht; int sc_nendpoints; @@ -775,10 +749,8 @@ struct rsu_softc { uint8_t sc_rftype; int8_t sc_nrxstream; int8_t sc_ntxstream; - struct rsu_host_cmd_ring cmdq; struct rsu_data sc_rx[RSU_RX_LIST_COUNT]; struct rsu_data sc_tx[RSU_TX_LIST_COUNT]; - struct rsu_data *fwcmd_data; uint8_t cmd_seq; uint8_t rom[128]; struct usb_xfer *sc_xfer[RSU_N_TRANSFER]; From owner-svn-src-head@freebsd.org Sat Dec 3 14:41:55 2016 Return-Path: Delivered-To: svn-src-head@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 2E4D5C6438A; Sat, 3 Dec 2016 14:41:55 +0000 (UTC) (envelope-from kevlo@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 F21051FFE; Sat, 3 Dec 2016 14:41:54 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3EfspB046548; Sat, 3 Dec 2016 14:41:54 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3EfsHZ046547; Sat, 3 Dec 2016 14:41:54 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201612031441.uB3EfsHZ046547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 3 Dec 2016 14:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309480 - head/sys/dev/rtwn/rtl8192c/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 14:41:55 -0000 Author: kevlo Date: Sat Dec 3 14:41:53 2016 New Revision: 309480 URL: https://svnweb.freebsd.org/changeset/base/309480 Log: Fix logic error so the R92C_TDECTRL register value is updated correctly. Reviewed by: avos Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Sat Dec 3 14:26:58 2016 (r309479) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Sat Dec 3 14:41:53 2016 (r309480) @@ -333,9 +333,11 @@ void r92cu_init_tx_agg(struct rtwn_softc *sc) { struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); + uint32_t reg; - rtwn_setbits_4(sc, R92C_TDECTRL, - R92C_TDECTRL_BLK_DESC_NUM_M, uc->tx_agg_desc_num); + reg = rtwn_read_4(sc, R92C_TDECTRL); + reg = RW(reg, R92C_TDECTRL_BLK_DESC_NUM, uc->tx_agg_desc_num); + rtwn_write_4(sc, R92C_TDECTRL, reg); } void From owner-svn-src-head@freebsd.org Sat Dec 3 16:02:54 2016 Return-Path: Delivered-To: svn-src-head@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 7740EC65352; Sat, 3 Dec 2016 16:02:54 +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 381BB114A; Sat, 3 Dec 2016 16:02:54 +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 uB3G2r6o082339; Sat, 3 Dec 2016 16:02:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3G2r4e082338; Sat, 3 Dec 2016 16:02:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612031602.uB3G2r4e082338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 3 Dec 2016 16:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309481 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 16:02:54 -0000 Author: avos Date: Sat Dec 3 16:02:53 2016 New Revision: 309481 URL: https://svnweb.freebsd.org/changeset/base/309481 Log: rsu: fix frame processing in the Rx path (similar to r292207). - Fill in Rx radiotap header correctly (for every packet in a chain; not once per chain). - Fix rate / flags fields in Rx radiotap. - Add debug messages for discarded frames. - Pass received control (< sizeof(struct ieee80211_frame)) frames to net80211 (if allowed by device filter; cannot happen yet). Tested with Asus USB-N10. Differential Revision: https://reviews.freebsd.org/D5723 Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 14:41:53 2016 (r309480) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 16:02:53 2016 (r309481) @@ -219,7 +219,10 @@ static void rsu_rx_multi_event(struct rs #if 0 static int8_t rsu_get_rssi(struct rsu_softc *, int, void *); #endif -static struct mbuf * rsu_rx_frame(struct rsu_softc *, uint8_t *, int); +static struct mbuf * rsu_rx_copy_to_mbuf(struct rsu_softc *, + struct r92s_rx_stat *, int); +static struct ieee80211_node * rsu_rx_frame(struct rsu_softc *, struct mbuf *, + int8_t *); static struct mbuf * rsu_rx_multi_frame(struct rsu_softc *, uint8_t *, int); static struct mbuf * rsu_rxeof(struct usb_xfer *, struct rsu_data *); @@ -1827,64 +1830,76 @@ rsu_get_rssi(struct rsu_softc *sc, int r #endif static struct mbuf * -rsu_rx_frame(struct rsu_softc *sc, uint8_t *buf, int pktlen) +rsu_rx_copy_to_mbuf(struct rsu_softc *sc, struct r92s_rx_stat *stat, + int totlen) { struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; + struct mbuf *m; + uint32_t rxdw0; + int pktlen; + + rxdw0 = le32toh(stat->rxdw0); + if (__predict_false(rxdw0 & R92S_RXDW0_CRCERR)) { + RSU_DPRINTF(sc, RSU_DEBUG_RX, + "%s: RX flags error (CRC)\n", __func__); + goto fail; + } + + pktlen = MS(rxdw0, R92S_RXDW0_PKTLEN); + if (__predict_false(pktlen < sizeof (struct ieee80211_frame_ack))) { + RSU_DPRINTF(sc, RSU_DEBUG_RX, + "%s: frame is too short: %d\n", __func__, pktlen); + goto fail; + } + + m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); + if (__predict_false(m == NULL)) { + device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", + __func__); + goto fail; + } + + /* Finalize mbuf. */ + memcpy(mtod(m, uint8_t *), (uint8_t *)stat, totlen); + m->m_pkthdr.len = m->m_len = totlen; + + return (m); +fail: + counter_u64_add(ic->ic_ierrors, 1); + return (NULL); +} + +static struct ieee80211_node * +rsu_rx_frame(struct rsu_softc *sc, struct mbuf *m, int8_t *rssi_p) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_frame_min *wh; struct r92s_rx_stat *stat; uint32_t rxdw0, rxdw3; - struct mbuf *m; uint8_t rate; int infosz; - stat = (struct r92s_rx_stat *)buf; + stat = mtod(m, struct r92s_rx_stat *); rxdw0 = le32toh(stat->rxdw0); rxdw3 = le32toh(stat->rxdw3); - if (__predict_false(rxdw0 & R92S_RXDW0_CRCERR)) { - counter_u64_add(ic->ic_ierrors, 1); - return NULL; - } - if (__predict_false(pktlen < sizeof(*wh) || pktlen > MCLBYTES)) { - counter_u64_add(ic->ic_ierrors, 1); - return NULL; - } - rate = MS(rxdw3, R92S_RXDW3_RATE); infosz = MS(rxdw0, R92S_RXDW0_INFOSZ) * 8; #if 0 /* Get RSSI from PHY status descriptor if present. */ if (infosz != 0) - *rssi = rsu_get_rssi(sc, rate, &stat[1]); + *rssi_p = rsu_get_rssi(sc, rate, &stat[1]); else - *rssi = 0; #endif - - RSU_DPRINTF(sc, RSU_DEBUG_RX, - "%s: Rx frame len=%d rate=%d infosz=%d\n", - __func__, pktlen, rate, infosz); - - m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); - if (__predict_false(m == NULL)) { - counter_u64_add(ic->ic_ierrors, 1); - return NULL; - } - /* Hardware does Rx TCP checksum offload. */ - if (rxdw3 & R92S_RXDW3_TCPCHKVALID) { - if (__predict_true(rxdw3 & R92S_RXDW3_TCPCHKRPT)) - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; - } - wh = (struct ieee80211_frame *)((uint8_t *)&stat[1] + infosz); - memcpy(mtod(m, uint8_t *), wh, pktlen); - m->m_pkthdr.len = m->m_len = pktlen; + *rssi_p = 0; if (ieee80211_radiotap_active(ic)) { struct rsu_rx_radiotap_header *tap = &sc->sc_rxtap; /* Map HW rate index to 802.11 rate. */ - tap->wr_flags = 2; - if (!(rxdw3 & R92S_RXDW3_HTC)) { + tap->wr_flags = 0; /* TODO */ + if (rate < 12) { switch (rate) { /* CCK. */ case 0: tap->wr_rate = 2; break; @@ -1901,7 +1916,7 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 case 10: tap->wr_rate = 96; break; case 11: tap->wr_rate = 108; break; } - } else if (rate >= 12) { /* MCS0~15. */ + } else { /* MCS0~15. */ /* Bit 7 set means HT MCS instead of rate. */ tap->wr_rate = 0x80 | (rate - 12); } @@ -1912,9 +1927,26 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 tap->wr_dbm_antsignal = rsu_hwrssi_to_rssi(sc, sc->sc_currssi); tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); + }; + + /* Hardware does Rx TCP checksum offload. */ + if (rxdw3 & R92S_RXDW3_TCPCHKVALID) { + if (__predict_true(rxdw3 & R92S_RXDW3_TCPCHKRPT)) + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; } - return (m); + /* Drop descriptor. */ + m_adj(m, sizeof(*stat) + infosz); + wh = mtod(m, struct ieee80211_frame_min *); + + RSU_DPRINTF(sc, RSU_DEBUG_RX, + "%s: Rx frame len %d, rate %d, infosz %d\n", + __func__, m->m_len, rate, infosz); + + if (m->m_len >= sizeof(*wh)) + return (ieee80211_find_rxnode(ic, wh)); + + return (NULL); } static struct mbuf * @@ -1925,6 +1957,13 @@ rsu_rx_multi_frame(struct rsu_softc *sc, int totlen, pktlen, infosz, npkts; struct mbuf *m, *m0 = NULL, *prevm = NULL; + /* + * don't pass packets to the ieee80211 framework if the driver isn't + * RUNNING. + */ + if (!sc->sc_running) + return (NULL); + /* Get the number of encapsulated frames. */ stat = (struct r92s_rx_stat *)buf; npkts = MS(le32toh(stat->rxdw2), R92S_RXDW2_PKTCNT); @@ -1950,7 +1989,7 @@ rsu_rx_multi_frame(struct rsu_softc *sc, break; /* Process 802.11 frame. */ - m = rsu_rx_frame(sc, buf, pktlen); + m = rsu_rx_copy_to_mbuf(sc, stat, totlen); if (m0 == NULL) m0 = m; if (prevm == NULL) @@ -1998,10 +2037,10 @@ rsu_bulk_rx_callback(struct usb_xfer *xf { struct rsu_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; struct ieee80211_node *ni; struct mbuf *m = NULL, *next; struct rsu_data *data; + int8_t rssi; RSU_ASSERT_LOCKED(sc); @@ -2016,10 +2055,6 @@ rsu_bulk_rx_callback(struct usb_xfer *xf /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - /* - * XXX TODO: if we have an mbuf list, but then - * we hit data == NULL, what now? - */ data = STAILQ_FIRST(&sc->sc_rx_inactive); if (data == NULL) { KASSERT(m == NULL, ("mbuf isn't NULL")); @@ -2035,18 +2070,16 @@ tr_setup: * ieee80211_input() because here is at the end of a USB * callback and safe to unlock. */ - RSU_UNLOCK(sc); while (m != NULL) { - int rssi; + next = m->m_next; + m->m_next = NULL; + + ni = rsu_rx_frame(sc, m, &rssi); /* Cheat and get the last calibrated RSSI */ rssi = rsu_hwrssi_to_rssi(sc, sc->sc_currssi); + RSU_UNLOCK(sc); - next = m->m_next; - m->m_next = NULL; - wh = mtod(m, struct ieee80211_frame *); - ni = ieee80211_find_rxnode(ic, - (struct ieee80211_frame_min *)wh); if (ni != NULL) { if (ni->ni_flags & IEEE80211_NODE_HT) m->m_flags |= M_AMPDU; @@ -2054,9 +2087,10 @@ tr_setup: ieee80211_free_node(ni); } else (void)ieee80211_input_all(ic, m, rssi, -96); + + RSU_LOCK(sc); m = next; } - RSU_LOCK(sc); break; default: /* needs it to the inactive queue due to a error. */ From owner-svn-src-head@freebsd.org Sat Dec 3 17:27:11 2016 Return-Path: Delivered-To: svn-src-head@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 979F2C65EA5; Sat, 3 Dec 2016 17:27:11 +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 676832B5; Sat, 3 Dec 2016 17:27:11 +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 uB3HRA5Q015531; Sat, 3 Dec 2016 17:27:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HRAak015530; Sat, 3 Dec 2016 17:27:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612031727.uB3HRAak015530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 3 Dec 2016 17:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309486 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:27:11 -0000 Author: avos Date: Sat Dec 3 17:27:10 2016 New Revision: 309486 URL: https://svnweb.freebsd.org/changeset/base/309486 Log: rtwn: fix bitmap size calculation. Tested with RTL8188CE, STA mode. Modified: head/sys/dev/rtwn/if_rtwnvar.h Modified: head/sys/dev/rtwn/if_rtwnvar.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnvar.h Sat Dec 3 17:17:42 2016 (r309485) +++ head/sys/dev/rtwn/if_rtwnvar.h Sat Dec 3 17:27:10 2016 (r309486) @@ -207,8 +207,8 @@ struct rtwn_softc { int vaps_running; int monvaps_running; - uint16_t next_rom_addr; - uint8_t keys_bmap[roundup2(RTWN_CAM_ENTRY_LIMIT, NBBY)]; + uint16_t next_rom_addr; + uint8_t keys_bmap[howmany(RTWN_CAM_ENTRY_LIMIT, NBBY)]; struct rtwn_vap *vaps[RTWN_PORT_COUNT]; struct ieee80211_node *node_list[RTWN_MACID_LIMIT]; From owner-svn-src-head@freebsd.org Sat Dec 3 17:44:45 2016 Return-Path: Delivered-To: svn-src-head@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 019B8C654EC; Sat, 3 Dec 2016 17:44:45 +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 D06981326; Sat, 3 Dec 2016 17:44:44 +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 uB3Hiia0023850; Sat, 3 Dec 2016 17:44:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HihuQ023838; Sat, 3 Dec 2016 17:44:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612031744.uB3HihuQ023838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 3 Dec 2016 17:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309490 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:44:45 -0000 Author: pfg Date: Sat Dec 3 17:44:43 2016 New Revision: 309490 URL: https://svnweb.freebsd.org/changeset/base/309490 Log: Revert r253678, r253661: Fix a segfault in ctfmerge(1) due to a bug in GCC. The change was correct and the bug real, but upstream didn't adopt it and we want to remain in sync. When/if upstream does something about it we can bring their version. The bug in question was fixed in GCC 4.9 which is now the default in FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2 platforms also has a workaround so no end-user should be harmed by the revert. Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat Dec 3 17:44:43 2016 (r309490) @@ -52,8 +52,6 @@ static char *curfile; #define CTF_BUF_CHUNK_SIZE (64 * 1024) #define RES_BUF_CHUNK_SIZE (64 * 1024) -static int ntypes = 0; /* The number of types. */ - struct ctf_buf { strtab_t ctb_strtab; /* string table */ caddr_t ctb_base; /* pointer to base of buffer */ @@ -1145,10 +1143,6 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_type = tdarr[ctm->ctm_type]; (*mpp)->ml_offset = ctm->ctm_offset; (*mpp)->ml_size = 0; - if (ctm->ctm_type > ntypes) { - parseterminate("Invalid member type ctm_type=%d", - ctm->ctm_type); - } } } else { for (i = 0, mpp = &tdp->t_members; i < vlen; @@ -1165,10 +1159,6 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_offset = (int)CTF_LMEM_OFFSET(ctlm); (*mpp)->ml_size = 0; - if (ctlm->ctlm_type > ntypes) { - parseterminate("Invalid lmember type ctlm_type=%d", - ctlm->ctlm_type); - } } } @@ -1282,10 +1272,9 @@ ctf_parse(ctf_header_t *h, caddr_t buf, { tdata_t *td = tdata_new(); tdesc_t **tdarr; + int ntypes = count_types(h, buf); int idx, i; - ntypes = count_types(h, buf); - /* shudder */ tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1)); tdarr[0] = NULL; Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Dec 3 17:44:43 2016 (r309490) @@ -159,7 +159,7 @@ typedef struct ardef { /* Auxiliary structure for structure/union tdesc_t */ typedef struct mlist { int ml_offset; /* Offset from start of structure (in bits) */ - uint_t ml_size; /* Member size (in bits) */ + int ml_size; /* Member size (in bits) */ char *ml_name; /* Member name */ struct tdesc *ml_type; /* Member type */ struct mlist *ml_next; /* Next member */ Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Dec 3 17:44:43 2016 (r309490) @@ -727,13 +727,6 @@ die_array_create(dwarf_t *dw, Dwarf_Die tdesc_t *dimtdp; int flags; - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (uval == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - uval = 0; - } - tdp->t_size = uval; /* @@ -826,12 +819,6 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d tdp->t_type = ENUM; (void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ); - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (uval == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - uval = 0; - } tdp->t_size = uval; if ((mem = die_child(dw, die)) != NULL) { @@ -945,7 +932,7 @@ static void die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, int type, const char *typename) { - Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0; + Dwarf_Unsigned sz, bitsz, bitoff; #if BYTE_ORDER == _LITTLE_ENDIAN Dwarf_Unsigned bysz; #endif @@ -1004,8 +991,6 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st ml->ml_name = NULL; ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type); - debug(3, "die_sou_create(): ml_type = %p t_id = %d\n", - ml->ml_type, ml->ml_type->t_id); if (die_mem_offset(dw, mem, DW_AT_data_member_location, &mloff, 0)) { @@ -1051,24 +1036,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st *mlastp = ml; mlastp = &ml->ml_next; - - /* Find the size of the largest member to work around a gcc - * bug. See GCC Bugzilla 35998. - */ - if (maxsz < ml->ml_size) - maxsz = ml->ml_size; - } while ((mem = die_sibling(dw, mem)) != NULL); - /* See if we got a bogus DW_AT_byte_size. GCC will sometimes - * emit this. - */ - if (sz == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - tdp->t_size = maxsz / 8; /* maxsz is in bits, t_size is bytes */ - } - /* * GCC will attempt to eliminate unused types, thus decreasing the * size of the emitted dwarf. That is, if you declare a foo_t in your @@ -1170,7 +1139,7 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t ** } if (ml->ml_size != 0 && mt->t_type == INTRINSIC && - mt->t_intr->intr_nbits != (int)ml->ml_size) { + mt->t_intr->intr_nbits != ml->ml_size) { /* * This member is a bitfield, and needs to reference * an intrinsic type with the same width. If the @@ -1486,13 +1455,6 @@ die_base_create(dwarf_t *dw, Dwarf_Die b */ (void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ); - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (sz == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - sz = 0; - } - if (tdp->t_name == NULL) terminate("die %llu: base type without name\n", off); Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Sat Dec 3 17:44:43 2016 (r309490) @@ -952,7 +952,7 @@ soudef(char *cp, stabtype_t type, tdesc_ itdp = find_intrinsic(tdp); if (itdp->t_type == INTRINSIC) { - if ((int)mlp->ml_size != itdp->t_intr->intr_nbits) { + if (mlp->ml_size != itdp->t_intr->intr_nbits) { parse_debug(4, cp, "making %d bit intrinsic " "from %s", mlp->ml_size, tdesc_name(itdp)); mlp->ml_type = bitintrinsic(itdp, mlp->ml_size); @@ -1173,7 +1173,7 @@ resolve_typed_bitfields_cb(void *arg, vo while (tdp) { switch (tdp->t_type) { case INTRINSIC: - if ((int)ml->ml_size != tdp->t_intr->intr_nbits) { + if (ml->ml_size != tdp->t_intr->intr_nbits) { debug(3, "making %d bit intrinsic from %s", ml->ml_size, tdesc_name(tdp)); ml->ml_type = bitintrinsic(tdp, ml->ml_size); From owner-svn-src-head@freebsd.org Sat Dec 3 17:54:09 2016 Return-Path: Delivered-To: svn-src-head@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 B3DA7C6573F; Sat, 3 Dec 2016 17:54:09 +0000 (UTC) (envelope-from rpokala@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 83542182B; Sat, 3 Dec 2016 17:54:09 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3Hs85s027953; Sat, 3 Dec 2016 17:54:08 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3Hs8W2027951; Sat, 3 Dec 2016 17:54:08 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201612031754.uB3Hs8W2027951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sat, 3 Dec 2016 17:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309491 - in head/sys/modules: . bios X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:54:09 -0000 Author: rpokala Date: Sat Dec 3 17:54:08 2016 New Revision: 309491 URL: https://svnweb.freebsd.org/changeset/base/309491 Log: Build smbios.ko as a module for amd64 and i386 For whatever reason, smapi, smbios, vpd are all under the "bios" directory. smapi is only for i386, so the entire "bios" directory is only built for i386. Break smapi out, and make only it i386-specific. Then, build the "bios" directory for both amd64 and i386. Reviewed by: imp MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D8609 Modified: head/sys/modules/Makefile head/sys/modules/bios/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Dec 3 17:44:43 2016 (r309490) +++ head/sys/modules/Makefile Sat Dec 3 17:54:08 2016 (r309491) @@ -550,6 +550,7 @@ _igb= igb _agp= agp _an= an _aout= aout +_bios= bios _bktr= bktr _bxe= bxe _cardbus= cardbus @@ -730,7 +731,6 @@ _svr4= svr4 .if ${MK_EISA} != "no" _ahb= ahb .endif -_bios= bios _cm= cm .if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau Modified: head/sys/modules/bios/Makefile ============================================================================== --- head/sys/modules/bios/Makefile Sat Dec 3 17:44:43 2016 (r309490) +++ head/sys/modules/bios/Makefile Sat Dec 3 17:54:08 2016 (r309491) @@ -1,6 +1,10 @@ # $FreeBSD$ # -SUBDIR= smapi smbios vpd +SUBDIR= smbios vpd + +.if ${MACHINE_ARCH} == "i386" +SUBDIR+= smapi +.endif .include From owner-svn-src-head@freebsd.org Sat Dec 3 19:03:41 2016 Return-Path: Delivered-To: svn-src-head@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 9C92FC6344F; Sat, 3 Dec 2016 19:03:41 +0000 (UTC) (envelope-from dteske@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 6C676E50; Sat, 3 Dec 2016 19:03:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3J3enJ057648; Sat, 3 Dec 2016 19:03:40 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3J3eq0057647; Sat, 3 Dec 2016 19:03:40 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201612031903.uB3J3eq0057647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 3 Dec 2016 19:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309504 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:03:41 -0000 Author: dteske Date: Sat Dec 3 19:03:40 2016 New Revision: 309504 URL: https://svnweb.freebsd.org/changeset/base/309504 Log: Fix bug preventing limits(1) from being applied PR: misc/212493 Differential Revision: https://reviews.freebsd.org/D8232 Submitted by: girgen Reviewed by: adrian MFC after: 3 days X-MFC-to: stable/11 Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Dec 3 19:03:25 2016 (r309503) +++ head/etc/rc.subr Sat Dec 3 19:03:40 2016 (r309504) @@ -1045,6 +1045,7 @@ run_rc_command() # check_startmsgs && echo "Starting ${name}." if [ -n "$_chroot" ]; then + _cd= _doit="\ ${_nice:+nice -n $_nice }\ ${_fib:+setfib -F $_fib }\ @@ -1052,8 +1053,8 @@ ${_env:+env $_env }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else + _cd="${_chdir:+cd $_chdir && }" _doit="\ -${_chdir:+cd $_chdir && }\ ${_fib:+setfib -F $_fib }\ ${_env:+env $_env }\ $command $rc_flags $command_args" @@ -1072,7 +1073,7 @@ $command $rc_flags $command_args" fi # Prepend default limits - _doit="limits -C $_login_class $_doit" + _doit="$_cd limits -C $_login_class $_doit" # run the full command # From owner-svn-src-head@freebsd.org Sat Dec 3 20:12:57 2016 Return-Path: Delivered-To: svn-src-head@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 689E0C651A6 for ; Sat, 3 Dec 2016 20:12:57 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wj0-x22b.google.com (mail-wj0-x22b.google.com [IPv6:2a00:1450:400c:c01::22b]) (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 E45E51A1D for ; Sat, 3 Dec 2016 20:12:56 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wj0-x22b.google.com with SMTP id tg4so3522455wjb.1 for ; Sat, 03 Dec 2016 12:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lw6RGDeRXuN0KtgadeSCzICi5TByre7EBmLblUkBBhA=; b=C/0dKZnOC9GKg0f/AMpSf+21NSSXeopI6p/OFo2cjQh+D2YU3+RG1lepZulhycZsko 4CU/sJQxP6f7hTyLg96jmpmz8uKjJcQ/AULSxvCP0l59rUDF0OUTVhJc99JiIX3keA3o MuuT8ypM033AKniBx3/TZxVEMx7Lh+wE/GSovkF+P9Qr8U6ny8PeofmdlkxgDyx1MlRs Ljpkq28WO2i+YyVfw3psCLBk+js4oZQAXRAmZc9DO4v+/yftdDOPBEwvDx067IZ4wdKV hhX/eRmU+Hnj5VSs5h+twL3dEjMsjOcTRLJwQUl0v2aZfecWfBkJwFo7/7sEXrhxhhD8 BaQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lw6RGDeRXuN0KtgadeSCzICi5TByre7EBmLblUkBBhA=; b=ReBhRbzN+7bXrNsg3dhbvdh8CU54P/kyX9FPL3gaoksdhDcPXOHl/WxHriQNTEaWTQ 6Ud6jh53+aWbYQPgQlkXamdPZmGSCcQnT1qdCczySVezUxgxHUyY74h9mVJ4iBiHUQ4X QGdOtxgD9kVSg/0CHEWEHr/fv8FDfEJf4sFAdp66UzyBLTWB7jAH0cOmH1iXZt2mJVf1 C8PewzEuNYNoBoIqSYo1J0fQJebCwAJF4q8zqdOid7LeyVJHPN/M+v88niCSokYdVk9S dhNWnPRmhnDqX2GcRq37TWNruyNLDnqPIi/+mSZTrjj9bVEqknLDu7LerKzIOlPSDOj4 dl9A== X-Gm-Message-State: AKaTC03ChbqMzPPEEC5Vk2/+gdCp3RCpfmwTJJxf7z3LDqyVJfkAbY0vKojXLO8Do6LeGo9uGJuTHPDehXJ4yohP X-Received: by 10.194.0.43 with SMTP id 11mr43765066wjb.218.1480795975113; Sat, 03 Dec 2016 12:12:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.253.65 with HTTP; Sat, 3 Dec 2016 12:12:54 -0800 (PST) In-Reply-To: <201612020821.uB28L8s2000195@repo.freebsd.org> References: <201612020821.uB28L8s2000195@repo.freebsd.org> From: Oliver Pinter Date: Sat, 3 Dec 2016 21:12:54 +0100 Message-ID: Subject: Re: svn commit: r309400 - head/sys/dev/acpica To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , freebsd-acpi@freebsd.org Content-Type: multipart/mixed; boundary=f46d0421a85915aa600542c6ae3f X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:12:57 -0000 --f46d0421a85915aa600542c6ae3f Content-Type: text/plain; charset=UTF-8 On Fri, Dec 2, 2016 at 9:21 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Dec 2 08:21:08 2016 > New Revision: 309400 > URL: https://svnweb.freebsd.org/changeset/base/309400 > > Log: > Fix for endless recursion in the ACPI GPE handler during boot. > > When handling a GPE ACPI interrupt object the EcSpaceHandler() > function can be called which checks the EC_EVENT_SCI bit and then > recurse on the EcGpeQueryHandler() function. If there are multiple GPE > events pending the EC_EVENT_SCI bit will be set at the next call to > EcSpaceHandler() causing it to recurse again via the > EcGpeQueryHandler() function. This leads to a slow never ending > recursion during boot which prevents proper system startup, because > the EC_EVENT_SCI bit never gets cleared in this scenario. > > The behaviour is reproducible with the ALASKA AMI in combination with > a newer Skylake based mainboard in the following way: > > Enter BIOS and adjust the clock one hour forward. Save and exit the > BIOS. System fails to boot due to the above mentioned bug in > EcGpeQueryHandler() which was observed recursing multiple times. > > This patch adds a simple recursion guard to the EcGpeQueryHandler() > function and also also adds logic to detect if new GPE events occurred > during the execution of EcGpeQueryHandler() and then loop on this > function instead of recursing. > > Reviewed by: jhb > MFC after: 2 weeks > > Modified: > head/sys/dev/acpica/acpi_ec.c I have similar error since the latest BIOS update on my gigabyte H170N-Wifi board. The curiosity of the BIOS update was after upgrading to this version, there are no possibility to rollback to older version. The other weird thing, is that MFCing back this patch does not help. I get stucked lock in acmtx mutex, as you could see from the attached log. The other interesting is the ACPI error at boot time: [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) [1] cpu1: on acpi0 [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) (This error is on 10-STABLE.) > > Modified: head/sys/dev/acpica/acpi_ec.c > ============================================================================== > --- head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:15:52 2016 (r309399) > +++ head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:21:08 2016 (r309400) > @@ -613,16 +613,14 @@ EcCheckStatus(struct acpi_ec_softc *sc, > } > > static void > -EcGpeQueryHandler(void *Context) > +EcGpeQueryHandlerSub(struct acpi_ec_softc *sc) > { > - struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; > UINT8 Data; > ACPI_STATUS Status; > int retry; > char qxx[5]; > > ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); > - KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); > > /* Serialize user access with EcSpaceHandler(). */ > Status = EcLock(sc); > @@ -647,7 +645,6 @@ EcGpeQueryHandler(void *Context) > EC_EVENT_INPUT_BUFFER_EMPTY))) > break; > } > - sc->ec_sci_pend = FALSE; > if (ACPI_FAILURE(Status)) { > EcUnlock(sc); > device_printf(sc->ec_dev, "GPE query failed: %s\n", > @@ -678,6 +675,29 @@ EcGpeQueryHandler(void *Context) > } > } > > +static void > +EcGpeQueryHandler(void *Context) > +{ > + struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; > + int pending; > + > + KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); > + > + do { > + /* Read the current pending count */ > + pending = atomic_load_acq_int(&sc->ec_sci_pend); > + > + /* Call GPE handler function */ > + EcGpeQueryHandlerSub(sc); > + > + /* > + * Try to reset the pending count to zero. If this fails we > + * know another GPE event has occurred while handling the > + * current GPE event and need to loop. > + */ > + } while (!atomic_cmpset_int(&sc->ec_sci_pend, pending, 0)); > +} > + > /* > * The GPE handler is called when IBE/OBF or SCI events occur. We are > * called from an unknown lock context. > @@ -706,13 +726,14 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT > * It will run the query and _Qxx method later, under the lock. > */ > EcStatus = EC_GET_CSR(sc); > - if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { > + if ((EcStatus & EC_EVENT_SCI) && > + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { > CTR0(KTR_ACPI, "ec gpe queueing query handler"); > Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); > - if (ACPI_SUCCESS(Status)) > - sc->ec_sci_pend = TRUE; > - else > + if (ACPI_FAILURE(Status)) { > printf("EcGpeHandler: queuing GPE query handler failed\n"); > + atomic_store_rel_int(&sc->ec_sci_pend, 0); > + } > } > return (ACPI_REENABLE_GPE); > } > @@ -759,7 +780,8 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY > * we call it directly here since our thread taskq is not active yet. > */ > if (cold || rebooting || sc->ec_suspending) { > - if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { > + if ((EC_GET_CSR(sc) & EC_EVENT_SCI) && > + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { > CTR0(KTR_ACPI, "ec running gpe handler directly"); > EcGpeQueryHandler(sc); > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" --f46d0421a85915aa600542c6ae3f Content-Type: application/octet-stream; name="sysctl.lockup" Content-Disposition: attachment; filename="sysctl.lockup" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iw9nn1fp0 cHJvY3N0YXQgLWsKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICBQSUQgICAgVElEIENPTU0gICAg ICAgICAgICAgVEROQU1FICAgICAgICAgICBLU1RBQ0sgICAgICAgICAgICAgICAgICAgICAgIAo0 NzUzNiAxMDAxNDIgc3lzY3RsICAgICAgICAgICAtICAgICAgICAgICAgICAgIG1pX3N3aXRjaCBz bGVlcHFfc3dpdGNoIHNsZWVwcV9jYXRjaF9zaWduYWxzIHNsZWVwcV93YWl0X3NpZyBfc2xlZXAg QWNwaU9zQWNxdWlyZU11dGV4IEFjcGlVdEFjcXVpcmVNdXRleCBBY3BpRXhFbnRlckludGVycHJl dGVyIEFjcGlOc0V2YWx1YXRlIEFjcGlVdEV2YWx1YXRlT2JqZWN0IEFjcGlVdEV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pb3Muc3lz dGVtLm1ha2VyPSJHaWdhYnl0ZSBUZWNobm9sb2d5IENvLiwgTHRkLiIKc21iaW9zLnN5c3RlbS5w cm9kdWN0PSJIMTcwTi1XSUZJIgpzbWJpb3Muc3lzdGVtLnNlcmlhbD0iRGVmYXVsdCBzdHJpbmci CnNtYmlvcy5zeXN0ZW0udXVpZD0iWFhYWFhYWFgtWFhYWC1YWFhYLVhYWFgtWFhYWFhYWFhYWFhY IgpzbWJpb3Muc3lzdGVtLnZlcnNpb249IkRlZmF1bHQgc3RyaW5nIgpzbWJpb3MudmVyc2lvbj0i My4wIgo= --f46d0421a85915aa600542c6ae3f-- From owner-svn-src-head@freebsd.org Sat Dec 3 20:35:23 2016 Return-Path: Delivered-To: svn-src-head@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 F1983C6585A; Sat, 3 Dec 2016 20:35:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com [209.85.220.177]) (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 B4D858A9; Sat, 3 Dec 2016 20:35:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-qk0-f177.google.com with SMTP id x190so311862213qkb.0; Sat, 03 Dec 2016 12:35:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=yn+oPAz3nkAAxa+E2JTljMte2mt+eBgpUzwnUZtpArM=; b=KyrXUtccP/WwKfUl3uVaGwD8t+6vgJoGXeRMUMqdXoY1su9KL1O6DaB9TPwu/EuWNk 3UF3+2LglksMv9OcfuEs2sBDAT/drBGiAj+86GvWdsAEQqOBUuteC4mwixCT/+KDLK9d ngJV+XS0t/VRSYpA4wChyRNdduorCBdkU2JRx5FuoTE5jOCJeAa63x+i9H8qAbTbAo3+ PH+m+Q2WsBDdMUj/0NzhqJvDiZ63rFQOleX1rSwMQ+P+SBcMYUItekkB466YVcmalRTK 5yFcAYnTeIXiiW62XM1VIocwAPpuk43IndBPn7qu40KgvLqZnBbNyu9Icfq0GrRR4+wU K/YA== X-Gm-Message-State: AKaTC02uywxsh/nP5O9LJg7cl/q9CL9ObU6UfCyFrnI2yEdqQFvR+AcmuZC32+2YlIqZQg== X-Received: by 10.55.73.148 with SMTP id w142mr48616103qka.284.1480797322210; Sat, 03 Dec 2016 12:35:22 -0800 (PST) Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com. [209.85.220.178]) by smtp.gmail.com with ESMTPSA id b94sm5640467qkb.16.2016.12.03.12.35.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 12:35:21 -0800 (PST) Received: by mail-qk0-f178.google.com with SMTP id n204so311875983qke.2; Sat, 03 Dec 2016 12:35:21 -0800 (PST) X-Received: by 10.55.212.29 with SMTP id l29mr16206031qki.64.1480797321444; Sat, 03 Dec 2016 12:35:21 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.200.58.165 with HTTP; Sat, 3 Dec 2016 12:35:21 -0800 (PST) In-Reply-To: References: <201612012220.uB1MKSbR054941@repo.freebsd.org> From: Conrad Meyer Date: Sat, 3 Dec 2016 12:35:21 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi To: Ravi Pokala Cc: Kyle Evans , "Kenneth D. Merry" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:35:24 -0000 On Fri, Dec 2, 2016 at 9:38 PM, Ravi Pokala wrote: > -----Original Message----- >> From: on behalf of Kyle Evans >> >> I understand that this is a bogus error because at this point it >> pretty much *has* to be set by the report_timestamp call just prior, >> but is there a clean way to trick GCC into agreeing, or is it just a >> matter of explicitly initializing it to 0 before the report_timestamp >> call? > > Actually, it's a valid warning. While all paths to that point in timestam= p() go through report_timestamp(), not all paths through report_timestamp()= set *ts. Specifically, if cam_getccb() or cam_send_ccb() fail, or the requ= est was not completed, report_timestamp() does 'goto bailout' without setti= ng *ts. But in that case, report_timestamp() returns a non-zero error. And timestamp() will goto its own bailout, avoiding use of an unset value. > I'm disappointed that `clang' (on i386 and amd64) didn't notice this; I w= as under the impression `clang' did more of that type of deep path analysis= than `gcc'. I think it's purely spurious, although understandably difficult for the compiler to notice. Adrian's proposed zero initialization seems like a fine fix. Best, Conrad From owner-svn-src-head@freebsd.org Sat Dec 3 20:35:40 2016 Return-Path: Delivered-To: svn-src-head@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 E0C72C65896; Sat, 3 Dec 2016 20:35:40 +0000 (UTC) (envelope-from adrian@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 AA6B99B6; Sat, 3 Dec 2016 20:35:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3KZdNg006250; Sat, 3 Dec 2016 20:35:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3KZd4I006249; Sat, 3 Dec 2016 20:35:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612032035.uB3KZd4I006249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 3 Dec 2016 20:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309513 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:35:41 -0000 Author: adrian Date: Sat Dec 3 20:35:39 2016 New Revision: 309513 URL: https://svnweb.freebsd.org/changeset/base/309513 Log: [camcontrol] init ts=0 to quieten gcc. It "looks" like ts is set to something on success, and not modified on error. Checked on IRC with: cem Modified: head/sbin/camcontrol/timestamp.c Modified: head/sbin/camcontrol/timestamp.c ============================================================================== --- head/sbin/camcontrol/timestamp.c Sat Dec 3 20:30:25 2016 (r309512) +++ head/sbin/camcontrol/timestamp.c Sat Dec 3 20:35:39 2016 (r309513) @@ -328,7 +328,7 @@ timestamp(struct cam_device *device, int int retry_count, int timeout, int verbosemode __unused) { int c; - uint64_t ts; + uint64_t ts = 0; char *format_string = NULL; char *timestamp_string = NULL; int action = -1; From owner-svn-src-head@freebsd.org Sat Dec 3 20:56:38 2016 Return-Path: Delivered-To: svn-src-head@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 4B99BC652BE for ; Sat, 3 Dec 2016 20:56:38 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wj0-x230.google.com (mail-wj0-x230.google.com [IPv6:2a00:1450:400c:c01::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 D514A1AD8 for ; Sat, 3 Dec 2016 20:56:37 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wj0-x230.google.com with SMTP id xy5so259405664wjc.0 for ; Sat, 03 Dec 2016 12:56:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=c9tgLfAwCsk+jZyVV08/glFWKvxX/XLm51SIL24rUQc=; b=08v7eieoDDdYgR0D9FxMMtk1u66dNDRXIO3RbuS0S52fKvYo8Jrq4+pgOxBZNLYmyM dbJerj1F360W43YE1KTl1PUt4O5bM39hT7PsW3tnKyB7rd98/3QXu6d5MG/jXTZCtgE4 kgfvCRc0edoh633xRpkL8emJ2NWYgign8Fbn5jdh8xy0nymcOdpbV82+DRADdxhKdRMW 7pIZ2Q19rRxNABHq7rYFphmiuCudDPjxVubJ5Vxn9QTo3ZeoWqzkD63cTA8Izsp4mwRi qyityhf6gSAhBlVqks+OI2CjPtB7Cr8X+3bDsj13QW6WzW3S/in6cJMOhwou0myXKEsS anDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=c9tgLfAwCsk+jZyVV08/glFWKvxX/XLm51SIL24rUQc=; b=kWdx9FSNprurWDKdwd6edCltl6XZEhlaphiy+99B8fnWRv9Po6vP91K3kynLaD04Or KMPuJJdFdmTR6VT5Yc2k63Os84qTjWdx7CaQdo9o39+PjIpNsIg01TMXDSe+2p3iQdI3 Sy1MtEU6IJuD/PRs79ousq3vpincuz1VGM6BYxsA96Ncgiya4e7RMsE31MpYOxlOuKpA 47phjD+y7vTwX7Iz3t8Ck7EBLtNIhYye7BG6Rb+U6edZIlqDBtQC7ltrSMulYjahy4ir I5wZBn6lHiUWAjGfVAouj8e1q0EpEDCA6qiwwaIxVcbQTHmX/aYyV+UIBpapLHnRMu37 8BhQ== X-Gm-Message-State: AKaTC02rQJUl49QZLyaN3hOQKdqLeJE9PxJrft5FgGEXHo7SLm7C7ARg7fLzZNWlWApD0GRsCC2oe0HJf5D8+/20 X-Received: by 10.194.87.103 with SMTP id w7mr19891736wjz.164.1480798596207; Sat, 03 Dec 2016 12:56:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.253.65 with HTTP; Sat, 3 Dec 2016 12:56:35 -0800 (PST) In-Reply-To: References: <201612020821.uB28L8s2000195@repo.freebsd.org> From: Oliver Pinter Date: Sat, 3 Dec 2016 21:56:35 +0100 Message-ID: Subject: Re: svn commit: r309400 - head/sys/dev/acpica To: Hans Petter Selasky , jkim@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , freebsd-acpi@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:56:38 -0000 On 12/3/16, Oliver Pinter wrote: > On Fri, Dec 2, 2016 at 9:21 AM, Hans Petter Selasky > wrote: >> Author: hselasky >> Date: Fri Dec 2 08:21:08 2016 >> New Revision: 309400 >> URL: https://svnweb.freebsd.org/changeset/base/309400 >> >> Log: >> Fix for endless recursion in the ACPI GPE handler during boot. >> >> When handling a GPE ACPI interrupt object the EcSpaceHandler() >> function can be called which checks the EC_EVENT_SCI bit and then >> recurse on the EcGpeQueryHandler() function. If there are multiple GPE >> events pending the EC_EVENT_SCI bit will be set at the next call to >> EcSpaceHandler() causing it to recurse again via the >> EcGpeQueryHandler() function. This leads to a slow never ending >> recursion during boot which prevents proper system startup, because >> the EC_EVENT_SCI bit never gets cleared in this scenario. >> >> The behaviour is reproducible with the ALASKA AMI in combination with >> a newer Skylake based mainboard in the following way: >> >> Enter BIOS and adjust the clock one hour forward. Save and exit the >> BIOS. System fails to boot due to the above mentioned bug in >> EcGpeQueryHandler() which was observed recursing multiple times. >> >> This patch adds a simple recursion guard to the EcGpeQueryHandler() >> function and also also adds logic to detect if new GPE events occurred >> during the execution of EcGpeQueryHandler() and then loop on this >> function instead of recursing. >> >> Reviewed by: jhb >> MFC after: 2 weeks >> >> Modified: >> head/sys/dev/acpica/acpi_ec.c > > > I have similar error since the latest BIOS update on my gigabyte > H170N-Wifi board. The curiosity of the BIOS update was after upgrading > to this version, there are no possibility to rollback to older > version. > > The other weird thing, is that MFCing back this patch does not help. I > get stucked lock in acmtx mutex, as you > could see from the attached log. The other interesting is the ACPI > error at boot time: > > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > [1] cpu1: on acpi0 > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > > (This error is on 10-STABLE.) > After backported the last to ACPICA update to 10-STABLE with this patch, the issue reducated to this warning message: [1] acpi0: Power Button (fixed) [1] ACPI Error: Method parse/execution failed [\134_SB.PCI0.IOTR._CRS] (Node 0xfffff80006592f00), AE_AML_NO_RESOURCE_END_TAG (20161117/psparse-560) [1] ACPI Error: Method execution failed [\134_SB.PCI0.IOTR._CRS] (Node 0xfffff80006592f00), AE_AML_NO_RESOURCE_END_TAG (20161117/uteval-111) [1] can't fetch resources for \134_SB_.PCI0.IOTR - AE_AML_NO_RESOURCE_END_TAG but the lockup has gone. ;) [trim] From owner-svn-src-head@freebsd.org Sat Dec 3 21:04:38 2016 Return-Path: Delivered-To: svn-src-head@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 BE86BC65562; Sat, 3 Dec 2016 21:04:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com [209.85.220.177]) (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 8ED531FD5; Sat, 3 Dec 2016 21:04:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-qk0-f177.google.com with SMTP id x190so312223642qkb.0; Sat, 03 Dec 2016 13:04:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=hz4bFkgWpl+6hl+KIX5t9qHHbsSozmddU7I6lJcqP8o=; b=CNY3masU/hXEHMWG/euvoh5keDAjnTzHRebMibpwUOhJIZsDBHtVqrmmhEnAZa3S6Y IOrwJddjJlxmIQeYwQB1DoRu3nbgSMgzq8y3nbITmhbpv6x0kUUB04lE8218TeeslnSO 4kBIAFuBiDKoWXY/4q1XN+ngeotM4Z4TDd5CJ/To/EvXHihOTLvZ1pMatgNFW3seBmUz Z4Wc2nUVnXX47DTig6guPb+kI0cSbdV+/V6JBQjJd/+AmoukO/Duv86K/LnV/coVRpxA hTYCTIVs7qA33sphazqu4WuVacKsuIS6zB6JSW9Uj816ZEsC+HlmpzHRKNffOTIWKr+f o0Nw== X-Gm-Message-State: AKaTC00SJJIxlRZmRkjISG7iSHiPPVMJrjB/6YKgYuQqZt/igd0FPJOcx/3lRRXmQp31pA== X-Received: by 10.55.4.19 with SMTP id 19mr44047005qke.18.1480795339128; Sat, 03 Dec 2016 12:02:19 -0800 (PST) Received: from mail-qt0-f181.google.com (mail-qt0-f181.google.com. [209.85.216.181]) by smtp.gmail.com with ESMTPSA id i41sm5617175qtc.18.2016.12.03.12.02.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 12:02:19 -0800 (PST) Received: by mail-qt0-f181.google.com with SMTP id p16so281182433qta.0; Sat, 03 Dec 2016 12:02:18 -0800 (PST) X-Received: by 10.237.53.119 with SMTP id b52mr50076675qte.74.1480795338721; Sat, 03 Dec 2016 12:02:18 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.200.58.165 with HTTP; Sat, 3 Dec 2016 12:02:18 -0800 (PST) In-Reply-To: <201612030209.uB329Ngb043254@repo.freebsd.org> References: <201612030209.uB329Ngb043254@repo.freebsd.org> From: Conrad Meyer Date: Sat, 3 Dec 2016 12:02:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309462 - head/tests/sys/kern To: Ngie Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:04:38 -0000 On Fri, Dec 2, 2016 at 6:09 PM, Ngie Cooper wrote: > Author: ngie > Date: Sat Dec 3 02:09:23 2016 > New Revision: 309462 > URL: https://svnweb.freebsd.org/changeset/base/309462 > > Log: > Fix test coredump_phnum_test:coredump_phnum require.config specification > > The requirement is set via `atf_set "require.config" "allow_sysctl_side_effects"', > not `atf_set "require.config" "allow_sysctl_side_effects"' > > X-MFC with: r308177 > Pointyhat to: cmeyer Ngie, This line was added verbatim at your request: https://reviews.freebsd.org/D7264?id=18609#inline-43800 Conrad From owner-svn-src-head@freebsd.org Sat Dec 3 21:26:35 2016 Return-Path: Delivered-To: svn-src-head@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 A243AC65E72; Sat, 3 Dec 2016 21:26:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (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 71E101192; Sat, 3 Dec 2016 21:26:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id 3so11690498pgd.0; Sat, 03 Dec 2016 13:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tDmEFVxZhNEgMSqbwc3Cmmnz+M/yQCetK9cM2Ef8vW8=; b=qlMY2EG1kASJ8rM1Yc+gZ3U40UFjP0DtOKdR7Miv+SPdGGIN+fSsvpPqHsU+bC6BVr ROT0YFwl2HZWf2L4EpLEr2pvnGa5TQ2Du2XgbNIPIsQfUelpiscKUYFLvA2loGpYfX7W eG8nVFK3KpTPqdeSHRdV0VtA3UoRPBoSlNgwNhkmSh6q4jQRMaZqV7ICyT53nDTyqns3 iIjY4SkiRPcKPQGl/ADXnCqKGgelsho84ztkOU/TPsJYGBOWqQwbGhzYS45GVGOhHawW bsk2noDWSRJX800HUUFg/rkaXF5QNxhAOYuXaiFcBYyQnhkRKRZcljnIySxZGAVXteGI FRCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tDmEFVxZhNEgMSqbwc3Cmmnz+M/yQCetK9cM2Ef8vW8=; b=dC+sr1p4Jmyf2SavhYFLzfFY4j9MQfiJM67d5MAJfXe0Fc/FN4jwoNs4ojXCpKMrHX uIsH+dv6Mv8Ti84H76pg0BEnYuacP4QShzidKfa5LsTRDTITL06/OvUGmIiBpJvZLkxe dZnvRbBJ+bYXfo1nJvp7cEfaMp9nVhOK6o/qsMuVqfa1WIPynZYJpqJg8lLNnG8v8lEu HaKXemVbCkr5f05zi2UXjNPRQRw14IbOL6ZilDiwTVhT63776zzOiItCozF/Y4LMu3/O Ip/AI7D2dQq2M9UxUZ+S02FbSPwZ79+R6oB+I0Im6P53y6JJ3uf2zNRjq91Ex+v5dfTr yymA== X-Gm-Message-State: AKaTC03cdjQyT78daveWN6j2C+hnrcp3+Bgbvxf6q3b64EoH5T907rpttB4dBopKQvui4w== X-Received: by 10.98.108.3 with SMTP id h3mr50832530pfc.65.1480800394750; Sat, 03 Dec 2016 13:26:34 -0800 (PST) Received: from [192.168.50.73] (50-251-209-113-static.hfc.comcastbusiness.net. [50.251.209.113]) by smtp.gmail.com with ESMTPSA id x2sm16835999pfx.65.2016.12.03.13.26.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 13:26:34 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r309462 - head/tests/sys/kern From: Ngie Cooper X-Mailer: iPhone Mail (14B100) In-Reply-To: Date: Sat, 3 Dec 2016 13:26:33 -0800 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201612030209.uB329Ngb043254@repo.freebsd.org> To: cem@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:26:35 -0000 > On Dec 3, 2016, at 12:02, Conrad Meyer wrote: >=20 >> On Fri, Dec 2, 2016 at 6:09 PM, Ngie Cooper wrote: >> Author: ngie >> Date: Sat Dec 3 02:09:23 2016 >> New Revision: 309462 >> URL: https://svnweb.freebsd.org/changeset/base/309462 >>=20 >> Log: >> Fix test coredump_phnum_test:coredump_phnum require.config specification= >>=20 >> The requirement is set via `atf_set "require.config" "allow_sysctl_side_= effects"', >> not `atf_set "require.config" "allow_sysctl_side_effects"' >>=20 >> X-MFC with: r308177 >> Pointyhat to: cmeyer >=20 > Ngie, >=20 > This line was added verbatim at your request: > https://reviews.freebsd.org/D7264?id=3D18609#inline-43800 Ok, I'll take that part of the pointhat. -Ngie= From owner-svn-src-head@freebsd.org Sat Dec 3 21:48:34 2016 Return-Path: Delivered-To: svn-src-head@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 7B1EDC65691; Sat, 3 Dec 2016 21:48:34 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (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 53CFD1E13; Sat, 3 Dec 2016 21:48:34 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x243.google.com with SMTP id j92so15063533ioi.0; Sat, 03 Dec 2016 13:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=fx37WjlRZqnwcZRXfsHGWHf6rzEk3cEUL8dDEq3VSdg=; b=HiOWtzBbK7E2oa7ldk2lTwZz1/BxWUF+/jsPX7Nraa1bF8J48KL0zRnC+d+sditWPQ RMupSsp825g53Dyw8okvE0UNthwddIf5eo38Fc/Bcjz8j3iP1iQy26vUnf8YrQ+XHecR nn74qb/2Z0iprNhhd8Tzjo83HL3aO9QSvnKOynppaCPwRyB7v00wT0XS9NxBlh5OlSzJ WkQZJ3piM182KC4sWVAMnhMY/RpTIj7meJLAs7jdwApsLcIs/J/W71GB4dMsep2BmKzk oH663J48WwbYJK0NaVSXdt/5eUg67IpsOeK0I847ABknNlMxMB9uzlsfMRlS9YkUOOtb Q2Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=fx37WjlRZqnwcZRXfsHGWHf6rzEk3cEUL8dDEq3VSdg=; b=RLyBxJdRoMzTncNsBlOtSOimhvAnmltdKwg1q1clTzZtNDqg2ao61YbjPxIKPXY/cb WLGe0I46h4fd5TukA9l7rDXM0As3SW1YZO9+LQPYIpszk0e3tqdVom3Y9JP+LLlgYfeH x2pROBD70dXAWtQ+GXWpxnzMNJnpU1NZYy0BuUPtIKoIBCW4U9NEqc79kmltrYHoWiQN 1wELiqLYLjNYEySGH1yhgMyeE4Te9eD3QxrxNORR5+FlseodpYkd358gRghwv67wfC6r YHzturflHKGwS92LT+djjJbiLZJT8caLIuMm4GGCoWLG0XU1ZhgK2LxZikwRZxKFuxUX +KVA== X-Gm-Message-State: AKaTC016DRszXBjfTwc/I+dB0D1YDHcZD/piPSSdqukPerSXGg4PwSuad8GgdaBxigkU87jgyaZ52sYmRtaElw== X-Received: by 10.107.164.35 with SMTP id n35mr8483977ioe.171.1480801713585; Sat, 03 Dec 2016 13:48:33 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.128.164 with HTTP; Sat, 3 Dec 2016 13:48:33 -0800 (PST) In-Reply-To: <201612020930.uB29UDQR031063@repo.freebsd.org> References: <201612020930.uB29UDQR031063@repo.freebsd.org> From: Antoine Brodin Date: Sat, 3 Dec 2016 22:48:33 +0100 X-Google-Sender-Auth: yhTBbdfPXvLP_kxRjHkIq447qMo Message-ID: Subject: Re: svn commit: r309405 - head/contrib/libarchive/libarchive To: Martin Matuska Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:48:34 -0000 On Fri, Dec 2, 2016 at 10:30 AM, Martin Matuska wrote: > Author: mm > Date: Fri Dec 2 09:30:13 2016 > New Revision: 309405 > URL: https://svnweb.freebsd.org/changeset/base/309405 > > Log: > MFV r309403: > > Sync libarchive with vendor. > > Vendor bugfixes: > Fix for heap-buffer-overflow in archive_le16dec() > Fix for heap-buffer-overflow in uudecode_bidder_bid() > Reworked fix for compatibility with archives created by Perl Archive::Tar > > MFC after: 1 week Hi, There are still ports failing to extract (logs are ipv6 only): http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/logs/errors/jakarta-commons-logging-1.2.log http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/logs/errors/activemq-5.14.1.log http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/logs/errors/hadoop2-2.7.2_1.log Please request an exp-run before updating libarchive. Cheers, Antoine