From owner-svn-src-all@freebsd.org Sun May 15 00:01:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F160BB3BE4C; Sun, 15 May 2016 00:01: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 BB9CE1FDC; Sun, 15 May 2016 00:01: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 u4F01NMk095153; Sun, 15 May 2016 00:01:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F01NqL095152; Sun, 15 May 2016 00:01:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150001.u4F01NqL095152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299802 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:01:25 -0000 Author: ngie Date: Sun May 15 00:01:23 2016 New Revision: 299802 URL: https://svnweb.freebsd.org/changeset/base/299802 Log: Fix up both r299764 and r299770 nitems was wrong too, as it was being tested against a pointer instead of a buffer on the stack. Since the old code was just doing malloc, then strlcpy'ing the contents of the source buffer into the destination buffer, replace it all with a call to strdup.. Reported by: bde MFC after: 1 week X-MFC with: r299764, r299770 Supersized Duncecap to: ngie Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 23:50:44 2016 (r299801) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sun May 15 00:01:23 2016 (r299802) @@ -251,7 +251,7 @@ add_filename(struct snmp_toolinfo *snmpt return (0); } - if ((fstring = malloc(strlen(filename) + 1)) == NULL) { + if ((fstring = strdup(filename)) == NULL) { warnx("malloc() failed - %s", strerror(errno)); return (-1); } @@ -264,7 +264,6 @@ add_filename(struct snmp_toolinfo *snmpt if (cut != NULL) asn_append_oid(&(entry->cut), cut); - strlcpy(fstring, filename, nitems(fstring)); entry->name = fstring; entry->done = done; SLIST_INSERT_HEAD(&snmptoolctx->filelist, entry, link); From owner-svn-src-all@freebsd.org Sun May 15 00:03:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C93BEB3BFA7; Sun, 15 May 2016 00:03:15 +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 A109C1410; Sun, 15 May 2016 00:03:15 +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 u4F03Etn097257; Sun, 15 May 2016 00:03:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F03Ev8097256; Sun, 15 May 2016 00:03:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605150003.u4F03Ev8097256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 May 2016 00:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299804 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:03:15 -0000 Author: adrian Date: Sun May 15 00:03:14 2016 New Revision: 299804 URL: https://svnweb.freebsd.org/changeset/base/299804 Log: [bwn] add the full suite of SPROM flags Obtained from: Linux b43 Modified: head/sys/dev/bwn/if_bwnreg.h Modified: head/sys/dev/bwn/if_bwnreg.h ============================================================================== --- head/sys/dev/bwn/if_bwnreg.h Sun May 15 00:02:55 2016 (r299803) +++ head/sys/dev/bwn/if_bwnreg.h Sun May 15 00:03:14 2016 (r299804) @@ -41,21 +41,60 @@ #define PCI_VENDOR_BROADCOM 0x14e4 #define PCI_VENDOR_LINKSYS 0x1737 -#define BWN_BFL_BTCOEXIST 0x0001 -#define BWN_BFL_PACTRL 0x0002 -#define BWN_BFL_RSSI 0x0008 -#define BWN_BFL_CRYSTAL_NOSLOW 0x0020 -#define BWN_BFL_FEM 0x0800 -#define BWN_BFL_EXTLNA 0x1000 -#define BWN_BFL_HGPA 0x2000 /* had high gain PA */ -#define BWN_BFL_BTCMOD 0x4000 -#define BWN_BFL_ALTIQ 0x8000 - -#define BWN_BFH_NOPA 0x0001 -#define BWN_BFH_RSSIINV 0x0002 -#define BWN_BFH_LDO_PAREF 0x0004 -#define BWN_BFH_FEM_BT 0x0040 +/* SPROM flags */ +#define BWN_BFL_BTCOEXIST 0x0001 /* implements Bluetooth coexistance */ +#define BWN_BFL_PACTRL 0x0002 /* GPIO 9 controlling the PA */ +#define BWN_BFL_AIRLINEMODE 0x0004 /* implements GPIO 13 radio disable indication */ +#define BWN_BFL_RSSI 0x0008 /* software calculates nrssi slope. */ +#define BWN_BFL_ENETSPI 0x0010 /* has ephy roboswitch spi */ +#define BWN_BFL_CRYSTAL_NOSLOW 0x0020 /* no slow clock available */ +#define BWN_BFL_CCKHIPWR 0x0040 /* can do high power CCK transmission */ +#define BWN_BFL_ENETADM 0x0080 /* has ADMtek switch */ +#define BWN_BFL_ENETVLAN 0x0100 /* can do vlan */ +#define BWN_BFL_AFTERBURNER 0x0200 /* supports Afterburner mode */ +#define BWN_BFL_NOPCI 0x0400 /* leaves PCI floating */ +#define BWN_BFL_FEM 0x0800 /* supports the Front End Module */ +#define BWN_BFL_EXTLNA 0x1000 /* has an external LNA */ +#define BWN_BFL_HGPA 0x2000 /* had high gain PA */ +#define BWN_BFL_BTCMOD 0x4000 /* BFL_BTCOEXIST is given in alternate GPIOs */ +#define BWN_BFL_ALTIQ 0x8000 /* alternate I/Q settings */ + +/* SPROM boardflags_hi values */ +#define BWN_BFH_NOPA 0x0001 /* has no PA */ +#define BWN_BFH_RSSIINV 0x0002 /* RSSI uses positive slope (not TSSI) */ +#define BWN_BFH_LDO_PAREF 0x0004 /* uses the PARef LDO */ +#define BWN_BFH_3TSWITCH 0x0008 /* uses a triple throw switch shared + * with bluetooth */ +#define BWN_BFH_PHASESHIFT 0x0010 /* can support phase shifter */ +#define BWN_BFH_BUCKBOOST 0x0020 /* has buck/booster */ +#define BWN_BFH_FEM_BT 0x0040 /* has FEM and switch to share antenna + * with bluetooth */ +#define BWN_BFH_NOCBUCK 0x0080 +#define BWN_BFH_PALDO 0x0200 +#define BWN_BFH_EXTLNA_5GHZ 0x1000 /* has an external LNA (5GHz mode) */ + +/* SPROM boardflags2_lo values */ +#define BWN_BFL2_RXBB_INT_REG_DIS 0x0001 /* external RX BB regulator present */ +#define BWN_BFL2_APLL_WAR 0x0002 /* alternative A-band PLL settings implemented */ +#define BWN_BFL2_TXPWRCTRL_EN 0x0004 /* permits enabling TX Power Control */ +#define BWN_BFL2_2X4_DIV 0x0008 /* 2x4 diversity switch */ +#define BWN_BFL2_5G_PWRGAIN 0x0010 /* supports 5G band power gain */ +#define BWN_BFL2_PCIEWAR_OVR 0x0020 /* overrides ASPM and Clkreq settings */ +#define BWN_BFL2_CAESERS_BRD 0x0040 /* is Caesers board (unused) */ +#define BWN_BFL2_BTC3WIRE 0x0080 /* used 3-wire bluetooth coexist */ +#define BWN_BFL2_SKWRKFEM_BRD 0x0100 /* 4321mcm93 uses Skyworks FEM */ +#define BWN_BFL2_SPUR_WAR 0x0200 /* has a workaround for clock-harmonic spurs */ +#define BWN_BFL2_GPLL_WAR 0x0400 /* altenative G-band PLL settings implemented */ +#define BWN_BFL2_SINGLEANT_CCK 0x1000 +#define BWN_BFL2_2G_SPUR_WAR 0x2000 + +/* SPROM boardflags2_hi values */ +#define BWN_BFH2_GPLL_WAR2 0x0001 +#define BWN_BFH2_IPALVLSHIFT_3P3 0x0002 +#define BWN_BFH2_INTERNDET_TXIQCAL 0x0004 +#define BWN_BFH2_XTALBUFOUTEN 0x0008 +/* SIBA control registers */ #define BWN_TGSLOW_PHYCLOCK_ENABLE 0x00040000 #define BWN_TGSLOW_PHYRESET 0x00080000 #define BWN_TMSLOW_MACPHYCLKEN 0x00100000 /* MAC PHY Clock Control Enable (rev >= 5) */ From owner-svn-src-all@freebsd.org Sun May 15 00:02:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE1E3B3BF8D; Sun, 15 May 2016 00:02:56 +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 8BA3012F3; Sun, 15 May 2016 00:02:56 +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 u4F02tin097200; Sun, 15 May 2016 00:02:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F02t9I097199; Sun, 15 May 2016 00:02:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150002.u4F02t9I097199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299803 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:02:56 -0000 Author: ngie Date: Sun May 15 00:02:55 2016 New Revision: 299803 URL: https://svnweb.freebsd.org/changeset/base/299803 Log: Replace malloc + memset(.., 0, ..) with calloc calls MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:01:23 2016 (r299802) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:02:55 2016 (r299803) @@ -268,13 +268,11 @@ enum_pair_insert(struct enum_pairs *head { struct enum_pair *e_new; - if ((e_new = malloc(sizeof(struct enum_pair))) == NULL) { + if ((e_new = calloc(1, sizeof(struct enum_pair))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); } - memset(e_new, 0, sizeof(struct enum_pair)); - if ((e_new->enum_str = malloc(strlen(enum_str) + 1)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); free(e_new); @@ -557,12 +555,11 @@ snmp_enumtc_init(char *name) { struct enum_type *enum_tc; - if ((enum_tc = malloc(sizeof(struct enum_type))) == NULL) { + if ((enum_tc = calloc(1, sizeof(struct enum_type))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (NULL); } - memset(enum_tc, 0, sizeof(struct enum_type)); if ((enum_tc->name = malloc(strlen(name) + 1)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); free(enum_tc); From owner-svn-src-all@freebsd.org Sun May 15 00:05:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7091B32090; Sun, 15 May 2016 00:05:29 +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 9792E1787; Sun, 15 May 2016 00:05:29 +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 u4F05SAL097380; Sun, 15 May 2016 00:05:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F05SOs097379; Sun, 15 May 2016 00:05:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150005.u4F05SOs097379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299805 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:05:29 -0000 Author: ngie Date: Sun May 15 00:05:28 2016 New Revision: 299805 URL: https://svnweb.freebsd.org/changeset/base/299805 Log: Fix up r299769 Similar to r299802, it was noted that using nitems on scalar pointers is invalid. Use strdup instead of malloc + strlcpy (which is what the old code was doing anyhow). MFC after: 1 week Pointyhat to: ngie Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:03:14 2016 (r299804) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:05:28 2016 (r299805) @@ -273,14 +273,13 @@ enum_pair_insert(struct enum_pairs *head return (-1); } - if ((e_new->enum_str = malloc(strlen(enum_str) + 1)) == NULL) { + if ((e_new->enum_str = strdup(enum_str)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); free(e_new); return (-1); } e_new->enum_val = enum_val; - strlcpy(e_new->enum_str, enum_str, nitems(e_new->enum_str)); STAILQ_INSERT_TAIL(headp, e_new, link); return (1); @@ -560,12 +559,11 @@ snmp_enumtc_init(char *name) return (NULL); } - if ((enum_tc->name = malloc(strlen(name) + 1)) == NULL) { + if ((enum_tc->name = strdup(name)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); free(enum_tc); return (NULL); } - strlcpy(enum_tc->name, name, nitems(enum_tc->name)); return (enum_tc); } From owner-svn-src-all@freebsd.org Sun May 15 00:07:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2049CB32158; Sun, 15 May 2016 00:07:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDB4E1982; Sun, 15 May 2016 00:07:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id m9so26292283ige.1; Sat, 14 May 2016 17:07:14 -0700 (PDT) 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=xbGL4WEWtKl2yid8WASdOOXOopvnddOUiJp8QTmzxh0=; b=ivPvLzbG9QEZCRcjWSf9hQQ3rpFqhDcy+xO7tt5i2A7+Eg0Csy79R0kR3SBDpxAeGf sm8lMUn5i2BtHfyqCIdsGDyepFL7HihDFZ9CkSYGj1e4FTN+poZcmkRKI59ezhnUvZAd TJ2w7O3FJP9rXnT0jJ0VeXZ1fsFPwsaQK/Jucg7lk/Kq4+L7v4kRDy60PyI88IUn3D62 iTqNFw7Y7iqqdTsrUihJVehtU76K5VxqrGg+CP8KH+bL6kiqefx4WzkVgM3yx/IdTkIT BREbsjOFXZgchpb+Q99BUNoYQJN39l4BC6ZvzFzhQ2kgiKYn+0jbNS4asLPO9aF7R3aS f9wQ== 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=xbGL4WEWtKl2yid8WASdOOXOopvnddOUiJp8QTmzxh0=; b=iWGronFCGPEXx8m0jRjFkf9co66Igg2eXq+pm0mFnXsBnCKJc9u0OxWIUtBUYHX6rt aq4BSeI5NfcC7Hqp7Xrs47+GOyelCVOd7nmgQP9SMHvNNq8Z/bKEgmb375WqcSgpi7HA JogcKOsRGz6LTmTbqYlETlocQJIh6qFal5pmx8HigNDcq1bvVD3eDsWMHUfOaMIAd4Dq RtVofL/uQb9n91alGQblQy0guuXzgcqc0f2G77IpWhyZbBaY8iaaYrN70PUUOegi1x73 uDW0MSBw09jQ3FJvoDACJjIKKZcOCnWcpc8sYLVvK2EPEUCufELXX93ImegaWko9oxI1 vxWA== X-Gm-Message-State: AOPr4FX10it/7DzYoA6A6UqnstXXiYx/70HQ6chwM3ShC1UP/70UhqDShEjMs9VZ78iLsA== X-Received: by 10.50.63.228 with SMTP id j4mr4815125igs.25.1463270834219; Sat, 14 May 2016 17:07:14 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id e101sm8369777iod.29.2016.05.14.17.07.13 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2016 17:07:13 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299770 - head/usr.sbin/bsnmpd/tools/libbsnmptools From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20160515093254.R2601@besplex.bde.org> Date: Sat, 14 May 2016 17:07:13 -0700 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <53C0F48B-50C4-4453-849E-B84DC5CC5D56@gmail.com> References: <201605142243.u4EMh75e071378@repo.freebsd.org> <20160515093254.R2601@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:07:15 -0000 > On May 14, 2016, at 16:42, Bruce Evans wrote: >=20 > On Sat, 14 May 2016, Garrett Cooper wrote: =E2=80=A6 > Er, this is pointier than before. nitems() is only valid on arrays. You=E2=80=99re 100% correct. I forgot that it isn=E2=80=99t a magic = silver bullet that works with scalar pointers :(=E2=80=A6 >> Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.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/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May = 14 22:40:35 2016 (r299769) >> +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May = 14 22:43:07 2016 (r299770) >> @@ -264,7 +264,7 @@ add_filename(struct snmp_toolinfo *snmpt >>=20 >> if (cut !=3D NULL) >> asn_append_oid(&(entry->cut), cut); >> - strlcpy(fstring, filename, sizeof(fstring)); >> + strlcpy(fstring, filename, nitems(fstring)); >=20 > fstring is pointer to char, so nitems(fstring) =3D sizeof(char *) / 1 > sizeof(char *) =3D accidentally the same wrong value as before. >=20 > The old code using strlen() had a chance of being correct. The old and new code was implementing strdup in a longhand way. I just = converted everything to strdup.= From owner-svn-src-all@freebsd.org Sun May 15 00:08:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF40BB321D7; Sun, 15 May 2016 00:08:10 +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 B1CFE1AEE; Sun, 15 May 2016 00:08:10 +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 u4F08998097512; Sun, 15 May 2016 00:08:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F089ie097511; Sun, 15 May 2016 00:08:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150008.u4F089ie097511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299806 - head/usr.sbin/bsnmpd/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:08:11 -0000 Author: ngie Date: Sun May 15 00:08:09 2016 New Revision: 299806 URL: https://svnweb.freebsd.org/changeset/base/299806 Log: Bump WARNS to 6 MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/Makefile.inc Modified: head/usr.sbin/bsnmpd/tools/Makefile.inc ============================================================================== --- head/usr.sbin/bsnmpd/tools/Makefile.inc Sun May 15 00:05:28 2016 (r299805) +++ head/usr.sbin/bsnmpd/tools/Makefile.inc Sun May 15 00:08:09 2016 (r299806) @@ -12,3 +12,5 @@ LIBBSNMPTOOLSDIR= ${.OBJDIR}/../lib LIBBSNMPTOOLSDIR= ${.CURDIR}/../libbsnmptools .endif LIBBSNMPTOOLS= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a + +WARNS?= 6 From owner-svn-src-all@freebsd.org Sun May 15 00:10:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75172B3225B; Sun, 15 May 2016 00:10:39 +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 29AA71CEE; Sun, 15 May 2016 00:10:39 +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 u4F0AcLO097646; Sun, 15 May 2016 00:10:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0AcMi097644; Sun, 15 May 2016 00:10:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150010.u4F0AcMi097644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299807 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:10:39 -0000 Author: ngie Date: Sun May 15 00:10:37 2016 New Revision: 299807 URL: https://svnweb.freebsd.org/changeset/base/299807 Log: Replace QUADFMT with %ju and QUADXFMT with %jx and cast values with uintmax_t This will cure some -Wformat warnings MFC after: 1 week Reported by: clang, gcc Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/config.c head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/contrib/bsnmp/snmpd/config.c ============================================================================== --- head/contrib/bsnmp/snmpd/config.c Sun May 15 00:08:09 2016 (r299806) +++ head/contrib/bsnmp/snmpd/config.c Sun May 15 00:10:37 2016 (r299807) @@ -823,7 +823,8 @@ parse_oid(const char *varname, struct as while (token == '.') { if (gettoken() == TOK_NUM) { if (numval > ASN_MAXID) - report("subid too large %#"QUADXFMT, numval); + report("subid too large %#jx", + (uintmax_t)numval); if (oid->len == ASN_MAXOIDLEN) report("index too long"); if (gettoken() != ':') @@ -878,7 +879,7 @@ parse_syntax_integer(struct snmp_value * if (token != TOK_NUM) report("bad INTEGER syntax"); if (numval > 0x7fffffff) - report("INTEGER too large %"QUADFMT, numval); + report("INTEGER too large %ju", (uintmax_t)numval); value->v.integer = numval; gettoken(); Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Sun May 15 00:08:09 2016 (r299806) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Sun May 15 00:10:37 2016 (r299807) @@ -27,7 +27,7 @@ DEFSDIR= ${SHAREDIR}/snmp/defs CFLAGS+= -DSNMPTREE_TYPES CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I. -DUSE_LIBBEGEMOT -CFLAGS+= -DUSE_TCPWRAPPERS -DQUADFMT='"llu"' -DQUADXFMT='"llx"' +CFLAGS+= -DUSE_TCPWRAPPERS CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR_H -DHAVE_STRLCPY LIBADD= begemot bsnmp wrap From owner-svn-src-all@freebsd.org Sun May 15 00:13:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94C01B32431; Sun, 15 May 2016 00:13:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (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 718A31097; Sun, 15 May 2016 00:13:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22d.google.com with SMTP id c3so4989363igl.0; Sat, 14 May 2016 17:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=Q709wp6DsjL1mZ2Xk0/mvZSasU2rtYgArHUGYBvKbFo=; b=FxHdUGRce+A0ItilnulUMMUZRTRt35PIpZXZEkyi1u+4NwOxpUpCmutE4Idy1W0vpX b3Na4OBRgJPRiRKXnMndtb/qlNEX2HNHhPvybm9OiRdZZqNu3nrkXJzJEix7Z5MFtPxm 3KOwfBRDwuqAzUm7DwuJAZMhDRyg0lTMYoY/xzxzF5U1zsRCr3q8B3Qe217b9eCheobf wOFqavT67V3aJOOzfvDsz/vXw1ebF61hUAZSVebhdXJaggPiL59gJCF18577DmzHFI5U Hy9mIewHe4tE1QhvUMPG4U/xegBPdtrle+LEtouQwVNakmEUMpoRzhsMD+Txw2TyeAVC bd5w== 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:date :message-id:subject:from:to; bh=Q709wp6DsjL1mZ2Xk0/mvZSasU2rtYgArHUGYBvKbFo=; b=lQSvh/QWdESu5KfHy8DY11qBoU1onlXATA/3VlwOvxaDI80uO7mOYgwKd2apQEHRtn DhbAZKqzAakRWJbe/L31beeq/dZizyZHHWTdBWPXkULK6eIXLKxiIIChKhpFkY7VzTRY 9j4qMmcybdqlvfATiB+Dlk6OEji65b6OvSClDfrZOFctlVyUFoU/kzGUNK7PsF/bxLpW c1/AEHZ6hoDteg2a5LZGe1FofX3FMu2igVaEl2+y3VS4ddFxig33xdkmsnh8LhmSI3+Y 6MeSGcQhrvl+3P2iX/QVXibi+dAm0nZAPxBgHlR64JEQuQxUyrPJHuIwlfOOzgAhKagp 1k8w== X-Gm-Message-State: AOPr4FUeIzfa75wHqsse3cVydFV8JtH5Z+T0RP7OdsU0Csc5OjSOo3qVkGVtL/9oLhg3ZY9xlaAuPP8Py/3a1g== MIME-Version: 1.0 X-Received: by 10.50.42.132 with SMTP id o4mr6594762igl.37.1463271215879; Sat, 14 May 2016 17:13:35 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Sat, 14 May 2016 17:13:35 -0700 (PDT) In-Reply-To: <201605150003.u4F03Ev8097256@repo.freebsd.org> References: <201605150003.u4F03Ev8097256@repo.freebsd.org> Date: Sat, 14 May 2016 17:13:35 -0700 X-Google-Sender-Auth: XB_JF8a2GLbnezkfZVdTt2-fgWU Message-ID: Subject: Re: svn commit: r299804 - head/sys/dev/bwn From: Adrian Chadd To: "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:13:36 -0000 [snip] ok, ok. I'm the bwn(4) maintainer. -adrian From owner-svn-src-all@freebsd.org Sun May 15 00:13:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBB72B32436; Sun, 15 May 2016 00:13:37 +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 A5AB81098; Sun, 15 May 2016 00:13:37 +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 u4F0Davn000483; Sun, 15 May 2016 00:13:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0Da2Q000482; Sun, 15 May 2016 00:13:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150013.u4F0Da2Q000482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299808 - head/contrib/bsnmp/snmp_usm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:13:38 -0000 Author: ngie Date: Sun May 15 00:13:36 2016 New Revision: 299808 URL: https://svnweb.freebsd.org/changeset/base/299808 Log: Use sizeof(..)s for the destination buffers instead of hardcoded values corresponding to the destination buffer sizes MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmp_usm/usm_snmp.c Modified: head/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- head/contrib/bsnmp/snmp_usm/usm_snmp.c Sun May 15 00:10:37 2016 (r299807) +++ head/contrib/bsnmp/snmp_usm/usm_snmp.c Sun May 15 00:13:36 2016 (r299808) @@ -262,7 +262,7 @@ op_usm_users(struct snmp_context *ctx, s if (ctx->scratch->ptr1 == NULL) return (SNMP_ERR_GENERR); memcpy(ctx->scratch->ptr1, uuser->suser.priv_key, - SNMP_PRIV_KEY_SIZ); + sizeof(uuser->suser.priv_key)); memcpy(uuser->suser.priv_key, val->v.octetstring.octets, val->v.octetstring.len); break; @@ -286,7 +286,7 @@ op_usm_users(struct snmp_context *ctx, s uuser->user_public_len = val->v.octetstring.len; } else { memset(uuser->user_public, 0, - SNMP_ADM_STR32_SIZ); + sizeof(uuser->user_public)); uuser->user_public_len = 0; } break; @@ -351,7 +351,7 @@ op_usm_users(struct snmp_context *ctx, s case LEAF_usmUserAuthKeyChange: case LEAF_usmUserOwnAuthKeyChange: memcpy(uuser->suser.auth_key, ctx->scratch->ptr1, - SNMP_AUTH_KEY_SIZ); + sizeof(uuser->suser.auth_key)); free(ctx->scratch->ptr1); break; case LEAF_usmUserPrivProtocol: @@ -360,7 +360,7 @@ op_usm_users(struct snmp_context *ctx, s case LEAF_usmUserPrivKeyChange: case LEAF_usmUserOwnPrivKeyChange: memcpy(uuser->suser.priv_key, ctx->scratch->ptr1, - SNMP_PRIV_KEY_SIZ); + sizeof(uuser->suser.priv_key)); free(ctx->scratch->ptr1); break; case LEAF_usmUserPublic: @@ -371,7 +371,7 @@ op_usm_users(struct snmp_context *ctx, s free(ctx->scratch->ptr2); } else { memset(uuser->user_public, 0, - SNMP_ADM_STR32_SIZ); + sizeof(uuser->user_public)); uuser->user_public_len = 0; } break; From owner-svn-src-all@freebsd.org Sun May 15 00:14:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BEADB32506; Sun, 15 May 2016 00:14:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (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 14BB51357; Sun, 15 May 2016 00:14:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x235.google.com with SMTP id i75so168009693ioa.3; Sat, 14 May 2016 17:14:27 -0700 (PDT) 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=PdNm6YoU91Dr0ZrjwFz7JsxW7Crv6tnpUpQOGKMcI54=; b=pT/00KwcRP0KJaxHTrtlKd8BtCWzrKC6mijj7ZFZNPdb1a8QyQ7QKZ8UUFC7gfixXC 4YA6/p4IBPxnGAIi8bkQ75vCfAVWTUnGCE9PznIS5ithMwbxjUqAIkiE8yzgL2X1TKkD HiX2FDgzHZlhYVIBmplTzbFaZeO4Rxdp7a044/dJyJxJbVmVWvVKj16PBuZvRi/zTyoh cF5Rl9t1jgQX1kroFDFNV7+dQtopFjfrzsBjF38NcVTAWGEqefUVQ3zBhG992Cu7hq3h y+JlOhfhFcI1j9VCLKhci7WbpcZ5ilacnd/Zu43A/Mljze+GEVhYGSHGttIF9vbaa+Vh A07w== 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=PdNm6YoU91Dr0ZrjwFz7JsxW7Crv6tnpUpQOGKMcI54=; b=IqkKUYDXpdOhEV8Y22B2x7i3hw4YRtIqS6JV7SkcKwN++ZD0nvvrzM28JLXu5W/5t9 kZLhZu3oqwYV3MjwHq56ToW6rxl+PZYbIbx3NX7aqDeu7aPw82vDs4d03pTl3nO6ZB1x X2ftOTqHtv9xcMjEoZcxrA88Z/1R/3F+DH6yKd4GrQ8RJ7govg+NuCtztTm+StLZiFYE 6ogdnSKTRKK5G+Uy78gzej72dY1dRsnLlzj3VWzej2h1fl7lVMKZVA6jFQosmbOfFSRN tMOXMy85pdA2yUB8TUWObyhbW9yw4BDgMAgNFif2+QzXUx/GjZmjqbGM/gMlNhOGGUat bB4A== X-Gm-Message-State: AOPr4FXPfiZHiwfXYeLgcEt4J0xdc8WvmOtU+G6w49T6QuCgEoxh/HlvhsWrh59KEBAI0w== X-Received: by 10.107.155.1 with SMTP id d1mr18417298ioe.62.1463271266663; Sat, 14 May 2016 17:14:26 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id vh5sm3216063igb.21.2016.05.14.17.14.25 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2016 17:14:26 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299804 - head/sys/dev/bwn From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Sat, 14 May 2016 17:14:25 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201605150003.u4F03Ev8097256@repo.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:14:27 -0000 > On May 14, 2016, at 17:13, Adrian Chadd wrote: >=20 > [snip] >=20 > ok, ok. I'm the bwn(4) maintainer. Please MFC changes back to stable/10=E2=80=A6 thanks!= From owner-svn-src-all@freebsd.org Sun May 15 00:24:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D412B327C3; Sun, 15 May 2016 00:24:22 +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 450FE1B44; Sun, 15 May 2016 00:24:22 +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 u4F0OLG2003691; Sun, 15 May 2016 00:24:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0OLTB003689; Sun, 15 May 2016 00:24:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150024.u4F0OLTB003689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299810 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:24:22 -0000 Author: ngie Date: Sun May 15 00:24:21 2016 New Revision: 299810 URL: https://svnweb.freebsd.org/changeset/base/299810 Log: Correct function names that failed in error messages It should be calloc/strdup, not malloc MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:19:32 2016 (r299809) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:24:21 2016 (r299810) @@ -269,12 +269,12 @@ enum_pair_insert(struct enum_pairs *head struct enum_pair *e_new; if ((e_new = calloc(1, sizeof(struct enum_pair))) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "calloc() failed: %s", strerror(errno)); return (-1); } if ((e_new->enum_str = strdup(enum_str)) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "strdup() failed: %s", strerror(errno)); free(e_new); return (-1); } Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sun May 15 00:19:32 2016 (r299809) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sun May 15 00:24:21 2016 (r299810) @@ -252,12 +252,12 @@ add_filename(struct snmp_toolinfo *snmpt } if ((fstring = strdup(filename)) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("strdup() failed - %s", strerror(errno)); return (-1); } if ((entry = calloc(1, sizeof(struct fname))) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("calloc() failed - %s", strerror(errno)); free(fstring); return (-1); } From owner-svn-src-all@freebsd.org Sun May 15 00:25:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57009B3283A; Sun, 15 May 2016 00:25:37 +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 292C81D02; Sun, 15 May 2016 00:25:37 +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 u4F0Pa08003780; Sun, 15 May 2016 00:25:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0Pa2A003779; Sun, 15 May 2016 00:25:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150025.u4F0Pa2A003779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299811 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:25:37 -0000 Author: ngie Date: Sun May 15 00:25:36 2016 New Revision: 299811 URL: https://svnweb.freebsd.org/changeset/base/299811 Log: Use strdup instead of malloc + strlcpy Fix error messages on failure for calloc/strdup MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sun May 15 00:24:21 2016 (r299810) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sun May 15 00:25:36 2016 (r299811) @@ -763,17 +763,16 @@ snmp_import_object(struct snmp_toolinfo return (-1); if ((oid2str = calloc(1, sizeof(struct snmp_oid2str))) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "calloc() failed: %s", strerror(errno)); return (-1); } - if ((string = malloc(strlen(nexttok) + 1)) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + if ((string = strdup(nexttok)) == NULL) { + syslog(LOG_ERR, "strdup() failed: %s", strerror(errno)); free(oid2str); return (-1); } - strlcpy(string, nexttok, nitems(string)); oid2str->string = string; oid2str->strlen = strlen(nexttok); From owner-svn-src-all@freebsd.org Sun May 15 00:40:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92E34B32A9C; Sun, 15 May 2016 00:40:06 +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 5AE8B13B2; Sun, 15 May 2016 00:40:06 +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 u4F0e5bP007056; Sun, 15 May 2016 00:40:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0e5Ev007055; Sun, 15 May 2016 00:40:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150040.u4F0e5Ev007055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299814 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:40:06 -0000 Author: ngie Date: Sun May 15 00:40:05 2016 New Revision: 299814 URL: https://svnweb.freebsd.org/changeset/base/299814 Log: Replace malloc + memset(.., 0, ..) with calloc calls MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:35:35 2016 (r299813) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sun May 15 00:40:05 2016 (r299814) @@ -55,12 +55,11 @@ snmp_mapping_init(void) { struct snmp_mappings *m; - if ((m = malloc(sizeof(struct snmp_mappings))) == NULL) { + if ((m = calloc(1, sizeof(struct snmp_mappings))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (NULL); } - memset(m, 0, sizeof(struct snmp_mappings)); return (m); } @@ -478,13 +477,11 @@ snmp_syntax_insert(struct snmp_idxlist * { struct index *idx; - if ((idx = malloc(sizeof(struct index))) == NULL) { + if ((idx = calloc(1, sizeof(struct index))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); } - memset(idx, 0, sizeof(struct index)); - if (snmp_index_insert(headp, idx) < 0) { free(idx); return (-1); From owner-svn-src-all@freebsd.org Sun May 15 00:42:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29532B32C59; Sun, 15 May 2016 00:42:20 +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 EAEE318DF; Sun, 15 May 2016 00:42:19 +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 u4F0gJ8q009747; Sun, 15 May 2016 00:42:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0gJlh009746; Sun, 15 May 2016 00:42:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150042.u4F0gJlh009746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299815 - head/usr.sbin/bsnmpd/modules/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:42:20 -0000 Author: ngie Date: Sun May 15 00:42:18 2016 New Revision: 299815 URL: https://svnweb.freebsd.org/changeset/base/299815 Log: Remove NO_WERROR.clang from this Makefile This compiles with clang without warnings MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Modified: head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Sun May 15 00:40:05 2016 (r299814) +++ head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Sun May 15 00:42:18 2016 (r299815) @@ -15,8 +15,6 @@ MAN= snmp_mibII.3 CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd CFLAGS+= -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY -DHAVE_SYS_TREE_H -# XXX Work around clang warning, until maintainer approves fix. -NO_WERROR.clang= DEFS= ${MOD}_tree.def INCS= snmp_${MOD}.h From owner-svn-src-all@freebsd.org Sun May 15 00:45:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9585B32CEF; Sun, 15 May 2016 00:45:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 737971AC6; Sun, 15 May 2016 00:45:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4F0jHOd009912; Sun, 15 May 2016 00:45:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0jHTm009911; Sun, 15 May 2016 00:45:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605150045.u4F0jHTm009911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 15 May 2016 00:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299816 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:45:18 -0000 Author: rmacklem Date: Sun May 15 00:45:17 2016 New Revision: 299816 URL: https://svnweb.freebsd.org/changeset/base/299816 Log: Fix fuse so that stale buffer cache data isn't read. When I/O on a file under fuse is switched from buffered to DIRECT_IO, it was possible to read stale (before a recent modification) data from the buffer cache. This patch invalidates the buffer cache for the file to fix this. PR: 194293 MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_node.c Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Sun May 15 00:42:18 2016 (r299815) +++ head/sys/fs/fuse/fuse_node.c Sun May 15 00:45:17 2016 (r299816) @@ -289,7 +289,9 @@ fuse_vnode_open(struct vnode *vp, int32_ * XXXIP: Handle fd based DIRECT_IO */ if (fuse_open_flags & FOPEN_DIRECT_IO) { + ASSERT_VOP_ELOCKED(vp, __func__); VTOFUD(vp)->flag |= FN_DIRECTIO; + fuse_io_invalbuf(vp, td); } else { VTOFUD(vp)->flag &= ~FN_DIRECTIO; } From owner-svn-src-all@freebsd.org Sun May 15 00:54:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1704FB32E84; Sun, 15 May 2016 00:54:23 +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 CAF331EBB; Sun, 15 May 2016 00:54:22 +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 u4F0sMFM012834; Sun, 15 May 2016 00:54:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F0sMjC012833; Sun, 15 May 2016 00:54:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150054.u4F0sMjC012833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 00:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299817 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 00:54:23 -0000 Author: ngie Date: Sun May 15 00:54:21 2016 New Revision: 299817 URL: https://svnweb.freebsd.org/changeset/base/299817 Log: Use SNMPD_INPUT_FAILED instead of SNMP_CODE_FAILED SNMPD_INPUT_FAILED is `enum snmpd_input_err` type (which matches the return code from the function). SNMP_CODE_FAILED is `enum snmp_code` type. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Sun May 15 00:45:17 2016 (r299816) +++ head/contrib/bsnmp/snmpd/main.c Sun May 15 00:54:21 2016 (r299817) @@ -648,11 +648,11 @@ decoded: } else if (usm_user->suser.auth_proto != SNMP_AUTH_NOAUTH && (pdu->engine.engine_boots == 0 || pdu->engine.engine_time == 0)) { snmpd_usmstats.not_in_time_windows++; - ret = SNMP_CODE_FAILED; + ret = SNMPD_INPUT_FAILED; } if ((code = snmp_pdu_auth_access(pdu, ip)) != SNMP_CODE_OK) - ret = SNMP_CODE_FAILED; + ret = SNMPD_INPUT_FAILED; return (ret); } From owner-svn-src-all@freebsd.org Sun May 15 01:56:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0BAB392E6; Sun, 15 May 2016 01:56:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) (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 7DCA31D28; Sun, 15 May 2016 01:56:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f51.google.com with SMTP id x201so223890506oif.3; Sat, 14 May 2016 18:56:04 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=R8t7+4KBfzGo6Aa00zQ0hS4pEK18cl7Nzo+yF8hm7Rc=; b=YLJ6UXbYvYR/TjRtBbFDER3fORZc0Kb2Myt83xRdxnqAg8bchocj7qDCEwoH/cEfjk JxttLaRbrydEvhpusMWoioMwlPHzAFOt+4FHiieKmH+lSQfTJylHk8CtpyMrpwZ/6rPb Hi43bve0H0V7H/X3BRV/rqqIKw9KelnAGm1CmIjOYWbyJsmDcueDaMT+BmDTr6PKw8A6 6dvld7+aW4cv/6CFLwqimRsnzdaNh97XVQxZl6XUv2uhlGkckhHja49OGyPuf2sOAzWp POdoPFrIB5CfTucPotVHx/Eld6oq9iCyUU2wr4v+rZWIXJcxEdrON5zeY0VEQGxpw6Vx XVng== X-Gm-Message-State: AOPr4FWpRsOriKRUGzlm074tI1OYysfcfhSE1bfa5YEyscmquciDv/1zb5it9ZzIYhBSLQ== X-Received: by 10.157.56.51 with SMTP id i48mr12623407otc.130.1463275989725; Sat, 14 May 2016 18:33:09 -0700 (PDT) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com. [209.85.218.44]) by smtp.gmail.com with ESMTPSA id c9sm7517953oeq.5.2016.05.14.18.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 May 2016 18:33:09 -0700 (PDT) Received: by mail-oi0-f44.google.com with SMTP id v145so223080416oie.0; Sat, 14 May 2016 18:33:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.240.68 with SMTP id o65mr13326015oih.0.1463275989138; Sat, 14 May 2016 18:33:09 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Sat, 14 May 2016 18:33:09 -0700 (PDT) In-Reply-To: <201605141952.u4EJq4jP017501@repo.freebsd.org> References: <201605141952.u4EJq4jP017501@repo.freebsd.org> Date: Sat, 14 May 2016 18:33:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299751 - head/sys/dev/bwn From: Conrad Meyer To: Adrian Chadd 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 01:56:04 -0000 On Sat, May 14, 2016 at 12:52 PM, Adrian Chadd wrote: > Author: adrian > Date: Sat May 14 19:52:04 2016 > New Revision: 299751 > URL: https://svnweb.freebsd.org/changeset/base/299751 > > Log: > [bwn] migrate sqrt and add another couple of util routines. > > ... > > +unsigned int > +bwn_sqrt(struct bwn_mac *mac, unsigned int x) > +{ > + /* Table holding (10 * sqrt(x)) for x between 1 and 256. */ > + static uint8_t sqrt_table[256] = { > + 10, 14, 17, 20, 22, 24, 26, 28, > ... > + }; > + > + if (x == 0) > + return (0); > + if (x >= 256) { > + unsigned int tmp; > + > + for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1) > + /* do nothing */ ; > + return (tmp); Does this approximation method have a name? > + } > + return (sqrt_table[x - 1] / 10); Why do we store the table as 10*sqrt() if we're just going to divide every entry by ten? Best, Conrad From owner-svn-src-all@freebsd.org Sun May 15 02:30:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF654B39F4F; Sun, 15 May 2016 02:30: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 681CF1CDE; Sun, 15 May 2016 02:30: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 u4F2UYGH040439; Sun, 15 May 2016 02:30:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F2UYBx040438; Sun, 15 May 2016 02:30:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605150230.u4F2UYBx040438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 May 2016 02:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299821 - head/sbin/routed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 02:30:35 -0000 Author: pfg Date: Sun May 15 02:30:34 2016 New Revision: 299821 URL: https://svnweb.freebsd.org/changeset/base/299821 Log: routed(8): Avoid NULL de-reference and two possible memory leaks. The reports and fixes are straightforward but it's nice to be able to confirm against NetBSD. CID: 271080, 272306, 272307 Obtained from: NetBSD (CVS ref. 1.21 - 1.23) MFC after: 2 weeks. Modified: head/sbin/routed/parms.c Modified: head/sbin/routed/parms.c ============================================================================== --- head/sbin/routed/parms.c Sun May 15 01:15:20 2016 (r299820) +++ head/sbin/routed/parms.c Sun May 15 02:30:34 2016 (r299821) @@ -588,8 +588,10 @@ parse_parms(char *line, intnetp->intnet_metric = (int)strtol(val+1,&p,0); if (*p != '\0' || intnetp->intnet_metric <= 0 - || intnetp->intnet_metric >= HOPCNT_INFINITY) + || intnetp->intnet_metric >= HOPCNT_INFINITY) { + free(intnetp); return bad_str(line); + } } if (!getnet(buf, &intnetp->intnet_addr, &intnetp->intnet_mask) || intnetp->intnet_mask == HOST_MASK @@ -670,7 +672,7 @@ parse_parms(char *line, * The parm_net stuff is needed to allow several * -F settings. */ - if (!getnet(val0, &addr, &mask) + if (val0 == NULL || !getnet(val0, &addr, &mask) || parm.parm_name[0] != '\0') return bad_str(tgt); parm.parm_net = addr; @@ -681,6 +683,8 @@ parse_parms(char *line, /* since cleartext passwords are so weak allow * them anywhere */ + if (val0 == NULL) + return bad_str("no passwd"); msg = get_passwd(tgt,val0,&parm,RIP_AUTH_PW,1); if (msg) { *val0 = '\0'; @@ -812,8 +816,10 @@ parse_parms(char *line, || !getnet(buf2, &tg->tgate_nets[i].net, &tg->tgate_nets[i].mask) || tg->tgate_nets[i].net == RIP_DEFAULT - || tg->tgate_nets[i].mask == 0) + || tg->tgate_nets[i].mask == 0) { + free(tg); return bad_str(tgt); + } i++; } tg->tgate_next = tgates; From owner-svn-src-all@freebsd.org Sun May 15 02:41:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFDFB3B128; Sun, 15 May 2016 02:41:22 +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 D57F211F2; Sun, 15 May 2016 02:41:21 +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 u4F2fLGP045531; Sun, 15 May 2016 02:41:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F2fL1m045530; Sun, 15 May 2016 02:41:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605150241.u4F2fL1m045530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 May 2016 02:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299822 - head/sbin/routed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 02:41:22 -0000 Author: pfg Date: Sun May 15 02:41:20 2016 New Revision: 299822 URL: https://svnweb.freebsd.org/changeset/base/299822 Log: routed(8): Dereference before null check. CID: 272432 Obtained from: NetBSD (CVS ref. 1.16) MFC after: 2 weeks. Modified: head/sbin/routed/rdisc.c Modified: head/sbin/routed/rdisc.c ============================================================================== --- head/sbin/routed/rdisc.c Sun May 15 02:30:34 2016 (r299821) +++ head/sbin/routed/rdisc.c Sun May 15 02:41:20 2016 (r299822) @@ -758,7 +758,7 @@ send_rdisc(union ad_u *p, if (rdisc_sock < 0) get_rdisc_sock(); - trace_rdisc(msg, ifp->int_addr, rsin.sin_addr.s_addr, ifp, + trace_rdisc(msg, (ifp ? ifp->int_addr : 0), rsin.sin_addr.s_addr, ifp, p, p_size); if (0 > sendto(rdisc_sock, p, p_size, flags, From owner-svn-src-all@freebsd.org Sun May 15 03:01:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8586FB3B601; Sun, 15 May 2016 03:01:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 529BA102E; Sun, 15 May 2016 03:01:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4F31e1J052689; Sun, 15 May 2016 03:01:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F31ede052688; Sun, 15 May 2016 03:01:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605150301.u4F31ede052688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 15 May 2016 03:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299824 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:01:41 -0000 Author: markj Date: Sun May 15 03:01:40 2016 New Revision: 299824 URL: https://svnweb.freebsd.org/changeset/base/299824 Log: Remove an always-false error check in the AIFADDR_IN6 handler. CID: 1250792 MFC after: 1 week Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun May 15 02:58:39 2016 (r299823) +++ head/sys/netinet6/in6.c Sun May 15 03:01:40 2016 (r299824) @@ -697,9 +697,8 @@ in6_control(struct socket *so, u_long cm * that is, this address might make other addresses detached. */ pfxlist_onlink_check(); + aifaddr_out: - if (error != 0 || ia == NULL) - break; /* * Try to clear the flag when a new IPv6 address is added * onto an IFDISABLED interface and it succeeds. From owner-svn-src-all@freebsd.org Sun May 15 03:04:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93239B3B814; Sun, 15 May 2016 03:04:22 +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 4A1191350; Sun, 15 May 2016 03:04:22 +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 u4F34Lsl052831; Sun, 15 May 2016 03:04:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F34LGR052829; Sun, 15 May 2016 03:04:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605150304.u4F34LGR052829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 May 2016 03:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299825 - head/sbin/routed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:04:22 -0000 Author: pfg Date: Sun May 15 03:04:21 2016 New Revision: 299825 URL: https://svnweb.freebsd.org/changeset/base/299825 Log: routed(8): Misc. cleanups to squelch Coverity. table.c: Copy into fixed size buffer. trace.c: Argument got dup2() cannot be negative. Copy into fixed size buffer. CID: 1006785, 1006786, 271301 Obtained from: NetBSD MFC after: 2 weeks. Modified: head/sbin/routed/table.c head/sbin/routed/trace.c Modified: head/sbin/routed/table.c ============================================================================== --- head/sbin/routed/table.c Sun May 15 03:01:40 2016 (r299824) +++ head/sbin/routed/table.c Sun May 15 03:04:21 2016 (r299825) @@ -1228,7 +1228,7 @@ read_rt(void) continue; /* ignore compat message */ #endif - strcpy(str, rtm_type_name(m.r.rtm.rtm_type)); + strlcpy(str, rtm_type_name(m.r.rtm.rtm_type), sizeof(str)); strp = &str[strlen(str)]; if (m.r.rtm.rtm_type <= RTM_CHANGE) strp += sprintf(strp," from pid %d",m.r.rtm.rtm_pid); Modified: head/sbin/routed/trace.c ============================================================================== --- head/sbin/routed/trace.c Sun May 15 03:01:40 2016 (r299824) +++ head/sbin/routed/trace.c Sun May 15 03:04:21 2016 (r299825) @@ -205,6 +205,8 @@ trace_close(int zap_stdio) fclose(ftrace); ftrace = NULL; fd = open(_PATH_DEVNULL, O_RDWR); + if (fd < 0) + return; if (isatty(STDIN_FILENO)) (void)dup2(fd, STDIN_FILENO); if (isatty(STDOUT_FILENO)) @@ -439,9 +441,12 @@ addrname(naddr addr, /* in network byt } bufs[NUM_BUFS]; char *s, *sp; naddr dmask; + size_t l; int i; - s = strcpy(bufs[bufno].str, naddr_ntoa(addr)); + strlcpy(bufs[bufno].str, naddr_ntoa(addr), sizeof(bufs[bufno].str)); + s = bufs[bufno].str; + l = sizeof(bufs[bufno].str); bufno = (bufno+1) % NUM_BUFS; if (force == 1 || (force == 0 && mask != std_mask(addr))) { @@ -451,10 +456,11 @@ addrname(naddr addr, /* in network byt if (mask + dmask == 0) { for (i = 0; i != 32 && ((1< Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D73B8B3BADF; Sun, 15 May 2016 03:15:39 +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 A54091C16; Sun, 15 May 2016 03:15:39 +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 u4F3Fc1G056111; Sun, 15 May 2016 03:15:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3FbET056093; Sun, 15 May 2016 03:15:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605150315.u4F3FbET056093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 May 2016 03:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299826 - in stable/10: etc etc/ntp etc/rc.d share/examples/ipfilter share/examples/kld/cdev/test tools/regression/sockets/so_setfib tools/tools/fixwhite tools/tools/ipw tools/tools/nan... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:15:39 -0000 Author: pfg Date: Sun May 15 03:15:36 2016 New Revision: 299826 URL: https://svnweb.freebsd.org/changeset/base/299826 Log: MFC r298881, 298882, 298883, 298885: Minor spelling fixes in: tools, share, bluetooth, pmcstat, etc Many of these have user-visible strings. Modified: stable/10/etc/ntp/leap-seconds stable/10/etc/protocols stable/10/etc/rc.d/sendmail stable/10/etc/rc.initdiskless stable/10/share/examples/ipfilter/ipf-howto.txt stable/10/share/examples/kld/cdev/test/Makefile stable/10/tools/regression/sockets/so_setfib/so_setfib.c stable/10/tools/tools/fixwhite/fixwhite.1 stable/10/tools/tools/fixwhite/fixwhite.c stable/10/tools/tools/ipw/ipwstats.c stable/10/tools/tools/nanobsd/dhcpd/common stable/10/tools/tools/shlib-compat/shlib-compat.py stable/10/tools/tools/wtap/vis_map/vis_map.c stable/10/tools/tools/wtap/wtap/wtap.c stable/10/usr.sbin/bluetooth/btpand/btpand.c stable/10/usr.sbin/bluetooth/hccontrol/node.c stable/10/usr.sbin/pmcstat/pmcpl_calltree.c stable/10/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/ntp/leap-seconds ============================================================================== --- stable/10/etc/ntp/leap-seconds Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/ntp/leap-seconds Sun May 15 03:15:36 2016 (r299826) @@ -46,7 +46,7 @@ # by the International Bureau of Weights and Measures # (BIPM). See www.bipm.fr for more information. # -# 3. The current defintion of the relationship between UTC +# 3. The current definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different # time scales were in use before than epoch, and it can be # quite difficult to compute precise timestamps and time Modified: stable/10/etc/protocols ============================================================================== --- stable/10/etc/protocols Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/protocols Sun May 15 03:15:36 2016 (r299826) @@ -43,7 +43,7 @@ merit-inp 32 MERIT-INP # MERIT Internoda dccp 33 DCCP # Datagram Congestion Control Protocol 3pc 34 3PC # Third Party Connect Protocol idpr 35 IDPR # Inter-Domain Policy Routing Protocol -xtp 36 XTP # Xpress Tranfer Protocol +xtp 36 XTP # Xpress Transfer Protocol ddp 37 DDP # Datagram Delivery Protocol idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto tp++ 39 TP++ # TP++ Transport Protocol Modified: stable/10/etc/rc.d/sendmail ============================================================================== --- stable/10/etc/rc.d/sendmail Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/rc.d/sendmail Sun May 15 03:15:36 2016 (r299826) @@ -78,7 +78,7 @@ sendmail_cert_create() crlnumber = \$dir/crlnumber # the current crl number crl = \$dir/crl.pem # The current CRL private_key = \$dir/cakey.pem - x509_extensions = usr_cert # The extentions to add to the cert + x509_extensions = usr_cert # The extensions to add to the cert name_opt = ca_default # Subject Name options cert_opt = ca_default # Certificate field options default_days = 365 # how long to certify for @@ -99,7 +99,7 @@ sendmail_cert_create() default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes - x509_extensions = v3_ca # The extentions to add to the self signed cert + x509_extensions = v3_ca # The extensions to add to the self signed cert string_mask = utf8only prompt = no [ req_distinguished_name ] Modified: stable/10/etc/rc.initdiskless ============================================================================== --- stable/10/etc/rc.initdiskless Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/rc.initdiskless Sun May 15 03:15:36 2016 (r299826) @@ -103,7 +103,7 @@ # will be created. In case of multiple entries for the same # directory M, the last one in the scanning order is used. # NOTE: If you only need to create a memory filesystem but not -# initialize it from a template, it is preferrable to specify +# initialize it from a template, it is preferable to specify # it in fstab e.g. as "md /tmp mfs -s=30m,rw 0 0" # # /conf/T/SUBDIR.cpio.gz Modified: stable/10/share/examples/ipfilter/ipf-howto.txt ============================================================================== --- stable/10/share/examples/ipfilter/ipf-howto.txt Sun May 15 03:04:21 2016 (r299825) +++ stable/10/share/examples/ipfilter/ipf-howto.txt Sun May 15 03:15:36 2016 (r299826) @@ -1036,11 +1036,11 @@ In this case, the server is running n it's not a server, it's a client. And this client doesn't want unauthorized packets entering its IP stack at all. However, the client wants full access to the internet and -the reply packets that such privledge entails. This simple +the reply packets that such privilege entails. This simple ruleset creates state entries for every new outgoing TCP session. Again, since a state entry is created, these new TCP sessions are free to talk back and forth as they please -without the hinderance or inspection of the firewall rule- +without the hindrance or inspection of the firewall rule- set. We mentioned that this also works for UDP and ICMP: block in quick on tun0 all @@ -1271,7 +1271,7 @@ forgeries and allow fragments: This works because every packet that should be allowed through makes it into the state table before the blocking rules are reached. The only scan this won't detect is a SYN -scan itself. If you're truely worried about that, you might +scan itself. If you're truly worried about that, you might even want to log all initial SYN packets. 3.6. Responding To a Blocked Packet Modified: stable/10/share/examples/kld/cdev/test/Makefile ============================================================================== --- stable/10/share/examples/kld/cdev/test/Makefile Sun May 15 03:04:21 2016 (r299825) +++ stable/10/share/examples/kld/cdev/test/Makefile Sun May 15 03:15:36 2016 (r299826) @@ -73,7 +73,7 @@ WARNS?= 5 MODSTAT= /sbin/kldstat load: - @echo "This test program will call the sample kld characer device "; + @echo "This test program will call the sample kld character device "; @echo "driver." @echo @echo "The sample driver will display a message on the" Modified: stable/10/tools/regression/sockets/so_setfib/so_setfib.c ============================================================================== --- stable/10/tools/regression/sockets/so_setfib/so_setfib.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/regression/sockets/so_setfib/so_setfib.c Sun May 15 03:15:36 2016 (r299826) @@ -175,7 +175,7 @@ main(int argc __unused, char *argv[] __u return (0); } - /* Initalize randomness. */ + /* Initialize randomness. */ srandomdev(); /* Get number of FIBs supported by kernel. */ Modified: stable/10/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- stable/10/tools/tools/fixwhite/fixwhite.1 Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/fixwhite/fixwhite.1 Sun May 15 03:15:36 2016 (r299826) @@ -43,6 +43,6 @@ trailing whitespace characters from ever Multiple successive empty lines are merged together. If the whitespace at the beginning of a sentence is exactly a multiple of eight spaces, the whitespace is replaced by tabs. -Also, spaces preceeding tabs will be merged into the tab character. +Also, spaces preceding tabs will be merged into the tab character. .Sh AUTHORS .An Ed Schouten Aq ed@FreeBSD.org Modified: stable/10/tools/tools/fixwhite/fixwhite.c ============================================================================== --- stable/10/tools/tools/fixwhite/fixwhite.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/fixwhite/fixwhite.c Sun May 15 03:15:36 2016 (r299826) @@ -95,7 +95,7 @@ savewhite(char c, bool leading) savebyte(' '); break; case '\t': - /* Convert preceeding spaces to tabs. */ + /* Convert preceding spaces to tabs. */ ncolumn = (column / 8 + 1) * 8; while (peekbyte(1, ' ')) { queuelen--; Modified: stable/10/tools/tools/ipw/ipwstats.c ============================================================================== --- stable/10/tools/tools/ipw/ipwstats.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/ipw/ipwstats.c Sun May 15 03:15:36 2016 (r299826) @@ -89,7 +89,7 @@ static const struct statistic tbl[] = { { 27, "Number of reassociation requests transmitted", INT }, { 28, "Number of reassociation responses transmitted", INT }, { 29, "Number of probe requests transmitted", INT }, - { 30, "Number of probe reponses transmitted", INT }, + { 30, "Number of probe responses transmitted", INT }, { 31, "Number of beacons transmitted", INT }, { 32, "Number of ATIM frames transmitted", INT }, { 33, "Number of disassociation requests transmitted", INT }, @@ -137,7 +137,7 @@ static const struct statistic tbl[] = { { 89, "Number of reassociation requests received", INT }, { 90, "Number of reassociation responses received", INT }, { 91, "Number of probe requests received", INT }, - { 92, "Number of probe reponses received", INT }, + { 92, "Number of probe responses received", INT }, { 93, "Number of beacons received", INT }, { 94, "Number of ATIM frames received", INT }, { 95, "Number of disassociation requests received", INT }, Modified: stable/10/tools/tools/nanobsd/dhcpd/common ============================================================================== --- stable/10/tools/tools/nanobsd/dhcpd/common Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/nanobsd/dhcpd/common Sun May 15 03:15:36 2016 (r299826) @@ -229,7 +229,7 @@ add_port () { local port_path=$1 local port=`echo $1 | sed -e 's/\//_/'` shift - # Check if package allready exist + # Check if package already exist # Need to: # 1. check ARCH of this package! # 2. Add a trap Modified: stable/10/tools/tools/shlib-compat/shlib-compat.py ============================================================================== --- stable/10/tools/tools/shlib-compat/shlib-compat.py Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/shlib-compat/shlib-compat.py Sun May 15 03:15:36 2016 (r299826) @@ -893,7 +893,7 @@ class DwarfdumpParser(Parser): offset = int(tag.args['DW_AT_low_pc'], 16) if self.offsetmap.has_key(offset): raise ValueError("Dwarf dump parse error: " + - "symbol is aleady defined at offset 0x%x" % offset) + "symbol is already defined at offset 0x%x" % offset) self.offsetmap[offset] = tag if len(self.stack) > 0: prev = self.stack.pop() Modified: stable/10/tools/tools/wtap/vis_map/vis_map.c ============================================================================== --- stable/10/tools/tools/wtap/vis_map/vis_map.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/wtap/vis_map/vis_map.c Sun May 15 03:15:36 2016 (r299826) @@ -110,7 +110,7 @@ main(int argc, const char* argv[]) link_op(&l); break; default: - printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + printf("wtap ioctl: unknown command '%c'\n", *argv[1]); exit(1); } exit(0); Modified: stable/10/tools/tools/wtap/wtap/wtap.c ============================================================================== --- stable/10/tools/tools/wtap/wtap/wtap.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/wtap/wtap/wtap.c Sun May 15 03:15:36 2016 (r299826) @@ -75,7 +75,7 @@ int main( int argc, const char* argv[]) delete(id); break; default: - printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + printf("wtap ioctl: unknown command '%c'\n", *argv[1]); return -1; } return 0; Modified: stable/10/usr.sbin/bluetooth/btpand/btpand.c ============================================================================== --- stable/10/usr.sbin/bluetooth/btpand/btpand.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/bluetooth/btpand/btpand.c Sun May 15 03:15:36 2016 (r299826) @@ -65,7 +65,7 @@ static const struct { const char * desc; } services[] = { { "PANU", SDP_SERVICE_CLASS_PANU, "Personal Area Networking User" }, - { "NAP", SDP_SERVICE_CLASS_NAP, "Network Acess Point" }, + { "NAP", SDP_SERVICE_CLASS_NAP, "Network Access Point" }, { "GN", SDP_SERVICE_CLASS_GN, "Group Network" }, }; Modified: stable/10/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- stable/10/usr.sbin/bluetooth/hccontrol/node.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/bluetooth/hccontrol/node.c Sun May 15 03:15:36 2016 (r299826) @@ -591,7 +591,7 @@ struct hci_command node_commands[] = { "Write the value of the Role Switch parameter for the HCI node. By default,\n" \ "if Role Switch is supported, local device will try to perform Role Switch\n" \ "and become Master on incoming connection. Some devices do not support Role\n" \ -"Switch and thus incomming connections from such devices will fail. Setting\n" \ +"Switch and thus incoming connections from such devices will fail. Setting\n" \ "this parameter to zero will prevent Role Switch and thus accepting device\n" \ "will remain Slave", &hci_write_node_role_switch Modified: stable/10/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcpl_calltree.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/pmcstat/pmcpl_calltree.c Sun May 15 03:15:36 2016 (r299826) @@ -830,7 +830,7 @@ pmcpl_ct_node_printchild(struct pmcpl_ct /* * Child cost. - * TODO: attach child cost to the real position in the funtion. + * TODO: attach child cost to the real position in the function. * TODO: cfn= / call addr() / addr(call ) */ for (i=0 ; ipct_narc; i++) { Modified: stable/10/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat_log.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/pmcstat/pmcstat_log.c Sun May 15 03:15:36 2016 (r299826) @@ -1361,7 +1361,7 @@ pmcstat_analyze_log(void) assert(args.pa_flags & FLAG_DO_ANALYSIS); if (elf_version(EV_CURRENT) == EV_NONE) - err(EX_UNAVAILABLE, "Elf library intialization failed"); + err(EX_UNAVAILABLE, "Elf library initialization failed"); while (pmclog_read(args.pa_logparser, &ev) == 0) { assert(ev.pl_state == PMCLOG_OK); From owner-svn-src-all@freebsd.org Sun May 15 03:19:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB432B3BE53; Sun, 15 May 2016 03:19:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A52991F5B; Sun, 15 May 2016 03:19:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4F3Jr1G056346; Sun, 15 May 2016 03:19:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3JrS1056345; Sun, 15 May 2016 03:19:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605150319.u4F3JrS1056345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 15 May 2016 03:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299828 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:19:55 -0000 Author: markj Date: Sun May 15 03:19:53 2016 New Revision: 299828 URL: https://svnweb.freebsd.org/changeset/base/299828 Log: Fix a few style issues in the ICMP sysctl descriptions. MFC after: 1 week Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Sun May 15 03:18:03 2016 (r299827) +++ head/sys/netinet/ip_icmp.c Sun May 15 03:19:53 2016 (r299828) @@ -104,18 +104,19 @@ static VNET_DEFINE(int, icmpmaskrepl) = #define V_icmpmaskrepl VNET(icmpmaskrepl) SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpmaskrepl), 0, - "Reply to ICMP Address Mask Request packets."); + "Reply to ICMP Address Mask Request packets"); static VNET_DEFINE(u_int, icmpmaskfake) = 0; #define V_icmpmaskfake VNET(icmpmaskfake) SYSCTL_UINT(_net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpmaskfake), 0, - "Fake reply to ICMP Address Mask Request packets."); + "Fake reply to ICMP Address Mask Request packets"); VNET_DEFINE(int, drop_redirect) = 0; #define V_drop_redirect VNET(drop_redirect) SYSCTL_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(drop_redirect), 0, "Ignore ICMP redirects"); + &VNET_NAME(drop_redirect), 0, + "Ignore ICMP redirects"); static VNET_DEFINE(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) @@ -127,7 +128,7 @@ static VNET_DEFINE(char, reply_src[IFNAM #define V_reply_src VNET(reply_src) SYSCTL_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(reply_src), IFNAMSIZ, - "icmp reply source for non-local packets."); + "ICMP reply source for non-local packets"); static VNET_DEFINE(int, icmp_rfi) = 0; #define V_icmp_rfi VNET(icmp_rfi) @@ -141,19 +142,17 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, quo &VNET_NAME(icmp_quotelen), 0, "Number of bytes from original packet to quote in ICMP reply"); -/* - * ICMP broadcast echo sysctl - */ static VNET_DEFINE(int, icmpbmcastecho) = 0; #define V_icmpbmcastecho VNET(icmpbmcastecho) SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpbmcastecho), 0, - ""); + "Reply to multicast ICMP Echo Request and Timestamp packets"); static VNET_DEFINE(int, icmptstamprepl) = 1; #define V_icmptstamprepl VNET(icmptstamprepl) SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW, - &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); + &VNET_NAME(icmptstamprepl), 0, + "Respond to ICMP Timestamp packets"); #ifdef ICMPPRINTFS int icmpprintfs = 0; From owner-svn-src-all@freebsd.org Sun May 15 03:18:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0713B3BD4A; Sun, 15 May 2016 03:18:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCD741E18; Sun, 15 May 2016 03:18:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4F3I31G056251; Sun, 15 May 2016 03:18:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3I3S0056250; Sun, 15 May 2016 03:18:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605150318.u4F3I3S0056250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 15 May 2016 03:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299827 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:18:05 -0000 Author: markj Date: Sun May 15 03:18:03 2016 New Revision: 299827 URL: https://svnweb.freebsd.org/changeset/base/299827 Log: Add sysctl descriptions for net.inet6.ip6 and net.inet6.icmp6. icmp6.redirtimeout, icmp6.nd6_maxnudhint and ip6.rr_prune are left undocumented as they appear to have no effect. Some existing sysctl descriptions were modified for consistency and style, and the ip6.tempvltime and ip6.temppltime handlers were rewritten to be a bit simpler and to avoid setting the sysctl value before validating it. MFC after: 3 weeks Modified: head/sys/netinet6/in6_proto.c Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Sun May 15 03:15:36 2016 (r299826) +++ head/sys/netinet6/in6_proto.c Sun May 15 03:18:03 2016 (r299827) @@ -481,147 +481,170 @@ SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ips static int sysctl_ip6_temppltime(SYSCTL_HANDLER_ARGS) { - int error = 0; - int old; + int error, val; - error = SYSCTL_OUT(req, arg1, sizeof(int)); - if (error || !req->newptr) + val = V_ip6_temp_preferred_lifetime; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || !req->newptr) return (error); - old = V_ip6_temp_preferred_lifetime; - error = SYSCTL_IN(req, arg1, sizeof(int)); - if (V_ip6_temp_preferred_lifetime < - V_ip6_desync_factor + V_ip6_temp_regen_advance) { - V_ip6_temp_preferred_lifetime = old; + if (val < V_ip6_desync_factor + V_ip6_temp_regen_advance) return (EINVAL); - } - return (error); + V_ip6_temp_preferred_lifetime = val; + return (0); } static int sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS) { - int error = 0; - int old; + int error, val; - error = SYSCTL_OUT(req, arg1, sizeof(int)); - if (error || !req->newptr) + val = V_ip6_temp_valid_lifetime; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || !req->newptr) return (error); - old = V_ip6_temp_valid_lifetime; - error = SYSCTL_IN(req, arg1, sizeof(int)); - if (V_ip6_temp_valid_lifetime < V_ip6_temp_preferred_lifetime) { - V_ip6_temp_preferred_lifetime = old; + if (val < V_ip6_temp_preferred_lifetime) return (EINVAL); - } - return (error); + V_ip6_temp_valid_lifetime = val; + return (0); } SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_forwarding), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_forwarding), 0, + "Enable IPv6 forwarding between interfaces"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS, redirect, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_sendredirects), 0, ""); -SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(ip6_defhlim), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_sendredirects), 0, + "Send a redirect message when forwarding back to a source link"); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_defhlim), 0, + "Default hop limit"); SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, - ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); + ip6stat, + "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, + "Maximum allowed number of outstanding fragmented IPv6 packets"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, - "Default value of per-interface flag for accepting ICMPv6 Router" - "Advertisement messages"); + "Default value of per-interface flag for accepting ICMPv6 RA messages"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0, "Default value of per-interface flag to control whether routers " "sending ICMPv6 RA messages on that interface are added into the " - "default router list."); + "default router list"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_NORBIT_RAIF, norbit_raif, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_norbit_raif), 0, - "Always set 0 to R flag in ICMPv6 NA messages when accepting RA" - " on the interface."); + "Always set clear the R flag in ICMPv6 NA messages when accepting RA " + "on the interface"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RFC6204W3, rfc6204w3, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_rfc6204w3), 0, "Accept the default router list from ICMPv6 RA messages even " - "when packet forwarding enabled."); + "when packet forwarding is enabled"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_log_interval), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_log_interval), 0, + "Frequency in seconds at which to log IPv6 forwarding errors"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_hdrnestlimit), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_hdrnestlimit), 0, + "Maximum allowed number of nested protocol headers"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT, dad_count, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_dad_count), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_dad_count), 0, + "Number of ICMPv6 NS messages sent during duplicate address detection"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL, auto_flowlabel, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_auto_flowlabel), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_auto_flowlabel), 0, + "Provide an IPv6 flowlabel in outbound packets"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM, defmcasthlim, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_defmcasthlim), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_defmcasthlim), 0, + "Default hop limit for multicast packets"); SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION, kame_version, - CTLFLAG_RD, __KAME_VERSION, 0, ""); + CTLFLAG_RD, __KAME_VERSION, 0, + "KAME version string"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED, use_deprecated, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_deprecated), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_deprecated), 0, + "Allow the use of addresses whose preferred lifetimes have expired"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE, rr_prune, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_rr_prune), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_rr_prune), 0, + ""); /* XXX unused */ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USETEMPADDR, use_tempaddr, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_tempaddr), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_tempaddr), 0, + "Create RFC3041 temporary addresses for autoconfigured addresses"); SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_TEMPPLTIME, temppltime, CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ip6_temp_preferred_lifetime), 0, - sysctl_ip6_temppltime, "I", ""); + NULL, 0, sysctl_ip6_temppltime, "I", + "Maximum preferred lifetime for temporary addresses"); SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_TEMPVLTIME, tempvltime, CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ip6_temp_valid_lifetime), 0, - sysctl_ip6_tempvltime, "I", ""); + NULL, 0, sysctl_ip6_tempvltime, "I", + "Maximum valid lifetime for temporary addresses"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_v6only), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_v6only), 0, + "Restrict AF_INET6 sockets to IPv6 addresses only"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL, auto_linklocal, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0, - "Default value of per-interface flag for automatically adding an IPv6" - " link-local address to interfaces when attached"); + "Default value of per-interface flag for automatically adding an IPv6 " + "link-local address to interfaces when attached"); SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, struct rip6stat, rip6stat, "Raw IP6 statistics (struct rip6stat, netinet6/raw_ip6.h)"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_PREFER_TEMPADDR, prefer_tempaddr, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_prefer_tempaddr), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_prefer_tempaddr), 0, + "Prefer RFC3041 temporary addresses in source address selection"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEFAULTZONE, use_defaultzone, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_defzone), 0,""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_defzone), 0, + "Use the default scope zone when none is specified"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfrags), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfrags), 0, + "Maximum allowed number of outstanding IPv6 packet fragments"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MCAST_PMTU, mcast_pmtu, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_mcast_pmtu), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_mcast_pmtu), 0, + "Enable path MTU discovery for multicast packets"); #ifdef IPSTEALTH SYSCTL_INT(_net_inet6_ip6, IPV6CTL_STEALTH, stealth, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(ip6stealth), 0, ""); + &VNET_NAME(ip6stealth), 0, + "Forward IPv6 packets without decrementing their TTL"); #endif /* net.inet6.icmp6 */ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_rediraccept), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_rediraccept), 0, + "Accept ICMPv6 redirect messages"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_redirtimeout), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_redirtimeout), 0, + ""); /* XXX unused */ SYSCTL_VNET_PCPUSTAT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, struct icmp6stat, icmp6stat, "ICMPv6 statistics (struct icmp6stat, netinet/icmp6.h)"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_prune), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_prune), 0, + "Frequency in seconds of checks for expired prefixes and routers"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY, nd6_delay, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_delay), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_delay), 0, + "Delay in seconds before probing for reachability"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES, nd6_umaxtries, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_umaxtries), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_umaxtries), 0, + "Number of ICMPv6 NS messages sent during reachability detection"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES, nd6_mmaxtries, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_mmaxtries), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_mmaxtries), 0, + "Number of ICMPv6 NS messages sent during address resolution"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK, nd6_useloopback, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_useloopback), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_useloopback), 0, + "Create a loopback route when configuring an IPv6 address"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo), 0, + "Mask of enabled RF4620 node information query types"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO_OLDMCPREFIX, nodeinfo_oldmcprefix, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(icmp6_nodeinfo_oldmcprefix), 0, - "Join old IPv6 NI group address in draft-ietf-ipngwg-icmp-name-lookup" - " for compatibility with KAME implememtation."); + &VNET_NAME(icmp6_nodeinfo_oldmcprefix), 0, + "Join old IPv6 NI group address in draft-ietf-ipngwg-icmp-name-lookup " + "for compatibility with KAME implementation"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT, errppslimit, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, + "Maximum number of ICMPv6 error messages per second"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxnudhint), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxnudhint), 0, + ""); /* XXX unused */ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG, nd6_debug, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_debug), 0, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_debug), 0, + "Log NDP debug messages"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861, nd6_onlink_ns_rfc4861, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_onlink_ns_rfc4861), 0, - "Accept 'on-link' nd6 NS in compliance with RFC 4861."); + "Accept 'on-link' ICMPv6 NS messages in compliance with RFC 4861"); From owner-svn-src-all@freebsd.org Sun May 15 03:22:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24EABB3A095; Sun, 15 May 2016 03:22:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6D8B12D4; Sun, 15 May 2016 03:22:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4F3MEWB059074; Sun, 15 May 2016 03:22:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3MEtP059073; Sun, 15 May 2016 03:22:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605150322.u4F3MEtP059073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 15 May 2016 03:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299829 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:22:15 -0000 Author: markj Date: Sun May 15 03:22:13 2016 New Revision: 299829 URL: https://svnweb.freebsd.org/changeset/base/299829 Log: Use Node Information flag names instead of hard-coding their values. MFC after: 1 week Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sun May 15 03:19:53 2016 (r299828) +++ head/sys/netinet6/icmp6.c Sun May 15 03:22:13 2016 (r299829) @@ -667,7 +667,9 @@ icmp6_input(struct mbuf **mp, int *offp, * XXX: this combination of flags is pointless, * but should we keep this for compatibility? */ - if ((V_icmp6_nodeinfo & 5) != 5) + if ((V_icmp6_nodeinfo & (ICMP6_NODEINFO_FQDNOK | + ICMP6_NODEINFO_TMPADDROK)) != + (ICMP6_NODEINFO_FQDNOK | ICMP6_NODEINFO_TMPADDROK)) break; if (code != 0) From owner-svn-src-all@freebsd.org Sun May 15 03:36:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74911B3A2A6; Sun, 15 May 2016 03:36:20 +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 3409619A0; Sun, 15 May 2016 03:36:20 +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 u4F3aJWb062169; Sun, 15 May 2016 03:36:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3aJxd062168; Sun, 15 May 2016 03:36:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150336.u4F3aJxd062168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 03:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299830 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:36:20 -0000 Author: ngie Date: Sun May 15 03:36:19 2016 New Revision: 299830 URL: https://svnweb.freebsd.org/changeset/base/299830 Log: Fix -Wcast-align warnings Use memcpy instead of using direct assignment of void* pointers with CMSG_DATA(..), which changes alignment MFC after: 3 weeks Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Sun May 15 03:22:13 2016 (r299829) +++ head/contrib/bsnmp/snmpd/main.c Sun May 15 03:36:19 2016 (r299830) @@ -1169,7 +1169,7 @@ recv_dgram(struct port_input *pi, struct memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) - cred = (struct sockcred *)CMSG_DATA(cmsg); + memcpy(cred, CMSG_DATA(cmsg), sizeof(struct sockcred)); } if (pi->cred) @@ -1207,7 +1207,7 @@ snmpd_input(struct port_input *pi, struc ret = recv_stream(pi); } else { - struct in_addr *laddr; + struct in_addr laddr; memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); msg.msg_control = cbuf; @@ -1216,11 +1216,11 @@ snmpd_input(struct port_input *pi, struc cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); cmsgp->cmsg_level = IPPROTO_IP; cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); + memcpy(&laddr, CMSG_DATA(cmsgp), sizeof(struct in_addr)); - ret = recv_dgram(pi, laddr); + ret = recv_dgram(pi, &laddr); - if (laddr->s_addr == 0) { + if (laddr.s_addr == 0) { msg.msg_control = NULL; msg.msg_controllen = 0; } From owner-svn-src-all@freebsd.org Sun May 15 03:38:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99931B3A33F; Sun, 15 May 2016 03:38:41 +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 69BAA1B22; Sun, 15 May 2016 03:38:41 +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 u4F3cerS062288; Sun, 15 May 2016 03:38:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3ceTJ062287; Sun, 15 May 2016 03:38:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150338.u4F3ceTJ062287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 03:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299831 - head/usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:38:41 -0000 Author: ngie Date: Sun May 15 03:38:40 2016 New Revision: 299831 URL: https://svnweb.freebsd.org/changeset/base/299831 Log: Remove NO_WERROR and add WARNS?= 6 This now compiles cleanly on all architectures MFC after: 1 month Tested with: clang 3.8, gcc 4.2.1, gcc 4.5, make tinderbox Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Sun May 15 03:36:19 2016 (r299830) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Sun May 15 03:38:40 2016 (r299831) @@ -16,7 +16,6 @@ XSYM= snmpMIB begemotSnmpdModuleTable be freeBSD freeBSDVersion CLEANFILES= oid.h tree.c tree.h MAN= bsnmpd.1 snmpmod.3 -NO_WERROR= FILESGROUPS= BMIBS DEFS @@ -48,4 +47,6 @@ MANFILTER= sed -e 's%@MODPATH@%${LIBDIR} -e 's%@DEFPATH@%${DEFSDIR}/%g' \ -e 's%@MIBSPATH@%${BMIBSDIR}/%g' +WARNS?= 6 + .include From owner-svn-src-all@freebsd.org Sun May 15 03:41:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D13AFB3A445; Sun, 15 May 2016 03:41:02 +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 A357E1D75; Sun, 15 May 2016 03:41:02 +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 u4F3f1km064379; Sun, 15 May 2016 03:41:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3f1tq064378; Sun, 15 May 2016 03:41:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150341.u4F3f1tq064378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 03:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299832 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:41:02 -0000 Author: ngie Date: Sun May 15 03:41:01 2016 New Revision: 299832 URL: https://svnweb.freebsd.org/changeset/base/299832 Log: Remove trailing whitespace in license tort MFC after: 1 week Reported by: igor Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- head/contrib/bsnmp/snmpd/bsnmpd.1 Sun May 15 03:38:40 2016 (r299831) +++ head/contrib/bsnmp/snmpd/bsnmpd.1 Sun May 15 03:41:01 2016 (r299832) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -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. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY 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 From owner-svn-src-all@freebsd.org Sun May 15 03:43:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED9A4B3A5CD; Sun, 15 May 2016 03:43:37 +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 BEC2F10B2; Sun, 15 May 2016 03:43:37 +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 u4F3hax3065128; Sun, 15 May 2016 03:43:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3hasg065127; Sun, 15 May 2016 03:43:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150343.u4F3hasg065127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 03:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299833 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:43:38 -0000 Author: ngie Date: Sun May 15 03:43:36 2016 New Revision: 299833 URL: https://svnweb.freebsd.org/changeset/base/299833 Log: Fix fully canonicalized example for `myvariable.27...` `6` doesn't occur in the OID; it was spurious Bump .Dd for the change MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- head/contrib/bsnmp/snmpd/bsnmpd.1 Sun May 15 03:41:01 2016 (r299832) +++ head/contrib/bsnmp/snmpd/bsnmpd.1 Sun May 15 03:43:36 2016 (r299833) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd September 9, 2010 +.Dd May 10, 2016 .Dt BSNMPD 1 .Os .Sh NAME @@ -227,7 +227,7 @@ myvariable.27.foooll.[localhost]."&^!" .Pp results in the oid .Bd -unfilled -offset indent -myvariable.27.6.102.111.111.111.108.108.127.0.0.1.38.94.33 +myvariable.27.102.111.111.111.108.108.127.0.0.1.38.94.33 .Ed .Pp The value of the assignment may be either empty, a string or a number. From owner-svn-src-all@freebsd.org Sun May 15 03:44:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96682B3A67E; Sun, 15 May 2016 03:44: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 664F4121A; Sun, 15 May 2016 03:44: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 u4F3iWVD065215; Sun, 15 May 2016 03:44:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3iWV2065214; Sun, 15 May 2016 03:44:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150344.u4F3iWV2065214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 03:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299834 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:44:33 -0000 Author: ngie Date: Sun May 15 03:44:32 2016 New Revision: 299834 URL: https://svnweb.freebsd.org/changeset/base/299834 Log: Fix .Dd Today is the 14th, not the 10th of May Reported by: igor (derp) Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- head/contrib/bsnmp/snmpd/bsnmpd.1 Sun May 15 03:43:36 2016 (r299833) +++ head/contrib/bsnmp/snmpd/bsnmpd.1 Sun May 15 03:44:32 2016 (r299834) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd May 10, 2016 +.Dd May 14, 2016 .Dt BSNMPD 1 .Os .Sh NAME From owner-svn-src-all@freebsd.org Sun May 15 03:53:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8C59B3A885; Sun, 15 May 2016 03:53:07 +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 7E54B18DC; Sun, 15 May 2016 03:53:07 +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 u4F3r6wc068374; Sun, 15 May 2016 03:53:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3r6sx068373; Sun, 15 May 2016 03:53:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150353.u4F3r6sx068373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 03:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299836 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 03:53:07 -0000 Author: ngie Date: Sun May 15 03:53:06 2016 New Revision: 299836 URL: https://svnweb.freebsd.org/changeset/base/299836 Log: MFC r298864: Allow FILESGROUPS to be specified more than once by pruning out duplicates Modified: stable/10/share/mk/bsd.files.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.files.mk ============================================================================== --- stable/10/share/mk/bsd.files.mk Sun May 15 03:45:58 2016 (r299835) +++ stable/10/share/mk/bsd.files.mk Sun May 15 03:53:06 2016 (r299836) @@ -9,7 +9,7 @@ ____: FILESGROUPS?= FILES -_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g} +_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g:u} .for group in ${_FILESGROUPS} buildfiles: ${${group}} From owner-svn-src-all@freebsd.org Sun May 15 04:19:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0977B3C18D; Sun, 15 May 2016 04:19: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 C82301377; Sun, 15 May 2016 04:19: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 u4F4JoUN074623; Sun, 15 May 2016 04:19:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F4Jo3Y074622; Sun, 15 May 2016 04:19:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150419.u4F4Jo3Y074622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 04:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299838 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 04:19:52 -0000 Author: ngie Date: Sun May 15 04:19:50 2016 New Revision: 299838 URL: https://svnweb.freebsd.org/changeset/base/299838 Log: Reduce redundancy after release-pkg merge to head in r298107 - Use BINDIR instead of FILESDIR - Default all MODEs to BINMODE with a single for-loop at the bottom of the Makefile - Move all of the conditionals under the relevant MK_* != no build conditional blocks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun May 15 04:06:02 2016 (r299837) +++ head/etc/rc.d/Makefile Sun May 15 04:19:50 2016 (r299838) @@ -2,9 +2,8 @@ .include +BINDIR= /etc/rc.d FILESGROUPS= FILES -FILESDIR= /etc/rc.d -FILESMODE= ${BINMODE} FILES= DAEMON \ FILESYSTEMS \ @@ -134,18 +133,14 @@ FILES= DAEMON \ .if ${MK_ACCT} != "no" FILESGROUPS+= ACCT ACCT+= accounting -.endif -ACCTDIR= /etc/rc.d -ACCTMODE= ${BINMODE} ACCTPACKAGE= acct +.endif .if ${MK_ACPI} != "no" FILESGROUPS+= ACPI ACPI= power_profile -.endif -ACPIDIR= /etc/rc.d -ACPIMODE= ${BINMODE} ACPIPACKAGE= acpi +.endif .if ${MK_ACPI} != "no" || ${MK_APM} != "no" FILES+= powerd @@ -154,19 +149,15 @@ FILES+= powerd .if ${MK_AMD} != "no" FILESGROUPS+= AMD AMD+= amd -.endif -AMDDIR= /etc/rc.d -AMDMODE= ${BINMODE} AMDPACKAGE= amd +.endif .if ${MK_APM} != "no" FILESGROUPS+= APM APM+= apm APM+= apmd -.endif -APMDIR= /etc/rc.d -APMMODE= ${BINMODE} APMPACKAGE= apm +.endif .if ${MK_AUTOFS} != "no" FILES+= automount @@ -190,10 +181,8 @@ FILES+= bootparams .if ${MK_BSNMP} != "no" FILESGROUPS+= BSNMP BSNMP+= bsnmpd -.endif -BSNMPDIR= /etc/rc.d -BSNMPMODE= ${BINMODE} BSNMPPACKAGE= bsnmp +.endif .if ${MK_CCD} != "no" FILES+= ccd @@ -206,10 +195,8 @@ FILES+= ftpd .if ${MK_HAST} != "no" FILESGROUPS+= HAST HAST= hastd -.endif -HASTDIR= /etc/rc.d -HASTMODE= ${BINMODE} HASTPACKAGE= hast +.endif .if ${MK_INETD} != "no" FILES+= inetd @@ -223,10 +210,8 @@ FILES+= iscsid .if ${MK_JAIL} != "no" FILESGROUPS+= JAIL JAIL+= jail -.endif -JAILDIR= /etc/rc.d -JAILMODE= ${BINMODE} JAILPACKAGE= jail +.endif .if ${MK_LEGACY_CONSOLE} != "no" FILES+= moused @@ -269,10 +254,8 @@ FILES+= keyserv .if ${MK_OPENSSH} != "no" FILESGROUPS+= SSH SSH= sshd -.endif -SSHDIR= /etc/rc.d -SSHMODE= ${BINMODE} SSHPACKAGE= ssh +.endif .if ${MK_PF} != "no" FILES+= ftp-proxy @@ -281,10 +264,8 @@ FILES+= ftp-proxy .if ${MK_RCMDS} != "no" FILESGROUPS+= RCMDS RCMDS+= rwho -.endif -RCMDSDIR= /etc/rc.d -RCMDSMODE= ${BINMODE} RCMDSPACKAGE= rcmds +.endif .if ${MK_ROUTED} != "no" FILES+= routed @@ -293,10 +274,8 @@ FILES+= routed .if ${MK_SENDMAIL} != "no" FILESGROUPS+= SMRCD SMRCD= sendmail -.endif -SMRCDDIR= /etc/rc.d -SMRCDMODE= ${BINMODE} SMRCDPACKAGE= sendmail +.endif .if ${MK_TIMED} != "no" FILES+= timed @@ -305,10 +284,8 @@ FILES+= timed .if ${MK_UNBOUND} != "no" FILESGROUPS+= UNBOUND UNBOUND+= local_unbound -.endif -UNBOUNDDIR= /etc/rc.d -UNBOUNDMODE= ${BINMODE} UNBOUNDPACKAGE= unbound +.endif .if ${MK_UTMPX} != "no" _utx= utx @@ -317,14 +294,16 @@ _utx= utx .if ${MK_VI} != "no" FILESGROUPS+= VI VI+= virecover -.endif -VIDIR= /etc/rc.d -VIMODE= ${BINMODE} VIPACKAGE= vi +.endif .if ${MK_WIRELESS} != "no" FILES+= hostapd FILES+= wpa_supplicant .endif +.for fg in ${FILESGROUPS} +${fg}MODE?= ${BINMODE} +.endfor + .include From owner-svn-src-all@freebsd.org Sun May 15 04:29:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59426B3C446; Sun, 15 May 2016 04:29:36 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x242.google.com (mail-oi0-x242.google.com [IPv6:2607:f8b0:4003:c06::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 1FAA419CA; Sun, 15 May 2016 04:29:36 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x242.google.com with SMTP id i2so23836206oib.3; Sat, 14 May 2016 21:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=PDsEXsGqCUzuuPP2CRQFrVSnrL193HVxQXr8oQraDtI=; b=N5++Z/dj8XLWSR/BwIoRSqKchDJc696JFGHvYxic7nxbzydGdhYYz6FyFswQTJME7p tRuGO9tHl9EOEw79KFkSUWsF4y7gCoQab7EICktFbLj1Z8C4NeBQsLEe5px0LHfVVbiE 24DP9veN+V17ip56fwldlfG9J6Edmq+t9tN/YcsloFTVBzB2YDuwtz8h6ZPzBnnym/yZ AOkNPvq61ztHTrcaG/o2ekMgispfFl9npNoFMfj+ETTzbvcthL4DA/kvbOWZHxE4KExY Qcwq199d8mwFkbwhlTz6SQaI4H6kVXee7Ga+GFrkJr1IPaN0CwOykseBuwpbwq2w/xAt KmUw== 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:date :message-id:subject:from:to:cc; bh=PDsEXsGqCUzuuPP2CRQFrVSnrL193HVxQXr8oQraDtI=; b=Cu87sEANlpVbY7ukv+pRyAX0B4rqGtQVCJBK7zVdKQg2KoNirx2VXEYDjre24oE5Dl Yg2IduqV7T5fnRLwHe96aDzWm2bikMVWEIey9Kj311pL+mIhiqe9Zn7Eg6tB1+6/3+1m bb9tAD3CEo1t5XE/pMm+oPrfZKIdyGt4bjEqlYuuy+rwSy8pV2GYP5PIo8EepG5xS/b/ 84rtMdR7vn3fLGQ51lLAFof6hXw6J+BYF5ENrSC69SqJVMWT+3NIvjYPSNkW/7HTxvBV HDGQizFgNZp+Jfvd6MotRXHqZPRjs8MW3pifvYNCffvc7jjpDiE7uS9sp6p5Lvuz/JUr VNNQ== X-Gm-Message-State: AOPr4FVAMM3Ol9tcWBYmOb9oeoa5YBaOXFgPVw/sep4EJvLrhFW3lQcpOfcpgGhmbvpS2oDtXw+q9tXEEQCelA== MIME-Version: 1.0 X-Received: by 10.202.188.134 with SMTP id m128mr13509086oif.4.1463286575368; Sat, 14 May 2016 21:29:35 -0700 (PDT) Received: by 10.157.11.77 with HTTP; Sat, 14 May 2016 21:29:35 -0700 (PDT) In-Reply-To: <201605150338.u4F3ceTJ062287@repo.freebsd.org> References: <201605150338.u4F3ceTJ062287@repo.freebsd.org> Date: Sat, 14 May 2016 23:29:35 -0500 Message-ID: Subject: Re: svn commit: r299831 - head/usr.sbin/bsnmpd/bsnmpd From: Benjamin Kaduk To: Garrett Cooper 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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 04:29:36 -0000 On Sat, May 14, 2016 at 10:38 PM, Garrett Cooper wrote: > Author: ngie > Date: Sun May 15 03:38:40 2016 > New Revision: 299831 > URL: https://svnweb.freebsd.org/changeset/base/299831 > > Log: > Remove NO_WERROR and add WARNS?= 6 > I thought WARNS=6 was already the default. -Ben From owner-svn-src-all@freebsd.org Sun May 15 04:38:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75DCDB3C770; Sun, 15 May 2016 04:38:52 +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 2ACEB1EDE; Sun, 15 May 2016 04:38:52 +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 u4F4cpWf080603; Sun, 15 May 2016 04:38:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F4coNR080598; Sun, 15 May 2016 04:38:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150438.u4F4coNR080598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 04:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299839 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 04:38:52 -0000 Author: ngie Date: Sun May 15 04:38:50 2016 New Revision: 299839 URL: https://svnweb.freebsd.org/changeset/base/299839 Log: Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol Make zfs and zvol come before all of the items that depended on them previously MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/FILESYSTEMS head/etc/rc.d/dumpon head/etc/rc.d/var head/etc/rc.d/zfs head/etc/rc.d/zvol Modified: head/etc/rc.d/FILESYSTEMS ============================================================================== --- head/etc/rc.d/FILESYSTEMS Sun May 15 04:19:50 2016 (r299838) +++ head/etc/rc.d/FILESYSTEMS Sun May 15 04:38:50 2016 (r299839) @@ -4,7 +4,7 @@ # # PROVIDE: FILESYSTEMS -# REQUIRE: root mountcritlocal cleanvar zfs +# REQUIRE: root mountcritlocal cleanvar # This is a dummy dependency, for services which require filesystems # to be mounted before starting. It also serves as the default early / Modified: head/etc/rc.d/dumpon ============================================================================== --- head/etc/rc.d/dumpon Sun May 15 04:19:50 2016 (r299838) +++ head/etc/rc.d/dumpon Sun May 15 04:38:50 2016 (r299839) @@ -4,7 +4,6 @@ # # PROVIDE: dumpon -# REQUIRE: zvol # BEFORE: disks # KEYWORD: nojail Modified: head/etc/rc.d/var ============================================================================== --- head/etc/rc.d/var Sun May 15 04:19:50 2016 (r299838) +++ head/etc/rc.d/var Sun May 15 04:38:50 2016 (r299839) @@ -28,7 +28,7 @@ # # PROVIDE: var -# REQUIRE: mountcritlocal zfs +# REQUIRE: mountcritlocal # NFS /var is not supported, unless NFS /var is part of diskless NFS / Modified: head/etc/rc.d/zfs ============================================================================== --- head/etc/rc.d/zfs Sun May 15 04:19:50 2016 (r299838) +++ head/etc/rc.d/zfs Sun May 15 04:38:50 2016 (r299839) @@ -5,6 +5,7 @@ # PROVIDE: zfs # REQUIRE: mountcritlocal +# BEFORE: FILESYSTEMS var . /etc/rc.subr Modified: head/etc/rc.d/zvol ============================================================================== --- head/etc/rc.d/zvol Sun May 15 04:19:50 2016 (r299838) +++ head/etc/rc.d/zvol Sun May 15 04:38:50 2016 (r299839) @@ -5,6 +5,7 @@ # PROVIDE: zvol # REQUIRE: hostid +# BEFORE: dumpon # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@freebsd.org Sun May 15 04:39:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C49CCB3C7D4; Sun, 15 May 2016 04:39:37 +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 9241E1076; Sun, 15 May 2016 04:39:37 +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 u4F4dajh080675; Sun, 15 May 2016 04:39:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F4daim080674; Sun, 15 May 2016 04:39:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150439.u4F4daim080674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 04:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299840 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 04:39:37 -0000 Author: ngie Date: Sun May 15 04:39:36 2016 New Revision: 299840 URL: https://svnweb.freebsd.org/changeset/base/299840 Log: Conditionalize etc/rc.d/{zfs,zvol} install on MK_ZFS != no MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun May 15 04:38:50 2016 (r299839) +++ head/etc/rc.d/Makefile Sun May 15 04:39:36 2016 (r299840) @@ -127,8 +127,6 @@ FILES= DAEMON \ ypset \ ypupdated \ ypxfrd \ - zfs \ - zvol .if ${MK_ACCT} != "no" FILESGROUPS+= ACCT @@ -302,6 +300,13 @@ FILES+= hostapd FILES+= wpa_supplicant .endif +.if ${MK_ZFS} != "no" +FILESGROUPS+= ZFS +ZFS+= zfs +ZFS+= zvol +ZFSPACKAGE= zfs +.endif + .for fg in ${FILESGROUPS} ${fg}MODE?= ${BINMODE} .endfor From owner-svn-src-all@freebsd.org Sun May 15 05:22:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74848B3C0C7; Sun, 15 May 2016 05:22: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 40B39127F; Sun, 15 May 2016 05:22: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 u4F5MFqq095351; Sun, 15 May 2016 05:22:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F5MFJW095350; Sun, 15 May 2016 05:22:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150522.u4F5MFJW095350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 05:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299841 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 05:22:16 -0000 Author: ngie Date: Sun May 15 05:22:15 2016 New Revision: 299841 URL: https://svnweb.freebsd.org/changeset/base/299841 Log: Remove etc/rc.d/{zfs,zvol} if MK_ZFS != no MFC after: 2 weeks X-MFC with: r299840 Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 15 04:39:36 2016 (r299840) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 15 05:22:15 2016 (r299841) @@ -1010,6 +1010,8 @@ OLD_DIRS+=usr/share/dtrace OLD_FILES+=boot/gptzfsboot OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader +OLD_FILES+=etc/rc.d/zfs +OLD_FILES+=etc/rc.d/zvol OLD_FILES+=etc/devd/zfs.conf OLD_FILES+=etc/periodic/daily/404.status-zfs OLD_FILES+=etc/periodic/daily/800.scrub-zfs From owner-svn-src-all@freebsd.org Sun May 15 05:38:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D043AB3C237; Sun, 15 May 2016 05:38:48 +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 73D6D17F2; Sun, 15 May 2016 05:38:48 +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 u4F5clfH098533; Sun, 15 May 2016 05:38:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F5cl8e098530; Sun, 15 May 2016 05:38:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150538.u4F5cl8e098530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 05:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299842 - in head: etc/rc.d 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 05:38:48 -0000 Author: ngie Date: Sun May 15 05:38:47 2016 New Revision: 299842 URL: https://svnweb.freebsd.org/changeset/base/299842 Log: Conditionalize installing etc/rc.d/atm{1,2,3} `BEFORE: netif` was already in etc/rc.d/atm1, so no additional changes are needed in that script MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile head/etc/rc.d/netif head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun May 15 05:22:15 2016 (r299841) +++ head/etc/rc.d/Makefile Sun May 15 05:38:47 2016 (r299842) @@ -14,9 +14,6 @@ FILES= DAEMON \ addswap \ adjkerntz \ archdep \ - atm1 \ - atm2 \ - atm3 \ auditd \ auditdistd \ bgfsck \ @@ -157,6 +154,14 @@ APM+= apmd APMPACKAGE= apm .endif +.if ${MK_ATM} != "no" +FILESGROUPS+= ATM +ATM+= atm1 +ATM+= atm2 +ATM+= atm3 +ATMPACKAGE= atm +.endif + .if ${MK_AUTOFS} != "no" FILES+= automount FILES+= automountd Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sun May 15 05:22:15 2016 (r299841) +++ head/etc/rc.d/netif Sun May 15 05:38:47 2016 (r299842) @@ -26,7 +26,7 @@ # # PROVIDE: netif -# REQUIRE: atm1 FILESYSTEMS iovctl serial sppp sysctl +# REQUIRE: FILESYSTEMS iovctl serial sppp sysctl # REQUIRE: ipfilter ipfs # KEYWORD: nojailvnet Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 15 05:22:15 2016 (r299841) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 15 05:38:47 2016 (r299842) @@ -76,6 +76,9 @@ OLD_FILES+=usr/share/man/man8/atrun.8.gz .endif .if ${MK_ATM} == no +OLD_FILES+=etc/rc.d/atm1 +OLD_FILES+=etc/rc.d/atm2 +OLD_FILES+=etc/rc.d/atm3 OLD_FILES+=rescue/atmconfig OLD_FILES+=sbin/atmconfig OLD_FILES+=usr/bin/sscop From owner-svn-src-all@freebsd.org Sun May 15 05:45:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ABEEB3C4F1; Sun, 15 May 2016 05:45:56 +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 E175E1DDE; Sun, 15 May 2016 05:45:55 +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 u4F5jtSJ001539; Sun, 15 May 2016 05:45:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F5jtu7001537; Sun, 15 May 2016 05:45:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150545.u4F5jtu7001537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 05:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299843 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 05:45:56 -0000 Author: ngie Date: Sun May 15 05:45:54 2016 New Revision: 299843 URL: https://svnweb.freebsd.org/changeset/base/299843 Log: Fix broken dependency with routed when MK_ROUTED != no Remove routed as a requirement in NETWORKING, and put it in routed as a BEFORE requirement instead MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/NETWORKING head/etc/rc.d/routed Modified: head/etc/rc.d/NETWORKING ============================================================================== --- head/etc/rc.d/NETWORKING Sun May 15 05:38:47 2016 (r299842) +++ head/etc/rc.d/NETWORKING Sun May 15 05:45:54 2016 (r299843) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netwait netoptions routing ppp ipfw stf -# REQUIRE: defaultroute routed route6d resolv bridge +# REQUIRE: defaultroute route6d resolv bridge # REQUIRE: static_arp static_ndp # This is a dummy dependency, for services which require networking Modified: head/etc/rc.d/routed ============================================================================== --- head/etc/rc.d/routed Sun May 15 05:38:47 2016 (r299842) +++ head/etc/rc.d/routed Sun May 15 05:45:54 2016 (r299843) @@ -5,6 +5,7 @@ # PROVIDE: routed # REQUIRE: netif routing +# BEFORE: NETWORK # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@freebsd.org Sun May 15 06:00:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5014FB3C689; Sun, 15 May 2016 06:00:14 +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 1DDBF1212; Sun, 15 May 2016 06:00:14 +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 u4F60D75004681; Sun, 15 May 2016 06:00:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F60D48004680; Sun, 15 May 2016 06:00:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150600.u4F60D48004680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 06:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299844 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 06:00:14 -0000 Author: ngie Date: Sun May 15 06:00:13 2016 New Revision: 299844 URL: https://svnweb.freebsd.org/changeset/base/299844 Log: Make hostid_save depend on hostid MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/hostid_save Modified: head/etc/rc.d/hostid_save ============================================================================== --- head/etc/rc.d/hostid_save Sun May 15 05:45:54 2016 (r299843) +++ head/etc/rc.d/hostid_save Sun May 15 06:00:13 2016 (r299844) @@ -4,7 +4,7 @@ # # PROVIDE: hostid_save -# REQUIRE: root +# REQUIRE: hostid root # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@freebsd.org Sun May 15 06:06:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0AB2B3C7BE; Sun, 15 May 2016 06:06:23 +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 91C5F1745; Sun, 15 May 2016 06:06:23 +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 u4F66MPV007499; Sun, 15 May 2016 06:06:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F66MLv007498; Sun, 15 May 2016 06:06:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605150606.u4F66MLv007498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 May 2016 06:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299845 - head/sbin/routed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 06:06:23 -0000 Author: pfg Date: Sun May 15 06:06:22 2016 New Revision: 299845 URL: https://svnweb.freebsd.org/changeset/base/299845 Log: routed(8): Use arc4random_uniform instead of arc4random. Use arc4random_uniform() when the desired random number upper bound is not a power of two. While here, we don't need srandom() and friends anymore. Obtained from: OpenBSD (CVS rev. 1.20) Modified: head/sbin/routed/main.c Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sun May 15 06:00:13 2016 (r299844) +++ head/sbin/routed/main.c Sun May 15 06:06:22 2016 (r299845) @@ -303,11 +303,6 @@ usage: pidfile(0); #endif mypid = getpid(); -#ifdef __FreeBSD__ - srandomdev(); -#else - srandom((int)(clk.tv_sec ^ clk.tv_usec ^ mypid)); -#endif /* prepare socket connected to the kernel. */ @@ -826,8 +821,8 @@ intvl_random(struct timeval *tp, /* put { tp->tv_sec = (time_t)(hi == lo ? lo - : (lo + arc4random() % ((hi - lo)))); - tp->tv_usec = arc4random() % 1000000; + : (lo + arc4random_uniform(1 + hi - lo))); + tp->tv_usec = arc4random_uniform(1000000); } From owner-svn-src-all@freebsd.org Sun May 15 06:11:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D30CB3C852; Sun, 15 May 2016 06:11:42 +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 D76B31AC5; Sun, 15 May 2016 06:11:41 +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 u4F6Bfdo009696; Sun, 15 May 2016 06:11:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F6BfcU009695; Sun, 15 May 2016 06:11:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605150611.u4F6BfcU009695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 May 2016 06:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299846 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 06:11:42 -0000 Author: adrian Date: Sun May 15 06:11:40 2016 New Revision: 299846 URL: https://svnweb.freebsd.org/changeset/base/299846 Log: [bwn] commit the N-PHY register set. Obtained from: Linux b43 (register definitions.) Added: head/sys/dev/bwn/if_bwn_phy_n_regs.h (contents, props changed) Added: head/sys/dev/bwn/if_bwn_phy_n_regs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_phy_n_regs.h Sun May 15 06:11:40 2016 (r299846) @@ -0,0 +1,904 @@ +/*- + * Copyright (c) 2016 Adrian Chadd + * 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 + * 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 NONINFRINGEMENT, 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. + * + * $FreeBSD$ + */ +#ifndef __IF_BWN_PHY_N_REGS_H__ +#define __IF_BWN_PHY_N_REGS_H__ + +/* N-PHY registers. */ + +#define BWN_NPHY_BBCFG BWN_PHY_N(0x001) /* BB config */ +#define BWN_NPHY_BBCFG_RSTCCA 0x4000 /* Reset CCA */ +#define BWN_NPHY_BBCFG_RSTRX 0x8000 /* Reset RX */ +#define BWN_NPHY_CHANNEL BWN_PHY_N(0x005) /* Channel */ +#define BWN_NPHY_TXERR BWN_PHY_N(0x007) /* TX error */ +#define BWN_NPHY_BANDCTL BWN_PHY_N(0x009) /* Band control */ +#define BWN_NPHY_BANDCTL_5GHZ 0x0001 /* Use the 5GHz band */ +#define BWN_NPHY_4WI_ADDR BWN_PHY_N(0x00B) /* Four-wire bus address */ +#define BWN_NPHY_4WI_DATAHI BWN_PHY_N(0x00C) /* Four-wire bus data high */ +#define BWN_NPHY_4WI_DATALO BWN_PHY_N(0x00D) /* Four-wire bus data low */ +#define BWN_NPHY_BIST_STAT0 BWN_PHY_N(0x00E) /* Built-in self test status 0 */ +#define BWN_NPHY_BIST_STAT1 BWN_PHY_N(0x00F) /* Built-in self test status 1 */ + +#define BWN_NPHY_C1_DESPWR BWN_PHY_N(0x018) /* Core 1 desired power */ +#define BWN_NPHY_C1_CCK_DESPWR BWN_PHY_N(0x019) /* Core 1 CCK desired power */ +#define BWN_NPHY_C1_BCLIPBKOFF BWN_PHY_N(0x01A) /* Core 1 barely clip backoff */ +#define BWN_NPHY_C1_CCK_BCLIPBKOFF BWN_PHY_N(0x01B) /* Core 1 CCK barely clip backoff */ +#define BWN_NPHY_C1_CGAINI BWN_PHY_N(0x01C) /* Core 1 compute gain info */ +#define BWN_NPHY_C1_CGAINI_GAINBKOFF 0x001F /* Gain backoff */ +#define BWN_NPHY_C1_CGAINI_GAINBKOFF_SHIFT 0 +#define BWN_NPHY_C1_CGAINI_CLIPGBKOFF 0x03E0 /* Clip gain backoff */ +#define BWN_NPHY_C1_CGAINI_CLIPGBKOFF_SHIFT 5 +#define BWN_NPHY_C1_CGAINI_GAINSTEP 0x1C00 /* Gain step */ +#define BWN_NPHY_C1_CGAINI_GAINSTEP_SHIFT 10 +#define BWN_NPHY_C1_CGAINI_CL2DETECT 0x2000 /* Clip 2 detect mask */ +#define BWN_NPHY_C1_CCK_CGAINI BWN_PHY_N(0x01D) /* Core 1 CCK compute gain info */ +#define BWN_NPHY_C1_CCK_CGAINI_GAINBKOFF 0x001F /* Gain backoff */ +#define BWN_NPHY_C1_CCK_CGAINI_CLIPGBKOFF 0x01E0 /* CCK barely clip gain backoff */ +#define BWN_NPHY_C1_MINMAX_GAIN BWN_PHY_N(0x01E) /* Core 1 min/max gain */ +#define BWN_NPHY_C1_MINGAIN 0x00FF /* Minimum gain */ +#define BWN_NPHY_C1_MINGAIN_SHIFT 0 +#define BWN_NPHY_C1_MAXGAIN 0xFF00 /* Maximum gain */ +#define BWN_NPHY_C1_MAXGAIN_SHIFT 8 +#define BWN_NPHY_C1_CCK_MINMAX_GAIN BWN_PHY_N(0x01F) /* Core 1 CCK min/max gain */ +#define BWN_NPHY_C1_CCK_MINGAIN 0x00FF /* Minimum gain */ +#define BWN_NPHY_C1_CCK_MINGAIN_SHIFT 0 +#define BWN_NPHY_C1_CCK_MAXGAIN 0xFF00 /* Maximum gain */ +#define BWN_NPHY_C1_CCK_MAXGAIN_SHIFT 8 +#define BWN_NPHY_C1_INITGAIN BWN_PHY_N(0x020) /* Core 1 initial gain code */ +#define BWN_NPHY_C1_INITGAIN_EXTLNA 0x0001 /* External LNA index */ +#define BWN_NPHY_C1_INITGAIN_LNA 0x0006 /* LNA index */ +#define BWN_NPHY_C1_INITGAIN_LNAIDX_SHIFT 1 +#define BWN_NPHY_C1_INITGAIN_HPVGA1 0x0078 /* HPVGA1 index */ +#define BWN_NPHY_C1_INITGAIN_HPVGA1_SHIFT 3 +#define BWN_NPHY_C1_INITGAIN_HPVGA2 0x0F80 /* HPVGA2 index */ +#define BWN_NPHY_C1_INITGAIN_HPVGA2_SHIFT 7 +#define BWN_NPHY_C1_INITGAIN_TRRX 0x1000 /* TR RX index */ +#define BWN_NPHY_C1_INITGAIN_TRTX 0x2000 /* TR TX index */ +#define BWN_NPHY_REV3_C1_INITGAIN_A BWN_PHY_N(0x020) +#define BWN_NPHY_C1_CLIP1_HIGAIN BWN_PHY_N(0x021) /* Core 1 clip1 high gain code */ +#define BWN_NPHY_REV3_C1_INITGAIN_B BWN_PHY_N(0x021) +#define BWN_NPHY_C1_CLIP1_MEDGAIN BWN_PHY_N(0x022) /* Core 1 clip1 medium gain code */ +#define BWN_NPHY_REV3_C1_CLIP_HIGAIN_A BWN_PHY_N(0x022) +#define BWN_NPHY_C1_CLIP1_LOGAIN BWN_PHY_N(0x023) /* Core 1 clip1 low gain code */ +#define BWN_NPHY_REV3_C1_CLIP_HIGAIN_B BWN_PHY_N(0x023) +#define BWN_NPHY_C1_CLIP2_GAIN BWN_PHY_N(0x024) /* Core 1 clip2 gain code */ +#define BWN_NPHY_REV3_C1_CLIP_MEDGAIN_A BWN_PHY_N(0x024) +#define BWN_NPHY_C1_FILTERGAIN BWN_PHY_N(0x025) /* Core 1 filter gain */ +#define BWN_NPHY_C1_LPF_QHPF_BW BWN_PHY_N(0x026) /* Core 1 LPF Q HP F bandwidth */ +#define BWN_NPHY_C1_CLIPWBTHRES BWN_PHY_N(0x027) /* Core 1 clip wideband threshold */ +#define BWN_NPHY_C1_CLIPWBTHRES_CLIP2 0x003F /* Clip 2 */ +#define BWN_NPHY_C1_CLIPWBTHRES_CLIP2_SHIFT 0 +#define BWN_NPHY_C1_CLIPWBTHRES_CLIP1 0x0FC0 /* Clip 1 */ +#define BWN_NPHY_C1_CLIPWBTHRES_CLIP1_SHIFT 6 +#define BWN_NPHY_C1_W1THRES BWN_PHY_N(0x028) /* Core 1 W1 threshold */ +#define BWN_NPHY_C1_EDTHRES BWN_PHY_N(0x029) /* Core 1 ED threshold */ +#define BWN_NPHY_C1_SMSIGTHRES BWN_PHY_N(0x02A) /* Core 1 small sig threshold */ +#define BWN_NPHY_C1_NBCLIPTHRES BWN_PHY_N(0x02B) /* Core 1 NB clip threshold */ +#define BWN_NPHY_C1_CLIP1THRES BWN_PHY_N(0x02C) /* Core 1 clip1 threshold */ +#define BWN_NPHY_C1_CLIP2THRES BWN_PHY_N(0x02D) /* Core 1 clip2 threshold */ + +#define BWN_NPHY_C2_DESPWR BWN_PHY_N(0x02E) /* Core 2 desired power */ +#define BWN_NPHY_C2_CCK_DESPWR BWN_PHY_N(0x02F) /* Core 2 CCK desired power */ +#define BWN_NPHY_C2_BCLIPBKOFF BWN_PHY_N(0x030) /* Core 2 barely clip backoff */ +#define BWN_NPHY_C2_CCK_BCLIPBKOFF BWN_PHY_N(0x031) /* Core 2 CCK barely clip backoff */ +#define BWN_NPHY_C2_CGAINI BWN_PHY_N(0x032) /* Core 2 compute gain info */ +#define BWN_NPHY_C2_CGAINI_GAINBKOFF 0x001F /* Gain backoff */ +#define BWN_NPHY_C2_CGAINI_GAINBKOFF_SHIFT 0 +#define BWN_NPHY_C2_CGAINI_CLIPGBKOFF 0x03E0 /* Clip gain backoff */ +#define BWN_NPHY_C2_CGAINI_CLIPGBKOFF_SHIFT 5 +#define BWN_NPHY_C2_CGAINI_GAINSTEP 0x1C00 /* Gain step */ +#define BWN_NPHY_C2_CGAINI_GAINSTEP_SHIFT 10 +#define BWN_NPHY_C2_CGAINI_CL2DETECT 0x2000 /* Clip 2 detect mask */ +#define BWN_NPHY_C2_CCK_CGAINI BWN_PHY_N(0x033) /* Core 2 CCK compute gain info */ +#define BWN_NPHY_C2_CCK_CGAINI_GAINBKOFF 0x001F /* Gain backoff */ +#define BWN_NPHY_C2_CCK_CGAINI_CLIPGBKOFF 0x01E0 /* CCK barely clip gain backoff */ +#define BWN_NPHY_C2_MINMAX_GAIN BWN_PHY_N(0x034) /* Core 2 min/max gain */ +#define BWN_NPHY_C2_MINGAIN 0x00FF /* Minimum gain */ +#define BWN_NPHY_C2_MINGAIN_SHIFT 0 +#define BWN_NPHY_C2_MAXGAIN 0xFF00 /* Maximum gain */ +#define BWN_NPHY_C2_MAXGAIN_SHIFT 8 +#define BWN_NPHY_C2_CCK_MINMAX_GAIN BWN_PHY_N(0x035) /* Core 2 CCK min/max gain */ +#define BWN_NPHY_C2_CCK_MINGAIN 0x00FF /* Minimum gain */ +#define BWN_NPHY_C2_CCK_MINGAIN_SHIFT 0 +#define BWN_NPHY_C2_CCK_MAXGAIN 0xFF00 /* Maximum gain */ +#define BWN_NPHY_C2_CCK_MAXGAIN_SHIFT 8 +#define BWN_NPHY_C2_INITGAIN BWN_PHY_N(0x036) /* Core 2 initial gain code */ +#define BWN_NPHY_C2_INITGAIN_EXTLNA 0x0001 /* External LNA index */ +#define BWN_NPHY_C2_INITGAIN_LNA 0x0006 /* LNA index */ +#define BWN_NPHY_C2_INITGAIN_LNAIDX_SHIFT 1 +#define BWN_NPHY_C2_INITGAIN_HPVGA1 0x0078 /* HPVGA1 index */ +#define BWN_NPHY_C2_INITGAIN_HPVGA1_SHIFT 3 +#define BWN_NPHY_C2_INITGAIN_HPVGA2 0x0F80 /* HPVGA2 index */ +#define BWN_NPHY_C2_INITGAIN_HPVGA2_SHIFT 7 +#define BWN_NPHY_C2_INITGAIN_TRRX 0x1000 /* TR RX index */ +#define BWN_NPHY_C2_INITGAIN_TRTX 0x2000 /* TR TX index */ +#define BWN_NPHY_REV3_C1_CLIP_MEDGAIN_B BWN_PHY_N(0x036) +#define BWN_NPHY_C2_CLIP1_HIGAIN BWN_PHY_N(0x037) /* Core 2 clip1 high gain code */ +#define BWN_NPHY_REV3_C1_CLIP_LOGAIN_A BWN_PHY_N(0x037) +#define BWN_NPHY_C2_CLIP1_MEDGAIN BWN_PHY_N(0x038) /* Core 2 clip1 medium gain code */ +#define BWN_NPHY_REV3_C1_CLIP_LOGAIN_B BWN_PHY_N(0x038) +#define BWN_NPHY_C2_CLIP1_LOGAIN BWN_PHY_N(0x039) /* Core 2 clip1 low gain code */ +#define BWN_NPHY_REV3_C1_CLIP2_GAIN_A BWN_PHY_N(0x039) +#define BWN_NPHY_C2_CLIP2_GAIN BWN_PHY_N(0x03A) /* Core 2 clip2 gain code */ +#define BWN_NPHY_REV3_C1_CLIP2_GAIN_B BWN_PHY_N(0x03A) +#define BWN_NPHY_C2_FILTERGAIN BWN_PHY_N(0x03B) /* Core 2 filter gain */ +#define BWN_NPHY_C2_LPF_QHPF_BW BWN_PHY_N(0x03C) /* Core 2 LPF Q HP F bandwidth */ +#define BWN_NPHY_C2_CLIPWBTHRES BWN_PHY_N(0x03D) /* Core 2 clip wideband threshold */ +#define BWN_NPHY_C2_CLIPWBTHRES_CLIP2 0x003F /* Clip 2 */ +#define BWN_NPHY_C2_CLIPWBTHRES_CLIP2_SHIFT 0 +#define BWN_NPHY_C2_CLIPWBTHRES_CLIP1 0x0FC0 /* Clip 1 */ +#define BWN_NPHY_C2_CLIPWBTHRES_CLIP1_SHIFT 6 +#define BWN_NPHY_C2_W1THRES BWN_PHY_N(0x03E) /* Core 2 W1 threshold */ +#define BWN_NPHY_C2_EDTHRES BWN_PHY_N(0x03F) /* Core 2 ED threshold */ +#define BWN_NPHY_C2_SMSIGTHRES BWN_PHY_N(0x040) /* Core 2 small sig threshold */ +#define BWN_NPHY_C2_NBCLIPTHRES BWN_PHY_N(0x041) /* Core 2 NB clip threshold */ +#define BWN_NPHY_C2_CLIP1THRES BWN_PHY_N(0x042) /* Core 2 clip1 threshold */ +#define BWN_NPHY_C2_CLIP2THRES BWN_PHY_N(0x043) /* Core 2 clip2 threshold */ + +#define BWN_NPHY_CRS_THRES1 BWN_PHY_N(0x044) /* CRS threshold 1 */ +#define BWN_NPHY_CRS_THRES2 BWN_PHY_N(0x045) /* CRS threshold 2 */ +#define BWN_NPHY_CRS_THRES3 BWN_PHY_N(0x046) /* CRS threshold 3 */ +#define BWN_NPHY_CRSCTL BWN_PHY_N(0x047) /* CRS control */ +#define BWN_NPHY_DCFADDR BWN_PHY_N(0x048) /* DC filter address */ +#define BWN_NPHY_RXF20_NUM0 BWN_PHY_N(0x049) /* RX filter 20 numerator 0 */ +#define BWN_NPHY_RXF20_NUM1 BWN_PHY_N(0x04A) /* RX filter 20 numerator 1 */ +#define BWN_NPHY_RXF20_NUM2 BWN_PHY_N(0x04B) /* RX filter 20 numerator 2 */ +#define BWN_NPHY_RXF20_DENOM0 BWN_PHY_N(0x04C) /* RX filter 20 denominator 0 */ +#define BWN_NPHY_RXF20_DENOM1 BWN_PHY_N(0x04D) /* RX filter 20 denominator 1 */ +#define BWN_NPHY_RXF20_NUM10 BWN_PHY_N(0x04E) /* RX filter 20 numerator 10 */ +#define BWN_NPHY_RXF20_NUM11 BWN_PHY_N(0x04F) /* RX filter 20 numerator 11 */ +#define BWN_NPHY_RXF20_NUM12 BWN_PHY_N(0x050) /* RX filter 20 numerator 12 */ +#define BWN_NPHY_RXF20_DENOM10 BWN_PHY_N(0x051) /* RX filter 20 denominator 10 */ +#define BWN_NPHY_RXF20_DENOM11 BWN_PHY_N(0x052) /* RX filter 20 denominator 11 */ +#define BWN_NPHY_RXF40_NUM0 BWN_PHY_N(0x053) /* RX filter 40 numerator 0 */ +#define BWN_NPHY_RXF40_NUM1 BWN_PHY_N(0x054) /* RX filter 40 numerator 1 */ +#define BWN_NPHY_RXF40_NUM2 BWN_PHY_N(0x055) /* RX filter 40 numerator 2 */ +#define BWN_NPHY_RXF40_DENOM0 BWN_PHY_N(0x056) /* RX filter 40 denominator 0 */ +#define BWN_NPHY_RXF40_DENOM1 BWN_PHY_N(0x057) /* RX filter 40 denominator 1 */ +#define BWN_NPHY_RXF40_NUM10 BWN_PHY_N(0x058) /* RX filter 40 numerator 10 */ +#define BWN_NPHY_RXF40_NUM11 BWN_PHY_N(0x059) /* RX filter 40 numerator 11 */ +#define BWN_NPHY_RXF40_NUM12 BWN_PHY_N(0x05A) /* RX filter 40 numerator 12 */ +#define BWN_NPHY_RXF40_DENOM10 BWN_PHY_N(0x05B) /* RX filter 40 denominator 10 */ +#define BWN_NPHY_RXF40_DENOM11 BWN_PHY_N(0x05C) /* RX filter 40 denominator 11 */ +#define BWN_NPHY_PPROC_RSTLEN BWN_PHY_N(0x060) /* Packet processing reset length */ +#define BWN_NPHY_INITCARR_DLEN BWN_PHY_N(0x061) /* Initial carrier detection length */ +#define BWN_NPHY_CLIP1CARR_DLEN BWN_PHY_N(0x062) /* Clip1 carrier detection length */ +#define BWN_NPHY_CLIP2CARR_DLEN BWN_PHY_N(0x063) /* Clip2 carrier detection length */ +#define BWN_NPHY_INITGAIN_SLEN BWN_PHY_N(0x064) /* Initial gain settle length */ +#define BWN_NPHY_CLIP1GAIN_SLEN BWN_PHY_N(0x065) /* Clip1 gain settle length */ +#define BWN_NPHY_CLIP2GAIN_SLEN BWN_PHY_N(0x066) /* Clip2 gain settle length */ +#define BWN_NPHY_PACKGAIN_SLEN BWN_PHY_N(0x067) /* Packet gain settle length */ +#define BWN_NPHY_CARRSRC_TLEN BWN_PHY_N(0x068) /* Carrier search timeout length */ +#define BWN_NPHY_TISRC_TLEN BWN_PHY_N(0x069) /* Timing search timeout length */ +#define BWN_NPHY_ENDROP_TLEN BWN_PHY_N(0x06A) /* Energy drop timeout length */ +#define BWN_NPHY_CLIP1_NBDWELL_LEN BWN_PHY_N(0x06B) /* Clip1 NB dwell length */ +#define BWN_NPHY_CLIP2_NBDWELL_LEN BWN_PHY_N(0x06C) /* Clip2 NB dwell length */ +#define BWN_NPHY_W1CLIP1_DWELL_LEN BWN_PHY_N(0x06D) /* W1 clip1 dwell length */ +#define BWN_NPHY_W1CLIP2_DWELL_LEN BWN_PHY_N(0x06E) /* W1 clip2 dwell length */ +#define BWN_NPHY_W2CLIP1_DWELL_LEN BWN_PHY_N(0x06F) /* W2 clip1 dwell length */ +#define BWN_NPHY_PLOAD_CSENSE_EXTLEN BWN_PHY_N(0x070) /* Payload carrier sense extension length */ +#define BWN_NPHY_EDROP_CSENSE_EXTLEN BWN_PHY_N(0x071) /* Energy drop carrier sense extension length */ +#define BWN_NPHY_TABLE_ADDR BWN_PHY_N(0x072) /* Table address */ +#define BWN_NPHY_TABLE_DATALO BWN_PHY_N(0x073) /* Table data low */ +#define BWN_NPHY_TABLE_DATAHI BWN_PHY_N(0x074) /* Table data high */ +#define BWN_NPHY_WWISE_LENIDX BWN_PHY_N(0x075) /* WWiSE length index */ +#define BWN_NPHY_TGNSYNC_LENIDX BWN_PHY_N(0x076) /* TGNsync length index */ +#define BWN_NPHY_TXMACIF_HOLDOFF BWN_PHY_N(0x077) /* TX MAC IF Hold off */ +#define BWN_NPHY_RFCTL_CMD BWN_PHY_N(0x078) /* RF control (command) */ +#define BWN_NPHY_RFCTL_CMD_START 0x0001 /* Start sequence */ +#define BWN_NPHY_RFCTL_CMD_RXTX 0x0002 /* RX/TX */ +#define BWN_NPHY_RFCTL_CMD_CORESEL 0x0038 /* Core select */ +#define BWN_NPHY_RFCTL_CMD_CORESEL_SHIFT 3 +#define BWN_NPHY_RFCTL_CMD_PORFORCE 0x0040 /* POR force */ +#define BWN_NPHY_RFCTL_CMD_OEPORFORCE 0x0080 /* OE POR force */ +#define BWN_NPHY_RFCTL_CMD_RXEN 0x0100 /* RX enable */ +#define BWN_NPHY_RFCTL_CMD_TXEN 0x0200 /* TX enable */ +#define BWN_NPHY_RFCTL_CMD_CHIP0PU 0x0400 /* Chip0 PU */ +#define BWN_NPHY_RFCTL_CMD_EN 0x0800 /* Radio enabled */ +#define BWN_NPHY_RFCTL_CMD_SEQENCORE 0xF000 /* Seq en core */ +#define BWN_NPHY_RFCTL_CMD_SEQENCORE_SHIFT 12 +#define BWN_NPHY_RFCTL_RSSIO1 BWN_PHY_N(0x07A) /* RF control (RSSI others 1) */ +#define BWN_NPHY_RFCTL_RSSIO1_RXPD 0x0001 /* RX PD */ +#define BWN_NPHY_RFCTL_RSSIO1_TXPD 0x0002 /* TX PD */ +#define BWN_NPHY_RFCTL_RSSIO1_PAPD 0x0004 /* PA PD */ +#define BWN_NPHY_RFCTL_RSSIO1_RSSICTL 0x0030 /* RSSI control */ +#define BWN_NPHY_RFCTL_RSSIO1_LPFBW 0x00C0 /* LPF bandwidth */ +#define BWN_NPHY_RFCTL_RSSIO1_HPFBWHI 0x0100 /* HPF bandwidth high */ +#define BWN_NPHY_RFCTL_RSSIO1_HIQDISCO 0x0200 /* HIQ dis core */ +#define BWN_NPHY_RFCTL_RXG1 BWN_PHY_N(0x07B) /* RF control (RX gain 1) */ +#define BWN_NPHY_RFCTL_TXG1 BWN_PHY_N(0x07C) /* RF control (TX gain 1) */ +#define BWN_NPHY_RFCTL_RSSIO2 BWN_PHY_N(0x07D) /* RF control (RSSI others 2) */ +#define BWN_NPHY_RFCTL_RSSIO2_RXPD 0x0001 /* RX PD */ +#define BWN_NPHY_RFCTL_RSSIO2_TXPD 0x0002 /* TX PD */ +#define BWN_NPHY_RFCTL_RSSIO2_PAPD 0x0004 /* PA PD */ +#define BWN_NPHY_RFCTL_RSSIO2_RSSICTL 0x0030 /* RSSI control */ +#define BWN_NPHY_RFCTL_RSSIO2_LPFBW 0x00C0 /* LPF bandwidth */ +#define BWN_NPHY_RFCTL_RSSIO2_HPFBWHI 0x0100 /* HPF bandwidth high */ +#define BWN_NPHY_RFCTL_RSSIO2_HIQDISCO 0x0200 /* HIQ dis core */ +#define BWN_NPHY_RFCTL_RXG2 BWN_PHY_N(0x07E) /* RF control (RX gain 2) */ +#define BWN_NPHY_RFCTL_TXG2 BWN_PHY_N(0x07F) /* RF control (TX gain 2) */ +#define BWN_NPHY_RFCTL_RSSIO3 BWN_PHY_N(0x080) /* RF control (RSSI others 3) */ +#define BWN_NPHY_RFCTL_RSSIO3_RXPD 0x0001 /* RX PD */ +#define BWN_NPHY_RFCTL_RSSIO3_TXPD 0x0002 /* TX PD */ +#define BWN_NPHY_RFCTL_RSSIO3_PAPD 0x0004 /* PA PD */ +#define BWN_NPHY_RFCTL_RSSIO3_RSSICTL 0x0030 /* RSSI control */ +#define BWN_NPHY_RFCTL_RSSIO3_LPFBW 0x00C0 /* LPF bandwidth */ +#define BWN_NPHY_RFCTL_RSSIO3_HPFBWHI 0x0100 /* HPF bandwidth high */ +#define BWN_NPHY_RFCTL_RSSIO3_HIQDISCO 0x0200 /* HIQ dis core */ +#define BWN_NPHY_RFCTL_RXG3 BWN_PHY_N(0x081) /* RF control (RX gain 3) */ +#define BWN_NPHY_RFCTL_TXG3 BWN_PHY_N(0x082) /* RF control (TX gain 3) */ +#define BWN_NPHY_RFCTL_RSSIO4 BWN_PHY_N(0x083) /* RF control (RSSI others 4) */ +#define BWN_NPHY_RFCTL_RSSIO4_RXPD 0x0001 /* RX PD */ +#define BWN_NPHY_RFCTL_RSSIO4_TXPD 0x0002 /* TX PD */ +#define BWN_NPHY_RFCTL_RSSIO4_PAPD 0x0004 /* PA PD */ +#define BWN_NPHY_RFCTL_RSSIO4_RSSICTL 0x0030 /* RSSI control */ +#define BWN_NPHY_RFCTL_RSSIO4_LPFBW 0x00C0 /* LPF bandwidth */ +#define BWN_NPHY_RFCTL_RSSIO4_HPFBWHI 0x0100 /* HPF bandwidth high */ +#define BWN_NPHY_RFCTL_RSSIO4_HIQDISCO 0x0200 /* HIQ dis core */ +#define BWN_NPHY_RFCTL_RXG4 BWN_PHY_N(0x084) /* RF control (RX gain 4) */ +#define BWN_NPHY_RFCTL_TXG4 BWN_PHY_N(0x085) /* RF control (TX gain 4) */ +#define BWN_NPHY_C1_TXIQ_COMP_OFF BWN_PHY_N(0x087) /* Core 1 TX I/Q comp offset */ +#define BWN_NPHY_C2_TXIQ_COMP_OFF BWN_PHY_N(0x088) /* Core 2 TX I/Q comp offset */ +#define BWN_NPHY_C1_TXCTL BWN_PHY_N(0x08B) /* Core 1 TX control */ +#define BWN_NPHY_C2_TXCTL BWN_PHY_N(0x08C) /* Core 2 TX control */ +#define BWN_NPHY_AFECTL_OVER1 BWN_PHY_N(0x08F) /* AFE control override 1 */ +#define BWN_NPHY_SCRAM_SIGCTL BWN_PHY_N(0x090) /* Scram signal control */ +#define BWN_NPHY_SCRAM_SIGCTL_INITST 0x007F /* Initial state value */ +#define BWN_NPHY_SCRAM_SIGCTL_INITST_SHIFT 0 +#define BWN_NPHY_SCRAM_SIGCTL_SCM 0x0080 /* Scram control mode */ +#define BWN_NPHY_SCRAM_SIGCTL_SICE 0x0100 /* Scram index control enable */ +#define BWN_NPHY_SCRAM_SIGCTL_START 0xFE00 /* Scram start bit */ +#define BWN_NPHY_SCRAM_SIGCTL_START_SHIFT 9 +#define BWN_NPHY_RFCTL_INTC1 BWN_PHY_N(0x091) /* RF control (intc 1) */ +#define BWN_NPHY_RFCTL_INTC2 BWN_PHY_N(0x092) /* RF control (intc 2) */ +#define BWN_NPHY_RFCTL_INTC3 BWN_PHY_N(0x093) /* RF control (intc 3) */ +#define BWN_NPHY_RFCTL_INTC4 BWN_PHY_N(0x094) /* RF control (intc 4) */ +#define BWN_NPHY_NRDTO_WWISE BWN_PHY_N(0x095) /* # datatones WWiSE */ +#define BWN_NPHY_NRDTO_TGNSYNC BWN_PHY_N(0x096) /* # datatones TGNsync */ +#define BWN_NPHY_SIGFMOD_WWISE BWN_PHY_N(0x097) /* Signal field mod WWiSE */ +#define BWN_NPHY_LEG_SIGFMOD_11N BWN_PHY_N(0x098) /* Legacy signal field mod 11n */ +#define BWN_NPHY_HT_SIGFMOD_11N BWN_PHY_N(0x099) /* HT signal field mod 11n */ +#define BWN_NPHY_C1_RXIQ_COMPA0 BWN_PHY_N(0x09A) /* Core 1 RX I/Q comp A0 */ +#define BWN_NPHY_C1_RXIQ_COMPB0 BWN_PHY_N(0x09B) /* Core 1 RX I/Q comp B0 */ +#define BWN_NPHY_C2_RXIQ_COMPA1 BWN_PHY_N(0x09C) /* Core 2 RX I/Q comp A1 */ +#define BWN_NPHY_C2_RXIQ_COMPB1 BWN_PHY_N(0x09D) /* Core 2 RX I/Q comp B1 */ +#define BWN_NPHY_RXCTL BWN_PHY_N(0x0A0) /* RX control */ +#define BWN_NPHY_RXCTL_BSELU20 0x0010 /* Band select upper 20 */ +#define BWN_NPHY_RXCTL_RIFSEN 0x0080 /* RIFS enable */ +#define BWN_NPHY_RFSEQMODE BWN_PHY_N(0x0A1) /* RF seq mode */ +#define BWN_NPHY_RFSEQMODE_CAOVER 0x0001 /* Core active override */ +#define BWN_NPHY_RFSEQMODE_TROVER 0x0002 /* Trigger override */ +#define BWN_NPHY_RFSEQCA BWN_PHY_N(0x0A2) /* RF seq core active */ +#define BWN_NPHY_RFSEQCA_TXEN 0x000F /* TX enable */ +#define BWN_NPHY_RFSEQCA_TXEN_SHIFT 0 +#define BWN_NPHY_RFSEQCA_RXEN 0x00F0 /* RX enable */ +#define BWN_NPHY_RFSEQCA_RXEN_SHIFT 4 +#define BWN_NPHY_RFSEQCA_TXDIS 0x0F00 /* TX disable */ +#define BWN_NPHY_RFSEQCA_TXDIS_SHIFT 8 +#define BWN_NPHY_RFSEQCA_RXDIS 0xF000 /* RX disable */ +#define BWN_NPHY_RFSEQCA_RXDIS_SHIFT 12 +#define BWN_NPHY_RFSEQTR BWN_PHY_N(0x0A3) /* RF seq trigger */ +#define BWN_NPHY_RFSEQTR_RX2TX 0x0001 /* RX2TX */ +#define BWN_NPHY_RFSEQTR_TX2RX 0x0002 /* TX2RX */ +#define BWN_NPHY_RFSEQTR_UPGH 0x0004 /* Update gain H */ +#define BWN_NPHY_RFSEQTR_UPGL 0x0008 /* Update gain L */ +#define BWN_NPHY_RFSEQTR_UPGU 0x0010 /* Update gain U */ +#define BWN_NPHY_RFSEQTR_RST2RX 0x0020 /* Reset to RX */ +#define BWN_NPHY_RFSEQST BWN_PHY_N(0x0A4) /* RF seq status. Values same as trigger. */ +#define BWN_NPHY_AFECTL_OVER BWN_PHY_N(0x0A5) /* AFE control override */ +#define BWN_NPHY_AFECTL_C1 BWN_PHY_N(0x0A6) /* AFE control core 1 */ +#define BWN_NPHY_AFECTL_C2 BWN_PHY_N(0x0A7) /* AFE control core 2 */ +#define BWN_NPHY_AFECTL_C3 BWN_PHY_N(0x0A8) /* AFE control core 3 */ +#define BWN_NPHY_AFECTL_C4 BWN_PHY_N(0x0A9) /* AFE control core 4 */ +#define BWN_NPHY_AFECTL_DACGAIN1 BWN_PHY_N(0x0AA) /* AFE control DAC gain 1 */ +#define BWN_NPHY_AFECTL_DACGAIN2 BWN_PHY_N(0x0AB) /* AFE control DAC gain 2 */ +#define BWN_NPHY_AFECTL_DACGAIN3 BWN_PHY_N(0x0AC) /* AFE control DAC gain 3 */ +#define BWN_NPHY_AFECTL_DACGAIN4 BWN_PHY_N(0x0AD) /* AFE control DAC gain 4 */ +#define BWN_NPHY_STR_ADDR1 BWN_PHY_N(0x0AE) /* STR address 1 */ +#define BWN_NPHY_STR_ADDR2 BWN_PHY_N(0x0AF) /* STR address 2 */ +#define BWN_NPHY_CLASSCTL BWN_PHY_N(0x0B0) /* Classifier control */ +#define BWN_NPHY_CLASSCTL_CCKEN 0x0001 /* CCK enable */ +#define BWN_NPHY_CLASSCTL_OFDMEN 0x0002 /* OFDM enable */ +#define BWN_NPHY_CLASSCTL_WAITEDEN 0x0004 /* Waited enable */ +#define BWN_NPHY_IQFLIP BWN_PHY_N(0x0B1) /* I/Q flip */ +#define BWN_NPHY_IQFLIP_ADC1 0x0001 /* ADC1 */ +#define BWN_NPHY_IQFLIP_ADC2 0x0010 /* ADC2 */ +#define BWN_NPHY_SISO_SNR_THRES BWN_PHY_N(0x0B2) /* SISO SNR threshold */ +#define BWN_NPHY_SIGMA_N_MULT BWN_PHY_N(0x0B3) /* Sigma N multiplier */ +#define BWN_NPHY_TXMACDELAY BWN_PHY_N(0x0B4) /* TX MAC delay */ +#define BWN_NPHY_TXFRAMEDELAY BWN_PHY_N(0x0B5) /* TX frame delay */ +#define BWN_NPHY_MLPARM BWN_PHY_N(0x0B6) /* ML parameters */ +#define BWN_NPHY_MLCTL BWN_PHY_N(0x0B7) /* ML control */ +#define BWN_NPHY_WWISE_20NCYCDAT BWN_PHY_N(0x0B8) /* WWiSE 20 N cyc data */ +#define BWN_NPHY_WWISE_40NCYCDAT BWN_PHY_N(0x0B9) /* WWiSE 40 N cyc data */ +#define BWN_NPHY_TGNSYNC_20NCYCDAT BWN_PHY_N(0x0BA) /* TGNsync 20 N cyc data */ +#define BWN_NPHY_TGNSYNC_40NCYCDAT BWN_PHY_N(0x0BB) /* TGNsync 40 N cyc data */ +#define BWN_NPHY_INITSWIZP BWN_PHY_N(0x0BC) /* Initial swizzle pattern */ +#define BWN_NPHY_TXTAILCNT BWN_PHY_N(0x0BD) /* TX tail count value */ +#define BWN_NPHY_BPHY_CTL1 BWN_PHY_N(0x0BE) /* B PHY control 1 */ +#define BWN_NPHY_BPHY_CTL2 BWN_PHY_N(0x0BF) /* B PHY control 2 */ +#define BWN_NPHY_BPHY_CTL2_LUT 0x001F /* LUT index */ +#define BWN_NPHY_BPHY_CTL2_LUT_SHIFT 0 +#define BWN_NPHY_BPHY_CTL2_MACDEL 0x7FE0 /* MAC delay */ +#define BWN_NPHY_BPHY_CTL2_MACDEL_SHIFT 5 +#define BWN_NPHY_IQLOCAL_CMD BWN_PHY_N(0x0C0) /* I/Q LO cal command */ +#define BWN_NPHY_IQLOCAL_CMD_EN 0x8000 +#define BWN_NPHY_IQLOCAL_CMDNNUM BWN_PHY_N(0x0C1) /* I/Q LO cal command N num */ +#define BWN_NPHY_IQLOCAL_CMDGCTL BWN_PHY_N(0x0C2) /* I/Q LO cal command G control */ +#define BWN_NPHY_SAMP_CMD BWN_PHY_N(0x0C3) /* Sample command */ +#define BWN_NPHY_SAMP_CMD_STOP 0x0002 /* Stop */ +#define BWN_NPHY_SAMP_LOOPCNT BWN_PHY_N(0x0C4) /* Sample loop count */ +#define BWN_NPHY_SAMP_WAITCNT BWN_PHY_N(0x0C5) /* Sample wait count */ +#define BWN_NPHY_SAMP_DEPCNT BWN_PHY_N(0x0C6) /* Sample depth count */ +#define BWN_NPHY_SAMP_STAT BWN_PHY_N(0x0C7) /* Sample status */ +#define BWN_NPHY_GPIO_LOOEN BWN_PHY_N(0x0C8) /* GPIO low out enable */ +#define BWN_NPHY_GPIO_HIOEN BWN_PHY_N(0x0C9) /* GPIO high out enable */ +#define BWN_NPHY_GPIO_SEL BWN_PHY_N(0x0CA) /* GPIO select */ +#define BWN_NPHY_GPIO_CLKCTL BWN_PHY_N(0x0CB) /* GPIO clock control */ +#define BWN_NPHY_TXF_20CO_AS0 BWN_PHY_N(0x0CC) /* TX filter 20 coeff A stage 0 */ +#define BWN_NPHY_TXF_20CO_AS1 BWN_PHY_N(0x0CD) /* TX filter 20 coeff A stage 1 */ +#define BWN_NPHY_TXF_20CO_AS2 BWN_PHY_N(0x0CE) /* TX filter 20 coeff A stage 2 */ +#define BWN_NPHY_TXF_20CO_B32S0 BWN_PHY_N(0x0CF) /* TX filter 20 coeff B32 stage 0 */ +#define BWN_NPHY_TXF_20CO_B1S0 BWN_PHY_N(0x0D0) /* TX filter 20 coeff B1 stage 0 */ +#define BWN_NPHY_TXF_20CO_B32S1 BWN_PHY_N(0x0D1) /* TX filter 20 coeff B32 stage 1 */ +#define BWN_NPHY_TXF_20CO_B1S1 BWN_PHY_N(0x0D2) /* TX filter 20 coeff B1 stage 1 */ +#define BWN_NPHY_TXF_20CO_B32S2 BWN_PHY_N(0x0D3) /* TX filter 20 coeff B32 stage 2 */ +#define BWN_NPHY_TXF_20CO_B1S2 BWN_PHY_N(0x0D4) /* TX filter 20 coeff B1 stage 2 */ +#define BWN_NPHY_SIGFLDTOL BWN_PHY_N(0x0D5) /* Signal fld tolerance */ +#define BWN_NPHY_TXSERFLD BWN_PHY_N(0x0D6) /* TX service field */ +#define BWN_NPHY_AFESEQ_RX2TX_PUD BWN_PHY_N(0x0D7) /* AFE seq RX2TX power up/down delay */ +#define BWN_NPHY_AFESEQ_TX2RX_PUD BWN_PHY_N(0x0D8) /* AFE seq TX2RX power up/down delay */ +#define BWN_NPHY_TGNSYNC_SCRAMI0 BWN_PHY_N(0x0D9) /* TGNsync scram init 0 */ +#define BWN_NPHY_TGNSYNC_SCRAMI1 BWN_PHY_N(0x0DA) /* TGNsync scram init 1 */ +#define BWN_NPHY_INITSWIZPATTLEG BWN_PHY_N(0x0DB) /* Initial swizzle pattern leg */ +#define BWN_NPHY_BPHY_CTL3 BWN_PHY_N(0x0DC) /* B PHY control 3 */ +#define BWN_NPHY_BPHY_CTL3_SCALE 0x00FF /* Scale */ +#define BWN_NPHY_BPHY_CTL3_SCALE_SHIFT 0 +#define BWN_NPHY_BPHY_CTL3_FSC 0xFF00 /* Frame start count value */ +#define BWN_NPHY_BPHY_CTL3_FSC_SHIFT 8 +#define BWN_NPHY_BPHY_CTL4 BWN_PHY_N(0x0DD) /* B PHY control 4 */ +#define BWN_NPHY_C1_TXBBMULT BWN_PHY_N(0x0DE) /* Core 1 TX BB multiplier */ +#define BWN_NPHY_C2_TXBBMULT BWN_PHY_N(0x0DF) /* Core 2 TX BB multiplier */ +#define BWN_NPHY_TXF_40CO_AS0 BWN_PHY_N(0x0E1) /* TX filter 40 coeff A stage 0 */ +#define BWN_NPHY_TXF_40CO_AS1 BWN_PHY_N(0x0E2) /* TX filter 40 coeff A stage 1 */ +#define BWN_NPHY_TXF_40CO_AS2 BWN_PHY_N(0x0E3) /* TX filter 40 coeff A stage 2 */ +#define BWN_NPHY_TXF_40CO_B32S0 BWN_PHY_N(0x0E4) /* TX filter 40 coeff B32 stage 0 */ +#define BWN_NPHY_TXF_40CO_B1S0 BWN_PHY_N(0x0E5) /* TX filter 40 coeff B1 stage 0 */ +#define BWN_NPHY_TXF_40CO_B32S1 BWN_PHY_N(0x0E6) /* TX filter 40 coeff B32 stage 1 */ +#define BWN_NPHY_TXF_40CO_B1S1 BWN_PHY_N(0x0E7) /* TX filter 40 coeff B1 stage 1 */ +#define BWN_NPHY_REV3_RFCTL_OVER0 BWN_PHY_N(0x0E7) +#define BWN_NPHY_TXF_40CO_B32S2 BWN_PHY_N(0x0E8) /* TX filter 40 coeff B32 stage 2 */ +#define BWN_NPHY_TXF_40CO_B1S2 BWN_PHY_N(0x0E9) /* TX filter 40 coeff B1 stage 2 */ +#define BWN_NPHY_BIST_STAT2 BWN_PHY_N(0x0EA) /* BIST status 2 */ +#define BWN_NPHY_BIST_STAT3 BWN_PHY_N(0x0EB) /* BIST status 3 */ +#define BWN_NPHY_RFCTL_OVER BWN_PHY_N(0x0EC) /* RF control override */ +#define BWN_NPHY_REV3_RFCTL_OVER1 BWN_PHY_N(0x0EC) +#define BWN_NPHY_MIMOCFG BWN_PHY_N(0x0ED) /* MIMO config */ +#define BWN_NPHY_MIMOCFG_GFMIX 0x0004 /* Greenfield or mixed mode */ +#define BWN_NPHY_MIMOCFG_AUTO 0x0100 /* Greenfield/mixed mode auto */ +#define BWN_NPHY_RADAR_BLNKCTL BWN_PHY_N(0x0EE) /* Radar blank control */ +#define BWN_NPHY_A0RADAR_FIFOCTL BWN_PHY_N(0x0EF) /* Antenna 0 radar FIFO control */ +#define BWN_NPHY_A1RADAR_FIFOCTL BWN_PHY_N(0x0F0) /* Antenna 1 radar FIFO control */ +#define BWN_NPHY_A0RADAR_FIFODAT BWN_PHY_N(0x0F1) /* Antenna 0 radar FIFO data */ +#define BWN_NPHY_A1RADAR_FIFODAT BWN_PHY_N(0x0F2) /* Antenna 1 radar FIFO data */ +#define BWN_NPHY_RADAR_THRES0 BWN_PHY_N(0x0F3) /* Radar threshold 0 */ +#define BWN_NPHY_RADAR_THRES1 BWN_PHY_N(0x0F4) /* Radar threshold 1 */ +#define BWN_NPHY_RADAR_THRES0R BWN_PHY_N(0x0F5) /* Radar threshold 0R */ +#define BWN_NPHY_RADAR_THRES1R BWN_PHY_N(0x0F6) /* Radar threshold 1R */ +#define BWN_NPHY_CSEN_20IN40_DLEN BWN_PHY_N(0x0F7) /* Carrier sense 20 in 40 dwell length */ +#define BWN_NPHY_RFCTL_LUT_TRSW_LO1 BWN_PHY_N(0x0F8) /* RF control LUT TRSW lower 1 */ +#define BWN_NPHY_RFCTL_LUT_TRSW_UP1 BWN_PHY_N(0x0F9) /* RF control LUT TRSW upper 1 */ +#define BWN_NPHY_RFCTL_LUT_TRSW_LO2 BWN_PHY_N(0x0FA) /* RF control LUT TRSW lower 2 */ +#define BWN_NPHY_RFCTL_LUT_TRSW_UP2 BWN_PHY_N(0x0FB) /* RF control LUT TRSW upper 2 */ +#define BWN_NPHY_RFCTL_LUT_TRSW_LO3 BWN_PHY_N(0x0FC) /* RF control LUT TRSW lower 3 */ +#define BWN_NPHY_RFCTL_LUT_TRSW_UP3 BWN_PHY_N(0x0FD) /* RF control LUT TRSW upper 3 */ +#define BWN_NPHY_RFCTL_LUT_TRSW_LO4 BWN_PHY_N(0x0FE) /* RF control LUT TRSW lower 4 */ +#define BWN_NPHY_RFCTL_LUT_TRSW_UP4 BWN_PHY_N(0x0FF) /* RF control LUT TRSW upper 4 */ +#define BWN_NPHY_RFCTL_LUT_LNAPA1 BWN_PHY_N(0x100) /* RF control LUT LNA PA 1 */ +#define BWN_NPHY_RFCTL_LUT_LNAPA2 BWN_PHY_N(0x101) /* RF control LUT LNA PA 2 */ +#define BWN_NPHY_RFCTL_LUT_LNAPA3 BWN_PHY_N(0x102) /* RF control LUT LNA PA 3 */ +#define BWN_NPHY_RFCTL_LUT_LNAPA4 BWN_PHY_N(0x103) /* RF control LUT LNA PA 4 */ +#define BWN_NPHY_TGNSYNC_CRCM0 BWN_PHY_N(0x104) /* TGNsync CRC mask 0 */ +#define BWN_NPHY_TGNSYNC_CRCM1 BWN_PHY_N(0x105) /* TGNsync CRC mask 1 */ +#define BWN_NPHY_TGNSYNC_CRCM2 BWN_PHY_N(0x106) /* TGNsync CRC mask 2 */ +#define BWN_NPHY_TGNSYNC_CRCM3 BWN_PHY_N(0x107) /* TGNsync CRC mask 3 */ +#define BWN_NPHY_TGNSYNC_CRCM4 BWN_PHY_N(0x108) /* TGNsync CRC mask 4 */ +#define BWN_NPHY_CRCPOLY BWN_PHY_N(0x109) /* CRC polynomial */ +#define BWN_NPHY_SIGCNT BWN_PHY_N(0x10A) /* # sig count */ +#define BWN_NPHY_SIGSTARTBIT_CTL BWN_PHY_N(0x10B) /* Sig start bit control */ +#define BWN_NPHY_CRCPOLY_ORDER BWN_PHY_N(0x10C) /* CRC polynomial order */ +#define BWN_NPHY_RFCTL_CST0 BWN_PHY_N(0x10D) /* RF control core swap table 0 */ +#define BWN_NPHY_RFCTL_CST1 BWN_PHY_N(0x10E) /* RF control core swap table 1 */ +#define BWN_NPHY_RFCTL_CST2O BWN_PHY_N(0x10F) /* RF control core swap table 2 + others */ +#define BWN_NPHY_BPHY_CTL5 BWN_PHY_N(0x111) /* B PHY control 5 */ +#define BWN_NPHY_RFSEQ_LPFBW BWN_PHY_N(0x112) /* RF seq LPF bandwidth */ +#define BWN_NPHY_TSSIBIAS1 BWN_PHY_N(0x114) /* TSSI bias val 1 */ +#define BWN_NPHY_TSSIBIAS2 BWN_PHY_N(0x115) /* TSSI bias val 2 */ +#define BWN_NPHY_TSSIBIAS_BIAS 0x00FF /* Bias */ +#define BWN_NPHY_TSSIBIAS_BIAS_SHIFT 0 +#define BWN_NPHY_TSSIBIAS_VAL 0xFF00 /* Value */ +#define BWN_NPHY_TSSIBIAS_VAL_SHIFT 8 +#define BWN_NPHY_ESTPWR1 BWN_PHY_N(0x118) /* Estimated power 1 */ +#define BWN_NPHY_ESTPWR2 BWN_PHY_N(0x119) /* Estimated power 2 */ +#define BWN_NPHY_ESTPWR_PWR 0x00FF /* Estimated power */ +#define BWN_NPHY_ESTPWR_PWR_SHIFT 0 +#define BWN_NPHY_ESTPWR_VALID 0x0100 /* Estimated power valid */ +#define BWN_NPHY_TSSI_MAXTXFDT BWN_PHY_N(0x11C) /* TSSI max TX frame delay time */ +#define BWN_NPHY_TSSI_MAXTXFDT_VAL 0x00FF /* max TX frame delay time */ +#define BWN_NPHY_TSSI_MAXTXFDT_VAL_SHIFT 0 +#define BWN_NPHY_TSSI_MAXTDT BWN_PHY_N(0x11D) /* TSSI max TSSI delay time */ +#define BWN_NPHY_TSSI_MAXTDT_VAL 0x00FF /* max TSSI delay time */ +#define BWN_NPHY_TSSI_MAXTDT_VAL_SHIFT 0 +#define BWN_NPHY_ITSSI1 BWN_PHY_N(0x11E) /* TSSI idle 1 */ +#define BWN_NPHY_ITSSI2 BWN_PHY_N(0x11F) /* TSSI idle 2 */ +#define BWN_NPHY_ITSSI_VAL 0x00FF /* Idle TSSI */ +#define BWN_NPHY_ITSSI_VAL_SHIFT 0 +#define BWN_NPHY_TSSIMODE BWN_PHY_N(0x122) /* TSSI mode */ +#define BWN_NPHY_TSSIMODE_EN 0x0001 /* TSSI enable */ +#define BWN_NPHY_TSSIMODE_PDEN 0x0002 /* Power det enable */ +#define BWN_NPHY_RXMACIFM BWN_PHY_N(0x123) /* RX Macif mode */ +#define BWN_NPHY_CRSIT_COCNT_LO BWN_PHY_N(0x124) /* CRS idle time CRS-on count (low) */ +#define BWN_NPHY_CRSIT_COCNT_HI BWN_PHY_N(0x125) /* CRS idle time CRS-on count (high) */ +#define BWN_NPHY_CRSIT_MTCNT_LO BWN_PHY_N(0x126) /* CRS idle time measure time count (low) */ +#define BWN_NPHY_CRSIT_MTCNT_HI BWN_PHY_N(0x127) /* CRS idle time measure time count (high) */ +#define BWN_NPHY_SAMTWC BWN_PHY_N(0x128) /* Sample tail wait count */ +#define BWN_NPHY_IQEST_CMD BWN_PHY_N(0x129) /* I/Q estimate command */ +#define BWN_NPHY_IQEST_CMD_START 0x0001 /* Start */ +#define BWN_NPHY_IQEST_CMD_MODE 0x0002 /* Mode */ +#define BWN_NPHY_IQEST_WT BWN_PHY_N(0x12A) /* I/Q estimate wait time */ +#define BWN_NPHY_IQEST_WT_VAL 0x00FF /* Wait time */ +#define BWN_NPHY_IQEST_WT_VAL_SHIFT 0 +#define BWN_NPHY_IQEST_SAMCNT BWN_PHY_N(0x12B) /* I/Q estimate sample count */ +#define BWN_NPHY_IQEST_IQACC_LO0 BWN_PHY_N(0x12C) /* I/Q estimate I/Q acc lo 0 */ +#define BWN_NPHY_IQEST_IQACC_HI0 BWN_PHY_N(0x12D) /* I/Q estimate I/Q acc hi 0 */ +#define BWN_NPHY_IQEST_IPACC_LO0 BWN_PHY_N(0x12E) /* I/Q estimate I power acc lo 0 */ +#define BWN_NPHY_IQEST_IPACC_HI0 BWN_PHY_N(0x12F) /* I/Q estimate I power acc hi 0 */ +#define BWN_NPHY_IQEST_QPACC_LO0 BWN_PHY_N(0x130) /* I/Q estimate Q power acc lo 0 */ +#define BWN_NPHY_IQEST_QPACC_HI0 BWN_PHY_N(0x131) /* I/Q estimate Q power acc hi 0 */ +#define BWN_NPHY_IQEST_IQACC_LO1 BWN_PHY_N(0x134) /* I/Q estimate I/Q acc lo 1 */ +#define BWN_NPHY_IQEST_IQACC_HI1 BWN_PHY_N(0x135) /* I/Q estimate I/Q acc hi 1 */ +#define BWN_NPHY_IQEST_IPACC_LO1 BWN_PHY_N(0x136) /* I/Q estimate I power acc lo 1 */ +#define BWN_NPHY_IQEST_IPACC_HI1 BWN_PHY_N(0x137) /* I/Q estimate I power acc hi 1 */ +#define BWN_NPHY_IQEST_QPACC_LO1 BWN_PHY_N(0x138) /* I/Q estimate Q power acc lo 1 */ +#define BWN_NPHY_IQEST_QPACC_HI1 BWN_PHY_N(0x139) /* I/Q estimate Q power acc hi 1 */ +#define BWN_NPHY_MIMO_CRSTXEXT BWN_PHY_N(0x13A) /* MIMO PHY CRS TX extension */ +#define BWN_NPHY_PWRDET1 BWN_PHY_N(0x13B) /* Power det 1 */ +#define BWN_NPHY_PWRDET2 BWN_PHY_N(0x13C) /* Power det 2 */ +#define BWN_NPHY_MAXRSSI_DTIME BWN_PHY_N(0x13F) /* RSSI max RSSI delay time */ +#define BWN_NPHY_PIL_DW0 BWN_PHY_N(0x141) /* Pilot data weight 0 */ +#define BWN_NPHY_PIL_DW1 BWN_PHY_N(0x142) /* Pilot data weight 1 */ +#define BWN_NPHY_PIL_DW2 BWN_PHY_N(0x143) /* Pilot data weight 2 */ +#define BWN_NPHY_PIL_DW_BPSK 0x000F /* BPSK */ +#define BWN_NPHY_PIL_DW_BPSK_SHIFT 0 +#define BWN_NPHY_PIL_DW_QPSK 0x00F0 /* QPSK */ +#define BWN_NPHY_PIL_DW_QPSK_SHIFT 4 +#define BWN_NPHY_PIL_DW_16QAM 0x0F00 /* 16-QAM */ +#define BWN_NPHY_PIL_DW_16QAM_SHIFT 8 +#define BWN_NPHY_PIL_DW_64QAM 0xF000 /* 64-QAM */ +#define BWN_NPHY_PIL_DW_64QAM_SHIFT 12 +#define BWN_NPHY_FMDEM_CFG BWN_PHY_N(0x144) /* FM demodulation config */ +#define BWN_NPHY_PHASETR_A0 BWN_PHY_N(0x145) /* Phase track alpha 0 */ +#define BWN_NPHY_PHASETR_A1 BWN_PHY_N(0x146) /* Phase track alpha 1 */ +#define BWN_NPHY_PHASETR_A2 BWN_PHY_N(0x147) /* Phase track alpha 2 */ +#define BWN_NPHY_PHASETR_B0 BWN_PHY_N(0x148) /* Phase track beta 0 */ +#define BWN_NPHY_PHASETR_B1 BWN_PHY_N(0x149) /* Phase track beta 1 */ +#define BWN_NPHY_PHASETR_B2 BWN_PHY_N(0x14A) /* Phase track beta 2 */ +#define BWN_NPHY_PHASETR_CHG0 BWN_PHY_N(0x14B) /* Phase track change 0 */ +#define BWN_NPHY_PHASETR_CHG1 BWN_PHY_N(0x14C) /* Phase track change 1 */ +#define BWN_NPHY_PHASETW_OFF BWN_PHY_N(0x14D) /* Phase track offset */ +#define BWN_NPHY_RFCTL_DBG BWN_PHY_N(0x14E) /* RF control debug */ +#define BWN_NPHY_CCK_SHIFTB_REF BWN_PHY_N(0x150) /* CCK shiftbits reference var */ +#define BWN_NPHY_OVER_DGAIN0 BWN_PHY_N(0x152) /* Override digital gain 0 */ +#define BWN_NPHY_OVER_DGAIN1 BWN_PHY_N(0x153) /* Override digital gain 1 */ +#define BWN_NPHY_OVER_DGAIN_FDGV 0x0007 /* Force digital gain value */ +#define BWN_NPHY_OVER_DGAIN_FDGV_SHIFT 0 +#define BWN_NPHY_OVER_DGAIN_FDGEN 0x0008 /* Force digital gain enable */ +#define BWN_NPHY_OVER_DGAIN_CCKDGECV 0xFF00 /* CCK digital gain enable count value */ +#define BWN_NPHY_OVER_DGAIN_CCKDGECV_SHIFT 8 +#define BWN_NPHY_BIST_STAT4 BWN_PHY_N(0x156) /* BIST status 4 */ +#define BWN_NPHY_RADAR_MAL BWN_PHY_N(0x157) /* Radar MA length */ +#define BWN_NPHY_RADAR_SRCCTL BWN_PHY_N(0x158) /* Radar search control */ +#define BWN_NPHY_VLD_DTSIG BWN_PHY_N(0x159) /* VLD data tones sig */ +#define BWN_NPHY_VLD_DTDAT BWN_PHY_N(0x15A) /* VLD data tones data */ +#define BWN_NPHY_C1_BPHY_RXIQCA0 BWN_PHY_N(0x15B) /* Core 1 B PHY RX I/Q comp A0 */ +#define BWN_NPHY_C1_BPHY_RXIQCB0 BWN_PHY_N(0x15C) /* Core 1 B PHY RX I/Q comp B0 */ +#define BWN_NPHY_C2_BPHY_RXIQCA1 BWN_PHY_N(0x15D) /* Core 2 B PHY RX I/Q comp A1 */ +#define BWN_NPHY_C2_BPHY_RXIQCB1 BWN_PHY_N(0x15E) /* Core 2 B PHY RX I/Q comp B1 */ +#define BWN_NPHY_FREQGAIN0 BWN_PHY_N(0x160) /* Frequency gain 0 */ +#define BWN_NPHY_FREQGAIN1 BWN_PHY_N(0x161) /* Frequency gain 1 */ +#define BWN_NPHY_FREQGAIN2 BWN_PHY_N(0x162) /* Frequency gain 2 */ +#define BWN_NPHY_FREQGAIN3 BWN_PHY_N(0x163) /* Frequency gain 3 */ +#define BWN_NPHY_FREQGAIN4 BWN_PHY_N(0x164) /* Frequency gain 4 */ +#define BWN_NPHY_FREQGAIN5 BWN_PHY_N(0x165) /* Frequency gain 5 */ +#define BWN_NPHY_FREQGAIN6 BWN_PHY_N(0x166) /* Frequency gain 6 */ +#define BWN_NPHY_FREQGAIN7 BWN_PHY_N(0x167) /* Frequency gain 7 */ +#define BWN_NPHY_FREQGAIN_BYPASS BWN_PHY_N(0x168) /* Frequency gain bypass */ +#define BWN_NPHY_TRLOSS BWN_PHY_N(0x169) /* TR loss value */ +#define BWN_NPHY_C1_ADCCLIP BWN_PHY_N(0x16A) /* Core 1 ADC clip */ +#define BWN_NPHY_C2_ADCCLIP BWN_PHY_N(0x16B) /* Core 2 ADC clip */ +#define BWN_NPHY_LTRN_OFFGAIN BWN_PHY_N(0x16F) /* LTRN offset gain */ +#define BWN_NPHY_LTRN_OFF BWN_PHY_N(0x170) /* LTRN offset */ +#define BWN_NPHY_NRDATAT_WWISE20SIG BWN_PHY_N(0x171) /* # data tones WWiSE 20 sig */ +#define BWN_NPHY_NRDATAT_WWISE40SIG BWN_PHY_N(0x172) /* # data tones WWiSE 40 sig */ +#define BWN_NPHY_NRDATAT_TGNSYNC20SIG BWN_PHY_N(0x173) /* # data tones TGNsync 20 sig */ +#define BWN_NPHY_NRDATAT_TGNSYNC40SIG BWN_PHY_N(0x174) /* # data tones TGNsync 40 sig */ +#define BWN_NPHY_WWISE_CRCM0 BWN_PHY_N(0x175) /* WWiSE CRC mask 0 */ +#define BWN_NPHY_WWISE_CRCM1 BWN_PHY_N(0x176) /* WWiSE CRC mask 1 */ +#define BWN_NPHY_WWISE_CRCM2 BWN_PHY_N(0x177) /* WWiSE CRC mask 2 */ +#define BWN_NPHY_WWISE_CRCM3 BWN_PHY_N(0x178) /* WWiSE CRC mask 3 */ +#define BWN_NPHY_WWISE_CRCM4 BWN_PHY_N(0x179) /* WWiSE CRC mask 4 */ +#define BWN_NPHY_CHANEST_CDDSH BWN_PHY_N(0x17A) /* Channel estimate CDD shift */ +#define BWN_NPHY_HTAGC_WCNT BWN_PHY_N(0x17B) /* HT ADC wait counters */ +#define BWN_NPHY_SQPARM BWN_PHY_N(0x17C) /* SQ params */ +#define BWN_NPHY_MCSDUP6M BWN_PHY_N(0x17D) /* MCS dup 6M */ +#define BWN_NPHY_NDATAT_DUP40 BWN_PHY_N(0x17E) /* # data tones dup 40 */ +#define BWN_NPHY_DUP40_TGNSYNC_CYCD BWN_PHY_N(0x17F) /* Dup40 TGNsync cycle data */ +#define BWN_NPHY_DUP40_GFBL BWN_PHY_N(0x180) /* Dup40 GF format BL address */ +#define BWN_NPHY_DUP40_BL BWN_PHY_N(0x181) /* Dup40 format BL address */ +#define BWN_NPHY_LEGDUP_FTA BWN_PHY_N(0x182) /* Legacy dup frm table address */ +#define BWN_NPHY_PACPROC_DBG BWN_PHY_N(0x183) /* Packet processing debug */ +#define BWN_NPHY_PIL_CYC1 BWN_PHY_N(0x184) /* Pilot cycle counter 1 */ +#define BWN_NPHY_PIL_CYC2 BWN_PHY_N(0x185) /* Pilot cycle counter 2 */ +#define BWN_NPHY_TXF_20CO_S0A1 BWN_PHY_N(0x186) /* TX filter 20 coeff stage 0 A1 */ +#define BWN_NPHY_TXF_20CO_S0A2 BWN_PHY_N(0x187) /* TX filter 20 coeff stage 0 A2 */ +#define BWN_NPHY_TXF_20CO_S1A1 BWN_PHY_N(0x188) /* TX filter 20 coeff stage 1 A1 */ +#define BWN_NPHY_TXF_20CO_S1A2 BWN_PHY_N(0x189) /* TX filter 20 coeff stage 1 A2 */ +#define BWN_NPHY_TXF_20CO_S2A1 BWN_PHY_N(0x18A) /* TX filter 20 coeff stage 2 A1 */ +#define BWN_NPHY_TXF_20CO_S2A2 BWN_PHY_N(0x18B) /* TX filter 20 coeff stage 2 A2 */ +#define BWN_NPHY_TXF_20CO_S0B1 BWN_PHY_N(0x18C) /* TX filter 20 coeff stage 0 B1 */ +#define BWN_NPHY_TXF_20CO_S0B2 BWN_PHY_N(0x18D) /* TX filter 20 coeff stage 0 B2 */ +#define BWN_NPHY_TXF_20CO_S0B3 BWN_PHY_N(0x18E) /* TX filter 20 coeff stage 0 B3 */ +#define BWN_NPHY_TXF_20CO_S1B1 BWN_PHY_N(0x18F) /* TX filter 20 coeff stage 1 B1 */ +#define BWN_NPHY_TXF_20CO_S1B2 BWN_PHY_N(0x190) /* TX filter 20 coeff stage 1 B2 */ +#define BWN_NPHY_TXF_20CO_S1B3 BWN_PHY_N(0x191) /* TX filter 20 coeff stage 1 B3 */ +#define BWN_NPHY_TXF_20CO_S2B1 BWN_PHY_N(0x192) /* TX filter 20 coeff stage 2 B1 */ +#define BWN_NPHY_TXF_20CO_S2B2 BWN_PHY_N(0x193) /* TX filter 20 coeff stage 2 B2 */ +#define BWN_NPHY_TXF_20CO_S2B3 BWN_PHY_N(0x194) /* TX filter 20 coeff stage 2 B3 */ +#define BWN_NPHY_TXF_40CO_S0A1 BWN_PHY_N(0x195) /* TX filter 40 coeff stage 0 A1 */ +#define BWN_NPHY_TXF_40CO_S0A2 BWN_PHY_N(0x196) /* TX filter 40 coeff stage 0 A2 */ +#define BWN_NPHY_TXF_40CO_S1A1 BWN_PHY_N(0x197) /* TX filter 40 coeff stage 1 A1 */ +#define BWN_NPHY_TXF_40CO_S1A2 BWN_PHY_N(0x198) /* TX filter 40 coeff stage 1 A2 */ +#define BWN_NPHY_TXF_40CO_S2A1 BWN_PHY_N(0x199) /* TX filter 40 coeff stage 2 A1 */ +#define BWN_NPHY_TXF_40CO_S2A2 BWN_PHY_N(0x19A) /* TX filter 40 coeff stage 2 A2 */ +#define BWN_NPHY_TXF_40CO_S0B1 BWN_PHY_N(0x19B) /* TX filter 40 coeff stage 0 B1 */ +#define BWN_NPHY_TXF_40CO_S0B2 BWN_PHY_N(0x19C) /* TX filter 40 coeff stage 0 B2 */ +#define BWN_NPHY_TXF_40CO_S0B3 BWN_PHY_N(0x19D) /* TX filter 40 coeff stage 0 B3 */ +#define BWN_NPHY_TXF_40CO_S1B1 BWN_PHY_N(0x19E) /* TX filter 40 coeff stage 1 B1 */ +#define BWN_NPHY_TXF_40CO_S1B2 BWN_PHY_N(0x19F) /* TX filter 40 coeff stage 1 B2 */ +#define BWN_NPHY_TXF_40CO_S1B3 BWN_PHY_N(0x1A0) /* TX filter 40 coeff stage 1 B3 */ +#define BWN_NPHY_TXF_40CO_S2B1 BWN_PHY_N(0x1A1) /* TX filter 40 coeff stage 2 B1 */ +#define BWN_NPHY_TXF_40CO_S2B2 BWN_PHY_N(0x1A2) /* TX filter 40 coeff stage 2 B2 */ +#define BWN_NPHY_TXF_40CO_S2B3 BWN_PHY_N(0x1A3) /* TX filter 40 coeff stage 2 B3 */ +#define BWN_NPHY_RSSIMC_0I_RSSI_X BWN_PHY_N(0x1A4) /* RSSI multiplication coefficient 0 I RSSI X */ +#define BWN_NPHY_RSSIMC_0I_RSSI_Y BWN_PHY_N(0x1A5) /* RSSI multiplication coefficient 0 I RSSI Y */ +#define BWN_NPHY_RSSIMC_0I_RSSI_Z BWN_PHY_N(0x1A6) /* RSSI multiplication coefficient 0 I RSSI Z */ +#define BWN_NPHY_RSSIMC_0I_TBD BWN_PHY_N(0x1A7) /* RSSI multiplication coefficient 0 I TBD */ +#define BWN_NPHY_RSSIMC_0I_PWRDET BWN_PHY_N(0x1A8) /* RSSI multiplication coefficient 0 I power det */ +#define BWN_NPHY_RSSIMC_0I_TSSI BWN_PHY_N(0x1A9) /* RSSI multiplication coefficient 0 I TSSI */ +#define BWN_NPHY_RSSIMC_0Q_RSSI_X BWN_PHY_N(0x1AA) /* RSSI multiplication coefficient 0 Q RSSI X */ +#define BWN_NPHY_RSSIMC_0Q_RSSI_Y BWN_PHY_N(0x1AB) /* RSSI multiplication coefficient 0 Q RSSI Y */ +#define BWN_NPHY_RSSIMC_0Q_RSSI_Z BWN_PHY_N(0x1AC) /* RSSI multiplication coefficient 0 Q RSSI Z */ +#define BWN_NPHY_RSSIMC_0Q_TBD BWN_PHY_N(0x1AD) /* RSSI multiplication coefficient 0 Q TBD */ +#define BWN_NPHY_RSSIMC_0Q_PWRDET BWN_PHY_N(0x1AE) /* RSSI multiplication coefficient 0 Q power det */ +#define BWN_NPHY_RSSIMC_0Q_TSSI BWN_PHY_N(0x1AF) /* RSSI multiplication coefficient 0 Q TSSI */ +#define BWN_NPHY_RSSIMC_1I_RSSI_X BWN_PHY_N(0x1B0) /* RSSI multiplication coefficient 1 I RSSI X */ +#define BWN_NPHY_RSSIMC_1I_RSSI_Y BWN_PHY_N(0x1B1) /* RSSI multiplication coefficient 1 I RSSI Y */ +#define BWN_NPHY_RSSIMC_1I_RSSI_Z BWN_PHY_N(0x1B2) /* RSSI multiplication coefficient 1 I RSSI Z */ +#define BWN_NPHY_RSSIMC_1I_TBD BWN_PHY_N(0x1B3) /* RSSI multiplication coefficient 1 I TBD */ +#define BWN_NPHY_RSSIMC_1I_PWRDET BWN_PHY_N(0x1B4) /* RSSI multiplication coefficient 1 I power det */ +#define BWN_NPHY_RSSIMC_1I_TSSI BWN_PHY_N(0x1B5) /* RSSI multiplication coefficient 1 I TSSI */ +#define BWN_NPHY_RSSIMC_1Q_RSSI_X BWN_PHY_N(0x1B6) /* RSSI multiplication coefficient 1 Q RSSI X */ +#define BWN_NPHY_RSSIMC_1Q_RSSI_Y BWN_PHY_N(0x1B7) /* RSSI multiplication coefficient 1 Q RSSI Y */ +#define BWN_NPHY_RSSIMC_1Q_RSSI_Z BWN_PHY_N(0x1B8) /* RSSI multiplication coefficient 1 Q RSSI Z */ +#define BWN_NPHY_RSSIMC_1Q_TBD BWN_PHY_N(0x1B9) /* RSSI multiplication coefficient 1 Q TBD */ +#define BWN_NPHY_RSSIMC_1Q_PWRDET BWN_PHY_N(0x1BA) /* RSSI multiplication coefficient 1 Q power det */ +#define BWN_NPHY_RSSIMC_1Q_TSSI BWN_PHY_N(0x1BB) /* RSSI multiplication coefficient 1 Q TSSI */ +#define BWN_NPHY_SAMC_WCNT BWN_PHY_N(0x1BC) /* Sample collect wait counter */ +#define BWN_NPHY_PTHROUGH_CNT BWN_PHY_N(0x1BD) /* Pass-through counter */ +#define BWN_NPHY_LTRN_OFF_G20L BWN_PHY_N(0x1C4) /* LTRN offset gain 20L */ +#define BWN_NPHY_LTRN_OFF_20L BWN_PHY_N(0x1C5) /* LTRN offset 20L */ +#define BWN_NPHY_LTRN_OFF_G20U BWN_PHY_N(0x1C6) /* LTRN offset gain 20U */ +#define BWN_NPHY_LTRN_OFF_20U BWN_PHY_N(0x1C7) /* LTRN offset 20U */ +#define BWN_NPHY_DSSSCCK_GAINSL BWN_PHY_N(0x1C8) /* DSSS/CCK gain settle length */ +#define BWN_NPHY_GPIO_LOOUT BWN_PHY_N(0x1C9) /* GPIO low out */ +#define BWN_NPHY_GPIO_HIOUT BWN_PHY_N(0x1CA) /* GPIO high out */ +#define BWN_NPHY_CRS_CHECK BWN_PHY_N(0x1CB) /* CRS check */ +#define BWN_NPHY_ML_LOGSS_RAT BWN_PHY_N(0x1CC) /* ML/logss ratio */ +#define BWN_NPHY_DUPSCALE BWN_PHY_N(0x1CD) /* Dup scale */ +#define BWN_NPHY_BW1A BWN_PHY_N(0x1CE) /* BW 1A */ +#define BWN_NPHY_BW2 BWN_PHY_N(0x1CF) /* BW 2 */ +#define BWN_NPHY_BW3 BWN_PHY_N(0x1D0) /* BW 3 */ +#define BWN_NPHY_BW4 BWN_PHY_N(0x1D1) /* BW 4 */ +#define BWN_NPHY_BW5 BWN_PHY_N(0x1D2) /* BW 5 */ +#define BWN_NPHY_BW6 BWN_PHY_N(0x1D3) /* BW 6 */ +#define BWN_NPHY_COALEN0 BWN_PHY_N(0x1D4) /* Coarse length 0 */ +#define BWN_NPHY_COALEN1 BWN_PHY_N(0x1D5) /* Coarse length 1 */ +#define BWN_NPHY_CRSTHRES_1U BWN_PHY_N(0x1D6) /* CRS threshold 1 U */ +#define BWN_NPHY_CRSTHRES_2U BWN_PHY_N(0x1D7) /* CRS threshold 2 U */ +#define BWN_NPHY_CRSTHRES_3U BWN_PHY_N(0x1D8) /* CRS threshold 3 U */ +#define BWN_NPHY_CRSCTL_U BWN_PHY_N(0x1D9) /* CRS control U */ +#define BWN_NPHY_CRSTHRES_1L BWN_PHY_N(0x1DA) /* CRS threshold 1 L */ +#define BWN_NPHY_CRSTHRES_2L BWN_PHY_N(0x1DB) /* CRS threshold 2 L */ +#define BWN_NPHY_CRSTHRES_3L BWN_PHY_N(0x1DC) /* CRS threshold 3 L */ +#define BWN_NPHY_CRSCTL_L BWN_PHY_N(0x1DD) /* CRS control L */ +#define BWN_NPHY_STRA_1U BWN_PHY_N(0x1DE) /* STR address 1 U */ +#define BWN_NPHY_STRA_2U BWN_PHY_N(0x1DF) /* STR address 2 U */ +#define BWN_NPHY_STRA_1L BWN_PHY_N(0x1E0) /* STR address 1 L */ +#define BWN_NPHY_STRA_2L BWN_PHY_N(0x1E1) /* STR address 2 L */ +#define BWN_NPHY_CRSCHECK1 BWN_PHY_N(0x1E2) /* CRS check 1 */ +#define BWN_NPHY_CRSCHECK2 BWN_PHY_N(0x1E3) /* CRS check 2 */ +#define BWN_NPHY_CRSCHECK3 BWN_PHY_N(0x1E4) /* CRS check 3 */ +#define BWN_NPHY_JMPSTP0 BWN_PHY_N(0x1E5) /* Jump step 0 */ +#define BWN_NPHY_JMPSTP1 BWN_PHY_N(0x1E6) /* Jump step 1 */ +#define BWN_NPHY_TXPCTL_CMD BWN_PHY_N(0x1E7) /* TX power control command */ +#define BWN_NPHY_TXPCTL_CMD_INIT 0x007F /* Init */ +#define BWN_NPHY_TXPCTL_CMD_INIT_SHIFT 0 +#define BWN_NPHY_TXPCTL_CMD_COEFF 0x2000 /* Power control coefficients */ +#define BWN_NPHY_TXPCTL_CMD_HWPCTLEN 0x4000 /* Hardware TX power control enable */ +#define BWN_NPHY_TXPCTL_CMD_PCTLEN 0x8000 /* TX power control enable */ +#define BWN_NPHY_TXPCTL_N BWN_PHY_N(0x1E8) /* TX power control N num */ +#define BWN_NPHY_TXPCTL_N_TSSID 0x00FF /* N TSSI delay */ +#define BWN_NPHY_TXPCTL_N_TSSID_SHIFT 0 +#define BWN_NPHY_TXPCTL_N_NPTIL2 0x0700 /* N PT integer log2 */ +#define BWN_NPHY_TXPCTL_N_NPTIL2_SHIFT 8 +#define BWN_NPHY_TXPCTL_ITSSI BWN_PHY_N(0x1E9) /* TX power control idle TSSI */ +#define BWN_NPHY_TXPCTL_ITSSI_0 0x003F /* Idle TSSI 0 */ +#define BWN_NPHY_TXPCTL_ITSSI_0_SHIFT 0 +#define BWN_NPHY_TXPCTL_ITSSI_1 0x3F00 /* Idle TSSI 1 */ +#define BWN_NPHY_TXPCTL_ITSSI_1_SHIFT 8 +#define BWN_NPHY_TXPCTL_ITSSI_BINF 0x8000 /* Raw TSSI offset bin format */ +#define BWN_NPHY_TXPCTL_TPWR BWN_PHY_N(0x1EA) /* TX power control target power */ +#define BWN_NPHY_TXPCTL_TPWR_0 0x00FF /* Power 0 */ +#define BWN_NPHY_TXPCTL_TPWR_0_SHIFT 0 +#define BWN_NPHY_TXPCTL_TPWR_1 0xFF00 /* Power 1 */ +#define BWN_NPHY_TXPCTL_TPWR_1_SHIFT 8 +#define BWN_NPHY_TXPCTL_BIDX BWN_PHY_N(0x1EB) /* TX power control base index */ +#define BWN_NPHY_TXPCTL_BIDX_0 0x007F /* uC base index 0 */ +#define BWN_NPHY_TXPCTL_BIDX_0_SHIFT 0 +#define BWN_NPHY_TXPCTL_BIDX_1 0x7F00 /* uC base index 1 */ +#define BWN_NPHY_TXPCTL_BIDX_1_SHIFT 8 +#define BWN_NPHY_TXPCTL_BIDX_LOAD 0x8000 /* Load base index */ +#define BWN_NPHY_TXPCTL_PIDX BWN_PHY_N(0x1EC) /* TX power control power index */ +#define BWN_NPHY_TXPCTL_PIDX_0 0x007F /* uC power index 0 */ +#define BWN_NPHY_TXPCTL_PIDX_0_SHIFT 0 +#define BWN_NPHY_TXPCTL_PIDX_1 0x7F00 /* uC power index 1 */ +#define BWN_NPHY_TXPCTL_PIDX_1_SHIFT 8 +#define BWN_NPHY_C1_TXPCTL_STAT BWN_PHY_N(0x1ED) /* Core 1 TX power control status */ +#define BWN_NPHY_C2_TXPCTL_STAT BWN_PHY_N(0x1EE) /* Core 2 TX power control status */ +#define BWN_NPHY_TXPCTL_STAT_EST 0x00FF /* Estimated power */ +#define BWN_NPHY_TXPCTL_STAT_EST_SHIFT 0 +#define BWN_NPHY_TXPCTL_STAT_BIDX 0x7F00 /* Base index */ +#define BWN_NPHY_TXPCTL_STAT_BIDX_SHIFT 8 +#define BWN_NPHY_TXPCTL_STAT_ESTVALID 0x8000 /* Estimated power valid */ +#define BWN_NPHY_SMALLSGS_LEN BWN_PHY_N(0x1EF) /* Small sig gain settle length */ +#define BWN_NPHY_PHYSTAT_GAIN0 BWN_PHY_N(0x1F0) /* PHY stats gain info 0 */ +#define BWN_NPHY_PHYSTAT_GAIN1 BWN_PHY_N(0x1F1) /* PHY stats gain info 1 */ +#define BWN_NPHY_PHYSTAT_FREQEST BWN_PHY_N(0x1F2) /* PHY stats frequency estimate */ +#define BWN_NPHY_PHYSTAT_ADVRET BWN_PHY_N(0x1F3) /* PHY stats ADV retard */ +#define BWN_NPHY_PHYLB_MODE BWN_PHY_N(0x1F4) /* PHY loopback mode */ +#define BWN_NPHY_TONE_MIDX20_1 BWN_PHY_N(0x1F5) /* Tone map index 20/1 */ +#define BWN_NPHY_TONE_MIDX20_2 BWN_PHY_N(0x1F6) /* Tone map index 20/2 */ +#define BWN_NPHY_TONE_MIDX20_3 BWN_PHY_N(0x1F7) /* Tone map index 20/3 */ +#define BWN_NPHY_TONE_MIDX40_1 BWN_PHY_N(0x1F8) /* Tone map index 40/1 */ +#define BWN_NPHY_TONE_MIDX40_2 BWN_PHY_N(0x1F9) /* Tone map index 40/2 */ +#define BWN_NPHY_TONE_MIDX40_3 BWN_PHY_N(0x1FA) /* Tone map index 40/3 */ +#define BWN_NPHY_TONE_MIDX40_4 BWN_PHY_N(0x1FB) /* Tone map index 40/4 */ +#define BWN_NPHY_PILTONE_MIDX1 BWN_PHY_N(0x1FC) /* Pilot tone map index 1 */ +#define BWN_NPHY_PILTONE_MIDX2 BWN_PHY_N(0x1FD) /* Pilot tone map index 2 */ +#define BWN_NPHY_PILTONE_MIDX3 BWN_PHY_N(0x1FE) /* Pilot tone map index 3 */ +#define BWN_NPHY_TXRIFS_FRDEL BWN_PHY_N(0x1FF) /* TX RIFS frame delay */ +#define BWN_NPHY_AFESEQ_RX2TX_PUD_40M BWN_PHY_N(0x200) /* AFE seq rx2tx power up/down delay 40M */ +#define BWN_NPHY_AFESEQ_TX2RX_PUD_40M BWN_PHY_N(0x201) /* AFE seq tx2rx power up/down delay 40M */ +#define BWN_NPHY_AFESEQ_RX2TX_PUD_20M BWN_PHY_N(0x202) /* AFE seq rx2tx power up/down delay 20M */ +#define BWN_NPHY_AFESEQ_TX2RX_PUD_20M BWN_PHY_N(0x203) /* AFE seq tx2rx power up/down delay 20M */ +#define BWN_NPHY_RX_SIGCTL BWN_PHY_N(0x204) /* RX signal control */ +#define BWN_NPHY_RXPIL_CYCNT0 BWN_PHY_N(0x205) /* RX pilot cycle counter 0 */ +#define BWN_NPHY_RXPIL_CYCNT1 BWN_PHY_N(0x206) /* RX pilot cycle counter 1 */ +#define BWN_NPHY_RXPIL_CYCNT2 BWN_PHY_N(0x207) /* RX pilot cycle counter 2 */ +#define BWN_NPHY_AFESEQ_RX2TX_PUD_10M BWN_PHY_N(0x208) /* AFE seq rx2tx power up/down delay 10M */ +#define BWN_NPHY_AFESEQ_TX2RX_PUD_10M BWN_PHY_N(0x209) /* AFE seq tx2rx power up/down delay 10M */ +#define BWN_NPHY_DSSSCCK_CRSEXTL BWN_PHY_N(0x20A) /* DSSS/CCK CRS extension length */ +#define BWN_NPHY_ML_LOGSS_RATSLOPE BWN_PHY_N(0x20B) /* ML/logss ratio slope */ +#define BWN_NPHY_RIFS_SRCTL BWN_PHY_N(0x20C) /* RIFS search timeout length */ +#define BWN_NPHY_TXREALFD BWN_PHY_N(0x20D) /* TX real frame delay */ +#define BWN_NPHY_HPANT_SWTHRES BWN_PHY_N(0x20E) /* High power antenna switch threshold */ +#define BWN_NPHY_EDCRS_ASSTHRES0 BWN_PHY_N(0x210) /* ED CRS assert threshold 0 */ +#define BWN_NPHY_EDCRS_ASSTHRES1 BWN_PHY_N(0x211) /* ED CRS assert threshold 1 */ +#define BWN_NPHY_EDCRS_DEASSTHRES0 BWN_PHY_N(0x212) /* ED CRS deassert threshold 0 */ +#define BWN_NPHY_EDCRS_DEASSTHRES1 BWN_PHY_N(0x213) /* ED CRS deassert threshold 1 */ +#define BWN_NPHY_STR_WTIME20U BWN_PHY_N(0x214) /* STR wait time 20U */ +#define BWN_NPHY_STR_WTIME20L BWN_PHY_N(0x215) /* STR wait time 20L */ +#define BWN_NPHY_TONE_MIDX657M BWN_PHY_N(0x216) /* Tone map index 657M */ +#define BWN_NPHY_HTSIGTONES BWN_PHY_N(0x217) /* HT signal tones */ +#define BWN_NPHY_RSSI1 BWN_PHY_N(0x219) /* RSSI value 1 */ +#define BWN_NPHY_RSSI2 BWN_PHY_N(0x21A) /* RSSI value 2 */ +#define BWN_NPHY_CHAN_ESTHANG BWN_PHY_N(0x21D) /* Channel estimate hang */ +#define BWN_NPHY_FINERX2_CGC BWN_PHY_N(0x221) /* Fine RX 2 clock gate control */ +#define BWN_NPHY_FINERX2_CGC_DECGC 0x0008 /* Decode gated clocks */ +#define BWN_NPHY_TXPCTL_INIT BWN_PHY_N(0x222) /* TX power control init */ +#define BWN_NPHY_TXPCTL_INIT_PIDXI1 0x00FF /* Power index init 1 */ +#define BWN_NPHY_TXPCTL_INIT_PIDXI1_SHIFT 0 +#define BWN_NPHY_ED_CRSEN BWN_PHY_N(0x223) +#define BWN_NPHY_ED_CRS40ASSERTTHRESH0 BWN_PHY_N(0x224) +#define BWN_NPHY_ED_CRS40ASSERTTHRESH1 BWN_PHY_N(0x225) +#define BWN_NPHY_ED_CRS40DEASSERTTHRESH0 BWN_PHY_N(0x226) +#define BWN_NPHY_ED_CRS40DEASSERTTHRESH1 BWN_PHY_N(0x227) +#define BWN_NPHY_ED_CRS20LASSERTTHRESH0 BWN_PHY_N(0x228) +#define BWN_NPHY_ED_CRS20LASSERTTHRESH1 BWN_PHY_N(0x229) +#define BWN_NPHY_ED_CRS20LDEASSERTTHRESH0 BWN_PHY_N(0x22A) +#define BWN_NPHY_ED_CRS20LDEASSERTTHRESH1 BWN_PHY_N(0x22B) +#define BWN_NPHY_ED_CRS20UASSERTTHRESH0 BWN_PHY_N(0x22C) +#define BWN_NPHY_ED_CRS20UASSERTTHRESH1 BWN_PHY_N(0x22D) +#define BWN_NPHY_ED_CRS20UDEASSERTTHRESH0 BWN_PHY_N(0x22E) +#define BWN_NPHY_ED_CRS20UDEASSERTTHRESH1 BWN_PHY_N(0x22F) +#define BWN_NPHY_ED_CRS BWN_PHY_N(0x230) +#define BWN_NPHY_TIMEOUTEN BWN_PHY_N(0x231) +#define BWN_NPHY_OFDMPAYDECODETIMEOUTLEN BWN_PHY_N(0x232) +#define BWN_NPHY_CCKPAYDECODETIMEOUTLEN BWN_PHY_N(0x233) +#define BWN_NPHY_NONPAYDECODETIMEOUTLEN BWN_PHY_N(0x234) +#define BWN_NPHY_TIMEOUTSTATUS BWN_PHY_N(0x235) +#define BWN_NPHY_RFCTRLCORE0GPIO0 BWN_PHY_N(0x236) +#define BWN_NPHY_RFCTRLCORE0GPIO1 BWN_PHY_N(0x237) +#define BWN_NPHY_RFCTRLCORE0GPIO2 BWN_PHY_N(0x238) +#define BWN_NPHY_RFCTRLCORE0GPIO3 BWN_PHY_N(0x239) +#define BWN_NPHY_RFCTRLCORE1GPIO0 BWN_PHY_N(0x23A) +#define BWN_NPHY_RFCTRLCORE1GPIO1 BWN_PHY_N(0x23B) +#define BWN_NPHY_RFCTRLCORE1GPIO2 BWN_PHY_N(0x23C) +#define BWN_NPHY_RFCTRLCORE1GPIO3 BWN_PHY_N(0x23D) +#define BWN_NPHY_BPHYTESTCONTROL BWN_PHY_N(0x23E) + +/* REV3+ */ +#define BWN_NPHY_FORCEFRONT0 BWN_PHY_N(0x23F) +#define BWN_NPHY_FORCEFRONT1 BWN_PHY_N(0x240) +#define BWN_NPHY_NORMVARHYSTTH BWN_PHY_N(0x241) +#define BWN_NPHY_TXCCKERROR BWN_PHY_N(0x242) +#define BWN_NPHY_AFESEQINITDACGAIN BWN_PHY_N(0x243) +#define BWN_NPHY_TXANTSWLUT BWN_PHY_N(0x244) +#define BWN_NPHY_CORECONFIG BWN_PHY_N(0x245) +#define BWN_NPHY_ANTENNADIVDWELLTIME BWN_PHY_N(0x246) +#define BWN_NPHY_ANTENNACCKDIVDWELLTIME BWN_PHY_N(0x247) +#define BWN_NPHY_ANTENNADIVBACKOFFGAIN BWN_PHY_N(0x248) +#define BWN_NPHY_ANTENNADIVMINGAIN BWN_PHY_N(0x249) +#define BWN_NPHY_BRDSEL_NORMVARHYSTTH BWN_PHY_N(0x24A) +#define BWN_NPHY_RXANTSWITCHCTRL BWN_PHY_N(0x24B) +#define BWN_NPHY_ENERGYDROPTIMEOUTLEN2 BWN_PHY_N(0x24C) +#define BWN_NPHY_ML_LOG_TXEVM0 BWN_PHY_N(0x250) +#define BWN_NPHY_ML_LOG_TXEVM1 BWN_PHY_N(0x251) +#define BWN_NPHY_ML_LOG_TXEVM2 BWN_PHY_N(0x252) +#define BWN_NPHY_ML_LOG_TXEVM3 BWN_PHY_N(0x253) +#define BWN_NPHY_ML_LOG_TXEVM4 BWN_PHY_N(0x254) +#define BWN_NPHY_ML_LOG_TXEVM5 BWN_PHY_N(0x255) +#define BWN_NPHY_ML_LOG_TXEVM6 BWN_PHY_N(0x256) +#define BWN_NPHY_ML_LOG_TXEVM7 BWN_PHY_N(0x257) +#define BWN_NPHY_ML_SCALE_TWEAK BWN_PHY_N(0x258) +#define BWN_NPHY_MLUA BWN_PHY_N(0x259) +#define BWN_NPHY_ZFUA BWN_PHY_N(0x25A) +#define BWN_NPHY_CHANUPSYM01 BWN_PHY_N(0x25B) +#define BWN_NPHY_CHANUPSYM2 BWN_PHY_N(0x25C) +#define BWN_NPHY_RXSTRNFILT20NUM00 BWN_PHY_N(0x25D) +#define BWN_NPHY_RXSTRNFILT20NUM01 BWN_PHY_N(0x25E) +#define BWN_NPHY_RXSTRNFILT20NUM02 BWN_PHY_N(0x25F) +#define BWN_NPHY_RXSTRNFILT20DEN00 BWN_PHY_N(0x260) +#define BWN_NPHY_RXSTRNFILT20DEN01 BWN_PHY_N(0x261) +#define BWN_NPHY_RXSTRNFILT20NUM10 BWN_PHY_N(0x262) +#define BWN_NPHY_RXSTRNFILT20NUM11 BWN_PHY_N(0x263) +#define BWN_NPHY_RXSTRNFILT20NUM12 BWN_PHY_N(0x264) +#define BWN_NPHY_RXSTRNFILT20DEN10 BWN_PHY_N(0x265) +#define BWN_NPHY_RXSTRNFILT20DEN11 BWN_PHY_N(0x266) +#define BWN_NPHY_RXSTRNFILT40NUM00 BWN_PHY_N(0x267) +#define BWN_NPHY_RXSTRNFILT40NUM01 BWN_PHY_N(0x268) +#define BWN_NPHY_RXSTRNFILT40NUM02 BWN_PHY_N(0x269) +#define BWN_NPHY_RXSTRNFILT40DEN00 BWN_PHY_N(0x26A) +#define BWN_NPHY_RXSTRNFILT40DEN01 BWN_PHY_N(0x26B) +#define BWN_NPHY_RXSTRNFILT40NUM10 BWN_PHY_N(0x26C) +#define BWN_NPHY_RXSTRNFILT40NUM11 BWN_PHY_N(0x26D) +#define BWN_NPHY_RXSTRNFILT40NUM12 BWN_PHY_N(0x26E) +#define BWN_NPHY_RXSTRNFILT40DEN10 BWN_PHY_N(0x26F) +#define BWN_NPHY_RXSTRNFILT40DEN11 BWN_PHY_N(0x270) +#define BWN_NPHY_CRSHIGHPOWTHRESHOLD1 BWN_PHY_N(0x271) +#define BWN_NPHY_CRSHIGHPOWTHRESHOLD2 BWN_PHY_N(0x272) +#define BWN_NPHY_CRSHIGHLOWPOWTHRESHOLD BWN_PHY_N(0x273) +#define BWN_NPHY_CRSHIGHPOWTHRESHOLD1L BWN_PHY_N(0x274) +#define BWN_NPHY_CRSHIGHPOWTHRESHOLD2L BWN_PHY_N(0x275) +#define BWN_NPHY_CRSHIGHLOWPOWTHRESHOLDL BWN_PHY_N(0x276) +#define BWN_NPHY_CRSHIGHPOWTHRESHOLD1U BWN_PHY_N(0x277) +#define BWN_NPHY_CRSHIGHPOWTHRESHOLD2U BWN_PHY_N(0x278) +#define BWN_NPHY_CRSHIGHLOWPOWTHRESHOLDU BWN_PHY_N(0x279) +#define BWN_NPHY_CRSACIDETECTTHRESH BWN_PHY_N(0x27A) +#define BWN_NPHY_CRSACIDETECTTHRESHL BWN_PHY_N(0x27B) +#define BWN_NPHY_CRSACIDETECTTHRESHU BWN_PHY_N(0x27C) +#define BWN_NPHY_CRSMINPOWER0 BWN_PHY_N(0x27D) +#define BWN_NPHY_CRSMINPOWER1 BWN_PHY_N(0x27E) +#define BWN_NPHY_CRSMINPOWER2 BWN_PHY_N(0x27F) +#define BWN_NPHY_CRSMINPOWERL0 BWN_PHY_N(0x280) +#define BWN_NPHY_CRSMINPOWERL1 BWN_PHY_N(0x281) +#define BWN_NPHY_CRSMINPOWERL2 BWN_PHY_N(0x282) +#define BWN_NPHY_CRSMINPOWERU0 BWN_PHY_N(0x283) +#define BWN_NPHY_CRSMINPOWERU1 BWN_PHY_N(0x284) +#define BWN_NPHY_CRSMINPOWERU2 BWN_PHY_N(0x285) +#define BWN_NPHY_STRPARAM BWN_PHY_N(0x286) +#define BWN_NPHY_STRPARAML BWN_PHY_N(0x287) +#define BWN_NPHY_STRPARAMU BWN_PHY_N(0x288) +#define BWN_NPHY_BPHYCRSMINPOWER0 BWN_PHY_N(0x289) +#define BWN_NPHY_BPHYCRSMINPOWER1 BWN_PHY_N(0x28A) +#define BWN_NPHY_BPHYCRSMINPOWER2 BWN_PHY_N(0x28B) +#define BWN_NPHY_BPHYFILTDEN0COEF BWN_PHY_N(0x28C) +#define BWN_NPHY_BPHYFILTDEN1COEF BWN_PHY_N(0x28D) +#define BWN_NPHY_BPHYFILTDEN2COEF BWN_PHY_N(0x28E) +#define BWN_NPHY_BPHYFILTNUM0COEF BWN_PHY_N(0x28F) +#define BWN_NPHY_BPHYFILTNUM1COEF BWN_PHY_N(0x290) +#define BWN_NPHY_BPHYFILTNUM2COEF BWN_PHY_N(0x291) +#define BWN_NPHY_BPHYFILTNUM01COEF2 BWN_PHY_N(0x292) +#define BWN_NPHY_BPHYFILTBYPASS BWN_PHY_N(0x293) +#define BWN_NPHY_SGILTRNOFFSET BWN_PHY_N(0x294) +#define BWN_NPHY_RADAR_T2_MIN BWN_PHY_N(0x295) +#define BWN_NPHY_TXPWRCTRLDAMPING BWN_PHY_N(0x296) +#define BWN_NPHY_PAPD_EN0 BWN_PHY_N(0x297) /* PAPD Enable0 TBD */ +#define BWN_NPHY_EPS_TABLE_ADJ0 BWN_PHY_N(0x298) /* EPS Table Adj0 TBD */ +#define BWN_NPHY_EPS_OVERRIDEI_0 BWN_PHY_N(0x299) +#define BWN_NPHY_EPS_OVERRIDEQ_0 BWN_PHY_N(0x29A) +#define BWN_NPHY_PAPD_EN1 BWN_PHY_N(0x29B) /* PAPD Enable1 TBD */ +#define BWN_NPHY_EPS_TABLE_ADJ1 BWN_PHY_N(0x29C) /* EPS Table Adj1 TBD */ +#define BWN_NPHY_EPS_OVERRIDEI_1 BWN_PHY_N(0x29D) +#define BWN_NPHY_EPS_OVERRIDEQ_1 BWN_PHY_N(0x29E) +#define BWN_NPHY_PAPD_CAL_ADDRESS BWN_PHY_N(0x29F) +#define BWN_NPHY_PAPD_CAL_YREFEPSILON BWN_PHY_N(0x2A0) +#define BWN_NPHY_PAPD_CAL_SETTLE BWN_PHY_N(0x2A1) +#define BWN_NPHY_PAPD_CAL_CORRELATE BWN_PHY_N(0x2A2) +#define BWN_NPHY_PAPD_CAL_SHIFTS0 BWN_PHY_N(0x2A3) +#define BWN_NPHY_PAPD_CAL_SHIFTS1 BWN_PHY_N(0x2A4) +#define BWN_NPHY_SAMPLE_START_ADDR BWN_PHY_N(0x2A5) +#define BWN_NPHY_RADAR_ADC_TO_DBM BWN_PHY_N(0x2A6) +#define BWN_NPHY_REV3_C2_INITGAIN_A BWN_PHY_N(0x2A7) +#define BWN_NPHY_REV3_C2_INITGAIN_B BWN_PHY_N(0x2A8) +#define BWN_NPHY_REV3_C2_CLIP_HIGAIN_A BWN_PHY_N(0x2A9) +#define BWN_NPHY_REV3_C2_CLIP_HIGAIN_B BWN_PHY_N(0x2AA) +#define BWN_NPHY_REV3_C2_CLIP_MEDGAIN_A BWN_PHY_N(0x2AB) +#define BWN_NPHY_REV3_C2_CLIP_MEDGAIN_B BWN_PHY_N(0x2AC) +#define BWN_NPHY_REV3_C2_CLIP_LOGAIN_A BWN_PHY_N(0x2AD) +#define BWN_NPHY_REV3_C2_CLIP_LOGAIN_B BWN_PHY_N(0x2AE) +#define BWN_NPHY_REV3_C2_CLIP2_GAIN_A BWN_PHY_N(0x2AF) +#define BWN_NPHY_REV3_C2_CLIP2_GAIN_B BWN_PHY_N(0x2B0) + +#define BWN_NPHY_REV7_RF_CTL_MISC_REG3 BWN_PHY_N(0x340) +#define BWN_NPHY_REV7_RF_CTL_MISC_REG4 BWN_PHY_N(0x341) +#define BWN_NPHY_REV7_RF_CTL_OVER3 BWN_PHY_N(0x342) +#define BWN_NPHY_REV7_RF_CTL_OVER4 BWN_PHY_N(0x343) +#define BWN_NPHY_REV7_RF_CTL_MISC_REG5 BWN_PHY_N(0x344) +#define BWN_NPHY_REV7_RF_CTL_MISC_REG6 BWN_PHY_N(0x345) +#define BWN_NPHY_REV7_RF_CTL_OVER5 BWN_PHY_N(0x346) +#define BWN_NPHY_REV7_RF_CTL_OVER6 BWN_PHY_N(0x347) + +#define BWN_PHY_B_BBCFG BWN_PHY_N_BMODE(0x001) /* BB config */ +#define BWN_PHY_B_BBCFG_RSTCCA 0x4000 /* Reset CCA */ +#define BWN_PHY_B_BBCFG_RSTRX 0x8000 /* Reset RX */ +#define BWN_PHY_B_TEST BWN_PHY_N_BMODE(0x00A) + +#endif /* __IF_BWN_PHY_N_REGS_H__ */ From owner-svn-src-all@freebsd.org Sun May 15 06:24:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75DFBB3CA73; Sun, 15 May 2016 06:24:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FFAB1F96; Sun, 15 May 2016 06:24:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id 190so177566501iow.1; Sat, 14 May 2016 23:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=bYAI1+0wIcZVBN5UCj6LrmyKwCUlwvJ9Ra4Vl1e5Gug=; b=0WhHOXPduS8z8rL1JOM0/JP3kY9Ly4Q4iBalIWj91ybsEAroCRE9bHLJ0P4SEO4wCE 09dfH31IfHg9J6lH4bVbchGMGHnzcnlSjgPlu095d2KZmSqhOYadN/5k3+C7IfpvOV8v gF8xsFexQG/yciZLxyyprlMVM/BzrBeLSQhbG6gUS3N+RClnJg2YF0g1e2IQoioYWDUB WczB1TZyands9y/sptNedzXM5JbBUHq1oRJZwQFNVknHCvyu6XQyXd4W7ae1+VONlgI0 Ap0zJGkZYBKkWmXezQ+0CWAt3m/3W9u/oFwTq371x49WMcuXjL01+IR7Hw2yr5kuDkOO Epmg== 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:date :message-id:subject:from:to:cc; bh=bYAI1+0wIcZVBN5UCj6LrmyKwCUlwvJ9Ra4Vl1e5Gug=; b=SOCx1zgBDN7PcDd3vMo4o4fTTPa4G+WuhI93dUAIghmmp5Vdq2dBGOJVMRvlxDATIK wLRWFwG2n17E3yelRIqSF4spnO0dv4NpACu4sW25pSly+vMN4k/rBmcG2EQh4m/rRJ+6 vH5+VQgCiH/L3smdrPWafKTQjQeSesd19cKU3xB+Vw/kGRNyqaQmMLefAteKt03d6Uh5 2QAWhPeTfUIiPRekwQDThpUSbMEiFFNmxTRwAYuRRdASgTYzi22G7JO82PGJExu+vQKe JTlPkWneTSMeLvK4CLBR4MkCrqZEI7h8fk5xY0IhL5AY+cKbrF7bkEQv7dzDUamC6FML P/gw== X-Gm-Message-State: AOPr4FXK1XaQk0bnAFcGm/ttXvAag7lpB9vfhl3xqFZUSRJkIcVsyhOuXjCE9GchAHKTv7/VNFtI4F8yRN8wZQ== MIME-Version: 1.0 X-Received: by 10.36.83.65 with SMTP id n62mr4860176itb.71.1463293447479; Sat, 14 May 2016 23:24:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Sat, 14 May 2016 23:24:07 -0700 (PDT) In-Reply-To: References: <201605141952.u4EJq4jP017501@repo.freebsd.org> Date: Sat, 14 May 2016 23:24:07 -0700 X-Google-Sender-Auth: E2fgc-jrpkcGx1r_ldoASSK8LUc Message-ID: Subject: Re: svn commit: r299751 - head/sys/dev/bwn From: Adrian Chadd To: cem@freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 06:24:08 -0000 On 14 May 2016 at 18:33, Conrad Meyer wrote: > On Sat, May 14, 2016 at 12:52 PM, Adrian Chadd wrote: >> Author: adrian >> Date: Sat May 14 19:52:04 2016 >> New Revision: 299751 >> URL: https://svnweb.freebsd.org/changeset/base/299751 >> >> Log: >> [bwn] migrate sqrt and add another couple of util routines. >> >> ... >> >> +unsigned int >> +bwn_sqrt(struct bwn_mac *mac, unsigned int x) >> +{ >> + /* Table holding (10 * sqrt(x)) for x between 1 and 256. */ >> + static uint8_t sqrt_table[256] = { >> + 10, 14, 17, 20, 22, 24, 26, 28, >> ... >> + }; >> + >> + if (x == 0) >> + return (0); >> + if (x >= 256) { >> + unsigned int tmp; >> + >> + for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1) >> + /* do nothing */ ; >> + return (tmp); > > Does this approximation method have a name? "whatever the broadcom driver requires". >> + } >> + return (sqrt_table[x - 1] / 10); > > Why do we store the table as 10*sqrt() if we're just going to divide > every entry by ten? no idea, I just shuffled the code around so newer PHY code can use it! -a From owner-svn-src-all@freebsd.org Sun May 15 06:25:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B4A3B3CAC1; Sun, 15 May 2016 06:25:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) (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 5C9D2110A; Sun, 15 May 2016 06:25:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f54.google.com with SMTP id x19so227391590oix.2; Sat, 14 May 2016 23:25:19 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=BdZJwQ0cq+kD0R0tQlPM6blIr5KVwwoDXZHtEV1YbB8=; b=A8cx9Mau2lqwkVsgRlzpDgZ+a5h0XoWOMVOdDlSHFtwMQobY35kary4TtvetXDRjYR 88NGorghI/rLKSvcRnqY99roohZVybEAiknPy7pRHJWungELu1s3urIOV2SVGWOIXTzx tBoH0/A1RrJ5tPSBRONE0P7VAYF/O3PTmPvKPeEoz7aM4pcFoFMfZOMPSvP/n48Xosf4 qK85CugsU7S1qrDQYPyj/UlpvV8sLE9kNAXT1x1sNkey1s8DJ3q0CmTeJAr6Z5SbNqsc lhVO04L7YKi1EYkqE4CjpgcGwN/lXpW7RFnsl7nBXUtz3/HCF/FIxt3gc7kv89Wn3QpX gMmQ== X-Gm-Message-State: AOPr4FVJ8qZGZxAoT6Le78j5KGdR32h6MntqDRn/J+xXfqc2QovUCZG8GZPRrrPneNpbwA== X-Received: by 10.157.41.33 with SMTP id d30mr14084139otb.179.1463293511753; Sat, 14 May 2016 23:25:11 -0700 (PDT) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com. [209.85.218.44]) by smtp.gmail.com with ESMTPSA id t3sm8064949oih.7.2016.05.14.23.25.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 May 2016 23:25:11 -0700 (PDT) Received: by mail-oi0-f44.google.com with SMTP id v145so227247778oie.0; Sat, 14 May 2016 23:25:11 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.213.148 with SMTP id m142mr11366247oig.24.1463293511180; Sat, 14 May 2016 23:25:11 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Sat, 14 May 2016 23:25:11 -0700 (PDT) In-Reply-To: <201605142322.u4ENMcxV083873@repo.freebsd.org> References: <201605142322.u4ENMcxV083873@repo.freebsd.org> Date: Sat, 14 May 2016 23:25:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299778 - head/usr.sbin/bsnmpd/tools/libbsnmptools From: Conrad Meyer To: Garrett Cooper 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 06:25:19 -0000 On Sat, May 14, 2016 at 4:22 PM, Garrett Cooper wrote: > Author: ngie > Date: Sat May 14 23:22:38 2016 > New Revision: 299778 > URL: https://svnweb.freebsd.org/changeset/base/299778 > > Log: > Use a consistent errno save/restore pattern before running strtoul This is begging to be reduced to a subroutine for the common expression. Best, Conrad > > - Save errno > - Set errno to 0 > - Call strtoul > - Test errno (optional, but many calls to strtoul did this afterwards) > > Some of the code was setting errno = 0 after calling strtoul, not setting > errno = 0, or setting errno to saved_errno after the call, but before the > test. These all have unwanted behavioral side-effects, depending on the > initial value of errno and whether or not the input to strtoul was correct > or incorrect. > > MFC after: 3 weeks > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c > > Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c > ============================================================================== > --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 23:22:19 2016 (r299777) > +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 23:22:38 2016 (r299778) > @@ -364,6 +364,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'MM-' */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -377,6 +378,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'DD,' */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -390,6 +392,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'HH:' */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -403,6 +406,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'MM:' */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -416,6 +420,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'SS.' */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -429,6 +434,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'M(mseconds),' */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -454,6 +460,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'HH:' */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -467,6 +474,7 @@ snmp_date2asn_oid(char *str, struct asn_ > /* 'MM' - last one - ignore endptr here. */ > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0) > goto error; > @@ -725,6 +733,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as > > ptr = str; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0 || (v / 1000) > 9) { > warnx("Integer value %s not supported", str); > @@ -749,6 +758,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as > > ptr = endptr + 1; > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 10); > if (errno != 0 || (v / 1000) > 9) { > warnx("Integer value %s not supported", str); > @@ -776,6 +786,7 @@ parse_ntp_ts(struct snmp_value *sv, char > uint8_t ntp_ts[SNMP_NTP_TS_OCTETS]; > > saved_errno = errno; > + errno = 0; > v = strtoul(val, &endptr, 10); > if (errno != 0 || (v / 1000) > 9) { > errno = saved_errno; > @@ -797,6 +808,7 @@ parse_ntp_ts(struct snmp_value *sv, char > val = endptr + 1; > > saved_errno = errno; > + errno = 0; > v = strtoul(val, &endptr, 10); > if (errno != 0 || (v / 1000) > 9) { > errno = saved_errno; > @@ -879,8 +891,8 @@ snmp_bridgeid2oct(char *str, struct asn_ > ptr = str; > /* Read the priority. */ > saved_errno = errno; > - v = strtoul(ptr, &endptr, 10); > errno = 0; > + v = strtoul(ptr, &endptr, 10); > > if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { > errno = saved_errno; > @@ -897,6 +909,7 @@ snmp_bridgeid2oct(char *str, struct asn_ > ptr = endptr + 1; > for (i = 0; i < 5; i++) { > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 16); > errno = saved_errno; > if (v > 0xff) { > @@ -914,6 +927,7 @@ snmp_bridgeid2oct(char *str, struct asn_ > > /* The last one - don't check the ending char here. */ > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 16); > errno = saved_errno; > if (v > 0xff) { > @@ -938,7 +952,6 @@ parse_bridge_id(struct snmp_value *sv, c > saved_errno = errno; > errno = 0; > v = strtoul(string, &endptr, 10); > - errno = saved_errno; > > if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { > errno = saved_errno; > @@ -1026,8 +1039,8 @@ snmp_bport_id2oct(char *str, struct asn_ > ptr = str; > /* Read the priority. */ > saved_errno = errno; > - v = strtoul(ptr, &endptr, 10); > errno = 0; > + v = strtoul(ptr, &endptr, 10); > > if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { > errno = saved_errno; > @@ -1039,6 +1052,7 @@ snmp_bport_id2oct(char *str, struct asn_ > return (NULL); > > saved_errno = errno; > + errno = 0; > v = strtoul(ptr, &endptr, 16); > errno = saved_errno; > > @@ -1065,7 +1079,6 @@ parse_bport_id(struct snmp_value *value, > saved_errno = errno; > errno = 0; > v = strtoul(string, &endptr, 10); > - errno = saved_errno; > > if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { > errno = saved_errno; > From owner-svn-src-all@freebsd.org Sun May 15 07:02:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F8A9B3C155; Sun, 15 May 2016 07:02: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 D7BB8126C; Sun, 15 May 2016 07:02:35 +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 u4F72Znn025750; Sun, 15 May 2016 07:02:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F72Z0m025749; Sun, 15 May 2016 07:02:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605150702.u4F72Z0m025749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 May 2016 07:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299847 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 07:02:36 -0000 Author: adrian Date: Sun May 15 07:02:34 2016 New Revision: 299847 URL: https://svnweb.freebsd.org/changeset/base/299847 Log: [bwn] add DUALPHY; this may be useful for PHY-N and later dual-phy probing. Obtained from: Landon Fuller Modified: head/sys/dev/bwn/if_bwnreg.h Modified: head/sys/dev/bwn/if_bwnreg.h ============================================================================== --- head/sys/dev/bwn/if_bwnreg.h Sun May 15 06:11:40 2016 (r299846) +++ head/sys/dev/bwn/if_bwnreg.h Sun May 15 07:02:34 2016 (r299847) @@ -108,6 +108,7 @@ #define BWN_TGSHIGH_HAVE_2GHZ 0x00010000 #define BWN_TGSHIGH_HAVE_5GHZ 0x00020000 +#define BWN_TGSHIGH_DUALPHY 0x00080000 #define BWN_PHYTYPE_A 0x00 #define BWN_PHYTYPE_B 0x01 From owner-svn-src-all@freebsd.org Sun May 15 08:35:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76526B3276C; Sun, 15 May 2016 08:35:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43FDA1259; Sun, 15 May 2016 08:35:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4F8YxX6054450; Sun, 15 May 2016 08:34:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F8YxAU054449; Sun, 15 May 2016 08:34:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605150834.u4F8YxAU054449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 15 May 2016 08:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299848 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 08:35:00 -0000 Author: trasz Date: Sun May 15 08:34:59 2016 New Revision: 299848 URL: https://svnweb.freebsd.org/changeset/base/299848 Log: Make it possible to reroot into NFS. This means one can have eg an NFSv4 root over WiFi: boot from md_root (small rootfs image preloaded by loader(8)), setup WiFi, and then reroot into the actual root, over NFS. Note that it's currently limited to NFSv4, and due to problems with nfsuserd(8) it requres a workaround on the server side: one needs to set the vfs.nfsd.enable_stringtouid=1 sysctl and not run nfsuserd(8) on either the server or the client side. Reviewed by: rmacklem@ MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6347 Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun May 15 07:02:34 2016 (r299847) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun May 15 08:34:59 2016 (r299848) @@ -741,6 +741,101 @@ static const char *nfs_opts[] = { "from" NULL }; /* + * Parse the "from" mountarg, passed by the generic mount(8) program + * or the mountroot code. This is used when rerooting into NFS. + * + * Note that the "hostname" is actually a "hostname:/share/path" string. + */ +static int +nfs_mount_parse_from(struct vfsoptlist *opts, char **hostnamep, + struct sockaddr_in **sinp, char *dirpath, size_t dirpathsize, int *dirlenp) +{ + char nam[MNAMELEN + 1]; + char *delimp, *hostp, *spec; + int error, have_bracket = 0, offset, rv, speclen; + struct sockaddr_in *sin; + size_t len; + + error = vfs_getopt(opts, "from", (void **)&spec, &speclen); + if (error != 0) + return (error); + + /* + * This part comes from sbin/mount_nfs/mount_nfs.c:getnfsargs(). + */ + if (*spec == '[' && (delimp = strchr(spec + 1, ']')) != NULL && + *(delimp + 1) == ':') { + hostp = spec + 1; + spec = delimp + 2; + have_bracket = 1; + } else if ((delimp = strrchr(spec, ':')) != NULL) { + hostp = spec; + spec = delimp + 1; + } else if ((delimp = strrchr(spec, '@')) != NULL) { + printf("%s: path@server syntax is deprecated, " + "use server:path\n", __func__); + hostp = delimp + 1; + } else { + printf("%s: no : nfs-name\n", __func__); + return (EINVAL); + } + *delimp = '\0'; + + /* + * If there has been a trailing slash at mounttime it seems + * that some mountd implementations fail to remove the mount + * entries from their mountlist while unmounting. + */ + for (speclen = strlen(spec); + speclen > 1 && spec[speclen - 1] == '/'; + speclen--) + spec[speclen - 1] = '\0'; + if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { + printf("%s: %s:%s: name too long", __func__, hostp, spec); + return (EINVAL); + } + /* Make both '@' and ':' notations equal */ + if (*hostp != '\0') { + len = strlen(hostp); + offset = 0; + if (have_bracket) + nam[offset++] = '['; + memmove(nam + offset, hostp, len); + if (have_bracket) + nam[len + offset++] = ']'; + nam[len + offset++] = ':'; + memmove(nam + len + offset, spec, speclen); + nam[len + speclen + offset] = '\0'; + } + + /* + * XXX: IPv6 + */ + sin = malloc(sizeof(*sin), M_SONAME, M_WAITOK); + rv = inet_pton(AF_INET, hostp, &sin->sin_addr); + if (rv != 1) { + printf("%s: cannot parse '%s', inet_pton() returned %d\n", + __func__, hostp, rv); + free(sin, M_SONAME); + return (EINVAL); + } + + sin->sin_len = sizeof(*sin); + sin->sin_family = AF_INET; + /* + * XXX: hardcoded port number. + */ + sin->sin_port = htons(2049); + + *hostnamep = strdup(nam, M_NEWNFSMNT); + *sinp = sin; + strlcpy(dirpath, spec, dirpathsize); + *dirlenp = strlen(dirpath); + + return (0); +} + +/* * VFS Operations. * * mount system call @@ -785,17 +880,20 @@ nfs_mount(struct mount *mp) int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; int minvers = 0; - int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen; + int dirlen, has_nfs_args_opt, has_nfs_from_opt, + krbnamelen, srvkrbnamelen; size_t hstlen; has_nfs_args_opt = 0; + has_nfs_from_opt = 0; if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; goto out; } td = curthread; - if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS) { + if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS && + nfs_diskless_valid != 0) { error = nfs_mountroot(mp); goto out; } @@ -1135,6 +1233,19 @@ nfs_mount(struct mount *mp) args.addrlen); if (error != 0) goto out; + } else if (nfs_mount_parse_from(mp->mnt_optnew, + &args.hostname, (struct sockaddr_in **)&nam, dirpath, + sizeof(dirpath), &dirlen) == 0) { + has_nfs_from_opt = 1; + bcopy(args.hostname, hst, MNAMELEN); + hst[MNAMELEN - 1] = '\0'; + + /* + * This only works with NFSv4 for now. + */ + args.fhsize = 0; + args.flags |= NFSMNT_NFSV4; + args.sotype = SOCK_STREAM; } else { if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh, &args.fhsize) == 0) { @@ -1174,13 +1285,16 @@ nfs_mount(struct mount *mp) krbname[0] = '\0'; krbnamelen = strlen(krbname); - if (vfs_getopt(mp->mnt_optnew, "dirpath", (void **)&name, NULL) == 0) - strlcpy(dirpath, name, sizeof (dirpath)); - else - dirpath[0] = '\0'; - dirlen = strlen(dirpath); + if (has_nfs_from_opt == 0) { + if (vfs_getopt(mp->mnt_optnew, + "dirpath", (void **)&name, NULL) == 0) + strlcpy(dirpath, name, sizeof (dirpath)); + else + dirpath[0] = '\0'; + dirlen = strlen(dirpath); + } - if (has_nfs_args_opt == 0) { + if (has_nfs_args_opt == 0 && has_nfs_from_opt == 0) { if (vfs_getopt(mp->mnt_optnew, "addr", (void **)&args.addr, &args.addrlen) == 0) { if (args.addrlen > SOCK_MAXADDRLEN) { From owner-svn-src-all@freebsd.org Sun May 15 08:36:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63AF6B327DD; Sun, 15 May 2016 08:36:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A86B13CC; Sun, 15 May 2016 08:36:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4F8aDSP054559; Sun, 15 May 2016 08:36:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F8aDQl054557; Sun, 15 May 2016 08:36:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605150836.u4F8aDQl054557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 15 May 2016 08:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299849 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 08:36:14 -0000 Author: trasz Date: Sun May 15 08:36:12 2016 New Revision: 299849 URL: https://svnweb.freebsd.org/changeset/base/299849 Log: Remove NULL checks after M_WAITOK allocations from isp(4). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_sbus.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun May 15 08:34:59 2016 (r299848) +++ head/sys/dev/isp/isp_pci.c Sun May 15 08:36:12 2016 (r299849) @@ -1593,11 +1593,6 @@ isp_pci_mbxdma(ispsoftc_t *isp) len = isp->isp_maxcmds * sizeof (struct isp_pcmd); isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_osinfo.pcmd_pool == NULL) { - isp_prt(isp, ISP_LOGERR, "cannot allocate pcmds"); - ISP_LOCK(isp); - return (1); - } if (isp->isp_osinfo.sixtyfourbit) { nsegs = ISP_NSEG64_MAX; @@ -1614,12 +1609,6 @@ isp_pci_mbxdma(ispsoftc_t *isp) len = sizeof (isp_hdl_t) * isp->isp_maxcmds; isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_xflist == NULL) { - free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); - ISP_LOCK(isp); - isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array"); - return (1); - } for (len = 0; len < isp->isp_maxcmds - 1; len++) { isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; } Modified: head/sys/dev/isp/isp_sbus.c ============================================================================== --- head/sys/dev/isp/isp_sbus.c Sun May 15 08:34:59 2016 (r299848) +++ head/sys/dev/isp/isp_sbus.c Sun May 15 08:36:12 2016 (r299849) @@ -448,19 +448,8 @@ isp_sbus_mbxdma(ispsoftc_t *isp) len = sizeof (struct isp_pcmd) * isp->isp_maxcmds; isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_osinfo.pcmd_pool == NULL) { - isp_prt(isp, ISP_LOGERR, "cannot alloc pcmd pool"); - ISP_LOCK(isp); - return (1); - } - len = sizeof (isp_hdl_t *) * isp->isp_maxcmds; isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_xflist == NULL) { - isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array"); - ISP_LOCK(isp); - return (1); - } for (len = 0; len < isp->isp_maxcmds - 1; len++) { isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; } From owner-svn-src-all@freebsd.org Sun May 15 13:17:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3201AB3AB94; Sun, 15 May 2016 13:17:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2251E84; Sun, 15 May 2016 13:17:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FDH6Km038969; Sun, 15 May 2016 13:17:06 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FDH6Ma038967; Sun, 15 May 2016 13:17:06 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605151317.u4FDH6Ma038967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 May 2016 13:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299850 - in head/usr.bin/xinstall: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 13:17:07 -0000 Author: jilles Date: Sun May 15 13:17:05 2016 New Revision: 299850 URL: https://svnweb.freebsd.org/changeset/base/299850 Log: install: When preserving timestamps, also copy the nanoseconds part. Modified: head/usr.bin/xinstall/tests/install_test.sh head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/tests/install_test.sh ============================================================================== --- head/usr.bin/xinstall/tests/install_test.sh Sun May 15 08:36:12 2016 (r299849) +++ head/usr.bin/xinstall/tests/install_test.sh Sun May 15 13:17:05 2016 (r299850) @@ -64,6 +64,12 @@ copy_to_nonexistent_backup_safe_body() { copy_to_nonexistent_with_opts -b -B.bak -S } +atf_test_case copy_to_nonexistent_preserving +copy_to_nonexistent_preserving_body() { + copy_to_nonexistent_with_opts -p + [ ! testf -ot copyf ] || atf_fail "bad timestamp 2" +} + copy_self_with_opts() { printf 'test\n123\r456\r\n789\0z' >testf printf 'test\n123\r456\r\n789\0z' >testf2 @@ -307,6 +313,7 @@ atf_init_test_cases() { atf_add_test_case copy_to_nonexistent_safe_comparing atf_add_test_case copy_to_nonexistent_backup atf_add_test_case copy_to_nonexistent_backup_safe + atf_add_test_case copy_to_nonexistent_preserving atf_add_test_case copy_self atf_add_test_case copy_self_safe atf_add_test_case copy_self_comparing Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sun May 15 08:36:12 2016 (r299849) +++ head/usr.bin/xinstall/xinstall.c Sun May 15 13:17:05 2016 (r299850) @@ -131,7 +131,7 @@ static void do_symlink(const char *, con static void makelink(const char *, const char *, const struct stat *); static void install(const char *, const char *, u_long, u_int); static void install_dir(char *); -static void metadata_log(const char *, const char *, struct timeval *, +static void metadata_log(const char *, const char *, struct timespec *, const char *, const char *, off_t); static int parseid(const char *, id_t *); static void strip(const char *); @@ -722,7 +722,7 @@ static void install(const char *from_name, const char *to_name, u_long fset, u_int flags) { struct stat from_sb, temp_sb, to_sb; - struct timeval tvb[2]; + struct timespec tsb[2]; int devnull, files_match, from_fd, serrno, target; int tempcopy, temp_fd, to_fd; char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN]; @@ -857,11 +857,9 @@ install(const char *from_name, const cha * Need to preserve target file times, though. */ if (to_sb.st_nlink != 1) { - tvb[0].tv_sec = to_sb.st_atime; - tvb[0].tv_usec = 0; - tvb[1].tv_sec = to_sb.st_mtime; - tvb[1].tv_usec = 0; - (void)utimes(tempfile, tvb); + tsb[0] = to_sb.st_atim; + tsb[1] = to_sb.st_mtim; + (void)utimensat(AT_FDCWD, tempfile, tsb, 0); } else { files_match = 1; (void)unlink(tempfile); @@ -916,11 +914,9 @@ install(const char *from_name, const cha * Preserve the timestamp of the source file if necessary. */ if (dopreserve && !files_match && !devnull) { - tvb[0].tv_sec = from_sb.st_atime; - tvb[0].tv_usec = 0; - tvb[1].tv_sec = from_sb.st_mtime; - tvb[1].tv_usec = 0; - (void)utimes(to_name, tvb); + tsb[0] = from_sb.st_atim; + tsb[1] = from_sb.st_mtim; + (void)utimensat(AT_FDCWD, to_name, tsb, 0); } if (fstat(to_fd, &to_sb) == -1) { @@ -989,7 +985,7 @@ install(const char *from_name, const cha if (!devnull) (void)close(from_fd); - metadata_log(to_name, "file", tvb, NULL, digestresult, to_sb.st_size); + metadata_log(to_name, "file", tsb, NULL, digestresult, to_sb.st_size); free(digestresult); } @@ -1301,7 +1297,7 @@ again: * or to allow integrity checks to be performed. */ static void -metadata_log(const char *path, const char *type, struct timeval *tv, +metadata_log(const char *path, const char *type, struct timespec *ts, const char *slink, const char *digestresult, off_t size) { static const char extra[] = { ' ', '\t', '\n', '\\', '#', '\0' }; @@ -1355,9 +1351,9 @@ metadata_log(const char *path, const cha } if (*type == 'f') /* type=file */ fprintf(metafp, " size=%lld", (long long)size); - if (tv != NULL && dopreserve) - fprintf(metafp, " time=%lld.%ld", - (long long)tv[1].tv_sec, (long)tv[1].tv_usec); + if (ts != NULL && dopreserve) + fprintf(metafp, " time=%lld.%09ld", + (long long)ts[1].tv_sec, ts[1].tv_nsec); if (digestresult && digest) fprintf(metafp, " %s=%s", digest, digestresult); if (fflags) From owner-svn-src-all@freebsd.org Sun May 15 13:21:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFDD5B3AC88; Sun, 15 May 2016 13:21:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8206610AB; Sun, 15 May 2016 13:21:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FDKxmf039761; Sun, 15 May 2016 13:20:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FDKx3x039760; Sun, 15 May 2016 13:20:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201605151320.u4FDKx3x039760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 15 May 2016 13:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299851 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 13:21:00 -0000 Author: manu Date: Sun May 15 13:20:59 2016 New Revision: 299851 URL: https://svnweb.freebsd.org/changeset/base/299851 Log: Allow arm generic_timer code to be included even if not present in the SoC. Reviewed by: andrew Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6372 Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sun May 15 13:17:05 2016 (r299850) +++ head/sys/arm/arm/generic_timer.c Sun May 15 13:20:59 2016 (r299851) @@ -214,7 +214,8 @@ static void tmr_setup_user_access(void *arg __unused) { - smp_rendezvous(NULL, setup_user_access, NULL, NULL); + if (arm_tmr_sc != NULL) + smp_rendezvous(NULL, setup_user_access, NULL, NULL); } SYSINIT(tmr_ua, SI_SUB_SMP, SI_ORDER_SECOND, tmr_setup_user_access, NULL); From owner-svn-src-all@freebsd.org Sun May 15 14:39:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5908B39333; Sun, 15 May 2016 14:39:42 +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 7D0401431; Sun, 15 May 2016 14:39: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 u4FEdfhi063164; Sun, 15 May 2016 14:39:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FEdf8a063163; Sun, 15 May 2016 14:39:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605151439.u4FEdf8a063163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 May 2016 14:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299852 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 14:39:42 -0000 Author: adrian Date: Sun May 15 14:39:41 2016 New Revision: 299852 URL: https://svnweb.freebsd.org/changeset/base/299852 Log: [bwn] remove N-PHY registers for now. I've submitted an alternative proposal to -core about just importing the (converted) GPL PHY code in an alternate directory under sys/gnu/ so I don't have to rewrite it all to be BSD licenced. Deleted: head/sys/dev/bwn/if_bwn_phy_n_regs.h From owner-svn-src-all@freebsd.org Sun May 15 14:43:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AB9B396C1; Sun, 15 May 2016 14:43:53 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65ADB1A45; Sun, 15 May 2016 14:43:53 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FEhq1n066211; Sun, 15 May 2016 14:43:52 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FEhqSf066205; Sun, 15 May 2016 14:43:52 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201605151443.u4FEhqSf066205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 15 May 2016 14:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299853 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 14:43:53 -0000 Author: mmel Date: Sun May 15 14:43:52 2016 New Revision: 299853 URL: https://svnweb.freebsd.org/changeset/base/299853 Log: OFWGPIOBUS: Make ofwgpiobus_devclass externaly visible. It's needed for binding of gpio controllers. Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Sun May 15 14:39:41 2016 (r299852) +++ head/sys/dev/gpio/ofw_gpiobus.c Sun May 15 14:43:52 2016 (r299853) @@ -569,7 +569,7 @@ static device_method_t ofw_gpiobus_metho DEVMETHOD_END }; -static devclass_t ofwgpiobus_devclass; +devclass_t ofwgpiobus_devclass; DEFINE_CLASS_1(gpiobus, ofw_gpiobus_driver, ofw_gpiobus_methods, sizeof(struct gpiobus_softc), gpiobus_driver); From owner-svn-src-all@freebsd.org Sun May 15 14:47:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01942B397FA; Sun, 15 May 2016 14:47:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C756C1D17; Sun, 15 May 2016 14:47:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FElpcr066463; Sun, 15 May 2016 14:47:51 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FElpqr066462; Sun, 15 May 2016 14:47:51 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201605151447.u4FElpqr066462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 15 May 2016 14:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299854 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 14:47:52 -0000 Author: mmel Date: Sun May 15 14:47:50 2016 New Revision: 299854 URL: https://svnweb.freebsd.org/changeset/base/299854 Log: TEGRA: Don't use common name 'gpio' for tegra specific GPIO driver. Using commn name for different drivers breaks generic kernel creation. Modified: head/sys/arm/nvidia/tegra_gpio.c Modified: head/sys/arm/nvidia/tegra_gpio.c ============================================================================== --- head/sys/arm/nvidia/tegra_gpio.c Sun May 15 14:43:52 2016 (r299853) +++ head/sys/arm/nvidia/tegra_gpio.c Sun May 15 14:47:50 2016 (r299854) @@ -883,7 +883,7 @@ static device_method_t tegra_gpio_method }; static driver_t tegra_gpio_driver = { - "gpio", + "tegra_gpio", tegra_gpio_methods, sizeof(struct tegra_gpio_softc), }; @@ -891,3 +891,8 @@ static devclass_t tegra_gpio_devclass; EARLY_DRIVER_MODULE(tegra_gpio, simplebus, tegra_gpio_driver, tegra_gpio_devclass, 0, 0, 70); + +extern devclass_t ofwgpiobus_devclass; +extern driver_t ofw_gpiobus_driver; +EARLY_DRIVER_MODULE(ofw_gpiobus, tegra_gpio, ofw_gpiobus_driver, +ofwgpiobus_devclass, 0, 0, BUS_PASS_BUS); From owner-svn-src-all@freebsd.org Sun May 15 15:13:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CA29B39E2F; Sun, 15 May 2016 15:13:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29BB01A15; Sun, 15 May 2016 15:13:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FFDuZX075831; Sun, 15 May 2016 15:13:56 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FFDua8075830; Sun, 15 May 2016 15:13:56 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201605151513.u4FFDua8075830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 15 May 2016 15:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299855 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 15:13:57 -0000 Author: mmel Date: Sun May 15 15:13:56 2016 New Revision: 299855 URL: https://svnweb.freebsd.org/changeset/base/299855 Log: OFWIICBUS: Make ofwiicbus_devclass externaly visible. It's needed for binding of iic controllers. Modified: head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Sun May 15 14:47:50 2016 (r299854) +++ head/sys/dev/ofw/ofw_iicbus.c Sun May 15 15:13:56 2016 (r299855) @@ -76,7 +76,7 @@ struct ofw_iicbus_devinfo { struct ofw_bus_devinfo opd_obdinfo; }; -static devclass_t ofwiicbus_devclass; +devclass_t ofwiicbus_devclass; DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, sizeof(struct iicbus_softc), iicbus_driver); From owner-svn-src-all@freebsd.org Sun May 15 15:14:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E0E1B39E85; Sun, 15 May 2016 15:14:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB081B96; Sun, 15 May 2016 15:14:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FFEkYH075900; Sun, 15 May 2016 15:14:46 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FFEkFg075899; Sun, 15 May 2016 15:14:46 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201605151514.u4FFEkFg075899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 15 May 2016 15:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299856 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 15:14:47 -0000 Author: mmel Date: Sun May 15 15:14:46 2016 New Revision: 299856 URL: https://svnweb.freebsd.org/changeset/base/299856 Log: TEGRA: Don't use common name 'iicb' for tegra specific IIC driver. Using commn name for different drivers breaks generic kernel creation. Modified: head/sys/arm/nvidia/tegra_i2c.c Modified: head/sys/arm/nvidia/tegra_i2c.c ============================================================================== --- head/sys/arm/nvidia/tegra_i2c.c Sun May 15 15:13:56 2016 (r299855) +++ head/sys/arm/nvidia/tegra_i2c.c Sun May 15 15:14:46 2016 (r299856) @@ -800,5 +800,9 @@ static device_method_t tegra_i2c_methods DEFINE_CLASS_0(iichb, tegra_i2c_driver, tegra_i2c_methods, sizeof(struct tegra_i2c_softc)); static devclass_t tegra_i2c_devclass; -EARLY_DRIVER_MODULE(iichb, simplebus, tegra_i2c_driver, tegra_i2c_devclass, 0, - 0, 73); +EARLY_DRIVER_MODULE(tegra_iic, simplebus, tegra_i2c_driver, tegra_i2c_devclass, + 0, 0, 73); +extern devclass_t ofwiicbus_devclass; +extern driver_t ofw_iicbus_driver; +EARLY_DRIVER_MODULE(ofw_iicbus, tegra_iic, ofw_iicbus_driver, + ofwiicbus_devclass, 0, 0, BUS_PASS_BUS); From owner-svn-src-all@freebsd.org Sun May 15 15:26:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA243B3C089; Sun, 15 May 2016 15:26:20 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7235311AF; Sun, 15 May 2016 15:26:20 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FFQJFj079246; Sun, 15 May 2016 15:26:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FFQJ7l079245; Sun, 15 May 2016 15:26:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605151526.u4FFQJ7l079245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 15 May 2016 15:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299857 - stable/9/sys/contrib/ipfilter/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 15:26:20 -0000 Author: cy Date: Sun May 15 15:26:19 2016 New Revision: 299857 URL: https://svnweb.freebsd.org/changeset/base/299857 Log: Fix: IP Filter bug 1835705: It is impossible to delete a state using SIOCDELST ioctl. This is a direct commit to the stable/9 branch because this patch was already included in the ipfilter 5.1.2 import in r254562. It was ultimately included in ipfilter 4.1.29 (whereas stable/9 uses 4.1.28). Obtained from: ipfilter CVS repo: ip_state.c r1.13 Modified: stable/9/sys/contrib/ipfilter/netinet/ip_state.c Modified: stable/9/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/9/sys/contrib/ipfilter/netinet/ip_state.c Sun May 15 15:14:46 2016 (r299856) +++ stable/9/sys/contrib/ipfilter/netinet/ip_state.c Sun May 15 15:26:19 2016 (r299857) @@ -421,7 +421,7 @@ caddr_t data; if ((sp->is_p == st.is_p) && (sp->is_v == st.is_v) && !bcmp((caddr_t)&sp->is_src, (caddr_t)&st.is_src, sizeof(st.is_src)) && - !bcmp((caddr_t)&sp->is_dst, (caddr_t)&st.is_src, + !bcmp((caddr_t)&sp->is_dst, (caddr_t)&st.is_dst, sizeof(st.is_dst)) && !bcmp((caddr_t)&sp->is_ps, (caddr_t)&st.is_ps, sizeof(st.is_ps))) { From owner-svn-src-all@freebsd.org Sun May 15 15:31:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DD3EB3C11C; Sun, 15 May 2016 15:31:46 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E32D91449; Sun, 15 May 2016 15:31:45 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FFVjSl082042; Sun, 15 May 2016 15:31:45 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FFVj8q082041; Sun, 15 May 2016 15:31:45 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201605151531.u4FFVj8q082041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 15 May 2016 15:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299858 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 15:31:46 -0000 Author: mmel Date: Sun May 15 15:31:44 2016 New Revision: 299858 URL: https://svnweb.freebsd.org/changeset/base/299858 Log: TEGRA: Also attach gpioc to tegra_gpio driver. Forgotten in r299854. Modified: head/sys/arm/nvidia/tegra_gpio.c Modified: head/sys/arm/nvidia/tegra_gpio.c ============================================================================== --- head/sys/arm/nvidia/tegra_gpio.c Sun May 15 15:26:19 2016 (r299857) +++ head/sys/arm/nvidia/tegra_gpio.c Sun May 15 15:31:44 2016 (r299858) @@ -895,4 +895,7 @@ EARLY_DRIVER_MODULE(tegra_gpio, simplebu extern devclass_t ofwgpiobus_devclass; extern driver_t ofw_gpiobus_driver; EARLY_DRIVER_MODULE(ofw_gpiobus, tegra_gpio, ofw_gpiobus_driver, -ofwgpiobus_devclass, 0, 0, BUS_PASS_BUS); + ofwgpiobus_devclass, 0, 0, BUS_PASS_BUS); +extern devclass_t gpioc_devclass; +extern driver_t gpioc_driver; +DRIVER_MODULE(gpioc, tegra_gpio, gpioc_driver, gpioc_devclass, 0, 0); From owner-svn-src-all@freebsd.org Sun May 15 15:52:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77B27B3C79C; Sun, 15 May 2016 15:52:35 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B3401320; Sun, 15 May 2016 15:52:35 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FFqYca088296; Sun, 15 May 2016 15:52:34 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FFqYa6088295; Sun, 15 May 2016 15:52:34 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605151552.u4FFqYa6088295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 15 May 2016 15:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299859 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 15:52:35 -0000 Author: jmcneill Date: Sun May 15 15:52:34 2016 New Revision: 299859 URL: https://svnweb.freebsd.org/changeset/base/299859 Log: Allow RSB to be used from interrupt handlers. The driver uses polling mode if cold or !THREAD_CAN_SLEEP() and now implements the bus_* interface. Modified: head/sys/arm/allwinner/aw_rsb.c Modified: head/sys/arm/allwinner/aw_rsb.c ============================================================================== --- head/sys/arm/allwinner/aw_rsb.c Sun May 15 15:31:44 2016 (r299858) +++ head/sys/arm/allwinner/aw_rsb.c Sun May 15 15:52:34 2016 (r299859) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -201,21 +202,22 @@ static int rsb_start(device_t dev) { struct rsb_softc *sc; - int error, retry; + int error, retry, polling; sc = device_get_softc(dev); + polling = cold || !THREAD_CAN_SLEEP(); RSB_ASSERT_LOCKED(sc); /* Enable interrupts */ - if (!cold) + if (!polling) RSB_WRITE(sc, RSB_INTE, INT_MASK); /* Start the transfer */ RSB_WRITE(sc, RSB_CTRL, GLOBAL_INT_ENB | START_TRANS); /* Wait for transfer to complete */ - if (cold) { + if (polling) { error = ETIMEDOUT; for (retry = RSB_I2C_TIMEOUT; retry > 0; retry--) { sc->status |= RSB_READ(sc, RSB_INTS); @@ -482,6 +484,17 @@ static device_method_t rsb_methods[] = { DEVMETHOD(device_probe, rsb_probe), DEVMETHOD(device_attach, rsb_attach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + /* OFW methods */ DEVMETHOD(ofw_bus_get_node, rsb_get_node), From owner-svn-src-all@freebsd.org Sun May 15 15:54:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DE86B3C896; Sun, 15 May 2016 15:54:43 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D03F11787; Sun, 15 May 2016 15:54:42 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FFsfCf088527; Sun, 15 May 2016 15:54:41 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FFsfh6088526; Sun, 15 May 2016 15:54:41 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605151554.u4FFsfh6088526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 15 May 2016 15:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299860 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 15:54:43 -0000 Author: jmcneill Date: Sun May 15 15:54:41 2016 New Revision: 299860 URL: https://svnweb.freebsd.org/changeset/base/299860 Log: Add support for the AXP813/AXP818 power key and GPIO pins. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Sun May 15 15:52:34 2016 (r299859) +++ head/sys/arm/allwinner/axp81x.c Sun May 15 15:54:41 2016 (r299860) @@ -40,20 +40,51 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include + #include #include #include "iicbus_if.h" +#include "gpio_if.h" #define AXP_ICTYPE 0x03 #define AXP_POWERBAT 0x32 #define AXP_POWERBAT_SHUTDOWN (1 << 7) +#define AXP_IRQEN1 0x40 +#define AXP_IRQEN2 0x41 +#define AXP_IRQEN3 0x42 +#define AXP_IRQEN4 0x43 +#define AXP_IRQEN5 0x44 +#define AXP_IRQEN5_POKSIRQ (1 << 4) +#define AXP_IRQEN6 0x45 +#define AXP_IRQSTAT5 0x4c +#define AXP_IRQSTAT5_POKSIRQ (1 << 4) +#define AXP_GPIO0_CTRL 0x90 +#define AXP_GPIO1_CTRL 0x92 +#define AXP_GPIO_FUNC (0x7 << 0) +#define AXP_GPIO_FUNC_SHIFT 0 +#define AXP_GPIO_FUNC_DRVLO 0 +#define AXP_GPIO_FUNC_DRVHI 1 +#define AXP_GPIO_FUNC_INPUT 2 +#define AXP_GPIO_SIGBIT 0x94 +#define AXP_GPIO_PD 0x97 + +static const struct { + const char *name; + uint8_t ctrl_reg; +} axp81x_pins[] = { + { "GPIO0", AXP_GPIO0_CTRL }, + { "GPIO1", AXP_GPIO1_CTRL }, +}; static struct ofw_compat_data compat_data[] = { { "x-powers,axp813", 1 }, @@ -61,11 +92,23 @@ static struct ofw_compat_data compat_dat { NULL, 0 } }; +static struct resource_spec axp81x_spec[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + struct axp81x_softc { + struct resource *res; uint16_t addr; - struct intr_config_hook enum_hook; + void *ih; + device_t gpiodev; + struct mtx mtx; + int busy; }; +#define AXP_LOCK(sc) mtx_lock(&(sc)->mtx) +#define AXP_UNLOCK(sc) mtx_unlock(&(sc)->mtx) + static int axp81x_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { @@ -124,6 +167,267 @@ axp81x_shutdown(void *devp, int howto) axp81x_write(dev, AXP_POWERBAT, AXP_POWERBAT_SHUTDOWN); } +static void +axp81x_intr(void *arg) +{ + struct axp81x_softc *sc; + device_t dev; + uint8_t val; + int error; + + dev = arg; + sc = device_get_softc(dev); + + error = axp81x_read(dev, AXP_IRQSTAT5, &val, 1); + if (error != 0) + return; + + if (val != 0) { + if ((val & AXP_IRQSTAT5_POKSIRQ) != 0) { + if (bootverbose) + device_printf(dev, "Power button pressed\n"); + shutdown_nice(RB_POWEROFF); + } + /* Acknowledge */ + axp81x_write(dev, AXP_IRQSTAT5, val); + } +} + +static device_t +axp81x_gpio_get_bus(device_t dev) +{ + struct axp81x_softc *sc; + + sc = device_get_softc(dev); + + return (sc->gpiodev); +} + +static int +axp81x_gpio_pin_max(device_t dev, int *maxpin) +{ + *maxpin = nitems(axp81x_pins) - 1; + + return (0); +} + +static int +axp81x_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + if (pin >= nitems(axp81x_pins)) + return (EINVAL); + + snprintf(name, GPIOMAXNAME, "%s", axp81x_pins[pin].name); + + return (0); +} + +static int +axp81x_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + if (pin >= nitems(axp81x_pins)) + return (EINVAL); + + *caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + + return (0); +} + +static int +axp81x_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct axp81x_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp81x_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + THREAD_SLEEPING_OK(); + error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; + if (func == AXP_GPIO_FUNC_INPUT) + *flags = GPIO_PIN_INPUT; + else if (func == AXP_GPIO_FUNC_DRVLO || + func == AXP_GPIO_FUNC_DRVHI) + *flags = GPIO_PIN_OUTPUT; + else + *flags = 0; + } + THREAD_NO_SLEEPING(); + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp81x_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct axp81x_softc *sc; + uint8_t data; + int error; + + if (pin >= nitems(axp81x_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + THREAD_SLEEPING_OK(); + error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + data &= ~AXP_GPIO_FUNC; + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) != 0) { + if ((flags & GPIO_PIN_OUTPUT) == 0) + data |= AXP_GPIO_FUNC_INPUT; + } + error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); + } + THREAD_NO_SLEEPING(); + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp81x_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct axp81x_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp81x_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + THREAD_SLEEPING_OK(); + error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; + switch (func) { + case AXP_GPIO_FUNC_DRVLO: + *val = 0; + break; + case AXP_GPIO_FUNC_DRVHI: + *val = 1; + break; + case AXP_GPIO_FUNC_INPUT: + error = axp81x_read(dev, AXP_GPIO_SIGBIT, &data, 1); + if (error == 0) + *val = (data & (1 << pin)) ? 1 : 0; + break; + default: + error = EIO; + break; + } + } + THREAD_NO_SLEEPING(); + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp81x_gpio_pin_set(device_t dev, uint32_t pin, unsigned int val) +{ + struct axp81x_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp81x_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + THREAD_SLEEPING_OK(); + error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; + switch (func) { + case AXP_GPIO_FUNC_DRVLO: + case AXP_GPIO_FUNC_DRVHI: + data &= ~AXP_GPIO_FUNC; + data |= (val << AXP_GPIO_FUNC_SHIFT); + break; + default: + error = EIO; + break; + } + } + if (error == 0) + error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); + THREAD_NO_SLEEPING(); + AXP_UNLOCK(sc); + + return (error); +} + + +static int +axp81x_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct axp81x_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp81x_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + THREAD_SLEEPING_OK(); + error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; + switch (func) { + case AXP_GPIO_FUNC_DRVLO: + data &= ~AXP_GPIO_FUNC; + data |= (AXP_GPIO_FUNC_DRVHI << AXP_GPIO_FUNC_SHIFT); + break; + case AXP_GPIO_FUNC_DRVHI: + data &= ~AXP_GPIO_FUNC; + data |= (AXP_GPIO_FUNC_DRVLO << AXP_GPIO_FUNC_SHIFT); + break; + default: + error = EIO; + break; + } + } + if (error == 0) + error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); + THREAD_NO_SLEEPING(); + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp81x_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, + int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + if (gpios[0] >= nitems(axp81x_pins)) + return (EINVAL); + + *pin = gpios[0]; + *flags = gpios[1]; + + return (0); +} + +static phandle_t +axp81x_get_node(device_t dev, device_t bus) +{ + return (ofw_bus_get_node(dev)); +} + static int axp81x_probe(device_t dev) { @@ -143,19 +447,45 @@ axp81x_attach(device_t dev) { struct axp81x_softc *sc; uint8_t chip_id; + int error; sc = device_get_softc(dev); sc->addr = iicbus_get_addr(dev); + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + error = bus_alloc_resources(dev, axp81x_spec, &sc->res); + if (error != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (error); + } if (bootverbose) { axp81x_read(dev, AXP_ICTYPE, &chip_id, 1); device_printf(dev, "chip ID 0x%02x\n", chip_id); } + /* Enable IRQ on short power key press */ + axp81x_write(dev, AXP_IRQEN1, 0); + axp81x_write(dev, AXP_IRQEN2, 0); + axp81x_write(dev, AXP_IRQEN3, 0); + axp81x_write(dev, AXP_IRQEN4, 0); + axp81x_write(dev, AXP_IRQEN5, AXP_IRQEN5_POKSIRQ); + axp81x_write(dev, AXP_IRQEN6, 0); + + /* Install interrupt handler */ + error = bus_setup_intr(dev, sc->res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, axp81x_intr, dev, &sc->ih); + if (error != 0) { + device_printf(dev, "cannot setup interrupt handler\n"); + return (error); + } + EVENTHANDLER_REGISTER(shutdown_final, axp81x_shutdown, dev, SHUTDOWN_PRI_LAST); + sc->gpiodev = gpiobus_attach_bus(dev); + return (0); } @@ -164,6 +494,21 @@ static device_method_t axp81x_methods[] DEVMETHOD(device_probe, axp81x_probe), DEVMETHOD(device_attach, axp81x_attach), + /* GPIO interface */ + DEVMETHOD(gpio_get_bus, axp81x_gpio_get_bus), + DEVMETHOD(gpio_pin_max, axp81x_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, axp81x_gpio_pin_getname), + DEVMETHOD(gpio_pin_getcaps, axp81x_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, axp81x_gpio_pin_getflags), + DEVMETHOD(gpio_pin_setflags, axp81x_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, axp81x_gpio_pin_get), + DEVMETHOD(gpio_pin_set, axp81x_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, axp81x_gpio_pin_toggle), + DEVMETHOD(gpio_map_gpios, axp81x_gpio_map_gpios), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_node, axp81x_get_node), + DEVMETHOD_END }; @@ -174,7 +519,12 @@ static driver_t axp81x_driver = { }; static devclass_t axp81x_devclass; +extern devclass_t ofwgpiobus_devclass, gpioc_devclass; +extern driver_t ofw_gpiobus_driver, gpioc_driver; DRIVER_MODULE(axp81x, iicbus, axp81x_driver, axp81x_devclass, 0, 0); +DRIVER_MODULE(ofw_gpiobus, axp81x_pmu, ofw_gpiobus_driver, + ofwgpiobus_devclass, 0, 0); +DRIVER_MODULE(gpioc, axp81x_pmu, gpioc_driver, gpioc_devclass, 0, 0); MODULE_VERSION(axp81x, 1); MODULE_DEPEND(axp81x, iicbus, 1, 1, 1); From owner-svn-src-all@freebsd.org Sun May 15 15:56:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6CB6B3C904; Sun, 15 May 2016 15:56:49 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9643F195F; Sun, 15 May 2016 15:56:49 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FFumdX088656; Sun, 15 May 2016 15:56:48 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FFumxD088655; Sun, 15 May 2016 15:56:48 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605151556.u4FFumxD088655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 15 May 2016 15:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299861 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 15:56:49 -0000 Author: jmcneill Date: Sun May 15 15:56:48 2016 New Revision: 299861 URL: https://svnweb.freebsd.org/changeset/base/299861 Log: Add gpio-leds for Sinovoip BananaPi BPI-M3. The green LED on the board is wired to AXP813 GPIO0 and the blue LED is wired to AXP813 GPIO1. Modified: head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Modified: head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Sun May 15 15:54:41 2016 (r299860) +++ head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Sun May 15 15:56:48 2016 (r299861) @@ -104,5 +104,23 @@ reg = <0x3a3>; interrupt-parent = <&nmi_intc>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + gpio-controller; + #gpio-cells = <1>; + }; +}; + +/ { + leds { + compatible = "gpio-leds"; + + green_led { + gpios = <&axp81x 0>; /* AXP PMIC GPIO0 */ + label = "green_led"; + }; + + blue_led { + gpios = <&axp81x 1>; /* AXP PMIC GPIO1 */ + label = "blue_led"; + }; }; }; From owner-svn-src-all@freebsd.org Sun May 15 16:43:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72235B3C66E; Sun, 15 May 2016 16:43:48 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8BA1A53; Sun, 15 May 2016 16:43:48 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FGhl8t006669; Sun, 15 May 2016 16:43:47 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FGhlFw006667; Sun, 15 May 2016 16:43:47 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605151643.u4FGhlFw006667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 15 May 2016 16:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299862 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 16:43:48 -0000 Author: jmcneill Date: Sun May 15 16:43:47 2016 New Revision: 299862 URL: https://svnweb.freebsd.org/changeset/base/299862 Log: Reduce complexity of RSB by always using polling mode. Unfortunately gpiobus methods can be called with non-sleepable locks held. Reviewed by: mmel Modified: head/sys/arm/allwinner/aw_rsb.c head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/aw_rsb.c ============================================================================== --- head/sys/arm/allwinner/aw_rsb.c Sun May 15 15:56:48 2016 (r299861) +++ head/sys/arm/allwinner/aw_rsb.c Sun May 15 16:43:47 2016 (r299862) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -100,7 +99,6 @@ static struct ofw_compat_data compat_dat static struct resource_spec rsb_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 0, RF_ACTIVE }, { -1, 0 } }; @@ -125,12 +123,11 @@ static const struct { }; struct rsb_softc { - struct resource *res[2]; + struct resource *res; struct mtx mtx; clk_t clk; hwreset_t rst; device_t iicbus; - void *ih; int busy; uint32_t status; uint16_t cur_addr; @@ -141,8 +138,8 @@ struct rsb_softc { #define RSB_LOCK(sc) mtx_lock(&(sc)->mtx) #define RSB_UNLOCK(sc) mtx_unlock(&(sc)->mtx) #define RSB_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) -#define RSB_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) -#define RSB_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) +#define RSB_READ(sc, reg) bus_read_4((sc)->res, (reg)) +#define RSB_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) static phandle_t rsb_get_node(device_t bus, device_t dev) @@ -202,34 +199,24 @@ static int rsb_start(device_t dev) { struct rsb_softc *sc; - int error, retry, polling; + int error, retry; sc = device_get_softc(dev); - polling = cold || !THREAD_CAN_SLEEP(); RSB_ASSERT_LOCKED(sc); - /* Enable interrupts */ - if (!polling) - RSB_WRITE(sc, RSB_INTE, INT_MASK); - /* Start the transfer */ RSB_WRITE(sc, RSB_CTRL, GLOBAL_INT_ENB | START_TRANS); /* Wait for transfer to complete */ - if (polling) { - error = ETIMEDOUT; - for (retry = RSB_I2C_TIMEOUT; retry > 0; retry--) { - sc->status |= RSB_READ(sc, RSB_INTS); - if ((sc->status & INT_TRANS_OVER) != 0) { - error = 0; - break; - } - DELAY((1000 * hz) / RSB_I2C_TIMEOUT); + error = ETIMEDOUT; + for (retry = RSB_I2C_TIMEOUT; retry > 0; retry--) { + sc->status |= RSB_READ(sc, RSB_INTS); + if ((sc->status & INT_TRANS_OVER) != 0) { + error = 0; + break; } - } else { - error = mtx_sleep(sc, &sc->mtx, 0, "i2ciowait", - RSB_I2C_TIMEOUT); + DELAY((1000 * hz) / RSB_I2C_TIMEOUT); } if (error == 0 && (sc->status & INT_TRANS_OVER) == 0) { device_printf(dev, "transfer error, status 0x%08x\n", @@ -237,9 +224,6 @@ rsb_start(device_t dev) error = EIO; } - /* Disable interrupts */ - RSB_WRITE(sc, RSB_INTE, 0); - return (error); } @@ -389,23 +373,6 @@ done: return (error); } -static void -rsb_intr(void *arg) -{ - struct rsb_softc *sc; - uint32_t val; - - sc = arg; - - RSB_LOCK(sc); - val = RSB_READ(sc, RSB_INTS); - RSB_WRITE(sc, RSB_INTS, val); - sc->status |= val; - if ((sc->status & INT_MASK) != 0) - wakeup(sc); - RSB_UNLOCK(sc); -} - static int rsb_probe(device_t dev) { @@ -443,19 +410,12 @@ rsb_attach(device_t dev) } } - if (bus_alloc_resources(dev, rsb_spec, sc->res) != 0) { + if (bus_alloc_resources(dev, rsb_spec, &sc->res) != 0) { device_printf(dev, "cannot allocate resources for device\n"); error = ENXIO; goto fail; } - error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, - NULL, rsb_intr, sc, &sc->ih); - if (error != 0) { - device_printf(dev, "cannot setup interrupt handler\n"); - goto fail; - } - sc->iicbus = device_add_child(dev, "iicbus", -1); if (sc->iicbus == NULL) { device_printf(dev, "cannot add iicbus child device\n"); @@ -468,9 +428,7 @@ rsb_attach(device_t dev) return (0); fail: - if (sc->ih != NULL) - bus_teardown_intr(dev, sc->res[1], sc->ih); - bus_release_resources(dev, rsb_spec, sc->res); + bus_release_resources(dev, rsb_spec, &sc->res); if (sc->rst != NULL) hwreset_release(sc->rst); if (sc->clk != NULL) Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Sun May 15 15:56:48 2016 (r299861) +++ head/sys/arm/allwinner/axp81x.c Sun May 15 16:43:47 2016 (r299862) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -246,7 +245,6 @@ axp81x_gpio_pin_getflags(device_t dev, u sc = device_get_softc(dev); AXP_LOCK(sc); - THREAD_SLEEPING_OK(); error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; @@ -258,7 +256,6 @@ axp81x_gpio_pin_getflags(device_t dev, u else *flags = 0; } - THREAD_NO_SLEEPING(); AXP_UNLOCK(sc); return (error); @@ -277,7 +274,6 @@ axp81x_gpio_pin_setflags(device_t dev, u sc = device_get_softc(dev); AXP_LOCK(sc); - THREAD_SLEEPING_OK(); error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); if (error == 0) { data &= ~AXP_GPIO_FUNC; @@ -287,7 +283,6 @@ axp81x_gpio_pin_setflags(device_t dev, u } error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); } - THREAD_NO_SLEEPING(); AXP_UNLOCK(sc); return (error); @@ -306,7 +301,6 @@ axp81x_gpio_pin_get(device_t dev, uint32 sc = device_get_softc(dev); AXP_LOCK(sc); - THREAD_SLEEPING_OK(); error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; @@ -327,7 +321,6 @@ axp81x_gpio_pin_get(device_t dev, uint32 break; } } - THREAD_NO_SLEEPING(); AXP_UNLOCK(sc); return (error); @@ -346,7 +339,6 @@ axp81x_gpio_pin_set(device_t dev, uint32 sc = device_get_softc(dev); AXP_LOCK(sc); - THREAD_SLEEPING_OK(); error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; @@ -363,7 +355,6 @@ axp81x_gpio_pin_set(device_t dev, uint32 } if (error == 0) error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); - THREAD_NO_SLEEPING(); AXP_UNLOCK(sc); return (error); @@ -383,7 +374,6 @@ axp81x_gpio_pin_toggle(device_t dev, uin sc = device_get_softc(dev); AXP_LOCK(sc); - THREAD_SLEEPING_OK(); error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; @@ -403,7 +393,6 @@ axp81x_gpio_pin_toggle(device_t dev, uin } if (error == 0) error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); - THREAD_NO_SLEEPING(); AXP_UNLOCK(sc); return (error); From owner-svn-src-all@freebsd.org Sun May 15 16:46:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46B14B3C70E for ; Sun, 15 May 2016 16:46:01 +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 0BAD11D0B for ; Sun, 15 May 2016 16:46:00 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 8cd5ed74-1abc-11e6-9de8-1b78d5a2543b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 15 May 2016 16:46:19 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4FGjvcB045039; Sun, 15 May 2016 10:45:57 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463330757.1180.154.camel@freebsd.org> Subject: Re: svn commit: r299839 - head/etc/rc.d From: Ian Lepore To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 15 May 2016 10:45:57 -0600 In-Reply-To: <201605150438.u4F4coNR080598@repo.freebsd.org> References: <201605150438.u4F4coNR080598@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 16:46:01 -0000 On Sun, 2016-05-15 at 04:38 +0000, Garrett Cooper wrote: > Author: ngie > Date: Sun May 15 04:38:50 2016 > New Revision: 299839 > URL: https://svnweb.freebsd.org/changeset/base/299839 > > Log: > Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol > > Make zfs and zvol come before all of the items that depended on > them > previously > I'm trying to figure out why these changes are needed. rcorder works just fine when a requirement has no providers (yes, it whines, but that's why /etc/rc invokes it with 2>/dev/null). If FILESYSTEMS requires zfs and nothing provides zfs, then it's as if the requirement weren't in the list at all. The manpage for rcorder is wrong, the DIAGNOSTICS section implies that rcorder will abort on a missing requirement, but it doesn't. Changing requirements to BEFOREs seems like it has a lot of potential for messing with peoples' out-of-tree customizations. (And for some reason I've always had the impression that BEFORE was to be avoided in the base rc files, but I can't remember why I think that.) -- Ian From owner-svn-src-all@freebsd.org Sun May 15 17:25:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B08AB3C12C; Sun, 15 May 2016 17:25:32 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C13112AC; Sun, 15 May 2016 17:25:32 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FHPVhZ019159; Sun, 15 May 2016 17:25:31 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FHPVE6019158; Sun, 15 May 2016 17:25:31 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605151725.u4FHPVE6019158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 15 May 2016 17:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299863 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 17:25:32 -0000 Author: jmcneill Date: Sun May 15 17:25:31 2016 New Revision: 299863 URL: https://svnweb.freebsd.org/changeset/base/299863 Log: Enable SATA power regulator at boot on Sinovoip BananaPi BPI-M3. Modified: head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Modified: head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Sun May 15 16:43:47 2016 (r299862) +++ head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Sun May 15 17:25:31 2016 (r299863) @@ -37,6 +37,15 @@ status = "okay"; }; +®_ahci_5v { + gpio = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */ + status = "okay"; +}; + +&ahci_pwr_pin_a { + allwinner,pins = "PD25"; +}; + ®_usb1_vbus { gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ status = "okay"; From owner-svn-src-all@freebsd.org Sun May 15 20:04:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A973CB3CEB5; Sun, 15 May 2016 20:04:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FBD210A3; Sun, 15 May 2016 20:04:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FK4hfD069387; Sun, 15 May 2016 20:04:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FK4hsr069383; Sun, 15 May 2016 20:04:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605152004.u4FK4hsr069383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 15 May 2016 20:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299864 - in head/sys: cam/scsi modules/cam modules/tcp/fastpath netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 20:04:44 -0000 Author: markj Date: Sun May 15 20:04:43 2016 New Revision: 299864 URL: https://svnweb.freebsd.org/changeset/base/299864 Log: opt_kdtrace.h is not needed for SDT probes as of r258541. Modified: head/sys/cam/scsi/scsi_pass.c head/sys/modules/cam/Makefile head/sys/modules/tcp/fastpath/Makefile head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Sun May 15 17:25:31 2016 (r299863) +++ head/sys/cam/scsi/scsi_pass.c Sun May 15 20:04:43 2016 (r299864) @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_kdtrace.h" - #include #include #include Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Sun May 15 17:25:31 2016 (r299863) +++ head/sys/modules/cam/Makefile Sun May 15 20:04:43 2016 (r299864) @@ -11,7 +11,6 @@ SRCS= opt_cam.h SRCS+= opt_ada.h SRCS+= opt_scsi.h SRCS+= opt_cd.h -SRCS+= opt_kdtrace.h SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h Modified: head/sys/modules/tcp/fastpath/Makefile ============================================================================== --- head/sys/modules/tcp/fastpath/Makefile Sun May 15 17:25:31 2016 (r299863) +++ head/sys/modules/tcp/fastpath/Makefile Sun May 15 20:04:43 2016 (r299864) @@ -7,7 +7,7 @@ KMOD= fastpath SRCS= fastpath.c -SRCS+= opt_ipfw.h opt_inet.h opt_inet6.h opt_ipsec.h opt_kdtrace.h +SRCS+= opt_ipfw.h opt_inet.h opt_inet6.h opt_ipsec.h SRCS+= opt_tcpdebug.h # Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Sun May 15 17:25:31 2016 (r299863) +++ head/sys/netinet/tcp_stacks/fastpath.c Sun May 15 20:04:43 2016 (r299864) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_kdtrace.h" #include "opt_tcpdebug.h" #include From owner-svn-src-all@freebsd.org Sun May 15 21:37:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E39F3B3AB2C; Sun, 15 May 2016 21:37:37 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5FFD132F; Sun, 15 May 2016 21:37:37 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FLbakV096548; Sun, 15 May 2016 21:37:36 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FLbaNF096547; Sun, 15 May 2016 21:37:36 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605152137.u4FLbaNF096547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 15 May 2016 21:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299865 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 21:37:38 -0000 Author: truckman Date: Sun May 15 21:37:36 2016 New Revision: 299865 URL: https://svnweb.freebsd.org/changeset/base/299865 Log: When handling SIOCSIFNAME ensure that the new interface name is NUL terminated. Reject the rename attempt if the name is too long. MFC after: 1 week Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun May 15 20:04:43 2016 (r299864) +++ head/sys/net/if.c Sun May 15 21:37:36 2016 (r299865) @@ -2375,6 +2375,11 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); if (new_name[0] == '\0') return (EINVAL); + if (new_name[IFNAMSIZ-1] != '\0') { + new_name[IFNAMSIZ-1] = '\0'; + if (strlen(new_name) == IFNAMSIZ-1) + return (EINVAL); + } if (ifunit(new_name) != NULL) return (EEXIST); From owner-svn-src-all@freebsd.org Sun May 15 21:45:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8EC1B3AE57; Sun, 15 May 2016 21:45:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4AD193A; Sun, 15 May 2016 21:45:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FLj4xs099424; Sun, 15 May 2016 21:45:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FLj4mW099423; Sun, 15 May 2016 21:45:04 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605152145.u4FLj4mW099423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 15 May 2016 21:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299866 - head/usr.sbin/lmcconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 21:45:05 -0000 Author: truckman Date: Sun May 15 21:45:04 2016 New Revision: 299866 URL: https://svnweb.freebsd.org/changeset/base/299866 Log: Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 974852 MFC after: 1 week Modified: head/usr.sbin/lmcconfig/lmcconfig.c Modified: head/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- head/usr.sbin/lmcconfig/lmcconfig.c Sun May 15 21:37:36 2016 (r299865) +++ head/usr.sbin/lmcconfig/lmcconfig.c Sun May 15 21:45:04 2016 (r299866) @@ -222,7 +222,7 @@ call_driver(unsigned long cmd, struct io { int error = 0; - strncpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); + strlcpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); iohdr->cookie = NGM_LMC_COOKIE; iohdr->iohdr = iohdr; From owner-svn-src-all@freebsd.org Sun May 15 22:06:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26001B3B366; Sun, 15 May 2016 22:06:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA26612B3; Sun, 15 May 2016 22:06:22 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FM6MMD005788; Sun, 15 May 2016 22:06:22 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FM6MQU005786; Sun, 15 May 2016 22:06:22 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605152206.u4FM6MQU005786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 15 May 2016 22:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299867 - head/usr.sbin/rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:06:23 -0000 Author: truckman Date: Sun May 15 22:06:21 2016 New Revision: 299867 URL: https://svnweb.freebsd.org/changeset/base/299867 Log: Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. MFC after: 1 week Modified: head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/if.c Modified: head/usr.sbin/rtadvd/config.c ============================================================================== --- head/usr.sbin/rtadvd/config.c Sun May 15 21:45:04 2016 (r299866) +++ head/usr.sbin/rtadvd/config.c Sun May 15 22:06:21 2016 (r299867) @@ -640,7 +640,7 @@ getconfig_free_pfx: exit(1); } memset(&ndi, 0, sizeof(ndi)); - strncpy(ndi.ifname, ifi->ifi_ifname, sizeof(ndi.ifname)); + strlcpy(ndi.ifname, ifi->ifi_ifname, sizeof(ndi.ifname)); if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0) syslog(LOG_INFO, "<%s> ioctl:SIOCGIFINFO_IN6 at %s: %s", __func__, ifi->ifi_ifname, strerror(errno)); Modified: head/usr.sbin/rtadvd/if.c ============================================================================== --- head/usr.sbin/rtadvd/if.c Sun May 15 21:45:04 2016 (r299866) +++ head/usr.sbin/rtadvd/if.c Sun May 15 22:06:21 2016 (r299867) @@ -387,7 +387,7 @@ update_ifinfo_nd_flags(struct ifinfo *if } /* ND flags */ memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifi->ifi_ifname, + strlcpy(nd.ifname, ifi->ifi_ifname, sizeof(nd.ifname)); error = ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd); if (error) { @@ -516,7 +516,7 @@ update_ifinfo(struct ifilist_head_t *ifi if (ifi->ifi_phymtu == 0) { memset(&ifr, 0, sizeof(ifr)); ifr.ifr_addr.sa_family = AF_INET6; - strncpy(ifr.ifr_name, ifi->ifi_ifname, + strlcpy(ifr.ifr_name, ifi->ifi_ifname, sizeof(ifr.ifr_name)); error = ioctl(s, SIOCGIFMTU, (caddr_t)&ifr); if (error) { From owner-svn-src-all@freebsd.org Sun May 15 22:08:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15F1B3B445; Sun, 15 May 2016 22:08:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3921484; Sun, 15 May 2016 22:08:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4FM80hP068938; Sun, 15 May 2016 15:08:04 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605152208.u4FM80hP068938@gw.catspoiler.org> Date: Sun, 15 May 2016 15:08:00 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299867 - head/usr.sbin/rtadvd To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605152206.u4FM6MQU005786@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:08:09 -0000 On 15 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Sun May 15 22:06:21 2016 > New Revision: 299867 > URL: https://svnweb.freebsd.org/changeset/base/299867 > > Log: > Use strlcpy() instead of strncpy() when copying ifname to ensure > that it is NUL terminated. Additional NUL padding is not required > for short names. > > MFC after: 1 week > > Modified: > head/usr.sbin/rtadvd/config.c > head/usr.sbin/rtadvd/if.c Reported by: Coverity CID: 974860 From owner-svn-src-all@freebsd.org Sun May 15 22:17:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9374B3B5B5; Sun, 15 May 2016 22:17:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1D6C19DF; Sun, 15 May 2016 22:17:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FMHfOj008793; Sun, 15 May 2016 22:17:41 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FMHfUU008792; Sun, 15 May 2016 22:17:41 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605152217.u4FMHfUU008792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 15 May 2016 22:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299868 - head/usr.sbin/rtsold X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:17:43 -0000 Author: truckman Date: Sun May 15 22:17:41 2016 New Revision: 299868 URL: https://svnweb.freebsd.org/changeset/base/299868 Log: Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 99186, 991864, 991865 MFC after: 1 week Modified: head/usr.sbin/rtsold/if.c Modified: head/usr.sbin/rtsold/if.c ============================================================================== --- head/usr.sbin/rtsold/if.c Sun May 15 22:06:21 2016 (r299867) +++ head/usr.sbin/rtsold/if.c Sun May 15 22:17:41 2016 (r299868) @@ -82,7 +82,7 @@ interface_up(char *name) int s; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, name, sizeof(nd.ifname)); @@ -180,7 +180,7 @@ interface_status(struct ifinfo *ifinfo) /* get interface flags */ memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, &ifr) < 0) { warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFFLAGS) on %s: %s", ifname, strerror(errno)); @@ -196,7 +196,7 @@ interface_status(struct ifinfo *ifinfo) if (!ifinfo->mediareqok) goto active; memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name)); + strlcpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name)); if (ioctl(ifsock, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { if (errno != EINVAL) { @@ -396,7 +396,7 @@ get_llflag(const char *name) continue; memset(&ifr6, 0, sizeof(ifr6)); - strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); + strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { warnmsg(LOG_ERR, __func__, From owner-svn-src-all@freebsd.org Sun May 15 22:22:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD63B3B7F9; Sun, 15 May 2016 22:22:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2687F1E00; Sun, 15 May 2016 22:22:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4FMMiM9068979; Sun, 15 May 2016 15:22:48 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605152222.u4FMMiM9068979@gw.catspoiler.org> Date: Sun, 15 May 2016 15:22:44 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299867 - head/usr.sbin/rtadvd To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605152208.u4FM80hP068938@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:22:53 -0000 On 15 May, To: src-committers@freebsd.org wrote: > On 15 May, To: src-committers@freebsd.org wrote: >> Author: truckman >> Date: Sun May 15 22:06:21 2016 >> New Revision: 299867 >> URL: https://svnweb.freebsd.org/changeset/base/299867 >> >> Log: >> Use strlcpy() instead of strncpy() when copying ifname to ensure >> that it is NUL terminated. Additional NUL padding is not required >> for short names. >> >> MFC after: 1 week >> >> Modified: >> head/usr.sbin/rtadvd/config.c >> head/usr.sbin/rtadvd/if.c > > Reported by: Coverity > CID: 974860 Also CID: 1009972, 1009973 From owner-svn-src-all@freebsd.org Sun May 15 22:31:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD83B3B944; Sun, 15 May 2016 22:31:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA521241; Sun, 15 May 2016 22:31:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FMV3Pr014037; Sun, 15 May 2016 22:31:03 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FMV3LQ014036; Sun, 15 May 2016 22:31:03 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605152231.u4FMV3LQ014036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 15 May 2016 22:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299869 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:31:04 -0000 Author: truckman Date: Sun May 15 22:31:03 2016 New Revision: 299869 URL: https://svnweb.freebsd.org/changeset/base/299869 Log: Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 1009974 MFC after: 1 week Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Sun May 15 22:17:41 2016 (r299868) +++ head/usr.sbin/route6d/route6d.c Sun May 15 22:31:03 2016 (r299869) @@ -1592,7 +1592,7 @@ ifconfig1(const char *name, if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && !lflag) return (-1); ifr.ifr_addr = *sin6; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFNETMASK_IN6, (char *)&ifr) < 0) { syslog(LOG_INFO, "ioctl: SIOCGIFNETMASK_IN6"); return (-1); From owner-svn-src-all@freebsd.org Sun May 15 22:35:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F4CB3BAAD; Sun, 15 May 2016 22:35:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 603731527; Sun, 15 May 2016 22:35:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FMZBxO014887; Sun, 15 May 2016 22:35:11 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FMZBLj014886; Sun, 15 May 2016 22:35:11 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605152235.u4FMZBLj014886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 15 May 2016 22:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299870 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:35:12 -0000 Author: cy Date: Sun May 15 22:35:11 2016 New Revision: 299870 URL: https://svnweb.freebsd.org/changeset/base/299870 Log: Make subsequent code reachable. Reported by: Coverity CID 1354625 MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun May 15 22:31:03 2016 (r299869) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun May 15 22:35:11 2016 (r299870) @@ -1165,17 +1165,20 @@ INLINE int ipf_checkv6sum(fin) fr_info_t *fin; { - if ((fin->fin_flx & FI_NOCKSUM) != 0) + if ((fin->fin_flx & FI_NOCKSUM) != 0) { DT(ipf_checkv6sum_fi_nocksum); return 0; + } - if ((fin->fin_flx & FI_SHORT) != 0) + if ((fin->fin_flx & FI_SHORT) != 0) { DT(ipf_checkv6sum_fi_short); return 1; + } - if (fin->fin_cksum != FI_CK_NEEDED) + if (fin->fin_cksum != FI_CK_NEEDED) { DT(ipf_checkv6sum_fi_ck_needed); return (fin->fin_cksum > FI_CK_NEEDED) ? 0 : -1; + } if (ipf_checkl4sum(fin) == -1) { fin->fin_flx |= FI_BAD; From owner-svn-src-all@freebsd.org Sun May 15 22:36:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DD8BB3BB26; Sun, 15 May 2016 22:36:57 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1DC17FC; Sun, 15 May 2016 22:36:57 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FMau31014989; Sun, 15 May 2016 22:36:56 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FMauD3014985; Sun, 15 May 2016 22:36:56 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605152236.u4FMauD3014985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 15 May 2016 22:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299871 - in head/sys: arm/allwinner boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:36:57 -0000 Author: jmcneill Date: Sun May 15 22:36:55 2016 New Revision: 299871 URL: https://svnweb.freebsd.org/changeset/base/299871 Log: Add Allwinner A83T thermal sensor controller support. The A83T thermal sensor controller has three sensors. Sensor 0 corresponds to CPU cluster 0, sensor 1 to CPU cluster 1, and sensor 2 to the GPU. This driver exports the temperature sensor readings via sysctl. Calibration data is obtained from SRAM found in the Secure ID module. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D6378 Added: head/sys/arm/allwinner/aw_sid.c (contents, props changed) head/sys/arm/allwinner/aw_sid.h (contents, props changed) head/sys/arm/allwinner/aw_thermal.c (contents, props changed) Modified: head/sys/arm/allwinner/files.allwinner head/sys/boot/fdt/dts/arm/a83t.dtsi Added: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_sid.c Sun May 15 22:36:55 2016 (r299871) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Allwinner secure ID controller + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define SID_SRAM 0x200 +#define SID_THERMAL_CALIB0 (SID_SRAM + 0x34) +#define SID_THERMAL_CALIB1 (SID_SRAM + 0x38) + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun8i-a83t-sid", 1 }, + { NULL, 0 } +}; + +struct aw_sid_softc { + struct resource *res; +}; + +static struct aw_sid_softc *aw_sid_sc; + +static struct resource_spec aw_sid_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define RD4(sc, reg) bus_read_4((sc)->res, (reg)) +#define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) + +static int +aw_sid_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner Secure ID Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_sid_attach(device_t dev) +{ + struct aw_sid_softc *sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, aw_sid_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + aw_sid_sc = sc; + + return (0); +} + +int +aw_sid_read_tscalib(uint32_t *calib0, uint32_t *calib1) +{ + struct aw_sid_softc *sc; + + sc = aw_sid_sc; + if (sc == NULL) + return (ENXIO); + + *calib0 = RD4(sc, SID_THERMAL_CALIB0); + *calib1 = RD4(sc, SID_THERMAL_CALIB1); + + return (0); +} + +static device_method_t aw_sid_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, aw_sid_probe), + DEVMETHOD(device_attach, aw_sid_attach), + + DEVMETHOD_END +}; + +static driver_t aw_sid_driver = { + "aw_sid", + aw_sid_methods, + sizeof(struct aw_sid_softc), +}; + +static devclass_t aw_sid_devclass; + +EARLY_DRIVER_MODULE(aw_sid, simplebus, aw_sid_driver, aw_sid_devclass, 0, 0, + BUS_PASS_RESOURCE + BUS_PASS_ORDER_FIRST); +MODULE_VERSION(aw_sid, 1); Added: head/sys/arm/allwinner/aw_sid.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_sid.h Sun May 15 22:36:55 2016 (r299871) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __AW_SID_H__ +#define __AW_SID_H__ + +int aw_sid_read_tscalib(uint32_t *, uint32_t *); + +#endif /* !__AW_SID_H__ */ Added: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_thermal.c Sun May 15 22:36:55 2016 (r299871) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Allwinner thermal sensor controller + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define THS_CTRL0 0x00 +#define THS_CTRL2 0x40 +#define SENSOR_ACQ1_SHIFT 16 +#define SENSOR2_EN (1 << 2) +#define SENSOR1_EN (1 << 1) +#define SENSOR0_EN (1 << 0) +#define THS_INTC 0x44 +#define THS_INTS 0x48 +#define THS_FILTER 0x70 +#define FILTER_EN (1 << 2) +#define THS_CALIB0 0x74 +#define THS_CALIB1 0x78 +#define THS_DATA0 0x80 +#define THS_DATA1 0x84 +#define THS_DATA2 0x88 +#define DATA_MASK 0xfff + +#define TEMP_BASE 2719 +#define TEMP_MUL 1000 +#define TEMP_DIV 14186 +#define TEMP_TO_K 273 +#define ADC_ACQUIRE_TIME (24 - 1) +#define SENSOR_ENABLE_ALL (SENSOR0_EN|SENSOR1_EN|SENSOR2_EN) + +enum aw_thermal_sensor { + THS_SENSOR_CPU_CLUSTER0, + THS_SENSOR_CPU_CLUSTER1, + THS_SENSOR_GPU, + THS_SENSOR_END = -1 +}; + +struct aw_thermal_sensor_config { + enum aw_thermal_sensor sensor; + const char *name; + const char *desc; +}; + +static const struct aw_thermal_sensor_config a83t_sensor_config[] = { + { .sensor = THS_SENSOR_CPU_CLUSTER0, + .name = "cluster0", .desc = "CPU cluster 0 temperature" }, + { .sensor = THS_SENSOR_CPU_CLUSTER1, + .name = "cluster1", .desc = "CPU cluster 1 temperature" }, + { .sensor = THS_SENSOR_GPU, + .name = "gpu", .desc = "GPU temperature" }, + { .sensor = THS_SENSOR_END } +}; + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun8i-a83t-ts", (uintptr_t)&a83t_sensor_config }, + { NULL, (uintptr_t)NULL } +}; + +#define THS_CONF(d) \ + (void *)ofw_bus_search_compatible((d), compat_data)->ocd_data + +struct aw_thermal_softc { + struct resource *res; + struct aw_thermal_sensor_config *conf; +}; + +static struct resource_spec aw_thermal_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define RD4(sc, reg) bus_read_4((sc)->res, (reg)) +#define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) + +static int +aw_thermal_init(struct aw_thermal_softc *sc) +{ + uint32_t calib0, calib1; + int error; + + /* Read calibration settings from SRAM */ + error = aw_sid_read_tscalib(&calib0, &calib1); + if (error != 0) + return (error); + + /* Write calibration settings to thermal controller */ + WR4(sc, THS_CALIB0, calib0); + WR4(sc, THS_CALIB1, calib1); + + /* Configure ADC acquire time (CLK_IN/(N+1)) and enable sensors */ + WR4(sc, THS_CTRL0, ADC_ACQUIRE_TIME); + WR4(sc, THS_CTRL2, (ADC_ACQUIRE_TIME << SENSOR_ACQ1_SHIFT) | + SENSOR_ENABLE_ALL); + + /* Disable interrupts */ + WR4(sc, THS_INTC, 0); + WR4(sc, THS_INTS, RD4(sc, THS_INTS)); + + /* Enable average filter */ + WR4(sc, THS_FILTER, RD4(sc, THS_FILTER) | FILTER_EN); + + return (0); +} + +static int +aw_thermal_gettemp(uint32_t val) +{ + int raw; + + raw = val & DATA_MASK; + return (((TEMP_BASE - raw) * TEMP_MUL) / TEMP_DIV) + TEMP_TO_K; +} + +static int +aw_thermal_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct aw_thermal_softc *sc; + enum aw_thermal_sensor sensor; + int val; + + sc = arg1; + sensor = arg2; + + val = aw_thermal_gettemp(RD4(sc, THS_DATA0 + (sensor * 4))); + + return sysctl_handle_opaque(oidp, &val, sizeof(val), req); +} + +static int +aw_thermal_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (THS_CONF(dev) == NULL) + return (ENXIO); + + device_set_desc(dev, "Allwinner Thermal Sensor Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_thermal_attach(device_t dev) +{ + struct aw_thermal_softc *sc; + int i; + + sc = device_get_softc(dev); + + sc->conf = THS_CONF(dev); + + if (bus_alloc_resources(dev, aw_thermal_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + if (aw_thermal_init(sc) != 0) + return (ENXIO); + + for (i = 0; sc->conf[i].sensor != THS_SENSOR_END; i++) + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, sc->conf[i].name, + CTLTYPE_INT | CTLFLAG_RD, + sc, sc->conf[i].sensor, aw_thermal_sysctl, "IK0", + sc->conf[i].desc); + + return (0); +} + +static device_method_t aw_thermal_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, aw_thermal_probe), + DEVMETHOD(device_attach, aw_thermal_attach), + + DEVMETHOD_END +}; + +static driver_t aw_thermal_driver = { + "aw_thermal", + aw_thermal_methods, + sizeof(struct aw_thermal_softc), +}; + +static devclass_t aw_thermal_devclass; + +DRIVER_MODULE(aw_thermal, simplebus, aw_thermal_driver, aw_thermal_devclass, + 0, 0); +MODULE_VERSION(aw_thermal, 1); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun May 15 22:35:11 2016 (r299870) +++ head/sys/arm/allwinner/files.allwinner Sun May 15 22:36:55 2016 (r299871) @@ -24,6 +24,8 @@ arm/allwinner/if_awg.c optional awg arm/allwinner/if_emac.c optional emac arm/allwinner/sunxi_dma_if.m standard dev/iicbus/twsi/a10_twsi.c optional twsi +arm/allwinner/aw_sid.c standard +arm/allwinner/aw_thermal.c standard #arm/allwinner/console.c standard arm/allwinner/a10_fb.c optional vt Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/a83t.dtsi Sun May 15 22:35:11 2016 (r299870) +++ head/sys/boot/fdt/dts/arm/a83t.dtsi Sun May 15 22:36:55 2016 (r299871) @@ -185,6 +185,18 @@ #address-cells = <1>; #size-cells = <0>; }; + + sid: eeprom@01c14000 { + compatible = "allwinner,sun8i-a83t-sid"; + reg = <0x01c14000 0x400>; + }; + + rtp: rtp@01f04000 { + compatible = "allwinner,sun8i-a83t-ts"; + reg = <0x01f04000 0x400>; + interrupts = ; + #thermal-sensor-cells = <0>; + }; }; }; From owner-svn-src-all@freebsd.org Sun May 15 22:42:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76044B3BDD2; Sun, 15 May 2016 22:42:59 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (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 2444F1CAC; Sun, 15 May 2016 22:42:58 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 24kLbGSqdN9d024kMbhYWZ; Sun, 15 May 2016 16:42:51 -0600 X-Authority-Analysis: v=2.2 cv=QZUkhYTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=yrkiwgmsf1kA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=42wr6cOcpHI8fBchrNEA:9 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id AD3B713751; Sun, 15 May 2016 15:42:49 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u4FMgm3V033856; Sun, 15 May 2016 15:42:49 -0700 (PDT) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201605152242.u4FMgm3V033856@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.komquats.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299870 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Cy Schubert of "Sun, 15 May 2016 22:35:11 -0000." <201605152235.u4FMZBLj014886@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 15 May 2016 15:42:48 -0700 X-CMAE-Envelope: MS4wfMdhCJSAZs0iWbeLLcXrJfrKcCJDRtvq6mRtCQ1p7KJvLa390p3kSCOfvQ+m3tMiYTlUJMXbNe+Qh5edYRjz6r0yzzxHdEQkQJFUst4qD+Q/HRw3VUxj S4n35KlmTV2T6zLQR7FTsA4WMaxShKSKzk1506BNWVbbDNfsFW2s21xWHyD93aPg2YaZEOvN23fM+P+OI+HnmW93vpS5AqeClLIqgkVWXhAMLCsL2/nGTWAr tB82njOwMwiitG9PuUO1E31KbTYdA8OiIdczT6KHugJNrIfAVyexu0TsccufZJaO X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 22:42:59 -0000 In message <201605152235.u4FMZBLj014886@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Sun May 15 22:35:11 2016 > New Revision: 299870 > URL: https://svnweb.freebsd.org/changeset/base/299870 > > Log: > Make subsequent code reachable. > > Reported by: Coverity CID 1354625 > MFC after: 3 days Ignore the MFC. It's not required. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sun May 15 23:15:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A7DFB3C556; Sun, 15 May 2016 23:15:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C112B1CD2; Sun, 15 May 2016 23:15:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FNFAwG027132; Sun, 15 May 2016 23:15:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4FNFA1B027129; Sun, 15 May 2016 23:15:10 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605152315.u4FNFA1B027129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 15 May 2016 23:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299872 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 23:15:12 -0000 Author: rmacklem Date: Sun May 15 23:15:10 2016 New Revision: 299872 URL: https://svnweb.freebsd.org/changeset/base/299872 Log: Fix fuse for "cp" of a mode 0444 file to the file system. When "cp" of a file with read-only (mode 0444) to a fuse mounted file system was attempted it would fail with EACCES. This was because fuse would attempt to open the file WRONLY and the open would fail. This patch changes the fuse_vnop_open() to test for an extant read-write open and use that, if it is available. This makes the "cp" of a read-only file to the fuse mounted file system work ok. There are simpler ways to fix this than adding the fuse_filehandle_validrw() function, but this function is useful for future patches related to exporting a fuse filesystem via NFS. MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_file.h head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Sun May 15 22:36:55 2016 (r299871) +++ head/sys/fs/fuse/fuse_file.c Sun May 15 23:15:10 2016 (r299872) @@ -216,6 +216,28 @@ fuse_filehandle_valid(struct vnode *vp, return FUFH_IS_VALID(fufh); } +/* + * Check for a valid file handle, first the type requested, but if that + * isn't valid, try for FUFH_RDWR. + * Return the FUFH type that is valid or FUFH_INVALID if there are none. + * This is a variant of fuse_filehandle_vaild() analogous to + * fuse_filehandle_getrw(). + */ +fufh_type_t +fuse_filehandle_validrw(struct vnode *vp, fufh_type_t fufh_type) +{ + struct fuse_vnode_data *fvdat = VTOFUD(vp); + struct fuse_filehandle *fufh; + + fufh = &fvdat->fufh[fufh_type]; + if (FUFH_IS_VALID(fufh) != 0) + return (fufh_type); + fufh = &fvdat->fufh[FUFH_RDWR]; + if (FUFH_IS_VALID(fufh) != 0) + return (FUFH_RDWR); + return (FUFH_INVALID); +} + int fuse_filehandle_get(struct vnode *vp, fufh_type_t fufh_type, struct fuse_filehandle **fufhp) Modified: head/sys/fs/fuse/fuse_file.h ============================================================================== --- head/sys/fs/fuse/fuse_file.h Sun May 15 22:36:55 2016 (r299871) +++ head/sys/fs/fuse/fuse_file.h Sun May 15 23:15:10 2016 (r299872) @@ -137,6 +137,7 @@ fuse_filehandle_xlate_to_oflags(fufh_typ } int fuse_filehandle_valid(struct vnode *vp, fufh_type_t fufh_type); +fufh_type_t fuse_filehandle_validrw(struct vnode *vp, fufh_type_t fufh_type); int fuse_filehandle_get(struct vnode *vp, fufh_type_t fufh_type, struct fuse_filehandle **fufhp); int fuse_filehandle_getrw(struct vnode *vp, fufh_type_t fufh_type, Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Sun May 15 22:36:55 2016 (r299871) +++ head/sys/fs/fuse/fuse_vnops.c Sun May 15 23:15:10 2016 (r299872) @@ -1153,7 +1153,7 @@ fuse_vnop_open(struct vop_open_args *ap) fuse_open_flags = FOPEN_DIRECT_IO; } - if (fuse_filehandle_valid(vp, fufh_type)) { + if (fuse_filehandle_validrw(vp, fufh_type) != FUFH_INVALID) { fuse_vnode_open(vp, fuse_open_flags, td); return 0; } From owner-svn-src-all@freebsd.org Mon May 16 00:25:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA9E8B3332F; Mon, 16 May 2016 00:25:26 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E4141458; Mon, 16 May 2016 00:25:26 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G0PPWt048123; Mon, 16 May 2016 00:25:25 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G0POnA048112; Mon, 16 May 2016 00:25:24 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160025.u4G0POnA048112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 00:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299873 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 00:25:26 -0000 Author: truckman Date: Mon May 16 00:25:24 2016 New Revision: 299873 URL: https://svnweb.freebsd.org/changeset/base/299873 Log: Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Use sizeof(destination) in a few places instead of IFNAMSIZ. Cast afp->af_ridreq and afp->af_addreq to make the intent of the code more obvious. Reported by: Coverity CID: 1009628, 1009630, 1009631, 1009632, 1009633, 1009635, 1009638 CID: 1009639, 1009640, 1009641, 1009642, 1009643, 1009644, 1009645 CID: 1009646, 1009647, 1010049, 1010050, 1010051, 1010052, 1010053 CID: 1010054, 1011293, 1011294, 1011295, 1011296, 1011297, 1011298 CID: 1011299, 1305821, 1351720, 1351721 MFC after: 1 week Modified: head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_nd6.c head/sbin/ifconfig/ifclone.c head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/iffib.c head/sbin/ifconfig/ifgre.c head/sbin/ifconfig/ifieee80211.c head/sbin/ifconfig/ifmac.c head/sbin/ifconfig/ifmedia.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/af_inet.c Mon May 16 00:25:24 2016 (r299873) @@ -151,7 +151,7 @@ in_status_tunnel(int s) const struct sockaddr *sa = (const struct sockaddr *) &ifr.ifr_addr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, IFNAMSIZ); + strlcpy(ifr.ifr_name, name, IFNAMSIZ); if (ioctl(s, SIOCGIFPSRCADDR, (caddr_t)&ifr) < 0) return; @@ -176,7 +176,7 @@ in_set_tunnel(int s, struct addrinfo *sr struct in_aliasreq addreq; memset(&addreq, 0, sizeof(addreq)); - strncpy(addreq.ifra_name, name, IFNAMSIZ); + strlcpy(addreq.ifra_name, name, IFNAMSIZ); memcpy(&addreq.ifra_addr, srcres->ai_addr, srcres->ai_addr->sa_len); memcpy(&addreq.ifra_dstaddr, dstres->ai_addr, dstres->ai_addr->sa_len); Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/af_inet6.c Mon May 16 00:25:24 2016 (r299873) @@ -184,7 +184,7 @@ in6_status(int s __unused, const struct if (sin == NULL) return; - strncpy(ifr6.ifr_name, ifr.ifr_name, sizeof(ifr.ifr_name)); + strlcpy(ifr6.ifr_name, ifr.ifr_name, sizeof(ifr.ifr_name)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { warn("socket(AF_INET6,SOCK_DGRAM)"); return; @@ -423,7 +423,7 @@ in6_status_tunnel(int s) const struct sockaddr *sa = (const struct sockaddr *) &in6_ifr.ifr_addr; memset(&in6_ifr, 0, sizeof(in6_ifr)); - strncpy(in6_ifr.ifr_name, name, IFNAMSIZ); + strlcpy(in6_ifr.ifr_name, name, sizeof(in6_ifr.ifr_name)); if (ioctl(s, SIOCGIFPSRCADDR_IN6, (caddr_t)&in6_ifr) < 0) return; @@ -450,7 +450,7 @@ in6_set_tunnel(int s, struct addrinfo *s struct in6_aliasreq in6_addreq; memset(&in6_addreq, 0, sizeof(in6_addreq)); - strncpy(in6_addreq.ifra_name, name, IFNAMSIZ); + strlcpy(in6_addreq.ifra_name, name, sizeof(in6_addreq.ifra_name)); memcpy(&in6_addreq.ifra_addr, srcres->ai_addr, srcres->ai_addr->sa_len); memcpy(&in6_addreq.ifra_dstaddr, dstres->ai_addr, dstres->ai_addr->sa_len); Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/af_nd6.c Mon May 16 00:25:24 2016 (r299873) @@ -74,7 +74,7 @@ setnd6flags(const char *dummyaddr __unus int error; memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); + strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); error = ioctl(s, SIOCGIFINFO_IN6, &nd); if (error) { warn("ioctl(SIOCGIFINFO_IN6)"); @@ -99,7 +99,7 @@ setnd6defif(const char *dummyaddr __unus int error; memset(&ndifreq, 0, sizeof(ndifreq)); - strncpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); + strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); if (d < 0) { if (isnd6defif(s)) { @@ -126,7 +126,7 @@ isnd6defif(int s) int error; memset(&ndifreq, 0, sizeof(ndifreq)); - strncpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); + strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); ifindex = if_nametoindex(ndifreq.ifname); error = ioctl(s, SIOCGDEFIFACE_IN6, (caddr_t)&ndifreq); @@ -146,7 +146,7 @@ nd6_status(int s) int isdefif; memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); + strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT) warn("socket(AF_INET6, SOCK_DGRAM)"); Modified: head/sbin/ifconfig/ifclone.c ============================================================================== --- head/sbin/ifconfig/ifclone.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/ifclone.c Mon May 16 00:25:24 2016 (r299873) @@ -162,7 +162,7 @@ DECL_CMD_FUNC(clone_create, arg, d) static DECL_CMD_FUNC(clone_destroy, arg, d) { - (void) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + (void) strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) err(1, "SIOCIFDESTROY"); } Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/ifconfig.c Mon May 16 00:25:24 2016 (r299873) @@ -472,7 +472,7 @@ main(int argc, char *argv[]) ifindex = 0; for (ifa = sifap; ifa; ifa = ifa->ifa_next) { memset(&paifr, 0, sizeof(paifr)); - strncpy(paifr.ifr_name, ifa->ifa_name, sizeof(paifr.ifr_name)); + strlcpy(paifr.ifr_name, ifa->ifa_name, sizeof(paifr.ifr_name)); if (sizeof(paifr.ifr_addr) >= ifa->ifa_addr->sa_len) { memcpy(&paifr.ifr_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len); @@ -671,7 +671,7 @@ ifconfig(int argc, char *const *argv, in struct callback *cb; int s; - strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name); + strlcpy(ifr.ifr_name, name, sizeof ifr.ifr_name); afp = NULL; if (uafp != NULL) afp = uafp; @@ -792,7 +792,8 @@ top: } if (clearaddr) { int ret; - strncpy(afp->af_ridreq, name, sizeof ifr.ifr_name); + strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, + sizeof ifr.ifr_name); ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); if (ret < 0) { if (errno == EADDRNOTAVAIL && (doalias >= 0)) { @@ -809,7 +810,8 @@ top: } } if (newaddr && (setaddr || setmask)) { - strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); + strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, + sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); } @@ -1005,7 +1007,7 @@ static void setifmetric(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_metric = atoi(val); if (ioctl(s, SIOCSIFMETRIC, (caddr_t)&ifr) < 0) err(1, "ioctl SIOCSIFMETRIC (set metric)"); @@ -1015,7 +1017,7 @@ static void setifmtu(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_mtu = atoi(val); if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) < 0) err(1, "ioctl SIOCSIFMTU (set mtu)"); @@ -1027,7 +1029,7 @@ setifname(const char *val, int dummy __u { char *newname; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); newname = strdup(val); if (newname == NULL) @@ -1049,7 +1051,7 @@ setifdescr(const char *val, int dummy __ { char *newdescr; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_buffer.length = strlen(val) + 1; if (ifr.ifr_buffer.length == 1) { @@ -1109,7 +1111,7 @@ status(const struct afswtch *afp, const ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af; } - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0); if (s < 0) @@ -1191,7 +1193,7 @@ status(const struct afswtch *afp, const else if (afp->af_other_status != NULL) afp->af_other_status(s); - strncpy(ifs.ifs_name, name, sizeof ifs.ifs_name); + strlcpy(ifs.ifs_name, name, sizeof ifs.ifs_name); if (ioctl(s, SIOCGIFSTATUS, &ifs) == 0) printf("%s", ifs.ascii); Modified: head/sbin/ifconfig/iffib.c ============================================================================== --- head/sbin/ifconfig/iffib.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/iffib.c Mon May 16 00:25:24 2016 (r299873) @@ -49,13 +49,13 @@ fib_status(int s) struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) == 0 && ifr.ifr_fib != RT_DEFAULT_FIB) printf("\tfib: %u\n", ifr.ifr_fib); memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGTUNFIB, (caddr_t)&ifr) == 0 && ifr.ifr_fib != RT_DEFAULT_FIB) printf("\ttunnelfib: %u\n", ifr.ifr_fib); @@ -74,7 +74,7 @@ setiffib(const char *val, int dummy __un return; } - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_fib = fib; if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) warn("ioctl (SIOCSIFFIB)"); @@ -93,7 +93,7 @@ settunfib(const char *val, int dummy __u return; } - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_fib = fib; if (ioctl(s, SIOCSTUNFIB, (caddr_t)&ifr) < 0) warn("ioctl (SIOCSTUNFIB)"); Modified: head/sbin/ifconfig/ifgre.c ============================================================================== --- head/sbin/ifconfig/ifgre.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/ifgre.c Mon May 16 00:25:24 2016 (r299873) @@ -68,7 +68,7 @@ setifgrekey(const char *val, int dummy _ { uint32_t grekey = strtol(val, NULL, 0); - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_data = (caddr_t)&grekey; if (ioctl(s, GRESKEY, (caddr_t)&ifr) < 0) warn("ioctl (set grekey)"); Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/ifieee80211.c Mon May 16 00:25:24 2016 (r299873) @@ -3366,7 +3366,7 @@ scan_and_wait(int s) return; } (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = IEEE80211_IOC_SCAN_REQ; memset(&sr, 0, sizeof(sr)); @@ -3832,7 +3832,7 @@ get80211wme(int s, int param, int ac, in struct ieee80211req ireq; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = param; ireq.i_len = ac; if (ioctl(s, SIOCG80211, &ireq) < 0) { @@ -4013,7 +4013,7 @@ list_mac(int s) char c; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); /* XXX ?? */ + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); /* XXX ?? */ ireq.i_type = IEEE80211_IOC_MACCMD; ireq.i_val = IEEE80211_MACCMD_POLICY; if (ioctl(s, SIOCG80211, &ireq) < 0) { @@ -4119,7 +4119,7 @@ list_mesh(int s) struct ieee80211req_mesh_route *rt; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = IEEE80211_IOC_MESH_RTCMD; ireq.i_val = IEEE80211_MESH_RTCMD_LIST; ireq.i_data = &routes; @@ -4201,7 +4201,7 @@ get80211opmode(int s) struct ifmediareq ifmr; (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) { if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) { @@ -4347,7 +4347,7 @@ getid(int s, int ix, void *data, size_t struct ieee80211req ireq; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = (!mesh) ? IEEE80211_IOC_SSID : IEEE80211_IOC_MESH_ID; ireq.i_val = ix; ireq.i_data = data; Modified: head/sbin/ifconfig/ifmac.c ============================================================================== --- head/sbin/ifconfig/ifmac.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/ifmac.c Mon May 16 00:25:24 2016 (r299873) @@ -57,7 +57,7 @@ maclabel_status(int s) char *label_text; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (mac_prepare_ifnet_label(&label) == -1) return; @@ -90,7 +90,7 @@ setifmaclabel(const char *val, int d, in } memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_ifru.ifru_data = (void *)label; error = ioctl(s, SIOCSIFMAC, &ifr); Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Sun May 15 23:15:10 2016 (r299872) +++ head/sbin/ifconfig/ifmedia.c Mon May 16 00:25:24 2016 (r299873) @@ -112,7 +112,7 @@ media_status(int s) int xmedia = 1; (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); /* * Check if interface supports extended media types. @@ -213,7 +213,7 @@ ifmedia_getstate(int s) err(1, "malloc"); (void) memset(ifmr, 0, sizeof(struct ifmediareq)); - (void) strncpy(ifmr->ifm_name, name, + (void) strlcpy(ifmr->ifm_name, name, sizeof(ifmr->ifm_name)); ifmr->ifm_count = 0; @@ -287,7 +287,7 @@ setmedia(const char *val, int d, int s, */ subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; @@ -319,7 +319,7 @@ domediaopt(const char *val, int clear, i options = get_media_options(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = ifmr->ifm_current; if (clear) ifr.ifr_media &= ~options; @@ -346,7 +346,7 @@ setmediainst(const char *val, int d, int if (inst < 0 || inst > (int)IFM_INST_MAX) errx(1, "invalid media instance: %s", val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & ~IFM_IMASK) | inst << IFM_ISHIFT; ifmr->ifm_current = ifr.ifr_media; @@ -363,7 +363,7 @@ setmediamode(const char *val, int d, int mode = get_media_mode(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & ~IFM_MMASK) | mode; ifmr->ifm_current = ifr.ifr_media; From owner-svn-src-all@freebsd.org Mon May 16 00:34:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7155FB337FC; Mon, 16 May 2016 00:34:49 +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 4309D1C0B; Mon, 16 May 2016 00:34:49 +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 u4G0Ympr051489; Mon, 16 May 2016 00:34:48 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G0YmXt051488; Mon, 16 May 2016 00:34:48 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605160034.u4G0YmXt051488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 16 May 2016 00:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299874 - head/sbin/init X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 00:34:49 -0000 Author: araujo Date: Mon May 16 00:34:48 2016 New Revision: 299874 URL: https://svnweb.freebsd.org/changeset/base/299874 Log: For pointers use NULL instead of 0. MFC after: 2 weeks. Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Mon May 16 00:25:24 2016 (r299873) +++ head/sbin/init/init.c Mon May 16 00:34:48 2016 (r299874) @@ -328,7 +328,7 @@ invalid: if (kenv(KENV_GET, "init_script", kenv_value, sizeof(kenv_value)) > 0) { state_func_t next_transition; - if ((next_transition = run_script(kenv_value)) != 0) + if ((next_transition = run_script(kenv_value)) != NULL) initial_transition = (state_t) next_transition; } @@ -909,7 +909,7 @@ single_user(void) write_stderr(banner); for (;;) { clear = getpass("Password:"); - if (clear == 0 || *clear == '\0') + if (clear == NULL || *clear == '\0') _exit(0); password = crypt(clear, pp->pw_passwd); bzero(clear, _PASSWORD_LEN); @@ -1022,7 +1022,7 @@ runcom(void) { state_func_t next_transition; - if ((next_transition = run_script(_PATH_RUNCOM)) != 0) + if ((next_transition = run_script(_PATH_RUNCOM)) != NULL) return next_transition; runcom_mode = AUTOBOOT; /* the default */ @@ -1208,7 +1208,7 @@ construct_argv(char *command) char **argv = (char **) malloc(((strlen(command) + 1) / 2 + 1) * sizeof (char *)); - if ((argv[argc++] = strk(command)) == 0) { + if ((argv[argc++] = strk(command)) == NULL) { free(argv); return (NULL); } From owner-svn-src-all@freebsd.org Mon May 16 00:35:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70379B3388D; Mon, 16 May 2016 00:35:40 +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 3E07C1E91; Mon, 16 May 2016 00:35:40 +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 u4G0Zd89051565; Mon, 16 May 2016 00:35:39 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G0ZdQE051564; Mon, 16 May 2016 00:35:39 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605160035.u4G0ZdQE051564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 16 May 2016 00:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299875 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 00:35:40 -0000 Author: araujo Date: Mon May 16 00:35:39 2016 New Revision: 299875 URL: https://svnweb.freebsd.org/changeset/base/299875 Log: For pointers use NULL instead of 0. MFC after: 2 weeks. Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Mon May 16 00:34:48 2016 (r299874) +++ head/sbin/ping6/ping6.c Mon May 16 00:35:39 2016 (r299875) @@ -916,7 +916,7 @@ main(int argc, char *argv[]) errx(1, "can't initialize rthdr"); #else /* old advanced API */ if ((scmsgp = (struct cmsghdr *)inet6_rthdr_init(scmsgp, - IPV6_RTHDR_TYPE_0)) == 0) + IPV6_RTHDR_TYPE_0)) == NULL) errx(1, "can't initialize rthdr"); #endif /* USE_RFC2292BIS */ From owner-svn-src-all@freebsd.org Mon May 16 00:36:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9101B3391D; Mon, 16 May 2016 00:36:13 +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 B6CBA101F; Mon, 16 May 2016 00:36:13 +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 u4G0aC9E051633; Mon, 16 May 2016 00:36:12 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G0aC7H051632; Mon, 16 May 2016 00:36:12 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605160036.u4G0aC7H051632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 16 May 2016 00:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299876 - head/sbin/quotacheck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 00:36:14 -0000 Author: araujo Date: Mon May 16 00:36:12 2016 New Revision: 299876 URL: https://svnweb.freebsd.org/changeset/base/299876 Log: For pointers use NULL instead of 0. MFC after: 2 weeks. Modified: head/sbin/quotacheck/quotacheck.c Modified: head/sbin/quotacheck/quotacheck.c ============================================================================== --- head/sbin/quotacheck/quotacheck.c Mon May 16 00:35:39 2016 (r299875) +++ head/sbin/quotacheck/quotacheck.c Mon May 16 00:36:12 2016 (r299876) @@ -543,7 +543,7 @@ lookup(u_long id, int type) { struct fileusage *fup; - for (fup = fuhead[type][id & (FUHASH-1)]; fup != 0; fup = fup->fu_next) + for (fup = fuhead[type][id & (FUHASH-1)]; fup != NULL; fup = fup->fu_next) if (fup->fu_id == id) return (fup); return (NULL); From owner-svn-src-all@freebsd.org Mon May 16 01:11:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C53C4B3C1C3; Mon, 16 May 2016 01:11:03 +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 896161F94; Mon, 16 May 2016 01:11:03 +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 u4G1B2XD060797; Mon, 16 May 2016 01:11:02 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G1B2RO060794; Mon, 16 May 2016 01:11:02 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605160111.u4G1B2RO060794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 16 May 2016 01:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299877 - head/usr.bin/gprof X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 01:11:03 -0000 Author: araujo Date: Mon May 16 01:11:02 2016 New Revision: 299877 URL: https://svnweb.freebsd.org/changeset/base/299877 Log: Use NULL instead of 0 for pointers. MFC after: 2 weeks Modified: head/usr.bin/gprof/aout.c head/usr.bin/gprof/arcs.c head/usr.bin/gprof/gprof.c Modified: head/usr.bin/gprof/aout.c ============================================================================== --- head/usr.bin/gprof/aout.c Mon May 16 00:36:12 2016 (r299876) +++ head/usr.bin/gprof/aout.c Mon May 16 01:11:02 2016 (r299877) @@ -132,7 +132,7 @@ getsymtab(FILE *nfile, const char *filen errx( 1 , "%s: no symbols" , filename ); askfor = nname + 1; nl = (nltype *) calloc( askfor , sizeof(nltype) ); - if (nl == 0) + if (nl == NULL) errx( 1 , "no room for %zu bytes of symbol table" , askfor * sizeof(nltype) ); @@ -173,7 +173,7 @@ gettextspace(FILE *nfile) { textspace = (u_char *) malloc( xbuf.a_text ); - if ( textspace == 0 ) { + if ( textspace == NULL ) { warnx("no room for %u bytes of text space: can't do -c" , xbuf.a_text ); return; Modified: head/usr.bin/gprof/arcs.c ============================================================================== --- head/usr.bin/gprof/arcs.c Mon May 16 00:36:12 2016 (r299876) +++ head/usr.bin/gprof/arcs.c Mon May 16 01:11:02 2016 (r299877) @@ -376,7 +376,7 @@ cyclelink(void) * i.e. it is origin 1, not origin 0. */ cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) ); - if ( cyclenl == 0 ) + if ( cyclenl == NULL ) errx( 1 , "no room for %zu bytes of cycle headers" , ( ncycle + 1 ) * sizeof( nltype ) ); /* @@ -479,7 +479,7 @@ cycleanalyze(void) continue; done = FALSE; cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) ); - if ( cyclestack == 0 ) + if ( cyclestack == NULL ) errx( 1, "no room for %zu bytes of cycle stack" , ( size + 1 ) * sizeof( arctype * ) ); # ifdef DEBUG @@ -592,7 +592,7 @@ addcycle(arctype **stkstart, arctype **s } clp = (cltype *) calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); - if ( clp == 0 ) { + if ( clp == NULL ) { warnx( "no room for %zu bytes of subcycle storage" , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); return( FALSE ); Modified: head/usr.bin/gprof/gprof.c ============================================================================== --- head/usr.bin/gprof/gprof.c Mon May 16 00:36:12 2016 (r299876) +++ head/usr.bin/gprof/gprof.c Mon May 16 01:11:02 2016 (r299877) @@ -407,7 +407,7 @@ readsamples(FILE *pfile) if (samples == 0) { samples = (double *) calloc(nsamples, sizeof(double)); - if (samples == 0) + if (samples == NULL) errx(0, "no room for %d sample pc's", nsamples); } for (i = 0; i < nsamples; i++) { From owner-svn-src-all@freebsd.org Mon May 16 01:12:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B8BB3C278; Mon, 16 May 2016 01:12:57 +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 93A5B123B; Mon, 16 May 2016 01:12:57 +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 u4G1Cuji063526; Mon, 16 May 2016 01:12:56 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G1CuXx063525; Mon, 16 May 2016 01:12:56 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605160112.u4G1CuXx063525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 16 May 2016 01:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299878 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 01:12:57 -0000 Author: araujo Date: Mon May 16 01:12:56 2016 New Revision: 299878 URL: https://svnweb.freebsd.org/changeset/base/299878 Log: Use NULL instead of 0 for pointers. MFC after: 2 weeks. Modified: head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Mon May 16 01:11:02 2016 (r299877) +++ head/usr.sbin/kldxref/kldxref.c Mon May 16 01:12:56 2016 (r299878) @@ -494,7 +494,7 @@ parse_entry(struct mod_metadata *md, con ptr = *(char **)(walker + elt->pe_offset); buffer[0] = '\0'; - if (ptr != 0) { + if (ptr != NULL) { EF_SEG_READ(ef, (Elf_Off)ptr, sizeof(buffer), buffer); buffer[sizeof(buffer) - 1] = '\0'; From owner-svn-src-all@freebsd.org Mon May 16 01:30:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F98FB3C4C7; Mon, 16 May 2016 01:30:34 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4D9D186F; Mon, 16 May 2016 01:30:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G1UXN2066844; Mon, 16 May 2016 01:30:33 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G1UXTU066843; Mon, 16 May 2016 01:30:33 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160130.u4G1UXTU066843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 01:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299879 - head/lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 01:30:34 -0000 Author: truckman Date: Mon May 16 01:30:32 2016 New Revision: 299879 URL: https://svnweb.freebsd.org/changeset/base/299879 Log: Likely a false positive ... but make sure that -1 can't be used as an array index by splitting up a test. Reported by: Coverity CID: 603941 MFC after: 1 week Modified: head/lib/libc/resolv/res_query.c Modified: head/lib/libc/resolv/res_query.c ============================================================================== --- head/lib/libc/resolv/res_query.c Mon May 16 01:12:56 2016 (r299878) +++ head/lib/libc/resolv/res_query.c Mon May 16 01:30:32 2016 (r299879) @@ -135,10 +135,12 @@ again: if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) { n = res_nopt(statp, n, buf, sizeof(buf), anslen); - rdata = &buf[n]; - if (n > 0 && (statp->options & RES_NSID) != 0U) { - n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata, - NS_OPT_NSID, 0, NULL); + if (n > 0) { + rdata = &buf[n]; + if ((statp->options & RES_NSID) != 0U) { + n = res_nopt_rdata(statp, n, buf, sizeof(buf), + rdata, NS_OPT_NSID, 0, NULL); + } } } #endif From owner-svn-src-all@freebsd.org Mon May 16 01:38:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F7FEB3C60B; Mon, 16 May 2016 01:38:26 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFD4F1C97; Mon, 16 May 2016 01:38:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G1cPx7069810; Mon, 16 May 2016 01:38:25 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G1cPTs069809; Mon, 16 May 2016 01:38:25 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160138.u4G1cPTs069809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 01:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299880 - head/lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 01:38:26 -0000 Author: truckman Date: Mon May 16 01:38:24 2016 New Revision: 299880 URL: https://svnweb.freebsd.org/changeset/base/299880 Log: Since rdata is only used as an argument to the immediately following call to res_nopt_rdata(), revert r299879 and fix CID 603941 by moving rdata = &buf[n]; inside the if block. Reported by: Coverity CID: 603941 Modified: head/lib/libc/resolv/res_query.c Modified: head/lib/libc/resolv/res_query.c ============================================================================== --- head/lib/libc/resolv/res_query.c Mon May 16 01:30:32 2016 (r299879) +++ head/lib/libc/resolv/res_query.c Mon May 16 01:38:24 2016 (r299880) @@ -135,12 +135,10 @@ again: if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) { n = res_nopt(statp, n, buf, sizeof(buf), anslen); - if (n > 0) { + if (n > 0 && (statp->options & RES_NSID) != 0U) { rdata = &buf[n]; - if ((statp->options & RES_NSID) != 0U) { - n = res_nopt_rdata(statp, n, buf, sizeof(buf), - rdata, NS_OPT_NSID, 0, NULL); - } + n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata, + NS_OPT_NSID, 0, NULL); } } #endif From owner-svn-src-all@freebsd.org Mon May 16 02:21:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40D22B3C171; Mon, 16 May 2016 02:21:56 +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 0E40916B5; Mon, 16 May 2016 02:21:55 +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 u4G2Ltjd085822; Mon, 16 May 2016 02:21:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2LtBn085821; Mon, 16 May 2016 02:21:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160221.u4G2LtBn085821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299881 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 02:21:56 -0000 Author: kib Date: Mon May 16 02:21:54 2016 New Revision: 299881 URL: https://svnweb.freebsd.org/changeset/base/299881 Log: MFC r298921: Fix reporting of NOTE_LINK when directory link count changes due to rename removing or adding subdirectory entry. Modified: stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 01:38:24 2016 (r299880) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:21:54 2016 (r299881) @@ -4365,10 +4365,26 @@ void vop_rename_post(void *ap, int rc) { struct vop_rename_args *a = ap; + long hint; if (!rc) { - VFS_KNOTE_UNLOCKED(a->a_fdvp, NOTE_WRITE); - VFS_KNOTE_UNLOCKED(a->a_tdvp, NOTE_WRITE); + hint = NOTE_WRITE; + if (a->a_fdvp == a->a_tdvp) { + if (a->a_tvp != NULL && a->a_tvp->v_type == VDIR) + hint |= NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); + VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); + } else { + if (a->a_fvp->v_type == VDIR) + hint |= NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); + + if (a->a_fvp->v_type == VDIR && a->a_tvp != NULL && + a->a_tvp->v_type == VDIR) + hint &= ~NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); + } + VFS_KNOTE_UNLOCKED(a->a_fvp, NOTE_RENAME); if (a->a_tvp) VFS_KNOTE_UNLOCKED(a->a_tvp, NOTE_DELETE); From owner-svn-src-all@freebsd.org Mon May 16 02:24:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C2CB3C201; Mon, 16 May 2016 02:24: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 A9589199B; Mon, 16 May 2016 02:23:59 +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 u4G2Nw85085959; Mon, 16 May 2016 02:23:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2NwWL085957; Mon, 16 May 2016 02:23:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160223.u4G2NwWL085957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299882 - in stable/10: lib/libc/sys sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 02:24:00 -0000 Author: kib Date: Mon May 16 02:23:58 2016 New Revision: 299882 URL: https://svnweb.freebsd.org/changeset/base/299882 Log: MFC r298922: Issue NOTE_EXTEND when a directory entry is added to or removed from the monitored directory as the result of rename(2) operation. The renames staying in the directory are not reported. Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:21:54 2016 (r299881) +++ stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:23:58 2016 (r299882) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2016 +.Dd May 2, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -368,7 +368,13 @@ was called on the file referenced by the .It Dv NOTE_WRITE A write occurred on the file referenced by the descriptor. .It Dv NOTE_EXTEND -The file referenced by the descriptor was extended. +For regular file, the file referenced by the descriptor was extended. +.Pp +For directory, reports that a directory entry was added or removed, +as the result of rename operation. +The +.Dv NOTE_EXTEND +event is not reported when a name is changed inside the directory. .It Dv NOTE_ATTRIB The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 02:21:54 2016 (r299881) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:23:58 2016 (r299882) @@ -4375,6 +4375,7 @@ vop_rename_post(void *ap, int rc) VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); } else { + hint |= NOTE_EXTEND; if (a->a_fvp->v_type == VDIR) hint |= NOTE_LINK; VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); From owner-svn-src-all@freebsd.org Mon May 16 02:27:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F76BB3C2C6; Mon, 16 May 2016 02:27:29 +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 318FD1C19; Mon, 16 May 2016 02:27:29 +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 u4G2RSGF086263; Mon, 16 May 2016 02:27:28 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2RSM5086262; Mon, 16 May 2016 02:27:28 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201605160227.u4G2RSM5086262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 16 May 2016 02:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299883 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 02:27:29 -0000 Author: kevlo Date: Mon May 16 02:27:28 2016 New Revision: 299883 URL: https://svnweb.freebsd.org/changeset/base/299883 Log: Follow-up r298818: hide size of 'bands' array behind a macro. Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon May 16 02:23:58 2016 (r299882) +++ head/sys/dev/iwm/if_iwm.c Mon May 16 02:27:28 2016 (r299883) @@ -1725,7 +1725,7 @@ iwm_init_channel_map(struct ieee80211com { struct iwm_softc *sc = ic->ic_softc; struct iwm_nvm_data *data = &sc->sc_nvm; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; memset(bands, 0, sizeof(bands)); /* 1-13: 11b/g channels. */ From owner-svn-src-all@freebsd.org Mon May 16 02:35:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEEDAB3C49C; Mon, 16 May 2016 02:35: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 9FC371043; Mon, 16 May 2016 02:35:24 +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 u4G2ZNNN089171; Mon, 16 May 2016 02:35:23 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2ZNHR089170; Mon, 16 May 2016 02:35:23 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605160235.u4G2ZNHR089170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 16 May 2016 02:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299884 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 02:35:24 -0000 Author: araujo Date: Mon May 16 02:35:23 2016 New Revision: 299884 URL: https://svnweb.freebsd.org/changeset/base/299884 Log: When a group contains a non-existent user, make the warning message more helpful by mentioning the group name. Obtained from: OpenBSD (cvs 1.19) Modified: head/usr.sbin/ypldap/ypldap.c Modified: head/usr.sbin/ypldap/ypldap.c ============================================================================== --- head/usr.sbin/ypldap/ypldap.c Mon May 16 02:27:28 2016 (r299883) +++ head/usr.sbin/ypldap/ypldap.c Mon May 16 02:35:23 2016 (r299884) @@ -243,9 +243,8 @@ main_create_user_groups(struct env *env) if ((ue = RB_FIND(user_name_tree, env->sc_user_names_t, &ukey)) == NULL) { /* User not found */ - log_warnx("main: user: %s is referenced as a " - "group member, but can't be found in the " - "users map.\n", ukey.ue_line); + log_warnx("main: unknown user %s in group %s\n", + ukey.ue_line, ge->ge_line); if (bp != NULL) *(bp-1) = ','; continue; From owner-svn-src-all@freebsd.org Mon May 16 02:35:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A8FEB3C4C2; Mon, 16 May 2016 02:35:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D85E8118F; Mon, 16 May 2016 02:35:34 +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 u4G2ZYCB089226; Mon, 16 May 2016 02:35:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2ZXGd089223; Mon, 16 May 2016 02:35:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160235.u4G2ZXGd089223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299885 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 02:35:35 -0000 Author: kib Date: Mon May 16 02:35:33 2016 New Revision: 299885 URL: https://svnweb.freebsd.org/changeset/base/299885 Log: MFC r287831 (by cem): Note DOOMED vnodes with NOTE_REVOKE. Modified: stable/10/sys/kern/vfs_subr.c stable/10/sys/kern/vnode_if.src stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 02:35:23 2016 (r299884) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:35:33 2016 (r299885) @@ -4351,6 +4351,15 @@ vop_mknod_post(void *ap, int rc) } void +vop_reclaim_post(void *ap, int rc) +{ + struct vop_reclaim_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_REVOKE); +} + +void vop_remove_post(void *ap, int rc) { struct vop_remove_args *a = ap; @@ -4647,7 +4656,7 @@ filt_vfsread(struct knote *kn, long hint * filesystem is gone, so set the EOF flag and schedule * the knote for deletion. */ - if (hint == NOTE_REVOKE) { + if (hint == NOTE_REVOKE || (hint == 0 && vp->v_type == VBAD)) { VI_LOCK(vp); kn->kn_flags |= (EV_EOF | EV_ONESHOT); VI_UNLOCK(vp); @@ -4676,7 +4685,7 @@ filt_vfswrite(struct knote *kn, long hin * filesystem is gone, so set the EOF flag and schedule * the knote for deletion. */ - if (hint == NOTE_REVOKE) + if (hint == NOTE_REVOKE || (hint == 0 && vp->v_type == VBAD)) kn->kn_flags |= (EV_EOF | EV_ONESHOT); kn->kn_data = 0; @@ -4693,7 +4702,7 @@ filt_vfsvnode(struct knote *kn, long hin VI_LOCK(vp); if (kn->kn_sfflags & hint) kn->kn_fflags |= hint; - if (hint == NOTE_REVOKE) { + if (hint == NOTE_REVOKE || (hint == 0 && vp->v_type == VBAD)) { kn->kn_flags |= EV_EOF; VI_UNLOCK(vp); return (1); Modified: stable/10/sys/kern/vnode_if.src ============================================================================== --- stable/10/sys/kern/vnode_if.src Mon May 16 02:35:23 2016 (r299884) +++ stable/10/sys/kern/vnode_if.src Mon May 16 02:35:33 2016 (r299885) @@ -355,6 +355,7 @@ vop_inactive { %% reclaim vp E E E +%! reclaim post vop_reclaim_post vop_reclaim { IN struct vnode *vp; Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Mon May 16 02:35:23 2016 (r299884) +++ stable/10/sys/sys/vnode.h Mon May 16 02:35:33 2016 (r299885) @@ -774,6 +774,7 @@ void vop_lookup_post(void *a, int rc); void vop_lookup_pre(void *a); void vop_mkdir_post(void *a, int rc); void vop_mknod_post(void *a, int rc); +void vop_reclaim_post(void *a, int rc); void vop_remove_post(void *a, int rc); void vop_rename_post(void *a, int rc); void vop_rename_pre(void *a); From owner-svn-src-all@freebsd.org Mon May 16 02:42:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B599EB3C67D; Mon, 16 May 2016 02:42:54 +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 85EC116BF; Mon, 16 May 2016 02:42:54 +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 u4G2grua092116; Mon, 16 May 2016 02:42:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2grxU092111; Mon, 16 May 2016 02:42:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160242.u4G2grxU092111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299886 - in stable/10: lib/libc/sys sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 02:42:54 -0000 Author: kib Date: Mon May 16 02:42:53 2016 New Revision: 299886 URL: https://svnweb.freebsd.org/changeset/base/299886 Log: MFC r298982: Add EVFILT_VNODE open, read and close notifications. MFC r298984: Correct wording. Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/sys/kern/vfs_subr.c stable/10/sys/kern/vnode_if.src stable/10/sys/sys/event.h stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:35:33 2016 (r299885) +++ stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:42:53 2016 (r299886) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2016 +.Dd May 3, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -359,14 +359,28 @@ Takes a file descriptor as the identifie .Va fflags , and returns when one or more of the requested events occurs on the descriptor. The events to monitor are: -.Bl -tag -width "Dv NOTE_RENAME" +.Bl -tag -width "Dv NOTE_CLOSE_WRITE" +.It Dv NOTE_ATTRIB +The file referenced by the descriptor had its attributes changed. +.It Dv NOTE_CLOSE +A file descriptor referencing the monitored file, was closed. +The closed file descriptor did not have write access. +.It Dv NOTE_CLOSE_WRITE +A file descriptor referencing the monitored file, was closed. +The closed file descriptor has write access. +.Pp +This note, as well as +.Dv NOTE_CLOSE , +are not activated when files are closed forcibly by +.Xr unmount 2 or +.Xr revoke 2 . +Instead, +.Dv NOTE_REVOKE +is sent for such events. .It Dv NOTE_DELETE The .Fn unlink -system call -was called on the file referenced by the descriptor. -.It Dv NOTE_WRITE -A write occurred on the file referenced by the descriptor. +system call was called on the file referenced by the descriptor. .It Dv NOTE_EXTEND For regular file, the file referenced by the descriptor was extended. .Pp @@ -375,20 +389,24 @@ as the result of rename operation. The .Dv NOTE_EXTEND event is not reported when a name is changed inside the directory. -.It Dv NOTE_ATTRIB -The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK The link count on the file changed. In particular, the .Dv NOTE_LINK event is reported if a subdirectory was created or deleted inside the directory referenced by the descriptor. +.It Dv NOTE_OPEN +The file referenced by the descriptor was opened. +.It Dv NOTE_READ +A read occurred on the file referenced by the descriptor. .It Dv NOTE_RENAME The file referenced by the descriptor was renamed. .It Dv NOTE_REVOKE Access to the file was revoked via .Xr revoke 2 or the underlying file system was unmounted. +.It Dv NOTE_WRITE +A write occurred on the file referenced by the descriptor. .El .Pp On return, Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:42:53 2016 (r299886) @@ -4446,6 +4446,45 @@ vop_symlink_post(void *ap, int rc) VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); } +void +vop_open_post(void *ap, int rc) +{ + struct vop_open_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_OPEN); +} + +void +vop_close_post(void *ap, int rc) +{ + struct vop_close_args *a = ap; + + if (!rc && (a->a_cred != NOCRED || /* filter out revokes */ + (a->a_vp->v_iflag & VI_DOOMED) == 0)) { + VFS_KNOTE_LOCKED(a->a_vp, (a->a_fflag & FWRITE) != 0 ? + NOTE_CLOSE_WRITE : NOTE_CLOSE); + } +} + +void +vop_read_post(void *ap, int rc) +{ + struct vop_read_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + +void +vop_readdir_post(void *ap, int rc) +{ + struct vop_readdir_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + static struct knlist fs_knlist; static void Modified: stable/10/sys/kern/vnode_if.src ============================================================================== --- stable/10/sys/kern/vnode_if.src Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/kern/vnode_if.src Mon May 16 02:42:53 2016 (r299886) @@ -121,6 +121,7 @@ vop_mknod { %% open vp L L L +%! open post vop_open_post vop_open { IN struct vnode *vp; @@ -132,6 +133,7 @@ vop_open { %% close vp L L L +%! close post vop_close_post vop_close { IN struct vnode *vp; @@ -186,6 +188,7 @@ vop_markatime { }; %% read vp L L L +%! read post vop_read_post vop_read { IN struct vnode *vp; @@ -326,6 +329,7 @@ vop_symlink { %% readdir vp L L L +%! readdir post vop_readdir_post vop_readdir { IN struct vnode *vp; Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/sys/event.h Mon May 16 02:42:53 2016 (r299886) @@ -118,6 +118,12 @@ struct kevent { #define NOTE_LINK 0x0010 /* link count changed */ #define NOTE_RENAME 0x0020 /* vnode was renamed */ #define NOTE_REVOKE 0x0040 /* vnode access was revoked */ +#define NOTE_OPEN 0x0080 /* vnode was opened */ +#define NOTE_CLOSE 0x0100 /* file closed, fd did not + allowed write */ +#define NOTE_CLOSE_WRITE 0x0200 /* file closed, fd did allowed + write */ +#define NOTE_READ 0x0400 /* file was read */ /* * data/hint flags for EVFILT_PROC, shared with userspace Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/sys/vnode.h Mon May 16 02:42:53 2016 (r299886) @@ -765,6 +765,7 @@ int dead_read(struct vop_read_args *ap); int dead_write(struct vop_write_args *ap); /* These are called from within the actual VOPS. */ +void vop_close_post(void *a, int rc); void vop_create_post(void *a, int rc); void vop_deleteextattr_post(void *a, int rc); void vop_link_post(void *a, int rc); @@ -774,6 +775,9 @@ void vop_lookup_post(void *a, int rc); void vop_lookup_pre(void *a); void vop_mkdir_post(void *a, int rc); void vop_mknod_post(void *a, int rc); +void vop_open_post(void *a, int rc); +void vop_read_post(void *a, int rc); +void vop_readdir_post(void *a, int rc); void vop_reclaim_post(void *a, int rc); void vop_remove_post(void *a, int rc); void vop_rename_post(void *a, int rc); From owner-svn-src-all@freebsd.org Mon May 16 02:44:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9FBCB3C6F9; Mon, 16 May 2016 02:44:23 +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 AB52C185D; Mon, 16 May 2016 02:44: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 u4G2iMWB092228; Mon, 16 May 2016 02:44:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2iMlW092227; Mon, 16 May 2016 02:44:22 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605160244.u4G2iMlW092227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 16 May 2016 02:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299887 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 02:44:24 -0000 Author: araujo Date: Mon May 16 02:44:22 2016 New Revision: 299887 URL: https://svnweb.freebsd.org/changeset/base/299887 Log: Simplify overengineered and buggy code that looked like as if it did some kind of UTF-8 validation, but actually didn't, but instead, for malformed UTF-8 input, caused buffer overruns in some cases and caused skipping of valid ASCII characters in other cases. Obtained from: OpenBSD (cvs 1.32) Modified: head/usr.sbin/ypldap/aldap.c Modified: head/usr.sbin/ypldap/aldap.c ============================================================================== --- head/usr.sbin/ypldap/aldap.c Mon May 16 02:42:53 2016 (r299886) +++ head/usr.sbin/ypldap/aldap.c Mon May 16 02:44:22 2016 (r299887) @@ -1,6 +1,6 @@ -/* $Id: aldap.c,v 1.30 2012/04/30 21:40:03 jmatthew Exp $ */ -/* $OpenBSD: aldap.c,v 1.30 2012/04/30 21:40:03 jmatthew Exp $ */ /* $FreeBSD$ */ +/* $Id: aldap.c,v 1.32 2016/04/27 10:53:27 schwarze Exp $ */ +/* $OpenBSD: aldap.c,v 1.32 2016/04/27 10:53:27 schwarze Exp $ */ /* * Copyright (c) 2008 Alexander Schrijver @@ -19,6 +19,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include #include #include @@ -38,6 +39,7 @@ static struct ber_element *ldap_do_parse struct ber_element *, char **); char **aldap_get_stringset(struct ber_element *); char *utoa(char *); +static int isu8cont(unsigned char); char *parseval(char *, size_t); int aldap_create_page_control(struct ber_element *, int, struct aldap_page_control *); @@ -1161,7 +1163,7 @@ ldap_debug_elements(struct ber_element * #endif /* - * Convert UTF-8 to ASCII. + * Strip UTF-8 down to ASCII without validation. * notes: * non-ASCII characters are displayed as '?' * the argument u should be a NULL terminated sequence of UTF-8 bytes. @@ -1173,41 +1175,27 @@ utoa(char *u) char *str; /* calculate the length to allocate */ - for (len = 0, i = 0; u[i] != '\0'; ) { - if ((u[i] & 0xF0) == 0xF0) - i += 4; - else if ((u[i] & 0xE0) == 0xE0) - i += 3; - else if ((u[i] & 0xC0) == 0xC0) - i += 2; - else - i += 1; - len++; - } + for (len = 0, i = 0; u[i] != '\0'; i++) + if (!isu8cont(u[i])) + len++; if ((str = calloc(len + 1, sizeof(char))) == NULL) return NULL; /* copy the ASCII characters to the newly allocated string */ - for (i = 0, j = 0; u[i] != '\0'; j++) { - if ((u[i] & 0xF0) == 0xF0) { - str[j] = '?'; - i += 4; - } else if ((u[i] & 0xE0) == 0xE0) { - str[j] = '?'; - i += 3; - } else if ((u[i] & 0xC0) == 0xC0) { - str[j] = '?'; - i += 2; - } else { - str[j] = u[i]; - i += 1; - } - } + for (i = 0, j = 0; u[i] != '\0'; i++) + if (!isu8cont(u[i])) + str[j++] = isascii((unsigned char)u[i]) ? u[i] : '?'; return str; } +static int +isu8cont(unsigned char c) +{ + return (c & (0x80 | 0x40)) == 0x80; +} + /* * Parse a LDAP value * notes: @@ -1270,3 +1258,4 @@ aldap_get_errno(struct aldap *a, const c } return (a->err); } + From owner-svn-src-all@freebsd.org Mon May 16 03:26:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8BAEB3CE43; Mon, 16 May 2016 03:26: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 95F8F1AB4; Mon, 16 May 2016 03:26: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 u4G3QGED004774; Mon, 16 May 2016 03:26:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G3QGIi004771; Mon, 16 May 2016 03:26:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605160326.u4G3QGIi004771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 16 May 2016 03:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299888 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 03:26:18 -0000 Author: sephe Date: Mon May 16 03:26:16 2016 New Revision: 299888 URL: https://svnweb.freebsd.org/changeset/base/299888 Log: hyperv/hn: Combine per-packet-information parsing. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon May 16 02:44:22 2016 (r299887) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon May 16 03:26:16 2016 (r299888) @@ -1291,7 +1291,7 @@ hv_m_append(struct mbuf *m0, int len, c_ */ int netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, - rndis_tcp_ip_csum_info *csum_info, + const rndis_tcp_ip_csum_info *csum_info, const struct rndis_hash_info *hash_info, const struct rndis_hash_value *hash_value) { Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Mon May 16 02:44:22 2016 (r299887) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Mon May 16 03:26:16 2016 (r299888) @@ -1085,7 +1085,7 @@ typedef struct rndismp_rx_bufs_info_ { struct hv_vmbus_channel; int netvsc_recv(struct hv_vmbus_channel *chan, - netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info, + netvsc_packet *packet, const rndis_tcp_ip_csum_info *csum_info, const struct rndis_hash_info *hash_info, const struct rndis_hash_value *hash_value); void netvsc_channel_rollup(struct hv_vmbus_channel *chan); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon May 16 02:44:22 2016 (r299887) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon May 16 03:26:16 2016 (r299888) @@ -49,6 +49,22 @@ __FBSDID("$FreeBSD$"); #include "hv_rndis.h" #include "hv_rndis_filter.h" +struct hv_rf_recvinfo { + const ndis_8021q_info *vlan_info; + const rndis_tcp_ip_csum_info *csum_info; + const struct rndis_hash_info *hash_info; + const struct rndis_hash_value *hash_value; +}; + +#define HV_RF_RECVINFO_VLAN 0x1 +#define HV_RF_RECVINFO_CSUM 0x2 +#define HV_RF_RECVINFO_HASHINF 0x4 +#define HV_RF_RECVINFO_HASHVAL 0x8 +#define HV_RF_RECVINFO_ALL \ + (HV_RF_RECVINFO_VLAN | \ + HV_RF_RECVINFO_CSUM | \ + HV_RF_RECVINFO_HASHINF | \ + HV_RF_RECVINFO_HASHVAL) /* * Forward declarations @@ -433,6 +449,84 @@ hv_rf_receive_indicate_status(rndis_devi } } +static int +hv_rf_find_recvinfo(const rndis_packet *rpkt, struct hv_rf_recvinfo *info) +{ + const rndis_per_packet_info *ppi; + uint32_t mask, len; + + info->vlan_info = NULL; + info->csum_info = NULL; + info->hash_info = NULL; + info->hash_value = NULL; + + if (rpkt->per_pkt_info_offset == 0) + return 0; + + ppi = (const rndis_per_packet_info *) + ((const uint8_t *)rpkt + rpkt->per_pkt_info_offset); + len = rpkt->per_pkt_info_length; + mask = 0; + + while (len != 0) { + const void *ppi_dptr; + uint32_t ppi_dlen; + + if (__predict_false(ppi->size < ppi->per_packet_info_offset)) + return EINVAL; + ppi_dlen = ppi->size - ppi->per_packet_info_offset; + ppi_dptr = (const uint8_t *)ppi + ppi->per_packet_info_offset; + + switch (ppi->type) { + case ieee_8021q_info: + if (__predict_false(ppi_dlen < sizeof(ndis_8021q_info))) + return EINVAL; + info->vlan_info = ppi_dptr; + mask |= HV_RF_RECVINFO_VLAN; + break; + + case tcpip_chksum_info: + if (__predict_false(ppi_dlen < + sizeof(rndis_tcp_ip_csum_info))) + return EINVAL; + info->csum_info = ppi_dptr; + mask |= HV_RF_RECVINFO_CSUM; + break; + + case nbl_hash_value: + if (__predict_false(ppi_dlen < + sizeof(struct rndis_hash_value))) + return EINVAL; + info->hash_value = ppi_dptr; + mask |= HV_RF_RECVINFO_HASHVAL; + break; + + case nbl_hash_info: + if (__predict_false(ppi_dlen < + sizeof(struct rndis_hash_info))) + return EINVAL; + info->hash_info = ppi_dptr; + mask |= HV_RF_RECVINFO_HASHINF; + break; + + default: + goto skip; + } + + if (mask == HV_RF_RECVINFO_ALL) { + /* All found; done */ + break; + } +skip: + if (__predict_false(len < ppi->size)) + return EINVAL; + len -= ppi->size; + ppi = (const rndis_per_packet_info *) + ((const uint8_t *)ppi + ppi->size); + } + return 0; +} + /* * RNDIS filter receive data */ @@ -441,12 +535,9 @@ hv_rf_receive_data(rndis_device *device, struct hv_vmbus_channel *chan, netvsc_packet *pkt) { rndis_packet *rndis_pkt; - ndis_8021q_info *rppi_vlan_info; uint32_t data_offset; - rndis_tcp_ip_csum_info *csum_info = NULL; - const struct rndis_hash_info *hash_info; - const struct rndis_hash_value *hash_value; device_t dev = device->net_dev->dev->device; + struct hv_rf_recvinfo info; rndis_pkt = &message->msg.packet; @@ -470,17 +561,18 @@ hv_rf_receive_data(rndis_device *device, pkt->tot_data_buf_len = rndis_pkt->data_length; pkt->data = (void *)((unsigned long)pkt->data + data_offset); - rppi_vlan_info = hv_get_ppi_data(rndis_pkt, ieee_8021q_info); - if (rppi_vlan_info) { - pkt->vlan_tci = rppi_vlan_info->u1.s1.vlan_id; - } else { - pkt->vlan_tci = 0; + if (hv_rf_find_recvinfo(rndis_pkt, &info)) { + pkt->status = nvsp_status_failure; + device_printf(dev, "recvinfo parsing failed\n"); + return; } - csum_info = hv_get_ppi_data(rndis_pkt, tcpip_chksum_info); - hash_value = hv_get_ppi_data(rndis_pkt, nbl_hash_value); - hash_info = hv_get_ppi_data(rndis_pkt, nbl_hash_info); - netvsc_recv(chan, pkt, csum_info, hash_info, hash_value); + if (info.vlan_info != NULL) + pkt->vlan_tci = info.vlan_info->u1.s1.vlan_id; + else + pkt->vlan_tci = 0; + + netvsc_recv(chan, pkt, info.csum_info, info.hash_info, info.hash_value); } /* From owner-svn-src-all@freebsd.org Mon May 16 03:48:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 585F8B3C271; Mon, 16 May 2016 03:48: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 17CE6131E; Mon, 16 May 2016 03:48: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 u4G3m0lN010978; Mon, 16 May 2016 03:48:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G3m0Sg010977; Mon, 16 May 2016 03:48:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605160348.u4G3m0Sg010977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 16 May 2016 03:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299889 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 03:48:01 -0000 Author: sephe Date: Mon May 16 03:48:00 2016 New Revision: 299889 URL: https://svnweb.freebsd.org/changeset/base/299889 Log: hyperv/vmbus: Simplify event processing While I'm here, remove useless comment and unnecessary return. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6332 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 03:26:16 2016 (r299888) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 03:48:00 2016 (r299889) @@ -300,7 +300,6 @@ hv_vmbus_on_events(int cpu) int rel_id; int maxdword; hv_vmbus_synic_event_flags *event; - /* int maxdword = PAGE_SIZE >> 3; */ KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " "cpu out of range!")); @@ -314,9 +313,12 @@ hv_vmbus_on_events(int cpu) /* * receive size is 1/2 page and divide that by 4 bytes */ - if (synch_test_and_clear_bit(0, &event->flags32[0])) + if (synch_test_and_clear_bit(0, &event->flags32[0])) { recv_interrupt_page = hv_vmbus_g_connection.recv_interrupt_page; + } else { + return; + } } else { /* * On Host with Win8 or above, the event page can be @@ -330,36 +332,32 @@ hv_vmbus_on_events(int cpu) /* * Check events */ - if (recv_interrupt_page != NULL) { - for (dword = 0; dword < maxdword; dword++) { - if (recv_interrupt_page[dword]) { - for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) { - if (synch_test_and_clear_bit(bit, - (uint32_t *) &recv_interrupt_page[dword])) { - rel_id = (dword << 5) + bit; - if (rel_id == 0) { - /* - * Special case - - * vmbus channel protocol msg. - */ - continue; - } else { - hv_vmbus_channel * channel = hv_vmbus_g_connection.channels[rel_id]; - /* if channel is closed or closing */ - if (channel == NULL || channel->rxq == NULL) - continue; - - if (channel->batched_reading) - hv_ring_buffer_read_begin(&channel->inbound); - taskqueue_enqueue(channel->rxq, &channel->channel_task); - } - } - } - } + for (dword = 0; dword < maxdword; dword++) { + if (recv_interrupt_page[dword]) { + for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) { + if (synch_test_and_clear_bit(bit, + (uint32_t *) &recv_interrupt_page[dword])) { + rel_id = (dword << 5) + bit; + if (rel_id == 0) { + /* + * Special case - + * vmbus channel protocol msg. + */ + continue; + } else { + hv_vmbus_channel * channel = hv_vmbus_g_connection.channels[rel_id]; + /* if channel is closed or closing */ + if (channel == NULL || channel->rxq == NULL) + continue; + + if (channel->batched_reading) + hv_ring_buffer_read_begin(&channel->inbound); + taskqueue_enqueue(channel->rxq, &channel->channel_task); + } + } + } } } - - return; } /** From owner-svn-src-all@freebsd.org Mon May 16 03:56:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66E11B3C3D8; Mon, 16 May 2016 03:56:26 +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 0DC7918BB; Mon, 16 May 2016 03:56:25 +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 u4G3uPo5013928; Mon, 16 May 2016 03:56:25 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G3uPIJ013926; Mon, 16 May 2016 03:56:25 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605160356.u4G3uPIJ013926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 16 May 2016 03:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299890 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 03:56:26 -0000 Author: sephe Date: Mon May 16 03:56:24 2016 New Revision: 299890 URL: https://svnweb.freebsd.org/changeset/base/299890 Log: hyperv/vmbus: Simplify event processing For channel0, it will never be processed on event handling path, so there is no need to install it. After skipping in the channel0 installation, we could discard the channel0 check on event handling hot code path. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6333 Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon May 16 03:48:00 2016 (r299889) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon May 16 03:56:24 2016 (r299890) @@ -183,7 +183,14 @@ vmbus_channel_process_offer(hv_vmbus_cha * Make sure this is a new offer */ mtx_lock(&hv_vmbus_g_connection.channel_lock); - hv_vmbus_g_connection.channels[relid] = new_channel; + if (relid == 0) { + /* + * XXX channel0 will not be processed; skip it. + */ + printf("VMBUS: got channel0 offer\n"); + } else { + hv_vmbus_g_connection.channels[relid] = new_channel; + } TAILQ_FOREACH(channel, &hv_vmbus_g_connection.channel_anchor, list_entry) { Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 03:48:00 2016 (r299889) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 03:56:24 2016 (r299890) @@ -337,15 +337,11 @@ hv_vmbus_on_events(int cpu) for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) { if (synch_test_and_clear_bit(bit, (uint32_t *) &recv_interrupt_page[dword])) { - rel_id = (dword << 5) + bit; - if (rel_id == 0) { - /* - * Special case - - * vmbus channel protocol msg. - */ - continue; - } else { - hv_vmbus_channel * channel = hv_vmbus_g_connection.channels[rel_id]; + struct hv_vmbus_channel *channel; + + rel_id = (dword << 5) + bit; + channel = hv_vmbus_g_connection.channels[rel_id]; + /* if channel is closed or closing */ if (channel == NULL || channel->rxq == NULL) continue; @@ -353,7 +349,6 @@ hv_vmbus_on_events(int cpu) if (channel->batched_reading) hv_ring_buffer_read_begin(&channel->inbound); taskqueue_enqueue(channel->rxq, &channel->channel_task); - } } } } From owner-svn-src-all@freebsd.org Mon May 16 04:03:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70289B3C56F; Mon, 16 May 2016 04:03:44 +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 291D01E3E; Mon, 16 May 2016 04:03:44 +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 u4G43hf8017056; Mon, 16 May 2016 04:03:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G43hK5017055; Mon, 16 May 2016 04:03:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605160403.u4G43hK5017055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 04:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299891 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 04:03:44 -0000 Author: adrian Date: Mon May 16 04:03:43 2016 New Revision: 299891 URL: https://svnweb.freebsd.org/changeset/base/299891 Log: [bwn] use contigmalloc to allocate descriptors. We can't assume malloc() returns physically contiguous memory. Submitted by: Imre Vadasz Obtained from: DragonflyBSD Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon May 16 03:56:24 2016 (r299890) +++ head/sys/dev/bwn/if_bwn.c Mon May 16 04:03:43 2016 (r299891) @@ -2675,11 +2675,15 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i KASSERT(BWN_TXRING_SLOTS % BWN_TX_SLOTS_PER_FRAME == 0, ("%s:%d: fail", __func__, __LINE__)); - dr->dr_txhdr_cache = - malloc((dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_HDRSIZE(mac), M_DEVBUF, M_NOWAIT | M_ZERO); - KASSERT(dr->dr_txhdr_cache != NULL, - ("%s:%d: fail", __func__, __LINE__)); + dr->dr_txhdr_cache = contigmalloc( + (dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * + BWN_HDRSIZE(mac), M_DEVBUF, M_ZERO, + 0, BUS_SPACE_MAXADDR, 8, 0); + if (dr->dr_txhdr_cache == NULL) { + device_printf(sc->sc_dev, + "can't allocate TX header DMA memory\n"); + goto fail1; + } /* * Create TX ring DMA stuffs @@ -2698,7 +2702,7 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i if (error) { device_printf(sc->sc_dev, "can't create TX ring DMA tag: TODO frees\n"); - goto fail1; + goto fail2; } for (i = 0; i < dr->dr_numslots; i += 2) { @@ -2713,7 +2717,7 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i if (error) { device_printf(sc->sc_dev, "can't create RX buf DMA map\n"); - goto fail1; + goto fail2; } dr->getdesc(dr, i + 1, &desc, &mt); @@ -2727,7 +2731,7 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i if (error) { device_printf(sc->sc_dev, "can't create RX buf DMA map\n"); - goto fail1; + goto fail2; } } } else { @@ -2767,7 +2771,11 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i return (dr); fail2: - free(dr->dr_txhdr_cache, M_DEVBUF); + if (dr->dr_txhdr_cache != NULL) { + contigfree(dr->dr_txhdr_cache, + (dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * + BWN_HDRSIZE(mac), M_DEVBUF); + } fail1: free(dr->dr_meta, M_DEVBUF); fail0: @@ -2785,7 +2793,11 @@ bwn_dma_ringfree(struct bwn_dma_ring **d bwn_dma_free_descbufs(*dr); bwn_dma_free_ringmemory(*dr); - free((*dr)->dr_txhdr_cache, M_DEVBUF); + if ((*dr)->dr_txhdr_cache != NULL) { + contigfree((*dr)->dr_txhdr_cache, + ((*dr)->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * + BWN_HDRSIZE((*dr)->dr_mac), M_DEVBUF); + } free((*dr)->dr_meta, M_DEVBUF); free(*dr, M_DEVBUF); From owner-svn-src-all@freebsd.org Mon May 16 04:03:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 121D1B3C5A6; Mon, 16 May 2016 04:03:54 +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 BEA2F1F9F; Mon, 16 May 2016 04:03:53 +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 u4G43qJd017106; Mon, 16 May 2016 04:03:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G43qrC017105; Mon, 16 May 2016 04:03:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605160403.u4G43qrC017105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 16 May 2016 04:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299892 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 04:03:54 -0000 Author: sephe Date: Mon May 16 04:03:52 2016 New Revision: 299892 URL: https://svnweb.freebsd.org/changeset/base/299892 Log: hyperv/vmbus: Fix event processing loop indentation. No functional changes. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6334 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 04:03:43 2016 (r299891) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 04:03:52 2016 (r299892) @@ -333,25 +333,30 @@ hv_vmbus_on_events(int cpu) * Check events */ for (dword = 0; dword < maxdword; dword++) { - if (recv_interrupt_page[dword]) { + if (recv_interrupt_page[dword] == 0) + continue; + for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) { - if (synch_test_and_clear_bit(bit, - (uint32_t *) &recv_interrupt_page[dword])) { - struct hv_vmbus_channel *channel; - - rel_id = (dword << 5) + bit; - channel = hv_vmbus_g_connection.channels[rel_id]; - - /* if channel is closed or closing */ - if (channel == NULL || channel->rxq == NULL) - continue; - - if (channel->batched_reading) - hv_ring_buffer_read_begin(&channel->inbound); - taskqueue_enqueue(channel->rxq, &channel->channel_task); - } + if (synch_test_and_clear_bit(bit, + (uint32_t *)&recv_interrupt_page[dword])) { + struct hv_vmbus_channel *channel; + + rel_id = (dword << 5) + bit; + channel = + hv_vmbus_g_connection.channels[rel_id]; + + /* if channel is closed or closing */ + if (channel == NULL || channel->rxq == NULL) + continue; + + if (channel->batched_reading) { + hv_ring_buffer_read_begin( + &channel->inbound); + } + taskqueue_enqueue(channel->rxq, + &channel->channel_task); + } } - } } } From owner-svn-src-all@freebsd.org Mon May 16 04:39:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABBFAB3C265; Mon, 16 May 2016 04:39:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78F1111E4; Mon, 16 May 2016 04:39:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G4dG2s026288; Mon, 16 May 2016 04:39:16 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G4dGK5026287; Mon, 16 May 2016 04:39:16 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160439.u4G4dGK5026287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 04:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299893 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 04:39:17 -0000 Author: truckman Date: Mon May 16 04:39:16 2016 New Revision: 299893 URL: https://svnweb.freebsd.org/changeset/base/299893 Log: Don't free fnamebuf before we calling cfgfile_add(). This changes a use-after-free error into a minor memory leak. Reported by: Coverity CID: 1006084 Modified: head/usr.sbin/config/lang.l Modified: head/usr.sbin/config/lang.l ============================================================================== --- head/usr.sbin/config/lang.l Mon May 16 04:03:52 2016 (r299892) +++ head/usr.sbin/config/lang.l Mon May 16 04:39:16 2016 (r299893) @@ -267,7 +267,8 @@ include(const char *fname, int ateof) asprintf(&fnamebuf, "../../conf/%s", fname); if (fnamebuf != NULL) { fp = fopen(fnamebuf, "r"); - free(fnamebuf); + if (fp == NULL) + free(fnamebuf); } } if (fp == NULL) { @@ -275,10 +276,10 @@ include(const char *fname, int ateof) asprintf(&fnamebuf, "%s/%s", ipath->path, fname); if (fnamebuf != NULL) { fp = fopen(fnamebuf, "r"); - free(fnamebuf); } if (fp != NULL) break; + free(fnamebuf); } } if (fp == NULL) { From owner-svn-src-all@freebsd.org Mon May 16 04:43:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF635B3C48B; Mon, 16 May 2016 04:43:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A081C1738; Mon, 16 May 2016 04:43:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G4hlpS029104; Mon, 16 May 2016 04:43:47 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G4hlPV029103; Mon, 16 May 2016 04:43:47 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160443.u4G4hlPV029103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 04:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299894 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 04:43:48 -0000 Author: truckman Date: Mon May 16 04:43:47 2016 New Revision: 299894 URL: https://svnweb.freebsd.org/changeset/base/299894 Log: pdu_delete(request) frees request, so move the call after login_new_response(request) to avoid a use-after-free error Reported by: Coverity Reviewed by: 1331219, 1331220 Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Mon May 16 04:39:16 2016 (r299893) +++ head/usr.sbin/ctld/login.c Mon May 16 04:43:47 2016 (r299894) @@ -767,10 +767,10 @@ login_wait_transition(struct connection login_send_error(request, 0x02, 0x00); log_errx(1, "got no \"T\" flag after answering AuthMethod"); } - pdu_delete(request); log_debugx("got state transition request"); response = login_new_response(request); + pdu_delete(request); login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); pdu_send(response); pdu_delete(response); From owner-svn-src-all@freebsd.org Mon May 16 04:45:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35254B3C537; Mon, 16 May 2016 04:45:37 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 00D7418DD; Mon, 16 May 2016 04:45:36 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4G4jRtn069857; Sun, 15 May 2016 21:45:31 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605160445.u4G4jRtn069857@gw.catspoiler.org> Date: Sun, 15 May 2016 21:45:27 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299893 - head/usr.sbin/config To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605160439.u4G4dGK5026287@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 04:45:37 -0000 On 16 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Mon May 16 04:39:16 2016 > New Revision: 299893 > URL: https://svnweb.freebsd.org/changeset/base/299893 > > Log: > Don't free fnamebuf before we calling cfgfile_add(). This changes a > use-after-free error into a minor memory leak. > > Reported by: Coverity > CID: 1006084 MFC after: 1 week From owner-svn-src-all@freebsd.org Mon May 16 04:45:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 837CBB3C582; Mon, 16 May 2016 04:45:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0011A78; Mon, 16 May 2016 04:45:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4G4jmb0069863; Sun, 15 May 2016 21:45:52 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605160445.u4G4jmb0069863@gw.catspoiler.org> Date: Sun, 15 May 2016 21:45:48 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299894 - head/usr.sbin/ctld To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605160443.u4G4hlPV029103@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 04:45:57 -0000 On 16 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Mon May 16 04:43:47 2016 > New Revision: 299894 > URL: https://svnweb.freebsd.org/changeset/base/299894 > > Log: > pdu_delete(request) frees request, so move the call after > login_new_response(request) to avoid a use-after-free error > > Reported by: Coverity > Reviewed by: 1331219, 1331220 MFC after: 1 week From owner-svn-src-all@freebsd.org Mon May 16 04:47:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C05B3C609; Mon, 16 May 2016 04:47:33 +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 A90301C25; Mon, 16 May 2016 04:47:33 +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 u4G4lWAx029307; Mon, 16 May 2016 04:47:32 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G4lWhP029305; Mon, 16 May 2016 04:47:32 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605160447.u4G4lWhP029305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 16 May 2016 04:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299895 - in vendor/libarchive/dist: cpio libarchive X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 04:47:33 -0000 Author: mm Date: Mon May 16 04:47:32 2016 New Revision: 299895 URL: https://svnweb.freebsd.org/changeset/base/299895 Log: Update vendor/libarchvie to git commit 860ec63 Integrates my pull request #709 Modified: vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Modified: vendor/libarchive/dist/cpio/cpio.c ============================================================================== --- vendor/libarchive/dist/cpio/cpio.c Mon May 16 04:43:47 2016 (r299894) +++ vendor/libarchive/dist/cpio/cpio.c Mon May 16 04:47:32 2016 (r299895) @@ -295,6 +295,7 @@ main(int argc, char *argv[]) "Cannot use both -p and -%c", cpio->mode); cpio->mode = opt; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case OPTION_PASSPHRASE: cpio->passphrase = cpio->argument; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Mon May 16 04:43:47 2016 (r299894) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Mon May 16 04:47:32 2016 (r299895) @@ -401,6 +401,11 @@ archive_read_format_cpio_read_header(str /* If this is a symlink, read the link contents. */ if (archive_entry_filetype(entry) == AE_IFLNK) { + if (cpio->entry_bytes_remaining > 1024 * 1024) { + archive_set_error(&a->archive, ENOMEM, + "Rejecting malformed cpio archive: symlink contents exceed 1 megabyte"); + return (ARCHIVE_FATAL); + } h = __archive_read_ahead(a, (size_t)cpio->entry_bytes_remaining, NULL); if (h == NULL) From owner-svn-src-all@freebsd.org Mon May 16 05:01:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19200B3C973; Mon, 16 May 2016 05:01:46 +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 CF91F1395; Mon, 16 May 2016 05:01:45 +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 u4G51jD6034700; Mon, 16 May 2016 05:01:45 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G51ip1034695; Mon, 16 May 2016 05:01:44 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605160501.u4G51ip1034695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 16 May 2016 05:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299896 - in head/contrib/libarchive: cpio libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 05:01:46 -0000 Author: mm Date: Mon May 16 05:01:44 2016 New Revision: 299896 URL: https://svnweb.freebsd.org/changeset/base/299896 Log: Revert r299576 and MFV r299895: Revert r299576: Fix broken cpio behavior. MFV r299895: Update to vendor git commit 860ec63. MFC after: 3 weeks (together with libarchive 3.2.0) Fix broken cpio behavior in pass-through mode with vendor code. > Description of fields to fill in above: 76 columns --| > PR: If and which Problem Report is related. > Submitted by: If someone else sent in the change. > Reported by: If someone else reported the issue. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. _M libarchive _M libarchive/cpio M libarchive/cpio/bsdcpio.1 M libarchive/cpio/cpio.c _M libarchive/libarchive M libarchive/libarchive/archive_read_support_format_cpio.c Modified: head/contrib/libarchive/cpio/bsdcpio.1 head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/cpio/ (props changed) head/contrib/libarchive/libarchive/ (props changed) Modified: head/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- head/contrib/libarchive/cpio/bsdcpio.1 Mon May 16 04:47:32 2016 (r299895) +++ head/contrib/libarchive/cpio/bsdcpio.1 Mon May 16 05:01:44 2016 (r299896) @@ -156,7 +156,8 @@ See above for description. .It Fl Fl insecure (i and p mode only) Disable security checks during extraction or copying. -This allows extraction via symbolic links and path names containing +This allows extraction via symbolic links, absolute paths, +and path names containing .Sq .. in the name. .It Fl J , Fl Fl xz Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Mon May 16 04:47:32 2016 (r299895) +++ head/contrib/libarchive/cpio/cpio.c Mon May 16 05:01:44 2016 (r299896) @@ -171,6 +171,7 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; @@ -256,6 +257,7 @@ main(int argc, char *argv[]) case OPTION_INSECURE: cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case 'L': /* GNU cpio */ cpio->option_follow_links = 1; @@ -293,6 +295,7 @@ main(int argc, char *argv[]) "Cannot use both -p and -%c", cpio->mode); cpio->mode = opt; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case OPTION_PASSPHRASE: cpio->passphrase = cpio->argument; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Mon May 16 04:47:32 2016 (r299895) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Mon May 16 05:01:44 2016 (r299896) @@ -401,6 +401,11 @@ archive_read_format_cpio_read_header(str /* If this is a symlink, read the link contents. */ if (archive_entry_filetype(entry) == AE_IFLNK) { + if (cpio->entry_bytes_remaining > 1024 * 1024) { + archive_set_error(&a->archive, ENOMEM, + "Rejecting malformed cpio archive: symlink contents exceed 1 megabyte"); + return (ARCHIVE_FATAL); + } h = __archive_read_ahead(a, (size_t)cpio->entry_bytes_remaining, NULL); if (h == NULL) From owner-svn-src-all@freebsd.org Mon May 16 05:17:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 451BAB3CECD; Mon, 16 May 2016 05:17:44 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15A8C1E48; Mon, 16 May 2016 05:17:44 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G5Hh6b038953; Mon, 16 May 2016 05:17:43 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G5HhvW038952; Mon, 16 May 2016 05:17:43 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160517.u4G5HhvW038952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 05:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299897 - head/usr.sbin/rpc.lockd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 05:17:44 -0000 Author: truckman Date: Mon May 16 05:17:43 2016 New Revision: 299897 URL: https://svnweb.freebsd.org/changeset/base/299897 Log: NULL releasedfl after calling deallocate_file_lock() which frees it to avoid a use-after-free error in the debuglog() call at the top of the loop. Reported by: Coverity CID: 1006080 MFC after: 1 week Modified: head/usr.sbin/rpc.lockd/lockd_lock.c Modified: head/usr.sbin/rpc.lockd/lockd_lock.c ============================================================================== --- head/usr.sbin/rpc.lockd/lockd_lock.c Mon May 16 05:01:44 2016 (r299896) +++ head/usr.sbin/rpc.lockd/lockd_lock.c Mon May 16 05:17:43 2016 (r299897) @@ -1600,6 +1600,7 @@ unlock_partialfilelock(const struct file */ deallocate_file_lock(releasedfl); + releasedfl = NULL; } } From owner-svn-src-all@freebsd.org Mon May 16 05:26:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31AFDB3C1B0; Mon, 16 May 2016 05:26:15 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 044C51270; Mon, 16 May 2016 05:26:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-225-151.lns20.per1.internode.on.net [121.45.225.151]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u4G5Q1Br054637 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 15 May 2016 22:26:05 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r299746 - in head/sys: cddl/dev/dtrace cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/powerpc conf dev/acpica dev/hwpmc dev/hyperv/vmbus dev/xen/control geom/eli kern net sy... To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605141822.u4EIMqkx090971@repo.freebsd.org> From: Julian Elischer Message-ID: <0539c5c3-dce8-1659-d26e-ef136f256f10@freebsd.org> Date: Mon, 16 May 2016 13:25:56 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605141822.u4EIMqkx090971@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 05:26:15 -0000 On 15/05/2016 2:22 AM, John Baldwin wrote: > Author: jhb > Date: Sat May 14 18:22:52 2016 > New Revision: 299746 > URL: https://svnweb.freebsd.org/changeset/base/299746 > > Log: > Add an EARLY_AP_STARTUP option to start APs earlier during boot. > > Currently, Application Processors (non-boot CPUs) are started by > MD code at SI_SUB_CPU, but they are kept waiting in a "pen" until > SI_SUB_SMP at which point they are released to run kernel threads. > SI_SUB_SMP is one of the last SYSINIT levels, so APs don't enter > the scheduler and start running threads until fairly late in the > boot. > > This change moves SI_SUB_SMP up to just before software interrupt > threads are created allowing the APs to start executing kernel > threads much sooner (before any devices are probed). This allows > several initialization routines that need to perform initialization > on all CPUs to now perform that initialization in one step rather > than having to defer the AP initialization to a second SYSINIT run > at SI_SUB_SMP. It also permits all CPUs to be available for > handling interrupts before any devices are probed. > > This last feature fixes a problem on with interrupt vector exhaustion. > Specifically, in the old model all device interrupts were routed > onto the boot CPU during boot. Later after the APs were released at > SI_SUB_SMP, interrupts were redistributed across all CPUs. > > However, several drivers for multiqueue hardware allocate N interrupts > per CPU in the system. In a system with many CPUs, just a few drivers > doing this could exhaust the available pool of interrupt vectors on > the boot CPU as each driver was allocating N * mp_ncpu vectors on the > boot CPU. Now, drivers will allocate interrupts on their desired CPUs > during boot meaning that only N interrupts are allocated from the boot > CPU instead of N * mp_ncpu. > > Some other bits of code can also be simplified as smp_started is > now true much earlier and will now always be true for these bits of > code. This removes the need to treat the single-CPU boot environment > as a special case. > > As a transition aid, the new behavior is available under a new kernel > option (EARLY_AP_STARTUP). This will allow the option to be turned off > if need be during initial testing. I plan to enable this on x86 by > default in a followup commit in the next few days and to have all > platforms moved over before 11.0. Once the transition is complete, > the option will be removed along with the !EARLY_AP_STARTUP code. > > These changes have only been tested on x86. Other platform maintainers > are encouraged to port their architectures over as well. The main > things to check for are any uses of smp_started in MD code that can be > simplified and SI_SUB_SMP SYSINITs in MD code that can be removed in > the EARLY_AP_STARTUP case (e.g. the interrupt shuffling). > > PR: kern/199321 > Reviewed by: markj, gnn, kib > Sponsored by: Netflix > > Modified: > head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c > head/sys/cddl/dev/dtrace/dtrace_load.c > head/sys/cddl/dev/dtrace/i386/dtrace_subr.c > head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c > head/sys/conf/NOTES > head/sys/conf/options > head/sys/dev/acpica/acpi.c > head/sys/dev/acpica/acpi_cpu.c > head/sys/dev/hwpmc/hwpmc_mod.c > head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c > head/sys/dev/xen/control/control.c > head/sys/geom/eli/g_eli.c > head/sys/kern/kern_clock.c > head/sys/kern/kern_clocksource.c > head/sys/kern/kern_cpu.c > head/sys/net/netisr.c > head/sys/sys/kernel.h > head/sys/x86/isa/clock.c > head/sys/x86/x86/intr_machdep.c > head/sys/x86/x86/local_apic.c > head/sys/x86/x86/mca.c > head/sys/x86/x86/mp_x86.c > > Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c > ============================================================================== > --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sat May 14 18:22:52 2016 (r299746) > @@ -246,6 +246,26 @@ static uint64_t nsec_scale; > /* See below for the explanation of this macro. */ > #define SCALE_SHIFT 28 > > +static void > +dtrace_gethrtime_init_cpu(void *arg) > +{ > + uintptr_t cpu = (uintptr_t) arg; > + > + if (cpu == curcpu) > + tgt_cpu_tsc = rdtsc(); > + else > + hst_cpu_tsc = rdtsc(); > +} > + > +#ifdef EARLY_AP_STARTUP > +static void > +dtrace_gethrtime_init(void *arg) > +{ > + struct pcpu *pc; > + uint64_t tsc_f; > + cpuset_t map; > + int i; > +#else > /* > * Get the frequency and scale factor as early as possible so that they can be > * used for boot-time tracing. > @@ -254,6 +274,7 @@ static void > dtrace_gethrtime_init_early(void *arg) > { > uint64_t tsc_f; > +#endif > > /* > * Get TSC frequency known at this moment. > @@ -282,27 +303,18 @@ dtrace_gethrtime_init_early(void *arg) > * (terahertz) values; > */ > nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; > +#ifndef EARLY_AP_STARTUP > } > SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY, > dtrace_gethrtime_init_early, NULL); > > static void > -dtrace_gethrtime_init_cpu(void *arg) > -{ > - uintptr_t cpu = (uintptr_t) arg; > - > - if (cpu == curcpu) > - tgt_cpu_tsc = rdtsc(); > - else > - hst_cpu_tsc = rdtsc(); > -} > - > -static void > dtrace_gethrtime_init(void *arg) > { > struct pcpu *pc; > cpuset_t map; > int i; > +#endif > > /* The current CPU is the reference one. */ > sched_pin(); > @@ -323,8 +335,13 @@ dtrace_gethrtime_init(void *arg) > } > sched_unpin(); > } > +#ifdef EARLY_AP_STARTUP > +SYSINIT(dtrace_gethrtime_init, SI_SUB_DTRACE, SI_ORDER_ANY, > + dtrace_gethrtime_init, NULL); > +#else > SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, > NULL); > +#endif > > /* > * DTrace needs a high resolution time function which can > > Modified: head/sys/cddl/dev/dtrace/dtrace_load.c > ============================================================================== > --- head/sys/cddl/dev/dtrace/dtrace_load.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/cddl/dev/dtrace/dtrace_load.c Sat May 14 18:22:52 2016 (r299746) > @@ -22,6 +22,7 @@ > * > */ > > +#ifndef EARLY_AP_STARTUP > static void > dtrace_ap_start(void *dummy) > { > @@ -41,11 +42,15 @@ dtrace_ap_start(void *dummy) > } > > SYSINIT(dtrace_ap_start, SI_SUB_SMP, SI_ORDER_ANY, dtrace_ap_start, NULL); > +#endif > > static void > dtrace_load(void *dummy) > { > dtrace_provider_id_t id; > +#ifdef EARLY_AP_STARTUP > + int i; > +#endif > > /* Hook into the trap handler. */ > dtrace_trap_func = dtrace_trap; > @@ -142,8 +147,14 @@ dtrace_load(void *dummy) > > mutex_enter(&cpu_lock); > > +#ifdef EARLY_AP_STARTUP > + CPU_FOREACH(i) { > + (void) dtrace_cpu_setup(CPU_CONFIG, i); > + } > +#else > /* Setup the boot CPU */ > (void) dtrace_cpu_setup(CPU_CONFIG, 0); > +#endif > > mutex_exit(&cpu_lock); > > > Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c > ============================================================================== > --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sat May 14 18:22:52 2016 (r299746) > @@ -248,6 +248,26 @@ static uint64_t nsec_scale; > /* See below for the explanation of this macro. */ > #define SCALE_SHIFT 28 > > +static void > +dtrace_gethrtime_init_cpu(void *arg) > +{ > + uintptr_t cpu = (uintptr_t) arg; > + > + if (cpu == curcpu) > + tgt_cpu_tsc = rdtsc(); > + else > + hst_cpu_tsc = rdtsc(); > +} > + > +#ifdef EARLY_AP_STARTUP > +static void > +dtrace_gethrtime_init(void *arg) > +{ > + struct pcpu *pc; > + uint64_t tsc_f; > + cpuset_t map; > + int i; > +#else > /* > * Get the frequency and scale factor as early as possible so that they can be > * used for boot-time tracing. > @@ -256,6 +276,7 @@ static void > dtrace_gethrtime_init_early(void *arg) > { > uint64_t tsc_f; > +#endif > > /* > * Get TSC frequency known at this moment. > @@ -284,27 +305,18 @@ dtrace_gethrtime_init_early(void *arg) > * (terahertz) values; > */ > nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; > +#ifndef EARLY_AP_STARTUP > } > SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY, > dtrace_gethrtime_init_early, NULL); > > static void > -dtrace_gethrtime_init_cpu(void *arg) > -{ > - uintptr_t cpu = (uintptr_t) arg; > - > - if (cpu == curcpu) > - tgt_cpu_tsc = rdtsc(); > - else > - hst_cpu_tsc = rdtsc(); > -} > - > -static void > dtrace_gethrtime_init(void *arg) > { > cpuset_t map; > struct pcpu *pc; > int i; > +#endif > > /* The current CPU is the reference one. */ > sched_pin(); > @@ -325,8 +337,13 @@ dtrace_gethrtime_init(void *arg) > } > sched_unpin(); > } > +#ifdef EARLY_AP_STARTUP > +SYSINIT(dtrace_gethrtime_init, SI_SUB_DTRACE, SI_ORDER_ANY, > + dtrace_gethrtime_init, NULL); > +#else > SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, > NULL); > +#endif > > /* > * DTrace needs a high resolution time function which can > > Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c > ============================================================================== > --- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sat May 14 18:22:52 2016 (r299746) > @@ -218,8 +218,13 @@ dtrace_gethrtime_init(void *arg) > } > sched_unpin(); > } > - > -SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); > +#ifdef EARLY_AP_STARTUP > +SYSINIT(dtrace_gethrtime_init, SI_SUB_DTRACE, SI_ORDER_ANY, > + dtrace_gethrtime_init, NULL); > +#else > +SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, > + NULL); > +#endif > > /* > * DTrace needs a high resolution time function which can > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/conf/NOTES Sat May 14 18:22:52 2016 (r299746) > @@ -223,6 +223,12 @@ options SCHED_STATS > # Mandatory: > options SMP # Symmetric MultiProcessor Kernel > > +# EARLY_AP_STARTUP releases the Application Processors earlier in the > +# kernel startup process (before devices are probed) rather than at the > +# end. This is a temporary option for use during the transition from > +# late to early AP startup. > +options EARLY_AP_STARTUP > + > # MAXCPU defines the maximum number of CPUs that can boot in the system. > # A default value should be already present, for every architecture. > options MAXCPU=32 > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/conf/options Sat May 14 18:22:52 2016 (r299746) > @@ -620,6 +620,7 @@ DEBUG_MEMGUARD opt_vm.h > DEBUG_REDZONE opt_vm.h > > # Standard SMP options > +EARLY_AP_STARTUP opt_global.h > SMP opt_global.h > > # Size of the kernel message buffer > > Modified: head/sys/dev/acpica/acpi.c > ============================================================================== > --- head/sys/dev/acpica/acpi.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/dev/acpica/acpi.c Sat May 14 18:22:52 2016 (r299746) > @@ -2856,11 +2856,18 @@ acpi_EnterSleepState(struct acpi_softc * > stop_all_proc(); > EVENTHANDLER_INVOKE(power_suspend); > > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > + thread_lock(curthread); > + sched_bind(curthread, 0); > + thread_unlock(curthread); > +#else > if (smp_started) { > thread_lock(curthread); > sched_bind(curthread, 0); > thread_unlock(curthread); > } > +#endif > > /* > * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE > @@ -2991,11 +2998,17 @@ backout: > > mtx_unlock(&Giant); > > +#ifdef EARLY_AP_STARTUP > + thread_lock(curthread); > + sched_unbind(curthread); > + thread_unlock(curthread); > +#else > if (smp_started) { > thread_lock(curthread); > sched_unbind(curthread); > thread_unlock(curthread); > } > +#endif > > resume_all_proc(); > > > Modified: head/sys/dev/acpica/acpi_cpu.c > ============================================================================== > --- head/sys/dev/acpica/acpi_cpu.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/dev/acpica/acpi_cpu.c Sat May 14 18:22:52 2016 (r299746) > @@ -439,8 +439,12 @@ acpi_cpu_postattach(void *unused __unuse > free(devices, M_TEMP); > > if (attached) { > +#ifdef EARLY_AP_STARTUP > + acpi_cpu_startup(NULL); > +#else > /* Queue post cpu-probing task handler */ > AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); > +#endif > } > } > > > Modified: head/sys/dev/hwpmc/hwpmc_mod.c > ============================================================================== > --- head/sys/dev/hwpmc/hwpmc_mod.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat May 14 18:22:52 2016 (r299746) > @@ -334,7 +334,11 @@ static moduledata_t pmc_mod = { > &pmc_syscall_mod > }; > > +#ifdef EARLY_AP_STARTUP > +DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SYSCALLS, SI_ORDER_ANY); > +#else > DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SMP, SI_ORDER_ANY); > +#endif > MODULE_VERSION(pmc, PMC_VERSION); > > #ifdef HWPMC_DEBUG > > Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c > ============================================================================== > --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Sat May 14 18:22:52 2016 (r299746) > @@ -519,6 +519,7 @@ vmbus_attach(device_t dev) > device_printf(dev, "VMBUS: attach dev: %p\n", dev); > vmbus_devp = dev; > > +#ifndef EARLY_AP_STARTUP > /* > * If the system has already booted and thread > * scheduling is possible indicated by the global > @@ -526,6 +527,7 @@ vmbus_attach(device_t dev) > * initialization directly. > */ > if (!cold) > +#endif > vmbus_bus_init(); > > bus_generic_probe(dev); > @@ -538,6 +540,7 @@ vmbus_init(void) > if (vm_guest != VM_GUEST_HV) > return; > > +#ifndef EARLY_AP_STARTUP > /* > * If the system has already booted and thread > * scheduling is possible, as indicated by the > @@ -545,6 +548,7 @@ vmbus_init(void) > * initialization directly. > */ > if (!cold) > +#endif > vmbus_bus_init(); > } > > @@ -611,6 +615,9 @@ vmbus_modevent(module_t mod, int what, v > switch (what) { > > case MOD_LOAD: > +#ifdef EARLY_AP_STARTUP > + vmbus_init(); > +#endif > vmbus_mod_load(); > break; > case MOD_UNLOAD: > @@ -649,6 +656,7 @@ DRIVER_MODULE(vmbus, acpi, vmbus_driver, > MODULE_DEPEND(vmbus, acpi, 1, 1, 1); > MODULE_VERSION(vmbus, 1); > > +#ifndef EARLY_AP_STARTUP > /* We want to be started after SMP is initialized */ > SYSINIT(vmb_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, vmbus_init, NULL); > - > +#endif > > Modified: head/sys/dev/xen/control/control.c > ============================================================================== > --- head/sys/dev/xen/control/control.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/dev/xen/control/control.c Sat May 14 18:22:52 2016 (r299746) > @@ -202,11 +202,18 @@ xctrl_suspend() > stop_all_proc(); > EVENTHANDLER_INVOKE(power_suspend); > > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > + thread_lock(curthread); > + sched_bind(curthread, 0); > + thread_unlock(curthread); > +#else > if (smp_started) { > thread_lock(curthread); > sched_bind(curthread, 0); > thread_unlock(curthread); > } > +#endif > KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0")); > > /* > @@ -227,6 +234,17 @@ xctrl_suspend() > } > > #ifdef SMP > +#ifdef EARLY_AP_STARTUP > + /* > + * Suspend other CPUs. This prevents IPIs while we > + * are resuming, and will allow us to reset per-cpu > + * vcpu_info on resume. > + */ > + cpu_suspend_map = all_cpus; > + CPU_CLR(PCPU_GET(cpuid), &cpu_suspend_map); > + if (!CPU_EMPTY(&cpu_suspend_map)) > + suspend_cpus(cpu_suspend_map); > +#else > CPU_ZERO(&cpu_suspend_map); /* silence gcc */ > if (smp_started) { > /* > @@ -240,6 +258,7 @@ xctrl_suspend() > suspend_cpus(cpu_suspend_map); > } > #endif > +#endif > > /* > * Prevent any races with evtchn_interrupt() handler. > @@ -285,11 +304,17 @@ xctrl_suspend() > timecounter->tc_get_timecount(timecounter); > inittodr(time_second); > > +#ifdef EARLY_AP_STARTUP > + thread_lock(curthread); > + sched_unbind(curthread); > + thread_unlock(curthread); > +#else > if (smp_started) { > thread_lock(curthread); > sched_unbind(curthread); > thread_unlock(curthread); > } > +#endif > > resume_all_proc(); > > > Modified: head/sys/geom/eli/g_eli.c > ============================================================================== > --- head/sys/geom/eli/g_eli.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/geom/eli/g_eli.c Sat May 14 18:22:52 2016 (r299746) > @@ -479,7 +479,9 @@ g_eli_worker(void *arg) > > wr = arg; > sc = wr->w_softc; > -#ifdef SMP > +#ifdef EARLY_AP_STARTUP > + MPASS(!sc->sc_cpubind || smp_started); > +#elif defined(SMP) > /* Before sched_bind() to a CPU, wait for all CPUs to go on-line. */ > if (sc->sc_cpubind) { > while (!smp_started) > > Modified: head/sys/kern/kern_clock.c > ============================================================================== > --- head/sys/kern/kern_clock.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/kern/kern_clock.c Sat May 14 18:22:52 2016 (r299746) > @@ -391,6 +391,10 @@ static void > initclocks(dummy) > void *dummy; > { > +#ifdef EARLY_AP_STARTUP > + struct proc *p; > + struct thread *td; > +#endif > register int i; > > /* > @@ -415,6 +419,35 @@ initclocks(dummy) > * sign problems sooner. > */ > ticks = INT_MAX - (hz * 10 * 60); > + > +#ifdef EARLY_AP_STARTUP > + /* > + * Fixup the tick counts in any blocked or sleeping threads to > + * account for the jump above. > + */ > + sx_slock(&allproc_lock); > + FOREACH_PROC_IN_SYSTEM(p) { > + PROC_LOCK(p); > + if (p->p_state == PRS_NEW) { > + PROC_UNLOCK(p); > + continue; > + } > + FOREACH_THREAD_IN_PROC(p, td) { > + thread_lock(td); > + if (TD_ON_LOCK(td)) { > + MPASS(td->td_blktick == 0); > + td->td_blktick = ticks; > + } > + if (TD_ON_SLEEPQ(td)) { > + MPASS(td->td_slptick == 0); > + td->td_slptick = ticks; > + } > + thread_unlock(td); > + } > + PROC_UNLOCK(p); > + } > + sx_sunlock(&allproc_lock); > +#endif > } > > /* > > Modified: head/sys/kern/kern_clocksource.c > ============================================================================== > --- head/sys/kern/kern_clocksource.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/kern/kern_clocksource.c Sat May 14 18:22:52 2016 (r299746) > @@ -322,9 +322,16 @@ timercb(struct eventtimer *et, void *arg > curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); > > #ifdef SMP > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > +#endif > /* Prepare broadcasting to other CPUs for non-per-CPU timers. */ > bcast = 0; > +#ifdef EARLY_AP_STARTUP > + if ((et->et_flags & ET_FLAGS_PERCPU) == 0) { > +#else > if ((et->et_flags & ET_FLAGS_PERCPU) == 0 && smp_started) { > +#endif > CPU_FOREACH(cpu) { > state = DPCPU_ID_PTR(cpu, timerstate); > ET_HW_LOCK(state); > @@ -485,12 +492,17 @@ configtimer(int start) > nexttick = next; > else > nexttick = -1; > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > +#endif > CPU_FOREACH(cpu) { > state = DPCPU_ID_PTR(cpu, timerstate); > state->now = now; > +#ifndef EARLY_AP_STARTUP > if (!smp_started && cpu != CPU_FIRST()) > state->nextevent = SBT_MAX; > else > +#endif > state->nextevent = next; > if (periodic) > state->nexttick = next; > @@ -513,8 +525,13 @@ configtimer(int start) > } > ET_HW_UNLOCK(DPCPU_PTR(timerstate)); > #ifdef SMP > +#ifdef EARLY_AP_STARTUP > + /* If timer is global we are done. */ > + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { > +#else > /* If timer is global or there is no other CPUs yet - we are done. */ > if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || !smp_started) { > +#endif > critical_exit(); > return; > } > > Modified: head/sys/kern/kern_cpu.c > ============================================================================== > --- head/sys/kern/kern_cpu.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/kern/kern_cpu.c Sat May 14 18:22:52 2016 (r299746) > @@ -259,6 +259,9 @@ cf_set_method(device_t dev, const struct > CF_MTX_LOCK(&sc->lock); > > #ifdef SMP > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > +#else > /* > * If still booting and secondary CPUs not started yet, don't allow > * changing the frequency until they're online. This is because we > @@ -271,6 +274,7 @@ cf_set_method(device_t dev, const struct > error = ENXIO; > goto out; > } > +#endif > #endif /* SMP */ > > /* > > Modified: head/sys/net/netisr.c > ============================================================================== > --- head/sys/net/netisr.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/net/netisr.c Sat May 14 18:22:52 2016 (r299746) > @@ -1119,6 +1119,10 @@ netisr_start_swi(u_int cpuid, struct pcp > static void > netisr_init(void *arg) > { > +#ifdef EARLY_AP_STARTUP > + struct pcpu *pc; > +#endif > + > KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__)); > > NETISR_LOCK_INIT(); > @@ -1149,10 +1153,20 @@ netisr_init(void *arg) > netisr_bindthreads = 0; > } > #endif > + > +#ifdef EARLY_AP_STARTUP > + STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { > + if (nws_count >= netisr_maxthreads) > + break; > + netisr_start_swi(pc->pc_cpuid, pc); > + } > +#else > netisr_start_swi(curcpu, pcpu_find(curcpu)); > +#endif > } > SYSINIT(netisr_init, SI_SUB_SOFTINTR, SI_ORDER_FIRST, netisr_init, NULL); > > +#ifndef EARLY_AP_STARTUP > /* > * Start worker threads for additional CPUs. No attempt to gracefully handle > * work reassignment, we don't yet support dynamic reconfiguration. > @@ -1172,6 +1186,7 @@ netisr_start(void *arg) > } > } > SYSINIT(netisr_start, SI_SUB_SMP, SI_ORDER_MIDDLE, netisr_start, NULL); > +#endif > > /* > * Sysctl monitoring for netisr: query a list of registered protocols. > > Modified: head/sys/sys/kernel.h > ============================================================================== > --- head/sys/sys/kernel.h Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/sys/kernel.h Sat May 14 18:22:52 2016 (r299746) > @@ -118,7 +118,10 @@ enum sysinit_sub_id { > SI_SUB_SCHED_IDLE = 0x2600000, /* required idle procs */ > SI_SUB_MBUF = 0x2700000, /* mbuf subsystem */ > SI_SUB_INTR = 0x2800000, /* interrupt threads */ > - SI_SUB_SOFTINTR = 0x2800001, /* start soft interrupt thread */ > +#ifdef EARLY_AP_STARTUP > + SI_SUB_SMP = 0x2900000, /* start the APs*/ > +#endif > + SI_SUB_SOFTINTR = 0x2A00000, /* start soft interrupt thread */ > SI_SUB_DEVFS = 0x2F00000, /* devfs ready for devices */ > SI_SUB_INIT_IF = 0x3000000, /* prep for net interfaces */ > SI_SUB_NETGRAPH = 0x3010000, /* Let Netgraph initialize */ > @@ -154,7 +157,9 @@ enum sysinit_sub_id { > SI_SUB_KTHREAD_BUF = 0xea00000, /* buffer daemon*/ > SI_SUB_KTHREAD_UPDATE = 0xec00000, /* update daemon*/ > SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ > +#ifndef EARLY_AP_STARTUP > SI_SUB_SMP = 0xf000000, /* start the APs*/ > +#endif > SI_SUB_RACCTD = 0xf100000, /* start racctd*/ > SI_SUB_LAST = 0xfffffff /* final initialization */ > }; > > Modified: head/sys/x86/isa/clock.c > ============================================================================== > --- head/sys/x86/isa/clock.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/x86/isa/clock.c Sat May 14 18:22:52 2016 (r299746) > @@ -475,8 +475,27 @@ startrtclock() > void > cpu_initclocks(void) > { > +#ifdef EARLY_AP_STARTUP > + struct thread *td; > + int i; > > + td = curthread; > cpu_initclocks_bsp(); > + CPU_FOREACH(i) { > + if (i == 0) > + continue; > + thread_lock(td); > + sched_bind(td, i); > + thread_unlock(td); > + cpu_initclocks_ap(); > + } > + thread_lock(td); > + if (sched_is_bound(td)) > + sched_unbind(td); > + thread_unlock(td); > +#else > + cpu_initclocks_bsp(); > +#endif > } > > static int > > Modified: head/sys/x86/x86/intr_machdep.c > ============================================================================== > --- head/sys/x86/x86/intr_machdep.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/x86/x86/intr_machdep.c Sat May 14 18:22:52 2016 (r299746) > @@ -77,7 +77,7 @@ static struct mtx intr_table_lock; > static struct mtx intrcnt_lock; > static TAILQ_HEAD(pics_head, pic) pics; > > -#ifdef SMP > +#if defined(SMP) && !defined(EARLY_AP_STARTUP) > static int assign_cpu; > #endif > > @@ -320,11 +320,16 @@ intr_assign_cpu(void *arg, int cpu) > struct intsrc *isrc; > int error; > > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > + if (cpu != NOCPU) { > +#else > /* > * Don't do anything during early boot. We will pick up the > * assignment once the APs are started. > */ > if (assign_cpu && cpu != NOCPU) { > +#endif > isrc = arg; > mtx_lock(&intr_table_lock); > error = isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]); > @@ -502,9 +507,13 @@ intr_next_cpu(void) > { > u_int apic_id; > > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > +#else > /* Leave all interrupts on the BSP during boot. */ > if (!assign_cpu) > return (PCPU_GET(apic_id)); > +#endif > > mtx_lock_spin(&icu_lock); > apic_id = cpu_apic_ids[current_cpu]; > @@ -546,6 +555,7 @@ intr_add_cpu(u_int cpu) > CPU_SET(cpu, &intr_cpus); > } > > +#ifndef EARLY_AP_STARTUP > /* > * Distribute all the interrupt sources among the available CPUs once the > * AP's have been launched. > @@ -586,6 +596,7 @@ intr_shuffle_irqs(void *arg __unused) > } > SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs, > NULL); > +#endif > #else > /* > * Always route interrupts to the current processor in the UP case. > > Modified: head/sys/x86/x86/local_apic.c > ============================================================================== > --- head/sys/x86/x86/local_apic.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/x86/x86/local_apic.c Sat May 14 18:22:52 2016 (r299746) > @@ -749,6 +749,10 @@ native_lapic_enable_pmc(void) > > lvts[APIC_LVT_PMC].lvt_masked = 0; > > +#ifdef EARLY_AP_STARTUP > + MPASS(mp_ncpus == 1 || smp_started); > + smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL); > +#else > #ifdef SMP > /* > * If hwpmc was loaded at boot time then the APs may not be > @@ -760,6 +764,7 @@ native_lapic_enable_pmc(void) > else > #endif > lapic_update_pmc(NULL); > +#endif > return (1); > #else > return (0); > > Modified: head/sys/x86/x86/mca.c > ============================================================================== > --- head/sys/x86/x86/mca.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/x86/x86/mca.c Sat May 14 18:22:52 2016 (r299746) > @@ -726,7 +726,11 @@ mca_startup(void *dummy) > > callout_reset(&mca_timer, mca_ticks * hz, mca_periodic_scan, NULL); > } > +#ifdef EARLY_AP_STARTUP > +SYSINIT(mca_startup, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, mca_startup, NULL); > +#else > SYSINIT(mca_startup, SI_SUB_SMP, SI_ORDER_ANY, mca_startup, NULL); > +#endif > > #ifdef DEV_APIC > static void > > Modified: head/sys/x86/x86/mp_x86.c > ============================================================================== > --- head/sys/x86/x86/mp_x86.c Sat May 14 18:02:47 2016 (r299745) > +++ head/sys/x86/x86/mp_x86.c Sat May 14 18:22:52 2016 (r299746) > @@ -933,8 +933,10 @@ init_secondary_tail(void) > while (atomic_load_acq_int(&smp_started) == 0) > ia32_pause(); > > +#ifndef EARLY_AP_STARTUP > /* Start per-CPU event timers. */ > cpu_initclocks_ap(); > +#endif > > sched_throw(NULL); > > John, This feels as though it should be settable with a tuneable variable. Can you think of a good way to do this other than having two sysinit entries and making the tuneable "enable" the right one? There is no tuneable/sysinit interaction otherwise. From owner-svn-src-all@freebsd.org Mon May 16 06:17:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F139B3CD71; Mon, 16 May 2016 06:17:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5829316FD; Mon, 16 May 2016 06:17:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6HuwN056980; Mon, 16 May 2016 06:17:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6Hu8K056977; Mon, 16 May 2016 06:17:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160617.u4G6Hu8K056977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299898 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:17:57 -0000 Author: arybchik Date: Mon May 16 06:17:56 2016 New Revision: 299898 URL: https://svnweb.freebsd.org/changeset/base/299898 Log: sfxge(4): restructure efx_lic to support V3 licensing Create separate implementations of the efx_lic API for each revision of the licensing system. All processing of the V1/V2 license partition is moved to efx_lic, and an implementation of V3 licensing uses the existing TLV functions with extensions for writing new TLV entries. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6364 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon May 16 05:17:43 2016 (r299897) +++ head/sys/dev/sfxge/common/efx.h Mon May 16 06:17:56 2016 (r299898) @@ -2311,6 +2311,97 @@ efx_lic_get_id( __out_opt uint8_t *bufferp); +extern __checkReturn efx_rc_t +efx_lic_find_start( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ); + +extern __checkReturn efx_rc_t +efx_lic_find_end( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ); + +extern __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_find_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ); + +extern __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_validate_key( + __in efx_nic_t *enp, + __in_bcount(length) caddr_t keyp, + __in uint32_t length + ); + +extern __checkReturn efx_rc_t +efx_lic_read_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(key_max_size, *lengthp) + caddr_t keyp, + __in size_t key_max_size, + __out uint32_t *lengthp + ); + +extern __checkReturn efx_rc_t +efx_lic_write_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp + ); + + __checkReturn efx_rc_t +efx_lic_delete_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end, + __out uint32_t *deltap + ); + +extern __checkReturn efx_rc_t +efx_lic_create_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + +extern __checkReturn efx_rc_t +efx_lic_finish_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + #endif /* EFSYS_OPT_LICENSING */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Mon May 16 05:17:43 2016 (r299897) +++ head/sys/dev/sfxge/common/efx_impl.h Mon May 16 06:17:56 2016 (r299898) @@ -568,6 +568,27 @@ typedef struct efx_lic_ops_s { efx_rc_t (*elo_app_state)(efx_nic_t *, uint64_t, boolean_t *); efx_rc_t (*elo_get_id)(efx_nic_t *, size_t, uint32_t *, size_t *, uint8_t *); + efx_rc_t (*elo_find_start) + (efx_nic_t *, caddr_t, size_t, uint32_t *); + efx_rc_t (*elo_find_end)(efx_nic_t *, caddr_t, size_t, + uint32_t , uint32_t *); + boolean_t (*elo_find_key)(efx_nic_t *, caddr_t, size_t, + uint32_t, uint32_t *, uint32_t *); + boolean_t (*elo_validate_key)(efx_nic_t *, + caddr_t, uint32_t); + efx_rc_t (*elo_read_key)(efx_nic_t *, + caddr_t, size_t, uint32_t, uint32_t, + caddr_t, size_t, uint32_t *); + efx_rc_t (*elo_write_key)(efx_nic_t *, + caddr_t, size_t, uint32_t, + caddr_t, uint32_t, uint32_t *); + efx_rc_t (*elo_delete_key)(efx_nic_t *, + caddr_t, size_t, uint32_t, + uint32_t, uint32_t, uint32_t *); + efx_rc_t (*elo_create_partition)(efx_nic_t *, + caddr_t, size_t); + efx_rc_t (*elo_finish_partition)(efx_nic_t *, + caddr_t, size_t); } efx_lic_ops_t; #endif Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Mon May 16 05:17:43 2016 (r299897) +++ head/sys/dev/sfxge/common/efx_lic.c Mon May 16 06:17:56 2016 (r299898) @@ -36,6 +36,104 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_LICENSING +#include "ef10_tlv_layout.h" + +#if EFSYS_OPT_SIENA | EFSYS_OPT_HUNTINGTON + + __checkReturn efx_rc_t +efx_lic_v1v2_find_start( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ); + + __checkReturn efx_rc_t +efx_lic_v1v2_find_end( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ); + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v1v2_find_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ); + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v1v2_validate_key( + __in efx_nic_t *enp, + __in_bcount(length) caddr_t keyp, + __in uint32_t length + ); + + __checkReturn efx_rc_t +efx_lic_v1v2_read_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(key_max_size, *lengthp) + caddr_t keyp, + __in size_t key_max_size, + __out uint32_t *lengthp + ); + + __checkReturn efx_rc_t +efx_lic_v1v2_write_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp + ); + + __checkReturn efx_rc_t +efx_lic_v1v2_delete_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end, + __out uint32_t *deltap + ); + + __checkReturn efx_rc_t +efx_lic_v1v2_create_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + + __checkReturn efx_rc_t +efx_lic_v1v2_finish_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + +#endif /* EFSYS_OPT_HUNTINGTON | EFSYS_OPT_SIENA */ + + #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t @@ -52,6 +150,15 @@ static const efx_lic_ops_t __efx_lic_v1_ efx_mcdi_fc_license_get_key_stats, /* elo_get_key_stats */ NULL, /* elo_app_state */ NULL, /* elo_get_id */ + efx_lic_v1v2_find_start, /* elo_find_start */ + efx_lic_v1v2_find_end, /* elo_find_end */ + efx_lic_v1v2_find_key, /* elo_find_key */ + efx_lic_v1v2_validate_key, /* elo_validate_key */ + efx_lic_v1v2_read_key, /* elo_read_key */ + efx_lic_v1v2_write_key, /* elo_write_key */ + efx_lic_v1v2_delete_key, /* elo_delete_key */ + efx_lic_v1v2_create_partition, /* elo_create_partition */ + efx_lic_v1v2_finish_partition, /* elo_finish_partition */ }; #endif /* EFSYS_OPT_SIENA */ @@ -78,6 +185,15 @@ static const efx_lic_ops_t __efx_lic_v2_ efx_mcdi_licensing_get_key_stats, /* elo_get_key_stats */ efx_mcdi_licensed_app_state, /* elo_app_state */ NULL, /* elo_get_id */ + efx_lic_v1v2_find_start, /* elo_find_start */ + efx_lic_v1v2_find_end, /* elo_find_end */ + efx_lic_v1v2_find_key, /* elo_find_key */ + efx_lic_v1v2_validate_key, /* elo_validate_key */ + efx_lic_v1v2_read_key, /* elo_read_key */ + efx_lic_v1v2_write_key, /* elo_write_key */ + efx_lic_v1v2_delete_key, /* elo_delete_key */ + efx_lic_v1v2_create_partition, /* elo_create_partition */ + efx_lic_v1v2_finish_partition, /* elo_finish_partition */ }; #endif /* EFSYS_OPT_HUNTINGTON */ @@ -108,11 +224,111 @@ efx_mcdi_licensing_v3_get_id( __out_bcount_part_opt(buffer_size, *lengthp) uint8_t *bufferp); + __checkReturn efx_rc_t +efx_lic_v3_find_start( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ); + + __checkReturn efx_rc_t +efx_lic_v3_find_end( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ); + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v3_find_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ); + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v3_validate_key( + __in efx_nic_t *enp, + __in_bcount(length) caddr_t keyp, + __in uint32_t length + ); + + __checkReturn efx_rc_t +efx_lic_v3_read_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(key_max_size, *lengthp) + caddr_t keyp, + __in size_t key_max_size, + __out uint32_t *lengthp + ); + + __checkReturn efx_rc_t +efx_lic_v3_write_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp + ); + + __checkReturn efx_rc_t +efx_lic_v3_delete_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end, + __out uint32_t *deltap + ); + + __checkReturn efx_rc_t +efx_lic_v3_create_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + + __checkReturn efx_rc_t +efx_lic_v3_finish_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + static const efx_lic_ops_t __efx_lic_v3_ops = { efx_mcdi_licensing_v3_update_licenses, /* elo_update_licenses */ efx_mcdi_licensing_v3_report_license, /* elo_get_key_stats */ efx_mcdi_licensing_v3_app_state, /* elo_app_state */ efx_mcdi_licensing_v3_get_id, /* elo_get_id */ + efx_lic_v3_find_start, /* elo_find_start*/ + efx_lic_v3_find_end, /* elo_find_end */ + efx_lic_v3_find_key, /* elo_find_key */ + efx_lic_v3_validate_key, /* elo_validate_key */ + efx_lic_v3_read_key, /* elo_read_key */ + efx_lic_v3_write_key, /* elo_write_key */ + efx_lic_v3_delete_key, /* elo_delete_key */ + efx_lic_v3_create_partition, /* elo_create_partition */ + efx_lic_v3_finish_partition, /* elo_finish_partition */ }; #endif /* EFSYS_OPT_MEDFORD */ @@ -223,6 +439,267 @@ fail1: #endif /* EFSYS_OPT_SIENA */ +/* V1 and V2 Partition format - based on a 16-bit TLV format */ + +#if EFSYS_OPT_SIENA | EFSYS_OPT_HUNTINGTON + +/* + * V1/V2 format - defined in SF-108542-TC section 4.2: + * Type (T): 16bit - revision/HMAC algorithm + * Length (L): 16bit - value length in bytes + * Value (V): L bytes - payload + */ +#define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) +#define EFX_LICENSE_V1V2_HEADER_LENGTH (2*sizeof(uint16_t)) + + __checkReturn efx_rc_t +efx_lic_v1v2_find_start( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ) +{ + _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) + + *startp = 0; + return (0); +} + + __checkReturn efx_rc_t +efx_lic_v1v2_find_end( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ) +{ + _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) + + *endp = offset + EFX_LICENSE_V1V2_HEADER_LENGTH; + return (0); +} + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v1v2_find_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ) +{ + boolean_t found; + uint16_t tlv_type; + uint16_t tlv_length; + + _NOTE(ARGUNUSED(enp)) + + if((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH) + goto fail1; + + tlv_type = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[0]); + tlv_length = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[1]); + if ((tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) || + (tlv_type == 0 && tlv_length == 0)) { + found = B_FALSE; + } else { + *startp = offset; + *lengthp = tlv_length + EFX_LICENSE_V1V2_HEADER_LENGTH; + found = B_TRUE; + } + return (found); + +fail1: + EFSYS_PROBE(fail1); + + return (B_FALSE); +} + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v1v2_validate_key( + __in efx_nic_t *enp, + __in_bcount(length) caddr_t keyp, + __in uint32_t length + ) +{ + const efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + uint16_t tlv_type; + uint16_t tlv_length; + + _NOTE(ARGUNUSED(enp)) + + if (length < EFX_LICENSE_V1V2_HEADER_LENGTH) { + goto fail1; + } + + tlv_type = __LE_TO_CPU_16(((uint16_t*)keyp)[0]); + tlv_length = __LE_TO_CPU_16(((uint16_t*)keyp)[1]); + + if(tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) { + goto fail2; + } + if (tlv_type == 0) { + goto fail3; + } + if ((tlv_length + EFX_LICENSE_V1V2_HEADER_LENGTH) != length) { + goto fail4; + } + + return (B_TRUE); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE(fail1); + + return (B_FALSE); +} + + + __checkReturn efx_rc_t +efx_lic_v1v2_read_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(key_max_size, *lengthp) + caddr_t keyp, + __in size_t key_max_size, + __out uint32_t *lengthp + ) +{ + efx_rc_t rc; + + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX + + EFX_LICENSE_V1V2_HEADER_LENGTH)); + + if (key_max_size < length) { + rc = ENOSPC; + goto fail1; + } + memcpy(keyp, &bufferp[offset], length); + + *lengthp = length; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_v1v2_write_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp + ) +{ + efx_rc_t rc; + + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX + + EFX_LICENSE_V1V2_HEADER_LENGTH)); + + // Ensure space for terminator remains + if ((offset + length) > + (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) { + rc = ENOSPC; + goto fail1; + } + + memcpy(bufferp + offset, keyp, length); + + *lengthp = length; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_v1v2_delete_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end, + __out uint32_t *deltap + ) +{ + efx_rc_t rc; + uint32_t move_start = offset + length; + uint32_t move_length = end - move_start; + + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT(end <= buffer_size); + + // Shift everything after the key down + memmove(bufferp + offset, bufferp + move_start, move_length); + + *deltap = length; + + return (0); +} + + __checkReturn efx_rc_t +efx_lic_v1v2_create_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ) +{ + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); + + // Write terminator + memset(bufferp, '\0', EFX_LICENSE_V1V2_HEADER_LENGTH); + return (0); +} + + + __checkReturn efx_rc_t +efx_lic_v1v2_finish_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ) +{ + _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) + + return (0); +} + +#endif /* EFSYS_OPT_HUNTINGTON | EFSYS_OPT_SIENA */ + + /* V2 Licensing - used by Huntington family only. See SF-113611-TC */ #if EFSYS_OPT_HUNTINGTON @@ -575,7 +1052,7 @@ efx_mcdi_licensing_v3_get_id( req.emr_in_buf = bufferp; req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; req.emr_out_buf = bufferp; - req.emr_out_length = MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN); + req.emr_out_length = MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX); (void) memset(bufferp, 0, req.emr_out_length); } @@ -617,6 +1094,228 @@ fail1: return (rc); } +/* V3 format uses Huntington TLV format partition. See SF-108797-SW */ +#define EFX_LICENSE_V3_KEY_LENGTH_MIN (64) +#define EFX_LICENSE_V3_KEY_LENGTH_MAX (128) +#define EFX_LICENSE_V3_HASH_LENGTH (64) + + __checkReturn efx_rc_t +efx_lic_v3_find_start( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ) +{ + _NOTE(ARGUNUSED(enp)) + + return ef10_nvram_buffer_find_item_start(bufferp, buffer_size, startp); +} + + __checkReturn efx_rc_t +efx_lic_v3_find_end( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ) +{ + _NOTE(ARGUNUSED(enp)) + + return ef10_nvram_buffer_find_end(bufferp, buffer_size, offset, endp); +} + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v3_find_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ) +{ + _NOTE(ARGUNUSED(enp)) + + return ef10_nvram_buffer_find_item(bufferp, buffer_size, + offset, startp, lengthp); +} + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_v3_validate_key( + __in efx_nic_t *enp, + __in_bcount(length) caddr_t keyp, + __in uint32_t length + ) +{ + // Check key is a valid V3 key + efx_rc_t rc; + uint8_t key_type; + uint8_t key_length; + + _NOTE(ARGUNUSED(enp)) + + if (length < EFX_LICENSE_V3_KEY_LENGTH_MIN) { + goto fail1; + } + + key_type = ((uint8_t*)keyp)[0]; + key_length = ((uint8_t*)keyp)[1] + EFX_LICENSE_V3_HASH_LENGTH; + + if(key_length > EFX_LICENSE_V3_KEY_LENGTH_MAX) { + goto fail2; + } + if (key_type < 3) { + goto fail3; + } + if (key_length != length) { + goto fail4; + } + return (B_TRUE); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE(fail1); + + return (B_FALSE); +} + + __checkReturn efx_rc_t +efx_lic_v3_read_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(key_max_size, *lengthp) + caddr_t keyp, + __in size_t key_max_size, + __out uint32_t *lengthp + ) +{ + _NOTE(ARGUNUSED(enp)) + + return ef10_nvram_buffer_get_item(bufferp, buffer_size, + offset, length, keyp, key_max_size, lengthp); +} + + __checkReturn efx_rc_t +efx_lic_v3_write_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp + ) +{ + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT(length <= EFX_LICENSE_V3_KEY_LENGTH_MAX); + + return ef10_nvram_buffer_insert_item(bufferp, buffer_size, + offset, keyp, length, lengthp); +} + + __checkReturn efx_rc_t +efx_lic_v3_delete_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end, + __out uint32_t *deltap + ) +{ + efx_rc_t rc; + + _NOTE(ARGUNUSED(enp)) + + if ((rc = ef10_nvram_buffer_delete_item(bufferp, + buffer_size, offset, length, end)) != 0) { + goto fail1; + } + + *deltap = length; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_v3_create_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ) +{ + efx_rc_t rc; + + // Construct empty partition + if ((rc = ef10_nvram_buffer_create(enp, + NVRAM_PARTITION_TYPE_LICENSE, + bufferp, buffer_size)) != 0) { + rc = EFAULT; + goto fail1; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_v3_finish_partition( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ) +{ + efx_rc_t rc; + + if ((rc = ef10_nvram_buffer_finish(bufferp, + buffer_size)) != 0) { + goto fail1; + } + + // Validate completed partition + if ((rc = ef10_nvram_buffer_validate(enp, NVRAM_PARTITION_TYPE_LICENSE, + bufferp, buffer_size)) != 0) { + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #endif /* EFSYS_OPT_MEDFORD */ @@ -789,4 +1488,257 @@ fail1: return (rc); } +/* Buffer management API - abstracts varying TLV format used for License partition */ + + __checkReturn efx_rc_t +efx_lic_find_start( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ) +{ + const efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if ((rc = elop->elo_find_start(enp, bufferp, buffer_size, startp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_lic_find_end( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ) +{ + const efx_lic_ops_t *elop = enp->en_elop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if ((rc = elop->elo_find_end(enp, bufferp, buffer_size, offset, endp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_find_key( + __in efx_nic_t *enp, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ) +{ + const efx_lic_ops_t *elop = enp->en_elop; + boolean_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + EFSYS_ASSERT(bufferp); + EFSYS_ASSERT(startp); + EFSYS_ASSERT(lengthp); + + return (elop->elo_find_key(enp, bufferp, buffer_size, offset, + startp, lengthp)); +} + + +/* Validate that the buffer contains a single key in a recognised format. +** An empty or terminator buffer is not accepted as a valid key. +*/ + __checkReturn __success(return != B_FALSE) boolean_t +efx_lic_validate_key( + __in efx_nic_t *enp, + __in_bcount(length) caddr_t keyp, + __in uint32_t length + ) +{ + const efx_lic_ops_t *elop = enp->en_elop; + boolean_t rc; + uint16_t tlv_type; + uint16_t tlv_length; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + if ((rc = elop->elo_validate_key(enp, keyp, length)) == B_FALSE) + goto fail1; + + return (B_TRUE); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 16 06:19:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5ED2B3CE3F; Mon, 16 May 2016 06:19:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B484B18C8; Mon, 16 May 2016 06:19:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6JHiF057065; Mon, 16 May 2016 06:19:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6JH31057064; Mon, 16 May 2016 06:19:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160619.u4G6JH31057064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299899 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:19:19 -0000 Author: arybchik Date: Mon May 16 06:19:17 2016 New Revision: 299899 URL: https://svnweb.freebsd.org/changeset/base/299899 Log: sfxge(4): cleanup: make licensing function quieter Silent handling of failure to invoke functions that are not supported on older licensing versions. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6365 Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Mon May 16 06:17:56 2016 (r299898) +++ head/sys/dev/sfxge/common/efx_lic.c Mon May 16 06:19:17 2016 (r299899) @@ -1437,17 +1437,14 @@ efx_lic_app_state( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); - if (elop->elo_app_state == NULL) { - rc = ENOTSUP; - goto fail1; - } + if (elop->elo_app_state == NULL) + return (ENOTSUP); + if ((rc = elop->elo_app_state(enp, app_id, licensedp)) != 0) - goto fail2; + goto fail1; return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -1469,19 +1466,15 @@ efx_lic_get_id( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); - if (elop->elo_get_id == NULL) { - rc = ENOTSUP; - goto fail1; - } + if (elop->elo_get_id == NULL) + return (ENOTSUP); if ((rc = elop->elo_get_id(enp, buffer_size, typep, lengthp, bufferp)) != 0) - goto fail2; + goto fail1; return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-all@freebsd.org Mon May 16 06:24:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB7AAB3D0B0; Mon, 16 May 2016 06:24:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6A851E87; Mon, 16 May 2016 06:24:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6O4kM060374; Mon, 16 May 2016 06:24:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6O44s060371; Mon, 16 May 2016 06:24:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605160624.u4G6O44s060371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 06:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299900 - in head/sys/cddl: compat/opensolaris/kern 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:24:06 -0000 Author: avg Date: Mon May 16 06:24:04 2016 New Revision: 299900 URL: https://svnweb.freebsd.org/changeset/base/299900 Log: zfsctl: fix several problems with reference counts * Remove excessive references on a snapshot mountpoint vnode. zfsctl_snapdir_lookup() called VN_HOLD() on a vnode returned from zfsctl_snapshot_mknode() and the latter also had a call to VN_HOLD() on the same vnode. On top of that gfs_dir_create() already returns the vnode with the use count of 1 (set in getnewvnode). So there was 3 references on the vnode. * mount_snapshot() should keep a reference to a covered vnode. That reference is owned by the mountpoint (mounted snapshot filesystem). * Remove cryptic manipulations of a covered vnode in zfs_umount(). FreeBSD dounmount() already does the right thing and releases the covered vnode. PR: 207464 Reported by: dustinwenz@ebureau.com Tested by: Howard Powell MFC after: 3 weeks Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon May 16 06:19:17 2016 (r299899) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon May 16 06:24:04 2016 (r299900) @@ -229,7 +229,7 @@ mount_snapshot(kthread_t *td, vnode_t ** vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp)) panic("mount: lost mount"); - vput(vp); + VOP_UNLOCK(vp, 0); vfs_unbusy(mp); *vpp = mvp; return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 06:19:17 2016 (r299899) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 06:24:04 2016 (r299900) @@ -1076,7 +1076,6 @@ zfsctl_snapdir_lookup(ap) sep->se_name = kmem_alloc(strlen(nm) + 1, KM_SLEEP); (void) strcpy(sep->se_name, nm); *vpp = sep->se_root = zfsctl_snapshot_mknode(dvp, dmu_objset_id(snap)); - VN_HOLD(*vpp); avl_insert(&sdp->sd_snaps, sep, where); dmu_objset_rele(snap, FTAG); @@ -1454,7 +1453,6 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin vp = gfs_dir_create(sizeof (zfsctl_node_t), pvp, pvp->v_vfsp, &zfsctl_ops_snapshot, NULL, NULL, MAXNAMELEN, NULL, NULL); - VN_HOLD(vp); zcp = vp->v_data; zcp->zc_id = objset; VOP_UNLOCK(vp, 0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 16 06:19:17 2016 (r299899) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 16 06:24:04 2016 (r299900) @@ -2005,12 +2005,6 @@ zfs_umount(vfs_t *vfsp, int fflag) */ if (zfsvfs->z_ctldir != NULL) zfsctl_destroy(zfsvfs); - if (zfsvfs->z_issnap) { - vnode_t *svp = vfsp->mnt_vnodecovered; - - if (svp->v_count >= 2) - VN_RELE(svp); - } zfs_freevfs(vfsp); return (0); From owner-svn-src-all@freebsd.org Mon May 16 06:26:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07229B3D257; Mon, 16 May 2016 06:26:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2E581166; Mon, 16 May 2016 06:26:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6QIoN060506; Mon, 16 May 2016 06:26:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6QIK7060503; Mon, 16 May 2016 06:26:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160626.u4G6QIK7060503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299901 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:26:20 -0000 Author: arybchik Date: Mon May 16 06:26:18 2016 New Revision: 299901 URL: https://svnweb.freebsd.org/changeset/base/299901 Log: sfxge(4): cleanup: make VPD lookups quieter A lookup on a VPD entry which is missing reports several failure messages as it propagates through wrapper functions. Restructured the wrappers to treat this gracefully as an expected case. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6366 Modified: head/sys/dev/sfxge/common/ef10_vpd.c head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/ef10_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_vpd.c Mon May 16 06:24:04 2016 (r299900) +++ head/sys/dev/sfxge/common/ef10_vpd.c Mon May 16 06:26:18 2016 (r299901) @@ -332,8 +332,11 @@ ef10_vpd_get( /* And then from the provided data buffer */ if ((rc = efx_vpd_hunk_get(data, size, evvp->evv_tag, - evvp->evv_keyword, &offset, &length)) != 0) + evvp->evv_keyword, &offset, &length)) != 0) { + if (rc == ENOENT) + return (rc); goto fail2; + } evvp->evv_length = length; memcpy(evvp->evv_value, data + offset, length); Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Mon May 16 06:24:04 2016 (r299900) +++ head/sys/dev/sfxge/common/efx_vpd.c Mon May 16 06:26:18 2016 (r299901) @@ -253,8 +253,12 @@ efx_vpd_get( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD); - if ((rc = evpdop->evpdo_get(enp, data, size, evvp)) != 0) + if ((rc = evpdop->evpdo_get(enp, data, size, evvp)) != 0) { + if (rc == ENOENT) + return (rc); + goto fail1; + } return (0); Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Mon May 16 06:24:04 2016 (r299900) +++ head/sys/dev/sfxge/common/siena_vpd.c Mon May 16 06:26:18 2016 (r299901) @@ -436,8 +436,12 @@ siena_vpd_get( /* And then from the provided data buffer */ if ((rc = efx_vpd_hunk_get(data, size, evvp->evv_tag, - evvp->evv_keyword, &offset, &length)) != 0) + evvp->evv_keyword, &offset, &length)) != 0) { + if (rc == ENOENT) + return (rc); + goto fail2; + } evvp->evv_length = length; memcpy(evvp->evv_value, data + offset, length); From owner-svn-src-all@freebsd.org Mon May 16 06:30:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86AAFB3D303; Mon, 16 May 2016 06:30:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB521300; Mon, 16 May 2016 06:30:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6UPHG060682; Mon, 16 May 2016 06:30:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6UPei060681; Mon, 16 May 2016 06:30:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605160630.u4G6UPei060681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 06:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299902 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:30:26 -0000 Author: avg Date: Mon May 16 06:30:25 2016 New Revision: 299902 URL: https://svnweb.freebsd.org/changeset/base/299902 Log: mount_snapshot: consolidate all error handling This makes sure that the original vnode is always unlocked and released if any error happens. MFC after: 4 weeks Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon May 16 06:26:18 2016 (r299901) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon May 16 06:30:25 2016 (r299902) @@ -121,34 +121,39 @@ mount_snapshot(kthread_t *td, vnode_t ** struct ucred *cr; int error; + ASSERT_VOP_ELOCKED(*vpp, "mount_snapshot"); + + vp = *vpp; + *vpp = NULL; + error = 0; + /* * Be ultra-paranoid about making sure the type and fspath * variables will fit in our mp buffers, including the * terminating NUL. */ if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN) - return (ENAMETOOLONG); - - vfsp = vfs_byname_kld(fstype, td, &error); - if (vfsp == NULL) - return (ENODEV); - - vp = *vpp; - if (vp->v_type != VDIR) - return (ENOTDIR); + error = ENAMETOOLONG; + if (error == 0 && (vfsp = vfs_byname_kld(fstype, td, &error)) == NULL) + error = ENODEV; + if (error == 0 && vp->v_type != VDIR) + error = ENOTDIR; /* * We need vnode lock to protect v_mountedhere and vnode interlock * to protect v_iflag. */ - vn_lock(vp, LK_SHARED | LK_RETRY); - VI_LOCK(vp); - if ((vp->v_iflag & VI_MOUNT) != 0 || vp->v_mountedhere != NULL) { + if (error == 0) { + VI_LOCK(vp); + if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL) + vp->v_iflag |= VI_MOUNT; + else + error = EBUSY; VI_UNLOCK(vp); - VOP_UNLOCK(vp, 0); - return (EBUSY); } - vp->v_iflag |= VI_MOUNT; - VI_UNLOCK(vp); + if (error != 0) { + vput(vp); + return (error); + } VOP_UNLOCK(vp, 0); /* @@ -198,7 +203,6 @@ mount_snapshot(kthread_t *td, vnode_t ** vfs_unbusy(mp); vfs_freeopts(mp->mnt_optnew); vfs_mount_destroy(mp); - *vpp = NULL; return (error); } From owner-svn-src-all@freebsd.org Mon May 16 06:30:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF030B3D34C; Mon, 16 May 2016 06:30:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::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 87C0B169E; Mon, 16 May 2016 06:30:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id f89so198480787ioi.0; Sun, 15 May 2016 23:30:44 -0700 (PDT) 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=zZeJAe3UrADNb6ZaIfnJLHcQ4BfZfF38KRT0mye1rro=; b=y9k66Vn5yneANCojSJ30JCBEqiYz4+j2F+F8xJHba7YIPnqVJN7McCbaHwzjAGGTOL T9i/H+MgaHT+p1DneIknJYpwUdtfI7N+REAFrm+hBrCCCc2+PJC3BTJPUKi7VdiW0vfc 6dNELP4M49T8NYQZEip/jh9glCRGfXksUfzgkF7r1szhvDaOgQOk6rX5Rw4XOpdTgSgU Rhk4Esu5rz53y9lQWMPp09cDD+dxMLdhmcZ/5nA/nPoAYQb4co61cXJUHDWrJreb/iXa 4z89/mZg2ULPBBFX8UvnaRcAAU0h5WHPO9QL/t1k+io/6j5d2o7Q5hsBYNtCSvBW2Twf sOfg== 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=zZeJAe3UrADNb6ZaIfnJLHcQ4BfZfF38KRT0mye1rro=; b=cw6zdAr9w64GC8MyGu9c8zMS6VorgVacAt5AjIm1u9g2lLd6JiDIqXeKSH0mieuUrF OeEZ16fEM77hAi9SS/Skt8EoqKnEwVz28bEoxG8/iu8GBF1slUHakvipZzEFrn/Mo1i7 k3GCrruPSzYKwy+OU5Ki5UHKJKZDznrqqpBB2NxgKzI7TpWFzVfmsZxJKiNj756Vu7s7 pjoML8IjN2+9LIauGmCYK7g/siMF+GHcI5GvLnQBkvkVNjKrE6L16fVUfBxyA6wqHLk/ rYTES8u4lK2kRpLzQjYyuI60HKpCXBR5YHsh/CAidrYfxbcwXmj1SgovVF/Qrhbq3iDO qoSg== X-Gm-Message-State: AOPr4FX9PTEuzj+wwmVSjhmjEkPM4eslK36FiV1smFvCWUMjn9RbK60GG4Of7gK1UNSyjQ== X-Received: by 10.107.131.136 with SMTP id n8mr18722374ioi.132.1463380244041; Sun, 15 May 2016 23:30:44 -0700 (PDT) Received: from [192.168.20.14] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id e101sm10238774iod.29.2016.05.15.23.30.43 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 May 2016 23:30:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r299850 - in head/usr.bin/xinstall: . tests From: NGie Cooper X-Mailer: iPhone Mail (13E238) In-Reply-To: <201605151317.u4FDH6Ma038967@repo.freebsd.org> Date: Sun, 15 May 2016 23:30:42 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <74BD0EA9-0DE6-4253-8C2A-43B341F1E2F9@gmail.com> References: <201605151317.u4FDH6Ma038967@repo.freebsd.org> To: Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:30:44 -0000 > On May 15, 2016, at 06:17, Jilles Tjoelker wrote: >=20 > Author: jilles > Date: Sun May 15 13:17:05 2016 > New Revision: 299850 > URL: https://svnweb.freebsd.org/changeset/base/299850 >=20 > Log: > install: When preserving timestamps, also copy the nanoseconds part. >=20 > Modified: > head/usr.bin/xinstall/tests/install_test.sh > head/usr.bin/xinstall/xinstall.c This broke bootstrapping on stable/10, as seen with the recent Jenkins failu= res. > Modified: head/usr.bin/xinstall/tests/install_test.sh > =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/usr.bin/xinstall/tests/install_test.sh Sun May 15 08:36:12 201= 6 (r299849) > +++ head/usr.bin/xinstall/tests/install_test.sh Sun May 15 13:17:05 201= 6 (r299850) > @@ -64,6 +64,12 @@ copy_to_nonexistent_backup_safe_body() { > copy_to_nonexistent_with_opts -b -B.bak -S > } >=20 > +atf_test_case copy_to_nonexistent_preserving > +copy_to_nonexistent_preserving_body() { > + copy_to_nonexistent_with_opts -p > + [ ! testf -ot copyf ] || atf_fail "bad timestamp 2" > +} > + > copy_self_with_opts() { > printf 'test\n123\r456\r\n789\0z' >testf > printf 'test\n123\r456\r\n789\0z' >testf2 > @@ -307,6 +313,7 @@ atf_init_test_cases() { > atf_add_test_case copy_to_nonexistent_safe_comparing > atf_add_test_case copy_to_nonexistent_backup > atf_add_test_case copy_to_nonexistent_backup_safe > + atf_add_test_case copy_to_nonexistent_preserving > atf_add_test_case copy_self > atf_add_test_case copy_self_safe > atf_add_test_case copy_self_comparing >=20 > Modified: head/usr.bin/xinstall/xinstall.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/usr.bin/xinstall/xinstall.c Sun May 15 08:36:12 2016 (r2998= 49) > +++ head/usr.bin/xinstall/xinstall.c Sun May 15 13:17:05 2016 (r2998= 50) > @@ -131,7 +131,7 @@ static void do_symlink(const char *, con > static void makelink(const char *, const char *, const struct stat *); > static void install(const char *, const char *, u_long, u_int); > static void install_dir(char *); > -static void metadata_log(const char *, const char *, struct timeval *,= > +static void metadata_log(const char *, const char *, struct timespec *= , > const char *, const char *, off_t); > static int parseid(const char *, id_t *); > static void strip(const char *); > @@ -722,7 +722,7 @@ static void > install(const char *from_name, const char *to_name, u_long fset, u_int fla= gs) > { > struct stat from_sb, temp_sb, to_sb; > - struct timeval tvb[2]; > + struct timespec tsb[2]; > int devnull, files_match, from_fd, serrno, target; > int tempcopy, temp_fd, to_fd; > char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN];= > @@ -857,11 +857,9 @@ install(const char *from_name, const cha > * Need to preserve target file times, though. > */ > if (to_sb.st_nlink !=3D 1) { > - tvb[0].tv_sec =3D to_sb.st_atime; > - tvb[0].tv_usec =3D 0; > - tvb[1].tv_sec =3D to_sb.st_mtime; > - tvb[1].tv_usec =3D 0; > - (void)utimes(tempfile, tvb); > + tsb[0] =3D to_sb.st_atim; > + tsb[1] =3D to_sb.st_mtim; > + (void)utimensat(AT_FDCWD, tempfile, tsb, 0); > } else { > files_match =3D 1; > (void)unlink(tempfile); > @@ -916,11 +914,9 @@ install(const char *from_name, const cha > * Preserve the timestamp of the source file if necessary. > */ > if (dopreserve && !files_match && !devnull) { > - tvb[0].tv_sec =3D from_sb.st_atime; > - tvb[0].tv_usec =3D 0; > - tvb[1].tv_sec =3D from_sb.st_mtime; > - tvb[1].tv_usec =3D 0; > - (void)utimes(to_name, tvb); > + tsb[0] =3D from_sb.st_atim; > + tsb[1] =3D from_sb.st_mtim; > + (void)utimensat(AT_FDCWD, to_name, tsb, 0); > } >=20 > if (fstat(to_fd, &to_sb) =3D=3D -1) { > @@ -989,7 +985,7 @@ install(const char *from_name, const cha > if (!devnull) > (void)close(from_fd); >=20 > - metadata_log(to_name, "file", tvb, NULL, digestresult, to_sb.st_size)= ; > + metadata_log(to_name, "file", tsb, NULL, digestresult, to_sb.st_size)= ; > free(digestresult); > } >=20 > @@ -1301,7 +1297,7 @@ again: > * or to allow integrity checks to be performed. > */ > static void > -metadata_log(const char *path, const char *type, struct timeval *tv, > +metadata_log(const char *path, const char *type, struct timespec *ts, > const char *slink, const char *digestresult, off_t size) > { > static const char extra[] =3D { ' ', '\t', '\n', '\\', '#', '\0' }; > @@ -1355,9 +1351,9 @@ metadata_log(const char *path, const cha > } > if (*type =3D=3D 'f') /* type=3Dfile */ > fprintf(metafp, " size=3D%lld", (long long)size); > - if (tv !=3D NULL && dopreserve) > - fprintf(metafp, " time=3D%lld.%ld", > - (long long)tv[1].tv_sec, (long)tv[1].tv_usec); > + if (ts !=3D NULL && dopreserve) > + fprintf(metafp, " time=3D%lld.%09ld", > + (long long)ts[1].tv_sec, ts[1].tv_nsec); > if (digestresult && digest) > fprintf(metafp, " %s=3D%s", digest, digestresult); > if (fflags) >=20 From owner-svn-src-all@freebsd.org Mon May 16 06:32:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0171EB3D3BA; Mon, 16 May 2016 06:32:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD367194B; Mon, 16 May 2016 06:32:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6W6uB062742; Mon, 16 May 2016 06:32:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6W6Y5062741; Mon, 16 May 2016 06:32:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160632.u4G6W6Y5062741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299903 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:32:08 -0000 Author: arybchik Date: Mon May 16 06:32:06 2016 New Revision: 299903 URL: https://svnweb.freebsd.org/changeset/base/299903 Log: sfxge(4): cleanup: make TLV scans quieter Find end of segments in a more direct way that avoids an error report at the terminator. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6367 Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Mon May 16 06:30:25 2016 (r299902) +++ head/sys/dev/sfxge/common/ef10_nvram.c Mon May 16 06:32:06 2016 (r299903) @@ -901,6 +901,7 @@ ef10_nvram_buffer_find_end( // Read to end of partition tlv_cursor_t cursor; efx_rc_t rc; + uint32_t *segment_used; if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, buffer_size)) != 0) { @@ -908,10 +909,31 @@ ef10_nvram_buffer_find_end( goto fail1; } - if ((rc = tlv_require_end(&cursor)) != 0) - goto fail2; + segment_used = cursor.block; - *endp = byte_offset(tlv_last_segment_end(&cursor)+1, cursor.block); + /* + * Go through each segment and check that it has an end tag. If there + * is no end tag then the previous segment was the last valid one, + * so return the used space including that end tag. + */ + while (tlv_tag(&cursor) == TLV_TAG_PARTITION_HEADER) { + if (tlv_require_end(&cursor) != 0) { + if (segment_used == cursor.block) { + /* + * First segment is corrupt, so there is + * no valid data in partition. + */ + rc = EINVAL; + goto fail2; + } + break; + } + segment_used = cursor.end + 1; + + cursor.current = segment_used; + } + /* Return space used (including the END tag) */ + *endp = (segment_used - cursor.block) * sizeof (uint32_t); return (0); From owner-svn-src-all@freebsd.org Mon May 16 06:38:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29B8AB3D6CA; Mon, 16 May 2016 06:38:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA61E1DC9; Mon, 16 May 2016 06:38:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6cqXV063765; Mon, 16 May 2016 06:38:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6cp4M063758; Mon, 16 May 2016 06:38:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160638.u4G6cp4M063758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299904 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:38:53 -0000 Author: arybchik Date: Mon May 16 06:38:51 2016 New Revision: 299904 URL: https://svnweb.freebsd.org/changeset/base/299904 Log: sfxge(4): improve PCIe link speed and width check Perform a more accurate check of whether the PCIe bandwidth is sufficient for the current/supported port modes. Give a different warning if there is sufficient bandwidth to achieve line rate, but the link is not fast enough for optimal latency. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6369 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Mon May 16 06:32:06 2016 (r299903) +++ head/sys/dev/sfxge/common/ef10_impl.h Mon May 16 06:38:51 2016 (r299904) @@ -1035,7 +1035,13 @@ efx_mcdi_get_port_assignment( extern __checkReturn efx_rc_t efx_mcdi_get_port_modes( __in efx_nic_t *enp, - __out uint32_t *modesp); + __out uint32_t *modesp, + __out_opt uint32_t *current_modep); + +extern __checkReturn efx_rc_t +ef10_nic_get_port_mode_bandwidth( + __in uint32_t port_mode, + __out uint32_t *bandwidth_mbpsp); extern __checkReturn efx_rc_t efx_mcdi_get_mac_address_pf( Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Mon May 16 06:32:06 2016 (r299903) +++ head/sys/dev/sfxge/common/ef10_nic.c Mon May 16 06:38:51 2016 (r299904) @@ -88,7 +88,8 @@ fail1: __checkReturn efx_rc_t efx_mcdi_get_port_modes( __in efx_nic_t *enp, - __out uint32_t *modesp) + __out uint32_t *modesp, + __out_opt uint32_t *current_modep) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_PORT_MODES_IN_LEN, @@ -113,19 +114,31 @@ efx_mcdi_get_port_modes( } /* - * Require only Modes and DefaultMode fields. - * (CurrentMode field was added for Medford) + * Require only Modes and DefaultMode fields, unless the current mode + * was requested (CurrentMode field was added for Medford). */ if (req.emr_out_length_used < MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST) { rc = EMSGSIZE; goto fail2; } + if ((current_modep != NULL) && (req.emr_out_length_used < + MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST + 4)) { + rc = EMSGSIZE; + goto fail3; + } *modesp = MCDI_OUT_DWORD(req, GET_PORT_MODES_OUT_MODES); + if (current_modep != NULL) { + *current_modep = MCDI_OUT_DWORD(req, + GET_PORT_MODES_OUT_CURRENT_MODE); + } + return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: @@ -134,6 +147,50 @@ fail1: return (rc); } + __checkReturn efx_rc_t +ef10_nic_get_port_mode_bandwidth( + __in uint32_t port_mode, + __out uint32_t *bandwidth_mbpsp) +{ + uint32_t bandwidth; + efx_rc_t rc; + + switch (port_mode) { + case TLV_PORT_MODE_10G: + bandwidth = 10000; + break; + case TLV_PORT_MODE_10G_10G: + bandwidth = 10000 * 2; + break; + case TLV_PORT_MODE_10G_10G_10G_10G: + case TLV_PORT_MODE_10G_10G_10G_10G_Q: + case TLV_PORT_MODE_10G_10G_10G_10G_Q2: + bandwidth = 10000 * 4; + break; + case TLV_PORT_MODE_40G: + bandwidth = 40000; + break; + case TLV_PORT_MODE_40G_40G: + bandwidth = 40000 * 2; + break; + case TLV_PORT_MODE_40G_10G_10G: + case TLV_PORT_MODE_10G_10G_40G: + bandwidth = 40000 + (10000 * 2); + break; + default: + rc = EINVAL; + goto fail1; + } + + *bandwidth_mbpsp = bandwidth; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} static __checkReturn efx_rc_t efx_mcdi_vadaptor_alloc( @@ -1090,7 +1147,7 @@ ef10_external_port_mapping( uint32_t matches; uint32_t stride = 1; /* default 1-1 mapping */ - if ((rc = efx_mcdi_get_port_modes(enp, &port_modes)) != 0) { + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, NULL)) != 0) { /* No port mode information available - use default mapping */ goto out; } Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon May 16 06:32:06 2016 (r299903) +++ head/sys/dev/sfxge/common/efx.h Mon May 16 06:38:51 2016 (r299904) @@ -173,6 +173,30 @@ extern void efx_nic_destroy( __in efx_nic_t *enp); +#define EFX_PCIE_LINK_SPEED_GEN1 1 +#define EFX_PCIE_LINK_SPEED_GEN2 2 +#define EFX_PCIE_LINK_SPEED_GEN3 3 + +typedef enum efx_pcie_link_performance_e { + EFX_PCIE_LINK_PERFORMANCE_UNKNOWN_BANDWIDTH, + EFX_PCIE_LINK_PERFORMANCE_SUBOPTIMAL_BANDWIDTH, + EFX_PCIE_LINK_PERFORMANCE_SUBOPTIMAL_LATENCY, + EFX_PCIE_LINK_PERFORMANCE_OPTIMAL +} efx_pcie_link_performance_t; + +extern __checkReturn efx_rc_t +efx_nic_calculate_pcie_link_bandwidth( + __in uint32_t pcie_link_width, + __in uint32_t pcie_link_gen, + __out uint32_t *bandwidth_mbpsp); + +extern __checkReturn efx_rc_t +efx_nic_check_pcie_link_speed( + __in efx_nic_t *enp, + __in uint32_t pcie_link_width, + __in uint32_t pcie_link_gen, + __out efx_pcie_link_performance_t *resultp); + #if EFSYS_OPT_MCDI #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD @@ -1116,6 +1140,9 @@ typedef struct efx_nic_cfg_s { uint32_t enc_mcdi_max_payload_length; /* VPD may be per-PF or global */ boolean_t enc_vpd_is_global; + /* Minimum unidirectional bandwidth in Mb/s to max out all ports */ + uint32_t enc_required_pcie_bandwidth_mbps; + uint32_t enc_max_pcie_link_gen; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Mon May 16 06:32:06 2016 (r299903) +++ head/sys/dev/sfxge/common/efx_nic.c Mon May 16 06:38:51 2016 (r299904) @@ -964,3 +964,101 @@ fail1: } #endif /* EFSYS_OPT_LOOPBACK */ + + __checkReturn efx_rc_t +efx_nic_calculate_pcie_link_bandwidth( + __in uint32_t pcie_link_width, + __in uint32_t pcie_link_gen, + __out uint32_t *bandwidth_mbpsp) +{ + uint32_t lane_bandwidth; + uint32_t total_bandwidth; + efx_rc_t rc; + + if ((pcie_link_width == 0) || (pcie_link_width > 16) || + !ISP2(pcie_link_width)) { + rc = EINVAL; + goto fail1; + } + + switch (pcie_link_gen) { + case EFX_PCIE_LINK_SPEED_GEN1: + /* 2.5 Gb/s raw bandwidth with 8b/10b encoding */ + lane_bandwidth = 2000; + break; + case EFX_PCIE_LINK_SPEED_GEN2: + /* 5.0 Gb/s raw bandwidth with 8b/10b encoding */ + lane_bandwidth = 4000; + break; + case EFX_PCIE_LINK_SPEED_GEN3: + /* 8.0 Gb/s raw bandwidth with 128b/130b encoding */ + lane_bandwidth = 7877; + break; + default: + rc = EINVAL; + goto fail2; + } + + total_bandwidth = lane_bandwidth * pcie_link_width; + *bandwidth_mbpsp = total_bandwidth; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + + __checkReturn efx_rc_t +efx_nic_check_pcie_link_speed( + __in efx_nic_t *enp, + __in uint32_t pcie_link_width, + __in uint32_t pcie_link_gen, + __out efx_pcie_link_performance_t *resultp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t bandwidth; + efx_pcie_link_performance_t result; + efx_rc_t rc; + + if ((encp->enc_required_pcie_bandwidth_mbps == 0) || + (pcie_link_width == 0) || (pcie_link_width == 32) || + (pcie_link_gen == 0)) { + /* + * No usable info on what is required and/or in use. In virtual + * machines, sometimes the PCIe link width is reported as 0 or + * 32, or the speed as 0. + */ + result = EFX_PCIE_LINK_PERFORMANCE_UNKNOWN_BANDWIDTH; + goto out; + } + + /* Calculate the available bandwidth in megabits per second */ + rc = efx_nic_calculate_pcie_link_bandwidth(pcie_link_width, + pcie_link_gen, &bandwidth); + if (rc != 0) + goto fail1; + + if (bandwidth < encp->enc_required_pcie_bandwidth_mbps) { + result = EFX_PCIE_LINK_PERFORMANCE_SUBOPTIMAL_BANDWIDTH; + } else if (pcie_link_gen < encp->enc_max_pcie_link_gen) { + /* The link provides enough bandwidth but not optimal latency */ + result = EFX_PCIE_LINK_PERFORMANCE_SUBOPTIMAL_LATENCY; + } else { + result = EFX_PCIE_LINK_PERFORMANCE_OPTIMAL; + } + +out: + *resultp = result; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Mon May 16 06:32:06 2016 (r299903) +++ head/sys/dev/sfxge/common/hunt_nic.c Mon May 16 06:38:51 2016 (r299904) @@ -39,6 +39,65 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON +#include "ef10_tlv_layout.h" + +static __checkReturn efx_rc_t +hunt_nic_get_required_pcie_bandwidth( + __in efx_nic_t *enp, + __out uint32_t *bandwidth_mbpsp) +{ + uint32_t port_modes; + uint32_t max_port_mode; + uint32_t bandwidth; + efx_rc_t rc; + + /* + * On Huntington, the firmware may not give us the current port mode, so + * we need to go by the set of available port modes and assume the most + * capable mode is in use. + */ + + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, NULL)) != 0) { + /* No port mode info available */ + bandwidth = 0; + goto out; + } + + if (port_modes & (1 << TLV_PORT_MODE_40G_40G)) { + /* + * This needs the full PCIe bandwidth (and could use + * more) - roughly 64 Gbit/s for 8 lanes of Gen3. + */ + if ((rc = efx_nic_calculate_pcie_link_bandwidth(8, + EFX_PCIE_LINK_SPEED_GEN3, &bandwidth)) != 0) + goto fail1; + } else { + if (port_modes & (1 << TLV_PORT_MODE_40G)) { + max_port_mode = TLV_PORT_MODE_40G; + } else if (port_modes & (1 << TLV_PORT_MODE_10G_10G_10G_10G)) { + max_port_mode = TLV_PORT_MODE_10G_10G_10G_10G; + } else { + /* Assume two 10G ports */ + max_port_mode = TLV_PORT_MODE_10G_10G; + } + + if ((rc = ef10_nic_get_port_mode_bandwidth(max_port_mode, + &bandwidth)) != 0) + goto fail2; + } + +out: + *bandwidth_mbpsp = bandwidth; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} __checkReturn efx_rc_t hunt_board_cfg( @@ -57,6 +116,7 @@ hunt_board_cfg( uint32_t flags; uint32_t sysclk; uint32_t base, nvec; + uint32_t bandwidth; efx_rc_t rc; if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) @@ -286,8 +346,17 @@ hunt_board_cfg( */ encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) + goto fail15; + encp->enc_required_pcie_bandwidth_mbps = bandwidth; + + /* All Huntington devices have a PCIe Gen3, 8 lane connector */ + encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; + return (0); +fail15: + EFSYS_PROBE(fail15); fail14: EFSYS_PROBE(fail14); fail13: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Mon May 16 06:32:06 2016 (r299903) +++ head/sys/dev/sfxge/common/medford_nic.c Mon May 16 06:38:51 2016 (r299904) @@ -95,6 +95,38 @@ fail1: return (rc); } +static __checkReturn efx_rc_t +medford_nic_get_required_pcie_bandwidth( + __in efx_nic_t *enp, + __out uint32_t *bandwidth_mbpsp) +{ + uint32_t port_modes; + uint32_t current_mode; + uint32_t bandwidth; + efx_rc_t rc; + + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, + ¤t_mode)) != 0) { + /* No port mode info available. */ + bandwidth = 0; + goto out; + } + + if ((rc = ef10_nic_get_port_mode_bandwidth(current_mode, + &bandwidth)) != 0) + goto fail1; + +out: + *bandwidth_mbpsp = bandwidth; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t medford_board_cfg( __in efx_nic_t *enp) @@ -112,6 +144,7 @@ medford_board_cfg( uint32_t sysclk; uint32_t base, nvec; uint32_t end_padding; + uint32_t bandwidth; efx_rc_t rc; /* @@ -275,8 +308,16 @@ medford_board_cfg( */ encp->enc_vpd_is_global = B_TRUE; + rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); + if (rc != 0) + goto fail13; + encp->enc_required_pcie_bandwidth_mbps = bandwidth; + encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; + return (0); +fail13: + EFSYS_PROBE(fail13); fail12: EFSYS_PROBE(fail12); fail11: Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Mon May 16 06:32:06 2016 (r299903) +++ head/sys/dev/sfxge/common/siena_nic.c Mon May 16 06:38:51 2016 (r299904) @@ -150,6 +150,10 @@ siena_board_cfg( encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; encp->enc_allow_set_mac_with_installed_filters = B_TRUE; + /* Siena supports two 10G ports, and 8 lanes of PCIe Gen2 */ + encp->enc_required_pcie_bandwidth_mbps = 2 * 10000; + encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN2; + return (0); fail2: From owner-svn-src-all@freebsd.org Mon May 16 06:40:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B50B4B3D737; Mon, 16 May 2016 06:40:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 860191F44; Mon, 16 May 2016 06:40:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6eHH2063867; Mon, 16 May 2016 06:40:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6eHDs063866; Mon, 16 May 2016 06:40:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160640.u4G6eHDs063866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299905 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:40:18 -0000 Author: arybchik Date: Mon May 16 06:40:17 2016 New Revision: 299905 URL: https://svnweb.freebsd.org/changeset/base/299905 Log: sfxge(4): fix V1 licensing MCDI operations Implementation of the MCDI commands for Siena boards was requesting the wrong operation. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6370 Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Mon May 16 06:38:51 2016 (r299904) +++ head/sys/dev/sfxge/common/efx_lic.c Mon May 16 06:40:17 2016 (r299905) @@ -349,12 +349,15 @@ efx_mcdi_fc_license_update_license( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_FC_OP_LICENSE; + req.emr_cmd = MC_CMD_FC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; req.emr_out_buf = payload; req.emr_out_length = 0; + MCDI_IN_SET_DWORD(req, FC_IN_CMD, + MC_CMD_FC_OP_LICENSE); + MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP, MC_CMD_FC_IN_LICENSE_UPDATE_LICENSE); @@ -393,12 +396,15 @@ efx_mcdi_fc_license_get_key_stats( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_FC_OP_LICENSE; + req.emr_cmd = MC_CMD_FC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; req.emr_out_buf = payload; req.emr_out_length = MC_CMD_FC_OUT_LICENSE_LEN; + MCDI_IN_SET_DWORD(req, FC_IN_CMD, + MC_CMD_FC_OP_LICENSE); + MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP, MC_CMD_FC_IN_LICENSE_GET_KEY_STATS); From owner-svn-src-all@freebsd.org Mon May 16 06:40:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42ED4B3D77E; Mon, 16 May 2016 06:40:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC117110A; Mon, 16 May 2016 06:40:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6eqH6063932; Mon, 16 May 2016 06:40:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6eqtT063931; Mon, 16 May 2016 06:40:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605160640.u4G6eqtT063931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 06:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299906 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:40:53 -0000 Author: avg Date: Mon May 16 06:40:51 2016 New Revision: 299906 URL: https://svnweb.freebsd.org/changeset/base/299906 Log: add zfs_vptocnp with special handling for snapshots under .zfs The logic is similar to that already present in zfs_dirlook() to handle a dot-dot lookup on a root vnode of a snapshot mounted under .zfs/snapshot/. illumos does not have an equivalent of vop_vptocnp, so there only the lookup had to be patched up. MFC after: 4 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon May 16 06:40:17 2016 (r299905) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon May 16 06:40:51 2016 (r299906) @@ -7160,6 +7160,44 @@ zfs_freebsd_aclcheck(ap) return (EOPNOTSUPP); } +static int +zfs_vptocnp(struct vop_vptocnp_args *ap) +{ + vnode_t *covered_vp; + vnode_t *vp = ap->a_vp;; + zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data; + znode_t *zp = VTOZ(vp); + uint64_t parent; + int ltype; + int error; + + /* + * If we are a snapshot mounted under .zfs, run the operation + * on the covered vnode. + */ + if ((error = sa_lookup(zp->z_sa_hdl, + SA_ZPL_PARENT(zfsvfs), &parent, sizeof (parent))) != 0) + return (error); + + if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) + return (vop_stdvptocnp(ap)); + + covered_vp = vp->v_mount->mnt_vnodecovered; + vhold(covered_vp); + ltype = VOP_ISLOCKED(vp); + VOP_UNLOCK(vp, 0); + error = vget(covered_vp, LK_EXCLUSIVE | LK_VNHELD, curthread); + if (error == 0) { + error = VOP_VPTOCNP(covered_vp, ap->a_vpp, ap->a_cred, + ap->a_buf, ap->a_buflen); + vput(covered_vp); + } + vn_lock(vp, ltype | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) + error = SET_ERROR(ENOENT); + return (error); +} + struct vop_vector zfs_vnodeops; struct vop_vector zfs_fifoops; struct vop_vector zfs_shareops; @@ -7205,6 +7243,7 @@ struct vop_vector zfs_vnodeops = { .vop_aclcheck = zfs_freebsd_aclcheck, .vop_getpages = zfs_freebsd_getpages, .vop_putpages = zfs_freebsd_putpages, + .vop_vptocnp = zfs_vptocnp, }; struct vop_vector zfs_fifoops = { From owner-svn-src-all@freebsd.org Mon May 16 06:42:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89059B3D8E6; Mon, 16 May 2016 06:42:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA541488; Mon, 16 May 2016 06:42:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6gjG0066622; Mon, 16 May 2016 06:42:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6gjHY066621; Mon, 16 May 2016 06:42:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160642.u4G6gjHY066621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299907 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:42:46 -0000 Author: arybchik Date: Mon May 16 06:42:45 2016 New Revision: 299907 URL: https://svnweb.freebsd.org/changeset/base/299907 Log: sfxge(4): increase maximum size of license keys Increase buffer sizes for license keys to 160 bytes to accomodate ECDSA hashes. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Mon May 16 06:40:51 2016 (r299906) +++ head/sys/dev/sfxge/common/efx_lic.c Mon May 16 06:42:45 2016 (r299907) @@ -1102,7 +1102,7 @@ fail1: /* V3 format uses Huntington TLV format partition. See SF-108797-SW */ #define EFX_LICENSE_V3_KEY_LENGTH_MIN (64) -#define EFX_LICENSE_V3_KEY_LENGTH_MAX (128) +#define EFX_LICENSE_V3_KEY_LENGTH_MAX (160) #define EFX_LICENSE_V3_HASH_LENGTH (64) __checkReturn efx_rc_t From owner-svn-src-all@freebsd.org Mon May 16 06:49:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0A8CB3DA6B; Mon, 16 May 2016 06:49:10 +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 BFE21195B; Mon, 16 May 2016 06:49:10 +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 u4G6n9RA067013; Mon, 16 May 2016 06:49:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6n9uO067012; Mon, 16 May 2016 06:49:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605160649.u4G6n9uO067012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 06:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299908 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:49:11 -0000 Author: avg Date: Mon May 16 06:49:09 2016 New Revision: 299908 URL: https://svnweb.freebsd.org/changeset/base/299908 Log: zfsctl_snapdir_lookup: always clear VV_ROOT flag of snapshot's root VV_ROOT Previosuly we did that only if the snapshot was mounted earlier, its root vnode got recycled and then we accessed it again. We never cleared the flag for a freshly mounted snapshot. That was very inconsistent and probably a source of some bugs. Or maybe that painted over some bugs which might get revealed now. We should consistently clear the flag because we try very hard to pretend that snapshots auto-mounted under .zfs are part of their original filesystem. In other words, we try to hide the fact that they are different filesystems / mountpoints. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 06:42:45 2016 (r299907) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 06:49:09 2016 (r299908) @@ -1098,6 +1098,7 @@ domount: */ ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs); VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs; + (*vpp)->v_flag &= ~VROOT; } mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); From owner-svn-src-all@freebsd.org Mon May 16 06:59:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36B86B3DC6A; Mon, 16 May 2016 06:59:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E53641E42; Mon, 16 May 2016 06:59:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G6xCak069980; Mon, 16 May 2016 06:59:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G6xCNg069979; Mon, 16 May 2016 06:59:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160659.u4G6xCNg069979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 06:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299909 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 06:59:13 -0000 Author: arybchik Date: Mon May 16 06:59:12 2016 New Revision: 299909 URL: https://svnweb.freebsd.org/changeset/base/299909 Log: sfxge(4): regenerate MCDI headers from firmwaresrc .yml Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Mon May 16 06:49:09 2016 (r299908) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Mon May 16 06:59:12 2016 (r299909) @@ -721,6 +721,12 @@ #define FCDI_EVENT_CODE_PTP_STATUS 0x9 /* enum: Port id config to map MC-FC port idx */ #define FCDI_EVENT_CODE_PORT_CONFIG 0xa +/* enum: Boot result or error code */ +#define FCDI_EVENT_CODE_BOOT_RESULT 0xb +#define FCDI_EVENT_REBOOT_SRC_LBN 36 +#define FCDI_EVENT_REBOOT_SRC_WIDTH 8 +#define FCDI_EVENT_REBOOT_FC_FW 0x0 /* enum */ +#define FCDI_EVENT_REBOOT_FC_BOOTLOADER 0x1 /* enum */ #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0 #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0 #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32 @@ -752,6 +758,11 @@ #define FCDI_EVENT_PORT_CONFIG_DATA_OFST 0 #define FCDI_EVENT_PORT_CONFIG_DATA_LBN 0 #define FCDI_EVENT_PORT_CONFIG_DATA_WIDTH 32 +#define FCDI_EVENT_BOOT_RESULT_OFST 0 +/* Enum values, see field(s): */ +/* MC_CMD_AOE/MC_CMD_AOE_OUT_INFO/FC_BOOT_RESULT */ +#define FCDI_EVENT_BOOT_RESULT_LBN 0 +#define FCDI_EVENT_BOOT_RESULT_WIDTH 32 /* FCDI_EXTENDED_EVENT_PPS structuredef: Extended FCDI event to send PPS events * to the MC. Note that this structure | is overlaid over a normal FCDI event @@ -3350,6 +3361,8 @@ #define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_CHECKSUM 0x4 /* enum: Bad BSP */ #define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_BSP 0x5 +/* enum: Flash mode is invalid */ +#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_INVALID_FLASH_MODE 0x6 /* enum: FC application loaded and execution attempted */ #define MC_CMD_AOE_OUT_INFO_FC_BOOT_APP_EXECUTE 0x80 /* enum: FC application Started */ @@ -5480,6 +5493,14 @@ /* MC_CMD_SET_MAC_OUT msgresponse */ #define MC_CMD_SET_MAC_OUT_LEN 0 +/* MC_CMD_SET_MAC_V2_OUT msgresponse */ +#define MC_CMD_SET_MAC_V2_OUT_LEN 4 +/* MTU as configured after processing the request. See comment at + * MC_CMD_SET_MAC_IN/MTU. To query MTU without doing any changes, set CONTROL + * to 0. + */ +#define MC_CMD_SET_MAC_V2_OUT_MTU_OFST 0 + /***********************************/ /* MC_CMD_PHY_STATS @@ -6552,6 +6573,10 @@ #define MC_CMD_SENSOR_PHY1_VCC 0x4d /* enum: Controller die temperature (TDIODE): degC */ #define MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP 0x4e +/* enum: Board temperature (front): degC */ +#define MC_CMD_SENSOR_BOARD_FRONT_TEMP 0x4f +/* enum: Board temperature (back): degC */ +#define MC_CMD_SENSOR_BOARD_BACK_TEMP 0x50 /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */ #define MC_CMD_SENSOR_ENTRY_OFST 4 #define MC_CMD_SENSOR_ENTRY_LEN 8 @@ -7904,6 +7929,8 @@ #define LICENSED_FEATURES_TX_SNIFF_WIDTH 1 #define LICENSED_FEATURES_PROXY_FILTER_OPS_LBN 8 #define LICENSED_FEATURES_PROXY_FILTER_OPS_WIDTH 1 +#define LICENSED_FEATURES_EVENT_CUT_THROUGH_LBN 9 +#define LICENSED_FEATURES_EVENT_CUT_THROUGH_WIDTH 1 #define LICENSED_FEATURES_MASK_LBN 0 #define LICENSED_FEATURES_MASK_WIDTH 64 @@ -8072,6 +8099,8 @@ #define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_WIDTH 1 #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_LBN 5 #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_IN_FLAG_USE_TIMER_LBN 6 +#define MC_CMD_INIT_EVQ_IN_FLAG_USE_TIMER_WIDTH 1 #define MC_CMD_INIT_EVQ_IN_TMR_MODE_OFST 20 /* enum: Disabled */ #define MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS 0x0 @@ -9197,6 +9226,15 @@ * client */ #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_RESTRICTIONS 0x2 +/* enum: read properties relating to security rules (Medford-only; for use by + * SolarSecure apps, not directly by drivers. See SF-114946-SW.) + */ +#define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SECURITY_RULE_INFO 0x3 +/* enum: read the list of supported RX filter matches for VXLAN/NVGRE + * encapsulated frames, which follow a different match sequence to normal + * frames (Medford only) + */ +#define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_ENCAP_RX_MATCHES 0x4 /* MC_CMD_GET_PARSER_DISP_INFO_OUT msgresponse */ #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMIN 8 @@ -9227,6 +9265,39 @@ #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_LBN 0 #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_WIDTH 1 +/* MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT msgresponse: + * GET_PARSER_DISP_INFO response format for OP_GET_SECURITY_RULE_INFO. + * (Medford-only; for use by SolarSecure apps, not directly by drivers. See + * SF-114946-SW.) NOTE - this message definition is provisional. It has not yet + * been used in any released code and may change during development. This note + * will be removed once it is regarded as stable. + */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_LEN 36 +/* identifies the type of operation requested */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_OP_OFST 0 +/* Enum values, see field(s): */ +/* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */ +/* a version number representing the set of rule lookups that are implemented + * by the currently running firmware + */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_RULES_VERSION_OFST 4 +/* enum: implements lookup sequences described in SF-114946-SW draft C */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_RULES_VERSION_SF_114946_SW_C 0x0 +/* the number of nodes in the subnet map */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_SUBNET_MAP_NUM_NODES_OFST 8 +/* the number of entries in one subnet map node */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_SUBNET_MAP_NUM_ENTRIES_PER_NODE_OFST 12 +/* minimum valid value for a subnet ID in a subnet map leaf */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_SUBNET_ID_MIN_OFST 16 +/* maximum valid value for a subnet ID in a subnet map leaf */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_SUBNET_ID_MAX_OFST 20 +/* the number of entries in the local and remote port range maps */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_PORTRANGE_TREE_NUM_ENTRIES_OFST 24 +/* minimum valid value for a portrange ID in a port range map leaf */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_PORTRANGE_ID_MIN_OFST 28 +/* maximum valid value for a portrange ID in a port range map leaf */ +#define MC_CMD_GET_PARSER_DISP_SECURITY_RULE_INFO_OUT_PORTRANGE_ID_MAX_OFST 32 + /***********************************/ /* MC_CMD_PARSER_DISP_RW @@ -10084,6 +10155,8 @@ #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_TSO_EDIT 0x101 /* enum: TXDP Test firmware image 2 */ #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102 +/* enum: TXDP CSR bus test firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_CSR 0x103 #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_OFST 8 #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_LEN 2 #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_LBN 0 @@ -10162,7 +10235,7 @@ #define MC_CMD_GET_CAPABILITIES_V2_IN_LEN 0 /* MC_CMD_GET_CAPABILITIES_V2_OUT msgresponse */ -#define MC_CMD_GET_CAPABILITIES_V2_OUT_LEN 26 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_LEN 72 /* First word of flags. */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS1_OFST 0 #define MC_CMD_GET_CAPABILITIES_V2_OUT_VPORT_RECONFIGURE_LBN 3 @@ -10267,6 +10340,8 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_TSO_EDIT 0x101 /* enum: TXDP Test firmware image 2 */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102 +/* enum: TXDP CSR bus test firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_CSR 0x103 #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_OFST 8 #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_LEN 2 #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_REV_LBN 0 @@ -10346,11 +10421,67 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_LBN 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVQ_TIMER_CTRL_LBN 2 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVQ_TIMER_CTRL_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_LBN 3 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_LBN 4 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24 #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2 +/* One byte per PF containing the number of the external port assigned to this + * PF, indexed by PF number. Special values indicate that a PF is either not + * present or not assigned. + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16 +/* enum: The caller is not permitted to access information on this PF. */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_ACCESS_NOT_PERMITTED 0xff +/* enum: PF does not exist. */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_PRESENT 0xfe +/* enum: PF does exist but is not assigned to any external port. */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_ASSIGNED 0xfd +/* enum: This value indicates that PF is assigned, but it cannot be expressed + * in this field. It is intended for a possible future situation where a more + * complex scheme of PFs to ports mapping is being used. The future driver + * should look for a new field supporting the new scheme. The current/old + * driver should treat this value as PF_NOT_ASSIGNED. + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc +/* One byte per PF containing the number of its VFs, indexed by PF number. A + * special value indicates that a PF is not present. + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_OFST 42 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_LEN 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_NUM 16 +/* enum: The caller is not permitted to access information on this PF. */ +/* MC_CMD_GET_CAPABILITIES_V2_OUT_ACCESS_NOT_PERMITTED 0xff */ +/* enum: PF does not exist. */ +/* MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_PRESENT 0xfe */ +/* Number of VIs available for each external port */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_OFST 58 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_NUM 4 +/* Size of RX descriptor cache expressed as binary logarithm The actual size + * equals (2 ^ RX_DESC_CACHE_SIZE) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DESC_CACHE_SIZE_OFST 66 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DESC_CACHE_SIZE_LEN 1 +/* Size of TX descriptor cache expressed as binary logarithm The actual size + * equals (2 ^ TX_DESC_CACHE_SIZE) + */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DESC_CACHE_SIZE_OFST 67 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DESC_CACHE_SIZE_LEN 1 +/* Total number of available PIO buffers */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_PIO_BUFFS_OFST 68 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_PIO_BUFFS_LEN 2 +/* Size of a single PIO buffer */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_OFST 70 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_LEN 2 /***********************************/ @@ -13762,4 +13893,661 @@ /* MC_CMD_PREPARE_SIGNED_OUT msgresponse */ #define MC_CMD_PREPARE_SIGNED_OUT_LEN 0 + +/***********************************/ +/* MC_CMD_SET_SECURITY_RULE + * Set blacklist and/or whitelist action for a particular match criteria. + * (Medford-only; for use by SolarSecure apps, not directly by drivers. See + * SF-114946-SW.) NOTE - this message definition is provisional. It has not yet + * been used in any released code and may change during development. This note + * will be removed once it is regarded as stable. + */ +#define MC_CMD_SET_SECURITY_RULE 0x10f +#undef MC_CMD_0x10f_PRIVILEGE_CTG + +#define MC_CMD_0x10f_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_SET_SECURITY_RULE_IN msgrequest */ +#define MC_CMD_SET_SECURITY_RULE_IN_LEN 92 +/* fields to include in match criteria */ +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_FIELDS_OFST 0 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_IP_LBN 0 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_IP_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_IP_LBN 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_IP_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_MAC_LBN 2 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_MAC_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_PORT_LBN 3 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_PORT_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_MAC_LBN 4 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_MAC_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_PORT_LBN 5 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_PORT_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_ETHER_TYPE_LBN 6 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_ETHER_TYPE_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_INNER_VLAN_LBN 7 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_INNER_VLAN_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_OUTER_VLAN_LBN 8 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_OUTER_VLAN_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_IP_PROTO_LBN 9 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_IP_PROTO_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_PHYSICAL_PORT_LBN 10 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_PHYSICAL_PORT_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_RESERVED_LBN 11 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_RESERVED_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_SUBNET_ID_LBN 12 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_SUBNET_ID_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_PORTRANGE_ID_LBN 13 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_REMOTE_PORTRANGE_ID_WIDTH 1 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_PORTRANGE_ID_LBN 14 +#define MC_CMD_SET_SECURITY_RULE_IN_MATCH_LOCAL_PORTRANGE_ID_WIDTH 1 +/* remote MAC address to match (as bytes in network order) */ +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_MAC_OFST 4 +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_MAC_LEN 6 +/* remote port to match (as bytes in network order) */ +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_PORT_OFST 10 +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_PORT_LEN 2 +/* local MAC address to match (as bytes in network order) */ +#define MC_CMD_SET_SECURITY_RULE_IN_LOCAL_MAC_OFST 12 +#define MC_CMD_SET_SECURITY_RULE_IN_LOCAL_MAC_LEN 6 +/* local port to match (as bytes in network order) */ +#define MC_CMD_SET_SECURITY_RULE_IN_LOCAL_PORT_OFST 18 +#define MC_CMD_SET_SECURITY_RULE_IN_LOCAL_PORT_LEN 2 +/* Ethernet type to match (as bytes in network order) */ +#define MC_CMD_SET_SECURITY_RULE_IN_ETHER_TYPE_OFST 20 +#define MC_CMD_SET_SECURITY_RULE_IN_ETHER_TYPE_LEN 2 +/* Inner VLAN tag to match (as bytes in network order) */ +#define MC_CMD_SET_SECURITY_RULE_IN_INNER_VLAN_OFST 22 +#define MC_CMD_SET_SECURITY_RULE_IN_INNER_VLAN_LEN 2 +/* Outer VLAN tag to match (as bytes in network order) */ +#define MC_CMD_SET_SECURITY_RULE_IN_OUTER_VLAN_OFST 24 +#define MC_CMD_SET_SECURITY_RULE_IN_OUTER_VLAN_LEN 2 +/* IP protocol to match (in low byte; set high byte to 0) */ +#define MC_CMD_SET_SECURITY_RULE_IN_IP_PROTO_OFST 26 +#define MC_CMD_SET_SECURITY_RULE_IN_IP_PROTO_LEN 2 +/* Physical port to match (as little-endian 32-bit value) */ +#define MC_CMD_SET_SECURITY_RULE_IN_PHYSICAL_PORT_OFST 28 +/* Reserved; set to 0 */ +#define MC_CMD_SET_SECURITY_RULE_IN_RESERVED_OFST 32 +/* remote IP address to match (as bytes in network order; set last 12 bytes to + * 0 for IPv4 address) + */ +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_IP_OFST 36 +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_IP_LEN 16 +/* local IP address to match (as bytes in network order; set last 12 bytes to 0 + * for IPv4 address) + */ +#define MC_CMD_SET_SECURITY_RULE_IN_LOCAL_IP_OFST 52 +#define MC_CMD_SET_SECURITY_RULE_IN_LOCAL_IP_LEN 16 +/* remote subnet ID to match (as little-endian 32-bit value); note that remote + * subnets are matched by mapping the remote IP address to a "subnet ID" via a + * data structure which must already have been configured using + * MC_CMD_SUBNET_MAP_SET_NODE appropriately + */ +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_SUBNET_ID_OFST 68 +/* remote portrange ID to match (as little-endian 32-bit value); note that + * remote port ranges are matched by mapping the remote port to a "portrange + * ID" via a data structure which must already have been configured using + * MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE + */ +#define MC_CMD_SET_SECURITY_RULE_IN_REMOTE_PORTRANGE_ID_OFST 72 +/* local portrange ID to match (as little-endian 32-bit value); note that local + * port ranges are matched by mapping the local port to a "portrange ID" via a + * data structure which must already have been configured using + * MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE + */ +#define MC_CMD_SET_SECURITY_RULE_IN_LOCAL_PORTRANGE_ID_OFST 76 +/* set the action for transmitted packets matching this rule */ +#define MC_CMD_SET_SECURITY_RULE_IN_TX_ACTION_OFST 80 +/* enum: make no decision */ +#define MC_CMD_SET_SECURITY_RULE_IN_TX_ACTION_NONE 0x0 +/* enum: decide to accept the packet */ +#define MC_CMD_SET_SECURITY_RULE_IN_TX_ACTION_WHITELIST 0x1 +/* enum: decide to drop the packet */ +#define MC_CMD_SET_SECURITY_RULE_IN_TX_ACTION_BLACKLIST 0x2 +/* enum: do not change the current TX action */ +#define MC_CMD_SET_SECURITY_RULE_IN_TX_ACTION_UNCHANGED 0xffffffff +/* set the action for received packets matching this rule */ +#define MC_CMD_SET_SECURITY_RULE_IN_RX_ACTION_OFST 84 +/* enum: make no decision */ +#define MC_CMD_SET_SECURITY_RULE_IN_RX_ACTION_NONE 0x0 +/* enum: decide to accept the packet */ +#define MC_CMD_SET_SECURITY_RULE_IN_RX_ACTION_WHITELIST 0x1 +/* enum: decide to drop the packet */ +#define MC_CMD_SET_SECURITY_RULE_IN_RX_ACTION_BLACKLIST 0x2 +/* enum: do not change the current RX action */ +#define MC_CMD_SET_SECURITY_RULE_IN_RX_ACTION_UNCHANGED 0xffffffff +/* counter ID to associate with this rule; IDs are allocated using + * MC_CMD_SECURITY_RULE_COUNTER_ALLOC + */ +#define MC_CMD_SET_SECURITY_RULE_IN_COUNTER_ID_OFST 88 +/* enum: special value for the null counter ID */ +#define MC_CMD_SET_SECURITY_RULE_IN_COUNTER_ID_NONE 0x0 + +/* MC_CMD_SET_SECURITY_RULE_OUT msgresponse */ +#define MC_CMD_SET_SECURITY_RULE_OUT_LEN 28 +/* new reference count for uses of counter ID */ +#define MC_CMD_SET_SECURITY_RULE_OUT_COUNTER_REFCNT_OFST 0 +/* constructed match bits for this rule (as a tracing aid only) */ +#define MC_CMD_SET_SECURITY_RULE_OUT_LUE_MATCH_BITS_OFST 4 +#define MC_CMD_SET_SECURITY_RULE_OUT_LUE_MATCH_BITS_LEN 12 +/* constructed discriminator bits for this rule (as a tracing aid only) */ +#define MC_CMD_SET_SECURITY_RULE_OUT_LUE_DISCRIMINATOR_OFST 16 +/* base location for probes for this rule (as a tracing aid only) */ +#define MC_CMD_SET_SECURITY_RULE_OUT_LUE_PROBE_BASE_OFST 20 +/* step for probes for this rule (as a tracing aid only) */ +#define MC_CMD_SET_SECURITY_RULE_OUT_LUE_PROBE_STEP_OFST 24 + + +/***********************************/ +/* MC_CMD_RESET_SECURITY_RULES + * Reset all blacklist and whitelist actions for a particular physical port, or + * all ports. (Medford-only; for use by SolarSecure apps, not directly by + * drivers. See SF-114946-SW.) NOTE - this message definition is provisional. + * It has not yet been used in any released code and may change during + * development. This note will be removed once it is regarded as stable. + */ +#define MC_CMD_RESET_SECURITY_RULES 0x110 +#undef MC_CMD_0x110_PRIVILEGE_CTG + +#define MC_CMD_0x110_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_RESET_SECURITY_RULES_IN msgrequest */ +#define MC_CMD_RESET_SECURITY_RULES_IN_LEN 4 +/* index of physical port to reset (or ALL_PHYSICAL_PORTS to reset all) */ +#define MC_CMD_RESET_SECURITY_RULES_IN_PHYSICAL_PORT_OFST 0 +/* enum: special value to reset all physical ports */ +#define MC_CMD_RESET_SECURITY_RULES_IN_ALL_PHYSICAL_PORTS 0xffffffff + +/* MC_CMD_RESET_SECURITY_RULES_OUT msgresponse */ +#define MC_CMD_RESET_SECURITY_RULES_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_GET_SECURITY_RULESET_VERSION + * Return a large hash value representing a "version" of the complete set of + * currently active blacklist / whitelist rules and associated data structures. + * (Medford-only; for use by SolarSecure apps, not directly by drivers. See + * SF-114946-SW.) NOTE - this message definition is provisional. It has not yet + * been used in any released code and may change during development. This note + * will be removed once it is regarded as stable. + */ +#define MC_CMD_GET_SECURITY_RULESET_VERSION 0x111 +#undef MC_CMD_0x111_PRIVILEGE_CTG + +#define MC_CMD_0x111_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_GET_SECURITY_RULESET_VERSION_IN msgrequest */ +#define MC_CMD_GET_SECURITY_RULESET_VERSION_IN_LEN 0 + +/* MC_CMD_GET_SECURITY_RULESET_VERSION_OUT msgresponse */ +#define MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_LENMIN 1 +#define MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_LENMAX 252 +#define MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_LEN(num) (0+1*(num)) +/* Opaque hash value; length may vary depending on the hash scheme used */ +#define MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_VERSION_OFST 0 +#define MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_VERSION_LEN 1 +#define MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_VERSION_MINNUM 1 +#define MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_VERSION_MAXNUM 252 + + +/***********************************/ +/* MC_CMD_SECURITY_RULE_COUNTER_ALLOC + * Allocate counters for use with blacklist / whitelist rules. (Medford-only; + * for use by SolarSecure apps, not directly by drivers. See SF-114946-SW.) + * NOTE - this message definition is provisional. It has not yet been used in + * any released code and may change during development. This note will be + * removed once it is regarded as stable. + */ +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC 0x112 +#undef MC_CMD_0x112_PRIVILEGE_CTG + +#define MC_CMD_0x112_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_SECURITY_RULE_COUNTER_ALLOC_IN msgrequest */ +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_IN_LEN 4 +/* the number of new counter IDs to request */ +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_IN_NUM_COUNTERS_OFST 0 + +/* MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT msgresponse */ +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_LENMIN 4 +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_LENMAX 252 +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_LEN(num) (4+4*(num)) +/* the number of new counter IDs allocated (may be less than the number + * requested if resources are unavailable) + */ +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_NUM_COUNTERS_OFST 0 +/* new counter ID(s) */ +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_COUNTER_ID_OFST 4 +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_COUNTER_ID_LEN 4 +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_COUNTER_ID_MINNUM 0 +#define MC_CMD_SECURITY_RULE_COUNTER_ALLOC_OUT_COUNTER_ID_MAXNUM 62 + + +/***********************************/ +/* MC_CMD_SECURITY_RULE_COUNTER_FREE + * Allocate counters for use with blacklist / whitelist rules. (Medford-only; + * for use by SolarSecure apps, not directly by drivers. See SF-114946-SW.) + * NOTE - this message definition is provisional. It has not yet been used in + * any released code and may change during development. This note will be + * removed once it is regarded as stable. + */ +#define MC_CMD_SECURITY_RULE_COUNTER_FREE 0x113 +#undef MC_CMD_0x113_PRIVILEGE_CTG + +#define MC_CMD_0x113_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_SECURITY_RULE_COUNTER_FREE_IN msgrequest */ +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_LENMIN 4 +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_LENMAX 252 +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_LEN(num) (4+4*(num)) +/* the number of counter IDs to free */ +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_NUM_COUNTERS_OFST 0 +/* the counter ID(s) to free */ +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_COUNTER_ID_OFST 4 +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_COUNTER_ID_LEN 4 +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_COUNTER_ID_MINNUM 0 +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_IN_COUNTER_ID_MAXNUM 62 + +/* MC_CMD_SECURITY_RULE_COUNTER_FREE_OUT msgresponse */ +#define MC_CMD_SECURITY_RULE_COUNTER_FREE_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_SUBNET_MAP_SET_NODE + * Atomically update a trie node in the map of subnets to subnet IDs. The + * constants in the descriptions of the fields of this message may be retrieved + * by the GET_SECURITY_RULE_INFO op of MC_CMD_GET_PARSER_DISP_INFO. (Medford- + * only; for use by SolarSecure apps, not directly by drivers. See + * SF-114946-SW.) NOTE - this message definition is provisional. It has not yet + * been used in any released code and may change during development. This note + * will be removed once it is regarded as stable. + */ +#define MC_CMD_SUBNET_MAP_SET_NODE 0x114 +#undef MC_CMD_0x114_PRIVILEGE_CTG + +#define MC_CMD_0x114_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_SUBNET_MAP_SET_NODE_IN msgrequest */ +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_LENMIN 6 +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_LENMAX 252 +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_LEN(num) (4+2*(num)) +/* node to update in the range 0 .. SUBNET_MAP_NUM_NODES-1 */ +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_NODE_ID_OFST 0 +/* SUBNET_MAP_NUM_ENTRIES_PER_NODE new entries; each entry is either a pointer + * to the next node, expressed as an offset in the trie memory (i.e. node ID + * multiplied by SUBNET_MAP_NUM_ENTRIES_PER_NODE), or a leaf value in the range + * SUBNET_ID_MIN .. SUBNET_ID_MAX + */ +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_ENTRY_OFST 4 +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_ENTRY_LEN 2 +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_ENTRY_MINNUM 1 +#define MC_CMD_SUBNET_MAP_SET_NODE_IN_ENTRY_MAXNUM 124 + +/* MC_CMD_SUBNET_MAP_SET_NODE_OUT msgresponse */ +#define MC_CMD_SUBNET_MAP_SET_NODE_OUT_LEN 0 + +/* PORTRANGE_TREE_ENTRY structuredef */ +#define PORTRANGE_TREE_ENTRY_LEN 4 +/* key for branch nodes (<= key takes left branch, > key takes right branch), + * or magic value for leaf nodes + */ +#define PORTRANGE_TREE_ENTRY_BRANCH_KEY_OFST 0 +#define PORTRANGE_TREE_ENTRY_BRANCH_KEY_LEN 2 +#define PORTRANGE_TREE_ENTRY_LEAF_NODE_KEY 0xffff /* enum */ +#define PORTRANGE_TREE_ENTRY_BRANCH_KEY_LBN 0 +#define PORTRANGE_TREE_ENTRY_BRANCH_KEY_WIDTH 16 +/* final portrange ID for leaf nodes (don't care for branch nodes) */ +#define PORTRANGE_TREE_ENTRY_LEAF_PORTRANGE_ID_OFST 2 +#define PORTRANGE_TREE_ENTRY_LEAF_PORTRANGE_ID_LEN 2 +#define PORTRANGE_TREE_ENTRY_LEAF_PORTRANGE_ID_LBN 16 +#define PORTRANGE_TREE_ENTRY_LEAF_PORTRANGE_ID_WIDTH 16 + + +/***********************************/ +/* MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE + * Atomically update the entire tree mapping remote port ranges to portrange + * IDs. The constants in the descriptions of the fields of this message may be + * retrieved by the GET_SECURITY_RULE_INFO op of MC_CMD_GET_PARSER_DISP_INFO. + * (Medford-only; for use by SolarSecure apps, not directly by drivers. See + * SF-114946-SW.) NOTE - this message definition is provisional. It has not yet + * been used in any released code and may change during development. This note + * will be removed once it is regarded as stable. + */ +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE 0x115 +#undef MC_CMD_0x115_PRIVILEGE_CTG + +#define MC_CMD_0x115_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN msgrequest */ +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN_LENMIN 4 +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN_LENMAX 252 +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN_LEN(num) (0+4*(num)) +/* PORTRANGE_TREE_NUM_ENTRIES new entries, each laid out as a + * PORTRANGE_TREE_ENTRY + */ +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_OFST 0 +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_LEN 4 +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_MINNUM 1 +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_MAXNUM 63 + +/* MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_OUT msgresponse */ +#define MC_CMD_REMOTE_PORTRANGE_MAP_SET_TREE_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE + * Atomically update the entire tree mapping remote port ranges to portrange + * IDs. The constants in the descriptions of the fields of this message may be + * retrieved by the GET_SECURITY_RULE_INFO op of MC_CMD_GET_PARSER_DISP_INFO. + * (Medford-only; for use by SolarSecure apps, not directly by drivers. See + * SF-114946-SW.) NOTE - this message definition is provisional. It has not yet + * been used in any released code and may change during development. This note + * will be removed once it is regarded as stable. + */ +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE 0x116 +#undef MC_CMD_0x116_PRIVILEGE_CTG + +#define MC_CMD_0x116_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN msgrequest */ +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN_LENMIN 4 +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN_LENMAX 252 +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN_LEN(num) (0+4*(num)) +/* PORTRANGE_TREE_NUM_ENTRIES new entries, each laid out as a + * PORTRANGE_TREE_ENTRY + */ +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_OFST 0 +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_LEN 4 +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_MINNUM 1 +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_IN_ENTRIES_MAXNUM 63 + +/* MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_OUT msgresponse */ +#define MC_CMD_LOCAL_PORTRANGE_MAP_SET_TREE_OUT_LEN 0 + +/* TUNNEL_ENCAP_UDP_PORT_ENTRY structuredef */ +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_LEN 4 +/* UDP port (the standard ports are named below but any port may be used) */ +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_OFST 0 +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_LEN 2 +/* enum: the IANA allocated UDP port for VXLAN */ +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_IANA_VXLAN_UDP_PORT 0x12b5 +/* enum: the IANA allocated UDP port for Geneve */ +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_IANA_GENEVE_UDP_PORT 0x17c1 +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_LBN 0 +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_WIDTH 16 +/* tunnel encapsulation protocol (only those named below are supported) */ +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_OFST 2 +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_LEN 2 +/* enum: This port will be used for VXLAN on both IPv4 and IPv6 */ +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_VXLAN 0x0 +/* enum: This port will be used for Geneve on both IPv4 and IPv6 */ +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_GENEVE 0x1 +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_LBN 16 +#define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_WIDTH 16 + + +/***********************************/ +/* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS + * Configure UDP ports for tunnel encapsulation hardware acceleration. The + * parser-dispatcher will attempt to parse traffic on these ports as tunnel + * encapsulation PDUs and filter them using the tunnel encapsulation filter + * chain rather than the standard filter chain. Note that this command can + * cause all functions to see a reset. (Available on Medford only.) + */ +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS 0x117 +#undef MC_CMD_0x117_PRIVILEGE_CTG + +#define MC_CMD_0x117_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN msgrequest */ +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LENMIN 4 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LENMAX 68 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LEN(num) (4+4*(num)) +/* Flags */ +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_FLAGS_OFST 0 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_FLAGS_LEN 2 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_UNLOADING_LBN 0 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_UNLOADING_WIDTH 1 +/* The number of entries in the ENTRIES array */ +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_NUM_ENTRIES_OFST 2 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_NUM_ENTRIES_LEN 2 +/* Entries defining the UDP port to protocol mapping, each laid out as a + * TUNNEL_ENCAP_UDP_PORT_ENTRY + */ +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_OFST 4 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_LEN 4 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MINNUM 0 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MAXNUM 16 + +/* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT msgresponse */ +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_LEN 2 +/* Flags */ +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_FLAGS_OFST 0 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_FLAGS_LEN 2 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_RESETTING_LBN 0 +#define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_RESETTING_WIDTH 1 + + +/***********************************/ +/* MC_CMD_RX_BALANCING + * Configure a port upconverter to distribute the packets on both RX engines. + * Packets are distributed based on a table with the destination vFIFO. The + * index of the table is a hash of source and destination of IPV4 and VLAN + * priority. + */ +#define MC_CMD_RX_BALANCING 0x118 +#undef MC_CMD_0x118_PRIVILEGE_CTG + +#define MC_CMD_0x118_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_RX_BALANCING_IN msgrequest */ +#define MC_CMD_RX_BALANCING_IN_LEN 4 +/* The RX port whose upconverter table will be modified */ +#define MC_CMD_RX_BALANCING_IN_PORT_OFST 0 +#define MC_CMD_RX_BALANCING_IN_PORT_LEN 1 +/* The VLAN priority associated to the table index and vFIFO */ +#define MC_CMD_RX_BALANCING_IN_PRIORITY_OFST 1 +#define MC_CMD_RX_BALANCING_IN_PRIORITY_LEN 1 +/* The resulting bit of SRC^DST for indexing the table */ +#define MC_CMD_RX_BALANCING_IN_SRC_DST_OFST 2 +#define MC_CMD_RX_BALANCING_IN_SRC_DST_LEN 1 +/* The RX engine to which the vFIFO in the table entry will point to */ +#define MC_CMD_RX_BALANCING_IN_ENG_OFST 3 +#define MC_CMD_RX_BALANCING_IN_ENG_LEN 1 + +/* MC_CMD_RX_BALANCING_OUT msgresponse */ +#define MC_CMD_RX_BALANCING_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_TSA_BIND + * TSAN - TSAC binding communication protocol. Refer to SF-115479-TC for more + * info in respect to the binding protocol. Note- This MCDI command is only + * available over a TLS secure connection between the TSAN and TSAC, and is not + * available to host software. + */ +#define MC_CMD_TSA_BIND 0x119 + +/* MC_CMD_TSA_BIND_IN msgrequest: Protocol operation code */ +#define MC_CMD_TSA_BIND_IN_LEN 4 +#define MC_CMD_TSA_BIND_IN_OP_OFST 0 +/* enum: Retrieve the TSAN ID from a TSAN. TSAN ID is a unique identifier for + * the network adapter. More specifically, TSAN ID equals the MAC address of + * the network adapter. TSAN ID is used as part of the TSAN authentication + * protocol. Refer to SF-114946-SW for more information. + */ +#define MC_CMD_TSA_BIND_OP_GET_ID 0x1 +/* enum: Get a binding ticket from the TSAN. The binding ticket is used as part + * of the binding procedure to authorize the binding of an adapter to a TSAID. + * Refer to SF-114946-SW for more information. + */ +#define MC_CMD_TSA_BIND_OP_GET_TICKET 0x2 +/* enum: Opcode associated with the propagation of a private key that TSAN uses + * as part of post-binding authentication procedure. More specifically, TSAN + * uses this key for a signing operation. TSAC uses the counterpart public key + * to verify the signature. Note - The post-binding authentication occurs when + * the TSAN-TSAC connection terminates and TSAN tries to reconnect. Refer to + * SF-114946-SW for more information. + */ +#define MC_CMD_TSA_BIND_OP_SET_KEY 0x3 +/* enum: Request an unbinding operation. Note- TSAN clears the binding ticket + * from the Nvram section. + */ +#define MC_CMD_TSA_BIND_OP_UNBIND 0x4 + +/* MC_CMD_TSA_BIND_IN_GET_ID msgrequest */ +#define MC_CMD_TSA_BIND_IN_GET_ID_LEN 20 +/* The operation requested. */ +#define MC_CMD_TSA_BIND_IN_GET_ID_OP_OFST 0 +/* Cryptographic nonce that TSAC generates and sends to TSAN. TSAC generates + * the nonce every time as part of the TSAN post-binding authentication + * procedure when the TSAN-TSAC connection terminates and TSAN does need to re- + * connect to the TSAC. Refer to SF-114946-SW for more information. + */ +#define MC_CMD_TSA_BIND_IN_GET_ID_NONCE_OFST 4 +#define MC_CMD_TSA_BIND_IN_GET_ID_NONCE_LEN 16 + +/* MC_CMD_TSA_BIND_IN_GET_TICKET msgrequest */ +#define MC_CMD_TSA_BIND_IN_GET_TICKET_LEN 4 +/* The operation requested. */ +#define MC_CMD_TSA_BIND_IN_GET_TICKET_OP_OFST 0 + +/* MC_CMD_TSA_BIND_IN_SET_KEY msgrequest */ +#define MC_CMD_TSA_BIND_IN_SET_KEY_LENMIN 5 +#define MC_CMD_TSA_BIND_IN_SET_KEY_LENMAX 252 +#define MC_CMD_TSA_BIND_IN_SET_KEY_LEN(num) (4+1*(num)) +/* The operation requested. */ +#define MC_CMD_TSA_BIND_IN_SET_KEY_OP_OFST 0 +/* This data blob contains the private key generated by the TSAC. TSAN uses + * this key for a signing operation. Note- This private key is used in + * conjunction with the post-binding TSAN authentication procedure that occurs + * when the TSAN-TSAC connection terminates and TSAN tries to reconnect. Refer + * to SF-114946-SW for more information. + */ +#define MC_CMD_TSA_BIND_IN_SET_KEY_DATKEY_OFST 4 +#define MC_CMD_TSA_BIND_IN_SET_KEY_DATKEY_LEN 1 +#define MC_CMD_TSA_BIND_IN_SET_KEY_DATKEY_MINNUM 1 +#define MC_CMD_TSA_BIND_IN_SET_KEY_DATKEY_MAXNUM 248 + +/* MC_CMD_TSA_BIND_IN_UNBIND msgrequest: Asks for the un-binding procedure */ +#define MC_CMD_TSA_BIND_IN_UNBIND_LEN 6 +/* TSAN unique identifier for the network adapter */ +#define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_OFST 0 +#define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_LEN 6 + +/* MC_CMD_TSA_BIND_OUT_GET_ID msgresponse */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_LENMIN 11 +#define MC_CMD_TSA_BIND_OUT_GET_ID_LENMAX 252 +#define MC_CMD_TSA_BIND_OUT_GET_ID_LEN(num) (10+1*(num)) +/* The operation completion code. */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_OP_OFST 0 +/* TSAN unique identifier for the network adapter */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_TSANID_OFST 4 +#define MC_CMD_TSA_BIND_OUT_GET_ID_TSANID_LEN 6 +/* The signature data blob. The signature is computed against the message + * formed by TSAN ID concatenated with the NONCE value. Refer to SF-115479-TC + * for more information also in respect to the private keys that are used to + * sign the message based on TSAN pre/post-binding authentication procedure. + */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_OFST 10 +#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_LEN 1 +#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_MINNUM 1 +#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_MAXNUM 242 + +/* MC_CMD_TSA_BIND_OUT_GET_TICKET msgresponse */ +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_LENMIN 5 +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_LENMAX 252 +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_LEN(num) (4+1*(num)) +/* The operation completion code. */ +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_OP_OFST 0 +/* The ticket represents the data blob construct that TSAN sends to TSAC as + * part of the binding protocol. From the TSAN perspective the ticket is an + * opaque construct. For more info refer to SF-115479-TC. + */ +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_TICKET_OFST 4 +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_TICKET_LEN 1 +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_TICKET_MINNUM 1 +#define MC_CMD_TSA_BIND_OUT_GET_TICKET_TICKET_MAXNUM 248 + +/* MC_CMD_TSA_BIND_OUT_SET_KEY msgresponse */ +#define MC_CMD_TSA_BIND_OUT_SET_KEY_LEN 4 +/* The operation completion code. */ +#define MC_CMD_TSA_BIND_OUT_SET_KEY_OP_OFST 0 + +/* MC_CMD_TSA_BIND_OUT_UNBIND msgresponse */ +#define MC_CMD_TSA_BIND_OUT_UNBIND_LEN 8 +/* Same as MC_CMD_ERR field, but included as 0 in success cases */ +#define MC_CMD_TSA_BIND_OUT_UNBIND_RESULT_OFST 0 +/* Extra status information */ +#define MC_CMD_TSA_BIND_OUT_UNBIND_INFO_OFST 4 +/* enum: Unbind successful. */ +#define MC_CMD_TSA_BIND_OUT_UNBIND_OK_UNBOUND 0x0 +/* enum: TSANID mismatch */ +#define MC_CMD_TSA_BIND_OUT_UNBIND_ERR_BAD_TSANID 0x1 +/* enum: Unable to remove the binding ticket from persistent storage. */ +#define MC_CMD_TSA_BIND_OUT_UNBIND_ERR_REMOVE_TICKET 0x2 +/* enum: TSAN is not bound to a binding ticket. */ +#define MC_CMD_TSA_BIND_OUT_UNBIND_ERR_NOT_BOUND 0x3 + + +/***********************************/ +/* MC_CMD_MANAGE_SECURITY_RULESET_CACHE + * Manage the persistent NVRAM cache of security rules created with + * MC_CMD_SET_SECURITY_RULE. Note that the cache is not automatically updated + * as rules are added or removed; the active ruleset must be explicitly + * committed to the cache. The cache may also be explicitly invalidated, + * without affecting the currently active ruleset. When the cache is valid, it + * will be loaded at power on or MC reboot, instead of the default ruleset. + * Rollback of the currently active ruleset to the cached version (when it is + * valid) is also supported. (Medford-only; for use by SolarSecure apps, not + * directly by drivers. See SF-114946-SW.) NOTE - this message definition is + * provisional. It has not yet been used in any released code and may change + * during development. This note will be removed once it is regarded as stable. + */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE 0x11a +#undef MC_CMD_0x11a_PRIVILEGE_CTG + +#define MC_CMD_0x11a_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_MANAGE_SECURITY_RULESET_CACHE_IN msgrequest */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_IN_LEN 4 +/* the operation to perform */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_IN_OP_OFST 0 +/* enum: reports the ruleset version that is cached in persistent storage but + * performs no other action + */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_IN_OP_GET_CACHED_VERSION 0x0 +/* enum: rolls back the active state to the cached version. (May fail with + * ENOENT if there is no valid cached version.) + */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_IN_OP_ROLLBACK 0x1 +/* enum: commits the active state to the persistent cache */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_IN_OP_COMMIT 0x2 +/* enum: invalidates the persistent cache without affecting the active state */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_IN_OP_INVALIDATE 0x3 + +/* MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT msgresponse */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_LENMIN 5 +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_LENMAX 252 +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_LEN(num) (4+1*(num)) +/* indicates whether the persistent cache is valid (after completion of the + * requested operation in the case of rollback, commit, or invalidate) + */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_STATE_OFST 0 +/* enum: persistent cache is invalid (the VERSION field will be empty in this + * case) + */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_STATE_INVALID 0x0 +/* enum: persistent cache is valid */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_STATE_VALID 0x1 +/* cached ruleset version (after completion of the requested operation, in the + * case of rollback, commit, or invalidate) as an opaque hash value in the same + * form as MC_CMD_GET_SECURITY_RULESET_VERSION_OUT_VERSION + */ +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_OFST 4 +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_LEN 1 +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_MINNUM 1 +#define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_MAXNUM 248 + #endif /* _SIENA_MC_DRIVER_PCOL_H */ From owner-svn-src-all@freebsd.org Mon May 16 07:00:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 355D5B3DD97; Mon, 16 May 2016 07:00:51 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8151102F; Mon, 16 May 2016 07:00:50 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G70oAV070108; Mon, 16 May 2016 07:00:50 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G70oAw070105; Mon, 16 May 2016 07:00:50 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605160700.u4G70oAw070105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 16 May 2016 07:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299910 - head/sys/dev/etherswitch/mtkswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:00:51 -0000 Author: sgalabov Date: Mon May 16 07:00:49 2016 New Revision: 299910 URL: https://svnweb.freebsd.org/changeset/base/299910 Log: Introduce basic etherswitch support for Ralink SoCs This revision introduces basic support for the internal ESW switch found Ralink/Mediatek SoCs such as RT3050, RT3352, RT5350, MT7628; and GSW found in MT7620 and MT7621. It only supports 802.1q VLANs and doesn't support external PHYs at the moment (only the ones that are built into the switch itself). Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6348 Added: head/sys/dev/etherswitch/mtkswitch/ head/sys/dev/etherswitch/mtkswitch/mtkswitch.c (contents, props changed) head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c (contents, props changed) head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.h (contents, props changed) head/sys/dev/etherswitch/mtkswitch/mtkswitch_rt3050.c (contents, props changed) head/sys/dev/etherswitch/mtkswitch/mtkswitch_rt3050.h (contents, props changed) head/sys/dev/etherswitch/mtkswitch/mtkswitchvar.h (contents, props changed) Added: head/sys/dev/etherswitch/mtkswitch/mtkswitch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/mtkswitch/mtkswitch.c Mon May 16 07:00:49 2016 (r299910) @@ -0,0 +1,668 @@ +/*- + * Copyright (c) 2016 Stanislav Galabov. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * 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$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +#define DEBUG + +#if defined(DEBUG) +static SYSCTL_NODE(_debug, OID_AUTO, mtkswitch, CTLFLAG_RD, 0, "mtkswitch"); +#endif + +static inline int mtkswitch_portforphy(int phy); +static int mtkswitch_ifmedia_upd(struct ifnet *ifp); +static void mtkswitch_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); +static void mtkswitch_tick(void *arg); + +static const struct ofw_compat_data compat_data[] = { + { "ralink,rt3050-esw", MTK_SWITCH_RT3050 }, + { "ralink,rt3352-esw", MTK_SWITCH_RT3352 }, + { "ralink,rt5350-esw", MTK_SWITCH_RT5350 }, + { "mediatek,mt7620-gsw", MTK_SWITCH_MT7620 }, + { "mediatek,mt7621-gsw", MTK_SWITCH_MT7621 }, + { "mediatek,mt7628-esw", MTK_SWITCH_MT7628 }, + + /* Sentinel */ + { NULL, MTK_SWITCH_NONE } +}; + +static int +mtkswitch_probe(device_t dev) +{ + struct mtkswitch_softc *sc; + mtk_switch_type switch_type; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + switch_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (switch_type == MTK_SWITCH_NONE) + return (ENXIO); + + sc = device_get_softc(dev); + bzero(sc, sizeof(*sc)); + sc->sc_switchtype = switch_type; + + device_set_desc_copy(dev, "MTK Switch Driver"); + + return (0); +} + +static int +mtkswitch_attach_phys(struct mtkswitch_softc *sc) +{ + int phy, err = 0; + char name[IFNAMSIZ]; + + /* PHYs need an interface, so we generate a dummy one */ + snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); + for (phy = 0; phy < sc->numphys; phy++) { + if ((sc->phymap & (1u << phy)) == 0) { + sc->ifp[phy] = NULL; + sc->ifname[phy] = NULL; + sc->miibus[phy] = NULL; + continue; + } + sc->ifp[phy] = if_alloc(IFT_ETHER); + sc->ifp[phy]->if_softc = sc; + sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX; + sc->ifname[phy] = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK); + bcopy(name, sc->ifname[phy], strlen(name) + 1); + if_initname(sc->ifp[phy], sc->ifname[phy], + mtkswitch_portforphy(phy)); + err = mii_attach(sc->sc_dev, &sc->miibus[phy], sc->ifp[phy], + mtkswitch_ifmedia_upd, mtkswitch_ifmedia_sts, + BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + if (err != 0) { + device_printf(sc->sc_dev, + "attaching PHY %d failed\n", + phy); + } else { + DPRINTF(sc->sc_dev, "%s attached to pseudo interface " + "%s\n", device_get_nameunit(sc->miibus[phy]), + sc->ifp[phy]->if_xname); + } + } + return (err); +} + +static int +mtkswitch_set_vlan_mode(struct mtkswitch_softc *sc, uint32_t mode) +{ + + /* Check for invalid modes. */ + if ((mode & sc->info.es_vlan_caps) != mode) + return (EINVAL); + + sc->vlan_mode = mode; + + /* Reset VLANs. */ + sc->hal.mtkswitch_vlan_init_hw(sc); + + return (0); +} + +static int +mtkswitch_attach(device_t dev) +{ + struct mtkswitch_softc *sc; + int err = 0; + int port, rid; + + sc = device_get_softc(dev); + + /* sc->sc_switchtype is already decided in mtkswitch_probe() */ + sc->numports = MTKSWITCH_MAX_PORTS; + sc->numphys = MTKSWITCH_MAX_PHYS; + sc->cpuport = MTKSWITCH_CPU_PORT; + sc->sc_dev = dev; + + /* Attach switch related functions */ + if (sc->sc_switchtype == MTK_SWITCH_NONE) { + device_printf(dev, "Unknown switch type\n"); + return (ENXIO); + } + + if (sc->sc_switchtype == MTK_SWITCH_MT7620 || + sc->sc_switchtype == MTK_SWITCH_MT7621) + mtk_attach_switch_mt7620(sc); + else + mtk_attach_switch_rt3050(sc); + + /* Allocate resources */ + rid = 0; + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_res == NULL) { + device_printf(dev, "could not map memory\n"); + return (ENXIO); + } + + mtx_init(&sc->sc_mtx, "mtkswitch", NULL, MTX_DEF); + + /* Reset the switch */ + if (sc->hal.mtkswitch_reset(sc)) { + DPRINTF(dev, "%s: mtkswitch_reset: failed\n", __func__); + return (ENXIO); + } + + err = sc->hal.mtkswitch_hw_setup(sc); + DPRINTF(dev, "%s: hw_setup: err=%d\n", __func__, err); + if (err != 0) + return (err); + + err = sc->hal.mtkswitch_hw_global_setup(sc); + DPRINTF(dev, "%s: hw_global_setup: err=%d\n", __func__, err); + if (err != 0) + return (err); + + /* Initialize the switch ports */ + for (port = 0; port < sc->numports; port++) { + sc->hal.mtkswitch_port_init(sc, port); + } + + /* Attach the PHYs and complete the bus enumeration */ + err = mtkswitch_attach_phys(sc); + DPRINTF(dev, "%s: attach_phys: err=%d\n", __func__, err); + if (err != 0) + return (err); + + /* Default to ingress filters off. */ + err = mtkswitch_set_vlan_mode(sc, ETHERSWITCH_VLAN_DOT1Q); + DPRINTF(dev, "%s: set_vlan_mode: err=%d\n", __func__, err); + if (err != 0) + return (err); + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + err = bus_generic_attach(dev); + DPRINTF(dev, "%s: bus_generic_attach: err=%d\n", __func__, err); + if (err != 0) + return (err); + + callout_init_mtx(&sc->callout_tick, &sc->sc_mtx, 0); + + MTKSWITCH_LOCK(sc); + mtkswitch_tick(sc); + MTKSWITCH_UNLOCK(sc); + + return (0); +} + +static int +mtkswitch_detach(device_t dev) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + int phy; + + callout_drain(&sc->callout_tick); + + for (phy = 0; phy < MTKSWITCH_MAX_PHYS; phy++) { + if (sc->miibus[phy] != NULL) + device_delete_child(dev, sc->miibus[phy]); + if (sc->ifp[phy] != NULL) + if_free(sc->ifp[phy]); + free(sc->ifname[phy], M_DEVBUF); + } + + bus_generic_detach(dev); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +/* PHY <-> port mapping is currently 1:1 */ +static inline int +mtkswitch_portforphy(int phy) +{ + + return (phy); +} + +static inline int +mtkswitch_phyforport(int port) +{ + + return (port); +} + +static inline struct mii_data * +mtkswitch_miiforport(struct mtkswitch_softc *sc, int port) +{ + int phy = mtkswitch_phyforport(port); + + if (phy < 0 || phy >= MTKSWITCH_MAX_PHYS || sc->miibus[phy] == NULL) + return (NULL); + + return (device_get_softc(sc->miibus[phy])); +} + +static inline struct ifnet * +mtkswitch_ifpforport(struct mtkswitch_softc *sc, int port) +{ + int phy = mtkswitch_phyforport(port); + + if (phy < 0 || phy >= MTKSWITCH_MAX_PHYS) + return (NULL); + + return (sc->ifp[phy]); +} + +/* + * Convert port status to ifmedia. + */ +static void +mtkswitch_update_ifmedia(uint32_t portstatus, u_int *media_status, + u_int *media_active) +{ + *media_active = IFM_ETHER; + *media_status = IFM_AVALID; + + if ((portstatus & MTKSWITCH_LINK_UP) != 0) + *media_status |= IFM_ACTIVE; + else { + *media_active |= IFM_NONE; + return; + } + + switch (portstatus & MTKSWITCH_SPEED_MASK) { + case MTKSWITCH_SPEED_10: + *media_active |= IFM_10_T; + break; + case MTKSWITCH_SPEED_100: + *media_active |= IFM_100_TX; + break; + case MTKSWITCH_SPEED_1000: + *media_active |= IFM_1000_T; + break; + } + + if ((portstatus & MTKSWITCH_DUPLEX) != 0) + *media_active |= IFM_FDX; + else + *media_active |= IFM_HDX; + + if ((portstatus & MTKSWITCH_TXFLOW) != 0) + *media_active |= IFM_ETH_TXPAUSE; + if ((portstatus & MTKSWITCH_RXFLOW) != 0) + *media_active |= IFM_ETH_RXPAUSE; +} + +static void +mtkswitch_miipollstat(struct mtkswitch_softc *sc) +{ + struct mii_data *mii; + struct mii_softc *miisc; + uint32_t portstatus; + int i, port_flap = 0; + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + + for (i = 0; i < sc->numphys; i++) { + if (sc->miibus[i] == NULL) + continue; + mii = device_get_softc(sc->miibus[i]); + portstatus = sc->hal.mtkswitch_get_port_status(sc, + mtkswitch_portforphy(i)); + + /* If a port has flapped - mark it so we can flush the ATU */ + if (((mii->mii_media_status & IFM_ACTIVE) == 0 && + (portstatus & MTKSWITCH_LINK_UP) != 0) || + ((mii->mii_media_status & IFM_ACTIVE) != 0 && + (portstatus & MTKSWITCH_LINK_UP) == 0)) { + port_flap = 1; + } + + mtkswitch_update_ifmedia(portstatus, &mii->mii_media_status, + &mii->mii_media_active); + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { + if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) != + miisc->mii_inst) + continue; + mii_phy_update(miisc, MII_POLLSTAT); + } + } + + if (port_flap) + sc->hal.mtkswitch_atu_flush(sc); +} + +static void +mtkswitch_tick(void *arg) +{ + struct mtkswitch_softc *sc = arg; + + mtkswitch_miipollstat(sc); + callout_reset(&sc->callout_tick, hz, mtkswitch_tick, sc); +} + +static void +mtkswitch_lock(device_t dev) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + MTKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + MTKSWITCH_LOCK(sc); +} + +static void +mtkswitch_unlock(device_t dev) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + MTKSWITCH_UNLOCK(sc); +} + +static etherswitch_info_t * +mtkswitch_getinfo(device_t dev) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + return (&sc->info); +} + +static inline int +mtkswitch_is_cpuport(struct mtkswitch_softc *sc, int port) +{ + + return (sc->cpuport == port); +} + +static int +mtkswitch_getport(device_t dev, etherswitch_port_t *p) +{ + struct mtkswitch_softc *sc; + struct mii_data *mii; + struct ifmediareq *ifmr; + int err; + + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->info.es_nports) + return (ENXIO); + + err = sc->hal.mtkswitch_port_vlan_get(sc, p); + if (err != 0) + return (err); + + mii = mtkswitch_miiforport(sc, p->es_port); + if (mtkswitch_is_cpuport(sc, p->es_port)) { + /* fill in fixed values for CPU port */ + /* XXX is this valid in all cases? */ + p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr = &p->es_ifmr; + ifmr->ifm_count = 0; + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_1000_T | IFM_FDX; + ifmr->ifm_mask = 0; + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + } else if (mii != NULL) { + err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, + &mii->mii_media, SIOCGIFMEDIA); + if (err) + return (err); + } else { + ifmr = &p->es_ifmr; + ifmr->ifm_count = 0; + ifmr->ifm_current = ifmr->ifm_active = IFM_NONE; + ifmr->ifm_mask = 0; + ifmr->ifm_status = 0; + } + return (0); +} + +static int +mtkswitch_setport(device_t dev, etherswitch_port_t *p) +{ + int err; + struct mtkswitch_softc *sc; + struct ifmedia *ifm; + struct mii_data *mii; + struct ifnet *ifp; + + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->info.es_nports) + return (ENXIO); + + /* Port flags. */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + err = sc->hal.mtkswitch_port_vlan_setup(sc, p); + if (err) + return (err); + } + + /* Do not allow media changes on CPU port. */ + if (mtkswitch_is_cpuport(sc, p->es_port)) + return (0); + + mii = mtkswitch_miiforport(sc, p->es_port); + if (mii == NULL) + return (ENXIO); + + ifp = mtkswitch_ifpforport(sc, p->es_port); + + ifm = &mii->mii_media; + return (ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA)); +} + +static void +mtkswitch_statchg(device_t dev) +{ + + DPRINTF(dev, "%s\n", __func__); +} + +static int +mtkswitch_ifmedia_upd(struct ifnet *ifp) +{ + struct mtkswitch_softc *sc = ifp->if_softc; + struct mii_data *mii = mtkswitch_miiforport(sc, ifp->if_dunit); + + if (mii == NULL) + return (ENXIO); + mii_mediachg(mii); + return (0); +} + +static void +mtkswitch_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct mtkswitch_softc *sc = ifp->if_softc; + struct mii_data *mii = mtkswitch_miiforport(sc, ifp->if_dunit); + + DPRINTF(sc->sc_dev, "%s\n", __func__); + + if (mii == NULL) + return; + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; +} + +static int +mtkswitch_getconf(device_t dev, etherswitch_conf_t *conf) +{ + struct mtkswitch_softc *sc; + + sc = device_get_softc(dev); + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = sc->vlan_mode; + + return (0); +} + +static int +mtkswitch_setconf(device_t dev, etherswitch_conf_t *conf) +{ + struct mtkswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + + /* Set the VLAN mode. */ + if (conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) { + err = mtkswitch_set_vlan_mode(sc, conf->vlan_mode); + if (err != 0) + return (err); + } + + return (0); +} + +static int +mtkswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *e) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.mtkswitch_vlan_getvgroup(sc, e)); +} + +static int +mtkswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *e) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.mtkswitch_vlan_setvgroup(sc, e)); +} + +static int +mtkswitch_readphy(device_t dev, int phy, int reg) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.mtkswitch_phy_read(dev, phy, reg)); +} + +static int +mtkswitch_writephy(device_t dev, int phy, int reg, int val) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.mtkswitch_phy_write(dev, phy, reg, val)); +} + +static int +mtkswitch_readreg(device_t dev, int addr) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.mtkswitch_reg_read(dev, addr)); +} + +static int +mtkswitch_writereg(device_t dev, int addr, int value) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.mtkswitch_reg_write(dev, addr, value)); +} + +static device_method_t mtkswitch_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mtkswitch_probe), + DEVMETHOD(device_attach, mtkswitch_attach), + DEVMETHOD(device_detach, mtkswitch_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, device_add_child_ordered), + + /* MII interface */ + DEVMETHOD(miibus_readreg, mtkswitch_readphy), + DEVMETHOD(miibus_writereg, mtkswitch_writephy), + DEVMETHOD(miibus_statchg, mtkswitch_statchg), + + /* MDIO interface */ + DEVMETHOD(mdio_readreg, mtkswitch_readphy), + DEVMETHOD(mdio_writereg, mtkswitch_writephy), + + /* ehterswitch interface */ + DEVMETHOD(etherswitch_lock, mtkswitch_lock), + DEVMETHOD(etherswitch_unlock, mtkswitch_unlock), + DEVMETHOD(etherswitch_getinfo, mtkswitch_getinfo), + DEVMETHOD(etherswitch_readreg, mtkswitch_readreg), + DEVMETHOD(etherswitch_writereg, mtkswitch_writereg), + DEVMETHOD(etherswitch_readphyreg, mtkswitch_readphy), + DEVMETHOD(etherswitch_writephyreg, mtkswitch_writephy), + DEVMETHOD(etherswitch_getport, mtkswitch_getport), + DEVMETHOD(etherswitch_setport, mtkswitch_setport), + DEVMETHOD(etherswitch_getvgroup, mtkswitch_getvgroup), + DEVMETHOD(etherswitch_setvgroup, mtkswitch_setvgroup), + DEVMETHOD(etherswitch_getconf, mtkswitch_getconf), + DEVMETHOD(etherswitch_setconf, mtkswitch_setconf), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(mtkswitch, mtkswitch_driver, mtkswitch_methods, + sizeof(struct mtkswitch_softc)); +static devclass_t mtkswitch_devclass; + +DRIVER_MODULE(mtkswitch, simplebus, mtkswitch_driver, mtkswitch_devclass, 0, 0); +DRIVER_MODULE(miibus, mtkswitch, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(mdio, mtkswitch, mdio_driver, mdio_devclass, 0, 0); +DRIVER_MODULE(etherswitch, mtkswitch, etherswitch_driver, etherswitch_devclass, + 0, 0); +MODULE_VERSION(mtkswitch, 1); +MODULE_DEPEND(mtkswitch, miibus, 1, 1, 1); +MODULE_DEPEND(mtkswitch, etherswitch, 1, 1, 1); Added: head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c Mon May 16 07:00:49 2016 (r299910) @@ -0,0 +1,563 @@ +/*- + * Copyright (c) 2016 Stanislav Galabov. + * 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$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +static int +mtkswitch_phy_read_locked(struct mtkswitch_softc *sc, int phy, int reg) +{ + uint32_t data; + + MTKSWITCH_WRITE(sc, MTKSWITCH_PIAC, PIAC_PHY_ACS_ST | PIAC_MDIO_ST | + (reg << PIAC_MDIO_REG_ADDR_OFF) | (phy << PIAC_MDIO_PHY_ADDR_OFF) | + PIAC_MDIO_CMD_READ); + while ((data = MTKSWITCH_READ(sc, MTKSWITCH_PIAC)) & PIAC_PHY_ACS_ST); + + return ((int)(data & PIAC_MDIO_RW_DATA_MASK)); +} + +static int +mtkswitch_phy_read(device_t dev, int phy, int reg) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + int data; + + if ((phy < 0 || phy >= 32) || (reg < 0 || reg >= 32)) + return (ENXIO); + + MTKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + MTKSWITCH_LOCK(sc); + data = mtkswitch_phy_read_locked(sc, phy, reg); + MTKSWITCH_UNLOCK(sc); + + return (data); +} + +static int +mtkswitch_phy_write_locked(struct mtkswitch_softc *sc, int phy, int reg, + int val) +{ + + MTKSWITCH_WRITE(sc, MTKSWITCH_PIAC, PIAC_PHY_ACS_ST | PIAC_MDIO_ST | + (reg << PIAC_MDIO_REG_ADDR_OFF) | (phy << PIAC_MDIO_PHY_ADDR_OFF) | + (val & PIAC_MDIO_RW_DATA_MASK) | PIAC_MDIO_CMD_WRITE); + while (MTKSWITCH_READ(sc, MTKSWITCH_PIAC) & PIAC_PHY_ACS_ST); + + return (0); +} + +static int +mtkswitch_phy_write(device_t dev, int phy, int reg, int val) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + int res; + + if ((phy < 0 || phy >= 32) || (reg < 0 || reg >= 32)) + return (ENXIO); + + MTKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + MTKSWITCH_LOCK(sc); + res = mtkswitch_phy_write_locked(sc, phy, reg, val); + MTKSWITCH_UNLOCK(sc); + + return (res); +} + +static uint32_t +mtkswitch_reg_read32(struct mtkswitch_softc *sc, int reg) +{ + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (MTKSWITCH_READ(sc, reg)); +} + +static uint32_t +mtkswitch_reg_write32(struct mtkswitch_softc *sc, int reg, uint32_t val) +{ + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + MTKSWITCH_WRITE(sc, reg, val); + return (0); +} + +static uint32_t +mtkswitch_reg_read32_mt7621(struct mtkswitch_softc *sc, int reg) +{ + uint32_t low, hi; + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY, + MTKSWITCH_GLOBAL_REG, MTKSWITCH_REG_ADDR(reg)); + low = mtkswitch_phy_read_locked(sc, MTKSWITCH_GLOBAL_PHY, + MTKSWITCH_REG_LO(reg)); + hi = mtkswitch_phy_read_locked(sc, MTKSWITCH_GLOBAL_PHY, + MTKSWITCH_REG_HI(reg));; + return (low | (hi << 16)); +} + +static uint32_t +mtkswitch_reg_write32_mt7621(struct mtkswitch_softc *sc, int reg, uint32_t val) +{ + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY, + MTKSWITCH_GLOBAL_REG, MTKSWITCH_REG_ADDR(reg)); + mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY, + MTKSWITCH_REG_LO(reg), MTKSWITCH_VAL_LO(val)); + mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY, + MTKSWITCH_REG_HI(reg), MTKSWITCH_VAL_HI(val)); + return (0); +} + +static int +mtkswitch_reg_read(device_t dev, int reg) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + uint32_t val; + + val = sc->hal.mtkswitch_read(sc, MTKSWITCH_REG32(reg)); + if (MTKSWITCH_IS_HI16(reg)) + return (MTKSWITCH_HI16(val)); + return (MTKSWITCH_LO16(val)); +} + +static int +mtkswitch_reg_write(device_t dev, int reg, int val) +{ + struct mtkswitch_softc *sc = device_get_softc(dev); + uint32_t tmp; + + tmp = sc->hal.mtkswitch_read(sc, MTKSWITCH_REG32(reg)); + if (MTKSWITCH_IS_HI16(reg)) { + tmp &= MTKSWITCH_LO16_MSK; + tmp |= MTKSWITCH_TO_HI16(val); + } else { + tmp &= MTKSWITCH_HI16_MSK; + tmp |= MTKSWITCH_TO_LO16(val); + } + sc->hal.mtkswitch_write(sc, MTKSWITCH_REG32(reg), tmp); + + return (0); +} + +static int +mtkswitch_reset(struct mtkswitch_softc *sc) +{ + + /* We don't reset the switch for now */ + return (0); +} + +static int +mtkswitch_hw_setup(struct mtkswitch_softc *sc) +{ + + /* + * TODO: parse the device tree and see if we need to configure + * ports, etc. differently. For now we fallback to defaults. + */ + + /* Called early and hence unlocked */ + return (0); +} + +static int +mtkswitch_hw_global_setup(struct mtkswitch_softc *sc) +{ + /* Currently does nothing */ + + /* Called early and hence unlocked */ + return (0); +} + +static void +mtkswitch_port_init(struct mtkswitch_softc *sc, int port) +{ + uint32_t val; + + /* Called early and hence unlocked */ + + /* Set the port to secure mode */ + sc->hal.mtkswitch_write(sc, MTKSWITCH_PCR(port), PCR_PORT_VLAN_SECURE); + + /* Set port's vlan_attr to user port */ + val = sc->hal.mtkswitch_read(sc, MTKSWITCH_PVC(port)); + val &= PVC_VLAN_ATTR_MASK; + sc->hal.mtkswitch_write(sc, MTKSWITCH_PVC(port), val); + + /* Set port's MAC to default settings */ + sc->hal.mtkswitch_write(sc, MTKSWITCH_PMCR(port), PMCR_CFG_DEFAULT); +} + +static uint32_t +mtkswitch_get_port_status(struct mtkswitch_softc *sc, int port) +{ + uint32_t val, res, tmp; + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + res = 0; + val = sc->hal.mtkswitch_read(sc, MTKSWITCH_PMSR(port)); + + if (val & PMSR_MAC_LINK_STS) + res |= MTKSWITCH_LINK_UP; + if (val & PMSR_MAC_DPX_STS) + res |= MTKSWITCH_DUPLEX; + tmp = PMSR_MAC_SPD(val); + if (tmp == 0) + res |= MTKSWITCH_SPEED_10; + else if (tmp == 1) + res |= MTKSWITCH_SPEED_100; + else if (tmp == 2) + res |= MTKSWITCH_SPEED_1000; + if (val & PMSR_TX_FC_STS) + res |= MTKSWITCH_TXFLOW; + if (val & PMSR_RX_FC_STS) + res |= MTKSWITCH_RXFLOW; + + return (res); +} + +static int +mtkswitch_atu_flush(struct mtkswitch_softc *sc) +{ + + MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + + /* Flush all non-static MAC addresses */ + while (sc->hal.mtkswitch_read(sc, MTKSWITCH_ATC) & ATC_BUSY); + sc->hal.mtkswitch_write(sc, MTKSWITCH_ATC, ATC_BUSY | + ATC_AC_MAT_NON_STATIC_MACS | ATC_AC_CMD_CLEAN); + while (sc->hal.mtkswitch_read(sc, MTKSWITCH_ATC) & ATC_BUSY); + + return (0); +} + +static int +mtkswitch_port_vlan_setup(struct mtkswitch_softc *sc, etherswitch_port_t *p) +{ + int err; + + /* + * Port behaviour wrt tag/untag/stack is currently defined per-VLAN. + * So we say we don't support it here. + */ + if ((p->es_flags & (ETHERSWITCH_PORT_DOUBLE_TAG | + ETHERSWITCH_PORT_ADDTAG | ETHERSWITCH_PORT_STRIPTAG)) != 0) + return (ENOTSUP); + + MTKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + MTKSWITCH_LOCK(sc); + + /* Set the PVID */ + if (p->es_pvid != 0) { + err = sc->hal.mtkswitch_vlan_set_pvid(sc, p->es_port, + p->es_pvid); + if (err != 0) { + MTKSWITCH_UNLOCK(sc); + return (err); + } + } + + MTKSWITCH_UNLOCK(sc); + + return (0); +} + +static int +mtkswitch_port_vlan_get(struct mtkswitch_softc *sc, etherswitch_port_t *p) +{ + + MTKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + MTKSWITCH_LOCK(sc); + + /* Retrieve the PVID */ + sc->hal.mtkswitch_vlan_get_pvid(sc, p->es_port, &p->es_pvid); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 16 07:12:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8092DB3C2D2; Mon, 16 May 2016 07:12:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2A31C10; Mon, 16 May 2016 07:12:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G7C4Yv075834; Mon, 16 May 2016 07:12:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7C4Q4075833; Mon, 16 May 2016 07:12:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160712.u4G7C4Q4075833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 07:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299911 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:12:05 -0000 Author: arybchik Date: Mon May 16 07:12:04 2016 New Revision: 299911 URL: https://svnweb.freebsd.org/changeset/base/299911 Log: sfxge(4): fix license validation check for V3 licenses Length consistency checks were failing for ECC hashes. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Mon May 16 07:00:49 2016 (r299910) +++ head/sys/dev/sfxge/common/efx_lic.c Mon May 16 07:12:04 2016 (r299911) @@ -1103,7 +1103,6 @@ fail1: /* V3 format uses Huntington TLV format partition. See SF-108797-SW */ #define EFX_LICENSE_V3_KEY_LENGTH_MIN (64) #define EFX_LICENSE_V3_KEY_LENGTH_MAX (160) -#define EFX_LICENSE_V3_HASH_LENGTH (64) __checkReturn efx_rc_t efx_lic_v3_find_start( @@ -1169,16 +1168,17 @@ efx_lic_v3_validate_key( goto fail1; } - key_type = ((uint8_t*)keyp)[0]; - key_length = ((uint8_t*)keyp)[1] + EFX_LICENSE_V3_HASH_LENGTH; - - if(key_length > EFX_LICENSE_V3_KEY_LENGTH_MAX) { + if (length > EFX_LICENSE_V3_KEY_LENGTH_MAX) { goto fail2; } + + key_type = ((uint8_t*)keyp)[0]; + key_length = ((uint8_t*)keyp)[1]; + if (key_type < 3) { goto fail3; } - if (key_length != length) { + if (key_length > length) { goto fail4; } return (B_TRUE); From owner-svn-src-all@freebsd.org Mon May 16 07:19:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0961B3C64A; Mon, 16 May 2016 07:19:34 +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 B8C9A1176; Mon, 16 May 2016 07:19:34 +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 u4G7JX8c076125; Mon, 16 May 2016 07:19:33 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7JXr7076122; Mon, 16 May 2016 07:19:33 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605160719.u4G7JXr7076122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 16 May 2016 07:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299912 - in head: share/man/man9 sys/amd64/include sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:19:35 -0000 Author: sephe Date: Mon May 16 07:19:33 2016 New Revision: 299912 URL: https://svnweb.freebsd.org/changeset/base/299912 Log: atomic: Add testandclear on i386/amd64 Reviewed by: kib Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6381 Modified: head/share/man/man9/atomic.9 head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/share/man/man9/atomic.9 ============================================================================== --- head/share/man/man9/atomic.9 Mon May 16 07:12:04 2016 (r299911) +++ head/share/man/man9/atomic.9 Mon May 16 07:19:33 2016 (r299912) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2015 +.Dd May 12, 2016 .Dt ATOMIC 9 .Os .Sh NAME @@ -65,6 +65,8 @@ .Ft .Fn atomic_swap_ "volatile *p" " v" .Ft int +.Fn atomic_testandclear_ "volatile *p" "u_int v" +.Ft int .Fn atomic_testandset_ "volatile *p" "u_int v" .Sh DESCRIPTION Each of the atomic operations is guaranteed to be atomic across multiple @@ -309,6 +311,15 @@ and .Dq Li 16 and do not have any variants with memory barriers at this time. .Bl -hang +.It Fn atomic_testandclear p v +.Bd -literal -compact +bit = 1 << (v % (sizeof(*p) * NBBY)); +tmp = (*p & bit) != 0; +*p &= ~bit; +return (tmp); +.Ed +.El +.Bl -hang .It Fn atomic_testandset p v .Bd -literal -compact bit = 1 << (v % (sizeof(*p) * NBBY)); @@ -320,6 +331,8 @@ return (tmp); .Pp The .Fn atomic_testandset +and +.Fn atomic_testandclear functions are only implemented for the types .Dq Li int , .Dq Li long @@ -348,6 +361,8 @@ and functions return the value at the specified address. The .Fn atomic_testandset +and +.Fn atomic_testandclear function returns the result of the test operation. .Sh EXAMPLES This example uses the @@ -425,3 +440,6 @@ and .Fn atomic_testandset operations were added in .Fx 10.0 . +.Fn atomic_testandclear +operation was added in +.Fx 11.0 . Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Mon May 16 07:12:04 2016 (r299911) +++ head/sys/amd64/include/atomic.h Mon May 16 07:19:33 2016 (r299912) @@ -103,6 +103,8 @@ u_int atomic_fetchadd_int(volatile u_int u_long atomic_fetchadd_long(volatile u_long *p, u_long v); int atomic_testandset_int(volatile u_int *p, u_int v); int atomic_testandset_long(volatile u_long *p, u_int v); +int atomic_testandclear_int(volatile u_int *p, u_int v); +int atomic_testandclear_long(volatile u_long *p, u_int v); void atomic_thread_fence_acq(void); void atomic_thread_fence_acq_rel(void); void atomic_thread_fence_rel(void); @@ -264,6 +266,40 @@ atomic_testandset_long(volatile u_long * return (res); } +static __inline int +atomic_testandclear_int(volatile u_int *p, u_int v) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " btrl %2,%1 ; " + " setc %0 ; " + "# atomic_testandclear_int" + : "=q" (res), /* 0 */ + "+m" (*p) /* 1 */ + : "Ir" (v & 0x1f) /* 2 */ + : "cc"); + return (res); +} + +static __inline int +atomic_testandclear_long(volatile u_long *p, u_int v) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " btrq %2,%1 ; " + " setc %0 ; " + "# atomic_testandclear_long" + : "=q" (res), /* 0 */ + "+m" (*p) /* 1 */ + : "Jr" ((u_long)(v & 0x3f)) /* 2 */ + : "cc"); + return (res); +} + /* * We assume that a = b will do atomic loads and stores. Due to the * IA32 memory model, a simple store guarantees release semantics. @@ -537,6 +573,7 @@ u_long atomic_swap_long(volatile u_long #define atomic_readandclear_32 atomic_readandclear_int #define atomic_fetchadd_32 atomic_fetchadd_int #define atomic_testandset_32 atomic_testandset_int +#define atomic_testandclear_32 atomic_testandclear_int /* Operations on 64-bit quad words. */ #define atomic_set_64 atomic_set_long @@ -560,6 +597,7 @@ u_long atomic_swap_long(volatile u_long #define atomic_readandclear_64 atomic_readandclear_long #define atomic_fetchadd_64 atomic_fetchadd_long #define atomic_testandset_64 atomic_testandset_long +#define atomic_testandclear_64 atomic_testandclear_long /* Operations on pointers. */ #define atomic_set_ptr atomic_set_long Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Mon May 16 07:12:04 2016 (r299911) +++ head/sys/i386/include/atomic.h Mon May 16 07:19:33 2016 (r299912) @@ -108,6 +108,7 @@ void atomic_##NAME##_barr_##TYPE(volatil int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); int atomic_testandset_int(volatile u_int *p, u_int v); +int atomic_testandclear_int(volatile u_int *p, u_int v); void atomic_thread_fence_acq(void); void atomic_thread_fence_acq_rel(void); void atomic_thread_fence_rel(void); @@ -250,6 +251,23 @@ atomic_testandset_int(volatile u_int *p, return (res); } +static __inline int +atomic_testandclear_int(volatile u_int *p, u_int v) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " btrl %2,%1 ; " + " setc %0 ; " + "# atomic_testandclear_int" + : "=q" (res), /* 0 */ + "+m" (*p) /* 1 */ + : "Ir" (v & 0x1f) /* 2 */ + : "cc"); + return (res); +} + /* * We assume that a = b will do atomic loads and stores. Due to the * IA32 memory model, a simple store guarantees release semantics. @@ -602,6 +620,13 @@ atomic_testandset_long(volatile u_long * return (atomic_testandset_int((volatile u_int *)p, v)); } +static __inline int +atomic_testandclear_long(volatile u_long *p, u_int v) +{ + + return (atomic_testandclear_int((volatile u_int *)p, v)); +} + /* Read the current value and store a new value in the destination. */ #ifdef __GNUCLIKE_ASM @@ -728,6 +753,7 @@ u_long atomic_swap_long(volatile u_long #define atomic_readandclear_32 atomic_readandclear_int #define atomic_fetchadd_32 atomic_fetchadd_int #define atomic_testandset_32 atomic_testandset_int +#define atomic_testandclear_32 atomic_testandclear_int /* Operations on pointers. */ #define atomic_set_ptr(p, v) \ From owner-svn-src-all@freebsd.org Mon May 16 07:23:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83F69B3C853; Mon, 16 May 2016 07:23:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51A8916D0; Mon, 16 May 2016 07:23:25 +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 u4G7NOVo078896; Mon, 16 May 2016 07:23:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7NOBU078895; Mon, 16 May 2016 07:23:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605160723.u4G7NOBU078895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 07:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299913 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:23:25 -0000 Author: avg Date: Mon May 16 07:23:24 2016 New Revision: 299913 URL: https://svnweb.freebsd.org/changeset/base/299913 Log: dounmount: do not call mountcheckdirs() for mounts with MNT_IGNORE This is a bit hackish, but the flag is currently set only for ZFS snapshots mounted under .zfs. mountcheckdirs() can change cdir/rdir references to a covered vnode. But for the said snapshots the covered vnode is really ephemeral and it must never be accessed (except for a few specific cases). To do: consider removing mountcheckdirs() entirely MFC after: 5 days Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon May 16 07:19:33 2016 (r299912) +++ head/sys/kern/vfs_mount.c Mon May 16 07:23:24 2016 (r299913) @@ -1298,7 +1298,8 @@ dounmount(struct mount *mp, int flags, s */ if ((flags & MNT_FORCE) && VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) { - if (mp->mnt_vnodecovered != NULL) + if (mp->mnt_vnodecovered != NULL && + (mp->mnt_flag & MNT_IGNORE) == 0) mountcheckdirs(fsrootvp, mp->mnt_vnodecovered); if (fsrootvp == rootvnode) { vrele(rootvnode); @@ -1319,7 +1320,8 @@ dounmount(struct mount *mp, int flags, s if (error && error != ENXIO) { if ((flags & MNT_FORCE) && VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) { - if (mp->mnt_vnodecovered != NULL) + if (mp->mnt_vnodecovered != NULL && + (mp->mnt_flag & MNT_IGNORE) == 0) mountcheckdirs(mp->mnt_vnodecovered, fsrootvp); if (rootvnode == NULL) { rootvnode = fsrootvp; From owner-svn-src-all@freebsd.org Mon May 16 07:24:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B45B3C8F2; Mon, 16 May 2016 07:24:31 +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 6453A187D; Mon, 16 May 2016 07:24:31 +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 u4G7OUqN078972; Mon, 16 May 2016 07:24:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7OUH0078971; Mon, 16 May 2016 07:24:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605160724.u4G7OUH0078971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 07:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299914 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:24:31 -0000 Author: avg Date: Mon May 16 07:24:30 2016 New Revision: 299914 URL: https://svnweb.freebsd.org/changeset/base/299914 Log: zfsctl_ops_snapshot: remove methods should never be called We pretend that snapshots mounted under .zfs are part of the original filesystem and we try very hard to hide vnodes on top of which the snapshots are mounted. Given that I believe that the removed operations should never be called. They might have been called previously because of issues fixed in r299906, r299908 and r299913. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 07:23:24 2016 (r299913) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 07:24:30 2016 (r299914) @@ -1522,99 +1522,6 @@ zfsctl_snapshot_reclaim(ap) } static int -zfsctl_traverse_begin(vnode_t **vpp, int lktype) -{ - - VN_HOLD(*vpp); - /* Snapshot should be already mounted, but just in case. */ - if (vn_mountedvfs(*vpp) == NULL) - return (ENOENT); - return (traverse(vpp, lktype)); -} - -static void -zfsctl_traverse_end(vnode_t *vp, int err) -{ - - if (err == 0) - vput(vp); - else - VN_RELE(vp); -} - -static int -zfsctl_snapshot_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - } */ *ap; -{ - vnode_t *vp = ap->a_vp; - int err; - - err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY); - if (err == 0) - err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred); - zfsctl_traverse_end(vp, err); - return (err); -} - -static int -zfsctl_snapshot_fid(ap) - struct vop_fid_args /* { - struct vnode *a_vp; - struct fid *a_fid; - } */ *ap; -{ - vnode_t *vp = ap->a_vp; - int err; - - err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY); - if (err == 0) - err = VOP_VPTOFH(vp, (void *)ap->a_fid); - zfsctl_traverse_end(vp, err); - return (err); -} - -static int -zfsctl_snapshot_lookup(ap) - struct vop_lookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; -{ - vnode_t *dvp = ap->a_dvp; - vnode_t **vpp = ap->a_vpp; - struct componentname *cnp = ap->a_cnp; - cred_t *cr = ap->a_cnp->cn_cred; - zfsvfs_t *zfsvfs = dvp->v_vfsp->vfs_data; - int error; - - if (cnp->cn_namelen != 2 || cnp->cn_nameptr[0] != '.' || - cnp->cn_nameptr[1] != '.') { - return (ENOENT); - } - - ASSERT(dvp->v_type == VDIR); - ASSERT(zfsvfs->z_ctldir != NULL); - - error = zfsctl_root_lookup(zfsvfs->z_ctldir, "snapshot", vpp, - NULL, 0, NULL, cr, NULL, NULL, NULL); - if (error == 0) { - int ltype = VOP_ISLOCKED(dvp); - VN_HOLD(*vpp); - VOP_UNLOCK(dvp, 0); - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); - VN_RELE(*vpp); - vn_lock(dvp, ltype | LK_RETRY); - } - - return (error); -} - -static int zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap) { zfsvfs_t *zfsvfs = ap->a_vp->v_vfsp->vfs_data; @@ -1663,10 +1570,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc static struct vop_vector zfsctl_ops_snapshot = { .vop_default = &default_vnodeops, .vop_inactive = VOP_NULL, - .vop_lookup = zfsctl_snapshot_lookup, .vop_reclaim = zfsctl_snapshot_reclaim, - .vop_getattr = zfsctl_snapshot_getattr, - .vop_fid = zfsctl_snapshot_fid, .vop_vptocnp = zfsctl_snapshot_vptocnp, }; From owner-svn-src-all@freebsd.org Mon May 16 07:27:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CC34B3C9FD; Mon, 16 May 2016 07:27:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0B21E1AC1; Mon, 16 May 2016 07:27:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA07508; Mon, 16 May 2016 10:27:27 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1b2Cw3-000HJU-JP; Mon, 16 May 2016 10:27:27 +0300 Subject: Re: svn commit: r299913 - head/sys/kern To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201605160723.u4G7NOBU078895@repo.freebsd.org> From: Andriy Gapon Message-ID: <0ab9a696-a438-248e-6a96-bdbc6b7d8be7@FreeBSD.org> Date: Mon, 16 May 2016 10:26:26 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605160723.u4G7NOBU078895@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:27:31 -0000 On 16/05/2016 10:23, Andriy Gapon wrote: > Author: avg > Date: Mon May 16 07:23:24 2016 > New Revision: 299913 > URL: https://svnweb.freebsd.org/changeset/base/299913 > > Log: > dounmount: do not call mountcheckdirs() for mounts with MNT_IGNORE > > This is a bit hackish, but the flag is currently set only for ZFS > snapshots mounted under .zfs. mountcheckdirs() can change cdir/rdir > references to a covered vnode. But for the said snapshots the covered > vnode is really ephemeral and it must never be accessed (except > for a few specific cases). > > To do: consider removing mountcheckdirs() entirely > > MFC after: 5 days This was supposed to be 5 weeks. -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon May 16 07:29:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EACDFB3CA70; Mon, 16 May 2016 07:29:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7C381CA4; Mon, 16 May 2016 07:29:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G7TooO079194; Mon, 16 May 2016 07:29:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7To3V079193; Mon, 16 May 2016 07:29:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160729.u4G7To3V079193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 07:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299915 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:29:52 -0000 Author: arybchik Date: Mon May 16 07:29:50 2016 New Revision: 299915 URL: https://svnweb.freebsd.org/changeset/base/299915 Log: sfxge(4): improve TX/RX queue error messages Report the full error descriptor in a form that can be passed to firmwaresrc/dpcpu/scripts/evdecode Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Mon May 16 07:24:30 2016 (r299914) +++ head/sys/dev/sfxge/common/ef10_ev.c Mon May 16 07:29:50 2016 (r299915) @@ -871,7 +871,9 @@ ef10_ev_mcdi( */ enp->en_reset_flags |= EFX_RESET_TXQ_ERR; - EFSYS_PROBE1(tx_descq_err, uint32_t, MCDI_EV_FIELD(eqp, DATA)); + EFSYS_PROBE2(tx_descq_err, + uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_1), + uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_0)); /* Inform the driver that a reset is required. */ eecp->eec_exception(arg, EFX_EXCEPTION_TX_ERROR, @@ -911,7 +913,9 @@ ef10_ev_mcdi( */ enp->en_reset_flags |= EFX_RESET_RXQ_ERR; - EFSYS_PROBE1(rx_descq_err, uint32_t, MCDI_EV_FIELD(eqp, DATA)); + EFSYS_PROBE2(rx_descq_err, + uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_1), + uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_0)); /* Inform the driver that a reset is required. */ eecp->eec_exception(arg, EFX_EXCEPTION_RX_ERROR, From owner-svn-src-all@freebsd.org Mon May 16 07:31:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE105B3CB8D; Mon, 16 May 2016 07:31:12 +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 B7B531022; Mon, 16 May 2016 07:31:12 +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 u4G7VB1v080324; Mon, 16 May 2016 07:31:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7VBZX080300; Mon, 16 May 2016 07:31:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605160731.u4G7VBZX080300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 07:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299916 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:31:13 -0000 Author: avg Date: Mon May 16 07:31:11 2016 New Revision: 299916 URL: https://svnweb.freebsd.org/changeset/base/299916 Log: vfs_read_dirent: increment ncookies after adding a cookie It seems that at present vfs_read_dirent() is used only with filesystems that do not support cookies, so the bug never manifested itself. MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon May 16 07:29:50 2016 (r299915) +++ head/sys/kern/vfs_subr.c Mon May 16 07:31:11 2016 (r299916) @@ -5053,6 +5053,7 @@ vfs_read_dirent(struct vop_readdir_args *ap->a_cookies = realloc(*ap->a_cookies, (*ap->a_ncookies + 1) * sizeof(u_long), M_TEMP, M_WAITOK | M_ZERO); (*ap->a_cookies)[*ap->a_ncookies] = off; + *ap->a_ncookies += 1; return (0); } From owner-svn-src-all@freebsd.org Mon May 16 07:33:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42292B3CDBD; Mon, 16 May 2016 07:33:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F51A1366; Mon, 16 May 2016 07:33:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G7XvAb082317; Mon, 16 May 2016 07:33:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7Xvaq082316; Mon, 16 May 2016 07:33:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160733.u4G7Xvaq082316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 07:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299917 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:33:58 -0000 Author: arybchik Date: Mon May 16 07:33:56 2016 New Revision: 299917 URL: https://svnweb.freebsd.org/changeset/base/299917 Log: sfxge(4): set TSOv2 feature flag on Medford Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Mon May 16 07:31:11 2016 (r299916) +++ head/sys/dev/sfxge/common/efx_nic.c Mon May 16 07:33:56 2016 (r299917) @@ -307,7 +307,8 @@ efx_nic_create( EFX_FEATURE_MCDI | EFX_FEATURE_MAC_HEADER_FILTERS | EFX_FEATURE_MCDI_DMA | - EFX_FEATURE_PIO_BUFFERS; + EFX_FEATURE_PIO_BUFFERS | + EFX_FEATURE_FW_ASSISTED_TSO_V2; break; #endif /* EFSYS_OPT_MEDFORD */ From owner-svn-src-all@freebsd.org Mon May 16 07:45:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E11EB3D0FC; Mon, 16 May 2016 07:45:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F02C71C15; Mon, 16 May 2016 07:45:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G7jiiN085338; Mon, 16 May 2016 07:45:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7jiIY085337; Mon, 16 May 2016 07:45:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160745.u4G7jiIY085337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 07:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299918 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:45:45 -0000 Author: arybchik Date: Mon May 16 07:45:43 2016 New Revision: 299918 URL: https://svnweb.freebsd.org/changeset/base/299918 Log: fxge(4): cleanup: run genfwdef to propogate prior changes to TLV headers Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon May 16 07:33:56 2016 (r299917) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon May 16 07:45:43 2016 (r299918) @@ -776,6 +776,39 @@ struct tlv_pcie_link_settings { uint16_t width; /* Number of lanes */ }; +/* TX event merging config. + * + * Sets the global maximum number of events for the merging bins, and the + * global timeout configuration for the bins, and the global timeout for + * empty queues. + */ +#define TLV_TAG_TX_EVENT_MERGING_CONFIG (0x10210000) +struct tlv_tx_event_merging_config { + uint32_t tag; + uint32_t length; + uint32_t max_events; +#define TLV_TX_EVENT_MERGING_CONFIG_MAX_EVENTS_MAX ((1 << 4) - 1) + uint32_t timeout_ns; + uint32_t qempty_timeout_ns; /* Medford only */ +}; +#define TLV_TX_EVENT_MERGING_MAX_EVENTS_DEFAULT 7 +#define TLV_TX_EVENT_MERGING_TIMEOUT_NS_DEFAULT 1400 +#define TLV_TX_EVENT_MERGING_QEMPTY_TIMEOUT_NS_DEFAULT 700 + +/* Tx vFIFO Low latency configuration + * + * To keep the desired booting behaviour for the switch, it just requires to + * know if the low latency mode is enabled. + */ + +#define TLV_TAG_TX_VFIFO_ULL_MODE (0x10220000) +struct tlv_tx_vfifo_ull_mode { + uint32_t tag; + uint32_t length; + uint8_t mode; +#define TLV_TX_VFIFO_ULL_MODE_DEFAULT 0 +}; + #define TLV_TAG_LICENSE (0x30800000) typedef struct tlv_license { @@ -784,4 +817,104 @@ typedef struct tlv_license { uint8_t data[]; } tlv_license_t; +/* TSA NIC IP address configuration + * + * Sets the TSA NIC IP address statically via configuration tool or dynamically + * via DHCP via snooping based on the mode selection (0=Static, 1=DHCP, 2=Snoop) + * + * NOTE: This TAG is temporarily placed in the dynamic config partition and will + * be moved to a private partition during TSA development. It is not used in any + * released code yet. + */ + +#define TLV_TAG_TMP_TSAN_CONFIG (0x10220000) + +#define TLV_TSAN_IP_MODE_STATIC (0) +#define TLV_TSAN_IP_MODE_DHCP (1) +#define TLV_TSAN_IP_MODE_SNOOP (2) +typedef struct tlv_tsan_config { + uint32_t tag; + uint32_t length; + uint32_t mode; + uint32_t ip; + uint32_t netmask; + uint32_t gateway; + uint32_t port; + uint32_t bind_retry; + uint32_t bind_bkout; +} tlv_tsan_config_t; + +/* TSA Controller IP address configuration + * + * Sets the TSA Controller IP address statically via configuration tool + * + * NOTE: This TAG is temporarily placed in the dynamic config partition and will + * be moved to a private partition during TSA development. It is not used in any + * released code yet. + */ + +#define TLV_TAG_TMP_TSAC_CONFIG (0x10230000) + +#define TLV_MAX_TSACS (4) +typedef struct tlv_tsac_config { + uint32_t tag; + uint32_t length; + uint32_t num_tsacs; + uint32_t ip[TLV_MAX_TSACS]; + uint32_t port[TLV_MAX_TSACS]; +} tlv_tsac_config_t; + +/* Binding ticket + * + * Sets the TSA NIC binding ticket used for binding process between the TSA NIC + * and the TSA Controller + * + * NOTE: This TAG is temporarily placed in the dynamic config partition and will + * be moved to a private partition during TSA development. It is not used in any + * released code yet. + */ + +#define TLV_TAG_TMP_BINDING_TICKET (0x10240000) + +typedef struct tlv_binding_ticket { + uint32_t tag; + uint32_t length; + uint8_t bytes[]; +} tlv_binding_ticket_t; + +/* Solarflare private key + * + * Sets the Solareflare private key used for signing during the binding process + * + * NOTE: This TAG is temporarily placed in the dynamic config partition and will + * be moved to a private partition during TSA development. It is not used in any + * released code yet. + */ + +#define TLV_TAG_TMP_PIK_SF (0x10250000) + +typedef struct tlv_pik_sf { + uint32_t tag; + uint32_t length; + uint8_t bytes[]; +} tlv_pik_sf_t; + +/* CA root certificate + * + * Sets the CA root certificate used for TSA Controller verfication during + * TLS connection setup between the TSA NIC and the TSA Controller + * + * NOTE: This TAG is temporarily placed in the dynamic config partition and will + * be moved to a private partition during TSA development. It is not used in any + * released code yet. + */ + +#define TLV_TAG_TMP_CA_ROOT_CERT (0x10260000) + +typedef struct tlv_ca_root_cert { + uint32_t tag; + uint32_t length; + uint8_t bytes[]; +} tlv_ca_root_cert_t; + #endif /* CI_MGMT_TLV_LAYOUT_H */ From owner-svn-src-all@freebsd.org Mon May 16 07:47:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19EC1B3D18B; Mon, 16 May 2016 07:47:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBC151DC7; Mon, 16 May 2016 07:47:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G7lLQ6085441; Mon, 16 May 2016 07:47:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G7lLrt085440; Mon, 16 May 2016 07:47:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160747.u4G7lLrt085440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 07:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299919 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 07:47:22 -0000 Author: arybchik Date: Mon May 16 07:47:20 2016 New Revision: 299919 URL: https://svnweb.freebsd.org/changeset/base/299919 Log: sfxge(4): translate MC_CMD_ERR_EEXIST to host errno value This is needed because the new MCDI command nvram_private_append can return MC_CMD_ERR_EEXIST Submitted by: Tom Millington Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Mon May 16 07:45:43 2016 (r299918) +++ head/sys/dev/sfxge/common/efx_mcdi.c Mon May 16 07:47:20 2016 (r299919) @@ -632,6 +632,8 @@ efx_mcdi_request_errcode( return (EALREADY); /* MCDI v2 */ + case MC_CMD_ERR_EEXIST: + return (EEXIST); #ifdef MC_CMD_ERR_EAGAIN case MC_CMD_ERR_EAGAIN: return (EAGAIN); From owner-svn-src-all@freebsd.org Mon May 16 08:04:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9656B3D949; Mon, 16 May 2016 08:04:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6C8E1A67; Mon, 16 May 2016 08:04:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G84ep0091346; Mon, 16 May 2016 08:04:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G84eOe091345; Mon, 16 May 2016 08:04:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160804.u4G84eOe091345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 08:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299920 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:04:42 -0000 Author: arybchik Date: Mon May 16 08:04:40 2016 New Revision: 299920 URL: https://svnweb.freebsd.org/changeset/base/299920 Log: sfxge(4): cleanup: simplify ef10_ev_qcreate Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Mon May 16 07:47:20 2016 (r299919) +++ head/sys/dev/sfxge/common/ef10_ev.c Mon May 16 08:04:40 2016 (r299920) @@ -92,8 +92,7 @@ efx_mcdi_init_evq( __in unsigned int instance, __in efsys_mem_t *esmp, __in size_t nevs, - __in uint32_t irq, - __out_opt uint32_t *irqp) + __in uint32_t irq) { efx_mcdi_req_t req; uint8_t payload[ @@ -175,8 +174,7 @@ efx_mcdi_init_evq( goto fail3; } - if (irqp != NULL) - *irqp = MCDI_OUT_DWORD(req, INIT_EVQ_OUT_IRQ); + /* NOTE: ignore the returned IRQ param as firmware does not set it. */ return (0); @@ -275,12 +273,9 @@ ef10_ev_qcreate( eep->ee_drv_gen = ef10_ev_drv_gen; eep->ee_mcdi = ef10_ev_mcdi; - /* - * Set up the event queue - * NOTE: ignore the returned IRQ param as firmware does not set it. - */ + /* Set up the event queue */ irq = index; /* INIT_EVQ expects function-relative vector number */ - if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, NULL)) != 0) + if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq)) != 0) goto fail3; return (0); From owner-svn-src-all@freebsd.org Mon May 16 08:07:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88600B3DA36; Mon, 16 May 2016 08:07:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58A131C94; Mon, 16 May 2016 08:07:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G87WdQ091483; Mon, 16 May 2016 08:07:32 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G87WeO091482; Mon, 16 May 2016 08:07:32 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160807.u4G87WeO091482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 08:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299921 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:07:33 -0000 Author: truckman Date: Mon May 16 08:07:32 2016 New Revision: 299921 URL: https://svnweb.freebsd.org/changeset/base/299921 Log: Add an assertion to catch a potential underflow in an array index calculation, though this should not happen in the current code. Reported by: Coverity CID: 1008486 MFC after: 3 weeks Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon May 16 08:04:40 2016 (r299920) +++ head/sbin/ifconfig/ifieee80211.c Mon May 16 08:07:32 2016 (r299921) @@ -3753,6 +3753,7 @@ list_txpow(int s) /* suppress duplicates as above */ if (isset(reported, c->ic_ieee) && !verbose) { /* XXX we assume duplicates are adjacent */ + assert(achans->ic_nchans > 0); prev = &achans->ic_chans[achans->ic_nchans-1]; /* display highest power on channel */ if (c->ic_maxpower > prev->ic_maxpower) From owner-svn-src-all@freebsd.org Mon May 16 08:13:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A28BCB3DBCD; Mon, 16 May 2016 08:13:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 624871058; Mon, 16 May 2016 08:13:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G8DUAN094517; Mon, 16 May 2016 08:13:30 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G8DUB3094516; Mon, 16 May 2016 08:13:30 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160813.u4G8DUB3094516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 08:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299922 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:13:31 -0000 Author: truckman Date: Mon May 16 08:13:30 2016 New Revision: 299922 URL: https://svnweb.freebsd.org/changeset/base/299922 Log: Don't call free_addrselectpolicy(&policyhead) before policyhead has been initialized. Reported by: Coverity CID: 1018727 Modified: head/lib/libc/net/name6.c Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Mon May 16 08:07:32 2016 (r299921) +++ head/lib/libc/net/name6.c Mon May 16 08:13:30 2016 (r299922) @@ -655,7 +655,6 @@ _hpreorder(struct hostent *hp) #endif break; default: - free_addrselectpolicy(&policyhead); return hp; } From owner-svn-src-all@freebsd.org Mon May 16 08:15:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0ACB3DC30; Mon, 16 May 2016 08:15:12 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EE1C211E4; Mon, 16 May 2016 08:15:11 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4G8F243070422; Mon, 16 May 2016 01:15:06 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605160815.u4G8F243070422@gw.catspoiler.org> Date: Mon, 16 May 2016 01:15:02 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299922 - head/lib/libc/net To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605160813.u4G8DUB3094516@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:15:12 -0000 On 16 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Mon May 16 08:13:30 2016 > New Revision: 299922 > URL: https://svnweb.freebsd.org/changeset/base/299922 > > Log: > Don't call free_addrselectpolicy(&policyhead) before policyhead has been > initialized. > > Reported by: Coverity > CID: 1018727 MFC after: 1 week From owner-svn-src-all@freebsd.org Mon May 16 08:27:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 234D5B3DDD0; Mon, 16 May 2016 08:27:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6E5B184A; Mon, 16 May 2016 08:27:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G8RLUW097786; Mon, 16 May 2016 08:27:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G8RKwr097785; Mon, 16 May 2016 08:27:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160827.u4G8RKwr097785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 08:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299923 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:27:22 -0000 Author: arybchik Date: Mon May 16 08:27:20 2016 New Revision: 299923 URL: https://svnweb.freebsd.org/changeset/base/299923 Log: sfxge(4): cleanup: make MCDI license queries quieter in common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Mon May 16 08:13:30 2016 (r299922) +++ head/sys/dev/sfxge/common/efx_lic.c Mon May 16 08:27:20 2016 (r299923) @@ -408,7 +408,7 @@ efx_mcdi_fc_license_get_key_stats( MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP, MC_CMD_FC_IN_LICENSE_GET_KEY_STATS); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; @@ -935,7 +935,7 @@ efx_mcdi_licensing_v3_report_license( MCDI_IN_SET_DWORD(req, LICENSING_V3_IN_OP, MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; @@ -1062,7 +1062,7 @@ efx_mcdi_licensing_v3_get_id( (void) memset(bufferp, 0, req.emr_out_length); } - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; From owner-svn-src-all@freebsd.org Mon May 16 08:28:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2DA9B3DEE2; Mon, 16 May 2016 08:28:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B087B1A2F; Mon, 16 May 2016 08:28:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G8SRwK097864; Mon, 16 May 2016 08:28:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G8SRHM097863; Mon, 16 May 2016 08:28:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160828.u4G8SRHM097863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 08:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299924 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:28:29 -0000 Author: arybchik Date: Mon May 16 08:28:27 2016 New Revision: 299924 URL: https://svnweb.freebsd.org/changeset/base/299924 Log: sfxge(4): cleanup: remove misnamed function declaration Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Mon May 16 08:27:20 2016 (r299923) +++ head/sys/dev/sfxge/common/efx_impl.h Mon May 16 08:28:27 2016 (r299924) @@ -461,14 +461,6 @@ typedef struct efx_nvram_ops_s { } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ -extern __checkReturn efx_rc_t -efx_nvram_tlv_validate( - __in efx_nic_t *enp, - __in uint32_t partn, - __in_bcount(partn_size) caddr_t partn_data, - __in size_t partn_size); - - #if EFSYS_OPT_VPD typedef struct efx_vpd_ops_s { efx_rc_t (*evpdo_init)(efx_nic_t *); From owner-svn-src-all@freebsd.org Mon May 16 08:32:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7AA1B3D044; Mon, 16 May 2016 08:32:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BA3F1DFD; Mon, 16 May 2016 08:32:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G8WL0f000731; Mon, 16 May 2016 08:32:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G8WLw9000726; Mon, 16 May 2016 08:32:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605160832.u4G8WLw9000726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 May 2016 08:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299925 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:32:22 -0000 Author: arybchik Date: Mon May 16 08:32:21 2016 New Revision: 299925 URL: https://svnweb.freebsd.org/changeset/base/299925 Log: sfxge(4): cleanup: quieten more common code MCDI handlers Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Mon May 16 08:28:27 2016 (r299924) +++ head/sys/dev/sfxge/common/ef10_ev.c Mon May 16 08:32:21 2016 (r299925) @@ -207,7 +207,7 @@ efx_mcdi_fini_evq( MCDI_IN_SET_DWORD(req, FINI_EVQ_IN_INSTANCE, instance); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Mon May 16 08:28:27 2016 (r299924) +++ head/sys/dev/sfxge/common/ef10_filter.c Mon May 16 08:32:21 2016 (r299925) @@ -353,7 +353,7 @@ efx_mcdi_filter_op_delete( MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, handle->efh_lo); MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, handle->efh_hi); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Mon May 16 08:28:27 2016 (r299924) +++ head/sys/dev/sfxge/common/ef10_nic.c Mon May 16 08:32:21 2016 (r299925) @@ -765,7 +765,7 @@ efx_mcdi_unlink_piobuf( MCDI_IN_SET_DWORD(req, UNLINK_PIOBUF_IN_TXQ_INSTANCE, vi_index); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Mon May 16 08:28:27 2016 (r299924) +++ head/sys/dev/sfxge/common/ef10_rx.c Mon May 16 08:32:21 2016 (r299925) @@ -127,7 +127,7 @@ efx_mcdi_fini_rxq( MCDI_IN_SET_DWORD(req, FINI_RXQ_IN_INSTANCE, instance); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { rc = req.emr_rc; @@ -249,7 +249,7 @@ efx_mcdi_rss_context_free( MCDI_IN_SET_DWORD(req, RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID, rss_context); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Mon May 16 08:28:27 2016 (r299924) +++ head/sys/dev/sfxge/common/ef10_tx.c Mon May 16 08:32:21 2016 (r299925) @@ -149,7 +149,7 @@ efx_mcdi_fini_txq( MCDI_IN_SET_DWORD(req, FINI_TXQ_IN_INSTANCE, instance); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { rc = req.emr_rc; From owner-svn-src-all@freebsd.org Mon May 16 08:34:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E97D7B3D0D1; Mon, 16 May 2016 08:34:18 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6F0C1FFE; Mon, 16 May 2016 08:34:18 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4G8YHPU000851; Mon, 16 May 2016 08:34:17 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G8YH1C000850; Mon, 16 May 2016 08:34:17 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605160834.u4G8YH1C000850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 08:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299926 - head/lib/libpam/modules/pam_unix X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:34:19 -0000 Author: truckman Date: Mon May 16 08:34:17 2016 New Revision: 299926 URL: https://svnweb.freebsd.org/changeset/base/299926 Log: Hoist the getpwnam() call outside the first if/else block in pam_sm_chauthtok(). Set user = getlogin() inside the true branch so that it is initialized for the following PAM_LOG() call. This is how it is done in pam_sm_authenticate(). Reported by: Coverity CID: 272498 MFC after: 1 week Modified: head/lib/libpam/modules/pam_unix/pam_unix.c Modified: head/lib/libpam/modules/pam_unix/pam_unix.c ============================================================================== --- head/lib/libpam/modules/pam_unix/pam_unix.c Mon May 16 08:32:21 2016 (r299925) +++ head/lib/libpam/modules/pam_unix/pam_unix.c Mon May 16 08:34:17 2016 (r299926) @@ -278,13 +278,13 @@ pam_sm_chauthtok(pam_handle_t *pamh, int int pfd, tfd, retval; if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) - pwd = getpwnam(getlogin()); + user = getlogin(); else { retval = pam_get_user(pamh, &user, NULL); if (retval != PAM_SUCCESS) return (retval); - pwd = getpwnam(user); } + pwd = getpwnam(user); if (pwd == NULL) return (PAM_AUTHTOK_RECOVERY_ERR); From owner-svn-src-all@freebsd.org Mon May 16 08:50:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F95BB3D568; Mon, 16 May 2016 08:50: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 45CE01AD9; Mon, 16 May 2016 08:50: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 u4G8oWNJ004320; Mon, 16 May 2016 08:50:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G8oWkq004319; Mon, 16 May 2016 08:50:32 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605160850.u4G8oWkq004319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 16 May 2016 08:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299927 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 08:50:33 -0000 Author: sephe Date: Mon May 16 08:50:32 2016 New Revision: 299927 URL: https://svnweb.freebsd.org/changeset/base/299927 Log: hyperv/vmbus: Use atomic_testandclear Prepare to use unsigned long for event channel bit array. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6382 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 08:34:17 2016 (r299926) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 08:50:32 2016 (r299927) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -313,7 +314,7 @@ hv_vmbus_on_events(int cpu) /* * receive size is 1/2 page and divide that by 4 bytes */ - if (synch_test_and_clear_bit(0, &event->flags32[0])) { + if (atomic_testandclear_int(&event->flags32[0], 0)) { recv_interrupt_page = hv_vmbus_g_connection.recv_interrupt_page; } else { @@ -337,8 +338,8 @@ hv_vmbus_on_events(int cpu) continue; for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) { - if (synch_test_and_clear_bit(bit, - (uint32_t *)&recv_interrupt_page[dword])) { + if (atomic_testandclear_int( + &recv_interrupt_page[dword], bit)) { struct hv_vmbus_channel *channel; rel_id = (dword << 5) + bit; From owner-svn-src-all@freebsd.org Mon May 16 09:11:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F158CB3DC89; Mon, 16 May 2016 09:11:41 +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 C0C131847; Mon, 16 May 2016 09:11:41 +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 u4G9Bfgh013041; Mon, 16 May 2016 09:11:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G9Be5W013033; Mon, 16 May 2016 09:11:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605160911.u4G9Be5W013033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 09:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299928 - in head/sys: arm/arm conf dev/pci kern mips/mediatek sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 09:11:42 -0000 Author: andrew Date: Mon May 16 09:11:40 2016 New Revision: 299928 URL: https://svnweb.freebsd.org/changeset/base/299928 Log: Introduce MSI and MSI-X support to intrng. This adds a new msi device interface with 5 methods to mirror the 5 MSI/MSI-X methods in the pcib interface. The pcib driver will need to perform a device specific lookup to find the MSI controller and pass this to intrng as the xref. Intrng will finally find the controller and have it handle the requested operation. Obtained from: ABT Systems Ltd MFH: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5985 Added: head/sys/kern/msi_if.m (contents, props changed) Modified: head/sys/arm/arm/gic.c head/sys/conf/files.arm head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h head/sys/kern/subr_intr.c head/sys/mips/mediatek/files.mediatek head/sys/sys/intr.h Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Mon May 16 08:50:32 2016 (r299927) +++ head/sys/arm/arm/gic.c Mon May 16 09:11:40 2016 (r299928) @@ -53,6 +53,10 @@ __FBSDID("$FreeBSD$"); #ifdef INTRNG #include #endif + +#include +#include + #include #include #include @@ -64,6 +68,7 @@ __FBSDID("$FreeBSD$"); #ifdef INTRNG #include "pic_if.h" +#include "msi_if.h" #endif #define GIC_DEBUG_SPURIOUS @@ -123,6 +128,10 @@ struct gic_irqsrc { enum intr_polarity gi_pol; enum intr_trigger gi_trig; #define GI_FLAG_EARLY_EOI (1 << 0) +#define GI_FLAG_MSI (1 << 1) /* This interrupt source should only */ + /* be used for MSI/MSI-X interrupts */ +#define GI_FLAG_MSI_USED (1 << 2) /* This irq is already allocated */ + /* for a MSI/MSI-X interrupt */ u_int gi_flags; }; @@ -562,6 +571,33 @@ arm_gic_add_children(device_t dev) return (true); } + +static void +arm_gic_reserve_msi_range(device_t dev, u_int start, u_int count) +{ + struct arm_gic_softc *sc; + int i; + + sc = device_get_softc(dev); + + KASSERT((start + count) < sc->nirqs, + ("%s: Trying to allocate too many MSI IRQs: %d + %d > %d", __func__, + start, count, sc->nirqs)); + for (i = 0; i < count; i++) { + KASSERT(sc->gic_irqs[start + i].gi_isrc.isrc_handlers == 0, + ("%s: MSI interrupt %d already has a handler", __func__, + count + i)); + KASSERT(sc->gic_irqs[start + i].gi_pol == INTR_POLARITY_CONFORM, + ("%s: MSI interrupt %d already has a polarity", __func__, + count + i)); + KASSERT(sc->gic_irqs[start + i].gi_trig == INTR_TRIGGER_CONFORM, + ("%s: MSI interrupt %d already has a trigger", __func__, + count + i)); + sc->gic_irqs[start + i].gi_pol = INTR_POLARITY_HIGH; + sc->gic_irqs[start + i].gi_trig = INTR_TRIGGER_EDGE; + sc->gic_irqs[start + i].gi_flags |= GI_FLAG_MSI; + } +} #endif static int @@ -1018,6 +1054,10 @@ gic_map_intr(device_t dev, struct intr_m if (gic_map_fdt(dev, daf->ncells, daf->cells, &irq, &pol, &trig) != 0) return (EINVAL); + KASSERT(irq >= sc->nirqs || + (sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) == 0, + ("%s: Attempting to map a MSI interrupt from FDT", + __func__)); break; #endif default: @@ -1067,15 +1107,23 @@ arm_gic_setup_intr(device_t dev, struct enum intr_trigger trig; enum intr_polarity pol; - if (data == NULL) - return (ENOTSUP); - - /* Get config for resource. */ - if (gic_map_intr(dev, data, &irq, &pol, &trig)) - return (EINVAL); + if ((gi->gi_flags & GI_FLAG_MSI) == GI_FLAG_MSI) { + irq = gi->gi_irq; + pol = gi->gi_pol; + trig = gi->gi_trig; + KASSERT(pol == INTR_POLARITY_HIGH, + ("%s: MSI interrupts must be active-high", __func__)); + KASSERT(trig == INTR_TRIGGER_EDGE, + ("%s: MSI interrupts must be edge triggered", __func__)); + } else if (data != NULL) { + /* Get config for resource. */ + if (gic_map_intr(dev, data, &irq, &pol, &trig)) + return (EINVAL); - if (gi->gi_irq != irq) - return (EINVAL); + if (gi->gi_irq != irq) + return (EINVAL); + } else + return (ENOTSUP); /* Compare config if this is not first setup. */ if (isrc->isrc_handlers != 0) { @@ -1086,16 +1134,20 @@ arm_gic_setup_intr(device_t dev, struct return (0); } - if (pol == INTR_POLARITY_CONFORM) - pol = INTR_POLARITY_LOW; /* just pick some */ - if (trig == INTR_TRIGGER_CONFORM) - trig = INTR_TRIGGER_EDGE; /* just pick some */ - - gi->gi_pol = pol; - gi->gi_trig = trig; - /* Edge triggered interrupts need an early EOI sent */ - if (gi->gi_pol == INTR_TRIGGER_EDGE) - gi->gi_flags |= GI_FLAG_EARLY_EOI; + /* For MSI/MSI-X we should have already configured these */ + if ((gi->gi_flags & GI_FLAG_MSI) == 0) { + if (pol == INTR_POLARITY_CONFORM) + pol = INTR_POLARITY_LOW; /* just pick some */ + if (trig == INTR_TRIGGER_CONFORM) + trig = INTR_TRIGGER_EDGE; /* just pick some */ + + gi->gi_pol = pol; + gi->gi_trig = trig; + + /* Edge triggered interrupts need an early EOI sent */ + if (gi->gi_pol == INTR_TRIGGER_EDGE) + gi->gi_flags |= GI_FLAG_EARLY_EOI; + } /* * XXX - In case that per CPU interrupt is going to be enabled in time @@ -1107,7 +1159,7 @@ arm_gic_setup_intr(device_t dev, struct if (isrc->isrc_flags & INTR_ISRCF_PPI) CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); - gic_config(sc, gi->gi_irq, trig, pol); + gic_config(sc, gi->gi_irq, gi->gi_trig, gi->gi_pol); arm_gic_bind_intr(dev, isrc); return (0); } @@ -1118,7 +1170,7 @@ arm_gic_teardown_intr(device_t dev, stru { struct gic_irqsrc *gi = (struct gic_irqsrc *)isrc; - if (isrc->isrc_handlers == 0) { + if (isrc->isrc_handlers == 0 && (gi->gi_flags & GI_FLAG_MSI) == 0) { gi->gi_pol = INTR_POLARITY_CONFORM; gi->gi_trig = INTR_TRIGGER_CONFORM; } @@ -1502,8 +1554,8 @@ struct arm_gicv2m_softc { struct resource *sc_mem; struct mtx sc_mutex; u_int sc_spi_start; + u_int sc_spi_end; u_int sc_spi_count; - u_int sc_spi_offset; }; static struct ofw_compat_data gicv2m_compat_data[] = { @@ -1529,9 +1581,11 @@ static int arm_gicv2m_attach(device_t dev) { struct arm_gicv2m_softc *sc; + struct arm_gic_softc *psc; uint32_t typer; int rid; + psc = device_get_softc(device_get_parent(dev)); sc = device_get_softc(dev); rid = 0; @@ -1545,9 +1599,16 @@ arm_gicv2m_attach(device_t dev) typer = bus_read_4(sc->sc_mem, GICV2M_MSI_TYPER); sc->sc_spi_start = MSI_TYPER_SPI_BASE(typer); sc->sc_spi_count = MSI_TYPER_SPI_COUNT(typer); + sc->sc_spi_end = sc->sc_spi_start + sc->sc_spi_count; + + /* Reserve these interrupts for MSI/MSI-X use */ + arm_gic_reserve_msi_range(device_get_parent(dev), sc->sc_spi_start, + sc->sc_spi_count); mtx_init(&sc->sc_mutex, "GICv2m lock", "", MTX_DEF); + intr_msi_register(dev, gic_xref(dev)); + if (bootverbose) device_printf(dev, "using spi %u to %u\n", sc->sc_spi_start, sc->sc_spi_start + sc->sc_spi_count - 1); @@ -1555,11 +1616,176 @@ arm_gicv2m_attach(device_t dev) return (0); } +static int +arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct arm_gic_softc *psc; + struct arm_gicv2m_softc *sc; + int i, irq, end_irq; + bool found; + + KASSERT(powerof2(count), ("%s: bad count", __func__)); + KASSERT(powerof2(maxcount), ("%s: bad maxcount", __func__)); + + psc = device_get_softc(device_get_parent(dev)); + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mutex); + + found = false; + for (irq = sc->sc_spi_start; irq < sc->sc_spi_end && !found; irq++) { + /* Start on an aligned interrupt */ + if ((irq & (maxcount - 1)) != 0) + continue; + + /* Assume we found a valid range until shown otherwise */ + found = true; + + /* Check this range is valid */ + for (end_irq = irq; end_irq != irq + count - 1; end_irq++) { + /* No free interrupts */ + if (end_irq == sc->sc_spi_end) { + found = false; + break; + } + + KASSERT((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI)!= 0, + ("%s: Non-MSI interrupt found", __func__)); + + /* This is already used */ + if ((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == + GI_FLAG_MSI_USED) { + found = false; + break; + } + } + } + + /* Not enough interrupts were found */ + if (!found || irq == sc->sc_spi_end) { + mtx_unlock(&sc->sc_mutex); + return (ENXIO); + } + + for (i = 0; i < count; i++) { + /* Mark the interrupt as used */ + psc->gic_irqs[irq + i].gi_flags |= GI_FLAG_MSI_USED; + + } + mtx_unlock(&sc->sc_mutex); + + for (i = 0; i < count; i++) + srcs[i] = (struct intr_irqsrc *)&psc->gic_irqs[irq + i]; + *pic = device_get_parent(dev); + + return (0); +} + +static int +arm_gicv2m_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **isrc) +{ + struct arm_gicv2m_softc *sc; + struct gic_irqsrc *gi; + int i; + + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mutex); + for (i = 0; i < count; i++) { + gi = (struct gic_irqsrc *)isrc; + + KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED, + ("%s: Trying to release an unused MSI-X interrupt", + __func__)); + + gi->gi_flags &= ~GI_FLAG_MSI_USED; + mtx_unlock(&sc->sc_mutex); + } + + return (0); +} + +static int +arm_gicv2m_alloc_msix(device_t dev, device_t child, device_t *pic, + struct intr_irqsrc **isrcp) +{ + struct arm_gicv2m_softc *sc; + struct arm_gic_softc *psc; + int irq; + + psc = device_get_softc(device_get_parent(dev)); + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mutex); + /* Find an unused interrupt */ + for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { + KASSERT((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) != 0, + ("%s: Non-MSI interrupt found", __func__)); + if ((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == 0) + break; + } + /* No free interrupt was found */ + if (irq == sc->sc_spi_end) { + mtx_unlock(&sc->sc_mutex); + return (ENXIO); + } + + /* Mark the interrupt as used */ + psc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI_USED; + mtx_unlock(&sc->sc_mutex); + + *isrcp = (struct intr_irqsrc *)&psc->gic_irqs[irq]; + *pic = device_get_parent(dev); + + return (0); +} + +static int +arm_gicv2m_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +{ + struct arm_gicv2m_softc *sc; + struct gic_irqsrc *gi; + + sc = device_get_softc(dev); + gi = (struct gic_irqsrc *)isrc; + + KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED, + ("%s: Trying to release an unused MSI-X interrupt", __func__)); + + mtx_lock(&sc->sc_mutex); + gi->gi_flags &= ~GI_FLAG_MSI_USED; + mtx_unlock(&sc->sc_mutex); + + return (0); +} + +static int +arm_gicv2m_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct arm_gicv2m_softc *sc = device_get_softc(dev); + struct gic_irqsrc *gi = (struct gic_irqsrc *)isrc; + + *addr = vtophys(rman_get_virtual(sc->sc_mem)) + GICv2M_MSI_SETSPI_NS; + *data = gi->gi_irq; + + return (0); +} + static device_method_t arm_gicv2m_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arm_gicv2m_probe), DEVMETHOD(device_attach, arm_gicv2m_attach), + /* MSI/MSI-X */ + DEVMETHOD(msi_alloc_msi, arm_gicv2m_alloc_msi), + DEVMETHOD(msi_release_msi, arm_gicv2m_release_msi), + DEVMETHOD(msi_alloc_msix, arm_gicv2m_alloc_msix), + DEVMETHOD(msi_release_msix, arm_gicv2m_release_msix), + DEVMETHOD(msi_map_msi, arm_gicv2m_map_msi), + /* End */ DEVMETHOD_END }; Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon May 16 08:50:32 2016 (r299927) +++ head/sys/conf/files.arm Mon May 16 09:11:40 2016 (r299928) @@ -114,6 +114,7 @@ font.h optional sc \ compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" +kern/msi_if.m optional intrng kern/pic_if.m optional intrng kern/subr_busdma_bufalloc.c standard kern/subr_devmap.c standard Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon May 16 08:50:32 2016 (r299927) +++ head/sys/dev/pci/pci_host_generic.c Mon May 16 09:11:40 2016 (r299928) @@ -46,6 +46,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(INTRNG) +#include +#endif + #include #include #include @@ -158,6 +162,7 @@ pci_host_generic_attach(device_t dev) uint64_t phys_base; uint64_t pci_base; uint64_t size; + phandle_t node; int error; int tuple; int rid; @@ -227,8 +232,12 @@ pci_host_generic_attach(device_t dev) } } - ofw_bus_setup_iinfo(ofw_bus_get_node(dev), &sc->pci_iinfo, - sizeof(cell_t)); + node = ofw_bus_get_node(dev); + ofw_bus_setup_iinfo(node, &sc->pci_iinfo, sizeof(cell_t)); + + /* Find the MSI interrupt handler */ + OF_searchencprop(node, "msi-parent", &sc->msi_parent, + sizeof(sc->msi_parent)); device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); @@ -661,8 +670,13 @@ static int generic_pcie_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { +#if defined(INTRNG) + struct generic_pcie_softc *sc; -#if defined(__aarch64__) + sc = device_get_softc(pci); + return (intr_alloc_msi(pci, child, sc->msi_parent, count, maxcount, + irqs)); +#elif defined(__aarch64__) return (arm_alloc_msi(pci, child, count, maxcount, irqs)); #else return (ENXIO); @@ -672,8 +686,12 @@ generic_pcie_alloc_msi(device_t pci, dev static int generic_pcie_release_msi(device_t pci, device_t child, int count, int *irqs) { +#if defined(INTRNG) + struct generic_pcie_softc *sc; -#if defined(__aarch64__) + sc = device_get_softc(pci); + return (intr_release_msi(pci, child, sc->msi_parent, count, irqs)); +#elif defined(__aarch64__) return (arm_release_msi(pci, child, count, irqs)); #else return (ENXIO); @@ -684,8 +702,12 @@ static int generic_pcie_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) { +#if defined(INTRNG) + struct generic_pcie_softc *sc; -#if defined(__aarch64__) + sc = device_get_softc(pci); + return (intr_map_msi(pci, child, sc->msi_parent, irq, addr, data)); +#elif defined(__aarch64__) return (arm_map_msi(pci, child, irq, addr, data)); #else return (ENXIO); @@ -695,8 +717,12 @@ generic_pcie_map_msi(device_t pci, devic static int generic_pcie_alloc_msix(device_t pci, device_t child, int *irq) { +#if defined(INTRNG) + struct generic_pcie_softc *sc; -#if defined(__aarch64__) + sc = device_get_softc(pci); + return (intr_alloc_msix(pci, child, sc->msi_parent, irq)); +#elif defined(__aarch64__) return (arm_alloc_msix(pci, child, irq)); #else return (ENXIO); @@ -706,8 +732,12 @@ generic_pcie_alloc_msix(device_t pci, de static int generic_pcie_release_msix(device_t pci, device_t child, int irq) { +#if defined(INTRNG) + struct generic_pcie_softc *sc; -#if defined(__aarch64__) + sc = device_get_softc(pci); + return (intr_release_msix(pci, child, sc->msi_parent, irq)); +#elif defined(__aarch64__) return (arm_release_msix(pci, child, irq)); #else return (ENXIO); Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Mon May 16 08:50:32 2016 (r299927) +++ head/sys/dev/pci/pci_host_generic.h Mon May 16 09:11:40 2016 (r299928) @@ -60,6 +60,7 @@ struct generic_pcie_softc { bus_space_handle_t ioh; #ifdef FDT struct ofw_bus_iinfo pci_iinfo; + phandle_t msi_parent; #endif }; Added: head/sys/kern/msi_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/msi_if.m Mon May 16 09:11:40 2016 (r299928) @@ -0,0 +1,74 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Andrew Turner under +# sponsorship from the FreeBSD Foundation. +# +# 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$ +# + +INTERFACE msi; + +HEADER { + struct intr_irqsrc; +}; + +METHOD int alloc_msi { + device_t dev; + device_t child; + int count; + int maxcount; + device_t *pic; + struct intr_irqsrc **srcs; +}; + +METHOD int release_msi { + device_t dev; + device_t child; + int count; + struct intr_irqsrc **srcs; +}; + +METHOD int alloc_msix { + device_t dev; + device_t child; + device_t *pic; + struct intr_irqsrc **src; +}; + +METHOD int release_msix { + device_t dev; + device_t child; + struct intr_irqsrc *src; +}; + +METHOD int map_msi { + device_t dev; + device_t child; + struct intr_irqsrc *src; + uint64_t *addr; + uint32_t *data; +}; + Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon May 16 08:50:32 2016 (r299927) +++ head/sys/kern/subr_intr.c Mon May 16 09:11:40 2016 (r299928) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #endif #include "pic_if.h" +#include "msi_if.h" #define INTRNAME_LEN (2*MAXCOMLEN + 1) @@ -97,6 +98,9 @@ struct intr_pic { SLIST_ENTRY(intr_pic) pic_next; intptr_t pic_xref; /* hardware identification */ device_t pic_dev; +#define FLAG_PIC (1 << 0) +#define FLAG_MSI (1 << 1) + u_int pic_flags; }; static struct mtx pic_list_lock; @@ -168,6 +172,7 @@ intr_irq_init(void *dummy __unused) SLIST_INIT(&pic_list); mtx_init(&pic_list_lock, "intr pic list", NULL, MTX_DEF); + mtx_init(&isrc_table_lock, "intr isrc table", NULL, MTX_DEF); } SYSINIT(intr_irq_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_irq_init, NULL); @@ -917,6 +922,8 @@ intr_pic_register(device_t dev, intptr_t if (pic == NULL) return (ENOMEM); + pic->pic_flags |= FLAG_PIC; + debugf("PIC %p registered for %s \n", pic, device_get_nameunit(dev), dev, xref); return (0); @@ -948,11 +955,18 @@ int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, void *arg, u_int ipicount) { + struct intr_pic *pic; - if (pic_lookup(dev, xref) == NULL) { + pic = pic_lookup(dev, xref); + if (pic == NULL) { device_printf(dev, "not registered\n"); return (EINVAL); } + + KASSERT((pic->pic_flags & FLAG_PIC) != 0, + ("%s: Found a non-PIC controller: %s", __func__, + device_get_name(pic->pic_dev))); + if (filter == NULL) { device_printf(dev, "filter missing\n"); return (EINVAL); @@ -992,6 +1006,10 @@ intr_map_irq(device_t dev, intptr_t xref if (pic == NULL) return (ESRCH); + KASSERT((pic->pic_flags & FLAG_PIC) != 0, + ("%s: Found a non-PIC controller: %s", __func__, + device_get_name(pic->pic_dev))); + error = PIC_MAP_INTR(pic->pic_dev, data, &isrc); if (error == 0) *irqp = isrc->isrc_irq; @@ -1259,6 +1277,160 @@ intr_irq_next_cpu(u_int current_cpu, cpu } #endif +/* + * Register a MSI/MSI-X interrupt controller + */ +int +intr_msi_register(device_t dev, intptr_t xref) +{ + struct intr_pic *pic; + + if (dev == NULL) + return (EINVAL); + pic = pic_create(dev, xref); + if (pic == NULL) + return (ENOMEM); + + pic->pic_flags |= FLAG_MSI; + + debugf("PIC %p registered for %s \n", pic, + device_get_nameunit(dev), dev, (uintmax_t)xref); + return (0); +} + +int +intr_alloc_msi(device_t pci, device_t child, intptr_t xref, int count, + int maxcount, int *irqs) +{ + struct intr_irqsrc **isrc; + struct intr_pic *pic; + device_t pdev; + int err, i; + + pic = pic_lookup(NULL, xref); + if (pic == NULL) + return (ESRCH); + + KASSERT((pic->pic_flags & FLAG_MSI) != 0, + ("%s: Found a non-MSI controller: %s", __func__, + device_get_name(pic->pic_dev))); + + isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); + err = MSI_ALLOC_MSI(pic->pic_dev, child, count, maxcount, &pdev, isrc); + if (err == 0) { + for (i = 0; i < count; i++) { + irqs[i] = isrc[i]->isrc_irq; + } + } + + free(isrc, M_INTRNG); + + return (err); +} + +int +intr_release_msi(device_t pci, device_t child, intptr_t xref, int count, + int *irqs) +{ + struct intr_irqsrc **isrc; + struct intr_pic *pic; + int i, err; + + pic = pic_lookup(NULL, xref); + if (pic == NULL) + return (ESRCH); + + KASSERT((pic->pic_flags & FLAG_MSI) != 0, + ("%s: Found a non-MSI controller: %s", __func__, + device_get_name(pic->pic_dev))); + + isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); + + for (i = 0; i < count; i++) { + isrc[i] = isrc_lookup(irqs[i]); + if (isrc == NULL) { + free(isrc, M_INTRNG); + return (EINVAL); + } + } + + err = MSI_RELEASE_MSI(pic->pic_dev, child, count, isrc); + free(isrc, M_INTRNG); + return (err); +} + +int +intr_alloc_msix(device_t pci, device_t child, intptr_t xref, int *irq) +{ + struct intr_irqsrc *isrc; + struct intr_pic *pic; + device_t pdev; + int err; + + pic = pic_lookup(NULL, xref); + if (pic == NULL) + return (ESRCH); + + KASSERT((pic->pic_flags & FLAG_MSI) != 0, + ("%s: Found a non-MSI controller: %s", __func__, + device_get_name(pic->pic_dev))); + + err = MSI_ALLOC_MSIX(pic->pic_dev, child, &pdev, &isrc); + if (err != 0) + return (err); + + *irq = isrc->isrc_irq; + return (0); +} + +int +intr_release_msix(device_t pci, device_t child, intptr_t xref, int irq) +{ + struct intr_irqsrc *isrc; + struct intr_pic *pic; + int err; + + pic = pic_lookup(NULL, xref); + if (pic == NULL) + return (ESRCH); + + KASSERT((pic->pic_flags & FLAG_MSI) != 0, + ("%s: Found a non-MSI controller: %s", __func__, + device_get_name(pic->pic_dev))); + + isrc = isrc_lookup(irq); + if (isrc == NULL) + return (EINVAL); + + err = MSI_RELEASE_MSIX(pic->pic_dev, child, isrc); + return (err); +} + +int +intr_map_msi(device_t pci, device_t child, intptr_t xref, int irq, + uint64_t *addr, uint32_t *data) +{ + struct intr_irqsrc *isrc; + struct intr_pic *pic; + int err; + + pic = pic_lookup(NULL, xref); + if (pic == NULL) + return (ESRCH); + + KASSERT((pic->pic_flags & FLAG_MSI) != 0, + ("%s: Found a non-MSI controller: %s", __func__, + device_get_name(pic->pic_dev))); + + isrc = isrc_lookup(irq); + if (isrc == NULL) + return (EINVAL); + + err = MSI_MAP_MSI(pic->pic_dev, child, isrc, addr, data); + return (err); +} + + void dosoftints(void); void dosoftints(void) Modified: head/sys/mips/mediatek/files.mediatek ============================================================================== --- head/sys/mips/mediatek/files.mediatek Mon May 16 08:50:32 2016 (r299927) +++ head/sys/mips/mediatek/files.mediatek Mon May 16 09:11:40 2016 (r299928) @@ -28,6 +28,7 @@ dev/rt/if_rt.c optional rt # Hack to reuse ARM intrng code kern/subr_intr.c standard +kern/msi_if.m standard kern/pic_if.m standard # Intrng compatible MIPS32 interrupt controller Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Mon May 16 08:50:32 2016 (r299927) +++ head/sys/sys/intr.h Mon May 16 09:11:40 2016 (r299928) @@ -128,6 +128,14 @@ int intr_teardown_irq(device_t, struct r int intr_describe_irq(device_t, struct resource *, void *, const char *); +/* MSI/MSI-X handling */ +int intr_msi_register(device_t, intptr_t); +int intr_alloc_msi(device_t, device_t, intptr_t, int, int, int *); +int intr_release_msi(device_t, device_t, intptr_t, int, int *); +int intr_map_msi(device_t, device_t, intptr_t, int, uint64_t *, uint32_t *); +int intr_alloc_msix(device_t, device_t, intptr_t, int *); +int intr_release_msix(device_t, device_t, intptr_t, int); + #ifdef DEV_ACPI u_int intr_acpi_map_irq(device_t, u_int, enum intr_polarity, enum intr_trigger); From owner-svn-src-all@freebsd.org Mon May 16 09:15:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E87B7B3DD34; Mon, 16 May 2016 09:15:52 +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 A9C201B24; Mon, 16 May 2016 09:15:52 +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 u4G9Fpqh013229; Mon, 16 May 2016 09:15:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G9FpBa013220; Mon, 16 May 2016 09:15:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605160915.u4G9FpBa013220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 09:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299929 - in head: share/man/man9 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 09:15:53 -0000 Author: andrew Date: Mon May 16 09:15:50 2016 New Revision: 299929 URL: https://svnweb.freebsd.org/changeset/base/299929 Log: Re-commit r299467 having fixed the build: Add a new get_id interface to pci and pcib. This will allow us to both detect failures, and get different PCI IDs. For the former the interface returns an int to signal an error. The ID is returned at a uintptr_t * argument. For the latter there is a type argument that allows selecting the ID type. This only specifies a single type, however a MSI type will be added to handle the need to find the ID the hardware passes to the ARM GICv3 interrupt controller. A follow up commit will be made to remove pci_get_rid. Reviewed by: jhb, rstone (previous version) Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6239 Modified: head/share/man/man9/Makefile head/share/man/man9/pci.9 head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcib_support.c head/sys/dev/pci/pcivar.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon May 16 09:11:40 2016 (r299928) +++ head/share/man/man9/Makefile Mon May 16 09:15:50 2016 (r299929) @@ -1290,6 +1290,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_extcap.9 \ pci.9 pci_find_htcap.9 \ pci.9 pci_find_pcie_root_port.9 \ + pci.9 pci_get_id.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Mon May 16 09:11:40 2016 (r299928) +++ head/share/man/man9/pci.9 Mon May 16 09:15:50 2016 (r299929) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2015 +.Dd May 16, 2016 .Dt PCI 9 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm pci_find_extcap , .Nm pci_find_htcap , .Nm pci_find_pcie_root_port , +.Nm pci_get_id , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -97,6 +98,8 @@ .Ft device_t .Fn pci_find_pcie_root_port "device_t dev" .Ft int +.Fn pci_get_id "device_t dev" "enum pci_id_type type" "uintptr_t *id" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -357,6 +360,18 @@ returns .Dv NULL . .Pp The +.Fn pci_get_id +function is used to read an identifier from a device. +The +.Fa type +flag is used to specify which identifier to read. +The following flags are supported: +.Bl -hang -width ".Dv PCI_ID_RID" +.It Dv PCI_ID_RID +Read the routing identifier for the device. +.El +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon May 16 09:11:40 2016 (r299928) +++ head/sys/dev/pci/pci.c Mon May 16 09:15:50 2016 (r299929) @@ -122,7 +122,8 @@ static void pci_resume_msix(device_t de static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); -static uint16_t pci_get_rid_method(device_t dev, device_t child); +static int pci_get_id_method(device_t dev, device_t child, + enum pci_id_type type, uintptr_t *rid); static struct pci_devinfo * pci_fill_devinfo(device_t pcib, device_t bus, int d, int b, int s, int f, uint16_t vid, uint16_t did); @@ -190,7 +191,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_msix_count, pci_msix_count_method), DEVMETHOD(pci_msix_pba_bar, pci_msix_pba_bar_method), DEVMETHOD(pci_msix_table_bar, pci_msix_table_bar_method), - DEVMETHOD(pci_get_rid, pci_get_rid_method), + DEVMETHOD(pci_get_id, pci_get_id_method), DEVMETHOD(pci_alloc_devinfo, pci_alloc_devinfo_method), DEVMETHOD(pci_child_added, pci_child_added_method), #ifdef PCI_IOV @@ -5823,11 +5824,12 @@ pci_restore_state(device_t dev) pci_cfg_restore(dev, dinfo); } -static uint16_t -pci_get_rid_method(device_t dev, device_t child) +static int +pci_get_id_method(device_t dev, device_t child, enum pci_id_type type, + uintptr_t *id) { - return (PCIB_GET_RID(device_get_parent(dev), child)); + return (PCIB_GET_ID(device_get_parent(dev), child, type, id)); } /* Find the upstream port of a given PCI device in a root complex. */ Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Mon May 16 09:11:40 2016 (r299928) +++ head/sys/dev/pci/pci_if.m Mon May 16 09:15:50 2016 (r299929) @@ -27,6 +27,7 @@ # #include +#include INTERFACE pci; @@ -54,6 +55,10 @@ CODE { HEADER { struct nvlist; + + enum pci_id_type { + PCI_ID_RID, + }; } @@ -208,9 +213,11 @@ METHOD int msix_table_bar { device_t child; } DEFAULT null_msix_bar; -METHOD uint16_t get_rid { +METHOD int get_id { device_t dev; device_t child; + enum pci_id_type type; + uintptr_t *id; }; METHOD struct pci_devinfo * alloc_devinfo { Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Mon May 16 09:11:40 2016 (r299928) +++ head/sys/dev/pci/pci_pci.c Mon May 16 09:15:50 2016 (r299929) @@ -59,7 +59,8 @@ static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); -static uint16_t pcib_ari_get_rid(device_t pcib, device_t dev); +static int pcib_ari_get_id(device_t pcib, device_t dev, + enum pci_id_type type, uintptr_t *id); static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); static void pcib_write_config(device_t dev, u_int b, u_int s, @@ -114,7 +115,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), - DEVMETHOD(pcib_get_rid, pcib_ari_get_rid), + DEVMETHOD(pcib_get_id, pcib_ari_get_id), DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), DEVMETHOD(pcib_ari_enabled, pcib_ari_enabled), DEVMETHOD(pcib_decode_rid, pcib_ari_decode_rid), @@ -2574,26 +2575,32 @@ pcib_ari_enabled(device_t pcib) return ((sc->flags & PCIB_ENABLE_ARI) != 0); } -static uint16_t -pcib_ari_get_rid(device_t pcib, device_t dev) +static int +pcib_ari_get_id(device_t pcib, device_t dev, enum pci_id_type type, + uintptr_t *id) { struct pcib_softc *sc; uint8_t bus, slot, func; + if (type != PCI_ID_RID) + return (ENXIO); + sc = device_get_softc(pcib); if (sc->flags & PCIB_ENABLE_ARI) { bus = pci_get_bus(dev); func = pci_get_function(dev); - return (PCI_ARI_RID(bus, func)); + *id = (PCI_ARI_RID(bus, func)); } else { bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); - return (PCI_RID(bus, slot, func)); + *id = (PCI_RID(bus, slot, func)); } + + return (0); } /* Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Mon May 16 09:11:40 2016 (r299928) +++ head/sys/dev/pci/pcib_if.m Mon May 16 09:15:50 2016 (r299929) @@ -48,6 +48,10 @@ CODE { } }; +HEADER { + #include "pci_if.h" +}; + # # Return the number of slots on the attached PCI bus. # @@ -175,10 +179,12 @@ METHOD int power_for_sleep { # # Return the PCI Routing Identifier (RID) for the device. # -METHOD uint16_t get_rid { +METHOD int get_id { device_t pcib; device_t dev; -} DEFAULT pcib_get_rid; + enum pci_id_type type; + uintptr_t *id; +} DEFAULT pcib_get_id; # # Enable Alternative RID Interpretation if both the downstream port (pcib) Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Mon May 16 09:11:40 2016 (r299928) +++ head/sys/dev/pci/pcib_private.h Mon May 16 09:15:50 2016 (r299929) @@ -190,7 +190,8 @@ int pcib_release_msi(device_t pcib, dev int pcib_alloc_msix(device_t pcib, device_t dev, int *irq); int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); -uint16_t pcib_get_rid(device_t pcib, device_t dev); +int pcib_get_id(device_t pcib, device_t dev, enum pci_id_type type, + uintptr_t *id); void pcib_decode_rid(device_t pcib, uint16_t rid, int *bus, int *slot, int *func); Modified: head/sys/dev/pci/pcib_support.c ============================================================================== --- head/sys/dev/pci/pcib_support.c Mon May 16 09:11:40 2016 (r299928) +++ head/sys/dev/pci/pcib_support.c Mon May 16 09:15:50 2016 (r299929) @@ -54,16 +54,20 @@ pcib_maxfuncs(device_t dev) return (PCI_FUNCMAX); } -uint16_t -pcib_get_rid(device_t pcib, device_t dev) +int +pcib_get_id(device_t pcib, device_t dev, enum pci_id_type type, uintptr_t *id) { uint8_t bus, slot, func; + if (type != PCI_ID_RID) + return (ENXIO); + bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); - return (PCI_RID(bus, slot, func)); + *id = (PCI_RID(bus, slot, func)); + return (0); } void Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Mon May 16 09:11:40 2016 (r299928) +++ head/sys/dev/pci/pcivar.h Mon May 16 09:15:50 2016 (r299929) @@ -542,10 +542,26 @@ pci_msix_table_bar(device_t dev) return (PCI_MSIX_TABLE_BAR(device_get_parent(dev), dev)); } +static __inline int +pci_get_id(device_t dev, enum pci_id_type type, uintptr_t *id) +{ + return (PCI_GET_ID(device_get_parent(dev), dev, type, id)); +} + +/* + * This is the deprecated interface, there is no way to tell the difference + * between a failure and a valid value that happens to be the same as the + * failure value. + */ static __inline uint16_t pci_get_rid(device_t dev) { - return (PCI_GET_RID(device_get_parent(dev), dev)); + uintptr_t rid; + + if (pci_get_id(dev, PCI_ID_RID, &rid) != 0) + return (0); + + return (rid); } static __inline void From owner-svn-src-all@freebsd.org Mon May 16 09:16:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F02B3DD79; Mon, 16 May 2016 09:16:16 +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 900411CE7; Mon, 16 May 2016 09:16:16 +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 u4G9GFxf013295; Mon, 16 May 2016 09:16:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G9GFLl013293; Mon, 16 May 2016 09:16:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605160916.u4G9GFLl013293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 May 2016 09:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299930 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 09:16:16 -0000 Author: hselasky Date: Mon May 16 09:16:15 2016 New Revision: 299930 URL: https://svnweb.freebsd.org/changeset/base/299930 Log: Properly implement "cpu_has_clflush" macro. Suggested by: kib, jhb MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 16 09:15:50 2016 (r299929) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 16 09:16:15 2016 (r299930) @@ -258,7 +258,11 @@ #define smp_processor_id() PCPU_GET(cpuid) #define num_possible_cpus() mp_ncpus #define num_online_cpus() mp_ncpus -#define cpu_has_clflush (1) + +#if defined(__i386__) || defined(__amd64__) +extern bool linux_cpu_has_clflush; +#define cpu_has_clflush linux_cpu_has_clflush +#endif typedef struct pm_message { int event; Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 16 09:15:50 2016 (r299929) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 16 09:16:15 2016 (r299930) @@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$"); #include +#if defined(__i386__) || defined(__amd64__) +#include +#endif + #include #include #include @@ -67,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1362,12 +1367,19 @@ linux_irq_handler(void *ent) irqe->handler(irqe->irq, irqe->arg); } +#if defined(__i386__) || defined(__amd64__) +bool linux_cpu_has_clflush; +#endif + static void linux_compat_init(void *arg) { struct sysctl_oid *rootoid; int i; +#if defined(__i386__) || defined(__amd64__) + linux_cpu_has_clflush = (cpu_feature & CPUID_CLFSH); +#endif sx_init(&linux_global_rcu_lock, "LinuxGlobalRCU"); rootoid = SYSCTL_ADD_ROOT_NODE(NULL, From owner-svn-src-all@freebsd.org Mon May 16 09:25:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47DDCB3B132; Mon, 16 May 2016 09:25:57 +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 1877013AE; Mon, 16 May 2016 09:25:57 +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 u4G9PuUw016289; Mon, 16 May 2016 09:25:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G9Pu8d016288; Mon, 16 May 2016 09:25:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605160925.u4G9Pu8d016288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 May 2016 09:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299931 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 09:25:57 -0000 Author: hselasky Date: Mon May 16 09:25:56 2016 New Revision: 299931 URL: https://svnweb.freebsd.org/changeset/base/299931 Log: Don't dereference parent pointer when it is NULL. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/device.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Mon May 16 09:16:15 2016 (r299930) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Mon May 16 09:25:56 2016 (r299931) @@ -211,11 +211,11 @@ device_register(struct device *dev) } else if (dev->parent == NULL) { bsddev = devclass_get_device(dev->class->bsdclass, 0); } - - if (bsddev == NULL) + if (bsddev == NULL && dev->parent != NULL) { bsddev = device_add_child(dev->parent->bsddev, dev->class->kobj.name, unit); - if (bsddev) { + } + if (bsddev != NULL) { if (dev->devt == 0) dev->devt = makedev(0, device_get_unit(bsddev)); device_set_softc(bsddev, dev); From owner-svn-src-all@freebsd.org Mon May 16 09:31:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5B5CB3B3FC; Mon, 16 May 2016 09:31:46 +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 69C6E19B8; Mon, 16 May 2016 09:31:46 +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 u4G9Vj2M019218; Mon, 16 May 2016 09:31:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G9ViUB019204; Mon, 16 May 2016 09:31:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605160931.u4G9ViUB019204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 09:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299932 - in head: share/man/man9 sys/arm64/arm64 sys/arm64/cavium sys/dev/ofw 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 09:31:46 -0000 Author: andrew Date: Mon May 16 09:31:44 2016 New Revision: 299932 URL: https://svnweb.freebsd.org/changeset/base/299932 Log: Add a pcib interface for use by interrupt controllers that need to translate the pci rid to a controller ID. The translation could be based on the 'msi-map' OFW property, a similar ACPI option, or hard-coded for hardware lacking the above options. Reviewed by: wma Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/pci.9 head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/arm64/cavium/thunder_pcie_pem_fdt.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_pci.c Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Mon May 16 09:25:56 2016 (r299931) +++ head/share/man/man9/pci.9 Mon May 16 09:31:44 2016 (r299932) @@ -369,6 +369,9 @@ The following flags are supported: .Bl -hang -width ".Dv PCI_ID_RID" .It Dv PCI_ID_RID Read the routing identifier for the device. +.It Dv PCI_ID_MSI +Read the MSI routing ID. +This is needed by some interrupt controllers to route MSI and MSI-X interrupts. .El .Pp The Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Mon May 16 09:25:56 2016 (r299931) +++ head/sys/arm64/arm64/gic_v3_its.c Mon May 16 09:31:44 2016 (r299932) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #define GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET 88 #include "pic_if.h" +#include "pcib_if.h" /* Device and PIC methods */ static int gic_v3_its_attach(device_t); @@ -150,7 +151,6 @@ const char *its_ptab_type[] = { /* Cavium ThunderX PCI devid acquire function */ static uint32_t its_get_devbits_thunder(device_t); -static uint32_t its_get_devid_thunder(device_t); static const struct its_quirks its_quirks[] = { { @@ -160,7 +160,6 @@ static const struct its_quirks its_quirk */ .cpuid = CPU_ID_RAW(CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0), .cpuid_mask = CPU_IMPL_MASK | CPU_PART_MASK, - .devid_func = its_get_devid_thunder, .devbits_func = its_get_devbits_thunder, }, }; @@ -1569,46 +1568,6 @@ its_device_asign_lpi_locked(struct gic_v * Add vendor specific PCI devid function here. */ static uint32_t -its_get_devid_thunder(device_t pci_dev) -{ - int bsf; - int pem; - uint32_t bus; - - bus = pci_get_bus(pci_dev); - bsf = pci_get_rid(pci_dev); - - /* Check if accessing internal PCIe (low bus numbers) */ - if (bus < GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET) { - return ((pci_get_domain(pci_dev) << PCI_RID_DOMAIN_SHIFT) | - bsf); - /* PEM otherwise */ - } else { - /* PEM (PCIe MAC/root complex) number is equal to domain */ - pem = pci_get_domain(pci_dev); - - /* - * Set appropriate device ID (passed by the HW along with - * the transaction to memory) for different root complex - * numbers using hard-coded domain portion for each group. - */ - if (pem < 3) - return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); - - if (pem < 6) - return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); - - if (pem < 9) - return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); - - if (pem < 12) - return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); - } - - return (0); -} - -static uint32_t its_get_devbits_thunder(device_t dev) { uint32_t devid_bits; @@ -1670,28 +1629,15 @@ its_get_devbits(device_t dev) return (its_get_devbits_default(dev)); } -static __inline uint32_t -its_get_devid_default(device_t pci_dev) -{ - - return (PCI_DEVID_GENERIC(pci_dev)); -} - static uint32_t its_get_devid(device_t pci_dev) { - const struct its_quirks *quirk; - size_t i; + uintptr_t id; - for (i = 0; i < nitems(its_quirks); i++) { - quirk = &its_quirks[i]; - if (CPU_MATCH_RAW(quirk->cpuid_mask, quirk->cpuid)) { - if (quirk->devid_func != NULL) - return ((*quirk->devid_func)(pci_dev)); - } - } + if (pci_get_id(pci_dev, PCI_ID_MSI, &id) != 0) + panic("its_get_devid: Unable to get the MSI DeviceID"); - return (its_get_devid_default(pci_dev)); + return (id); } /* Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Mon May 16 09:25:56 2016 (r299931) +++ head/sys/arm64/arm64/gic_v3_var.h Mon May 16 09:31:44 2016 (r299932) @@ -247,12 +247,10 @@ struct gic_v3_its_softc { /* Stuff that is specific to the vendor's implementation */ typedef uint32_t (*its_devbits_func_t)(device_t); -typedef uint32_t (*its_devid_func_t)(device_t); struct its_quirks { uint64_t cpuid; uint64_t cpuid_mask; - its_devid_func_t devid_func; its_devbits_func_t devbits_func; }; Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Mon May 16 09:25:56 2016 (r299931) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Mon May 16 09:31:44 2016 (r299932) @@ -45,16 +45,24 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include #include +#include #include "thunder_pcie_common.h" +#include "pcib_if.h" + #ifdef THUNDERX_PASS_1_1_ERRATA static struct resource * thunder_pcie_fdt_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); #endif static int thunder_pcie_fdt_attach(device_t); static int thunder_pcie_fdt_probe(device_t); +static int thunder_pcie_fdt_get_id(device_t, device_t, enum pci_id_type, + uintptr_t *); static device_method_t thunder_pcie_fdt_methods[] = { /* Device interface */ @@ -64,6 +72,9 @@ static device_method_t thunder_pcie_fdt_ DEVMETHOD(bus_alloc_resource, thunder_pcie_fdt_alloc_resource), #endif + /* pcib interface */ + DEVMETHOD(pcib_get_id, thunder_pcie_fdt_get_id), + /* End */ DEVMETHOD_END }; @@ -112,6 +123,26 @@ thunder_pcie_fdt_attach(device_t dev) return (pci_host_generic_attach(dev)); } +static int +thunder_pcie_fdt_get_id(device_t pci, device_t child, enum pci_id_type type, + uintptr_t *id) +{ + phandle_t node; + int bsf; + + if (type != PCI_ID_MSI) + return (pcib_get_id(pci, child, type, id)); + + node = ofw_bus_get_node(pci); + if (OF_hasprop(node, "msi-map")) + return (generic_pcie_get_id(pci, child, type, id)); + + bsf = pci_get_rid(child); + *id = (pci_get_domain(child) << PCI_RID_DOMAIN_SHIFT) | bsf; + + return (0); +} + #ifdef THUNDERX_PASS_1_1_ERRATA static struct resource * thunder_pcie_fdt_alloc_resource(device_t dev, device_t child, int type, int *rid, Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Mon May 16 09:25:56 2016 (r299931) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Mon May 16 09:31:44 2016 (r299932) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -131,6 +132,8 @@ static int thunder_pem_release_msi(devic static int thunder_pem_alloc_msix(device_t, device_t, int *); static int thunder_pem_release_msix(device_t, device_t, int); static int thunder_pem_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +static int thunder_pem_get_id(device_t, device_t, enum pci_id_type, + uintptr_t *); static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); @@ -182,6 +185,7 @@ static device_method_t thunder_pem_metho DEVMETHOD(pcib_alloc_msi, thunder_pem_alloc_msi), DEVMETHOD(pcib_release_msi, thunder_pem_release_msi), DEVMETHOD(pcib_map_msi, thunder_pem_map_msi), + DEVMETHOD(pcib_get_id, thunder_pem_get_id), DEVMETHOD_END }; @@ -372,6 +376,40 @@ thunder_pem_map_msi(device_t pci, device } static int +thunder_pem_get_id(device_t pci, device_t child, enum pci_id_type type, + uintptr_t *id) +{ + int bsf; + int pem; + + if (type != PCI_ID_MSI) + return (pcib_get_id(pci, child, type, id)); + + bsf = pci_get_rid(child); + + /* PEM (PCIe MAC/root complex) number is equal to domain */ + pem = pci_get_domain(child); + + /* + * Set appropriate device ID (passed by the HW along with + * the transaction to memory) for different root complex + * numbers using hard-coded domain portion for each group. + */ + if (pem < 3) + *id = (0x1 << PCI_RID_DOMAIN_SHIFT) | bsf; + else if (pem < 6) + *id = (0x3 << PCI_RID_DOMAIN_SHIFT) | bsf; + else if (pem < 9) + *id = (0x9 << PCI_RID_DOMAIN_SHIFT) | bsf; + else if (pem < 12) + *id = (0xB << PCI_RID_DOMAIN_SHIFT) | bsf; + else + return (ENXIO); + + return (0); +} + +static int thunder_pem_identify(device_t dev) { struct thunder_pem_softc *sc; Modified: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 09:25:56 2016 (r299931) +++ head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 09:31:44 2016 (r299932) @@ -65,6 +65,8 @@ static int thunder_pem_fdt_alloc_msi(dev static int thunder_pem_fdt_release_msi(device_t, device_t, int, int *); static int thunder_pem_fdt_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +static int thunder_pem_fdt_get_id(device_t, device_t, enum pci_id_type, + uintptr_t *); static device_method_t thunder_pem_fdt_methods[] = { /* Device interface */ @@ -76,6 +78,7 @@ static device_method_t thunder_pem_fdt_m DEVMETHOD(pcib_alloc_msi, thunder_pem_fdt_alloc_msi), DEVMETHOD(pcib_release_msi, thunder_pem_fdt_release_msi), DEVMETHOD(pcib_map_msi, thunder_pem_fdt_map_msi), + DEVMETHOD(pcib_get_id, thunder_pem_fdt_get_id), /* End */ DEVMETHOD_END @@ -142,3 +145,23 @@ thunder_pem_fdt_map_msi(device_t pci, de return (arm_map_msi(pci, child, irq, addr, data)); } + +static int +thunder_pem_fdt_get_id(device_t dev, device_t child, enum pci_id_type type, + uintptr_t *id) +{ + phandle_t node; + uint32_t rid; + uint16_t pci_rid; + + if (type != PCI_ID_MSI) + return (pcib_get_id(dev, child, type, id)); + + node = ofw_bus_get_node(dev); + pci_rid = pci_get_rid(child); + + ofw_bus_msimap(node, pci_rid, NULL, &rid); + *id = rid; + + return (0); +} Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Mon May 16 09:25:56 2016 (r299931) +++ head/sys/dev/ofw/ofw_bus_subr.c Mon May 16 09:31:44 2016 (r299932) @@ -397,6 +397,57 @@ ofw_bus_search_intrmap(void *intr, int i } int +ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phandle_t *msi_parent, + uint32_t *msi_rid) +{ + pcell_t *map, mask, msi_base, rid_base, rid_length; + ssize_t len; + uint32_t masked_rid, rid; + int err, i; + + /* TODO: This should be OF_searchprop_alloc if we had it */ + len = OF_getencprop_alloc(node, "msi-map", sizeof(*map), (void **)&map); + if (len < 0) { + if (msi_parent != NULL) { + *msi_parent = 0; + OF_getencprop(node, "msi-parent", msi_parent, + sizeof(*msi_parent)); + } + if (msi_rid != NULL) + *msi_rid = pci_rid; + return (0); + } + + err = ENOENT; + rid = 0; + mask = 0xffffffff; + OF_getencprop(node, "msi-map-mask", &mask, sizeof(mask)); + + masked_rid = pci_rid & mask; + for (i = 0; i < len; i += 4) { + rid_base = map[i + 0]; + rid_length = map[i + 3]; + + if (masked_rid < rid_base || + masked_rid >= (rid_base + rid_length)) + continue; + + msi_base = map[i + 2]; + + if (msi_parent != NULL) + *msi_parent = map[i + 1]; + if (msi_rid != NULL) + *msi_rid = masked_rid - rid_base + msi_base; + err = 0; + break; + } + + free(map, M_OFWPROP); + + return (err); +} + +int ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells, struct resource_list *rl) { Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Mon May 16 09:25:56 2016 (r299931) +++ head/sys/dev/ofw/ofw_bus_subr.h Mon May 16 09:31:44 2016 (r299932) @@ -76,6 +76,9 @@ int ofw_bus_lookup_imap(phandle_t, struc int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); +/* Routines for processing msi maps */ +int ofw_bus_msimap(phandle_t, uint16_t, phandle_t *, uint32_t *); + /* Routines for parsing device-tree data into resource lists. */ int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t, struct resource_list *); Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon May 16 09:25:56 2016 (r299931) +++ head/sys/dev/pci/pci_host_generic.c Mon May 16 09:31:44 2016 (r299932) @@ -744,6 +744,26 @@ generic_pcie_release_msix(device_t pci, #endif } +int +generic_pcie_get_id(device_t pci, device_t child, enum pci_id_type type, + uintptr_t *id) +{ + phandle_t node; + uint32_t rid; + uint16_t pci_rid; + + if (type != PCI_ID_MSI) + return (pcib_get_id(pci, child, type, id)); + + node = ofw_bus_get_node(pci); + pci_rid = pci_get_rid(child); + + ofw_bus_msimap(node, pci_rid, NULL, &rid); + *id = rid; + + return (0); +} + static device_method_t generic_pcie_methods[] = { DEVMETHOD(device_probe, generic_pcie_probe), DEVMETHOD(device_attach, pci_host_generic_attach), @@ -767,6 +787,7 @@ static device_method_t generic_pcie_meth DEVMETHOD(pcib_alloc_msix, generic_pcie_alloc_msix), DEVMETHOD(pcib_release_msix, generic_pcie_release_msix), DEVMETHOD(pcib_map_msi, generic_pcie_map_msi), + DEVMETHOD(pcib_get_id, generic_pcie_get_id), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, generic_pcie_ofw_get_devinfo), Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Mon May 16 09:25:56 2016 (r299931) +++ head/sys/dev/pci/pci_host_generic.h Mon May 16 09:31:44 2016 (r299932) @@ -70,5 +70,6 @@ DECLARE_CLASS(generic_pcie_driver); struct resource *pci_host_generic_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); int pci_host_generic_attach(device_t); +int generic_pcie_get_id(device_t, device_t, enum pci_id_type, uintptr_t *); #endif /* __PCI_HOST_GENERIC_H_ */ Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Mon May 16 09:25:56 2016 (r299931) +++ head/sys/dev/pci/pci_if.m Mon May 16 09:31:44 2016 (r299932) @@ -58,6 +58,7 @@ HEADER { enum pci_id_type { PCI_ID_RID, + PCI_ID_MSI, }; } Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Mon May 16 09:25:56 2016 (r299931) +++ head/sys/dev/pci/pci_pci.c Mon May 16 09:31:44 2016 (r299932) @@ -2580,10 +2580,13 @@ pcib_ari_get_id(device_t pcib, device_t uintptr_t *id) { struct pcib_softc *sc; + device_t bus_dev; uint8_t bus, slot, func; - if (type != PCI_ID_RID) - return (ENXIO); + if (type != PCI_ID_RID) { + bus_dev = device_get_parent(pcib); + return (PCIB_GET_ID(device_get_parent(bus_dev), dev, type, id)); + } sc = device_get_softc(pcib); From owner-svn-src-all@freebsd.org Mon May 16 09:56:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16FE0B3BCA6; Mon, 16 May 2016 09:56:50 +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 CE1831755; Mon, 16 May 2016 09:56:49 +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 u4G9unj6025382; Mon, 16 May 2016 09:56:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G9umAT025380; Mon, 16 May 2016 09:56:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605160956.u4G9umAT025380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 May 2016 09:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299933 - in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 09:56:50 -0000 Author: hselasky Date: Mon May 16 09:56:48 2016 New Revision: 299933 URL: https://svnweb.freebsd.org/changeset/base/299933 Log: Implement more Linux device related functions in the LinuxKPI. While at it use NULL for some pointer checks. Bump the FreeBSD version to force recompilation of all kernel modules due to a structure size change. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Mon May 16 09:31:44 2016 (r299932) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Mon May 16 09:56:48 2016 (r299933) @@ -31,6 +31,7 @@ #ifndef _LINUX_DEVICE_H_ #define _LINUX_DEVICE_H_ +#include #include #include #include @@ -71,6 +72,7 @@ struct device { unsigned int irq; unsigned int msix; unsigned int msix_max; + const struct attribute_group **groups; }; extern struct device linux_root_device; @@ -127,11 +129,12 @@ show_class_attr_string(struct class *cla #define dev_err(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) #define dev_warn(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) #define dev_info(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_notice(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) #define dev_printk(lvl, dev, fmt, ...) \ device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) static inline void * -dev_get_drvdata(struct device *dev) +dev_get_drvdata(const struct device *dev) { return dev->driver_data; @@ -191,11 +194,106 @@ class_unregister(struct class *class) kobject_put(&class->kobj); } +static inline struct device *kobj_to_dev(struct kobject *kobj) +{ + return container_of(kobj, struct device, kobj); +} + /* - * Devices are registered and created for exporting to sysfs. create + * Devices are registered and created for exporting to sysfs. Create * implies register and register assumes the device fields have been * setup appropriately before being called. */ +static inline void +device_initialize(struct device *dev) +{ + device_t bsddev; + + bsddev = NULL; + if (dev->devt) { + int unit = MINOR(dev->devt); + bsddev = devclass_get_device(dev->class->bsdclass, unit); + } + if (bsddev != NULL) + device_set_softc(bsddev, dev); + + dev->bsddev = bsddev; + kobject_init(&dev->kobj, &linux_dev_ktype); +} + +static inline int +device_add(struct device *dev) +{ + if (dev->bsddev != NULL) { + if (dev->devt == 0) + dev->devt = makedev(0, device_get_unit(dev->bsddev)); + } + kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); + return (0); +} + +static inline void +device_create_release(struct device *dev) +{ + kfree(dev); +} + +static inline struct device * +device_create_groups_vargs(struct class *class, struct device *parent, + dev_t devt, void *drvdata, const struct attribute_group **groups, + const char *fmt, va_list args) +{ + struct device *dev = NULL; + int retval = -ENODEV; + + if (class == NULL || IS_ERR(class)) + goto error; + + dev = kzalloc(sizeof(*dev), GFP_KERNEL); + if (!dev) { + retval = -ENOMEM; + goto error; + } + + device_initialize(dev); + dev->devt = devt; + dev->class = class; + dev->parent = parent; + dev->groups = groups; + dev->release = device_create_release; + dev->bsddev = devclass_get_device(dev->class->bsdclass, MINOR(devt)); + dev_set_drvdata(dev, drvdata); + + retval = kobject_set_name_vargs(&dev->kobj, fmt, args); + if (retval) + goto error; + + retval = device_add(dev); + if (retval) + goto error; + + return dev; + +error: + put_device(dev); + return ERR_PTR(retval); +} + +static inline struct device * +device_create_with_groups(struct class *class, + struct device *parent, dev_t devt, void *drvdata, + const struct attribute_group **groups, const char *fmt, ...) +{ + va_list vargs; + struct device *dev; + + va_start(vargs, fmt); + dev = device_create_groups_vargs(class, parent, devt, drvdata, + groups, fmt, vargs); + va_end(vargs); + return dev; +} + static inline int device_register(struct device *dev) { @@ -233,13 +331,29 @@ device_unregister(struct device *dev) device_t bsddev; bsddev = dev->bsddev; + dev->bsddev = NULL; + mtx_lock(&Giant); - if (bsddev) + if (bsddev != NULL) device_delete_child(device_get_parent(bsddev), bsddev); mtx_unlock(&Giant); put_device(dev); } +static inline void +device_del(struct device *dev) +{ + device_t bsddev; + + bsddev = dev->bsddev; + dev->bsddev = NULL; + + mtx_lock(&Giant); + if (bsddev != NULL) + device_delete_child(device_get_parent(bsddev), bsddev); + mtx_unlock(&Giant); +} + struct device *device_create(struct class *class, struct device *parent, dev_t devt, void *drvdata, const char *fmt, ...); @@ -251,7 +365,7 @@ device_destroy(struct class *class, dev_ unit = MINOR(devt); bsddev = devclass_get_device(class->bsdclass, unit); - if (bsddev) + if (bsddev != NULL) device_unregister(device_get_softc(bsddev)); } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon May 16 09:31:44 2016 (r299932) +++ head/sys/sys/param.h Mon May 16 09:56:48 2016 (r299933) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100108 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100109 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon May 16 10:03:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C452B3C002; Mon, 16 May 2016 10:03:59 +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 D41AD1E27; Mon, 16 May 2016 10:03:58 +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 u4GA3vIU028373; Mon, 16 May 2016 10:03:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GA3vC5028372; Mon, 16 May 2016 10:03:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605161003.u4GA3vC5028372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 10:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299934 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 10:03:59 -0000 Author: andrew Date: Mon May 16 10:03:57 2016 New Revision: 299934 URL: https://svnweb.freebsd.org/changeset/base/299934 Log: Teach the ThunderX PCI PEM driver about intrng. This will be used later when arm64 is supported by intrng. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Modified: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 09:56:48 2016 (r299933) +++ head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 10:03:57 2016 (r299934) @@ -109,6 +109,60 @@ thunder_pem_fdt_probe(device_t dev) return (ENXIO); } +#ifdef INTRNG +static int +thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, + irqs)); +} + +static int +thunder_pem_fdt_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_release_msi(pci, child, msi_parent, count, irqs)); +} + +static int +thunder_pem_fdt_alloc_msix(device_t pci, device_t child, int *irq) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_alloc_msix(pci, child, msi_parent, irq)); +} + +static int +thunder_pem_fdt_release_msix(device_t pci, device_t child, int irq) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_release_msix(pci, child, msi_parent, irq)); +} + +static int +thunder_pem_fdt_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); +} +#else static int thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) @@ -145,6 +199,7 @@ thunder_pem_fdt_map_msi(device_t pci, de return (arm_map_msi(pci, child, irq, addr, data)); } +#endif static int thunder_pem_fdt_get_id(device_t dev, device_t child, enum pci_id_type type, From owner-svn-src-all@freebsd.org Mon May 16 10:48:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D244B3CE01; Mon, 16 May 2016 10:48: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 CCD0516AC; Mon, 16 May 2016 10:48:52 +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 u4GAmprD040776; Mon, 16 May 2016 10:48:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GAmpvf040770; Mon, 16 May 2016 10:48:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605161048.u4GAmpvf040770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 10:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299936 - in head/sys: arm64/arm64 arm64/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 10:48:53 -0000 Author: andrew Date: Mon May 16 10:48:51 2016 New Revision: 299936 URL: https://svnweb.freebsd.org/changeset/base/299936 Log: Add support for intrng to arm64. As the GICv3 drivers will need to be updated, and until further testing can be done, this is disabled for now. It is expected arm64 will switch to this interface, and the old interface will be removed before 11.0 is released. Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/autoconf.c head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/arm64/nexus.c head/sys/arm64/include/intr.h head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm64/arm64/autoconf.c ============================================================================== --- head/sys/arm64/arm64/autoconf.c Mon May 16 10:34:55 2016 (r299935) +++ head/sys/arm64/arm64/autoconf.c Mon May 16 10:48:51 2016 (r299936) @@ -80,7 +80,13 @@ configure(void *dummy) static void configure_final(void *dummy) { + +#ifdef INTRNG + /* Enable interrupt reception on this CPU */ + intr_enable(); +#else arm_enable_intr(); +#endif cninit_finish(); if (bootverbose) Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Mon May 16 10:34:55 2016 (r299935) +++ head/sys/arm64/arm64/mp_machdep.c Mon May 16 10:48:51 2016 (r299936) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 The FreeBSD Foundation + * Copyright (c) 2015-2016 The FreeBSD Foundation * All rights reserved. * * This software was developed by Andrew Turner under @@ -65,6 +65,29 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INTRNG +#include "pic_if.h" + +typedef void intr_ipi_send_t(void *, cpuset_t, u_int); +typedef void intr_ipi_handler_t(void *); + +#define INTR_IPI_NAMELEN (MAXCOMLEN + 1) +struct intr_ipi { + intr_ipi_handler_t * ii_handler; + void * ii_handler_arg; + intr_ipi_send_t * ii_send; + void * ii_send_arg; + char ii_name[INTR_IPI_NAMELEN]; + u_long * ii_count; +}; + +static struct intr_ipi ipi_sources[INTR_IPI_COUNT]; + +static struct intr_ipi *intr_ipi_lookup(u_int); +static void intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *, + void *); +#endif /* INTRNG */ + boolean_t ofw_cpu_reg(phandle_t node, u_int, cell_t *); extern struct pcpu __pcpu[]; @@ -184,9 +207,18 @@ release_aps(void *dummy __unused) { int cpu, i; +#ifdef INTRNG + intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); + intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); + intr_pic_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); + intr_pic_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); + intr_pic_ipi_setup(IPI_STOP_HARD, "stop hard", ipi_stop, NULL); + intr_pic_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); +#else /* Setup the IPI handler */ for (i = 0; i < INTR_IPI_COUNT; i++) arm_setup_ipihandler(ipi_handler, i); +#endif atomic_store_rel_int(&aps_ready, 1); /* Wake up the other CPUs */ @@ -214,7 +246,9 @@ void init_secondary(uint64_t cpu) { struct pcpu *pcpup; +#ifndef INTRNG int i; +#endif pcpup = &__pcpu[cpu]; /* @@ -241,11 +275,13 @@ init_secondary(uint64_t cpu) */ identify_cpu(); +#ifndef INTRNG /* Configure the interrupt controller */ arm_init_secondary(); for (i = 0; i < INTR_IPI_COUNT; i++) arm_unmask_ipi(i); +#endif /* Start per-CPU event timers. */ cpu_initclocks_ap(); @@ -270,6 +306,10 @@ init_secondary(uint64_t cpu) mtx_unlock_spin(&ap_boot_mtx); +#ifdef INTRNG + intr_pic_init_secondary(); +#endif + /* Enter the scheduler */ sched_throw(NULL); @@ -277,6 +317,64 @@ init_secondary(uint64_t cpu) /* NOTREACHED */ } +#ifdef INTRNG +/* + * Send IPI thru interrupt controller. + */ +static void +pic_ipi_send(void *arg, cpuset_t cpus, u_int ipi) +{ + + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + PIC_IPI_SEND(intr_irq_root_dev, arg, cpus, ipi); +} + +/* + * Setup IPI handler on interrupt controller. + * + * Not SMP coherent. + */ +static void +intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, + void *arg) +{ + struct intr_irqsrc *isrc; + struct intr_ipi *ii; + int error; + + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + KASSERT(hand != NULL, ("%s: ipi %u no handler", __func__, ipi)); + + error = PIC_IPI_SETUP(intr_irq_root_dev, ipi, &isrc); + if (error != 0) + return; + + isrc->isrc_handlers++; + + ii = intr_ipi_lookup(ipi); + KASSERT(ii->ii_count == NULL, ("%s: ipi %u reused", __func__, ipi)); + + ii->ii_handler = hand; + ii->ii_handler_arg = arg; + ii->ii_send = pic_ipi_send; + ii->ii_send_arg = isrc; + strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); + ii->ii_count = intr_ipi_setup_counters(name); +} + +static void +intr_ipi_send(cpuset_t cpus, u_int ipi) +{ + struct intr_ipi *ii; + + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); + + ii->ii_send(ii->ii_send_arg, cpus, ipi); +} +#endif + static void ipi_ast(void *dummy __unused) { @@ -329,6 +427,7 @@ ipi_stop(void *dummy __unused) CTR0(KTR_SMP, "IPI_STOP (restart)"); } +#ifndef INTRNG static int ipi_handler(void *arg) { @@ -364,6 +463,7 @@ ipi_handler(void *arg) return (FILTER_HANDLED); } +#endif struct cpu_group * cpu_topo(void) @@ -490,3 +590,149 @@ cpu_mp_setmaxid(void) mp_ncpus = 1; mp_maxid = 0; } + +#ifdef INTRNG +/* + * Lookup IPI source. + */ +static struct intr_ipi * +intr_ipi_lookup(u_int ipi) +{ + + if (ipi >= INTR_IPI_COUNT) + panic("%s: no such IPI %u", __func__, ipi); + + return (&ipi_sources[ipi]); +} + +/* + * interrupt controller dispatch function for IPIs. It should + * be called straight from the interrupt controller, when associated + * interrupt source is learned. Or from anybody who has an interrupt + * source mapped. + */ +void +intr_ipi_dispatch(u_int ipi, struct trapframe *tf) +{ + void *arg; + struct intr_ipi *ii; + + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); + + intr_ipi_increment_count(ii->ii_count, PCPU_GET(cpuid)); + + /* + * Supply ipi filter with trapframe argument + * if none is registered. + */ + arg = ii->ii_handler_arg != NULL ? ii->ii_handler_arg : tf; + ii->ii_handler(arg); +} + +#ifdef notyet +/* + * Map IPI into interrupt controller. + * + * Not SMP coherent. + */ +static int +ipi_map(struct intr_irqsrc *isrc, u_int ipi) +{ + boolean_t is_percpu; + int error; + + if (ipi >= INTR_IPI_COUNT) + panic("%s: no such IPI %u", __func__, ipi); + + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + + isrc->isrc_type = INTR_ISRCT_NAMESPACE; + isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; + isrc->isrc_nspc_num = ipi_next_num; + + error = PIC_REGISTER(intr_irq_root_dev, isrc, &is_percpu); + if (error == 0) { + isrc->isrc_dev = intr_irq_root_dev; + ipi_next_num++; + } + return (error); +} + +/* + * Setup IPI handler to interrupt source. + * + * Note that there could be more ways how to send and receive IPIs + * on a platform like fast interrupts for example. In that case, + * one can call this function with ASIF_NOALLOC flag set and then + * call intr_ipi_dispatch() when appropriate. + * + * Not SMP coherent. + */ +int +intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, + void *arg, u_int flags) +{ + struct intr_irqsrc *isrc; + int error; + + if (filter == NULL) + return(EINVAL); + + isrc = intr_ipi_lookup(ipi); + if (isrc->isrc_ipifilter != NULL) + return (EEXIST); + + if ((flags & AISHF_NOALLOC) == 0) { + error = ipi_map(isrc, ipi); + if (error != 0) + return (error); + } + + isrc->isrc_ipifilter = filter; + isrc->isrc_arg = arg; + isrc->isrc_handlers = 1; + isrc->isrc_count = intr_ipi_setup_counters(name); + isrc->isrc_index = 0; /* it should not be used in IPI case */ + + if (isrc->isrc_dev != NULL) { + PIC_ENABLE_INTR(isrc->isrc_dev, isrc); + PIC_ENABLE_SOURCE(isrc->isrc_dev, isrc); + } + return (0); +} +#endif + +/* Sending IPI */ +void +ipi_all_but_self(u_int ipi) +{ + cpuset_t cpus; + + cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &cpus); + CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); + intr_ipi_send(cpus, ipi); +} + +void +ipi_cpu(int cpu, u_int ipi) +{ + cpuset_t cpus; + + CPU_ZERO(&cpus); + CPU_SET(cpu, &cpus); + + CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x", __func__, cpu, ipi); + intr_ipi_send(cpus, ipi); +} + +void +ipi_selected(cpuset_t cpus, u_int ipi) +{ + + CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); + intr_ipi_send(cpus, ipi); +} +#endif /* INTRNG */ Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Mon May 16 10:34:55 2016 (r299935) +++ head/sys/arm64/arm64/nexus.c Mon May 16 10:48:51 2016 (r299936) @@ -271,7 +271,13 @@ nexus_config_intr(device_t dev, int irq, enum intr_polarity pol) { +#ifdef INTRNG + /* TODO: This is wrong, it's needed for ACPI */ + device_printf(dev, "bus_config_intr is obsolete and not supported!\n"); + return (EOPNOTSUPP); +#else return (intr_irq_config(irq, trig, pol)); +#endif } static int @@ -288,8 +294,12 @@ nexus_setup_intr(device_t dev, device_t if (error) return (error); +#ifdef INTRNG + error = intr_setup_irq(child, res, filt, intr, arg, flags, cookiep); +#else error = arm_setup_intr(device_get_nameunit(child), filt, intr, arg, rman_get_start(res), flags, cookiep); +#endif return (error); } @@ -298,7 +308,11 @@ static int nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) { +#ifdef INTRNG + return (intr_teardown_irq(child, r, ih)); +#else return (intr_irq_remove_handler(child, rman_get_start(r), ih)); +#endif } #ifdef SMP @@ -306,7 +320,11 @@ static int nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) { +#ifdef INTRNG + return (intr_bind_irq(child, irq, cpu)); +#else return (intr_irq_bind(rman_get_start(irq), cpu)); +#endif } #endif @@ -429,6 +447,9 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { +#ifdef INTRNG + return (intr_fdt_map_irq(iparent, intr, icells)); +#else int irq; if (icells == 3) { @@ -441,6 +462,7 @@ nexus_ofw_map_intr(device_t dev, device_ irq = intr[0]; return (irq); +#endif } #endif Modified: head/sys/arm64/include/intr.h ============================================================================== --- head/sys/arm64/include/intr.h Mon May 16 10:34:55 2016 (r299935) +++ head/sys/arm64/include/intr.h Mon May 16 10:48:51 2016 (r299936) @@ -29,6 +29,28 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +#ifdef INTRNG + +#ifdef FDT +#include +#endif + +#include + +#ifndef NIRQ +#define NIRQ 1024 /* XXX - It should be an option. */ +#endif + +static inline void +arm_irq_memory_barrier(uintptr_t irq) +{ +} + +#ifdef SMP +void intr_ipi_dispatch(u_int, struct trapframe *); +#endif + +#else int intr_irq_config(u_int, enum intr_trigger, enum intr_polarity); void intr_irq_handler(struct trapframe *); int intr_irq_remove_handler(device_t, u_int, void *); @@ -55,5 +77,6 @@ void arm_init_secondary(void); void arm_setup_ipihandler(driver_filter_t *, u_int); void arm_unmask_ipi(u_int); #endif +#endif #endif /* _MACHINE_INTR_H */ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon May 16 10:34:55 2016 (r299935) +++ head/sys/conf/files.arm64 Mon May 16 10:48:51 2016 (r299936) @@ -1,5 +1,6 @@ # $FreeBSD$ arm/arm/generic_timer.c standard +arm/arm/gic.c optional intrng arm/arm/pmu.c standard arm64/acpica/acpi_machdep.c optional acpi arm64/acpica/OsdEnvironment.c optional acpi @@ -24,14 +25,14 @@ arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard arm64/arm64/elf_machdep.c standard arm64/arm64/exception.S standard -arm64/arm64/gic.c standard -arm64/arm64/gic_acpi.c optional acpi -arm64/arm64/gic_fdt.c optional fdt -arm64/arm64/gic_v3.c standard -arm64/arm64/gic_v3_fdt.c optional fdt -arm64/arm64/gic_v3_its.c standard +arm64/arm64/gic.c optional !intrng +arm64/arm64/gic_acpi.c optional !intrng acpi +arm64/arm64/gic_fdt.c optional !intrng fdt +arm64/arm64/gic_v3.c optional !intrng +arm64/arm64/gic_v3_fdt.c optional !intrng fdt +arm64/arm64/gic_v3_its.c optional !intrng arm64/arm64/identcpu.c standard -arm64/arm64/intr_machdep.c standard +arm64/arm64/intr_machdep.c optional !intrng arm64/arm64/in_cksum.c optional inet | inet6 arm64/arm64/locore.S standard no-obj arm64/arm64/machdep.c standard @@ -40,7 +41,7 @@ arm64/arm64/minidump_machdep.c standard arm64/arm64/mp_machdep.c optional smp arm64/arm64/nexus.c standard arm64/arm64/ofw_machdep.c optional fdt -arm64/arm64/pic_if.m standard +arm64/arm64/pic_if.m optional !intrng arm64/arm64/pmap.c standard arm64/arm64/stack_machdep.c optional ddb | stack arm64/arm64/support.S standard @@ -83,7 +84,10 @@ dev/vnic/thunder_mdio_fdt.c optional vni dev/vnic/thunder_mdio.c optional vnic dev/vnic/lmac_if.m optional vnic kern/kern_clocksource.c standard +kern/msi_if.m optional intrng +kern/pic_if.m optional intrng kern/subr_devmap.c standard +kern/subr_intr.c optional intrng libkern/bcmp.c standard libkern/ffs.c standard libkern/ffsl.c standard Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Mon May 16 10:34:55 2016 (r299935) +++ head/sys/conf/options.arm64 Mon May 16 10:48:51 2016 (r299936) @@ -1,6 +1,7 @@ # $FreeBSD$ ARM64 opt_global.h +INTRNG opt_global.h SOCDEV_PA opt_global.h SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h From owner-svn-src-all@freebsd.org Mon May 16 10:51:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D82B3CEB3; Mon, 16 May 2016 10:51:37 +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 C8B39195F; Mon, 16 May 2016 10:51: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 u4GApZ5G040924; Mon, 16 May 2016 10:51:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GApZ9L040923; Mon, 16 May 2016 10:51:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605161051.u4GApZ9L040923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 May 2016 10:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299937 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 10:51:37 -0000 Author: avos Date: Mon May 16 10:51:35 2016 New Revision: 299937 URL: https://svnweb.freebsd.org/changeset/base/299937 Log: rtwn: fix double free in raw xmit path. Reported by: mva Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Mon May 16 10:48:51 2016 (r299936) +++ head/sys/dev/rtwn/if_rtwn.c Mon May 16 10:51:35 2016 (r299937) @@ -1789,7 +1789,6 @@ rtwn_raw_xmit(struct ieee80211_node *ni, } if (rtwn_tx(sc, m, ni) != 0) { - m_freem(m); RTWN_UNLOCK(sc); return (EIO); } From owner-svn-src-all@freebsd.org Mon May 16 10:53:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39D1B3D014 for ; Mon, 16 May 2016 10:53:01 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com [IPv6:2a00:1450:4010:c04::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 2F8E41C6E for ; Mon, 16 May 2016 10:53:01 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lb0-x236.google.com with SMTP id h1so48601044lbj.3 for ; Mon, 16 May 2016 03:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Q1+WyX+Q4Ua9DpcZmRA3jOEMOb9OzzBTB5nzO/fmvoE=; b=kPqNn3XYgMRI6+i9yPD1zolhhgN0N1+B2QgBPXG7G5ZD+zRrilZb/1FZ46ahpYWEre +VUKLg521HUYSvyGaRipJ8sgk4f5Bi4xSn9tqDv191h+h0nxYMB2dwsIPOZP5q4d2FM5 uNpVrfpUMr3wtkJb310ESqtVj6vDlj0a2QS2sFGrPIDgp/k7rpt2wAWEiZwm9YxtWI1g Ubs30RQtdQPr+AP62dh6HnziNV0yMx4KivZsO/iEkP32uQ+gpSy2HzZM9TfCSCFBNlPA 1xhqZh+siBDl0zRbro9XlIUxgzKSeWVNY6ze2r9n9j21qm43YUouUT4UsbnbfqewfXOz i3aQ== 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=Q1+WyX+Q4Ua9DpcZmRA3jOEMOb9OzzBTB5nzO/fmvoE=; b=d5pgYkxNsO63Eykqe07y2rh8lRJXYR7i+NO2wbMog7OJkUTP3/VPWSaQYU8NYeHB7W bPYmN8a0Udnt31RXkmtEh83NXa5o3VIdTzY3x0bg25IzHV0GAtg0oo1EOt27skdvp4Bt 9L5xbvpZwWifElHS0EtUZnB1SaL48a08MhgBvC8PfXVxbCOgSuE0O0zl1Ke5/goocbj0 7jlAr9mXFBCBZzpDDqEEzH3uHGeeqm1vP1aloseD9ffM/et9EnMv8uDhkU3nFeyu8No/ megZzJJcS8IOfx3VjPpB1L8lkiEderzknLR/xMju7/lfxWo4/QMPcsVACXKhvz56nhAF Qdmg== X-Gm-Message-State: AOPr4FWcEOOicGv/UkT1sWok1g7+jJRLWdCX8X7Flu+NnF0KyuWSdWLcxlfLmRt8IOFM7YmMJLvXmbYvSzUvVw== X-Received: by 10.112.126.136 with SMTP id my8mr7050508lbb.22.1463395979235; Mon, 16 May 2016 03:52:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.68 with HTTP; Mon, 16 May 2016 03:52:39 -0700 (PDT) In-Reply-To: <201605161003.u4GA3vC5028372@repo.freebsd.org> References: <201605161003.u4GA3vC5028372@repo.freebsd.org> From: Zbigniew Bodek Date: Mon, 16 May 2016 12:52:39 +0200 Message-ID: Subject: Re: svn commit: r299934 - head/sys/arm64/cavium To: Andrew Turner 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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 10:53:01 -0000 Are these ThunderX related commits going to be reviewed or tested by anyone that uses ThunderX? Kind regards zbb 2016-05-16 12:03 GMT+02:00 Andrew Turner : > Author: andrew > Date: Mon May 16 10:03:57 2016 > New Revision: 299934 > URL: https://svnweb.freebsd.org/changeset/base/299934 > > Log: > Teach the ThunderX PCI PEM driver about intrng. This will be used later > when arm64 is supported by intrng. > > Obtained from: ABT Systems Ltd > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/arm64/cavium/thunder_pcie_pem_fdt.c > > Modified: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c > > ============================================================================== > --- head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 > 09:56:48 2016 (r299933) > +++ head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 > 10:03:57 2016 (r299934) > @@ -109,6 +109,60 @@ thunder_pem_fdt_probe(device_t dev) > return (ENXIO); > } > > +#ifdef INTRNG > +static int > +thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int > maxcount, > + int *irqs) > +{ > + phandle_t msi_parent; > + > + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), > &msi_parent, > + NULL); > + return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, > + irqs)); > +} > + > +static int > +thunder_pem_fdt_release_msi(device_t pci, device_t child, int count, int > *irqs) > +{ > + phandle_t msi_parent; > + > + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), > &msi_parent, > + NULL); > + return (intr_release_msi(pci, child, msi_parent, count, irqs)); > +} > + > +static int > +thunder_pem_fdt_alloc_msix(device_t pci, device_t child, int *irq) > +{ > + phandle_t msi_parent; > + > + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), > &msi_parent, > + NULL); > + return (intr_alloc_msix(pci, child, msi_parent, irq)); > +} > + > +static int > +thunder_pem_fdt_release_msix(device_t pci, device_t child, int irq) > +{ > + phandle_t msi_parent; > + > + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), > &msi_parent, > + NULL); > + return (intr_release_msix(pci, child, msi_parent, irq)); > +} > + > +static int > +thunder_pem_fdt_map_msi(device_t pci, device_t child, int irq, uint64_t > *addr, > + uint32_t *data) > +{ > + phandle_t msi_parent; > + > + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), > &msi_parent, > + NULL); > + return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); > +} > +#else > static int > thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int > maxcount, > int *irqs) > @@ -145,6 +199,7 @@ thunder_pem_fdt_map_msi(device_t pci, de > > return (arm_map_msi(pci, child, irq, addr, data)); > } > +#endif > > static int > thunder_pem_fdt_get_id(device_t dev, device_t child, enum pci_id_type > type, > _______________________________________________ > 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" > From owner-svn-src-all@freebsd.org Mon May 16 11:48:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 756E5B3DFB2; Mon, 16 May 2016 11:48:44 +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 429311946; Mon, 16 May 2016 11:48:44 +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 u4GBmhvi058774; Mon, 16 May 2016 11:48:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GBmhvI058773; Mon, 16 May 2016 11:48:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605161148.u4GBmhvI058773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 11:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299938 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 11:48:44 -0000 Author: avg Date: Mon May 16 11:48:43 2016 New Revision: 299938 URL: https://svnweb.freebsd.org/changeset/base/299938 Log: fix up r299902: mount_snapshot requires that the covered vnode is locked Previously that was not strictly enforced. MFC after: 4 weeks X-MFC with: r299902 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 10:51:35 2016 (r299937) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 11:48:43 2016 (r299938) @@ -1086,6 +1086,7 @@ domount: (void) snprintf(mountpoint, mountpoint_len, "%s/" ZFS_CTLDIR_NAME "/snapshot/%s", dvp->v_vfsp->mnt_stat.f_mntonname, nm); + VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE)); err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0); kmem_free(mountpoint, mountpoint_len); if (err == 0) { From owner-svn-src-all@freebsd.org Mon May 16 11:52:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4051DB3D102; Mon, 16 May 2016 11:52:33 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 0DCBE1D41; Mon, 16 May 2016 11:52:32 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (94.197.121.2.threembb.co.uk [94.197.121.2]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id EFC72D78FE; Mon, 16 May 2016 11:46:23 +0000 (UTC) Date: Mon, 16 May 2016 12:46:15 +0100 From: Andrew Turner To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299934 - head/sys/arm64/cavium Message-ID: <20160516124615.103685f0@zapp> In-Reply-To: References: <201605161003.u4GA3vC5028372@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 11:52:33 -0000 On Mon, 16 May 2016 12:52:39 +0200 Zbigniew Bodek wrote: > Are these ThunderX related commits going to be reviewed or tested by > anyone that uses ThunderX? I have been testing on the Pass 1.1 and Pass 2.0 ThunderX units in the cluster. Andrew From owner-svn-src-all@freebsd.org Mon May 16 12:02:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7799EB3D8C4; Mon, 16 May 2016 12:02:07 +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 4A32916F0; Mon, 16 May 2016 12:02: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 u4GC26KK064333; Mon, 16 May 2016 12:02:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GC26Ql064332; Mon, 16 May 2016 12:02:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605161202.u4GC26Ql064332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 12:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299939 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 12:02:07 -0000 Author: andrew Date: Mon May 16 12:02:06 2016 New Revision: 299939 URL: https://svnweb.freebsd.org/changeset/base/299939 Log: Move the call to intr_pic_init_secondary to the same place as in the non-intrng case. 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 Mon May 16 11:48:43 2016 (r299938) +++ head/sys/arm64/arm64/mp_machdep.c Mon May 16 12:02:06 2016 (r299939) @@ -275,7 +275,9 @@ init_secondary(uint64_t cpu) */ identify_cpu(); -#ifndef INTRNG +#ifdef INTRNG + intr_pic_init_secondary(); +#else /* Configure the interrupt controller */ arm_init_secondary(); @@ -306,10 +308,6 @@ init_secondary(uint64_t cpu) mtx_unlock_spin(&ap_boot_mtx); -#ifdef INTRNG - intr_pic_init_secondary(); -#endif - /* Enter the scheduler */ sched_throw(NULL); From owner-svn-src-all@freebsd.org Mon May 16 12:15:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B147B3DDB0; Mon, 16 May 2016 12:15:21 +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 CE2851E71; Mon, 16 May 2016 12:15:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GCFKbA068134; Mon, 16 May 2016 12:15:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GCFJjY068132; Mon, 16 May 2016 12:15:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605161215.u4GCFJjY068132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 12:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299940 - in head/sys/cddl: compat/opensolaris/kern 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 12:15:21 -0000 Author: avg Date: Mon May 16 12:15:19 2016 New Revision: 299940 URL: https://svnweb.freebsd.org/changeset/base/299940 Log: fix a vnode reference leak caused by illumos compat traverse() This commit partially reverts r273641 which introduced the leak. It did so to accomodate for some consumers of traverse() that expected the starting vnode to stay as-is. But that introduced the leak in the case when a mounted filesystem was found and its root vnode was returned. r299914 removed the troublesome consumers and now there is no reason to keep the starting vnode. So, now the new rules are: - if there is no mounted filesystem, then nothing is changed - otherwise the starting vnode is always released - the root vnode of the mounted filesystem is returned locked and referenced in the case of success MFC after: 5 weeks X-MFC after: r299914 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Mon May 16 12:02:06 2016 (r299939) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Mon May 16 12:15:19 2016 (r299940) @@ -89,13 +89,14 @@ traverse(vnode_t **cvpp, int lktype) if (vfsp == NULL) break; error = vfs_busy(vfsp, 0); + /* * tvp is NULL for *cvpp vnode, which we can't unlock. - * At least some callers expect the reference to be - * maintained to the original *cvpp */ if (tvp != NULL) vput(cvp); + else + vrele(cvp); if (error) return (error); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 12:02:06 2016 (r299939) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 12:15:19 2016 (r299940) @@ -1018,7 +1018,6 @@ zfsctl_snapdir_lookup(ap) VN_HOLD(*vpp); err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY); if (err != 0) { - VN_RELE(*vpp); *vpp = NULL; } else if (*vpp == sep->se_root) { /* @@ -1613,16 +1612,15 @@ zfsctl_lookup_objset(vfs_t *vfsp, uint64 */ error = traverse(&vp, LK_SHARED | LK_RETRY); if (error == 0) { - if (vp == sep->se_root) + if (vp == sep->se_root) { + VN_RELE(vp); /* release covered vp */ error = SET_ERROR(EINVAL); - else + } else { *zfsvfsp = VTOZ(vp)->z_zfsvfs; + VN_URELE(vp); /* put snapshot's root vp */ + } } mutex_exit(&sdp->sd_lock); - if (error == 0) - VN_URELE(vp); - else - VN_RELE(vp); } else { error = SET_ERROR(EINVAL); mutex_exit(&sdp->sd_lock); From owner-svn-src-all@freebsd.org Mon May 16 12:18:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4999AB3DE99; Mon, 16 May 2016 12:18:32 +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 1C2AA1040; Mon, 16 May 2016 12:18:32 +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 u4GCIViJ068280; Mon, 16 May 2016 12:18:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GCIVD4068278; Mon, 16 May 2016 12:18:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605161218.u4GCIVD4068278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 12:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299941 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 12:18:32 -0000 Author: andrew Date: Mon May 16 12:18:30 2016 New Revision: 299941 URL: https://svnweb.freebsd.org/changeset/base/299941 Log: Call ofw_bus_msimap to find the parent MSI controller, it may not use the msi-parent property. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon May 16 12:15:19 2016 (r299940) +++ head/sys/dev/pci/pci_host_generic.c Mon May 16 12:18:30 2016 (r299941) @@ -235,10 +235,6 @@ pci_host_generic_attach(device_t dev) node = ofw_bus_get_node(dev); ofw_bus_setup_iinfo(node, &sc->pci_iinfo, sizeof(cell_t)); - /* Find the MSI interrupt handler */ - OF_searchencprop(node, "msi-parent", &sc->msi_parent, - sizeof(sc->msi_parent)); - device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } @@ -671,10 +667,11 @@ generic_pcie_alloc_msi(device_t pci, dev int *irqs) { #if defined(INTRNG) - struct generic_pcie_softc *sc; + phandle_t msi_parent; - sc = device_get_softc(pci); - return (intr_alloc_msi(pci, child, sc->msi_parent, count, maxcount, + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, irqs)); #elif defined(__aarch64__) return (arm_alloc_msi(pci, child, count, maxcount, irqs)); @@ -687,10 +684,11 @@ static int generic_pcie_release_msi(device_t pci, device_t child, int count, int *irqs) { #if defined(INTRNG) - struct generic_pcie_softc *sc; + phandle_t msi_parent; - sc = device_get_softc(pci); - return (intr_release_msi(pci, child, sc->msi_parent, count, irqs)); + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_release_msi(pci, child, msi_parent, count, irqs)); #elif defined(__aarch64__) return (arm_release_msi(pci, child, count, irqs)); #else @@ -703,10 +701,11 @@ generic_pcie_map_msi(device_t pci, devic uint32_t *data) { #if defined(INTRNG) - struct generic_pcie_softc *sc; + phandle_t msi_parent; - sc = device_get_softc(pci); - return (intr_map_msi(pci, child, sc->msi_parent, irq, addr, data)); + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); #elif defined(__aarch64__) return (arm_map_msi(pci, child, irq, addr, data)); #else @@ -718,10 +717,11 @@ static int generic_pcie_alloc_msix(device_t pci, device_t child, int *irq) { #if defined(INTRNG) - struct generic_pcie_softc *sc; + phandle_t msi_parent; - sc = device_get_softc(pci); - return (intr_alloc_msix(pci, child, sc->msi_parent, irq)); + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_alloc_msix(pci, child, msi_parent, irq)); #elif defined(__aarch64__) return (arm_alloc_msix(pci, child, irq)); #else @@ -733,10 +733,11 @@ static int generic_pcie_release_msix(device_t pci, device_t child, int irq) { #if defined(INTRNG) - struct generic_pcie_softc *sc; + phandle_t msi_parent; - sc = device_get_softc(pci); - return (intr_release_msix(pci, child, sc->msi_parent, irq)); + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_release_msix(pci, child, msi_parent, irq)); #elif defined(__aarch64__) return (arm_release_msix(pci, child, irq)); #else Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Mon May 16 12:15:19 2016 (r299940) +++ head/sys/dev/pci/pci_host_generic.h Mon May 16 12:18:30 2016 (r299941) @@ -60,7 +60,6 @@ struct generic_pcie_softc { bus_space_handle_t ioh; #ifdef FDT struct ofw_bus_iinfo pci_iinfo; - phandle_t msi_parent; #endif }; From owner-svn-src-all@freebsd.org Mon May 16 12:56:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24459B3CA66; Mon, 16 May 2016 12:56:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DABDD1865; Mon, 16 May 2016 12:56:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GCuTC0080660; Mon, 16 May 2016 12:56:29 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GCuSOO080658; Mon, 16 May 2016 12:56:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605161256.u4GCuSOO080658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 16 May 2016 12:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299942 - in head/usr.bin/xinstall: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 12:56:30 -0000 Author: jilles Date: Mon May 16 12:56:28 2016 New Revision: 299942 URL: https://svnweb.freebsd.org/changeset/base/299942 Log: install: Revert utimensat usage (r299850). This should fix the build on older stable/10, since install is a bootstrap tool. Pending a decision how to fix this properly, revert utimensat usage. Copies with the -p option will again appear older than the original almost always, but -p is not commonly used. Modified: head/usr.bin/xinstall/tests/install_test.sh head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/tests/install_test.sh ============================================================================== --- head/usr.bin/xinstall/tests/install_test.sh Mon May 16 12:18:30 2016 (r299941) +++ head/usr.bin/xinstall/tests/install_test.sh Mon May 16 12:56:28 2016 (r299942) @@ -64,12 +64,6 @@ copy_to_nonexistent_backup_safe_body() { copy_to_nonexistent_with_opts -b -B.bak -S } -atf_test_case copy_to_nonexistent_preserving -copy_to_nonexistent_preserving_body() { - copy_to_nonexistent_with_opts -p - [ ! testf -ot copyf ] || atf_fail "bad timestamp 2" -} - copy_self_with_opts() { printf 'test\n123\r456\r\n789\0z' >testf printf 'test\n123\r456\r\n789\0z' >testf2 @@ -313,7 +307,6 @@ atf_init_test_cases() { atf_add_test_case copy_to_nonexistent_safe_comparing atf_add_test_case copy_to_nonexistent_backup atf_add_test_case copy_to_nonexistent_backup_safe - atf_add_test_case copy_to_nonexistent_preserving atf_add_test_case copy_self atf_add_test_case copy_self_safe atf_add_test_case copy_self_comparing Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Mon May 16 12:18:30 2016 (r299941) +++ head/usr.bin/xinstall/xinstall.c Mon May 16 12:56:28 2016 (r299942) @@ -131,7 +131,7 @@ static void do_symlink(const char *, con static void makelink(const char *, const char *, const struct stat *); static void install(const char *, const char *, u_long, u_int); static void install_dir(char *); -static void metadata_log(const char *, const char *, struct timespec *, +static void metadata_log(const char *, const char *, struct timeval *, const char *, const char *, off_t); static int parseid(const char *, id_t *); static void strip(const char *); @@ -722,7 +722,7 @@ static void install(const char *from_name, const char *to_name, u_long fset, u_int flags) { struct stat from_sb, temp_sb, to_sb; - struct timespec tsb[2]; + struct timeval tvb[2]; int devnull, files_match, from_fd, serrno, target; int tempcopy, temp_fd, to_fd; char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN]; @@ -857,9 +857,11 @@ install(const char *from_name, const cha * Need to preserve target file times, though. */ if (to_sb.st_nlink != 1) { - tsb[0] = to_sb.st_atim; - tsb[1] = to_sb.st_mtim; - (void)utimensat(AT_FDCWD, tempfile, tsb, 0); + tvb[0].tv_sec = to_sb.st_atime; + tvb[0].tv_usec = 0; + tvb[1].tv_sec = to_sb.st_mtime; + tvb[1].tv_usec = 0; + (void)utimes(tempfile, tvb); } else { files_match = 1; (void)unlink(tempfile); @@ -914,9 +916,11 @@ install(const char *from_name, const cha * Preserve the timestamp of the source file if necessary. */ if (dopreserve && !files_match && !devnull) { - tsb[0] = from_sb.st_atim; - tsb[1] = from_sb.st_mtim; - (void)utimensat(AT_FDCWD, to_name, tsb, 0); + tvb[0].tv_sec = from_sb.st_atime; + tvb[0].tv_usec = 0; + tvb[1].tv_sec = from_sb.st_mtime; + tvb[1].tv_usec = 0; + (void)utimes(to_name, tvb); } if (fstat(to_fd, &to_sb) == -1) { @@ -985,7 +989,7 @@ install(const char *from_name, const cha if (!devnull) (void)close(from_fd); - metadata_log(to_name, "file", tsb, NULL, digestresult, to_sb.st_size); + metadata_log(to_name, "file", tvb, NULL, digestresult, to_sb.st_size); free(digestresult); } @@ -1297,7 +1301,7 @@ again: * or to allow integrity checks to be performed. */ static void -metadata_log(const char *path, const char *type, struct timespec *ts, +metadata_log(const char *path, const char *type, struct timeval *tv, const char *slink, const char *digestresult, off_t size) { static const char extra[] = { ' ', '\t', '\n', '\\', '#', '\0' }; @@ -1351,9 +1355,9 @@ metadata_log(const char *path, const cha } if (*type == 'f') /* type=file */ fprintf(metafp, " size=%lld", (long long)size); - if (ts != NULL && dopreserve) - fprintf(metafp, " time=%lld.%09ld", - (long long)ts[1].tv_sec, ts[1].tv_nsec); + if (tv != NULL && dopreserve) + fprintf(metafp, " time=%lld.%ld", + (long long)tv[1].tv_sec, (long)tv[1].tv_usec); if (digestresult && digest) fprintf(metafp, " %s=%s", digest, digestresult); if (fflags) From owner-svn-src-all@freebsd.org Mon May 16 13:07:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DA98B3CEC7; Mon, 16 May 2016 13:07:05 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 045CF10AF; Mon, 16 May 2016 13:07:05 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id a17so135216195wme.0; Mon, 16 May 2016 06:07:04 -0700 (PDT) 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=pe1SGhqtVwT5ouFtXp1Adhik5bEtEIcwv6POdtDC9V4=; b=VBYLQMGbYLpeDWRSR6e+l23NmQryAcGnzFMdzzvm5B8GxecQJEteQ2TN7P3G6JXs+e fhr3UakhwSNaH8seC6TthdkWu5Vb8QKsiF56fZcnJy/IuVLndKCi+WnkNPXQreyjeX0h Y/TjqJqDzWx6zDM+ZyhYyPngwlvLx4ycSohNWklAsW2XWIFi2ddu2tTG4X1RT1iNzc2T fCdwr9Nuev2PSU4XtDr+HNi15jVbMPviXzH+hDDgnBBJWSZvAKW3KlaPIFPXMPTz8T2W SoK2giJY6UN031CyGEKBSXMFOabtzuKofkuujL7/2EpCrZF4iy0bOpIdpAJU3KTQAKW1 Tbeg== 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=pe1SGhqtVwT5ouFtXp1Adhik5bEtEIcwv6POdtDC9V4=; b=GeN9yrb8IGXzdiFdng7lqn1kI35XYqO/74lj7+3olUzV12RfeX1SqIjFGNI6R/BsZP dFwM1SwsNEqjMF9nA0jXzCWgMQkTybMmusntwSixKl/wjoBH+0O4E3dIJmD6VRGy+oJ1 +ES07YBPPmdAyVfpuPaE1H1+IY8YDTxK08/mVlsXWXHZtdUSoLuG5VqmjB9nvmOl9AkN LRtmowM/BlSnD0KnNWeoHTfRwK62ssxR88f1EmFDUo4j7af2fP3YTK6gy9Wr/Cewy3wk 5CtUY72UzbjMVRylAG/BZtWpRttEAdnP8Nw9keTBHfxGxJsZFuuutPl40FDKCBe97m7h Gd7A== X-Gm-Message-State: AOPr4FULQsraVnTWi6yDrwfNwAQ1jE/UduKFqOACX8mQepGH/6abEw67BcelYnQzHLu/Hw== X-Received: by 10.28.59.133 with SMTP id i127mr18321679wma.24.1463404023560; Mon, 16 May 2016 06:07:03 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id i194sm18314867wmf.6.2016.05.16.06.07.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 May 2016 06:07:02 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 16 May 2016 15:07:00 +0200 From: Baptiste Daroussin To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299942 - in head/usr.bin/xinstall: . tests Message-ID: <20160516130700.GQ49383@ivaldir.etoilebsd.net> References: <201605161256.u4GCuSOO080658@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jTlsQtO0VwrbBARu" Content-Disposition: inline In-Reply-To: <201605161256.u4GCuSOO080658@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 13:07:05 -0000 --jTlsQtO0VwrbBARu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 16, 2016 at 12:56:28PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Mon May 16 12:56:28 2016 > New Revision: 299942 > URL: https://svnweb.freebsd.org/changeset/base/299942 >=20 > Log: > install: Revert utimensat usage (r299850). > =20 > This should fix the build on older stable/10, since install is a bootst= rap > tool. > =20 > Pending a decision how to fix this properly, revert utimensat usage. Co= pies > with the -p option will again appear older than the original almost alw= ays, > but -p is not commonly used. You could add a utimensat stub into libstand to workaround the issue? Best regards, Bapt --jTlsQtO0VwrbBARu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXOcXzAAoJEGOJi9zxtz5aECsQAMdDG7F3vNU65Ej2Ph0KAcOc lvtJ04LyLaTqi/e1rEX60mQ9Aewxwgo2YBXEciqENb0lxNEffL/foXlm4fdny1fs tsZKd2GFh1efEq2bCYIzShomTjLod9/e44LMJ5X1x3y1N/UiX3+QbxhejZ2IMF2g JK6n6Nv/a0mfGysSlxwUSXsfr1TlLlRwIE+2p5nDX3O6QGzKC/Jsxun01g6Ylbfh ix9PrH/Y/BDMzLXGdlxQ7HCFTzYY32G5Nn1l7LQHgBqxHPKuq3V7IiU7Dk0nFd3x hLhjkXF5olcN2EfLi2kQJyJ5VP8JRpgHpLR30s6+oLFJo1MfArbAPfKS+SW4azJe yOk7+jofx0PZQAwqHzIhM7UUvgNBtEZIV0sx/ocq/QD0pOZVJBTC2pJyWkOB0h7P duZ2mFh+zvegsNpb0XLJpI22Hp2lzZHOmAP42pd7oPGf51z2phu5Hbz53NLyVumj NKz8dVRN2XlYkm29aThZF9dqjWnlpnnsIqdVBxIzJSlB3lJm+X+s0MblJ9t6fr+I GWcv7rH33jmRWD78W/KFYfaW8vWKy65WM+Ronx4z38TwTlmsnou8JRWS0k+YWWkZ lFtko7n1ZpwiYJlJq0DBwmkEUHo2TkJtEsv0gG7E0RkxfMUGHngNx/bgU+8iajIV On5XvRm2hmiKqGPGiWYd =27tG -----END PGP SIGNATURE----- --jTlsQtO0VwrbBARu-- From owner-svn-src-all@freebsd.org Mon May 16 13:20:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B008BB3D3AB; Mon, 16 May 2016 13:20:16 +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 5A8861A50; Mon, 16 May 2016 13:20:16 +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 u4GDK7KT095412 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 16 May 2016 16:20:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4GDK7KT095412 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4GDK7Xh095411; Mon, 16 May 2016 16:20:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 May 2016 16:20:07 +0300 From: Konstantin Belousov To: Allan Jude Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... Message-ID: <20160516132007.GV89104@kib.kiev.ua> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <5716538B.4060108@freebsd.org> <20160419160500.GY2422@kib.kiev.ua> <1769146.f6cP0aQdA7@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1769146.f6cP0aQdA7@ralph.baldwin.cx> User-Agent: Mutt/1.6.1 (2016-04-27) 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 13:20:16 -0000 On Tue, Apr 19, 2016 at 09:26:41AM -0700, John Baldwin wrote: > On Tuesday, April 19, 2016 07:05:00 PM Konstantin Belousov wrote: > > On Tue, Apr 19, 2016 at 11:49:31AM -0400, Allan Jude wrote: > > > On 2016-04-19 05:30, Konstantin Belousov wrote: > > > > On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: > > > >> On 2016-04-18 19:36, Adrian Chadd wrote: > > > >>> Someone pointed out how this bloats out memory requirement in loader. > > > >>> > > > >>> Did anyone check that? > > > >>> > > > >>> -adrian > > > >>> > > > >> > > > >> I tested down to 128mb of ram in QEMU, booted from the installer ISO, > > > >> did the install, and booted the installed system without issue. > > > > > > > > 64MB is^H^H was very much useful and workable i386 config. i386 kernel > > > > does fit into the 32M but current automatic tuning prevents usermode > > > > from operating. Little manual tuning make 32M on tolerable. > > > > > > > > Making loader require 64M is a regression. At very least, it is > > > > impossible to test low mem configs anymore. > > > > > > > > > > Would a src.conf knob make sense, to use a smaller value when targeting > > > small systems, while keeping the advantages when using more reasonable > > > systems? > > > > > > Or we could make these changes to the HEAP and bcache size specific to > > > 64bit platforms? > > I do not consider neither the current state, nor the two proposed > > changes, acceptable. Loader is same on 32 and 64 bit x86 machines, so > > how would you reconfigure it on 64bit machine ? Non-default knob is too > > obscure and hard to communicate, people would try to use 32M and see > > that it breaks, just abandoning the idea of trying. > > > > Either default-built loader should size itself dynamically based on the > > available memory, perhaps capping heap at 64MB starting from the 128MB > > configs, or, assuming that we consider 32MB be the absolute minimal > > workable config, loader could set HEAP to 8MB. > > > > Dynamic heap size is theoretically best, but it might be hard to do > > if memory map is retrieved after heap is configured (I do not know). > > We retreive the memory map first and parse the SMAP to pick the best > "spot" for the heap. (We prefer to put it "away" from the location > where we load the kernel + modules.) Choosing a dynamic size for the > heap should be quite doable. Fixing libstand's malloc() to try to > "grow" when necessary would be nice for the EFI case as well, but that > is a larger change. It was a month since this commit was made. Is there any progress with fixing the regression on small machines ? BTW, as a data point, I happen to have to run stripped-down i386 current kernel on 32MB machine, and saw around 11MB left to usermode after the init and /bin/sh were started for singlemode. Kernel was stripped, but not too much stripped (unused drivers removed). From owner-svn-src-all@freebsd.org Mon May 16 13:39:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B09D1B3D9CB; Mon, 16 May 2016 13:39:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 824361785; Mon, 16 May 2016 13:39:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GDd41v093124; Mon, 16 May 2016 13:39:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GDd4J8093123; Mon, 16 May 2016 13:39:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605161339.u4GDd4J8093123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 16 May 2016 13:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299943 - head/lib/libthr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 13:39:05 -0000 Author: jilles Date: Mon May 16 13:39:04 2016 New Revision: 299943 URL: https://svnweb.freebsd.org/changeset/base/299943 Log: libthr(3): Fix xref to _umtx_op(2) now that we have it. Modified: head/lib/libthr/libthr.3 Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Mon May 16 12:56:28 2016 (r299942) +++ head/lib/libthr/libthr.3 Mon May 16 13:39:04 2016 (r299943) @@ -118,7 +118,7 @@ environment variable. If both the spin and yield loops failed to acquire the lock, the thread is taken off the CPU and put to sleep in the kernel with the -.Xr umtx 2 +.Xr _umtx_op 2 syscall. The kernel wakes up a thread and hands the ownership of the lock to the woken thread when the lock becomes available. @@ -236,7 +236,7 @@ logs. .Xr ld-elf.so.1 1 , .Xr getrlimit 2 , .Xr errno 2 , -.Xr umtx 2 , +.Xr _umtx_op 2 , .Xr dlclose 3 , .Xr dlopen 3 , .Xr getenv 3 , From owner-svn-src-all@freebsd.org Mon May 16 13:48:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50CC9B3DD40; Mon, 16 May 2016 13:48:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::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 1B20C1E98; Mon, 16 May 2016 13:48:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x242.google.com with SMTP id d62so14857504iof.1; Mon, 16 May 2016 06:48:05 -0700 (PDT) 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=Vwd1ad1tDOqUHpFmj0FTm+NcR6F3z6VnoAuYxTPGQ98=; b=fyzaK7UkHpEy8Oks0t7B35Ejs3QcMznYLrevFK9VhOQeBREAby41aZGmkK2DxOBAk1 ydDz3DrIqEqh4x+P0AGuWpmPmx6FDVoZNAUUbjRu9Y4YJZ7pnZwx3V/Iyz0H6zdXTWxc DVjGHsIDBcarbtMWNA89gi2VVSR6hCjJP8P4MYK85Kb3sBXX7MfvW+BqH6WZpxxVKlwm 9+N20LVjEXYq68W23GHSXwSYRcjzXrdN/2MIE8xpVNY2rHFqVU9ll1smLlYv76Viktks k1yZlMLqirVkQN1TpG3Y7C/KZBKIdId2fHpZXo9LPmvdXT4C4G+JgiYoA8NZ9RFk+7On RbiA== 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=Vwd1ad1tDOqUHpFmj0FTm+NcR6F3z6VnoAuYxTPGQ98=; b=T4YVrgdCttcGvBCeNA+P1t+2jYWe8AvmP0NJIieuk7cDKQETh027sy+CzYtel0L4k8 LOrrgdqcSrwCiVh8OC74KVqDgU1ItJGFuMO+jzt/0giF28p7rEP4M6d+EpBZlvcaa4ve GDKP6NWvuCmbC3jxsfRCK4kd6ZgDDLgOraJEoMRduDg6f3jdSZNe7gQ4h5/cMa3O647L c2kuqP4+PDpBzL+8znJ9eM/KI0YHREgoisKNO4YZ44yT8h7IoHTw/gliT0m1+lYP3+3F AodN0ghs7FMrflyVhBaYc3lW5jRaBTNY+sgcTrxLrYu5JsRvorBHYA0EEJtOQdLtSdab ps/A== X-Gm-Message-State: AOPr4FXp3Zur8WadIz2mvvkaXTKC2VJf70jJFHam7zWamap2O/IMrpLJNdwRzxmAIWhWvv+afTZp2n/H85QBcw== X-Received: by 10.107.31.146 with SMTP id f140mr20017435iof.180.1463406484429; Mon, 16 May 2016 06:48:04 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Mon, 16 May 2016 06:47:44 -0700 (PDT) In-Reply-To: <201605160834.u4G8YH1C000850@repo.freebsd.org> References: <201605160834.u4G8YH1C000850@repo.freebsd.org> From: Ed Maste Date: Mon, 16 May 2016 09:47:44 -0400 X-Google-Sender-Auth: WjEbwDnozkKkAYWbf5sIfR8hKTI Message-ID: Subject: Re: svn commit: r299926 - head/lib/libpam/modules/pam_unix To: Don Lewis 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 13:48:05 -0000 On 16 May 2016 at 04:34, Don Lewis wrote: > Author: truckman > Date: Mon May 16 08:34:17 2016 > New Revision: 299926 > URL: https://svnweb.freebsd.org/changeset/base/299926 > > Log: > Hoist the getpwnam() call outside the first if/else block in > pam_sm_chauthtok(). Set user = getlogin() inside the true > branch so that it is initialized for the following PAM_LOG() > call. This is how it is done in pam_sm_authenticate(). Unfortunately this triggers a warning on powerpc/powerpc64: /scratch/tmp/emaste/freebsd/lib/libpam/modules/pam_unix/pam_unix.c: In function 'pam_sm_chauthtok': /scratch/tmp/emaste/freebsd/lib/libpam/modules/pam_unix/pam_unix.c:278: warning: 'retval' may be used uninitialized in this function I don't see why GCC warns now and did not before, though. From owner-svn-src-all@freebsd.org Mon May 16 14:07:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23A62B3C1E7; Mon, 16 May 2016 14:07:45 +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 E0BC51AD9; Mon, 16 May 2016 14:07:44 +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 u4GE7i1g002604; Mon, 16 May 2016 14:07:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GE7h9n002600; Mon, 16 May 2016 14:07:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605161407.u4GE7h9n002600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 16 May 2016 14:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299944 - in head/sys: arm64/arm64 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 14:07:45 -0000 Author: andrew Date: Mon May 16 14:07:43 2016 New Revision: 299944 URL: https://svnweb.freebsd.org/changeset/base/299944 Log: Add intrng support to the GICv3 driver. It lacks ITS support so won't handle MSI or MSI-X interrupts, however this is enought to boot FreeBSD under the ARM Foundation Model with a GICv3 interrupt controller. Approved by: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gic_v3_var.h head/sys/conf/files.arm64 Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Mon May 16 13:39:04 2016 (r299943) +++ head/sys/arm64/arm64/gic_v3.c Mon May 16 14:07:43 2016 (r299944) @@ -1,7 +1,10 @@ /*- - * Copyright (c) 2015 The FreeBSD Foundation + * Copyright (c) 2015-2016 The FreeBSD Foundation * All rights reserved. * + * This software was developed by Andrew Turner under + * the sponsorship of the FreeBSD Foundation. + * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. * @@ -27,6 +30,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -58,6 +63,28 @@ __FBSDID("$FreeBSD$"); #include "gic_v3_reg.h" #include "gic_v3_var.h" +#ifdef INTRNG +static pic_disable_intr_t gic_v3_disable_intr; +static pic_enable_intr_t gic_v3_enable_intr; +static pic_map_intr_t gic_v3_map_intr; +static pic_setup_intr_t gic_v3_setup_intr; +static pic_teardown_intr_t gic_v3_teardown_intr; +static pic_post_filter_t gic_v3_post_filter; +static pic_post_ithread_t gic_v3_post_ithread; +static pic_pre_ithread_t gic_v3_pre_ithread; +static pic_bind_intr_t gic_v3_bind_intr; +#ifdef SMP +static pic_init_secondary_t gic_v3_init_secondary; +static pic_ipi_send_t gic_v3_ipi_send; +static pic_ipi_setup_t gic_v3_ipi_setup; +#endif + +static u_int gic_irq_cpu; +#ifdef SMP +static u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; +static u_int sgi_first_unused = GIC_FIRST_SGI; +#endif +#else /* Device and PIC methods */ static int gic_v3_bind(device_t, u_int, u_int); static void gic_v3_dispatch(device_t, struct trapframe *); @@ -68,11 +95,29 @@ static void gic_v3_unmask_irq(device_t, static void gic_v3_init_secondary(device_t); static void gic_v3_ipi_send(device_t, cpuset_t, u_int); #endif +#endif static device_method_t gic_v3_methods[] = { /* Device interface */ DEVMETHOD(device_detach, gic_v3_detach), +#ifdef INTRNG + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, gic_v3_disable_intr), + DEVMETHOD(pic_enable_intr, gic_v3_enable_intr), + DEVMETHOD(pic_map_intr, gic_v3_map_intr), + DEVMETHOD(pic_setup_intr, gic_v3_setup_intr), + DEVMETHOD(pic_teardown_intr, gic_v3_teardown_intr), + DEVMETHOD(pic_post_filter, gic_v3_post_filter), + DEVMETHOD(pic_post_ithread, gic_v3_post_ithread), + DEVMETHOD(pic_pre_ithread, gic_v3_pre_ithread), +#ifdef SMP + DEVMETHOD(pic_bind_intr, gic_v3_bind_intr), + DEVMETHOD(pic_init_secondary, gic_v3_init_secondary), + DEVMETHOD(pic_ipi_send, gic_v3_ipi_send), + DEVMETHOD(pic_ipi_setup, gic_v3_ipi_setup), +#endif +#else /* PIC interface */ DEVMETHOD(pic_bind, gic_v3_bind), DEVMETHOD(pic_dispatch, gic_v3_dispatch), @@ -83,6 +128,8 @@ static device_method_t gic_v3_methods[] DEVMETHOD(pic_init_secondary, gic_v3_init_secondary), DEVMETHOD(pic_ipi_send, gic_v3_ipi_send), #endif +#endif + /* End */ DEVMETHOD_END }; @@ -144,6 +191,10 @@ gic_v3_attach(device_t dev) int rid; int err; size_t i; +#ifdef INTRNG + u_int irq; + const char *name; +#endif sc = device_get_softc(dev); sc->gic_registered = FALSE; @@ -192,6 +243,36 @@ gic_v3_attach(device_t dev) if (sc->gic_nirqs > GIC_I_NUM_MAX) sc->gic_nirqs = GIC_I_NUM_MAX; +#ifdef INTRNG + sc->gic_irqs = malloc(sizeof(*sc->gic_irqs) * sc->gic_nirqs, + M_GIC_V3, M_WAITOK | M_ZERO); + name = device_get_nameunit(dev); + for (irq = 0; irq < sc->gic_nirqs; irq++) { + struct intr_irqsrc *isrc; + + sc->gic_irqs[irq].gi_irq = irq; + sc->gic_irqs[irq].gi_pol = INTR_POLARITY_CONFORM; + sc->gic_irqs[irq].gi_trig = INTR_TRIGGER_CONFORM; + + isrc = &sc->gic_irqs[irq].gi_isrc; + if (irq <= GIC_LAST_SGI) { + err = intr_isrc_register(isrc, sc->dev, + INTR_ISRCF_IPI, "%s,i%u", name, irq - GIC_FIRST_SGI); + } else if (irq <= GIC_LAST_PPI) { + err = intr_isrc_register(isrc, sc->dev, + INTR_ISRCF_PPI, "%s,p%u", name, irq - GIC_FIRST_PPI); + } else { + err = intr_isrc_register(isrc, sc->dev, 0, + "%s,s%u", name, irq - GIC_FIRST_SPI); + } + if (err != 0) { + /* XXX call intr_isrc_deregister() */ + free(irqs, M_DEVBUF); + return (err); + } + } +#endif + /* Get the number of supported interrupt identifier bits */ sc->gic_idbits = GICD_TYPER_IDBITS(typer); @@ -210,8 +291,10 @@ gic_v3_attach(device_t dev) * Full success. * Now register PIC to the interrupts handling layer. */ +#ifndef INTRNG arm_register_root_pic(dev, sc->gic_nirqs); sc->gic_registered = TRUE; +#endif return (0); } @@ -244,6 +327,508 @@ gic_v3_detach(device_t dev) return (0); } +#ifdef INTRNG +int +arm_gic_v3_intr(void *arg) +{ + struct gic_v3_softc *sc = arg; + struct gic_v3_irqsrc *gi; + uint64_t active_irq; + struct trapframe *tf; + bool first; + + first = true; + + while (1) { + if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) { + /* + * Hardware: Cavium ThunderX + * Chip revision: Pass 1.0 (early version) + * Pass 1.1 (production) + * ERRATUM: 22978, 23154 + */ + __asm __volatile( + "nop;nop;nop;nop;nop;nop;nop;nop; \n" + "mrs %0, ICC_IAR1_EL1 \n" + "nop;nop;nop;nop; \n" + "dsb sy \n" + : "=&r" (active_irq)); + } else { + active_irq = gic_icc_read(IAR1); + } + + if (__predict_false(active_irq >= sc->gic_nirqs)) + return (FILTER_HANDLED); + + tf = curthread->td_intr_frame; + gi = &sc->gic_irqs[active_irq]; + if (active_irq <= GIC_LAST_SGI) { + /* Call EOI for all IPI before dispatch. */ + gic_icc_write(EOIR1, (uint64_t)active_irq); +#ifdef SMP + intr_ipi_dispatch(sgi_to_ipi[gi->gi_irq], tf); +#else + device_printf(sc->dev, "SGI %u on UP system detected\n", + active_irq - GIC_FIRST_SGI); +#endif + } else if (active_irq >= GIC_FIRST_PPI && + active_irq <= GIC_LAST_SPI) { + if (gi->gi_pol == INTR_TRIGGER_EDGE) + gic_icc_write(EOIR1, gi->gi_irq); + + if (intr_isrc_dispatch(&gi->gi_isrc, tf) != 0) { + if (gi->gi_pol != INTR_TRIGGER_EDGE) + gic_icc_write(EOIR1, gi->gi_irq); + gic_v3_disable_intr(sc->dev, &gi->gi_isrc); + device_printf(sc->dev, + "Stray irq %lu disabled\n", active_irq); + } + } + } +} + +#ifdef FDT +static int +gic_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int *irqp, + enum intr_polarity *polp, enum intr_trigger *trigp) +{ + u_int irq; + + if (ncells < 3) + return (EINVAL); + + /* + * The 1st cell is the interrupt type: + * 0 = SPI + * 1 = PPI + * The 2nd cell contains the interrupt number: + * [0 - 987] for SPI + * [0 - 15] for PPI + * The 3rd cell is the flags, encoded as follows: + * bits[3:0] trigger type and level flags + * 1 = edge triggered + * 2 = edge triggered (PPI only) + * 4 = level-sensitive + * 8 = level-sensitive (PPI only) + */ + switch (cells[0]) { + case 0: + irq = GIC_FIRST_SPI + cells[1]; + /* SPI irq is checked later. */ + break; + case 1: + irq = GIC_FIRST_PPI + cells[1]; + if (irq > GIC_LAST_PPI) { + device_printf(dev, "unsupported PPI interrupt " + "number %u\n", cells[1]); + return (EINVAL); + } + break; + default: + device_printf(dev, "unsupported interrupt type " + "configuration %u\n", cells[0]); + return (EINVAL); + } + + switch (cells[2] & 0xf) { + case 1: + *trigp = INTR_TRIGGER_EDGE; + *polp = INTR_POLARITY_HIGH; + break; + case 2: + *trigp = INTR_TRIGGER_EDGE; + *polp = INTR_POLARITY_LOW; + break; + case 4: + *trigp = INTR_TRIGGER_LEVEL; + *polp = INTR_POLARITY_HIGH; + break; + case 8: + *trigp = INTR_TRIGGER_LEVEL; + *polp = INTR_POLARITY_LOW; + break; + default: + device_printf(dev, "unsupported trigger/polarity " + "configuration 0x%02x\n", cells[2]); + return (EINVAL); + } + + /* Check the interrupt is valid */ + if (irq >= GIC_FIRST_SPI && *polp != INTR_POLARITY_HIGH) + return (EINVAL); + + *irqp = irq; + return (0); +} +#endif + +static int +do_gic_v3_map_intr(device_t dev, struct intr_map_data *data, u_int *irqp, + enum intr_polarity *polp, enum intr_trigger *trigp) +{ + struct gic_v3_softc *sc; + enum intr_polarity pol; + enum intr_trigger trig; +#ifdef FDT + struct intr_map_data_fdt *daf; +#endif + u_int irq; + + sc = device_get_softc(dev); + + switch (data->type) { +#ifdef FDT + case INTR_MAP_DATA_FDT: + daf = (struct intr_map_data_fdt *)data; + if (gic_map_fdt(dev, daf->ncells, daf->cells, &irq, &pol, + &trig) != 0) + return (EINVAL); + break; +#endif + default: + return (EINVAL); + } + + if (irq >= sc->gic_nirqs) + return (EINVAL); + switch (pol) { + case INTR_POLARITY_CONFORM: + case INTR_POLARITY_LOW: + case INTR_POLARITY_HIGH: + break; + default: + return (EINVAL); + } + switch (trig) { + case INTR_TRIGGER_CONFORM: + case INTR_TRIGGER_EDGE: + case INTR_TRIGGER_LEVEL: + break; + default: + return (EINVAL); + } + + *irqp = irq; + if (polp != NULL) + *polp = pol; + if (trigp != NULL) + *trigp = trig; + return (0); +} + +static int +gic_v3_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct gic_v3_softc *sc; + int error; + u_int irq; + + error = do_gic_v3_map_intr(dev, data, &irq, NULL, NULL); + if (error == 0) { + sc = device_get_softc(dev); + *isrcp = GIC_INTR_ISRC(sc, irq); + } + return (error); +} + +static int +gic_v3_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct gic_v3_softc *sc = device_get_softc(dev); + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + enum intr_trigger trig; + enum intr_polarity pol; + uint32_t reg; + u_int irq; + int error; + + if (data == NULL) + return (ENOTSUP); + + error = do_gic_v3_map_intr(dev, data, &irq, &pol, &trig); + if (error != 0) + return (error); + + if (gi->gi_irq != irq || pol == INTR_POLARITY_CONFORM || + trig == INTR_TRIGGER_CONFORM) + return (EINVAL); + + /* Compare config if this is not first setup. */ + if (isrc->isrc_handlers != 0) { + if (pol != gi->gi_pol || trig != gi->gi_trig) + return (EINVAL); + else + return (0); + } + + gi->gi_pol = pol; + gi->gi_trig = trig; + + /* + * XXX - In case that per CPU interrupt is going to be enabled in time + * when SMP is already started, we need some IPI call which + * enables it on others CPUs. Further, it's more complicated as + * pic_enable_source() and pic_disable_source() should act on + * per CPU basis only. Thus, it should be solved here somehow. + */ + if (isrc->isrc_flags & INTR_ISRCF_PPI) + CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); + + if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_SPI) { + mtx_lock_spin(&sc->gic_mtx); + + /* Set the trigger and polarity */ + if (irq <= GIC_LAST_PPI) + reg = gic_r_read(sc, 4, + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq)); + else + reg = gic_d_read(sc, 4, GICD_ICFGR(irq)); + if (trig == INTR_TRIGGER_LEVEL) + reg &= ~(2 << ((irq % 16) * 2)); + else + reg |= 2 << ((irq % 16) * 2); + + if (irq <= GIC_LAST_PPI) { + gic_r_write(sc, 4, + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq), reg); + gic_v3_wait_for_rwp(sc, REDIST); + } else { + gic_d_write(sc, 4, GICD_ICFGR(irq), reg); + gic_v3_wait_for_rwp(sc, DIST); + } + + mtx_unlock_spin(&sc->gic_mtx); + + gic_v3_bind_intr(dev, isrc); + } + + return (0); +} + +static int +gic_v3_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + + panic("gic_v3_teardown_intr"); +} + +static void +gic_v3_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct gic_v3_softc *sc; + struct gic_v3_irqsrc *gi; + u_int irq; + + sc = device_get_softc(dev); + gi = (struct gic_v3_irqsrc *)isrc; + irq = gi->gi_irq; + + if (irq <= GIC_LAST_PPI) { + /* SGIs and PPIs in corresponding Re-Distributor */ + gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + GICD_ICENABLER(irq), + GICD_I_MASK(irq)); + gic_v3_wait_for_rwp(sc, REDIST); + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { + /* SPIs in distributor */ + gic_d_write(sc, 4, GICD_ICENABLER(irq), GICD_I_MASK(irq)); + gic_v3_wait_for_rwp(sc, DIST); + } else + panic("gic_v3_disable_intr"); +} + +static void +gic_v3_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct gic_v3_softc *sc; + struct gic_v3_irqsrc *gi; + u_int irq; + + sc = device_get_softc(dev); + gi = (struct gic_v3_irqsrc *)isrc; + irq = gi->gi_irq; + + if (irq <= GIC_LAST_PPI) { + /* SGIs and PPIs in corresponding Re-Distributor */ + gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + GICD_ISENABLER(irq), + GICD_I_MASK(irq)); + gic_v3_wait_for_rwp(sc, REDIST); + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { + /* SPIs in distributor */ + gic_d_write(sc, 4, GICD_ISENABLER(irq), GICD_I_MASK(irq)); + gic_v3_wait_for_rwp(sc, DIST); + } else + panic("gic_v3_enable_intr"); +} + +static void +gic_v3_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + + gic_v3_disable_intr(dev, isrc); + gic_icc_write(EOIR1, gi->gi_irq); +} + +static void +gic_v3_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + gic_v3_enable_intr(dev, isrc); +} + +static void +gic_v3_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + + if (gi->gi_pol == INTR_TRIGGER_EDGE) + return; + + gic_icc_write(EOIR1, gi->gi_irq); +} + +static int +gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct gic_v3_softc *sc; + struct gic_v3_irqsrc *gi; + int cpu; + + gi = (struct gic_v3_irqsrc *)isrc; + if (gi->gi_irq <= GIC_LAST_PPI) + return (EINVAL); + + KASSERT(gi->gi_irq >= GIC_FIRST_SPI && gi->gi_irq <= GIC_LAST_SPI, + ("%s: Attempting to bind an invalid IRQ", __func__)); + + sc = device_get_softc(dev); + + if (CPU_EMPTY(&isrc->isrc_cpu)) { + gic_irq_cpu = intr_irq_next_cpu(gic_irq_cpu, &all_cpus); + CPU_SETOF(gic_irq_cpu, &isrc->isrc_cpu); + gic_d_write(sc, 4, GICD_IROUTER(gi->gi_irq), + CPU_AFFINITY(gic_irq_cpu)); + } else { + /* + * We can only bind to a single CPU so select + * the first CPU found. + */ + cpu = CPU_FFS(&isrc->isrc_cpu) - 1; + gic_d_write(sc, 4, GICD_IROUTER(gi->gi_irq), CPU_AFFINITY(cpu)); + } + + return (0); +} + +#ifdef SMP +static void +gic_v3_init_secondary(device_t dev) +{ + struct gic_v3_softc *sc; + gic_v3_initseq_t *init_func; + struct intr_irqsrc *isrc; + u_int cpu, irq; + int err; + + sc = device_get_softc(dev); + cpu = PCPU_GET(cpuid); + + /* Train init sequence for boot CPU */ + for (init_func = gic_v3_secondary_init; *init_func != NULL; + init_func++) { + err = (*init_func)(sc); + if (err != 0) { + device_printf(dev, + "Could not initialize GIC for CPU%u\n", cpu); + return; + } + } + + /* Unmask attached SGI interrupts. */ + for (irq = GIC_FIRST_SGI; irq <= GIC_LAST_SGI; irq++) { + isrc = GIC_INTR_ISRC(sc, irq); + if (intr_isrc_init_on_cpu(isrc, cpu)) + gic_v3_enable_intr(dev, isrc); + } + + /* Unmask attached PPI interrupts. */ + for (irq = GIC_FIRST_PPI; irq <= GIC_LAST_PPI; irq++) { + isrc = GIC_INTR_ISRC(sc, irq); + if (intr_isrc_init_on_cpu(isrc, cpu)) + gic_v3_enable_intr(dev, isrc); + } +} + +static void +gic_v3_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus, + u_int ipi) +{ + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + uint64_t aff, val, irq; + int i; + +#define GIC_AFF_MASK (CPU_AFF3_MASK | CPU_AFF2_MASK | CPU_AFF1_MASK) +#define GIC_AFFINITY(i) (CPU_AFFINITY(i) & GIC_AFF_MASK) + aff = GIC_AFFINITY(0); + irq = gi->gi_irq; + val = 0; + + /* Iterate through all CPUs in set */ + for (i = 0; i < mp_ncpus; i++) { + /* Move to the next affinity group */ + if (aff != GIC_AFFINITY(i)) { + /* Send the IPI */ + if (val != 0) { + gic_icc_write(SGI1R, val); + val = 0; + } + aff = GIC_AFFINITY(i); + } + + /* Send the IPI to this cpu */ + if (CPU_ISSET(i, &cpus)) { +#define ICC_SGI1R_AFFINITY(aff) \ + (((uint64_t)CPU_AFF3(aff) << ICC_SGI1R_EL1_AFF3_SHIFT) | \ + ((uint64_t)CPU_AFF2(aff) << ICC_SGI1R_EL1_AFF2_SHIFT) | \ + ((uint64_t)CPU_AFF1(aff) << ICC_SGI1R_EL1_AFF1_SHIFT)) + /* Set the affinity when the first at this level */ + if (val == 0) + val = ICC_SGI1R_AFFINITY(aff) | + irq << ICC_SGI1R_EL1_SGIID_SHIFT; + /* Set the bit to send the IPI to te CPU */ + val |= 1 << CPU_AFF0(CPU_AFFINITY(i)); + } + } + + /* Send the IPI to the last cpu affinity group */ + if (val != 0) + gic_icc_write(SGI1R, val); +#undef GIC_AFF_MASK +#undef GIC_AFFINITY +} + +static int +gic_v3_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc **isrcp) +{ + struct intr_irqsrc *isrc; + struct gic_v3_softc *sc = device_get_softc(dev); + + if (sgi_first_unused > GIC_LAST_SGI) + return (ENOSPC); + + isrc = GIC_INTR_ISRC(sc, sgi_first_unused); + sgi_to_ipi[sgi_first_unused++] = ipi; + + CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); + + *isrcp = isrc; + return (0); +} +#endif /* SMP */ +#else /* INTRNG */ /* * PIC interface. */ @@ -451,6 +1036,7 @@ gic_v3_ipi_send(device_t dev, cpuset_t c } } #endif +#endif /* !INTRNG */ /* * Helper routines Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Mon May 16 13:39:04 2016 (r299943) +++ head/sys/arm64/arm64/gic_v3_fdt.c Mon May 16 14:07:43 2016 (r299944) @@ -38,14 +38,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include "pic_if.h" - #include "gic_v3_reg.h" #include "gic_v3_var.h" @@ -117,6 +116,9 @@ gic_v3_fdt_attach(device_t dev) { struct gic_v3_softc *sc; pcell_t redist_regions; +#ifdef INTRNG + intptr_t xref; +#endif int err; sc = device_get_softc(dev); @@ -132,8 +134,22 @@ gic_v3_fdt_attach(device_t dev) sc->gic_redists.nregions = redist_regions; err = gic_v3_attach(dev); - if (err) + if (err != 0) + goto error; + +#ifdef INTRNG + xref = OF_xref_from_node(ofw_bus_get_node(dev)); + if (intr_pic_register(dev, xref) != 0) { + device_printf(dev, "could not register PIC\n"); + goto error; + } + + if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc, + GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { goto error; + } +#endif + /* * Try to register ITS to this GIC. * GIC will act as a bus in that case. @@ -279,6 +295,7 @@ gic_v3_ofw_bus_attach(device_t dev) return (bus_generic_attach(dev)); } +#ifndef INTRNG static int gic_v3_its_fdt_probe(device_t dev); static device_method_t gic_v3_its_fdt_methods[] = { @@ -310,3 +327,4 @@ gic_v3_its_fdt_probe(device_t dev) device_set_desc(dev, GIC_V3_ITS_DEVSTR); return (BUS_PROBE_DEFAULT); } +#endif Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Mon May 16 13:39:04 2016 (r299943) +++ head/sys/arm64/arm64/gic_v3_var.h Mon May 16 14:07:43 2016 (r299944) @@ -41,6 +41,15 @@ DECLARE_CLASS(gic_v3_driver); /* 1 bit per LPI + 1 KB more for the obligatory PPI, SGI, SPI stuff */ #define LPI_PENDTAB_SIZE ((LPI_CONFTAB_SIZE / 8) + 0x400) +#ifdef INTRNG +struct gic_v3_irqsrc { + struct intr_irqsrc gi_isrc; + uint32_t gi_irq; + enum intr_polarity gi_pol; + enum intr_trigger gi_trig; +}; +#endif + struct redist_lpis { vm_offset_t conf_base; vm_offset_t pend_base[MAXCPU]; @@ -75,13 +84,22 @@ struct gic_v3_softc { u_int gic_idbits; boolean_t gic_registered; + +#ifdef INTRNG + struct gic_v3_irqsrc *gic_irqs; +#endif }; +#ifdef INTRNG +#define GIC_INTR_ISRC(sc, irq) (&sc->gic_irqs[irq].gi_isrc) +#endif + MALLOC_DECLARE(M_GIC_V3); /* Device methods */ int gic_v3_attach(device_t dev); int gic_v3_detach(device_t dev); +int arm_gic_v3_intr(void *); /* * ITS Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon May 16 13:39:04 2016 (r299943) +++ head/sys/conf/files.arm64 Mon May 16 14:07:43 2016 (r299944) @@ -28,8 +28,8 @@ arm64/arm64/exception.S standard arm64/arm64/gic.c optional !intrng arm64/arm64/gic_acpi.c optional !intrng acpi arm64/arm64/gic_fdt.c optional !intrng fdt -arm64/arm64/gic_v3.c optional !intrng -arm64/arm64/gic_v3_fdt.c optional !intrng fdt +arm64/arm64/gic_v3.c standard +arm64/arm64/gic_v3_fdt.c optional fdt arm64/arm64/gic_v3_its.c optional !intrng arm64/arm64/identcpu.c standard arm64/arm64/intr_machdep.c optional !intrng From owner-svn-src-all@freebsd.org Mon May 16 15:03:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 293AEB3D549; Mon, 16 May 2016 15:03:54 +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 D44D71FAE; Mon, 16 May 2016 15:03:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GF3r4e020857; Mon, 16 May 2016 15:03:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GF3rRa020856; Mon, 16 May 2016 15:03:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605161503.u4GF3rRa020856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 15:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299945 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:03:54 -0000 Author: avg Date: Mon May 16 15:03:52 2016 New Revision: 299945 URL: https://svnweb.freebsd.org/changeset/base/299945 Log: avoid deadlock between zfsctl_snapdir_lookup and zfsctl_snapshot_reclaim The former acquired a snap vnode lock while holding sd_lock while the latter does the opposite. The solution is drop sd_lock before acquiring the vnode lock. That should be okay as we are still holding a lock on the 'snapshot' directory in the exclusive mode. That lock ensures that there are no concurrent lookups in the directory and thus no concurrent mount attempts. But now we have to account for the possibility that the snap vnode might get reclaim after we drop sd_lock and before we can get the node lock. So, check for that case and retry. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 14:07:43 2016 (r299944) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:03:52 2016 (r299945) @@ -1011,6 +1011,7 @@ zfsctl_snapdir_lookup(ap) #endif } +relookup: mutex_enter(&sdp->sd_lock); search.se_name = (char *)nm; if ((sep = avl_find(&sdp->sd_snaps, &search, &where)) != NULL) { @@ -1085,7 +1086,16 @@ domount: (void) snprintf(mountpoint, mountpoint_len, "%s/" ZFS_CTLDIR_NAME "/snapshot/%s", dvp->v_vfsp->mnt_stat.f_mntonname, nm); - VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE)); + mutex_exit(&sdp->sd_lock); + + /* + * The vnode may get reclaimed between dropping sd_lock and + * getting the vnode lock. + * */ + err = vn_lock(*vpp, LK_EXCLUSIVE); + if (err == ENOENT) + goto relookup; + VERIFY0(err); err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0); kmem_free(mountpoint, mountpoint_len); if (err == 0) { @@ -1100,7 +1110,6 @@ domount: VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs; (*vpp)->v_flag &= ~VROOT; } - mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); #ifdef illumos From owner-svn-src-all@freebsd.org Mon May 16 15:13:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E679AB3D9F9; Mon, 16 May 2016 15:13:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A57FE188E; Mon, 16 May 2016 15:13:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GFDG2W023999; Mon, 16 May 2016 15:13:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GFDG1U023997; Mon, 16 May 2016 15:13:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605161513.u4GFDG1U023997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 15:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299946 - in 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:13:18 -0000 Author: avg Date: Mon May 16 15:13:16 2016 New Revision: 299946 URL: https://svnweb.freebsd.org/changeset/base/299946 Log: gfs_lookup_dot() does not have to acquire any locks In fact, that was dangerous. For example, zfsctl_snapshot_reclaim() calls gfs_dir_lookup() on ".." path and that ends up calling gfs_lookup_dot() which violated locking order by acquiring the parent's directory vnode lock after the child's vnode lock. Also, the previous behavior was inconsistent as gfs_dir_lookup() returned a locked vnode for . and .. lookups, but not for any other. Now gfs_lookup_dot() just references a resulting vnode and the locking is done in its consumers, where necessary. Note that we do not enable shared locking support for any gfs / zfsctl vnodes. This commit partially reverts r273641. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Mon May 16 15:03:52 2016 (r299945) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Mon May 16 15:13:16 2016 (r299946) @@ -442,19 +442,9 @@ gfs_lookup_dot(vnode_t **vpp, vnode_t *d *vpp = dvp; return (0); } else if (strcmp(nm, "..") == 0) { - if (pvp == NULL) { - ASSERT(dvp->v_flag & VROOT); - VN_HOLD(dvp); - *vpp = dvp; - ASSERT_VOP_ELOCKED(dvp, "gfs_lookup_dot: non-locked dvp"); - } else { - ltype = VOP_ISLOCKED(dvp); - VOP_UNLOCK(dvp, 0); - VN_HOLD(pvp); - *vpp = pvp; - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); - vn_lock(dvp, ltype | LK_RETRY); - } + ASSERT(pvp != NULL); + VN_HOLD(pvp); + *vpp = pvp; return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:03:52 2016 (r299945) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:13:16 2016 (r299946) @@ -987,6 +987,11 @@ zfsctl_snapdir_lookup(ap) ZFS_ENTER(zfsvfs); if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) { + if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') { + VOP_UNLOCK(dvp, 0); + VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE)); + VERIFY0(vn_lock(dvp, LK_EXCLUSIVE)); + } ZFS_EXIT(zfsvfs); return (0); } @@ -1151,6 +1156,11 @@ zfsctl_shares_lookup(ap) strlcpy(nm, cnp->cn_nameptr, cnp->cn_namelen + 1); if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) { + if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') { + VOP_UNLOCK(dvp, 0); + VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE)); + VERIFY0(vn_lock(dvp, LK_EXCLUSIVE)); + } ZFS_EXIT(zfsvfs); return (0); } @@ -1488,7 +1498,6 @@ zfsctl_snapshot_reclaim(ap) VERIFY(gfs_dir_lookup(vp, "..", &dvp, cr, 0, NULL, NULL) == 0); sdp = dvp->v_data; - VOP_UNLOCK(dvp, 0); /* this may already have been unmounted */ if (sdp == NULL) { VN_RELE(dvp); From owner-svn-src-all@freebsd.org Mon May 16 15:28:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72653B3DC84; Mon, 16 May 2016 15:28:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2725A10DE; Mon, 16 May 2016 15:28:40 +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 u4GFSd9j027214; Mon, 16 May 2016 15:28:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GFSdHT027213; Mon, 16 May 2016 15:28:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605161528.u4GFSdHT027213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 15:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299947 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:28:40 -0000 Author: avg Date: Mon May 16 15:28:39 2016 New Revision: 299947 URL: https://svnweb.freebsd.org/changeset/base/299947 Log: fix locking in zfsctl_root_lookup Dropping the root vnode's lock after VFS_ROOT() didn't really help the fact that we acquired the lock while holding its child's, .zfs, lock while performing the operaiton. So, directly use zfs_zget() to get the root vnode. While there simplify the code in zfsctl_freebsd_root_lookup. We know that .zfs is always exclusively locked. We know that there is already a reference on *vpp, so no need for an extra one. Account for the fact that .. lookup may ask for a different lock type, not necessarily LK_EXCLUSIVE. And handle a possible failure to acquire the lock given the lock flags. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:13:16 2016 (r299946) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:28:39 2016 (r299947) @@ -537,9 +537,20 @@ zfsctl_root_lookup(vnode_t *dvp, char *n ZFS_ENTER(zfsvfs); if (strcmp(nm, "..") == 0) { +#ifdef illumos err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp); +#else + /* + * NB: can not use VFS_ROOT here as it would acquire + * the vnode lock of the parent (root) vnode while + * holding the child's (.zfs) lock. + */ + znode_t *rootzp; + + err = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (err == 0) - VOP_UNLOCK(*vpp, 0); + *vpp = ZTOV(rootzp); +#endif } else { err = gfs_vop_lookup(dvp, nm, vpp, pnp, flags, rdir, cr, ct, direntflags, realpnp); @@ -601,10 +612,10 @@ zfsctl_freebsd_root_lookup(ap) vnode_t **vpp = ap->a_vpp; cred_t *cr = ap->a_cnp->cn_cred; int flags = ap->a_cnp->cn_flags; + int lkflags = ap->a_cnp->cn_lkflags; int nameiop = ap->a_cnp->cn_nameiop; char nm[NAME_MAX + 1]; int err; - int ltype; if ((flags & ISLASTCN) && (nameiop == RENAME || nameiop == CREATE)) return (EOPNOTSUPP); @@ -613,16 +624,15 @@ zfsctl_freebsd_root_lookup(ap) strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1); err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, NULL); if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) { - ltype = VOP_ISLOCKED(dvp); - if (flags & ISDOTDOT) { - VN_HOLD(*vpp); + if (flags & ISDOTDOT) VOP_UNLOCK(dvp, 0); + err = vn_lock(*vpp, lkflags); + if (err != 0) { + vrele(*vpp); + *vpp = NULL; } - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); - if (flags & ISDOTDOT) { - VN_RELE(*vpp); - vn_lock(dvp, ltype| LK_RETRY); - } + if (flags & ISDOTDOT) + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); } return (err); From owner-svn-src-all@freebsd.org Mon May 16 15:32:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 812E1B3DE17; Mon, 16 May 2016 15:32:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB521683; Mon, 16 May 2016 15:32:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GFW2u2030281; Mon, 16 May 2016 15:32:02 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GFW2cw030280; Mon, 16 May 2016 15:32:02 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605161532.u4GFW2cw030280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 15:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299948 - head/lib/libpam/modules/pam_unix X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:32:03 -0000 Author: truckman Date: Mon May 16 15:32:02 2016 New Revision: 299948 URL: https://svnweb.freebsd.org/changeset/base/299948 Log: Set retval in the empty password case to avoid a path through the code that fails to set retval before falling through to the final return(). Reported by: emaste Reported by: Coverity CID: 1018711 MFC after: 1 week Modified: head/lib/libpam/modules/pam_unix/pam_unix.c Modified: head/lib/libpam/modules/pam_unix/pam_unix.c ============================================================================== --- head/lib/libpam/modules/pam_unix/pam_unix.c Mon May 16 15:28:39 2016 (r299947) +++ head/lib/libpam/modules/pam_unix/pam_unix.c Mon May 16 15:32:02 2016 (r299948) @@ -332,6 +332,7 @@ pam_sm_chauthtok(pam_handle_t *pamh, int * XXX check PAM_DISALLOW_NULL_AUTHTOK */ old_pass = ""; + retval = PAM_SUCCESS; } else { retval = pam_get_authtok(pamh, PAM_OLDAUTHTOK, &old_pass, NULL); From owner-svn-src-all@freebsd.org Mon May 16 15:34:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8EE9B3DE7B; Mon, 16 May 2016 15:34:46 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ACB96184C; Mon, 16 May 2016 15:34:46 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4GFYaLI071803; Mon, 16 May 2016 08:34:40 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605161534.u4GFYaLI071803@gw.catspoiler.org> Date: Mon, 16 May 2016 08:34:36 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299926 - head/lib/libpam/modules/pam_unix To: emaste@freebsd.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:34:47 -0000 On 16 May, Ed Maste wrote: > On 16 May 2016 at 04:34, Don Lewis wrote: >> Author: truckman >> Date: Mon May 16 08:34:17 2016 >> New Revision: 299926 >> URL: https://svnweb.freebsd.org/changeset/base/299926 >> >> Log: >> Hoist the getpwnam() call outside the first if/else block in >> pam_sm_chauthtok(). Set user = getlogin() inside the true >> branch so that it is initialized for the following PAM_LOG() >> call. This is how it is done in pam_sm_authenticate(). > > Unfortunately this triggers a warning on powerpc/powerpc64: > > /scratch/tmp/emaste/freebsd/lib/libpam/modules/pam_unix/pam_unix.c: In > function 'pam_sm_chauthtok': > /scratch/tmp/emaste/freebsd/lib/libpam/modules/pam_unix/pam_unix.c:278: > warning: 'retval' may be used uninitialized in this function > > I don't see why GCC warns now and did not before, though. Strange ... It turns out that Coverity did notice this, CID 1018711. It should be fixed by r299948. From owner-svn-src-all@freebsd.org Mon May 16 15:37:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58486B3DEE5; Mon, 16 May 2016 15:37:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0301A29; Mon, 16 May 2016 15:37:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GFbfOO030526; Mon, 16 May 2016 15:37:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GFbfs5030525; Mon, 16 May 2016 15:37:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605161537.u4GFbfs5030525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 15:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299949 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:37:42 -0000 Author: avg Date: Mon May 16 15:37:41 2016 New Revision: 299949 URL: https://svnweb.freebsd.org/changeset/base/299949 Log: try to recycle "snap" vnodes as soon as possible Those vnodes should not linger. "Stale" nodes may get out of synchronization with actual snapshots. For example if we destroy a snapshot and create a new one with the same name. Or when we rename a snapshot. While there fix the argument type for zfsctl_snapshot_reclaim(). Also, its original argument can be passed to gfs_vop_reclaim() directly. Bug 209093 could be related although I have not specifically verified that. Referencing just in case. PR: 209093 MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:32:02 2016 (r299948) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:37:41 2016 (r299949) @@ -1490,17 +1490,28 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin return (vp); } +static int +zfsctl_snapshot_inactive(ap) + struct vop_inactive_args /* { + struct vnode *a_vp; + struct thread *a_td; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + + vrecycle(vp); + return (0); +} static int zfsctl_snapshot_reclaim(ap) - struct vop_inactive_args /* { + struct vop_reclaim_args /* { struct vnode *a_vp; struct thread *a_td; } */ *ap; { vnode_t *vp = ap->a_vp; cred_t *cr = ap->a_td->td_ucred; - struct vop_reclaim_args iap; zfsctl_snapdir_t *sdp; zfs_snapentry_t *sep, *next; int locked; @@ -1543,8 +1554,7 @@ zfsctl_snapshot_reclaim(ap) * "active". If we lookup the same name again we will end up * creating a new vnode. */ - iap.a_vp = vp; - gfs_vop_reclaim(&iap); + gfs_vop_reclaim(ap); return (0); } @@ -1597,7 +1607,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc */ static struct vop_vector zfsctl_ops_snapshot = { .vop_default = &default_vnodeops, - .vop_inactive = VOP_NULL, + .vop_inactive = zfsctl_snapshot_inactive, .vop_reclaim = zfsctl_snapshot_reclaim, .vop_vptocnp = zfsctl_snapshot_vptocnp, }; From owner-svn-src-all@freebsd.org Mon May 16 15:43:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2897EB3D0ED; Mon, 16 May 2016 15:43:01 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7FB6101C; Mon, 16 May 2016 15:43:00 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GFh0DV033455; Mon, 16 May 2016 15:43:00 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GFh0cS033454; Mon, 16 May 2016 15:43:00 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605161543.u4GFh0cS033454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 15:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299950 - head/lib/libbsdstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:43:01 -0000 Author: truckman Date: Mon May 16 15:42:59 2016 New Revision: 299950 URL: https://svnweb.freebsd.org/changeset/base/299950 Log: Fix off by one error in index limit calculation Reported by: Coverity CID: 1193826 Modified: head/lib/libbsdstat/bsdstat.c Modified: head/lib/libbsdstat/bsdstat.c ============================================================================== --- head/lib/libbsdstat/bsdstat.c Mon May 16 15:37:41 2016 (r299949) +++ head/lib/libbsdstat/bsdstat.c Mon May 16 15:42:59 2016 (r299950) @@ -53,7 +53,7 @@ bsdstat_setfmt(struct bsdstat *sf, const "skipped\n", sf->name, tok); continue; } - if (j+3 > (int) sizeof(sf->fmts)) { + if (j+4 > (int) sizeof(sf->fmts)) { fprintf(stderr, "%s: not enough room for all stats; " "stopped at %s\n", sf->name, tok); break; From owner-svn-src-all@freebsd.org Mon May 16 15:48:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A16D5B3D1B7; Mon, 16 May 2016 15:48:57 +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 54F861239; Mon, 16 May 2016 15:48:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GFmuut034507; Mon, 16 May 2016 15:48:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GFmuCW034506; Mon, 16 May 2016 15:48:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605161548.u4GFmuCW034506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 May 2016 15:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299951 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 15:48:57 -0000 Author: avg Date: Mon May 16 15:48:56 2016 New Revision: 299951 URL: https://svnweb.freebsd.org/changeset/base/299951 Log: do not destroy 'snapdir' when it becomes inactive That was just wrong. In fact, we can safely keep this static entry when it's inactive. Now the destructive action is moved to the reclaim method and the function is renamed from zfsctl_snapdir_inactive(0 to zfsctl_snapdir_reclaim(). Also, we can use gfs_vop_reclaim() instead of gfs_dir_inactive() + kmem_free(). Lastly, we can just assert that the node does not any children when it is reclaimed, even on the force unmount. That's because zfs_umount() does an extra vflush() pass which should destroy all snapshot-mountpoint vnodes that are the snapdir's children. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:42:59 2016 (r299950) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon May 16 15:48:56 2016 (r299951) @@ -454,25 +454,6 @@ zfsctl_shares_fid(ap) return (error); } -static int -zfsctl_common_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - struct thread *a_td; - } */ *ap; -{ - vnode_t *vp = ap->a_vp; - - /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); - VI_LOCK(vp); - vp->v_data = NULL; - VI_UNLOCK(vp); - return (0); -} - /* * .zfs inode namespace * @@ -1377,8 +1358,8 @@ zfsctl_snapdir_getattr(ap) /* ARGSUSED */ static int -zfsctl_snapdir_inactive(ap) - struct vop_inactive_args /* { +zfsctl_snapdir_reclaim(ap) + struct vop_reclaim_args /* { struct vnode *a_vp; struct thread *a_td; } */ *ap; @@ -1387,21 +1368,10 @@ zfsctl_snapdir_inactive(ap) zfsctl_snapdir_t *sdp = vp->v_data; zfs_snapentry_t *sep; - /* - * On forced unmount we have to free snapshots from here. - */ - mutex_enter(&sdp->sd_lock); - while ((sep = avl_first(&sdp->sd_snaps)) != NULL) { - avl_remove(&sdp->sd_snaps, sep); - kmem_free(sep->se_name, strlen(sep->se_name) + 1); - kmem_free(sep, sizeof (zfs_snapentry_t)); - } - mutex_exit(&sdp->sd_lock); - gfs_dir_inactive(vp); ASSERT(avl_numnodes(&sdp->sd_snaps) == 0); mutex_destroy(&sdp->sd_lock); avl_destroy(&sdp->sd_snaps); - kmem_free(sdp, sizeof (zfsctl_snapdir_t)); + gfs_vop_reclaim(ap); return (0); } @@ -1448,8 +1418,8 @@ static struct vop_vector zfsctl_ops_snap .vop_mkdir = zfsctl_freebsd_snapdir_mkdir, .vop_readdir = gfs_vop_readdir, .vop_lookup = zfsctl_snapdir_lookup, - .vop_inactive = zfsctl_snapdir_inactive, - .vop_reclaim = zfsctl_common_reclaim, + .vop_inactive = VOP_NULL, + .vop_reclaim = zfsctl_snapdir_reclaim, .vop_fid = zfsctl_common_fid, }; From owner-svn-src-all@freebsd.org Mon May 16 16:01:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D2D0B3D6D6; Mon, 16 May 2016 16:01:47 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE3E1DE5; Mon, 16 May 2016 16:01:47 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GG1kaR041731; Mon, 16 May 2016 16:01:46 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GG1kMN041730; Mon, 16 May 2016 16:01:46 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605161601.u4GG1kMN041730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 16:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299952 - head/usr.bin/ldd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:01:47 -0000 Author: truckman Date: Mon May 16 16:01:46 2016 New Revision: 299952 URL: https://svnweb.freebsd.org/changeset/base/299952 Log: Increase size of argv[] array to avoid running off the end. Reported by: Coverity CID: 1193819 MFC after: 1 week Modified: head/usr.bin/ldd/ldd.c Modified: head/usr.bin/ldd/ldd.c ============================================================================== --- head/usr.bin/ldd/ldd.c Mon May 16 15:48:56 2016 (r299951) +++ head/usr.bin/ldd/ldd.c Mon May 16 16:01:46 2016 (r299952) @@ -88,7 +88,7 @@ static void usage(void); static int execldd32(char *file, char *fmt1, char *fmt2, int aflag, int vflag) { - char *argv[8]; + char *argv[9]; int i, rval, status; LDD_UNSETENV("TRACE_LOADED_OBJECTS"); From owner-svn-src-all@freebsd.org Mon May 16 16:09:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62256B3DA83 for ; Mon, 16 May 2016 16:09:12 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::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 755EF1344 for ; Mon, 16 May 2016 16:09:11 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lb0-x229.google.com with SMTP id n11so51861211lbh.1 for ; Mon, 16 May 2016 09:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0Fv8kmA7H+FhLUdP+1izRkYdf7jBn99oBuhrRbW/TJA=; b=XAx5c/9MSAZXxdI6cX6NNon43swDQfkDcCJU+Xz9aire0ps1E4lQxIAQv5Pm62/S07 1Uw/ilm2gXqMOPTbl2sOYxcL6tAvklxJtlSLnhy1UfHdxxtM6d8j5SryoYH9mcXH1MZN FFwb60ldku7u6t9mHpzC2lpxauBjTZfCQsGy9+/dX0LE+h2wYuY4Ja0ze/x1u4PV27X3 T06VIGf0S5x+EbcBgbBe164Mr7eSAgOTEMQ8VCPZbyN5U8NG+WhWgv/2lLfbjhlnOwnt Khu0h4ThRZpqt9x6ijPC4rdHG9JNOt+H7/fXgpb2YvI9z3tgKvoYVVbYIClpkLZHvFNC 6tOg== 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=0Fv8kmA7H+FhLUdP+1izRkYdf7jBn99oBuhrRbW/TJA=; b=Rr+jjp1jTtnR0ooPdnDNH2JiIaLHPaXcskM3263cljQwWXRlEDamlMx/FK1olhpvQx 2YuPHKU/+idMDZqxwyy+cTJNFJXyn/ZYYZ8qs00YhOMjHlvtRfdy2aTP416HH3CEg58L hexOKUZBZvXbPpm5NuYsDbNzM4jfcoIJNo29hn9qHp2Iug670d8KA0JTXDdMAJPNNXyE DmY6KFrPAR/XBdIT+byG6cg8hOcwOS9LLskx6LDimdNvt5xnzLGh/rIsF42dsQxaprj5 RJXrecc9s3pWayMSwczU+eVQp1moB7Y+xW28ob4YGIu9nXxFeOCYGmUkMWjhIaUdALqK Nbyg== X-Gm-Message-State: AOPr4FVPJMqd6VR3zsO2vEURlhililg93y8rlALornB5mn6TgPasTmmZSVYiL/IhHF+UuiMVtPVGdIS83vfaHA== X-Received: by 10.112.126.136 with SMTP id my8mr7525056lbb.22.1463414949465; Mon, 16 May 2016 09:09:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.68 with HTTP; Mon, 16 May 2016 09:08:49 -0700 (PDT) In-Reply-To: <201605161407.u4GE7h9n002600@repo.freebsd.org> References: <201605161407.u4GE7h9n002600@repo.freebsd.org> From: Zbigniew Bodek Date: Mon, 16 May 2016 18:08:49 +0200 Message-ID: Subject: Re: svn commit: r299944 - in head/sys: arm64/arm64 conf To: Andrew Turner 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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:09:12 -0000 Hello Andrew, I think committing this code should be preceded by at least brief review. Few remarks to the code found on the first glance below. Kind regards zbb 2016-05-16 16:07 GMT+02:00 Andrew Turner : > Author: andrew > Date: Mon May 16 14:07:43 2016 > New Revision: 299944 > URL: https://svnweb.freebsd.org/changeset/base/299944 > > Log: > Add intrng support to the GICv3 driver. It lacks ITS support so won't > handle > MSI or MSI-X interrupts, however this is enought to boot FreeBSD under > the > ARM Foundation Model with a GICv3 interrupt controller. > > Approved by: ABT Systems Ltd > Relnotes: yes > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/arm64/arm64/gic_v3.c > head/sys/arm64/arm64/gic_v3_fdt.c > head/sys/arm64/arm64/gic_v3_var.h > head/sys/conf/files.arm64 > > Modified: head/sys/arm64/arm64/gic_v3.c > > ============================================================================== > --- head/sys/arm64/arm64/gic_v3.c Mon May 16 13:39:04 2016 > (r299943) > +++ head/sys/arm64/arm64/gic_v3.c Mon May 16 14:07:43 2016 > (r299944) > @@ -1,7 +1,10 @@ > /*- > - * Copyright (c) 2015 The FreeBSD Foundation > + * Copyright (c) 2015-2016 The FreeBSD Foundation > * All rights reserved. > * > + * This software was developed by Andrew Turner under > + * the sponsorship of the FreeBSD Foundation. > + * > * This software was developed by Semihalf under > * the sponsorship of the FreeBSD Foundation. > * > @@ -27,6 +30,8 @@ > * SUCH DAMAGE. > */ > > +#include "opt_platform.h" > + > #include > __FBSDID("$FreeBSD$"); > > @@ -58,6 +63,28 @@ __FBSDID("$FreeBSD$"); > #include "gic_v3_reg.h" > #include "gic_v3_var.h" > > +#ifdef INTRNG > +static pic_disable_intr_t gic_v3_disable_intr; > +static pic_enable_intr_t gic_v3_enable_intr; > +static pic_map_intr_t gic_v3_map_intr; > +static pic_setup_intr_t gic_v3_setup_intr; > +static pic_teardown_intr_t gic_v3_teardown_intr; > +static pic_post_filter_t gic_v3_post_filter; > +static pic_post_ithread_t gic_v3_post_ithread; > +static pic_pre_ithread_t gic_v3_pre_ithread; > +static pic_bind_intr_t gic_v3_bind_intr; > +#ifdef SMP > +static pic_init_secondary_t gic_v3_init_secondary; > +static pic_ipi_send_t gic_v3_ipi_send; > +static pic_ipi_setup_t gic_v3_ipi_setup; > +#endif > + > +static u_int gic_irq_cpu; > +#ifdef SMP > +static u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; > +static u_int sgi_first_unused = GIC_FIRST_SGI; > +#endif > +#else > /* Device and PIC methods */ > static int gic_v3_bind(device_t, u_int, u_int); > static void gic_v3_dispatch(device_t, struct trapframe *); > @@ -68,11 +95,29 @@ static void gic_v3_unmask_irq(device_t, > static void gic_v3_init_secondary(device_t); > static void gic_v3_ipi_send(device_t, cpuset_t, u_int); > #endif > +#endif > > static device_method_t gic_v3_methods[] = { > /* Device interface */ > DEVMETHOD(device_detach, gic_v3_detach), > > +#ifdef INTRNG > + /* Interrupt controller interface */ > + DEVMETHOD(pic_disable_intr, gic_v3_disable_intr), > + DEVMETHOD(pic_enable_intr, gic_v3_enable_intr), > + DEVMETHOD(pic_map_intr, gic_v3_map_intr), > + DEVMETHOD(pic_setup_intr, gic_v3_setup_intr), > + DEVMETHOD(pic_teardown_intr, gic_v3_teardown_intr), > + DEVMETHOD(pic_post_filter, gic_v3_post_filter), > + DEVMETHOD(pic_post_ithread, gic_v3_post_ithread), > + DEVMETHOD(pic_pre_ithread, gic_v3_pre_ithread), > +#ifdef SMP > + DEVMETHOD(pic_bind_intr, gic_v3_bind_intr), > + DEVMETHOD(pic_init_secondary, gic_v3_init_secondary), > + DEVMETHOD(pic_ipi_send, gic_v3_ipi_send), > + DEVMETHOD(pic_ipi_setup, gic_v3_ipi_setup), > +#endif > +#else > /* PIC interface */ > DEVMETHOD(pic_bind, gic_v3_bind), > DEVMETHOD(pic_dispatch, gic_v3_dispatch), > @@ -83,6 +128,8 @@ static device_method_t gic_v3_methods[] > DEVMETHOD(pic_init_secondary, gic_v3_init_secondary), > DEVMETHOD(pic_ipi_send, gic_v3_ipi_send), > #endif > +#endif > + > /* End */ > DEVMETHOD_END > }; > @@ -144,6 +191,10 @@ gic_v3_attach(device_t dev) > int rid; > int err; > size_t i; > +#ifdef INTRNG > + u_int irq; > + const char *name; > +#endif > > sc = device_get_softc(dev); > sc->gic_registered = FALSE; > @@ -192,6 +243,36 @@ gic_v3_attach(device_t dev) > if (sc->gic_nirqs > GIC_I_NUM_MAX) > sc->gic_nirqs = GIC_I_NUM_MAX; > > +#ifdef INTRNG > + sc->gic_irqs = malloc(sizeof(*sc->gic_irqs) * sc->gic_nirqs, > + M_GIC_V3, M_WAITOK | M_ZERO); > + name = device_get_nameunit(dev); > + for (irq = 0; irq < sc->gic_nirqs; irq++) { > + struct intr_irqsrc *isrc; > + > + sc->gic_irqs[irq].gi_irq = irq; > + sc->gic_irqs[irq].gi_pol = INTR_POLARITY_CONFORM; > + sc->gic_irqs[irq].gi_trig = INTR_TRIGGER_CONFORM; > + > + isrc = &sc->gic_irqs[irq].gi_isrc; > + if (irq <= GIC_LAST_SGI) { > + err = intr_isrc_register(isrc, sc->dev, > + INTR_ISRCF_IPI, "%s,i%u", name, irq - > GIC_FIRST_SGI); > + } else if (irq <= GIC_LAST_PPI) { > + err = intr_isrc_register(isrc, sc->dev, > + INTR_ISRCF_PPI, "%s,p%u", name, irq - > GIC_FIRST_PPI); > + } else { > + err = intr_isrc_register(isrc, sc->dev, 0, > + "%s,s%u", name, irq - GIC_FIRST_SPI); > + } > + if (err != 0) { > + /* XXX call intr_isrc_deregister() */ > + free(irqs, M_DEVBUF); > + return (err); > + } > + } > +#endif > + > /* Get the number of supported interrupt identifier bits */ > sc->gic_idbits = GICD_TYPER_IDBITS(typer); > > @@ -210,8 +291,10 @@ gic_v3_attach(device_t dev) > * Full success. > * Now register PIC to the interrupts handling layer. > */ > +#ifndef INTRNG > arm_register_root_pic(dev, sc->gic_nirqs); > sc->gic_registered = TRUE; > +#endif > > return (0); > } > @@ -244,6 +327,508 @@ gic_v3_detach(device_t dev) > return (0); > } > > +#ifdef INTRNG > +int > +arm_gic_v3_intr(void *arg) > +{ > + struct gic_v3_softc *sc = arg; > + struct gic_v3_irqsrc *gi; > + uint64_t active_irq; > + struct trapframe *tf; > + bool first; > + > + first = true; > + > + while (1) { > + if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) { > + /* > + * Hardware: Cavium ThunderX > + * Chip revision: Pass 1.0 (early version) > + * Pass 1.1 (production) > + * ERRATUM: 22978, 23154 > + */ > + __asm __volatile( > + "nop;nop;nop;nop;nop;nop;nop;nop; \n" > + "mrs %0, ICC_IAR1_EL1 \n" > + "nop;nop;nop;nop; \n" > + "dsb sy \n" > + : "=&r" (active_irq)); > + } else { > + active_irq = gic_icc_read(IAR1); > + } > + > + if (__predict_false(active_irq >= sc->gic_nirqs)) > + return (FILTER_HANDLED); > IMHO this is not true. Active IRQ could be much bigger than number of supported IRQs. We are asking for debugging in the future when we enable ITS. > + > + tf = curthread->td_intr_frame; > + gi = &sc->gic_irqs[active_irq]; > + if (active_irq <= GIC_LAST_SGI) { > + /* Call EOI for all IPI before dispatch. */ > + gic_icc_write(EOIR1, (uint64_t)active_irq); > +#ifdef SMP > + intr_ipi_dispatch(sgi_to_ipi[gi->gi_irq], tf); > +#else > + device_printf(sc->dev, "SGI %u on UP system > detected\n", > + active_irq - GIC_FIRST_SGI); > +#endif > + } else if (active_irq >= GIC_FIRST_PPI && > + active_irq <= GIC_LAST_SPI) { > + if (gi->gi_pol == INTR_TRIGGER_EDGE) > + gic_icc_write(EOIR1, gi->gi_irq); > + > + if (intr_isrc_dispatch(&gi->gi_isrc, tf) != 0) { > + if (gi->gi_pol != INTR_TRIGGER_EDGE) > + gic_icc_write(EOIR1, gi->gi_irq); > + gic_v3_disable_intr(sc->dev, &gi->gi_isrc); > + device_printf(sc->dev, > + "Stray irq %lu disabled\n", > active_irq); > + } > + } > + } > +} > + > +#ifdef FDT > +static int > +gic_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int *irqp, > + enum intr_polarity *polp, enum intr_trigger *trigp) > All other functions are called gic_v3 and this one is just gic_ Why can't we move as much FDT code to the dedicated file which is gic_v3_fdt.c? +{ > + u_int irq; > + > + if (ncells < 3) > + return (EINVAL); > + > + /* > + * The 1st cell is the interrupt type: > + * 0 = SPI > + * 1 = PPI > + * The 2nd cell contains the interrupt number: > + * [0 - 987] for SPI > + * [0 - 15] for PPI > + * The 3rd cell is the flags, encoded as follows: > + * bits[3:0] trigger type and level flags > + * 1 = edge triggered > + * 2 = edge triggered (PPI only) > + * 4 = level-sensitive > + * 8 = level-sensitive (PPI only) > + */ > + switch (cells[0]) { > + case 0: > + irq = GIC_FIRST_SPI + cells[1]; > + /* SPI irq is checked later. */ > + break; > + case 1: > + irq = GIC_FIRST_PPI + cells[1]; > + if (irq > GIC_LAST_PPI) { > + device_printf(dev, "unsupported PPI interrupt " > + "number %u\n", cells[1]); > + return (EINVAL); > + } > + break; > + default: > + device_printf(dev, "unsupported interrupt type " > + "configuration %u\n", cells[0]); > + return (EINVAL); > + } > + > + switch (cells[2] & 0xf) { > + case 1: > + *trigp = INTR_TRIGGER_EDGE; > + *polp = INTR_POLARITY_HIGH; > + break; > + case 2: > + *trigp = INTR_TRIGGER_EDGE; > + *polp = INTR_POLARITY_LOW; > + break; > + case 4: > + *trigp = INTR_TRIGGER_LEVEL; > + *polp = INTR_POLARITY_HIGH; > + break; > + case 8: > + *trigp = INTR_TRIGGER_LEVEL; > + *polp = INTR_POLARITY_LOW; > + break; > + default: > + device_printf(dev, "unsupported trigger/polarity " > + "configuration 0x%02x\n", cells[2]); > + return (EINVAL); > + } > + > + /* Check the interrupt is valid */ > + if (irq >= GIC_FIRST_SPI && *polp != INTR_POLARITY_HIGH) > + return (EINVAL); > + > + *irqp = irq; > + return (0); > +} > +#endif > + > +static int > +do_gic_v3_map_intr(device_t dev, struct intr_map_data *data, u_int *irqp, > + enum intr_polarity *polp, enum intr_trigger *trigp) > +{ > + struct gic_v3_softc *sc; > + enum intr_polarity pol; > + enum intr_trigger trig; > +#ifdef FDT > + struct intr_map_data_fdt *daf; > +#endif > + u_int irq; > + > + sc = device_get_softc(dev); > + > + switch (data->type) { > +#ifdef FDT > + case INTR_MAP_DATA_FDT: > + daf = (struct intr_map_data_fdt *)data; > + if (gic_map_fdt(dev, daf->ncells, daf->cells, &irq, &pol, > + &trig) != 0) > + return (EINVAL); > + break; > +#endif > + default: > + return (EINVAL); > + } > + > + if (irq >= sc->gic_nirqs) > + return (EINVAL); > + switch (pol) { > + case INTR_POLARITY_CONFORM: > + case INTR_POLARITY_LOW: > + case INTR_POLARITY_HIGH: > + break; > + default: > + return (EINVAL); > + } > + switch (trig) { > + case INTR_TRIGGER_CONFORM: > + case INTR_TRIGGER_EDGE: > + case INTR_TRIGGER_LEVEL: > + break; > + default: > + return (EINVAL); > + } > + > + *irqp = irq; > + if (polp != NULL) > + *polp = pol; > + if (trigp != NULL) > + *trigp = trig; > + return (0); > +} > + > +static int > +gic_v3_map_intr(device_t dev, struct intr_map_data *data, > + struct intr_irqsrc **isrcp) > +{ > + struct gic_v3_softc *sc; > + int error; > + u_int irq; > + > + error = do_gic_v3_map_intr(dev, data, &irq, NULL, NULL); > + if (error == 0) { > + sc = device_get_softc(dev); > + *isrcp = GIC_INTR_ISRC(sc, irq); > + } > + return (error); > +} > + > +static int > +gic_v3_setup_intr(device_t dev, struct intr_irqsrc *isrc, > + struct resource *res, struct intr_map_data *data) > +{ > + struct gic_v3_softc *sc = device_get_softc(dev); > + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; > + enum intr_trigger trig; > + enum intr_polarity pol; > + uint32_t reg; > + u_int irq; > + int error; > + > + if (data == NULL) > + return (ENOTSUP); > + > + error = do_gic_v3_map_intr(dev, data, &irq, &pol, &trig); > + if (error != 0) > + return (error); > + > + if (gi->gi_irq != irq || pol == INTR_POLARITY_CONFORM || > + trig == INTR_TRIGGER_CONFORM) > + return (EINVAL); > + > + /* Compare config if this is not first setup. */ > + if (isrc->isrc_handlers != 0) { > + if (pol != gi->gi_pol || trig != gi->gi_trig) > + return (EINVAL); > + else > + return (0); > + } > + > + gi->gi_pol = pol; > + gi->gi_trig = trig; > + > + /* > + * XXX - In case that per CPU interrupt is going to be enabled in > time > + * when SMP is already started, we need some IPI call which > + * enables it on others CPUs. Further, it's more complicated > as > + * pic_enable_source() and pic_disable_source() should act on > + * per CPU basis only. Thus, it should be solved here > somehow. > + */ > + if (isrc->isrc_flags & INTR_ISRCF_PPI) > + CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); > + > + if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_SPI) { > + mtx_lock_spin(&sc->gic_mtx); > + > + /* Set the trigger and polarity */ > + if (irq <= GIC_LAST_PPI) > + reg = gic_r_read(sc, 4, > + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq)); > + else > + reg = gic_d_read(sc, 4, GICD_ICFGR(irq)); > + if (trig == INTR_TRIGGER_LEVEL) > + reg &= ~(2 << ((irq % 16) * 2)); > + else > + reg |= 2 << ((irq % 16) * 2); > The rule of not using magic numbers does not apply here ;-) ? > + > + if (irq <= GIC_LAST_PPI) { > + gic_r_write(sc, 4, > + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq), reg); > + gic_v3_wait_for_rwp(sc, REDIST); > + } else { > + gic_d_write(sc, 4, GICD_ICFGR(irq), reg); > + gic_v3_wait_for_rwp(sc, DIST); > I would not recommend gic_v3_wait_for_rwp() while holding a spin lock. > + } > + > + mtx_unlock_spin(&sc->gic_mtx); > + > + gic_v3_bind_intr(dev, isrc); > + } > + > + return (0); > +} > + > +static int > +gic_v3_teardown_intr(device_t dev, struct intr_irqsrc *isrc, > + struct resource *res, struct intr_map_data *data) > +{ > + > + panic("gic_v3_teardown_intr"); > +} > + > +static void > +gic_v3_disable_intr(device_t dev, struct intr_irqsrc *isrc) > +{ > + struct gic_v3_softc *sc; > + struct gic_v3_irqsrc *gi; > + u_int irq; > + > + sc = device_get_softc(dev); > + gi = (struct gic_v3_irqsrc *)isrc; > + irq = gi->gi_irq; > + > + if (irq <= GIC_LAST_PPI) { > + /* SGIs and PPIs in corresponding Re-Distributor */ > + gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + > GICD_ICENABLER(irq), > + GICD_I_MASK(irq)); > + gic_v3_wait_for_rwp(sc, REDIST); > + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { > + /* SPIs in distributor */ > + gic_d_write(sc, 4, GICD_ICENABLER(irq), GICD_I_MASK(irq)); > + gic_v3_wait_for_rwp(sc, DIST); > In gic_v3_setup_intr() we need spin lock and here we don't ? > + } else > + panic("gic_v3_disable_intr"); > +} > + > +static void > +gic_v3_enable_intr(device_t dev, struct intr_irqsrc *isrc) > +{ > + struct gic_v3_softc *sc; > + struct gic_v3_irqsrc *gi; > + u_int irq; > + > + sc = device_get_softc(dev); > + gi = (struct gic_v3_irqsrc *)isrc; > + irq = gi->gi_irq; > + > + if (irq <= GIC_LAST_PPI) { > + /* SGIs and PPIs in corresponding Re-Distributor */ > + gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + > GICD_ISENABLER(irq), > + GICD_I_MASK(irq)); > + gic_v3_wait_for_rwp(sc, REDIST); > + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { > + /* SPIs in distributor */ > + gic_d_write(sc, 4, GICD_ISENABLER(irq), GICD_I_MASK(irq)); > + gic_v3_wait_for_rwp(sc, DIST); > + } else > + panic("gic_v3_enable_intr"); > +} > These are almost entirely copied so why change panic string? This one is better? > + > +static void > +gic_v3_pre_ithread(device_t dev, struct intr_irqsrc *isrc) > +{ > + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; > + > + gic_v3_disable_intr(dev, isrc); > + gic_icc_write(EOIR1, gi->gi_irq); > +} > + > +static void > +gic_v3_post_ithread(device_t dev, struct intr_irqsrc *isrc) > +{ > + > + gic_v3_enable_intr(dev, isrc); > +} > + > +static void > +gic_v3_post_filter(device_t dev, struct intr_irqsrc *isrc) > +{ > + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; > + > + if (gi->gi_pol == INTR_TRIGGER_EDGE) > + return; > + > + gic_icc_write(EOIR1, gi->gi_irq); > +} > + > +static int > +gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc) > +{ > + struct gic_v3_softc *sc; > + struct gic_v3_irqsrc *gi; > + int cpu; > + > + gi = (struct gic_v3_irqsrc *)isrc; > + if (gi->gi_irq <= GIC_LAST_PPI) > + return (EINVAL); > + > + KASSERT(gi->gi_irq >= GIC_FIRST_SPI && gi->gi_irq <= GIC_LAST_SPI, > + ("%s: Attempting to bind an invalid IRQ", __func__)); > + > + sc = device_get_softc(dev); > + > + if (CPU_EMPTY(&isrc->isrc_cpu)) { > + gic_irq_cpu = intr_irq_next_cpu(gic_irq_cpu, &all_cpus); > + CPU_SETOF(gic_irq_cpu, &isrc->isrc_cpu); > + gic_d_write(sc, 4, GICD_IROUTER(gi->gi_irq), > + CPU_AFFINITY(gic_irq_cpu)); > + } else { > + /* > + * We can only bind to a single CPU so select > + * the first CPU found. > + */ > + cpu = CPU_FFS(&isrc->isrc_cpu) - 1; > + gic_d_write(sc, 4, GICD_IROUTER(gi->gi_irq), > CPU_AFFINITY(cpu)); > + } > + > + return (0); > +} > + > +#ifdef SMP > +static void > +gic_v3_init_secondary(device_t dev) > +{ > + struct gic_v3_softc *sc; > + gic_v3_initseq_t *init_func; > + struct intr_irqsrc *isrc; > + u_int cpu, irq; > + int err; > + > + sc = device_get_softc(dev); > + cpu = PCPU_GET(cpuid); > + > + /* Train init sequence for boot CPU */ > + for (init_func = gic_v3_secondary_init; *init_func != NULL; > + init_func++) { > + err = (*init_func)(sc); > + if (err != 0) { > + device_printf(dev, > + "Could not initialize GIC for CPU%u\n", cpu); > + return; > + } > + } > + > + /* Unmask attached SGI interrupts. */ > + for (irq = GIC_FIRST_SGI; irq <= GIC_LAST_SGI; irq++) { > + isrc = GIC_INTR_ISRC(sc, irq); > + if (intr_isrc_init_on_cpu(isrc, cpu)) > + gic_v3_enable_intr(dev, isrc); > + } > + > + /* Unmask attached PPI interrupts. */ > + for (irq = GIC_FIRST_PPI; irq <= GIC_LAST_PPI; irq++) { > + isrc = GIC_INTR_ISRC(sc, irq); > + if (intr_isrc_init_on_cpu(isrc, cpu)) > + gic_v3_enable_intr(dev, isrc); > + } > +} > + > +static void > +gic_v3_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus, > + u_int ipi) > What exactly is the functional difference between the current implementation and this one? Maybe we should exchange an old one to this or the opposite way instead of having two different implementations? > +{ > + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; > + uint64_t aff, val, irq; > + int i; > + > +#define GIC_AFF_MASK (CPU_AFF3_MASK | CPU_AFF2_MASK | > CPU_AFF1_MASK) > +#define GIC_AFFINITY(i) (CPU_AFFINITY(i) & GIC_AFF_MASK) > + aff = GIC_AFFINITY(0); > + irq = gi->gi_irq; > + val = 0; > + > + /* Iterate through all CPUs in set */ > + for (i = 0; i < mp_ncpus; i++) { > + /* Move to the next affinity group */ > + if (aff != GIC_AFFINITY(i)) { > + /* Send the IPI */ > + if (val != 0) { > + gic_icc_write(SGI1R, val); > + val = 0; > + } > + aff = GIC_AFFINITY(i); > + } > + > + /* Send the IPI to this cpu */ > + if (CPU_ISSET(i, &cpus)) { > +#define ICC_SGI1R_AFFINITY(aff) \ > + (((uint64_t)CPU_AFF3(aff) << ICC_SGI1R_EL1_AFF3_SHIFT) | \ > + ((uint64_t)CPU_AFF2(aff) << ICC_SGI1R_EL1_AFF2_SHIFT) | \ > + ((uint64_t)CPU_AFF1(aff) << ICC_SGI1R_EL1_AFF1_SHIFT)) > + /* Set the affinity when the first at this level */ > + if (val == 0) > + val = ICC_SGI1R_AFFINITY(aff) | > + irq << ICC_SGI1R_EL1_SGIID_SHIFT; > + /* Set the bit to send the IPI to te CPU */ > + val |= 1 << CPU_AFF0(CPU_AFFINITY(i)); > + } > + } > + > + /* Send the IPI to the last cpu affinity group */ > + if (val != 0) > + gic_icc_write(SGI1R, val); > +#undef GIC_AFF_MASK > +#undef GIC_AFFINITY > Couldn't we just use variables instead of defining and undefinining those ugly macros here? It really looks like they are here just to look different than it was in the previous implementation. > +} > + > +static int > +gic_v3_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc **isrcp) > +{ > + struct intr_irqsrc *isrc; > + struct gic_v3_softc *sc = device_get_softc(dev); > + > + if (sgi_first_unused > GIC_LAST_SGI) > + return (ENOSPC); > + > + isrc = GIC_INTR_ISRC(sc, sgi_first_unused); > + sgi_to_ipi[sgi_first_unused++] = ipi; > + > + CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); > + > + *isrcp = isrc; > + return (0); > +} > +#endif /* SMP */ > +#else /* INTRNG */ > /* > * PIC interface. > */ > @@ -451,6 +1036,7 @@ gic_v3_ipi_send(device_t dev, cpuset_t c > } > } > #endif > +#endif /* !INTRNG */ > > /* > * Helper routines > > Modified: head/sys/arm64/arm64/gic_v3_fdt.c > > ============================================================================== > --- head/sys/arm64/arm64/gic_v3_fdt.c Mon May 16 13:39:04 2016 > (r299943) > +++ head/sys/arm64/arm64/gic_v3_fdt.c Mon May 16 14:07:43 2016 > (r299944) > @@ -38,14 +38,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > #include > > #include > #include > #include > > -#include "pic_if.h" > - > #include "gic_v3_reg.h" > #include "gic_v3_var.h" > > @@ -117,6 +116,9 @@ gic_v3_fdt_attach(device_t dev) > { > struct gic_v3_softc *sc; > pcell_t redist_regions; > +#ifdef INTRNG > + intptr_t xref; > +#endif > int err; > > sc = device_get_softc(dev); > @@ -132,8 +134,22 @@ gic_v3_fdt_attach(device_t dev) > sc->gic_redists.nregions = redist_regions; > > err = gic_v3_attach(dev); > - if (err) > + if (err != 0) > + goto error; > + > +#ifdef INTRNG > + xref = OF_xref_from_node(ofw_bus_get_node(dev)); > + if (intr_pic_register(dev, xref) != 0) { > + device_printf(dev, "could not register PIC\n"); > + goto error; > + } > + > + if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc, > + GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { > goto error; > + } > +#endif > + > /* > * Try to register ITS to this GIC. > * GIC will act as a bus in that case. > @@ -279,6 +295,7 @@ gic_v3_ofw_bus_attach(device_t dev) > return (bus_generic_attach(dev)); > } > > +#ifndef INTRNG > static int gic_v3_its_fdt_probe(device_t dev); > > static device_method_t gic_v3_its_fdt_methods[] = { > @@ -310,3 +327,4 @@ gic_v3_its_fdt_probe(device_t dev) > device_set_desc(dev, GIC_V3_ITS_DEVSTR); > return (BUS_PROBE_DEFAULT); > } > +#endif > > Modified: head/sys/arm64/arm64/gic_v3_var.h > > ============================================================================== > --- head/sys/arm64/arm64/gic_v3_var.h Mon May 16 13:39:04 2016 > (r299943) > +++ head/sys/arm64/arm64/gic_v3_var.h Mon May 16 14:07:43 2016 > (r299944) > @@ -41,6 +41,15 @@ DECLARE_CLASS(gic_v3_driver); > /* 1 bit per LPI + 1 KB more for the obligatory PPI, SGI, SPI stuff */ > #define LPI_PENDTAB_SIZE ((LPI_CONFTAB_SIZE / 8) + 0x400) > > +#ifdef INTRNG > +struct gic_v3_irqsrc { > + struct intr_irqsrc gi_isrc; > + uint32_t gi_irq; > + enum intr_polarity gi_pol; > + enum intr_trigger gi_trig; > +}; > +#endif > + > struct redist_lpis { > vm_offset_t conf_base; > vm_offset_t pend_base[MAXCPU]; > @@ -75,13 +84,22 @@ struct gic_v3_softc { > u_int gic_idbits; > > boolean_t gic_registered; > + > +#ifdef INTRNG > + struct gic_v3_irqsrc *gic_irqs; > +#endif > }; > > +#ifdef INTRNG > +#define GIC_INTR_ISRC(sc, irq) (&sc->gic_irqs[irq].gi_isrc) > +#endif > + > MALLOC_DECLARE(M_GIC_V3); > > /* Device methods */ > int gic_v3_attach(device_t dev); > int gic_v3_detach(device_t dev); > +int arm_gic_v3_intr(void *); > > /* > * ITS > > Modified: head/sys/conf/files.arm64 > > ============================================================================== > --- head/sys/conf/files.arm64 Mon May 16 13:39:04 2016 (r299943) > +++ head/sys/conf/files.arm64 Mon May 16 14:07:43 2016 (r299944) > @@ -28,8 +28,8 @@ arm64/arm64/exception.S standard > arm64/arm64/gic.c optional !intrng > arm64/arm64/gic_acpi.c optional !intrng acpi > arm64/arm64/gic_fdt.c optional !intrng fdt > -arm64/arm64/gic_v3.c optional !intrng > -arm64/arm64/gic_v3_fdt.c optional !intrng fdt > +arm64/arm64/gic_v3.c standard > +arm64/arm64/gic_v3_fdt.c optional fdt > arm64/arm64/gic_v3_its.c optional !intrng > arm64/arm64/identcpu.c standard > arm64/arm64/intr_machdep.c optional !intrng > _______________________________________________ > 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" > From owner-svn-src-all@freebsd.org Mon May 16 16:16:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B27B3DD53; Mon, 16 May 2016 16:16:47 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93E6E1AFE; Mon, 16 May 2016 16:16:47 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GGGkgU045023; Mon, 16 May 2016 16:16:46 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GGGkeu045022; Mon, 16 May 2016 16:16:46 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605161616.u4GGGkeu045022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 16:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299953 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:16:47 -0000 Author: truckman Date: Mon May 16 16:16:46 2016 New Revision: 299953 URL: https://svnweb.freebsd.org/changeset/base/299953 Log: Fix an off by one error to avoid overflowing rp[]. Reported by: Coverity CID: 1007579 Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Mon May 16 16:01:46 2016 (r299952) +++ head/usr.sbin/makefs/mtree.c Mon May 16 16:16:46 2016 (r299953) @@ -150,7 +150,7 @@ mtree_file_path(fsnode *node) depth = 0; rp[depth] = node->name; - for (pnode = node->parent; pnode && depth < MAKEFS_MAX_TREE_DEPTH; + for (pnode = node->parent; pnode && depth < MAKEFS_MAX_TREE_DEPTH - 1; pnode = pnode->parent) { if (strcmp(pnode->name, ".") == 0) break; From owner-svn-src-all@freebsd.org Mon May 16 16:20:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E044CB3DE71; Mon, 16 May 2016 16:20:30 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AD60A1DC1; Mon, 16 May 2016 16:20:30 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4GGKM82071929; Mon, 16 May 2016 09:20:26 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605161620.u4GGKM82071929@gw.catspoiler.org> Date: Mon, 16 May 2016 09:20:22 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299953 - head/usr.sbin/makefs To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605161616.u4GGGkeu045022@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:20:31 -0000 On 16 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Mon May 16 16:16:46 2016 > New Revision: 299953 > URL: https://svnweb.freebsd.org/changeset/base/299953 > > Log: > Fix an off by one error to avoid overflowing rp[]. > > Reported by: Coverity > CID: 1007579 > > Modified: > head/usr.sbin/makefs/mtree.c MFC after: 1 week From owner-svn-src-all@freebsd.org Mon May 16 16:29:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E826AB3D07F; Mon, 16 May 2016 16:29:57 +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 C3C5E13A6; Mon, 16 May 2016 16:29: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 u4GGTvsW048301; Mon, 16 May 2016 16:29:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GGTumH048298; Mon, 16 May 2016 16:29:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605161629.u4GGTumH048298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 May 2016 16:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299954 - stable/10/sbin/restore X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:29:58 -0000 Author: pfg Date: Mon May 16 16:29:56 2016 New Revision: 299954 URL: https://svnweb.freebsd.org/changeset/base/299954 Log: MFC r298901: restore: promote some getfiles() parameters to size_t. This is based on a change from OpenBSD: "Fix restore so that it can actually restore files larger than 4GB by changing the type of "size" to off_t in getfiles() plus little dependent type cleanup, from Daniel Lucq." It is an important for machines with 32 bit longs. While here unsign the flags, also from OpenBSD. Obtained from: OpenBSD (with changes) Modified: stable/10/sbin/restore/dirs.c stable/10/sbin/restore/extern.h stable/10/sbin/restore/tape.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/restore/dirs.c ============================================================================== --- stable/10/sbin/restore/dirs.c Mon May 16 16:16:46 2016 (r299953) +++ stable/10/sbin/restore/dirs.c Mon May 16 16:29:56 2016 (r299954) @@ -85,7 +85,7 @@ struct modeinfo { mode_t mode; uid_t uid; gid_t gid; - int flags; + u_int flags; int extsize; }; @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct static void flushent(void); static struct inotab *inotablookup(ino_t); static RST_DIR *opendirfile(const char *); -static void putdir(char *, long); -static void putdirattrs(char *, long); +static void putdir(char *, size_t); +static void putdirattrs(char *, size_t); static void putent(struct direct *); static void rst_seekdir(RST_DIR *, long, long); static long rst_telldir(RST_DIR *); @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) * Put the directory entries in the directory file */ static void -putdir(char *buf, long size) +putdir(char *buf, size_t size) { struct direct *dp; - long loc, i; + size_t loc, i; for (loc = 0; loc < size; ) { dp = (struct direct *)(buf + loc); @@ -356,12 +356,12 @@ putdir(char *buf, long size) "reclen not multiple of 4 "); if (dp->d_reclen < DIRSIZ(0, dp)) vprintf(stdout, - "reclen less than DIRSIZ (%d < %zu) ", + "reclen less than DIRSIZ (%u < %zu) ", dp->d_reclen, DIRSIZ(0, dp)); #if NAME_MAX < 255 if (dp->d_namlen > NAME_MAX) vprintf(stdout, - "reclen name too big (%d > %d) ", + "reclen name too big (%u > %u) ", dp->d_namlen, NAME_MAX); #endif vprintf(stdout, "\n"); @@ -418,7 +418,7 @@ flushent(void) * Save extended attributes for a directory entry to a file. */ static void -putdirattrs(char *buf, long size) +putdirattrs(char *buf, size_t size) { if (mf != NULL && fwrite(buf, size, 1, mf) != 1) Modified: stable/10/sbin/restore/extern.h ============================================================================== --- stable/10/sbin/restore/extern.h Mon May 16 16:16:46 2016 (r299953) +++ stable/10/sbin/restore/extern.h Mon May 16 16:29:56 2016 (r299954) @@ -54,8 +54,8 @@ void freeentry(struct entry *); void freename(char *); int genliteraldir(char *, ino_t); char *gentempname(struct entry *); -void getfile(void (*)(char *, long), void (*)(char *, long), - void (*)(char *, long)); +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), + void (*)(char *, size_t)); void getvol(long); void initsymtable(char *); int inodetype(ino_t); @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); void treescan(char *, ino_t, long (*)(char *, ino_t, int)); ino_t upperbnd(ino_t); long verifyfile(char *, ino_t, int); -void xtrnull(char *, long); +void xtrnull(char *, size_t); /* From ../dump/dumprmt.c */ void rmtclose(void); Modified: stable/10/sbin/restore/tape.c ============================================================================== --- stable/10/sbin/restore/tape.c Mon May 16 16:16:46 2016 (r299953) +++ stable/10/sbin/restore/tape.c Mon May 16 16:29:56 2016 (r299954) @@ -104,7 +104,7 @@ static int checksum(int *); static void findinode(struct s_spcl *); static void findtapeblksize(void); static char *setupextattr(int); -static void xtrattr(char *, long); +static void xtrattr(char *, size_t); static void set_extattr_link(char *, void *, int); static void set_extattr_fd(int, char *, void *, int); static int gethead(struct s_spcl *); @@ -114,12 +114,12 @@ static u_long swabl(u_long); static u_char *swablong(u_char *, int); static u_char *swabshort(u_char *, int); static void terminateinput(void); -static void xtrfile(char *, long); -static void xtrlnkfile(char *, long); -static void xtrlnkskip(char *, long); -static void xtrmap(char *, long); -static void xtrmapskip(char *, long); -static void xtrskip(char *, long); +static void xtrfile(char *, size_t); +static void xtrlnkfile(char *, size_t); +static void xtrlnkskip(char *, size_t); +static void xtrmap(char *, size_t); +static void xtrmapskip(char *, size_t); +static void xtrskip(char *, size_t); /* * Set up an input source @@ -564,7 +564,7 @@ printdumpinfo(void) int extractfile(char *name) { - int flags; + u_int flags; uid_t uid; gid_t gid; mode_t mode; @@ -931,13 +931,13 @@ skipfile(void) * to the skip function. */ void -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), - void (*skip)(char *, long)) +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), + void (*skip)(char *, size_t)) { int i; - off_t size; + volatile off_t size; int curblk, attrsize; - void (*fillit)(char *, long); + void (*fillit)(char *, size_t); static char clearedbuf[MAXBSIZE]; char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; char junk[TP_BSIZE]; @@ -1066,7 +1066,7 @@ setupextattr(int extsize) * Extract the next block of extended attributes. */ static void -xtrattr(char *buf, long size) +xtrattr(char *buf, size_t size) { if (extloc + size > extbufsize) @@ -1079,7 +1079,7 @@ xtrattr(char *buf, long size) * Write out the next block of a file. */ static void -xtrfile(char *buf, long size) +xtrfile(char *buf, size_t size) { if (Nflag) @@ -1096,7 +1096,7 @@ xtrfile(char *buf, long size) */ /* ARGSUSED */ static void -xtrskip(char *buf, long size) +xtrskip(char *buf, size_t size) { if (lseek(ofile, size, SEEK_CUR) == -1) { @@ -1111,7 +1111,7 @@ xtrskip(char *buf, long size) * Collect the next block of a symbolic link. */ static void -xtrlnkfile(char *buf, long size) +xtrlnkfile(char *buf, size_t size) { pathlen += size; @@ -1128,7 +1128,7 @@ xtrlnkfile(char *buf, long size) */ /* ARGSUSED */ static void -xtrlnkskip(char *buf, long size) +xtrlnkskip(char *buf, size_t size) { fprintf(stderr, "unallocated block in symbolic link %s\n", @@ -1140,7 +1140,7 @@ xtrlnkskip(char *buf, long size) * Collect the next block of a bit map. */ static void -xtrmap(char *buf, long size) +xtrmap(char *buf, size_t size) { memmove(map, buf, size); @@ -1152,7 +1152,7 @@ xtrmap(char *buf, long size) */ /* ARGSUSED */ static void -xtrmapskip(char *buf, long size) +xtrmapskip(char *buf, size_t size) { panic("hole in map\n"); @@ -1164,7 +1164,7 @@ xtrmapskip(char *buf, long size) */ /* ARGSUSED */ void -xtrnull(char *buf, long size) +xtrnull(char *buf, size_t size) { return; From owner-svn-src-all@freebsd.org Mon May 16 16:31:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B575B3D183; Mon, 16 May 2016 16:31:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::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 03E6E17BD; Mon, 16 May 2016 16:31:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x241.google.com with SMTP id i75so15869576ioa.2; Mon, 16 May 2016 09:31:43 -0700 (PDT) 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=iMswHq+LOzRdOoCfppXlrEdEgeNMQInk/4UzuhBJjX4=; b=J8ADuaogBA1BkVGAbhnYTNZkBxB9IcEU2+FftsiSRpMCIx1lUZx2Y8pa4xKl2/Wuol FY3OTRqsisSY+mtOyEEeLLY8+ZKa938rkM2/+wqvSRtGFih7L2xKhahCwqrdrAqxgqL+ WLLWxPlo5eUQb9ciZwGUYv8zJwy1mjntuZrwwDq3HFuuhYCHKTqTQ41vji4fIWH4J0V4 cFkJTFRbiSSNLAPLUR1ye96lpmaHlj3aqm2Iw4bfGIwZf+uFQp6Q2Aho1EWDeF9f+EHH mUD/b4mR9ZS1ThTF8WtUY8lqQcZY38hnSNMo6rb295CpYGWMGqZQ96bjTeLZa083jE3z WfNw== 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=iMswHq+LOzRdOoCfppXlrEdEgeNMQInk/4UzuhBJjX4=; b=ifoYnwEHtmNHJfFP8p78B32DaRljCuHW0FsN27BgYC7lafDyJiZ0GmBqb644/t5OUC IVsCLW712vnwm9ZnJjpm1hLlr9g/nIadFTwL6kad0TVD9EhJlIDxGhl+1zeHG6KBMaUE Mg+3rtkln0n4X+gSr9kwbPCheSwxdmRBaddsOoOpdW9YH7cWIGfW/bovjZjDT9GAr6g1 lJzxcbC86K8qZzQbtzEg4WfDL8QQIbXwQ+3mo/OiuC0Zf+by2ZrQSeA9NfDtffXlKdT7 MPePxvFcb+vn9Wubg70+ViuoHecBVpHlaVQN6xpz0L1SHYcvz0jlP91Ryc5iQbd9pUK5 cEzA== X-Gm-Message-State: AOPr4FX6ziGOfw1gwXg4Dn2jvxiEKPP0ZXVLBax1Jt+fGYSyaY8S26+V8Zs1uOphr5T/KA== X-Received: by 10.107.182.137 with SMTP id g131mr20621339iof.27.1463416303425; Mon, 16 May 2016 09:31:43 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id v136sm5673862ita.3.2016.05.16.09.31.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 May 2016 09:31:42 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299933 - in head/sys: compat/linuxkpi/common/include/linux sys From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605160956.u4G9umAT025380@repo.freebsd.org> Date: Mon, 16 May 2016 09:31:41 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <222500EB-85C1-4FF7-ADB9-0BD71F55D835@gmail.com> References: <201605160956.u4G9umAT025380@repo.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:31:44 -0000 > On May 16, 2016, at 02:56, Hans Petter Selasky = wrote: >=20 > Author: hselasky > Date: Mon May 16 09:56:48 2016 > New Revision: 299933 > URL: https://svnweb.freebsd.org/changeset/base/299933 >=20 > Log: > Implement more Linux device related functions in the LinuxKPI. While > at it use NULL for some pointer checks. >=20 > Bump the FreeBSD version to force recompilation of all kernel modules > due to a structure size change. >=20 > Obtained from: kmacy @ > MFC after: 1 week > Sponsored by: Mellanox Technologies >=20 > Modified: > head/sys/compat/linuxkpi/common/include/linux/device.h > head/sys/sys/param.h >=20 > Modified: head/sys/compat/linuxkpi/common/include/linux/device.h > = =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/sys/compat/linuxkpi/common/include/linux/device.h Mon May = 16 09:31:44 2016 (r299932) > +++ head/sys/compat/linuxkpi/common/include/linux/device.h Mon May = 16 09:56:48 2016 (r299933) > @@ -31,6 +31,7 @@ > #ifndef _LINUX_DEVICE_H_ > #define _LINUX_DEVICE_H_ >=20 > +#include > #include > #include > #include > @@ -71,6 +72,7 @@ struct device { > unsigned int irq; > unsigned int msix; > unsigned int msix_max; > + const struct attribute_group **groups; > }; >=20 > extern struct device linux_root_device; > @@ -127,11 +129,12 @@ show_class_attr_string(struct class *cla > #define dev_err(dev, fmt, ...) device_printf((dev)->bsddev, = fmt, ##__VA_ARGS__) > #define dev_warn(dev, fmt, ...) device_printf((dev)->bsddev, = fmt, ##__VA_ARGS__) > #define dev_info(dev, fmt, ...) device_printf((dev)->bsddev, = fmt, ##__VA_ARGS__) > +#define dev_notice(dev, fmt, ...) = device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) > #define dev_printk(lvl, dev, fmt, ...) = \ > device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) >=20 > static inline void * > -dev_get_drvdata(struct device *dev) > +dev_get_drvdata(const struct device *dev) > { >=20 > return dev->driver_data; > @@ -191,11 +194,106 @@ class_unregister(struct class *class) > kobject_put(&class->kobj); > } >=20 > +static inline struct device *kobj_to_dev(struct kobject *kobj) > +{ > + return container_of(kobj, struct device, kobj); > +} > + > /* > - * Devices are registered and created for exporting to sysfs. create > + * Devices are registered and created for exporting to sysfs. Create > * implies register and register assumes the device fields have been > * setup appropriately before being called. > */ > +static inline void > +device_initialize(struct device *dev) > +{ > + device_t bsddev; > + > + bsddev =3D NULL; > + if (dev->devt) { > + int unit =3D MINOR(dev->devt); > + bsddev =3D devclass_get_device(dev->class->bsdclass, = unit); > + } > + if (bsddev !=3D NULL) > + device_set_softc(bsddev, dev); > + > + dev->bsddev =3D bsddev; > + kobject_init(&dev->kobj, &linux_dev_ktype); > +} > + > +static inline int > +device_add(struct device *dev) > +{=09 > + if (dev->bsddev !=3D NULL) { > + if (dev->devt =3D=3D 0) > + dev->devt =3D makedev(0, = device_get_unit(dev->bsddev)); > + } > + kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); > + return (0); > +} > + > +static inline void > +device_create_release(struct device *dev) > +{ > + kfree(dev); > +} > + > +static inline struct device * > +device_create_groups_vargs(struct class *class, struct device = *parent, > + dev_t devt, void *drvdata, const struct attribute_group **groups, > + const char *fmt, va_list args) > +{ > + struct device *dev =3D NULL; > + int retval =3D -ENODEV; > + > + if (class =3D=3D NULL || IS_ERR(class)) > + goto error; > + > + dev =3D kzalloc(sizeof(*dev), GFP_KERNEL); > + if (!dev) { > + retval =3D -ENOMEM; > + goto error; > + } > + > + device_initialize(dev); > + dev->devt =3D devt; > + dev->class =3D class; > + dev->parent =3D parent; > + dev->groups =3D groups; > + dev->release =3D device_create_release; > + dev->bsddev =3D devclass_get_device(dev->class->bsdclass, = MINOR(devt)); > + dev_set_drvdata(dev, drvdata); > + > + retval =3D kobject_set_name_vargs(&dev->kobj, fmt, args); > + if (retval) > + goto error; > + > + retval =3D device_add(dev); > + if (retval) > + goto error; > + > + return dev; > + > +error: > + put_device(dev); > + return ERR_PTR(retval); > +} > + > +static inline struct device * > +device_create_with_groups(struct class *class, > + struct device *parent, dev_t devt, void *drvdata, > + const struct attribute_group **groups, const char *fmt, ...) > +{ > + va_list vargs; > + struct device *dev; > + > + va_start(vargs, fmt); > + dev =3D device_create_groups_vargs(class, parent, devt, drvdata, > + groups, fmt, vargs); > + va_end(vargs); > + return dev; > +} > + > static inline int > device_register(struct device *dev) > { > @@ -233,13 +331,29 @@ device_unregister(struct device *dev) > device_t bsddev; >=20 > bsddev =3D dev->bsddev; > + dev->bsddev =3D NULL; > + > mtx_lock(&Giant); > - if (bsddev) > + if (bsddev !=3D NULL) Dumb question =E2=80=94 couldn=E2=80=99t we run the check without = locking Giant, then delete the child, e.g. if (bsddev !=3D NULL) { mtx_lock(&Giant); device_delete_child(device_get_parent(bsddev), bsddev);=20 mtx_unlock(&Giant); } put_device(dev); > device_delete_child(device_get_parent(bsddev), bsddev); > mtx_unlock(&Giant); > put_device(dev); > } >=20 > +static inline void > +device_del(struct device *dev) > +{ > + device_t bsddev; > + > + bsddev =3D dev->bsddev; > + dev->bsddev =3D NULL; > + > + mtx_lock(&Giant); > + if (bsddev !=3D NULL) > + device_delete_child(device_get_parent(bsddev), bsddev); > + mtx_unlock(&Giant); > +} > + > struct device *device_create(struct class *class, struct device = *parent, > dev_t devt, void *drvdata, const char *fmt, ...); >=20 > @@ -251,7 +365,7 @@ device_destroy(struct class *class, dev_ >=20 > unit =3D MINOR(devt); > bsddev =3D devclass_get_device(class->bsdclass, unit); > - if (bsddev) > + if (bsddev !=3D NULL) > device_unregister(device_get_softc(bsddev)); > } >=20 >=20 > Modified: head/sys/sys/param.h > = =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/sys/sys/param.h Mon May 16 09:31:44 2016 = (r299932) > +++ head/sys/sys/param.h Mon May 16 09:56:48 2016 = (r299933) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1100108 /* Master, propagated to newvers = */ > +#define __FreeBSD_version 1100109 /* Master, propagated to newvers = */ >=20 > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, >=20 From owner-svn-src-all@freebsd.org Mon May 16 16:44:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08E47B3D683; Mon, 16 May 2016 16:44:24 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9E1E1FF1; Mon, 16 May 2016 16:44:23 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A7F511FE024; Mon, 16 May 2016 18:44:19 +0200 (CEST) Subject: Re: svn commit: r299933 - in head/sys: compat/linuxkpi/common/include/linux sys To: "Ngie Cooper (yaneurabeya)" References: <201605160956.u4G9umAT025380@repo.freebsd.org> <222500EB-85C1-4FF7-ADB9-0BD71F55D835@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <308052a8-f574-5725-f6d7-e395956ca78a@selasky.org> Date: Mon, 16 May 2016 18:47:39 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <222500EB-85C1-4FF7-ADB9-0BD71F55D835@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:44:24 -0000 On 05/16/16 18:31, Ngie Cooper (yaneurabeya) wrote: > Dumb question — couldn’t we run the check without locking Giant, then delete the child, e.g. > > if (bsddev != NULL) { > mtx_lock(&Giant); > device_delete_child(device_get_parent(bsddev), bsddev); > mtx_unlock(&Giant); > } > put_device(dev); I guess so. Does it make a difference for you? --HPS From owner-svn-src-all@freebsd.org Mon May 16 16:44:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74EF4B3D6B8; Mon, 16 May 2016 16:44:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 428931154; Mon, 16 May 2016 16:44:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GGiYxC054255; Mon, 16 May 2016 16:44:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GGiYek054254; Mon, 16 May 2016 16:44:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605161644.u4GGiYek054254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 16 May 2016 16:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299955 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:44:35 -0000 Author: mav Date: Mon May 16 16:44:34 2016 New Revision: 299955 URL: https://svnweb.freebsd.org/changeset/base/299955 Log: No need to check login status for ZOMBIE ports. ZOMBIE ports are always logged out, and so initiator may try to relogin. MFC after: 1 weeks Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon May 16 16:29:56 2016 (r299954) +++ head/sys/dev/isp/isp.c Mon May 16 16:44:34 2016 (r299955) @@ -3808,6 +3808,9 @@ fail: goto fail; } + if (lp->state == FC_PORTDB_STATE_ZOMBIE) + goto relogin; + /* * See if we're still logged into it. * From owner-svn-src-all@freebsd.org Mon May 16 16:51:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B4FB3D93B; Mon, 16 May 2016 16:51:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::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 D5254175E; Mon, 16 May 2016 16:51:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x234.google.com with SMTP id bt5so65983902pac.3; Mon, 16 May 2016 09:51:23 -0700 (PDT) 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=U3lrpGsz9Gf/OPArZWunX/04vdNPeRj1UcVfJqbJUMM=; b=OUCjG/CP9ZOXYDKqqySyF8w2WwJgbdjMPNM3/IsfdGkwtZPJw2pj7S3DBlKl0pXqwg LqK5nyHVldWIutpEb+aaOyiOLTnIexmKuPdTxT5JMvKN8h0/XPG3jtBLmX3u63DxN0kc 5dO5VtAewasQl/rOf97jy+wNHpenaJ4wPXJUhK0eI2W8XY1YdcobWRcpcfJbAClaRwwC stHBUpF8l3UwrNRB/hNp9WzCLSVezrue3y7yuoETqQrRa7sbwzgu+0FWLRwB+nA23A2N q3D/EVLfPJQR1eD2lY19UaGyJ3+erqP+B6PRN9QGp4pEc0SeWGgjpvfDcBXM26IA4pj6 IDiA== 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=U3lrpGsz9Gf/OPArZWunX/04vdNPeRj1UcVfJqbJUMM=; b=EvrJAwWJhSIS1QcIt2EADwGNzzzIUns5g82kqK+j91Bx+LefW07Nrheh6SsaNhpmPq JFrbplTkp0KqkXPpNo0XaPuX6aODmfkczP5o6I6I/Tejye264n01pXWqQT/SxfO674W6 gGXiRwXPddgoYn6mjAFhXveNJY9QlDALA/iTBvZB9enz4dE3Mp2oEkNtYD/liZtCdTXv iK8SlPB3th7VOdSVQLkUm+wBKYDJ5yJEPpKb74aGyPEyqGBLKM42P0xW+vaQtUtlArWy H5fx1zWGjpD3kAwNdfEZXX+rdw8xlgscInmzgWLgFVCQaZ9D+MaZnQD8Wq61e7BCbLuA y1Wg== X-Gm-Message-State: AOPr4FVs0GWTr+IryHyBqqm4DigXNOIzdDHEPgmbyVHB/l8Z50jArwPNsmXWAjpCCs8MFw== X-Received: by 10.66.66.10 with SMTP id b10mr47127631pat.12.1463417483270; Mon, 16 May 2016 09:51:23 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id qb1sm48585984pac.44.2016.05.16.09.51.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 May 2016 09:51:22 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299933 - in head/sys: compat/linuxkpi/common/include/linux sys From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <308052a8-f574-5725-f6d7-e395956ca78a@selasky.org> Date: Mon, 16 May 2016 09:51:22 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4049F31C-6F86-4284-B3A5-8A4640671E43@gmail.com> References: <201605160956.u4G9umAT025380@repo.freebsd.org> <222500EB-85C1-4FF7-ADB9-0BD71F55D835@gmail.com> <308052a8-f574-5725-f6d7-e395956ca78a@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:51:24 -0000 > On May 16, 2016, at 09:47, Hans Petter Selasky = wrote: >=20 > On 05/16/16 18:31, Ngie Cooper (yaneurabeya) wrote: >> Dumb question =E2=80=94 couldn=E2=80=99t we run the check without = locking Giant, then delete the child, e.g. >>=20 >> if (bsddev !=3D NULL) { >> mtx_lock(&Giant); >> device_delete_child(device_get_parent(bsddev), bsddev); >> mtx_unlock(&Giant); >> } >> put_device(dev); >=20 > I guess so. Does it make a difference for you? First off, how often does the bsddev =3D=3D NULL case occur? If it doesn=E2=80=99t occur often, doing this increases contention on = Giant unnecessarily=E2=80=A6 Thanks, -Ngie= From owner-svn-src-all@freebsd.org Mon May 16 17:18:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42857B3C3C4; Mon, 16 May 2016 17:18:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F98C19F6; Mon, 16 May 2016 17:18:27 +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 u4GHIRLG063565; Mon, 16 May 2016 17:18:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GHIRgu063564; Mon, 16 May 2016 17:18:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605161718.u4GHIRgu063564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 16 May 2016 17:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299957 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 17:18:28 -0000 Author: mav Date: Mon May 16 17:18:26 2016 New Revision: 299957 URL: https://svnweb.freebsd.org/changeset/base/299957 Log: Reduce verbosity of "now sending synthesized status" message. MFC after: 1 week Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon May 16 17:06:44 2016 (r299956) +++ head/sys/dev/isp/isp_freebsd.c Mon May 16 17:18:26 2016 (r299957) @@ -1363,7 +1363,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u * and status, don't do it again and do the status portion now. */ if (atp->sendst) { - isp_prt(isp, ISP_LOGTINFO, "[0x%x] now sending synthesized status orig_dl=%u xfered=%u bit=%u", + isp_prt(isp, ISP_LOGTDEBUG0, "[0x%x] now sending synthesized status orig_dl=%u xfered=%u bit=%u", cso->tag_id, atp->orig_datalen, atp->bytes_xfered, atp->bytes_in_transit); xfrlen = 0; /* we already did the data transfer */ atp->sendst = 0; From owner-svn-src-all@freebsd.org Mon May 16 17:23:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2160B3C6EA; Mon, 16 May 2016 17:23:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 977BD1E75; Mon, 16 May 2016 17:23:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GHNvdG066391; Mon, 16 May 2016 17:23:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GHNvZ4066390; Mon, 16 May 2016 17:23:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605161723.u4GHNvZ4066390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 May 2016 17:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299958 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 17:23:58 -0000 Author: asomers Date: Mon May 16 17:23:57 2016 New Revision: 299958 URL: https://svnweb.freebsd.org/changeset/base/299958 Log: MFC r298072 Don't corrupt ZFS label's physpath attribute when booting while a disk is missing Prior to this change, vdev_geom_open_by_path would call vdev_geom_attach prior to verifying the device's GUIDs. vdev_geom_attach calls vdev_geom_attrchange to set the physpath in the vdev object. The result is that if the disk could not be found, then the labels for other disks in the same TLD would overwrite the missing disk's physpath with the physpath of whichever disk currently has the same devname as the missing one used to have. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon May 16 17:18:26 2016 (r299957) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon May 16 17:23:57 2016 (r299958) @@ -241,9 +241,6 @@ vdev_geom_attach(struct g_provider *pp, cp->private = vd; vd->vdev_tsd = cp; - /* Fetch initial physical path information for this device. */ - vdev_geom_attrchanged(cp, "GEOM::physpath"); - cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; return (cp); } @@ -796,6 +793,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi } } + /* Fetch initial physical path information for this device. */ + if (cp != NULL) + vdev_geom_attrchanged(cp, "GEOM::physpath"); + g_topology_unlock(); PICKUP_GIANT(); if (cp == NULL) { From owner-svn-src-all@freebsd.org Mon May 16 17:26:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E657B3C77F; Mon, 16 May 2016 17:26:27 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (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 DA05E103F; Mon, 16 May 2016 17:26:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x232.google.com with SMTP id d62so218395855iof.2; Mon, 16 May 2016 10:26:26 -0700 (PDT) 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=4k1+lSaZjBfaowVuonflUDI1Bc+Qqp1hZZr9oRKLz8I=; b=IPj55cbJbdt/f2HzhcfPaP7b64wbabinrh9qnfD6Z0mZqolZkY2Fj3GWynBZxfTyFh gotTcWLID97Ibw0pY4tp8DImynizfCukp5axChzw8/WqCxdes5EzBqqZh12FNfEONAmi 0HhOYXiP/eRcuQ4fF24MOQ3lI7+Fz3qXQwDzNtVR8bc/L2t/m7xOi8tqt1SvK7uCe+xH RV1wgiU1+SgT4swCMtXeliZB6yb2kc6GwvJHL5afSrCquSIfRtUrPYKWJeCE20ZcI87B LucY4oK36zkGZeTlUZkG9thBOAmdiZ5Nh+mD/tMm9Tf3WzkzV/YPFGZKRftOkLqFe8jo zGyA== 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=4k1+lSaZjBfaowVuonflUDI1Bc+Qqp1hZZr9oRKLz8I=; b=fDlqrScCKeYL0hWZ8Q9s9oBNfpxH29vslTzkO2NxSMC85Z41GDRGz9GukZzC3SsMCq a9/e35mD0DBodgnq1yuiTDhF2ESHJMd8ymhGgU/GmXq5xg/BvlCGJsfESi2P5y8JKyLY IHjPOCRciQJnp0CmKnfjjRwOz6iqyzUlxkpS4XKDJ0OB2lgtrWxJSw3m0OVFW49Ox4+B ErCHPq3CabcWvcOAUyZD3lsv6YC77aVNZsgeoz/uYLrWJqAIDVp+qw5SfDhzetIgQQxV UnHTkA7hja61TsqXO3QZO//DEkCTVRdi/hFDF1NI4tHf2J1l4Fd7745fbOTNn2Y6+DGX yKuA== X-Gm-Message-State: AOPr4FV0BkpCfyAS67vXzN5vb4GgdBTLW8Y32DC7ZAGGlcHXnGDKFsCzFunm072Z51h7bPf8v01twxcVSLppiw== X-Received: by 10.36.74.74 with SMTP id k71mr11099399itb.68.1463419586133; Mon, 16 May 2016 10:26:26 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Mon, 16 May 2016 10:26:06 -0700 (PDT) In-Reply-To: References: <201605161407.u4GE7h9n002600@repo.freebsd.org> From: Ed Maste Date: Mon, 16 May 2016 13:26:06 -0400 X-Google-Sender-Auth: mll0WbDfJOj-QaFgrHluYAlH8Q0 Message-ID: Subject: Re: svn commit: r299944 - in head/sys: arm64/arm64 conf To: Zbigniew Bodek Cc: Andrew Turner , "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 17:26:27 -0000 On 16 May 2016 at 12:08, Zbigniew Bodek wrote: > Hello Andrew, > > I think committing this code should be preceded by at least brief review. I agree, review makes sense especially in the case of GICv3 and other files that originated in the ThunderX work or are closely tied to that platform. From owner-svn-src-all@freebsd.org Mon May 16 17:28:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33483B3C837; Mon, 16 May 2016 17:28:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE72211E5; Mon, 16 May 2016 17:28:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1320C1FE024; Mon, 16 May 2016 19:28:43 +0200 (CEST) Subject: Re: svn commit: r299933 - in head/sys: compat/linuxkpi/common/include/linux sys To: "Ngie Cooper (yaneurabeya)" References: <201605160956.u4G9umAT025380@repo.freebsd.org> <222500EB-85C1-4FF7-ADB9-0BD71F55D835@gmail.com> <308052a8-f574-5725-f6d7-e395956ca78a@selasky.org> <4049F31C-6F86-4284-B3A5-8A4640671E43@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Mon, 16 May 2016 19:32:02 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <4049F31C-6F86-4284-B3A5-8A4640671E43@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 17:28:46 -0000 On 05/16/16 18:51, Ngie Cooper (yaneurabeya) wrote: > >> On May 16, 2016, at 09:47, Hans Petter Selasky wrote: >> >> On 05/16/16 18:31, Ngie Cooper (yaneurabeya) wrote: >>> Dumb question — couldn’t we run the check without locking Giant, then delete the child, e.g. >>> >>> if (bsddev != NULL) { >>> mtx_lock(&Giant); >>> device_delete_child(device_get_parent(bsddev), bsddev); >>> mtx_unlock(&Giant); >>> } >>> put_device(dev); >> >> I guess so. Does it make a difference for you? > > First off, how often does the bsddev == NULL case occur? > > If it doesn’t occur often, doing this increases contention on Giant unnecessarily… In general this piece of code is called very rarely. I'll look into it. --HPS From owner-svn-src-all@freebsd.org Mon May 16 17:41:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DB2B3CCF1; Mon, 16 May 2016 17:41:26 +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 9066E1DF4; Mon, 16 May 2016 17:41:26 +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 u4GHfPCc070587; Mon, 16 May 2016 17:41:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GHfPRD070586; Mon, 16 May 2016 17:41:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605161741.u4GHfPRD070586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 May 2016 17:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299960 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 17:41:26 -0000 Author: hselasky Date: Mon May 16 17:41:25 2016 New Revision: 299960 URL: https://svnweb.freebsd.org/changeset/base/299960 Log: Only lock Giant when needed in the LinuxKPI. Suggested by: ngie @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/device.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Mon May 16 17:32:28 2016 (r299959) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Mon May 16 17:41:25 2016 (r299960) @@ -333,10 +333,11 @@ device_unregister(struct device *dev) bsddev = dev->bsddev; dev->bsddev = NULL; - mtx_lock(&Giant); - if (bsddev != NULL) + if (bsddev != NULL) { + mtx_lock(&Giant); device_delete_child(device_get_parent(bsddev), bsddev); - mtx_unlock(&Giant); + mtx_unlock(&Giant); + } put_device(dev); } @@ -348,10 +349,11 @@ device_del(struct device *dev) bsddev = dev->bsddev; dev->bsddev = NULL; - mtx_lock(&Giant); - if (bsddev != NULL) + if (bsddev != NULL) { + mtx_lock(&Giant); device_delete_child(device_get_parent(bsddev), bsddev); - mtx_unlock(&Giant); + mtx_unlock(&Giant); + } } struct device *device_create(struct class *class, struct device *parent, From owner-svn-src-all@freebsd.org Mon May 16 18:11:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FC31B3D3EB; Mon, 16 May 2016 18:11:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E86F411F3; Mon, 16 May 2016 18:11:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GIBsni081630; Mon, 16 May 2016 18:11:54 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GIBrib081627; Mon, 16 May 2016 18:11:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605161811.u4GIBrib081627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 May 2016 18:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299961 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 18:11:55 -0000 Author: asomers Date: Mon May 16 18:11:53 2016 New Revision: 299961 URL: https://svnweb.freebsd.org/changeset/base/299961 Log: MFC 298212 Add the ability to read a SAS device's Target Port NAA designator sys/cam/scsi/scsi_all.h sys/cam/scsi/scsi_all.c Add the scsi_devid_is_port_naa helper function Modified: stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Mon May 16 17:41:25 2016 (r299960) +++ stable/10/sys/cam/scsi/scsi_all.c Mon May 16 18:11:53 2016 (r299961) @@ -5626,6 +5626,19 @@ scsi_devid_is_lun_name(uint8_t *bufp) return 1; } +int +scsi_devid_is_port_naa(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_PORT) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA) + return 0; + return 1; +} + struct scsi_vpd_id_descriptor * scsi_get_devid_desc(struct scsi_vpd_id_descriptor *desc, uint32_t len, scsi_devid_checkfn_t ck_fn) Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Mon May 16 17:41:25 2016 (r299960) +++ stable/10/sys/cam/scsi/scsi_all.h Mon May 16 18:11:53 2016 (r299961) @@ -3659,6 +3659,7 @@ int scsi_devid_is_lun_eui64(uint8_t *bu int scsi_devid_is_lun_naa(uint8_t *bufp); int scsi_devid_is_lun_name(uint8_t *bufp); int scsi_devid_is_lun_t10(uint8_t *bufp); +int scsi_devid_is_port_naa(uint8_t *bufp); struct scsi_vpd_id_descriptor * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len, scsi_devid_checkfn_t ck_fn); From owner-svn-src-all@freebsd.org Mon May 16 18:23:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D31C4B3D8C9; Mon, 16 May 2016 18:23:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) (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 8CCE41EED; Mon, 16 May 2016 18:23:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qg0-x22d.google.com with SMTP id f92so93456672qgf.0; Mon, 16 May 2016 11:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=R44EfIT07VKC4jUVD+4crfciqHBF9uHnCGNGMx7jP74=; b=o5bMvQy2495LyUIJ8RjGDX+yqElCnEXCdSbmc/imaQEgsTGyrBLmomo4ycqnhYqonw u5X8acyT7MUWfcF2DccSr8MSz8dG8LgbH51PWCLV+8J3yjXRQjz/ESlBD8O3GXDbR4QO aUE5f53y422N3rhxZDBMOampe6c3q28Cgr8Ag0h1kJ/CeZcFipU0aTz/JEw7PSIS8vom inX7uYl2TTwCpAtFlaV/9zk8N+PnShQJ/J/qENFoAakLNy242HIUd8eTfaXJm1U2JkB+ vri4yGkH7FGpy/HEB9ZipjNV+t41nE0tbZtccndpHH7ke5N6Th/mMqf+A7aFzoUguBJ/ Ocew== 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:date :message-id:subject:from:to:cc; bh=R44EfIT07VKC4jUVD+4crfciqHBF9uHnCGNGMx7jP74=; b=QUR3HKGYu6U5v2mXGg5Gb3M/1GRD7hsdhBklka0KBxr+rCFkr/kXBUZILBHvhamYmZ l3m52GmJHuVCgcwNEDkmtQnRcg5tV7BsqR3ozlrKuXpq0tV1vC29Vx3U1Gr5OBUUkjAk z6Uxtn1w+4x6qCNskpMmGgey8HWMlyK2rpXJ00+Oxf/RoqDwIvB3uoE1lwqBKkf/73sj Cdn4nkTG0Bnc++bJdATn9/Ga8r0fFMy5Jfg1gKpQ/tfGWj+TrjB50mYV5SX1OV1suIRK K3Zl76Qy41PvsQO/J/bMa6mANE6yhSi+E+lH0rl1tWUo6Bm8SRmlkMoRq7cavNxNIVyl 6/ig== X-Gm-Message-State: AOPr4FUCpduwMo88DHndzNVN2eSmyOQh207E18Dh1gGly/9wx0SzNZl46o4vkhsQegr0LOOJw4FGCLAAi+H9hg== MIME-Version: 1.0 X-Received: by 10.140.36.167 with SMTP id p36mr28374195qgp.38.1463422980727; Mon, 16 May 2016 11:23:00 -0700 (PDT) Received: by 10.55.170.201 with HTTP; Mon, 16 May 2016 11:23:00 -0700 (PDT) In-Reply-To: <201605161741.u4GHfPRD070586@repo.freebsd.org> References: <201605161741.u4GHfPRD070586@repo.freebsd.org> Date: Mon, 16 May 2016 11:23:00 -0700 Message-ID: Subject: Re: svn commit: r299960 - head/sys/compat/linuxkpi/common/include/linux From: Ngie Cooper To: Hans Petter Selasky 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 18:23:01 -0000 On Mon, May 16, 2016 at 10:41 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon May 16 17:41:25 2016 > New Revision: 299960 > URL: https://svnweb.freebsd.org/changeset/base/299960 > > Log: > Only lock Giant when needed in the LinuxKPI. > > Suggested by: ngie @ > MFC after: 1 week > Sponsored by: Mellanox Technologies Thanks! From owner-svn-src-all@freebsd.org Mon May 16 18:44:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1144B3DE4A; Mon, 16 May 2016 18:44:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 809AC1DC6; Mon, 16 May 2016 18:44:34 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 6FA2FB99A; Mon, 16 May 2016 14:44:33 -0400 (EDT) From: John Baldwin To: Julian Elischer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299746 - in head/sys: cddl/dev/dtrace cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/powerpc conf dev/acpica dev/hwpmc dev/hyperv/vmbus dev/xen/control geom/eli kern net sy... Date: Mon, 16 May 2016 10:56:35 -0700 Message-ID: <1993919.8YVJPRnaqB@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <0539c5c3-dce8-1659-d26e-ef136f256f10@freebsd.org> References: <201605141822.u4EIMqkx090971@repo.freebsd.org> <0539c5c3-dce8-1659-d26e-ef136f256f10@freebsd.org> 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.2.7 (bigwig.baldwin.cx); Mon, 16 May 2016 14:44:33 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 18:44:34 -0000 On Monday, May 16, 2016 01:25:56 PM Julian Elischer wrote: > On 15/05/2016 2:22 AM, John Baldwin wrote: > > Author: jhb > > Date: Sat May 14 18:22:52 2016 > > New Revision: 299746 > > URL: https://svnweb.freebsd.org/changeset/base/299746 > > > > Log: > > Add an EARLY_AP_STARTUP option to start APs earlier during boot. > > As a transition aid, the new behavior is available under a new kernel > > option (EARLY_AP_STARTUP). This will allow the option to be turned off > > if need be during initial testing. I plan to enable this on x86 by > > default in a followup commit in the next few days and to have all > > platforms moved over before 11.0. Once the transition is complete, > > the option will be removed along with the !EARLY_AP_STARTUP code. > John, This feels as though it should be settable with a tuneable > variable. Can you think > of a good way to do this other than having two sysinit entries and making > the tuneable "enable" the right one? There is no tuneable/sysinit > interaction otherwise. The idea is for the !EARLY_AP_STARTUP code to be temporary, so I think adding a tunable is probably a bit much to add in terms of overhead for something that should be temporary. -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 16 18:47:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4B6BB3DFA3; Mon, 16 May 2016 18:47:55 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6199F1162; Mon, 16 May 2016 18:47:55 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GIlsA0093632; Mon, 16 May 2016 18:47:54 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GIlrZ9093625; Mon, 16 May 2016 18:47:53 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605161847.u4GIlrZ9093625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 16 May 2016 18:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299962 - in stable/10/sys/dev/mpr: . mpi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 18:47:55 -0000 Author: slm Date: Mon May 16 18:47:53 2016 New Revision: 299962 URL: https://svnweb.freebsd.org/changeset/base/299962 Log: MFC r299263, r299265, r299266, r299267, r299268, r299269, r299270, r299271, r299272, r299274, r299275 - (r299263) Update MPI headers to version 42. - (r299265) Several style changes and add copyrights for 2016. - (r299266) Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's. - (r299267) No log bit in IOCStatus and endian-safe changes. Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and make a few more things endian-safe. - (r299268) Change logging level for a debug string to use MPR_LOG instead of MPR_INFO. - (r299269) Fix possible use of invalid pointer. It was possible to use an invalid pointer to get the target ID value. To fix this, initialize a local Target ID variable to an invalid value and change that variable to a valid value only if the pointer to the Target ID is not NULL. - (r299270) No need to set the MPRSAS_SHUTDOWN flag because it's never used. - (r299271) Use callout_reset_sbt() instead of callout_reset() if FreeBSD ver is >= 1000029 - (r299272) done_ccb pointer can be used if it is NULL. To prevent this, move check for done_ccb == NULL to before done_ccb is used in mprsas_stop_unit_done(). - (r299274) Disks can go missing until a reboot is done in some cases. This is due to the DevHandle not being released, which causes the Firmware to not allow that disk to be re-added. - (r299275) Bump version of mpr driver to 13.00.00.00-fbsd Modified: stable/10/sys/dev/mpr/mpi/mpi2.h stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h stable/10/sys/dev/mpr/mpi/mpi2_hbd.h stable/10/sys/dev/mpr/mpi/mpi2_history.txt stable/10/sys/dev/mpr/mpi/mpi2_init.h stable/10/sys/dev/mpr/mpi/mpi2_ioc.h stable/10/sys/dev/mpr/mpi/mpi2_ra.h stable/10/sys/dev/mpr/mpi/mpi2_raid.h stable/10/sys/dev/mpr/mpi/mpi2_sas.h stable/10/sys/dev/mpr/mpi/mpi2_targ.h stable/10/sys/dev/mpr/mpi/mpi2_tool.h stable/10/sys/dev/mpr/mpi/mpi2_type.h stable/10/sys/dev/mpr/mpr.c stable/10/sys/dev/mpr/mpr_config.c stable/10/sys/dev/mpr/mpr_ioctl.h stable/10/sys/dev/mpr/mpr_mapping.c stable/10/sys/dev/mpr/mpr_mapping.h stable/10/sys/dev/mpr/mpr_pci.c stable/10/sys/dev/mpr/mpr_sas.c stable/10/sys/dev/mpr/mpr_sas.h stable/10/sys/dev/mpr/mpr_sas_lsi.c stable/10/sys/dev/mpr/mpr_table.c stable/10/sys/dev/mpr/mpr_user.c stable/10/sys/dev/mpr/mprvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpr/mpi/mpi2.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,7 +34,8 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2.h @@ -43,7 +44,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.33 + * mpi2.h Version: 02.00.42 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -125,6 +126,22 @@ * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT. * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT. * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT. + * 01-08-14 02.00.34 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-14 02.00.35 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-18-14 02.00.36 Updated copyright information. + * Bumped MPI2_HEADER_VERSION_UNIT. + * 03-16-15 02.00.37 Updated for MPI v2.6. + * Bumped MPI2_HEADER_VERSION_UNIT. + * Added Scratchpad registers to + * MPI2_SYSTEM_INTERFACE_REGS. + * Added MPI2_DIAG_SBR_RELOAD. + * Added MPI2_IOCSTATUS_INSUFFICIENT_POWER. + * 03-19-15 02.00.38 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-25-15 02.00.39 Bumped MPI2_HEADER_VERSION_UNIT + * 08-25-15 02.00.40 Bumped MPI2_HEADER_VERSION_UNIT. + * Added V7 HostDiagnostic register defines + * 12-15-15 02.00.41 Bumped MPI_HEADER_VERSION_UNIT + * 01-01-16 02.00.42 Bumped MPI_HEADER_VERSION_UNIT * -------------------------------------------------------------------------- */ @@ -160,8 +177,15 @@ #define MPI2_VERSION_02_05 (0x0205) +/* minor version for MPI v2.6 compatible products */ +#define MPI26_VERSION_MINOR (0x06) +#define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \ + MPI26_VERSION_MINOR) +#define MPI2_VERSION_02_06 (0x0206) + + /* Unit and Dev versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x21) +#define MPI2_HEADER_VERSION_UNIT (0x2A) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -217,7 +241,8 @@ typedef volatile struct _MPI2_SYSTEM_INT U32 HCBSize; /* 0x74 */ U32 HCBAddressLow; /* 0x78 */ U32 HCBAddressHigh; /* 0x7C */ - U32 Reserved6[16]; /* 0x80 */ + U32 Reserved6[12]; /* 0x80 */ + U32 Scratchpad[4]; /* 0xB0 */ U32 RequestDescriptorPostLow; /* 0xC0 */ U32 RequestDescriptorPostHigh; /* 0xC4 */ U32 Reserved7[14]; /* 0xC8 */ @@ -261,10 +286,17 @@ typedef volatile struct _MPI2_SYSTEM_INT */ #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x00000008) +#define MPI2_DIAG_SBR_RELOAD (0x00002000) + #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK (0x00001800) #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT (0x00000000) #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW (0x00000800) +/* Defines for V7A/V7R HostDiagnostic Register */ +#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH64 (0x00000000) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW64 (0x00000800) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH32 (0x00001000) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW32 (0x00001800) #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG (0x00000400) #define MPI2_DIAG_FORCE_HCB_ON_RESET (0x00000200) #define MPI2_DIAG_HCB_MODE (0x00000100) @@ -335,7 +367,15 @@ typedef volatile struct _MPI2_SYSTEM_INT #define MPI2_HCB_ADDRESS_HIGH_OFFSET (0x0000007C) /* - * Offsets for the Request Queue + * Offsets for the Scratchpad registers + */ +#define MPI26_SCRATCHPAD0_OFFSET (0x000000B0) +#define MPI26_SCRATCHPAD1_OFFSET (0x000000B4) +#define MPI26_SCRATCHPAD2_OFFSET (0x000000B8) +#define MPI26_SCRATCHPAD3_OFFSET (0x000000BC) + +/* + * Offsets for the Request Descriptor Post Queue */ #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET (0x000000C0) #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET (0x000000C4) @@ -367,7 +407,8 @@ typedef struct _MPI2_DEFAULT_REQUEST_DES Mpi2DefaultRequestDescriptor_t, MPI2_POINTER pMpi2DefaultRequestDescriptor_t; /* defines for the RequestFlags field */ -#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x0E) +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x1E) +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_RSHIFT (1) /* use carefully; values below are pre-shifted left */ #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00) #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET (0x02) #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) @@ -455,6 +496,10 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_U Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t; + +/* for the RequestFlags field, use the same defines as MPI2_DEFAULT_REQUEST_DESCRIPTOR */ + + /* Reply Descriptors */ /* Default Reply Descriptor */ @@ -603,7 +648,8 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_FUNCTION_TOOLBOX (0x17) /* Toolbox */ #define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18) /* SCSI Enclosure Processor */ #define MPI2_FUNCTION_SMP_PASSTHROUGH (0x1A) /* SMP Passthrough */ -#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) /* SAS IO Unit Control */ +#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) /* SAS IO Unit Control */ /* for MPI v2.5 and earlier */ +#define MPI2_FUNCTION_IO_UNIT_CONTROL (0x1B) /* IO Unit Control */ /* for MPI v2.6 and later */ #define MPI2_FUNCTION_SATA_PASSTHROUGH (0x1C) /* SATA Passthrough */ #define MPI2_FUNCTION_DIAG_BUFFER_POST (0x1D) /* Diagnostic Buffer Post */ #define MPI2_FUNCTION_DIAG_RELEASE (0x1E) /* Diagnostic Release */ @@ -646,6 +692,7 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_IOCSTATUS_INVALID_FIELD (0x0007) #define MPI2_IOCSTATUS_INVALID_STATE (0x0008) #define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED (0x0009) +#define MPI2_IOCSTATUS_INSUFFICIENT_POWER (0x000A) /* MPI v2.6 and later */ /**************************************************************************** * Config IOCStatus values @@ -1123,7 +1170,7 @@ typedef union _MPI2_IEEE_SGE_CHAIN_UNION } MPI2_IEEE_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_CHAIN_UNION, Mpi2IeeeSgeChainUnion_t, MPI2_POINTER pMpi2IeeeSgeChainUnion_t; -/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 products only */ +/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 and later */ typedef struct _MPI25_IEEE_SGE_CHAIN64 { U64 Address; @@ -1181,16 +1228,23 @@ typedef union _MPI25_SGE_IO_UNION #define MPI2_IEEE_SGE_FLAGS_SIMPLE_ELEMENT (0x00) #define MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT (0x80) +/* Next Segment Format */ + +#define MPI26_IEEE_SGE_FLAGS_NSF_MASK (0x1C) +#define MPI26_IEEE_SGE_FLAGS_NSF_MPI_IEEE (0x00) + /* Data Location Address Space */ #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK (0x03) -#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */ +#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5 and later, use in IEEE Simple or Chain element */ #define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) /* use in IEEE Simple Element only */ #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR (0x02) #define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */ #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR (0x03) /* use in MPI v2.0 IEEE Chain Element only */ #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR (MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR) /* typo in name */ +#define MPI26_IEEE_SGE_FLAGS_IOCCTL_ADDR (0x02) /* for MPI v2.6 only */ + /**************************************************************************** * IEEE SGE operation Macros ****************************************************************************/ @@ -1246,8 +1300,9 @@ typedef union _MPI2_SGE_IO_UNION #define MPI2_SGLFLAGS_ADDRESS_SPACE_MASK (0x0C) #define MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE (0x00) #define MPI2_SGLFLAGS_IOCDDR_ADDRESS_SPACE (0x04) -#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) -#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE (0x0C) +#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) /* only for MPI v2.5 and earlier */ +#define MPI26_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) /* only for MPI v2.6 */ +#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE (0x0C) /* only for MPI v2.5 and earlier */ /* values for SGL Type subfield */ #define MPI2_SGLFLAGS_SGL_TYPE_MASK (0x03) #define MPI2_SGLFLAGS_SGL_TYPE_MPI (0x00) Modified: stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_cnfg.h * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.27 + * mpi2_cnfg.h Version: 02.00.35 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -210,6 +211,21 @@ * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. * Added MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID for * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. + * 01-08-14 02.00.28 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 06-13-14 02.00.29 Added SSUTimeout field to MPI2_CONFIG_PAGE_BIOS_1, and + * more defines for the BiosOptions field. + * 11-18-14 02.00.30 Updated copyright information. + * Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG. + * Added AdapterOrderAux fields to BIOS Page 3. + * 03-16-15 02.00.31 Updated for MPI v2.6. + * Added BoardPowerRequirement, PCISlotPowerAllocation, and + * Flags field to IO Unit Page 7. + * Added IO Unit Page 11. + * Added new SAS Phy Event codes + * 05-25-15 02.00.33 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 12-18-15 02.00.35 Added SATADeviceWaitTime to SAS IO Unit Page 4. * -------------------------------------------------------------------------- */ @@ -387,7 +403,6 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD #define MPI2_ETHERNET_PGAD_IF_NUMBER_MASK (0x000000FF) - /**************************************************************************** * Configuration messages ****************************************************************************/ @@ -491,8 +506,17 @@ typedef struct _MPI2_CONFIG_REPLY #define MPI25_MFGPAGE_DEVID_SAS3108_5 (0x0094) #define MPI25_MFGPAGE_DEVID_SAS3108_6 (0x0095) - - +/* MPI v2.6 SAS Products */ +#define MPI26_MFGPAGE_DEVID_SAS3216 (0x00C9) +#define MPI26_MFGPAGE_DEVID_SAS3224 (0x00C4) +#define MPI26_MFGPAGE_DEVID_SAS3316_1 (0x00C5) +#define MPI26_MFGPAGE_DEVID_SAS3316_2 (0x00C6) +#define MPI26_MFGPAGE_DEVID_SAS3316_3 (0x00C7) +#define MPI26_MFGPAGE_DEVID_SAS3316_4 (0x00C8) +#define MPI26_MFGPAGE_DEVID_SAS3324_1 (0x00C0) +#define MPI26_MFGPAGE_DEVID_SAS3324_2 (0x00C1) +#define MPI26_MFGPAGE_DEVID_SAS3324_3 (0x00C2) +#define MPI26_MFGPAGE_DEVID_SAS3324_4 (0x00C3) /* Manufacturing Page 0 */ @@ -962,14 +986,16 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT U16 BoardTemperature; /* 0x14 */ U8 BoardTemperatureUnits; /* 0x16 */ U8 Reserved3; /* 0x17 */ - U32 Reserved4; /* 0x18 */ - U32 Reserved5; /* 0x1C */ - U32 Reserved6; /* 0x20 */ - U32 Reserved7; /* 0x24 */ + U32 BoardPowerRequirement; /* 0x18 */ /* reserved prior to MPI v2.6 */ + U32 PCISlotPowerAllocation; /* 0x1C */ /* reserved prior to MPI v2.6 */ + U8 Flags; /* 0x20 */ /* reserved prior to MPI v2.6 */ + U8 Reserved6; /* 0x21 */ + U16 Reserved7; /* 0x22 */ + U32 Reserved8; /* 0x24 */ } MPI2_CONFIG_PAGE_IO_UNIT_7, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_7, Mpi2IOUnitPage7_t, MPI2_POINTER pMpi2IOUnitPage7_t; -#define MPI2_IOUNITPAGE7_PAGEVERSION (0x04) +#define MPI2_IOUNITPAGE7_PAGEVERSION (0x05) /* defines for IO Unit Page 7 CurrentPowerMode and PreviousPowerMode fields */ #define MPI25_IOUNITPAGE7_PM_INIT_MASK (0xC0) @@ -1050,6 +1076,8 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_BOARD_TEMP_FAHRENHEIT (0x01) #define MPI2_IOUNITPAGE7_BOARD_TEMP_CELSIUS (0x02) +/* defines for IO Unit Page 7 Flags field */ +#define MPI2_IOUNITPAGE7_FLAG_CABLE_POWER_EXC (0x01) /* IO Unit Page 8 */ @@ -1168,6 +1196,61 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE10_PAGEVERSION (0x01) +/* IO Unit Page 11 (for MPI v2.6 and later) */ + +typedef struct _MPI26_IOUNIT11_SPINUP_GROUP +{ + U8 MaxTargetSpinup; /* 0x00 */ + U8 SpinupDelay; /* 0x01 */ + U8 SpinupFlags; /* 0x02 */ + U8 Reserved1; /* 0x03 */ +} MPI26_IOUNIT11_SPINUP_GROUP, MPI2_POINTER PTR_MPI26_IOUNIT11_SPINUP_GROUP, + Mpi26IOUnit11SpinupGroup_t, MPI2_POINTER pMpi26IOUnit11SpinupGroup_t; + +/* defines for IO Unit Page 11 SpinupFlags */ +#define MPI26_IOUNITPAGE11_SPINUP_DISABLE_FLAG (0x01) + + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * four and check the value returned for NumPhys at runtime. + */ +#ifndef MPI26_IOUNITPAGE11_PHY_MAX +#define MPI26_IOUNITPAGE11_PHY_MAX (4) +#endif + +typedef struct _MPI26_CONFIG_PAGE_IO_UNIT_11 +{ + MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x04 */ + MPI26_IOUNIT11_SPINUP_GROUP SpinupGroupParameters[4]; /* 0x08 */ + U32 Reserved2; /* 0x18 */ + U32 Reserved3; /* 0x1C */ + U32 Reserved4; /* 0x20 */ + U8 BootDeviceWaitTime; /* 0x24 */ + U8 Reserved5; /* 0x25 */ + U16 Reserved6; /* 0x26 */ + U8 NumPhys; /* 0x28 */ + U8 PEInitialSpinupDelay; /* 0x29 */ + U8 PEReplyDelay; /* 0x2A */ + U8 Flags; /* 0x2B */ + U8 PHY[MPI26_IOUNITPAGE11_PHY_MAX];/* 0x2C */ +} MPI26_CONFIG_PAGE_IO_UNIT_11, + MPI2_POINTER PTR_MPI26_CONFIG_PAGE_IO_UNIT_11, + Mpi26IOUnitPage11_t, MPI2_POINTER pMpi26IOUnitPage11_t; + +#define MPI26_IOUNITPAGE11_PAGEVERSION (0x00) + +/* defines for Flags field */ +#define MPI26_IOUNITPAGE11_FLAGS_AUTO_PORTENABLE (0x01) + +/* defines for PHY field */ +#define MPI26_IOUNITPAGE11_PHY_SPINUP_GROUP_MASK (0x03) + + + + + /**************************************************************************** * IOC Config Pages @@ -1331,7 +1414,9 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ U32 BiosOptions; /* 0x04 */ U32 IOCSettings; /* 0x08 */ - U32 Reserved1; /* 0x0C */ + U8 SSUTimeout; /* 0x0C */ + U8 Reserved1; /* 0x0D */ + U16 Reserved2; /* 0x0E */ U32 DeviceSettings; /* 0x10 */ U16 NumberOfDevices; /* 0x14 */ U16 UEFIVersion; /* 0x16 */ @@ -1342,18 +1427,36 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 } MPI2_CONFIG_PAGE_BIOS_1, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_BIOS_1, Mpi2BiosPage1_t, MPI2_POINTER pMpi2BiosPage1_t; -#define MPI2_BIOSPAGE1_PAGEVERSION (0x05) +#define MPI2_BIOSPAGE1_PAGEVERSION (0x07) /* values for BIOS Page 1 BiosOptions field */ -#define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID (0x000000F0) -#define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_BOOT_LIST_ADD_ALT_BOOT_DEVICE (0x00008000) +#define MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG (0x00004000) -#define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION (0x00000006) -#define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII (0x00000000) -#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII (0x00000002) -#define MPI2_BIOSPAGE1_OPTIONS_VERSION_CHECK_UEFI_HII (0x00000004) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_MASK (0x00003800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_PBDHL (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_ENCSLOSURE (0x00000800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_LWWID (0x00001000) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_PSENS (0x00001800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_ESPHY (0x00002000) + +#define MPI2_BIOSPAGE1_OPTIONS_X86_DISABLE_BIOS (0x00000400) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_REGISTRATION_UEFI_BSD (0x00000300) +#define MPI2_BIOSPAGE1_OPTIONS_USE_BIT0_REGISTRATION_UEFI_BSD (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_FULL_REGISTRATION_UEFI_BSD (0x00000100) +#define MPI2_BIOSPAGE1_OPTIONS_ADAPTER_REGISTRATION_UEFI_BSD (0x00000200) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_REGISTRATION_UEFI_BSD (0x00000300) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID (0x000000F0) +#define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID (0x00000000) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION (0x00000006) +#define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII (0x00000002) +#define MPI2_BIOSPAGE1_OPTIONS_VERSION_CHECK_UEFI_HII (0x00000004) -#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) /* values for BIOS Page 1 IOCSettings field */ #define MPI2_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000) @@ -1477,6 +1580,8 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_2 /* BIOS Page 3 */ +#define MPI2_BIOSPAGE3_NUM_ADAPTER (4) + typedef struct _MPI2_ADAPTER_INFO { U8 PciBusNumber; /* 0x00 */ @@ -1488,17 +1593,26 @@ typedef struct _MPI2_ADAPTER_INFO #define MPI2_ADAPTER_INFO_FLAGS_EMBEDDED (0x0001) #define MPI2_ADAPTER_INFO_FLAGS_INIT_STATUS (0x0002) +typedef struct _MPI2_ADAPTER_ORDER_AUX +{ + U64 WWID; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 Reserved2; /* 0x0C */ +} MPI2_ADAPTER_ORDER_AUX, MPI2_POINTER PTR_MPI2_ADAPTER_ORDER_AUX, + Mpi2AdapterOrderAux_t, MPI2_POINTER pMpi2AdapterOrderAux_t; + typedef struct _MPI2_CONFIG_PAGE_BIOS_3 { MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ U32 GlobalFlags; /* 0x04 */ U32 BiosVersion; /* 0x08 */ - MPI2_ADAPTER_INFO AdapterOrder[4]; /* 0x0C */ + MPI2_ADAPTER_INFO AdapterOrder[MPI2_BIOSPAGE3_NUM_ADAPTER]; /* 0x0C */ U32 Reserved1; /* 0x1C */ + MPI2_ADAPTER_ORDER_AUX AdapterOrderAux[MPI2_BIOSPAGE3_NUM_ADAPTER]; /* 0x20 */ /* MPI v2.5 and newer */ } MPI2_CONFIG_PAGE_BIOS_3, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_BIOS_3, Mpi2BiosPage3_t, MPI2_POINTER pMpi2BiosPage3_t; -#define MPI2_BIOSPAGE3_PAGEVERSION (0x00) +#define MPI2_BIOSPAGE3_PAGEVERSION (0x01) /* values for BIOS Page 3 GlobalFlags */ #define MPI2_BIOSPAGE3_FLAGS_PAUSE_ON_ERROR (0x00000002) @@ -1990,6 +2104,8 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT0_PORTFLAGS_AUTO_PORT_CONFIG (0x01) /* values for SAS IO Unit Page 0 PhyFlags */ +#define MPI2_SASIOUNIT0_PHYFLAGS_INIT_PERSIST_CONNECT (0x40) +#define MPI2_SASIOUNIT0_PHYFLAGS_TARG_PERSIST_CONNECT (0x20) #define MPI2_SASIOUNIT0_PHYFLAGS_ZONING_ENABLED (0x10) #define MPI2_SASIOUNIT0_PHYFLAGS_PHY_DISABLED (0x08) @@ -2082,6 +2198,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) /* MPI v2.0 only. Obsolete in MPI v2.5 and later. */ /* values for SAS IO Unit Page 1 AdditionalControlFlags */ +#define MPI2_SASIOUNIT1_ACONTROL_DA_PERSIST_CONNECT (0x0100) #define MPI2_SASIOUNIT1_ACONTROL_MULTI_PORT_DOMAIN_ILLEGAL (0x0080) #define MPI2_SASIOUNIT1_ACONTROL_SATA_ASYNCHROUNOUS_NOTIFICATION (0x0040) #define MPI2_SASIOUNIT1_ACONTROL_INVALID_TOPOLOGY_CORRECTION (0x0020) @@ -2099,6 +2216,8 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) /* values for SAS IO Unit Page 1 PhyFlags */ +#define MPI2_SASIOUNIT1_PHYFLAGS_INIT_PERSIST_CONNECT (0x40) +#define MPI2_SASIOUNIT1_PHYFLAGS_TARG_PERSIST_CONNECT (0x20) #define MPI2_SASIOUNIT1_PHYFLAGS_ZONING_ENABLE (0x10) #define MPI2_SASIOUNIT1_PHYFLAGS_PHY_DISABLE (0x08) @@ -2117,7 +2236,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN /* see mpi2_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ -/* SAS IO Unit Page 4 */ +/* SAS IO Unit Page 4 (for MPI v2.5 and earlier) */ typedef struct _MPI2_SAS_IOUNIT4_SPINUP_GROUP { @@ -2148,7 +2267,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN U32 Reserved2; /* 0x1C */ U32 Reserved3; /* 0x20 */ U8 BootDeviceWaitTime; /* 0x24 */ - U8 Reserved4; /* 0x25 */ + U8 SATADeviceWaitTime; /* 0x25 */ U16 Reserved5; /* 0x26 */ U8 NumPhys; /* 0x28 */ U8 PEInitialSpinupDelay; /* 0x29 */ @@ -2595,6 +2714,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_DEV #define MPI2_SAS_DEVICE0_FLAGS_SATA_NCQ_SUPPORTED (0x0020) #define MPI2_SAS_DEVICE0_FLAGS_SATA_FUA_SUPPORTED (0x0010) #define MPI2_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH (0x0008) +#define MPI2_SAS_DEVICE0_FLAGS_PERSIST_CAPABLE (0x0004) #define MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID (0x0002) #define MPI2_SAS_DEVICE0_FLAGS_DEVICE_PRESENT (0x0001) @@ -2766,6 +2886,19 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C #define MPI2_SASPHY3_EVENT_CODE_MISALIGNED_MUX_PRIMITIVE (0xD1) #define MPI2_SASPHY3_EVENT_CODE_RX_AIP (0xD2) +/* Following codes are product specific and in MPI v2.6 and later */ +#define MPI2_SASPHY3_EVENT_CODE_LCARB_WAIT_TIME (0xD3) +#define MPI2_SASPHY3_EVENT_CODE_RCVD_CONN_RESP_WAIT_TIME (0xD4) +#define MPI2_SASPHY3_EVENT_CODE_LCCONN_TIME (0xD5) +#define MPI2_SASPHY3_EVENT_CODE_SSP_TX_START_TRANSMIT (0xD6) +#define MPI2_SASPHY3_EVENT_CODE_SATA_TX_START (0xD7) +#define MPI2_SASPHY3_EVENT_CODE_SMP_TX_START_TRANSMT (0xD8) +#define MPI2_SASPHY3_EVENT_CODE_TX_SMP_BREAK_CONN (0xD9) +#define MPI2_SASPHY3_EVENT_CODE_SSP_RX_START_RECEIVE (0xDA) +#define MPI2_SASPHY3_EVENT_CODE_SATA_RX_START_RECEIVE (0xDB) +#define MPI2_SASPHY3_EVENT_CODE_SMP_RX_START_RECEIVE (0xDC) + + /* values for the CounterType field */ #define MPI2_SASPHY3_COUNTER_TYPE_WRAPPING (0x00) #define MPI2_SASPHY3_COUNTER_TYPE_SATURATING (0x01) Modified: stable/10/sys/dev/mpr/mpi/mpi2_hbd.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_hbd.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_hbd.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2009-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_hbd.h * Title: MPI Host Based Discovery messages and structures * Creation Date: October 21, 2009 * - * mpi2_hbd.h Version: 02.00.02 + * mpi2_hbd.h Version: 02.00.03 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -57,6 +58,7 @@ * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from * HBD Action request, replaced by AdditionalInfo field. * 11-18-11 02.00.02 Incorporating additions for MPI v2.5. + * 11-18-14 02.00.03 Updated copyright information. * -------------------------------------------------------------------------- */ Modified: stable/10/sys/dev/mpr/mpi/mpi2_history.txt ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_history.txt Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_history.txt Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,27 +37,28 @@ ============================== Copyright (c) 2000-2015 LSI Corporation. - Copyright (c) 2013-2015 Avago Technologies + Copyright (c) 2013-2016 Avago Technologies + All rights reserved. --------------------------------------- - Header Set Release Version: 02.00.33 - Header Set Release Date: 12-05-13 + Header Set Release Version: 02.00.42 + Header Set Release Date: 01-04-16 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.33 02.00.32 - mpi2_cnfg.h 02.00.27 02.00.26 - mpi2_init.h 02.00.15 02.00.15 - mpi2_ioc.h 02.00.24 02.00.23 - mpi2_raid.h 02.00.10 02.00.10 - mpi2_sas.h 02.00.08 02.00.08 - mpi2_targ.h 02.00.06 02.00.06 - mpi2_tool.h 02.00.11 02.00.11 - mpi2_type.h 02.00.00 02.00.00 - mpi2_ra.h 02.00.00 02.00.00 - mpi2_hbd.h 02.00.02 02.00.02 - mpi2_history.txt 02.00.33 02.00.32 + mpi2.h 02.00.42 02.00.41 + mpi2_cnfg.h 02.00.35 02.00.34 + mpi2_init.h 02.00.20 02.00.19 + mpi2_ioc.h 02.00.27 02.00.27 + mpi2_raid.h 02.00.11 02.00.11 + mpi2_sas.h 02.00.10 02.00.10 + mpi2_targ.h 02.00.09 02.00.09 + mpi2_tool.h 02.00.13 02.00.13 + mpi2_type.h 02.00.01 02.00.01 + mpi2_ra.h 02.00.01 02.00.01 + mpi2_hbd.h 02.00.03 02.00.03 + mpi2_history.txt 02.00.41 02.00.40 * Date Version Description @@ -134,6 +135,22 @@ mpi2.h * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT. * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT. * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT. + * 01-08-14 02.00.34 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-14 02.00.35 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-18-14 02.00.36 Updated copyright information. + * Bumped MPI2_HEADER_VERSION_UNIT. + * 03-16-15 02.00.37 Updated for MPI v2.6. + * Bumped MPI2_HEADER_VERSION_UNIT. + * Added Scratchpad registers to + * MPI2_SYSTEM_INTERFACE_REGS. + * Added MPI2_DIAG_SBR_RELOAD. + * Added MPI2_IOCSTATUS_INSUFFICIENT_POWER. + * 03-19-15 02.00.38 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-25-15 02.00.39 Bumped MPI2_HEADER_VERSION_UNIT. + * 08-25-15 02.00.40 Bumped MPI2_HEADER_VERSION_UNIT. + * Added V7 HostDiagnostic register defines + * 12-15-15 02.00.41 Bumped MPI_HEADER_VERSION_UNIT + * 01-04-16 02.00.42 Bumped MPI_HEADER_VERSION_UNIT * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -294,6 +311,21 @@ mpi2_cnfg.h * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. * Added MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID for * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. + * 01-08-14 02.00.28 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 06-13-14 02.00.29 Added SSUTimeout field to MPI2_CONFIG_PAGE_BIOS_1, and + * more defines for the BiosOptions field.. + * 11-18-14 02.00.30 Updated copyright information. + * Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG. + * Added AdapterOrderAux fields to BIOS Page 3. + * 03-16-15 02.00.31 Updated for MPI v2.6. + * Added BoardPowerRequirement, PCISlotPowerAllocation, and + * Flags field to IO Unit Page 7. + * Added IO Unit Page 11. + * Added new SAS Phy Event codes + * 05-25-15 02.00.33 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 12-18-15 02.00.35 Added SATADeviceWaitTime to SAS IO Unit Page 4. * -------------------------------------------------------------------------- mpi2_init.h @@ -323,6 +355,16 @@ mpi2_init.h * Priority to match SAM-4. * Added EEDPErrorOffset to MPI2_SCSI_IO_REPLY. * 07-10-12 02.00.14 Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION. + * 04-09-13 02.00.15 Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY, + * replacing the Reserved4 field. + * 11-18-14 02.00.16 Updated copyright information. + * 03-16-15 02.00.17 Updated for MPI v2.6. + * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH. + * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and + * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF. + * 08-26-15 02.00.18 Added SCSITASKMGMT_MSGFLAGS for Target Reset. + * 12-18-15 02.00.19 Added EEDPObservedValue added to SCSI IO Reply message. + * 01-04-16 02.00.20 Modified EEDP reported values in SCSI IO Reply message. * -------------------------------------------------------------------------- mpi2_ioc.h @@ -441,6 +483,16 @@ mpi2_ioc.h * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY. * Added Encrypted Hash Extended Image. * 12-05-13 02.00.24 Added MPI25_HASH_IMAGE_TYPE_BIOS. + * 11-18-14 02.00.25 Updated copyright information. + * 03-16-15 02.00.26 Updated for MPI v2.6. + * Added MPI2_EVENT_ACTIVE_CABLE_EXCEPTION and + * MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT. + * Added MPI2_EVENT_PCIE_LINK_COUNTER and + * MPI26_EVENT_DATA_PCIE_LINK_COUNTER. + * Added MPI26_CTRL_OP_SHUTDOWN. + * Added MPI26_CTRL_OP_LINK_CLEAR_ERROR_LOG + * Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS + * 08-25-15 02.00.27 Added IC ARCH Class based signature defines. * -------------------------------------------------------------------------- mpi2_raid.h @@ -479,6 +531,9 @@ mpi2_sas.h * Passthrough Request message. * 08-19-13 02.00.08 Made MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL obsolete * for anything newer than MPI v2.0. + * 11-18-14 02.00.09 Updated copyright information. + * 03-16-15 02.00.10 Updated for MPI v2.6. + * Added MPI2_SATA_PT_REQ_PT_FLAGS_FPDMA. * -------------------------------------------------------------------------- mpi2_targ.h @@ -496,6 +551,11 @@ mpi2_targ.h * request message structure. * Added AbortType MPI2_TARGET_MODE_ABORT_DEVHANDLE and * MPI2_TARGET_MODE_ABORT_ALL_COMMANDS. + * 06-13-14 02.00.07 Added MinMSIxIndex and MaxMSIxIndex fields to + * MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST. + * 11-18-14 02.00.08 Updated copyright information. + * 03-16-15 02.00.09 Updated for MPI v2.6. + * Added MPI26_TARGET_ASSIST_IOFLAGS_ESCAPE_PASSTHROUGH. * -------------------------------------------------------------------------- mpi2_tool.h @@ -519,14 +579,18 @@ mpi2_tool.h * 07-26-12 02.00.10 Modified MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST so that * it uses MPI Chain SGE as well as MPI Simple SGE. * 08-19-13 02.00.11 Added MPI2_TOOLBOX_TEXT_DISPLAY_TOOL and related info. + * 01-08-14 02.00.12 Added MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC. + * 11-18-14 02.00.13 Updated copyright information. * -------------------------------------------------------------------------- mpi2_type.h * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A. + * 11-18-14 02.00.01 Updated copyright information. * -------------------------------------------------------------------------- mpi2_ra.h * 05-06-09 02.00.00 Initial version. + * 11-18-14 02.00.01 Updated copyright information. * -------------------------------------------------------------------------- mpi2_hbd.h @@ -534,24 +598,53 @@ mpi2_hbd.h * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from * HBD Action request, replaced by AdditionalInfo field. * 11-18-11 02.00.02 Incorporating additions for MPI v2.5. + * 11-18-14 02.00.03 Updated copyright information. * -------------------------------------------------------------------------- mpi2_history.txt Parts list history -Filename 02.00.33 02.00.32 02.00.31 02.00.30 ----------- -------- -------- -------- -------- -mpi2.h 02.00.33 02.00.32 02.00.31 02.00.30 -mpi2_cnfg.h 02.00.27 02.00.26 02.00.25 02.00.25 -mpi2_init.h 02.00.15 02.00.15 02.00.15 02.00.15 -mpi2_ioc.h 02.00.24 02.00.23 02.00.22 02.00.22 -mpi2_raid.h 02.00.10 02.00.10 02.00.10 02.00.09 -mpi2_sas.h 02.00.08 02.00.08 02.00.07 02.00.07 -mpi2_targ.h 02.00.06 02.00.06 02.00.06 02.00.06 -mpi2_tool.h 02.00.11 02.00.11 02.00.10 02.00.10 -mpi2_type.h 02.00.00 02.00.00 02.00.00 02.00.00 -mpi2_ra.h 02.00.00 02.00.00 02.00.00 02.00.00 -mpi2_hbd.h 02.00.02 02.00.02 02.00.02 02.00.02 +Filename 02.00.42 +---------- -------- +mpi2.h 02.00.42 +mpi2_cnfg.h 02.00.35 +mpi2_init.h 02.00.20 +mpi2_ioc.h 02.00.27 +mpi2_raid.h 02.00.11 +mpi2_sas.h 02.00.10 +mpi2_targ.h 02.00.09 +mpi2_tool.h 02.00.13 +mpi2_type.h 02.00.01 +mpi2_ra.h 02.00.01 +mpi2_hbd.h 02.00.03 + +Filename 02.00.41 02.00.40 02.00.39 02.00.38 02.00.37 02.00.36 +---------- -------- -------- -------- -------- -------- -------- +mpi2.h 02.00.41 02.00.40 02.00.39 02.00.38 02.00.37 02.00.36 +mpi2_cnfg.h 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +mpi2_init.h 02.00.19 02.00.18 02.00.17 02.00.17 02.00.17 02.00.16 +mpi2_ioc.h 02.00.27 02.00.27 02.00.26 02.00.26 02.00.26 02.00.25 +mpi2_raid.h 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 +mpi2_sas.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 02.00.09 +mpi2_targ.h 02.00.09 02.00.09 02.00.09 02.00.09 02.00.09 02.00.08 +mpi2_tool.h 02.00.13 02.00.13 02.00.13 02.00.13 02.00.13 02.00.13 +mpi2_type.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_ra.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_hbd.h 02.00.03 02.00.03 02.00.03 02.00.03 02.00.03 02.00.03 + +Filename 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +---------- -------- -------- -------- -------- -------- -------- +mpi2.h 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +mpi2_cnfg.h 02.00.29 02.00.28 02.00.27 02.00.26 02.00.25 02.00.25 +mpi2_init.h 02.00.15 02.00.15 02.00.15 02.00.15 02.00.15 02.00.15 +mpi2_ioc.h 02.00.24 02.00.24 02.00.24 02.00.23 02.00.22 02.00.22 +mpi2_raid.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 02.00.09 +mpi2_sas.h 02.00.08 02.00.08 02.00.08 02.00.08 02.00.07 02.00.07 +mpi2_targ.h 02.00.07 02.00.06 02.00.06 02.00.06 02.00.06 02.00.06 +mpi2_tool.h 02.00.12 02.00.12 02.00.11 02.00.11 02.00.10 02.00.10 +mpi2_type.h 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 +mpi2_ra.h 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 +mpi2_hbd.h 02.00.02 02.00.02 02.00.02 02.00.02 02.00.02 02.00.02 Filename 02.00.29 02.00.28 02.00.27 02.00.26 02.00.25 02.00.24 ---------- -------- -------- -------- -------- -------- -------- Modified: stable/10/sys/dev/mpr/mpi/mpi2_init.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_init.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_init.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_init.h * Title: MPI SCSI initiator mode messages and structures * Creation Date: June 23, 2006 * - * mpi2_init.h Version: 02.00.15 + * mpi2_init.h Version: 02.00.20 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -81,6 +82,14 @@ * 07-10-12 02.00.14 Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION. * 04-09-13 02.00.15 Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY, * replacing the Reserved4 field. + * 11-18-14 02.00.16 Updated copyright information. + * 03-16-15 02.00.17 Updated for MPI v2.6. + * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH. + * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and + * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF. + * 08-26-15 02.00.18 Added SCSITASKMGMT_MSGFLAGS for Target Reset. + * 12-18-15 02.00.19 Added EEDPObservedValue added to SCSI IO Reply message. + * 01-04-16 02.00.20 Modified EEDP reported values in SCSI IO Reply message. * -------------------------------------------------------------------------- */ @@ -164,8 +173,9 @@ typedef struct _MPI2_SCSI_IO_REQUEST #define MPI2_SCSIIO_MSGFLAGS_MASK_SENSE_ADDR (0x0C) #define MPI2_SCSIIO_MSGFLAGS_SYSTEM_SENSE_ADDR (0x00) #define MPI2_SCSIIO_MSGFLAGS_IOCDDR_SENSE_ADDR (0x04) -#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR (0x08) -#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR (0x0C) +#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR (0x08) /* for MPI v2.5 and earlier only */ +#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR (0x0C) /* for MPI v2.5 and earlier only */ +#define MPI26_SCSIIO_MSGFLAGS_IOCCTL_SENSE_ADDR (0x08) /* for MPI v2.6 only */ /* SCSI IO SGLFlags bits */ @@ -268,7 +278,7 @@ typedef union _MPI25_SCSI_IO_CDB_UNION } MPI25_SCSI_IO_CDB_UNION, MPI2_POINTER PTR_MPI25_SCSI_IO_CDB_UNION, Mpi25ScsiIoCdb_t, MPI2_POINTER pMpi25ScsiIoCdb_t; -/* MPI v2.5 SCSI IO Request Message */ +/* MPI v2.5/2.6 SCSI IO Request Message */ typedef struct _MPI25_SCSI_IO_REQUEST { U16 DevHandle; /* 0x00 */ @@ -347,8 +357,10 @@ typedef struct _MPI25_SCSI_IO_REQUEST #define MPI25_SCSIIO_IOFLAGS_NORMAL_PATH (0x0000) #define MPI25_SCSIIO_IOFLAGS_FAST_PATH (0x4000) +#define MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH (0x2000) /* MPI v2.6 and later */ #define MPI25_SCSIIO_IOFLAGS_LARGE_CDB (0x1000) #define MPI25_SCSIIO_IOFLAGS_BIDIRECTIONAL (0x0800) +#define MPI26_SCSIIO_IOFLAGS_PORT_REQUEST (0x0400) /* MPI v2.6 and later; IOC use only */ #define MPI25_SCSIIO_IOFLAGS_CDBLENGTH_MASK (0x01FF) /* MPI v2.5 defines for the EEDPFlags bits */ @@ -394,11 +406,19 @@ typedef struct _MPI2_SCSI_IO_REPLY U16 TaskTag; /* 0x20 */ U16 SCSIStatusQualifier; /* 0x22 */ U32 BidirectionalTransferCount; /* 0x24 */ - U32 EEDPErrorOffset; /* 0x28 */ /* MPI 2.5 only; Reserved in MPI 2.0 */ - U32 Reserved6; /* 0x2C */ + U32 EEDPErrorOffset; /* 0x28 */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U16 EEDPObservedAppTag; /* 0x2C */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U16 EEDPObservedGuard; /* 0x2E */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U32 EEDPObservedRefTag; /* 0x30 */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ } MPI2_SCSI_IO_REPLY, MPI2_POINTER PTR_MPI2_SCSI_IO_REPLY, Mpi2SCSIIOReply_t, MPI2_POINTER pMpi2SCSIIOReply_t; +/* SCSI IO Reply MsgFlags bits */ +#define MPI26_SCSIIO_REPLY_MSGFLAGS_REFTAG_OBSERVED_VALID (0x01) +#define MPI26_SCSIIO_REPLY_MSGFLAGS_GUARD_OBSERVED_VALID (0x02) +#define MPI26_SCSIIO_REPLY_MSGFLAGS_APPTAG_OBSERVED_VALID (0x04) + + /* SCSI IO Reply SCSIStatus values (SAM-4 status codes) */ #define MPI2_SCSI_STATUS_GOOD (0x00) @@ -474,12 +494,10 @@ typedef struct _MPI2_SCSI_TASK_MANAGE_RE #define MPI2_SCSITASKMGMT_MSGFLAGS_MASK_TARGET_RESET (0x18) #define MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET (0x00) +#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01) #define MPI2_SCSITASKMGMT_MSGFLAGS_NEXUS_RESET_SRST (0x08) #define MPI2_SCSITASKMGMT_MSGFLAGS_SAS_HARD_LINK_RESET (0x10) -#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01) - - /* SCSI Task Management Reply Message */ typedef struct _MPI2_SCSI_TASK_MANAGE_REPLY @@ -561,6 +579,7 @@ typedef struct _MPI2_SEP_REQUEST #define MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01) /* SlotStatus defines */ +#define MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF (0x00080000) /* MPI v2.6 and newer */ #define MPI2_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000) #define MPI2_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) #define MPI2_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200) @@ -598,6 +617,7 @@ typedef struct _MPI2_SEP_REPLY Mpi2SepReply_t, MPI2_POINTER pMpi2SepReply_t; /* SlotStatus defines */ +#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x00080000) /* MPI v2.6 and newer */ #define MPI2_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000) #define MPI2_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) #define MPI2_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200) Modified: stable/10/sys/dev/mpr/mpi/mpi2_ioc.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_ioc.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_ioc.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_ioc.h * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: October 11, 2006 * - * mpi2_ioc.h Version: 02.00.24 + * mpi2_ioc.h Version: 02.00.27 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -168,6 +169,17 @@ * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY. * Added Encrypted Hash Extended Image. * 12-05-13 02.00.24 Added MPI25_HASH_IMAGE_TYPE_BIOS. + * 11-18-14 02.00.25 Updated copyright information. + * 03-16-15 02.00.26 Updated for MPI v2.6. + * Added MPI2_EVENT_ACTIVE_CABLE_EXCEPTION and + * MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT. + * Added MPI2_EVENT_PCIE_LINK_COUNTER and + * MPI26_EVENT_DATA_PCIE_LINK_COUNTER. + * Added MPI26_CTRL_OP_SHUTDOWN. + * Added MPI26_CTRL_OP_LINK_CLEAR_ERROR_LOG + * Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS + * 08-25-15 02.00.27 Added IC ARCH Class based signature defines + * * -------------------------------------------------------------------------- */ @@ -200,8 +212,8 @@ typedef struct _MPI2_IOC_INIT_REQUEST U16 MsgVersion; /* 0x0C */ U16 HeaderVersion; /* 0x0E */ U32 Reserved5; /* 0x10 */ - U16 Reserved6; /* 0x14 */ - U8 Reserved7; /* 0x16 */ + U16 ConfigurationFlags; /* 0x14 */ + U8 HostPageSize; /* 0x16 */ U8 HostMSIxVectors; /* 0x17 */ U16 Reserved8; /* 0x18 */ U16 SystemRequestFrameSize; /* 0x1A */ @@ -329,7 +341,12 @@ typedef struct _MPI2_IOC_FACTS_REPLY U16 MaxDevHandle; /* 0x38 */ U16 MaxPersistentEntries; /* 0x3A */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 16 19:08:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20BF1B3D78D; Mon, 16 May 2016 19:08:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2C25111B; Mon, 16 May 2016 19:07:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJ7x0P000302; Mon, 16 May 2016 19:07:59 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJ7xko000300; Mon, 16 May 2016 19:07:59 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605161907.u4GJ7xko000300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 16 May 2016 19:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299963 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:08:00 -0000 Author: bz Date: Mon May 16 19:07:58 2016 New Revision: 299963 URL: https://svnweb.freebsd.org/changeset/base/299963 Log: Add HWPMC_HOOKS to std.armv6 to make them available so the module could be loaded. Discussed with: andrew Reviewed by: andrew Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D6359 Modified: head/sys/arm/conf/TEGRA124 head/sys/arm/conf/std.armv6 Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Mon May 16 18:47:53 2016 (r299962) +++ head/sys/arm/conf/TEGRA124 Mon May 16 19:07:58 2016 (r299963) @@ -154,4 +154,3 @@ device fdt_pinctrl # SoC-specific devices #device hwpmc -#options HWPMC_HOOKS Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Mon May 16 18:47:53 2016 (r299962) +++ head/sys/arm/conf/std.armv6 Mon May 16 19:07:58 2016 (r299963) @@ -36,6 +36,7 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support From owner-svn-src-all@freebsd.org Mon May 16 19:10:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33146B3D986; Mon, 16 May 2016 19:10:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFD32151F; Mon, 16 May 2016 19:10:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJAa5n000707; Mon, 16 May 2016 19:10:36 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJAZtX000704; Mon, 16 May 2016 19:10:35 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605161910.u4GJAZtX000704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 16 May 2016 19:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299964 - in stable/10/crypto/openssl/crypto: aes/asm sha/asm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:10:37 -0000 Author: jkim Date: Mon May 16 19:10:35 2016 New Revision: 299964 URL: https://svnweb.freebsd.org/changeset/base/299964 Log: Detect Clang to support AVX instructions on x86 platforms. Note head (OpenSSL 1.0.2 branch) has similar changes. Modified: stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Modified: stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl ============================================================================== --- stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Mon May 16 19:07:58 2016 (r299963) +++ stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Mon May 16 19:10:35 2016 (r299964) @@ -68,6 +68,7 @@ $avx=1 if (!$avx && $win64 && ($flavour $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); open OUT,"| \"$^X\" $xlate $flavour $output"; *STDOUT=*OUT; Modified: stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl ============================================================================== --- stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl Mon May 16 19:07:58 2016 (r299963) +++ stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl Mon May 16 19:10:35 2016 (r299964) @@ -116,6 +116,9 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)/ && $1>=2.03); # first version supporting AVX +$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && + $2>=3.0); # first version supporting AVX + &external_label("OPENSSL_ia32cap_P") if ($xmm); Modified: stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl ============================================================================== --- stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Mon May 16 19:07:58 2016 (r299963) +++ stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Mon May 16 19:10:35 2016 (r299964) @@ -81,6 +81,8 @@ $avx=1 if (!$avx && $win64 && ($flavour $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/ && + $2>=3.0); open OUT,"| \"$^X\" $xlate $flavour $output"; *STDOUT=*OUT; From owner-svn-src-all@freebsd.org Mon May 16 19:11:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42E65B3DA08; Mon, 16 May 2016 19:11:01 +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 04AD41807; Mon, 16 May 2016 19:11:00 +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 u4GJB0CD001428; Mon, 16 May 2016 19:11:00 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJB0oL001427; Mon, 16 May 2016 19:11:00 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605161911.u4GJB0oL001427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 May 2016 19:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299965 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:11:01 -0000 Author: avos Date: Mon May 16 19:10:59 2016 New Revision: 299965 URL: https://svnweb.freebsd.org/changeset/base/299965 Log: urtwn: add support for hardware multicast filter setup. Tested with RTL8188EU and RTL8188CUS. Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Mon May 16 19:10:35 2016 (r299964) +++ head/sys/dev/urtwn/if_urtwn.c Mon May 16 19:10:59 2016 (r299965) @@ -356,6 +356,8 @@ static void urtwn_update_slot(struct ie static void urtwn_update_slot_cb(struct urtwn_softc *, union sec_param *); static void urtwn_update_aifs(struct urtwn_softc *, uint8_t); +static uint8_t urtwn_get_multi_pos(const uint8_t[]); +static void urtwn_set_multi(struct urtwn_softc *); static void urtwn_set_promisc(struct urtwn_softc *); static void urtwn_update_promisc(struct ieee80211com *); static void urtwn_update_mcast(struct ieee80211com *); @@ -4359,9 +4361,8 @@ urtwn_rxfilter_init(struct urtwn_softc * URTWN_ASSERT_LOCKED(sc); - /* Accept all multicast frames. */ - urtwn_write_4(sc, R92C_MAR + 0, 0xffffffff); - urtwn_write_4(sc, R92C_MAR + 4, 0xffffffff); + /* Setup multicast filter. */ + urtwn_set_multi(sc); /* Filter for management frames. */ filter = 0x7f3f; @@ -4822,6 +4823,67 @@ urtwn_update_aifs(struct urtwn_softc *sc } } +static uint8_t +urtwn_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 +urtwn_set_multi(struct urtwn_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t mfilt[2]; + + URTWN_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 = urtwn_get_multi_pos(dl); + + mfilt[pos / 32] |= (1 << (pos % 32)); + } + if_maddr_runlock(ifp); + } + } else + mfilt[0] = mfilt[1] = ~0; + + + urtwn_write_4(sc, R92C_MAR + 0, mfilt[0]); + urtwn_write_4(sc, R92C_MAR + 4, mfilt[1]); + + URTWN_DPRINTF(sc, URTWN_DEBUG_STATE, "%s: MC filter %08x:%08x\n", + __func__, mfilt[0], mfilt[1]); +} + static void urtwn_set_promisc(struct urtwn_softc *sc) { @@ -4877,7 +4939,12 @@ urtwn_update_promisc(struct ieee80211com static void urtwn_update_mcast(struct ieee80211com *ic) { - /* XXX do nothing? */ + struct urtwn_softc *sc = ic->ic_softc; + + URTWN_LOCK(sc); + if (sc->sc_flags & URTWN_RUNNING) + urtwn_set_multi(sc); + URTWN_UNLOCK(sc); } static struct ieee80211_node * From owner-svn-src-all@freebsd.org Mon May 16 19:30:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83402B3E0AB; Mon, 16 May 2016 19:30:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8D8167C; Mon, 16 May 2016 19:30:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJUR9M007113; Mon, 16 May 2016 19:30:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJURNY007107; Mon, 16 May 2016 19:30:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605161930.u4GJURNY007107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 16 May 2016 19:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299966 - in stable/10: secure/lib/libcrypto secure/lib/libcrypto/amd64 secure/lib/libcrypto/i386 sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:30:28 -0000 Author: jkim Date: Mon May 16 19:30:27 2016 New Revision: 299966 URL: https://svnweb.freebsd.org/changeset/base/299966 Log: - Make libcrypto.so position independent on i386. - Enable linker error when libcrypto.so contains a relocation against text. - Add "Do not modify" comment to generated source files. - Set CC environment variable for Perl scripts to enable AVX instructions. - Update __FreeBSD_version to indicate libcrypto.so is position independent. Note this is a direct commit because head has OpenSSL 1.0.2 branch but based on r299389, r299462, r299464, r299479, and r299480. Added: stable/10/secure/lib/libcrypto/i386/aes-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/aes-586.s stable/10/secure/lib/libcrypto/i386/aesni-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/aesni-x86.s stable/10/secure/lib/libcrypto/i386/bf-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/bf-586.s stable/10/secure/lib/libcrypto/i386/bf-686.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/bf-686.s stable/10/secure/lib/libcrypto/i386/bn-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/bn-586.s stable/10/secure/lib/libcrypto/i386/cast-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/cast-586.s stable/10/secure/lib/libcrypto/i386/cmll-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/cmll-x86.s stable/10/secure/lib/libcrypto/i386/co-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/co-586.s stable/10/secure/lib/libcrypto/i386/crypt586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/crypt586.s stable/10/secure/lib/libcrypto/i386/des-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/des-586.s stable/10/secure/lib/libcrypto/i386/ghash-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/ghash-x86.s stable/10/secure/lib/libcrypto/i386/md5-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/md5-586.s stable/10/secure/lib/libcrypto/i386/rc4-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/rc4-586.s stable/10/secure/lib/libcrypto/i386/rc5-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/rc5-586.s stable/10/secure/lib/libcrypto/i386/rmd-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/rmd-586.s stable/10/secure/lib/libcrypto/i386/sha1-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/sha1-586.s stable/10/secure/lib/libcrypto/i386/sha256-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/sha256-586.s stable/10/secure/lib/libcrypto/i386/sha512-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/sha512-586.s stable/10/secure/lib/libcrypto/i386/vpaes-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/vpaes-x86.s stable/10/secure/lib/libcrypto/i386/wp-mmx.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/wp-mmx.s stable/10/secure/lib/libcrypto/i386/x86-gf2m.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/x86-gf2m.s stable/10/secure/lib/libcrypto/i386/x86-mont.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/x86-mont.s stable/10/secure/lib/libcrypto/i386/x86cpuid.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/x86cpuid.s Deleted: stable/10/secure/lib/libcrypto/i386/aes-586.s stable/10/secure/lib/libcrypto/i386/aesni-x86.s stable/10/secure/lib/libcrypto/i386/bf-586.s stable/10/secure/lib/libcrypto/i386/bf-686.s stable/10/secure/lib/libcrypto/i386/bn-586.s stable/10/secure/lib/libcrypto/i386/cast-586.s stable/10/secure/lib/libcrypto/i386/cmll-x86.s stable/10/secure/lib/libcrypto/i386/co-586.s stable/10/secure/lib/libcrypto/i386/crypt586.s stable/10/secure/lib/libcrypto/i386/des-586.s stable/10/secure/lib/libcrypto/i386/ghash-x86.s stable/10/secure/lib/libcrypto/i386/md5-586.s stable/10/secure/lib/libcrypto/i386/rc4-586.s stable/10/secure/lib/libcrypto/i386/rc5-586.s stable/10/secure/lib/libcrypto/i386/rmd-586.s stable/10/secure/lib/libcrypto/i386/sha1-586.s stable/10/secure/lib/libcrypto/i386/sha256-586.s stable/10/secure/lib/libcrypto/i386/sha512-586.s stable/10/secure/lib/libcrypto/i386/vpaes-x86.s stable/10/secure/lib/libcrypto/i386/wp-mmx.s stable/10/secure/lib/libcrypto/i386/x86-gf2m.s stable/10/secure/lib/libcrypto/i386/x86-mont.s stable/10/secure/lib/libcrypto/i386/x86cpuid.s Modified: stable/10/secure/lib/libcrypto/Makefile stable/10/secure/lib/libcrypto/Makefile.asm stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S stable/10/secure/lib/libcrypto/amd64/aesni-x86_64.S stable/10/secure/lib/libcrypto/amd64/bsaes-x86_64.S stable/10/secure/lib/libcrypto/amd64/cmll-x86_64.S stable/10/secure/lib/libcrypto/amd64/ghash-x86_64.S stable/10/secure/lib/libcrypto/amd64/md5-x86_64.S stable/10/secure/lib/libcrypto/amd64/modexp512-x86_64.S stable/10/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S stable/10/secure/lib/libcrypto/amd64/rc4-x86_64.S stable/10/secure/lib/libcrypto/amd64/sha1-x86_64.S stable/10/secure/lib/libcrypto/amd64/sha256-x86_64.S stable/10/secure/lib/libcrypto/amd64/sha512-x86_64.S stable/10/secure/lib/libcrypto/amd64/vpaes-x86_64.S stable/10/secure/lib/libcrypto/amd64/wp-x86_64.S stable/10/secure/lib/libcrypto/amd64/x86_64-gf2m.S stable/10/secure/lib/libcrypto/amd64/x86_64-mont.S stable/10/secure/lib/libcrypto/amd64/x86_64-mont5.S stable/10/secure/lib/libcrypto/amd64/x86_64cpuid.S stable/10/sys/sys/param.h Modified: stable/10/secure/lib/libcrypto/Makefile ============================================================================== --- stable/10/secure/lib/libcrypto/Makefile Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/Makefile Mon May 16 19:30:27 2016 (r299966) @@ -7,7 +7,6 @@ SUBDIR= engines LIB= crypto SHLIB_MAJOR= 7 -ALLOW_SHARED_TEXTREL= NO_LINT= @@ -26,7 +25,7 @@ SRCS= cpt_err.c cryptlib.c cversion.c ex .if ${MACHINE_CPUARCH} == "amd64" SRCS+= x86_64cpuid.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= x86cpuid.s +SRCS+= x86cpuid.S .else SRCS+= mem_clr.c .endif @@ -38,7 +37,7 @@ SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes SRCS+= aes-x86_64.S aesni-sha1-x86_64.S aesni-x86_64.S bsaes-x86_64.S \ vpaes-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= aes-586.s aesni-x86.s vpaes-x86.s +SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else SRCS+= aes_cbc.c aes_core.c .endif @@ -63,9 +62,9 @@ INCS+= asn1.h asn1_mac.h asn1t.h SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c .if ${MACHINE_CPUARCH} == "i386" .if ${MACHINE_CPU:Mi686} -SRCS+= bf-686.s +SRCS+= bf-686.S .else -SRCS+= bf-586.s +SRCS+= bf-586.S .endif .else SRCS+= bf_enc.c @@ -87,7 +86,7 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn SRCS+= modexp512-x86_64.S x86_64-gcc.c x86_64-gf2m.S x86_64-mont.S \ x86_64-mont5.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= bn-586.s co-586.s x86-gf2m.s x86-mont.s +SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c .endif @@ -102,7 +101,7 @@ SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= cmll_misc.c cmll-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= cmll-x86.s +SRCS+= cmll-x86.S .else SRCS+= camellia.c cmll_cbc.c cmll_misc.c .endif @@ -136,7 +135,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= crypt586.s des-586.s +SRCS+= crypt586.S des-586.S .else SRCS+= des_enc.c fcrypt_b.c .endif @@ -219,7 +218,7 @@ SRCS+= md5_dgst.c md5_one.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= md5-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= md5-586.s +SRCS+= md5-586.S .endif INCS+= md5.h @@ -232,7 +231,7 @@ SRCS+= cbc128.c ccm128.c cfb128.c ctr128 .if ${MACHINE_CPUARCH} == "amd64" SRCS+= ghash-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= ghash-x86.s +SRCS+= ghash-x86.S .endif INCS+= modes.h @@ -278,7 +277,7 @@ SRCS+= rc4_utl.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= rc4-md5-x86_64.S rc4-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= rc4-586.s +SRCS+= rc4-586.S .else SRCS+= rc4_enc.c rc4_skey.c .endif @@ -287,7 +286,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= rc5-586.s +SRCS+= rc5-586.S .else SRCS+= rc5_enc.c .endif @@ -296,7 +295,7 @@ INCS+= rc5.h # ripemd SRCS+= rmd_dgst.c rmd_one.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= rmd-586.s +SRCS+= rmd-586.S .endif INCS+= ripemd.h @@ -316,7 +315,7 @@ SRCS+= sha1_one.c sha1dgst.c sha256.c sh .if ${MACHINE_CPUARCH} == "amd64" SRCS+= sha1-x86_64.S sha256-x86_64.S sha512-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= sha1-586.s sha256-586.s sha512-586.s +SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif INCS+= sha.h @@ -347,7 +346,7 @@ SRCS+= wp_dgst.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= wp-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= wp-mmx.s wp_block.c +SRCS+= wp-mmx.S wp_block.c .else SRCS+= wp_block.c .endif @@ -379,9 +378,6 @@ CFLAGS+= -I${LCRYPTO_SRC}/crypto/asn1 CFLAGS+= -I${LCRYPTO_SRC}/crypto/evp CFLAGS+= -I${LCRYPTO_SRC}/crypto/modes -.if !empty(SRCS:M*.s) -AFLAGS+= --noexecstack -.endif .if !empty(SRCS:M*.S) ACFLAGS+= -Wa,--noexecstack .endif Modified: stable/10/secure/lib/libcrypto/Makefile.asm ============================================================================== --- stable/10/secure/lib/libcrypto/Makefile.asm Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/Makefile.asm Mon May 16 19:30:27 2016 (r299966) @@ -1,8 +1,8 @@ # $FreeBSD$ -# Use this to help generate the asm *.[Ss] files after an import. It is not +# Use this to help generate the asm *.S files after an import. It is not # perfect by any means, but does what is needed. -# Do a 'make -f Makefile.asm all' and it will generate *.s. Move them -# to the i386 subdir, and correct any exposed paths and $ FreeBSD $ tags. +# Do a 'make -f Makefile.asm all' and it will generate *.S. Move them +# to the arch subdir, and correct any exposed paths and $ FreeBSD $ tags. .include "Makefile.inc" @@ -39,31 +39,39 @@ SRCS+= ghash-x86_64.pl SRCS+= rc4-md5-x86_64.pl rc4-x86_64.pl # sha -SRCS+= sha1-x86_64.pl sha512-x86_64.pl +SRCS+= sha1-x86_64.pl # whrlpool SRCS+= wp-x86_64.pl -ASM= ${SRCS:S/.pl/.S/} -ASM+= sha256-x86_64.S x86_64cpuid.S +# cpuid +SRCS+= x86_64cpuid.pl -all: ${ASM} +SHA_ASM= sha256-x86_64 sha512-x86_64 +SHA_SRC= sha512-x86_64.pl +SHA_TMP= ${SHA_ASM:S/$/.s/} -CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.cmt/} ${SRCS:M*.pl:S/.pl$/.S/} -CLEANFILES+= sha256-x86_64.cmt sha256-x86_64.S x86_64cpuid.cmt x86_64cpuid.S -.SUFFIXES: .pl .cmt +ASM= ${SRCS:R:S/$/.S/} ${SHA_ASM:S/$/.S/} -.pl.cmt: - ( cd `dirname ${.IMPSRC}`/.. ; perl ${.IMPSRC} ${.OBJDIR}/${.TARGET} ) +all: ${ASM} -.cmt.S: - ( echo ' # $$'FreeBSD'$$'; cat ${.IMPSRC} ) > ${.TARGET} +CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/} +.SUFFIXES: .pl -sha256-x86_64.cmt: sha512-x86_64.pl - ( cd `dirname ${.ALLSRC}`/.. ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) +.pl.S: + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET} -x86_64cpuid.cmt: x86_64cpuid.pl - ( cd `dirname ${.ALLSRC}` ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) +${SHA_TMP}: ${SHA_SRC} + env CC=cc perl ${.ALLSRC} elf ${.TARGET} + +.for s in ${SHA_ASM} +${s}.S: ${s}.s + ( echo ' # $$'FreeBSD'$$' ;\ + echo ' # Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\ + cat ${s}.s ) > ${.TARGET} +.endfor .elif ${MACHINE_CPUARCH} == "i386" @@ -126,16 +134,22 @@ SRCS+= wp-mmx.pl # cpuid SRCS+= x86cpuid.pl -ASM= ${SRCS:S/.pl/.s/} +ASM= ${SRCS:R:S/$/.S/} all: ${ASM} -CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.s/} +CLEANFILES= ${ASM} .SUFFIXES: .pl -.pl.s: - ( echo ' # $$'FreeBSD'$$' ;\ - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ) > ${.TARGET} +.pl.S: + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + echo '#ifdef PIC' ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ + echo '#else' ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ + echo '#endif') |\ + sed -E 's|(\.file[[:blank:]]+)".*"|\1"${.TARGET}"|' > ${.TARGET} .endif .include Modified: stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S ============================================================================== --- stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S Mon May 16 19:30:27 2016 (r299966) @@ -1,4 +1,5 @@ - # $FreeBSD$ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aes-x86_64.pl. .text .type _x86_64_AES_encrypt,@function .align 16 Modified: stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S ============================================================================== --- stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Mon May 16 19:30:27 2016 (r299966) @@ -1,4 +1,5 @@ - # $FreeBSD$ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aesni-sha1-x86_64.pl. .text @@ -9,6 +10,11 @@ aesni_cbc_sha1_enc: movl OPENSSL_ia32cap_P+0(%rip),%r10d movl OPENSSL_ia32cap_P+4(%rip),%r11d + andl $268435456,%r11d + andl $1073741824,%r10d + orl %r11d,%r10d + cmpl $1342177280,%r10d + je aesni_cbc_sha1_enc_avx jmp aesni_cbc_sha1_enc_ssse3 .byte 0xf3,0xc3 .size aesni_cbc_sha1_enc,.-aesni_cbc_sha1_enc @@ -1385,6 +1391,1343 @@ aesni_cbc_sha1_enc_ssse3: .Lepilogue_ssse3: .byte 0xf3,0xc3 .size aesni_cbc_sha1_enc_ssse3,.-aesni_cbc_sha1_enc_ssse3 +.type aesni_cbc_sha1_enc_avx,@function +.align 16 +aesni_cbc_sha1_enc_avx: + movq 8(%rsp),%r10 + + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + leaq -104(%rsp),%rsp + + + vzeroall + movq %rdi,%r12 + movq %rsi,%r13 + movq %rdx,%r14 + movq %rcx,%r15 + vmovdqu (%r8),%xmm11 + movq %r8,88(%rsp) + shlq $6,%r14 + subq %r12,%r13 + movl 240(%r15),%r8d + addq $112,%r15 + addq %r10,%r14 + + leaq K_XX_XX(%rip),%r11 + movl 0(%r9),%eax + movl 4(%r9),%ebx + movl 8(%r9),%ecx + movl 12(%r9),%edx + movl %ebx,%esi + movl 16(%r9),%ebp + + vmovdqa 64(%r11),%xmm6 + vmovdqa 0(%r11),%xmm9 + vmovdqu 0(%r10),%xmm0 + vmovdqu 16(%r10),%xmm1 + vmovdqu 32(%r10),%xmm2 + vmovdqu 48(%r10),%xmm3 + vpshufb %xmm6,%xmm0,%xmm0 + addq $64,%r10 + vpshufb %xmm6,%xmm1,%xmm1 + vpshufb %xmm6,%xmm2,%xmm2 + vpshufb %xmm6,%xmm3,%xmm3 + vpaddd %xmm9,%xmm0,%xmm4 + vpaddd %xmm9,%xmm1,%xmm5 + vpaddd %xmm9,%xmm2,%xmm6 + vmovdqa %xmm4,0(%rsp) + vmovdqa %xmm5,16(%rsp) + vmovdqa %xmm6,32(%rsp) + vmovups -112(%r15),%xmm13 + vmovups 16-112(%r15),%xmm14 + jmp .Loop_avx +.align 16 +.Loop_avx: + addl 0(%rsp),%ebp + vmovups 0(%r12),%xmm12 + vxorps %xmm13,%xmm12,%xmm12 + vxorps %xmm12,%xmm11,%xmm11 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -80(%r15),%xmm15 + xorl %edx,%ecx + vpalignr $8,%xmm0,%xmm1,%xmm4 + movl %eax,%edi + shldl $5,%eax,%eax + vpaddd %xmm3,%xmm9,%xmm9 + andl %ecx,%esi + xorl %edx,%ecx + vpsrldq $4,%xmm3,%xmm8 + xorl %edx,%esi + addl %eax,%ebp + vpxor %xmm0,%xmm4,%xmm4 + shrdl $2,%ebx,%ebx + addl %esi,%ebp + vpxor %xmm2,%xmm8,%xmm8 + addl 4(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + shldl $5,%ebp,%ebp + vpxor %xmm8,%xmm4,%xmm4 + andl %ebx,%edi + xorl %ecx,%ebx + vmovdqa %xmm9,48(%rsp) + xorl %ecx,%edi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -64(%r15),%xmm14 + addl %ebp,%edx + vpsrld $31,%xmm4,%xmm8 + shrdl $7,%eax,%eax + addl %edi,%edx + addl 8(%rsp),%ecx + xorl %ebx,%eax + vpslldq $12,%xmm4,%xmm10 + vpaddd %xmm4,%xmm4,%xmm4 + movl %edx,%edi + shldl $5,%edx,%edx + andl %eax,%esi + xorl %ebx,%eax + vpsrld $30,%xmm10,%xmm9 + vpor %xmm8,%xmm4,%xmm4 + xorl %ebx,%esi + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpslld $2,%xmm10,%xmm10 + vpxor %xmm9,%xmm4,%xmm4 + addl 12(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + shldl $5,%ecx,%ecx + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -48(%r15),%xmm15 + vpxor %xmm10,%xmm4,%xmm4 + andl %ebp,%edi + xorl %eax,%ebp + vmovdqa 0(%r11),%xmm10 + xorl %eax,%edi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %edi,%ebx + addl 16(%rsp),%eax + xorl %ebp,%edx + vpalignr $8,%xmm1,%xmm2,%xmm5 + movl %ebx,%edi + shldl $5,%ebx,%ebx + vpaddd %xmm4,%xmm10,%xmm10 + andl %edx,%esi + xorl %ebp,%edx + vpsrldq $4,%xmm4,%xmm9 + xorl %ebp,%esi + addl %ebx,%eax + vpxor %xmm1,%xmm5,%xmm5 + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpxor %xmm3,%xmm9,%xmm9 + addl 20(%rsp),%ebp + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -32(%r15),%xmm14 + xorl %edx,%ecx + movl %eax,%esi + shldl $5,%eax,%eax + vpxor %xmm9,%xmm5,%xmm5 + andl %ecx,%edi + xorl %edx,%ecx + vmovdqa %xmm10,0(%rsp) + xorl %edx,%edi + addl %eax,%ebp + vpsrld $31,%xmm5,%xmm9 + shrdl $7,%ebx,%ebx + addl %edi,%ebp + addl 24(%rsp),%edx + xorl %ecx,%ebx + vpslldq $12,%xmm5,%xmm8 + vpaddd %xmm5,%xmm5,%xmm5 + movl %ebp,%edi + shldl $5,%ebp,%ebp + andl %ebx,%esi + xorl %ecx,%ebx + vpsrld $30,%xmm8,%xmm10 + vpor %xmm9,%xmm5,%xmm5 + xorl %ecx,%esi + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -16(%r15),%xmm15 + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %esi,%edx + vpslld $2,%xmm8,%xmm8 + vpxor %xmm10,%xmm5,%xmm5 + addl 28(%rsp),%ecx + xorl %ebx,%eax + movl %edx,%esi + shldl $5,%edx,%edx + vpxor %xmm8,%xmm5,%xmm5 + andl %eax,%edi + xorl %ebx,%eax + vmovdqa 16(%r11),%xmm8 + xorl %ebx,%edi + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + addl 32(%rsp),%ebx + xorl %eax,%ebp + vpalignr $8,%xmm2,%xmm3,%xmm6 + movl %ecx,%edi + shldl $5,%ecx,%ecx + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 0(%r15),%xmm14 + vpaddd %xmm5,%xmm8,%xmm8 + andl %ebp,%esi + xorl %eax,%ebp + vpsrldq $4,%xmm5,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + vpxor %xmm2,%xmm6,%xmm6 + shrdl $7,%edx,%edx + addl %esi,%ebx + vpxor %xmm4,%xmm10,%xmm10 + addl 36(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + shldl $5,%ebx,%ebx + vpxor %xmm10,%xmm6,%xmm6 + andl %edx,%edi + xorl %ebp,%edx + vmovdqa %xmm8,16(%rsp) + xorl %ebp,%edi + addl %ebx,%eax + vpsrld $31,%xmm6,%xmm10 + shrdl $7,%ecx,%ecx + addl %edi,%eax + addl 40(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 16(%r15),%xmm15 + xorl %edx,%ecx + vpslldq $12,%xmm6,%xmm9 + vpaddd %xmm6,%xmm6,%xmm6 + movl %eax,%edi + shldl $5,%eax,%eax + andl %ecx,%esi + xorl %edx,%ecx + vpsrld $30,%xmm9,%xmm8 + vpor %xmm10,%xmm6,%xmm6 + xorl %edx,%esi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %esi,%ebp + vpslld $2,%xmm9,%xmm9 + vpxor %xmm8,%xmm6,%xmm6 + addl 44(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + shldl $5,%ebp,%ebp + vpxor %xmm9,%xmm6,%xmm6 + andl %ebx,%edi + xorl %ecx,%ebx + vmovdqa 16(%r11),%xmm9 + xorl %ecx,%edi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 32(%r15),%xmm14 + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %edi,%edx + addl 48(%rsp),%ecx + xorl %ebx,%eax + vpalignr $8,%xmm3,%xmm4,%xmm7 + movl %edx,%edi + shldl $5,%edx,%edx + vpaddd %xmm6,%xmm9,%xmm9 + andl %eax,%esi + xorl %ebx,%eax + vpsrldq $4,%xmm6,%xmm8 + xorl %ebx,%esi + addl %edx,%ecx + vpxor %xmm3,%xmm7,%xmm7 + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpxor %xmm5,%xmm8,%xmm8 + addl 52(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + shldl $5,%ecx,%ecx + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 48(%r15),%xmm15 + vpxor %xmm8,%xmm7,%xmm7 + andl %ebp,%edi + xorl %eax,%ebp + vmovdqa %xmm9,32(%rsp) + xorl %eax,%edi + addl %ecx,%ebx + vpsrld $31,%xmm7,%xmm8 + shrdl $7,%edx,%edx + addl %edi,%ebx + addl 56(%rsp),%eax + xorl %ebp,%edx + vpslldq $12,%xmm7,%xmm10 + vpaddd %xmm7,%xmm7,%xmm7 + movl %ebx,%edi + shldl $5,%ebx,%ebx + andl %edx,%esi + xorl %ebp,%edx + vpsrld $30,%xmm10,%xmm9 + vpor %xmm8,%xmm7,%xmm7 + xorl %ebp,%esi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpslld $2,%xmm10,%xmm10 + vpxor %xmm9,%xmm7,%xmm7 + addl 60(%rsp),%ebp + cmpl $11,%r8d + jb .Lvaesenclast1 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 64(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 80(%r15),%xmm15 + je .Lvaesenclast1 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 96(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 112(%r15),%xmm15 +.Lvaesenclast1: + vaesenclast %xmm15,%xmm11,%xmm11 + vmovups 16-112(%r15),%xmm14 + xorl %edx,%ecx + movl %eax,%esi + shldl $5,%eax,%eax + vpxor %xmm10,%xmm7,%xmm7 + andl %ecx,%edi + xorl %edx,%ecx + vmovdqa 16(%r11),%xmm10 + xorl %edx,%edi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %edi,%ebp + vpalignr $8,%xmm6,%xmm7,%xmm9 + vpxor %xmm4,%xmm0,%xmm0 + addl 0(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%edi + shldl $5,%ebp,%ebp + vpxor %xmm1,%xmm0,%xmm0 + andl %ebx,%esi + xorl %ecx,%ebx + vmovdqa %xmm10,%xmm8 + vpaddd %xmm7,%xmm10,%xmm10 + xorl %ecx,%esi + vmovups 16(%r12),%xmm12 + vxorps %xmm13,%xmm12,%xmm12 + vmovups %xmm11,0(%r13,%r12,1) + vxorps %xmm12,%xmm11,%xmm11 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -80(%r15),%xmm15 + addl %ebp,%edx + vpxor %xmm9,%xmm0,%xmm0 + shrdl $7,%eax,%eax + addl %esi,%edx + addl 4(%rsp),%ecx + xorl %ebx,%eax + vpsrld $30,%xmm0,%xmm9 + vmovdqa %xmm10,48(%rsp) + movl %edx,%esi + shldl $5,%edx,%edx + andl %eax,%edi + xorl %ebx,%eax + vpslld $2,%xmm0,%xmm0 + xorl %ebx,%edi + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + addl 8(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%edi + shldl $5,%ecx,%ecx + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -64(%r15),%xmm14 + vpor %xmm9,%xmm0,%xmm0 + andl %ebp,%esi + xorl %eax,%ebp + vmovdqa %xmm0,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %esi,%ebx + addl 12(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + shldl $5,%ebx,%ebx + andl %edx,%edi + xorl %ebp,%edx + xorl %ebp,%edi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %edi,%eax + vpalignr $8,%xmm7,%xmm0,%xmm10 + vpxor %xmm5,%xmm1,%xmm1 + addl 16(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -48(%r15),%xmm15 + xorl %edx,%esi + movl %eax,%edi + shldl $5,%eax,%eax + vpxor %xmm2,%xmm1,%xmm1 + xorl %ecx,%esi + addl %eax,%ebp + vmovdqa %xmm8,%xmm9 + vpaddd %xmm0,%xmm8,%xmm8 + shrdl $7,%ebx,%ebx + addl %esi,%ebp + vpxor %xmm10,%xmm1,%xmm1 + addl 20(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + shldl $5,%ebp,%ebp + vpsrld $30,%xmm1,%xmm10 + vmovdqa %xmm8,0(%rsp) + xorl %ebx,%edi + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %edi,%edx + vpslld $2,%xmm1,%xmm1 + addl 24(%rsp),%ecx + xorl %ebx,%esi + movl %edx,%edi + shldl $5,%edx,%edx + xorl %eax,%esi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -32(%r15),%xmm14 + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpor %xmm10,%xmm1,%xmm1 + addl 28(%rsp),%ebx + xorl %eax,%edi + vmovdqa %xmm1,%xmm8 + movl %ecx,%esi + shldl $5,%ecx,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %edi,%ebx + vpalignr $8,%xmm0,%xmm1,%xmm8 + vpxor %xmm6,%xmm2,%xmm2 + addl 32(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + shldl $5,%ebx,%ebx + vpxor %xmm3,%xmm2,%xmm2 + xorl %edx,%esi + addl %ebx,%eax + vmovdqa 32(%r11),%xmm10 + vpaddd %xmm1,%xmm9,%xmm9 + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpxor %xmm8,%xmm2,%xmm2 + addl 36(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -16(%r15),%xmm15 + xorl %edx,%edi + movl %eax,%esi + shldl $5,%eax,%eax + vpsrld $30,%xmm2,%xmm8 + vmovdqa %xmm9,16(%rsp) + xorl %ecx,%edi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %edi,%ebp + vpslld $2,%xmm2,%xmm2 + addl 40(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + shldl $5,%ebp,%ebp + xorl %ebx,%esi + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %esi,%edx + vpor %xmm8,%xmm2,%xmm2 + addl 44(%rsp),%ecx + xorl %ebx,%edi + vmovdqa %xmm2,%xmm9 + movl %edx,%esi + shldl $5,%edx,%edx + xorl %eax,%edi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 0(%r15),%xmm14 + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + vpalignr $8,%xmm1,%xmm2,%xmm9 + vpxor %xmm7,%xmm3,%xmm3 + addl 48(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + shldl $5,%ecx,%ecx + vpxor %xmm4,%xmm3,%xmm3 + xorl %ebp,%esi + addl %ecx,%ebx + vmovdqa %xmm10,%xmm8 + vpaddd %xmm2,%xmm10,%xmm10 + shrdl $7,%edx,%edx + addl %esi,%ebx + vpxor %xmm9,%xmm3,%xmm3 + addl 52(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + shldl $5,%ebx,%ebx + vpsrld $30,%xmm3,%xmm9 + vmovdqa %xmm10,32(%rsp) + xorl %edx,%edi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %edi,%eax + vpslld $2,%xmm3,%xmm3 + addl 56(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 16(%r15),%xmm15 + xorl %edx,%esi + movl %eax,%edi + shldl $5,%eax,%eax + xorl %ecx,%esi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %esi,%ebp + vpor %xmm9,%xmm3,%xmm3 + addl 60(%rsp),%edx + xorl %ecx,%edi + vmovdqa %xmm3,%xmm10 + movl %ebp,%esi + shldl $5,%ebp,%ebp + xorl %ebx,%edi + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %edi,%edx + vpalignr $8,%xmm2,%xmm3,%xmm10 + vpxor %xmm0,%xmm4,%xmm4 + addl 0(%rsp),%ecx + xorl %ebx,%esi + movl %edx,%edi + shldl $5,%edx,%edx + vpxor %xmm5,%xmm4,%xmm4 + xorl %eax,%esi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 32(%r15),%xmm14 + addl %edx,%ecx + vmovdqa %xmm8,%xmm9 + vpaddd %xmm3,%xmm8,%xmm8 + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpxor %xmm10,%xmm4,%xmm4 + addl 4(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + shldl $5,%ecx,%ecx + vpsrld $30,%xmm4,%xmm10 + vmovdqa %xmm8,48(%rsp) + xorl %ebp,%edi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %edi,%ebx + vpslld $2,%xmm4,%xmm4 + addl 8(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + shldl $5,%ebx,%ebx + xorl %edx,%esi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpor %xmm10,%xmm4,%xmm4 + addl 12(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 48(%r15),%xmm15 + xorl %edx,%edi + vmovdqa %xmm4,%xmm8 + movl %eax,%esi + shldl $5,%eax,%eax + xorl %ecx,%edi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %edi,%ebp + vpalignr $8,%xmm3,%xmm4,%xmm8 + vpxor %xmm1,%xmm5,%xmm5 + addl 16(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + shldl $5,%ebp,%ebp + vpxor %xmm6,%xmm5,%xmm5 + xorl %ebx,%esi + addl %ebp,%edx + vmovdqa %xmm9,%xmm10 + vpaddd %xmm4,%xmm9,%xmm9 + shrdl $7,%eax,%eax + addl %esi,%edx + vpxor %xmm8,%xmm5,%xmm5 + addl 20(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + shldl $5,%edx,%edx + vpsrld $30,%xmm5,%xmm8 + vmovdqa %xmm9,0(%rsp) + xorl %eax,%edi + cmpl $11,%r8d + jb .Lvaesenclast2 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 64(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 80(%r15),%xmm15 + je .Lvaesenclast2 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 96(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 112(%r15),%xmm15 +.Lvaesenclast2: + vaesenclast %xmm15,%xmm11,%xmm11 + vmovups 16-112(%r15),%xmm14 + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + vpslld $2,%xmm5,%xmm5 + addl 24(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + shldl $5,%ecx,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %esi,%ebx + vpor %xmm8,%xmm5,%xmm5 + addl 28(%rsp),%eax + xorl %ebp,%edi + vmovdqa %xmm5,%xmm9 + movl %ebx,%esi + shldl $5,%ebx,%ebx + xorl %edx,%edi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %edi,%eax + vpalignr $8,%xmm4,%xmm5,%xmm9 + vpxor %xmm2,%xmm6,%xmm6 + movl %ecx,%edi + vmovups 32(%r12),%xmm12 + vxorps %xmm13,%xmm12,%xmm12 + vmovups %xmm11,16(%r13,%r12,1) + vxorps %xmm12,%xmm11,%xmm11 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -80(%r15),%xmm15 + xorl %edx,%ecx + addl 32(%rsp),%ebp + andl %edx,%edi + vpxor %xmm7,%xmm6,%xmm6 + andl %ecx,%esi + shrdl $7,%ebx,%ebx + vmovdqa %xmm10,%xmm8 + vpaddd %xmm5,%xmm10,%xmm10 + addl %edi,%ebp + movl %eax,%edi + vpxor %xmm9,%xmm6,%xmm6 + shldl $5,%eax,%eax + addl %esi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + vpsrld $30,%xmm6,%xmm9 + vmovdqa %xmm10,16(%rsp) + movl %ebx,%esi + xorl %ecx,%ebx + addl 36(%rsp),%edx + andl %ecx,%esi + vpslld $2,%xmm6,%xmm6 + andl %ebx,%edi + shrdl $7,%eax,%eax + addl %esi,%edx + movl %ebp,%esi + shldl $5,%ebp,%ebp + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -64(%r15),%xmm14 + addl %edi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + vpor %xmm9,%xmm6,%xmm6 + movl %eax,%edi + xorl %ebx,%eax + vmovdqa %xmm6,%xmm10 + addl 40(%rsp),%ecx + andl %ebx,%edi + andl %eax,%esi + shrdl $7,%ebp,%ebp + addl %edi,%ecx + movl %edx,%edi + shldl $5,%edx,%edx + addl %esi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movl %ebp,%esi + xorl %eax,%ebp + addl 44(%rsp),%ebx + andl %eax,%esi + andl %ebp,%edi + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -48(%r15),%xmm15 + shrdl $7,%edx,%edx + addl %esi,%ebx + movl %ecx,%esi + shldl $5,%ecx,%ecx + addl %edi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + vpalignr $8,%xmm5,%xmm6,%xmm10 + vpxor %xmm3,%xmm7,%xmm7 + movl %edx,%edi + xorl %ebp,%edx + addl 48(%rsp),%eax + andl %ebp,%edi + vpxor %xmm0,%xmm7,%xmm7 + andl %edx,%esi + shrdl $7,%ecx,%ecx + vmovdqa 48(%r11),%xmm9 + vpaddd %xmm6,%xmm8,%xmm8 + addl %edi,%eax + movl %ebx,%edi + vpxor %xmm10,%xmm7,%xmm7 + shldl $5,%ebx,%ebx + addl %esi,%eax + xorl %ebp,%edx + addl %ebx,%eax + vpsrld $30,%xmm7,%xmm10 + vmovdqa %xmm8,32(%rsp) + movl %ecx,%esi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -32(%r15),%xmm14 + xorl %edx,%ecx + addl 52(%rsp),%ebp + andl %edx,%esi + vpslld $2,%xmm7,%xmm7 + andl %ecx,%edi + shrdl $7,%ebx,%ebx + addl %esi,%ebp + movl %eax,%esi + shldl $5,%eax,%eax + addl %edi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + vpor %xmm10,%xmm7,%xmm7 + movl %ebx,%edi + xorl %ecx,%ebx + vmovdqa %xmm7,%xmm8 + addl 56(%rsp),%edx + andl %ecx,%edi *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 16 19:32:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B646DB3E253; Mon, 16 May 2016 19:32:39 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92AD01BA6; Mon, 16 May 2016 19:32:39 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJWcOS009818; Mon, 16 May 2016 19:32:38 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJWcTO009817; Mon, 16 May 2016 19:32:38 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605161932.u4GJWcTO009817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 16 May 2016 19:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299967 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:32:39 -0000 Author: slm Date: Mon May 16 19:32:38 2016 New Revision: 299967 URL: https://svnweb.freebsd.org/changeset/base/299967 Log: MFC r299276 Updates to mpr driver man page. - Add 3216 and 3224 support. - Add SSU, chain_alloc_fail, and spinup_wait_time information. - Clear up some sentences. - Correct some typos. Modified: stable/10/share/man/man4/mpr.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/mpr.4 ============================================================================== --- stable/10/share/man/man4/mpr.4 Mon May 16 19:30:27 2016 (r299966) +++ stable/10/share/man/man4/mpr.4 Mon May 16 19:32:38 2016 (r299967) @@ -1,6 +1,8 @@ .\" .\" Copyright (c) 2010 Spectra Logic Corporation .\" Copyright (c) 2014 LSI Corp +.\" Copyright (c) 2016 Avago Technologies +.\" Copyright (c) 2016 Broadcom Ltd. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,55 +33,62 @@ .\" mpr driver man page. .\" .\" Author: Ken Merry -.\" Author: Stephen McConnell +.\" Author: Stephen McConnell .\" .\" $Id$ .\" $FreeBSD$ .\" -.Dd May 2, 2014 +.Dd April 29, 2016 .Dt MPR 4 .Os .Sh NAME .Nm mpr .Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver" .Sh SYNOPSIS -To compile this driver into the kernel, place the following lines in your -kernel configuration file: +To compile this driver into the kernel, place these lines in the kernel +configuration file: .Bd -ragged -offset indent .Cd "device pci" .Cd "device scbus" .Cd "device mpr" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +The driver can be loaded as a module at boot time by placing this line in .Xr loader.conf 5 : .Bd -literal -offset indent mpr_load="YES" .Ed .Sh DESCRIPTION The -.Nm -driver provides support for LSI Fusion-MPT 3 IT/IR +.Nm +driver provides support for Broadcom Ltd./Avago Tech (LSI) +Fusion-MPT 3 IT/IR .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +These controllers are supported by the .Nm driver: .Pp .Bl -bullet -compact .It -LSI SAS 3004 (4 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3004 (4 Port SAS) +.It +Broadcom Ltd./Avago Tech (LSI) SAS 3008 (8 Port SAS) .It -LSI SAS 3008 (8 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3108 (8 Port SAS) .It -LSI SAS 3108 (8 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS) +.It +Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS) .El .Sh CONFIGURATION +.Pp +In all tunable descriptions below, X represents the adapter number. +.Pp To disable MSI interrupts for all .Nm -driver instances, set the following tunable value in +driver instances, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.disable_msi=1 @@ -87,17 +96,15 @@ hw.mpr.disable_msi=1 .Pp To disable MSI interrupts for a specific .Nm -driver instance, set the following tunable value in +driver instance, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.disable_msi=1 .Ed .Pp -where X is the adapter number. -.Pp To disable MSI-X interrupts for all .Nm -driver instances, set the following tunable value in +driver instances, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.disable_msix=1 @@ -105,73 +112,134 @@ hw.mpr.disable_msix=1 .Pp To disable MSI-X interrupts for a specific .Nm -driver instance, set the following tunable value in +driver instance, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.disable_msix=1 .Ed .Pp To set the maximum number of DMA chains allocated for all adapters, set -the following variable in +this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.max_chains=NNNN .Ed .Pp To set the maximum number of DMA chains allocated for a specific adapter, -set the following variable in +set this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.max_chains=NNNN .Ed .Pp -This variable may also be viewed via -.Xr sysctl 8 -to see the maximum set for a given adapter. +The default max_chains value is 2048. .Pp -The current number of free chain frames may be seen via the +The current number of free chain frames is stored in the dev.mpr.X.chain_free .Xr sysctl 8 variable. .Pp -The lowest number of free chain frames may be seen via the +The lowest number of free chain frames seen since boot is stored in the dev.mpr.X.chain_free_lowwater .Xr sysctl 8 variable. .Pp +The number of times that chain frame allocations have failed since boot is +stored in the +dev.mpr.X.chain_alloc_fail +.Xr sysctl 8 +variable. +This can be used to determine whether the max_chains tunable should be +increased to help performance. +.Pp The current number of active I/O commands is shown in the dev.mpr.X.io_cmds_active .Xr sysctl 8 variable. .Pp -The maximum number of active I/O commands seen since boot is shown in the +The highest number of active I/O commands seen since boot is stored in the dev.mpr.X.io_cmds_highwater .Xr sysctl 8 variable. .Pp Devices can be excluded from .Nm -control for all adapters by setting the following variable in +control for all adapters by setting this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.exclude_ids=Y .Ed .Pp -where Y is the target ID of the device. -If more than one device is to be -excluded, target ID's are separated by commas. +Y represents the target ID of the device. +If more than one device is to be excluded, target IDs are separated by commas. .Pp Devices can be excluded from .Nm -control for a specific adapter by setting the following variable in +control for a specific adapter by setting this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.exclude_ids=Y .Ed .Pp -where X is the adapter number and Y is the target ID of the device. -If more -than one device is to be excluded, target ID's are separated by commas. +Y represents the target ID of the device. +If more than one device is to be excluded, target IDs are separated by commas. +.Pp +The adapter can issue the +.Sy StartStopUnit +SCSI command to SATA direct-access devices during shutdown. +This allows the device to quiesce powering down. +To control this feature for all adapters, set the +.Bd -literal -offset indent +hw.mpr.enable_ssu +.Ed +.Pp +tunable in +.Xr loader.conf 5 +to one of these values: +.Bl -tag -width 6n -offset indent +.It 0 +Do not send SSU to either HDDs or SSDs. +.It 1 +Send SSU to SSDs, but not to HDDs. +This is the default value. +.It 2 +Send SSU to HDDs, but not to SSDs. +.It 3 +Send SSU to both HDDs and SSDs. +.El +.Pp +To control the feature for a specific adapter, set this tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mpr.X.enable_ssu +.Ed +.Pp +The same set of values are valid when setting this tunable for all adapters. +.Pp +SATA disks that take several seconds to spin up and fail the SATA Identify +command might not be discovered by the driver. +This problem can sometimes be overcome by increasing the value of the spinup +wait time in +.Xr loader.conf 5 : +with the +.Bd -literal -offset indent +hw.mpr.spinup_wait_time=NNNN +.Ed +.Pp +tunable. +NNNN represents the number of seconds to wait for SATA devices to spin up when +the device fails the initial SATA Identify command. +.Pp +Spinup wait times can be set for specific adapters in +.Xr loader.conf 5 : +with the +.Bd -literal -offset indent +dev.mpr.X.spinup_wait_time=NNNN +.Ed +.Pp +tunable. +NNNN is the number of seconds to wait for SATA devices to spin up when they fail +the initial SATA Identify command. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -180,21 +248,21 @@ driver, set the hw.mpr.X.debug_level .Ed .Pp -variable, where X is the adapter number, either in +tunable, either in .Xr loader.conf 5 -or via +or by using .Xr sysctl 8 . -The following bits have the described effects: +These bits have the described effects: .Bd -literal -offset indent -0x0001 Enable informational prints. -0x0002 Enable prints for driver faults. +0x0001 Enable informational prints (set by default). +0x0002 Enable prints for driver faults (set by default). 0x0004 Enable prints for controller events. 0x0008 Enable prints for controller logging. 0x0010 Enable prints for tracing recovery operations. 0x0020 Enable prints for parameter errors and programming bugs. 0x0040 Enable prints for system initialization operations. 0x0080 Enable prints for more detailed information. -0x0100 Enable prints for user-generated commands. +0x0100 Enable prints for user-generated commands (IOCTL). 0x0200 Enable prints for device mapping. 0x0400 Enable prints for tracing through driver functions. .Ed @@ -220,10 +288,11 @@ The .Nm driver was originally written by .An -nosplit -.An Scott Long Aq scottl@FreeBSD.org . -It has been improved and tested by LSI Corporation. +.An Scott Long Aq Mt scottl@FreeBSD.org . +It has been improved and tested by LSI Corporation, +Avago Technologies (formally LSI), and Broadcom Ltd. (formally Avago). .Pp This man page was written by -.An Ken Merry Aq ken@FreeBSD.org +.An Ken Merry Aq Mt ken@FreeBSD.org with additional input from -.An Stephen McConnell Aq stephen.mcconnell@lsi.com . +.An Stephen McConnell Aq Mt slm@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon May 16 19:39:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07103B3E4F7; Mon, 16 May 2016 19:39:07 +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 C86DD1053; Mon, 16 May 2016 19:39:06 +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 u4GJd5Cl010140; Mon, 16 May 2016 19:39:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJd5gL010138; Mon, 16 May 2016 19:39:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605161939.u4GJd5gL010138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 19:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299969 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:39:07 -0000 Author: adrian Date: Mon May 16 19:39:05 2016 New Revision: 299969 URL: https://svnweb.freebsd.org/changeset/base/299969 Log: [siba] make the debug code somewhat useful again. It's still not configurable by a kernel option; that'll come next. Sponsored by: Palm Springs Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Mon May 16 19:33:23 2016 (r299968) +++ head/sys/dev/siba/siba_core.c Mon May 16 19:39:05 2016 (r299969) @@ -184,6 +184,8 @@ siba_core_attach(struct siba_softc *siba siba->siba_ops = &siba_pci_ops; + siba->siba_debug = SIBA_DEBUG_SCAN; + siba_pci_gpio(siba, SIBA_GPIO_CRYSTAL | SIBA_GPIO_PLL, 1); siba_scan(siba); @@ -332,7 +334,8 @@ siba_scan(struct siba_softc *siba) DPRINTF(siba, SIBA_DEBUG_SCAN, "core %d (%s) found (cc %#xrev %#x vendor %#x)\n", i, siba_core_name(sd->sd_id.sd_device), - sd->sd_id.sd_device, sd->sd_id.sd_rev, sd->sd_id.vendor); + sd->sd_id.sd_device, sd->sd_id.sd_rev, + sd->sd_id.sd_vendor); switch (sd->sd_id.sd_device) { case SIBA_DEVID_CHIPCOMMON: Modified: head/sys/dev/siba/sibavar.h ============================================================================== --- head/sys/dev/siba/sibavar.h Mon May 16 19:33:23 2016 (r299968) +++ head/sys/dev/siba/sibavar.h Mon May 16 19:39:05 2016 (r299969) @@ -604,6 +604,7 @@ struct siba_softc { bus_addr_t siba_maddr; bus_size_t siba_msize; uint8_t siba_ncores; + uint32_t siba_debug; /* * the following variables are only used for siba_bwn bridge. From owner-svn-src-all@freebsd.org Mon May 16 19:42:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5AC1B3E732; Mon, 16 May 2016 19:42:39 +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 9D39C167F; Mon, 16 May 2016 19:42:39 +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 u4GJgchC012987; Mon, 16 May 2016 19:42:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJgcb8012983; Mon, 16 May 2016 19:42:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605161942.u4GJgcb8012983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 May 2016 19:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299970 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:42:39 -0000 Author: pfg Date: Mon May 16 19:42:38 2016 New Revision: 299970 URL: https://svnweb.freebsd.org/changeset/base/299970 Log: Add a small set of logical operators to DDB command language. This are based on Mach3. Documentation is pending but has been promised. Submitted by: Dan Partelly Reviewed by: adrian, jhb (older version) Differential Revision: https://reviews.freebsd.org/D4230 RelNotes: yes Modified: head/sys/ddb/db_examine.c head/sys/ddb/db_expr.c head/sys/ddb/db_lex.c head/sys/ddb/db_lex.h Modified: head/sys/ddb/db_examine.c ============================================================================== --- head/sys/ddb/db_examine.c Mon May 16 19:39:05 2016 (r299969) +++ head/sys/ddb/db_examine.c Mon May 16 19:42:38 2016 (r299970) @@ -225,6 +225,10 @@ db_print_cmd(db_expr_t addr, bool have_a else db_printf("\\%03o", (int)value); break; + default: + db_print_format = 'x'; + db_error("Syntax error: unsupported print modifier\n"); + /*NOTREACHED*/ } db_printf("\n"); } Modified: head/sys/ddb/db_expr.c ============================================================================== --- head/sys/ddb/db_expr.c Mon May 16 19:39:05 2016 (r299969) +++ head/sys/ddb/db_expr.c Mon May 16 19:42:38 2016 (r299970) @@ -43,6 +43,9 @@ static bool db_mult_expr(db_expr_t *valu static bool db_shift_expr(db_expr_t *valuep); static bool db_term(db_expr_t *valuep); static bool db_unary(db_expr_t *valuep); +static bool db_logical_or_expr(db_expr_t *valuep); +static bool db_logical_and_expr(db_expr_t *valuep); +static bool db_logical_relation_expr(db_expr_t *valuep); static bool db_term(db_expr_t *valuep) @@ -108,19 +111,40 @@ db_unary(db_expr_t *valuep) t = db_read_token(); if (t == tMINUS) { if (!db_unary(valuep)) { - db_error("Syntax error\n"); + db_printf("Expression syntax error after '%c'\n", '-'); + db_error(NULL); /*NOTREACHED*/ } *valuep = -*valuep; return (true); } + if (t == tEXCL) { + if(!db_unary(valuep)) { + db_printf("Expression syntax error after '%c'\n", '!'); + db_error(NULL); + /* NOTREACHED */ + } + *valuep = (!(*valuep)); + return (true); + } + if (t == tBIT_NOT) { + if(!db_unary(valuep)) { + db_printf("Expression syntax error after '%c'\n", '~'); + db_error(NULL); + /* NOTREACHED */ + } + *valuep = (~(*valuep)); + return (true); + } if (t == tSTAR) { /* indirection */ if (!db_unary(valuep)) { - db_error("Syntax error\n"); + db_printf("Expression syntax error after '%c'\n", '*'); + db_error(NULL); /*NOTREACHED*/ } - *valuep = db_get_value((db_addr_t)*valuep, sizeof(void *), false); + *valuep = db_get_value((db_addr_t)*valuep, sizeof(void *), + false); return (true); } db_unread_token(t); @@ -137,24 +161,31 @@ db_mult_expr(db_expr_t *valuep) return (false); t = db_read_token(); - while (t == tSTAR || t == tSLASH || t == tPCT || t == tHASH) { + while (t == tSTAR || t == tSLASH || t == tPCT || t == tHASH || + t == tBIT_AND ) { if (!db_term(&rhs)) { - db_error("Syntax error\n"); + db_printf("Expression syntax error after '%c'\n", '!'); + db_error(NULL); /*NOTREACHED*/ } - if (t == tSTAR) - lhs *= rhs; - else { - if (rhs == 0) { - db_error("Divide by 0\n"); - /*NOTREACHED*/ - } - if (t == tSLASH) - lhs /= rhs; - else if (t == tPCT) - lhs %= rhs; - else - lhs = roundup(lhs, rhs); + switch(t) { + case tSTAR: + lhs *= rhs; + break; + case tBIT_AND: + lhs &= rhs; + break; + default: + if (rhs == 0) { + db_error("Divide by 0\n"); + /*NOTREACHED*/ + } + if (t == tSLASH) + lhs /= rhs; + else if (t == tPCT) + lhs %= rhs; + else + lhs = roundup(lhs, rhs); } t = db_read_token(); } @@ -168,20 +199,32 @@ db_add_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; int t; + char c; if (!db_mult_expr(&lhs)) return (false); t = db_read_token(); - while (t == tPLUS || t == tMINUS) { + while (t == tPLUS || t == tMINUS || t == tBIT_OR) { if (!db_mult_expr(&rhs)) { - db_error("Syntax error\n"); + c = db_tok_string[0]; + db_printf("Expression syntax error after '%c'\n", c); + db_error(NULL); /*NOTREACHED*/ } - if (t == tPLUS) + switch (t) { + case tPLUS: lhs += rhs; - else + break; + case tMINUS: lhs -= rhs; + break; + case tBIT_OR: + lhs |= rhs; + break; + default: + __unreachable(); + } t = db_read_token(); } db_unread_token(t); @@ -196,8 +239,7 @@ db_shift_expr(db_expr_t *valuep) int t; if (!db_add_expr(&lhs)) - return (false); - + return (false); t = db_read_token(); while (t == tSHIFT_L || t == tSHIFT_R) { if (!db_add_expr(&rhs)) { @@ -221,8 +263,109 @@ db_shift_expr(db_expr_t *valuep) return (true); } +static bool +db_logical_relation_expr( + db_expr_t *valuep) +{ + db_expr_t lhs, rhs; + int t; + char op[3]; + + if (!db_shift_expr(&lhs)) + return (false); + + t = db_read_token(); + while (t == tLOG_EQ || t == tLOG_NOT_EQ || t == tGREATER || + t == tGREATER_EQ || t == tLESS || t == tLESS_EQ) { + op[0] = db_tok_string[0]; + op[1] = db_tok_string[1]; + op[2] = 0; + if (!db_shift_expr(&rhs)) { + db_printf("Expression syntax error after \"%s\"\n", op); + db_error(NULL); + /*NOTREACHED*/ + } + switch(t) { + case tLOG_EQ: + lhs = (lhs == rhs); + break; + case tLOG_NOT_EQ: + lhs = (lhs != rhs); + break; + case tGREATER: + lhs = (lhs > rhs); + break; + case tGREATER_EQ: + lhs = (lhs >= rhs); + break; + case tLESS: + lhs = (lhs < rhs); + break; + case tLESS_EQ: + lhs = (lhs <= rhs); + break; + default: + __unreachable(); + } + t = db_read_token(); + } + db_unread_token(t); + *valuep = lhs; + return (true); +} + +static bool +db_logical_and_expr( + db_expr_t *valuep) +{ + db_expr_t lhs, rhs; + int t; + + if (!db_logical_relation_expr(&lhs)) + return (false); + + t = db_read_token(); + while (t == tLOG_AND) { + if (!db_logical_relation_expr(&rhs)) { + db_printf("Expression syntax error after '%s'\n", "&&"); + db_error(NULL); + /*NOTREACHED*/ + } + lhs = (lhs && rhs); + t = db_read_token(); + } + db_unread_token(t); + *valuep = lhs; + return (true); +} + +static bool +db_logical_or_expr( + db_expr_t *valuep) +{ + db_expr_t lhs, rhs; + int t; + + if (!db_logical_and_expr(&lhs)) + return(false); + + t = db_read_token(); + while (t == tLOG_OR) { + if (!db_logical_and_expr(&rhs)) { + db_printf("Expression syntax error after '%s'\n", "||"); + db_error(NULL); + /*NOTREACHED*/ + } + lhs = (lhs || rhs); + t = db_read_token(); + } + db_unread_token(t); + *valuep = lhs; + return (true); +} + int db_expression(db_expr_t *valuep) { - return (db_shift_expr(valuep)); + return (db_logical_or_expr(valuep)); } Modified: head/sys/ddb/db_lex.c ============================================================================== --- head/sys/ddb/db_lex.c Mon May 16 19:39:05 2016 (r299969) +++ head/sys/ddb/db_lex.c Mon May 16 19:42:38 2016 (r299970) @@ -274,6 +274,10 @@ db_lex(void) case '/': return (tSLASH); case '=': + c = db_read_char(); + if (c == '=') + return (tLOG_EQ); + db_unread_char(c); return (tEQ); case '%': return (tPCT); @@ -290,21 +294,46 @@ db_lex(void) case '$': return (tDOLLAR); case '!': + c = db_read_char(); + if (c == '='){ + return (tLOG_NOT_EQ); + } + db_unread_char(c); return (tEXCL); case ';': return (tSEMI); + case '&': + c = db_read_char(); + if (c == '&') + return (tLOG_AND); + db_unread_char(c); + return (tBIT_AND); + case '|': + c = db_read_char(); + if (c == '|') + return (tLOG_OR); + db_unread_char(c); + return (tBIT_OR); case '<': c = db_read_char(); if (c == '<') return (tSHIFT_L); + if (c == '=') + return (tLESS_EQ); db_unread_char(c); - break; + return (tLESS); case '>': c = db_read_char(); if (c == '>') return (tSHIFT_R); + if (c == '=') + return (tGREATER_EQ); db_unread_char(c); - break; + return (tGREATER); + case '?': + return (tQUESTION); + case '~': + return (tBIT_NOT); case -1: return (tEOF); } Modified: head/sys/ddb/db_lex.h ============================================================================== --- head/sys/ddb/db_lex.h Mon May 16 19:39:05 2016 (r299969) +++ head/sys/ddb/db_lex.h Mon May 16 19:42:38 2016 (r299970) @@ -69,5 +69,18 @@ extern char db_tok_string[TOK_STRING_SIZ #define tSHIFT_R 19 #define tDOTDOT 20 #define tSEMI 21 +#define tLOG_EQ 22 +#define tLOG_NOT_EQ 23 +#define tLESS 24 +#define tLESS_EQ 25 +#define tGREATER 26 +#define tGREATER_EQ 27 +#define tBIT_AND 28 +#define tBIT_OR 29 +#define tLOG_AND 30 +#define tLOG_OR 31 +#define tSTRING 32 +#define tQUESTION 33 +#define tBIT_NOT 34 #endif /* !_DDB_DB_LEX_H_ */ From owner-svn-src-all@freebsd.org Mon May 16 19:48:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B15A8B3E85A; Mon, 16 May 2016 19:48:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 828DA1958; Mon, 16 May 2016 19:48:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJm2Jn013276; Mon, 16 May 2016 19:48:02 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJm2l5013275; Mon, 16 May 2016 19:48:02 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605161948.u4GJm2l5013275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 19:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299971 - head/usr.bin/chat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:48:03 -0000 Author: truckman Date: Mon May 16 19:48:02 2016 New Revision: 299971 URL: https://svnweb.freebsd.org/changeset/base/299971 Log: Fix off by one error that overflowed the rep_len array when doing the final NUL termination. Reported by: Coverity CID: 1007617 MFC after: 1 week Modified: head/usr.bin/chat/chat.c Modified: head/usr.bin/chat/chat.c ============================================================================== --- head/usr.bin/chat/chat.c Mon May 16 19:42:38 2016 (r299970) +++ head/usr.bin/chat/chat.c Mon May 16 19:48:02 2016 (r299971) @@ -521,7 +521,7 @@ void terminate(int status) size_t rep_len; rep_len = strlen(report_buffer); - while (rep_len + 1 <= sizeof(report_buffer)) { + while (rep_len + 1 < sizeof(report_buffer)) { alarm(1); c = get_char(); alarm(0); From owner-svn-src-all@freebsd.org Mon May 16 19:59:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD00B3EC79; Mon, 16 May 2016 19:59:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9BB11AD; Mon, 16 May 2016 19:59:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id n63so103057837qkf.0; Mon, 16 May 2016 12:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=FPDpXGTFSiyYeAMri94Yg2q3McOlaNEfs+/WiP0F8gs=; b=qmtGmBRedbyRYrgRHm3kGclJT+MG42mTMvL8hZh51x60s4En54FucgmvWKI+Wbo5HJ wWNO5FEY8hBF9xb6CSZiY50p/IqklRDVVm6lTB3h5Hg9U6oKjMKayG8SyA4FCi+VMF9k EFeeDHERxbVQkMRdVWCwLse6D0iajbp1AJk0Tj+EgEtB0jw4w9bX22PkLJOHEKZ/xxug fs5WsOYFLAK4VDvq3Yj2iKau4He0ox9TlaQOq1spYMjAGgzC8bMP9Q29Vu9kpPGUB8QB ubadUziQj+ihzE21BJ9/6yyghdZ0iIaetjz3AXeAR6uxnDkYOPujahGcnVRjPhHyCmf+ FLIA== 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:date :message-id:subject:from:to:cc; bh=FPDpXGTFSiyYeAMri94Yg2q3McOlaNEfs+/WiP0F8gs=; b=EmFfwvvptYC1A+KxzLWo/A1TfLsCC5m84sIDdamFmEYpena7fFOn8jA6zq87pXg9iz mq3LF71c0Ot0qW+jSIwsq8Zp21q4f7RV1rjgYizypFsEYmmEmeus9vm3x5zViPjgjJPk EzA8B49mmd5Slolwv0GIhqXgLk28my1YqhYlCLbV53J25enBSTij9eEXIcoGfGxOZGxI X/QRcqvygiWY2StoeafQPo7pF8gw5Og3tyka0gP6uqz+G5yHLF4cF7Vd2TdycL+Q+avd QVhEXmRRfaS4l+YL6HUZgh34FYoOCWpYG7hwOCH6fW6FTXAceqsklrBHIN7m5chdRXv9 nGxw== X-Gm-Message-State: AOPr4FWvGc5NCKWnZbuk+nzHdriEf7noMLJHbmGKMPAC3yxMbEskmvSinGpeFtQlDt9PjlGssz66JDWfcmoMPg== MIME-Version: 1.0 X-Received: by 10.55.73.199 with SMTP id w190mr33367455qka.77.1463428750501; Mon, 16 May 2016 12:59:10 -0700 (PDT) Received: by 10.55.170.201 with HTTP; Mon, 16 May 2016 12:59:10 -0700 (PDT) In-Reply-To: <1463330757.1180.154.camel@freebsd.org> References: <201605150438.u4F4coNR080598@repo.freebsd.org> <1463330757.1180.154.camel@freebsd.org> Date: Mon, 16 May 2016 12:59:10 -0700 Message-ID: Subject: Re: svn commit: r299839 - head/etc/rc.d From: Ngie Cooper To: Ian Lepore Cc: Garrett Cooper , "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 19:59:11 -0000 On Sun, May 15, 2016 at 9:45 AM, Ian Lepore wrote: > On Sun, 2016-05-15 at 04:38 +0000, Garrett Cooper wrote: >> Author: ngie >> Date: Sun May 15 04:38:50 2016 >> New Revision: 299839 >> URL: https://svnweb.freebsd.org/changeset/base/299839 >> >> Log: >> Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol >> >> Make zfs and zvol come before all of the items that depended on >> them >> previously > > I'm trying to figure out why these changes are needed. rcorder works > just fine when a requirement has no providers (yes, it whines, but > that's why /etc/rc invokes it with 2>/dev/null). If FILESYSTEMS > requires zfs and nothing provides zfs, then it's as if the requirement > weren't in the list at all. > > The manpage for rcorder is wrong, the DIAGNOSTICS section implies that > rcorder will abort on a missing requirement, but it doesn't. > > Changing requirements to BEFOREs seems like it has a lot of potential > for messing with peoples' out-of-tree customizations. (And for some > reason I've always had the impression that BEFORE was to be avoided in > the base rc files, but I can't remember why I think that.) Hi Ian, Answering both you and Ravi, I agree that the general boot case will "just work" (tm), but it masks issues. In the vanilla case, /etc/rc redirects stderr to /dev/null . This unfortunately hides both missing rc.d dependencies called out as REQUIREs, as well as circular dependencies (which you might notice if you ran rcorder on the directory after r287197 on head -- see: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202726 ), which means that if anyone is running rcorder without directing the stderr to /dev/null, they'll be confused by circular dependencies or missing PROVIDEs if rc.d script aren't installed; I do this sometimes by cd'ing to the etc/rc.d directory and running rcorder `make -VFILES`. Anytime there's a circular dependency, rcorder tosses the whole thing out and screws up the boot order. In the $work case, we use a different system internally at $work for running parallel boot that calculates rc.d script dependencies in a lot more pedantic way. If a dependency is missing, our boot will fail, so we've created a bunch of dummy provides for missing rc.d scripts that are REQUIREments that we don't install. This bloats the rc.d graph more than necessary. All in all, this entire thing is a mess; I'm just shuffling deck chairs right now so I can replace boards and refinish parts of the metaphorical deck enough that things will work "ok" for 11.0-RELEASE. I'll talk with mmacy about launchd and come up with an official proposal for how to move forward with boot in 12.0, because rc is a dated system and needs to be replaced with something more performant and more flexible/logical (run things based on events instead of a one-time static boot order). Thanks, -Ngie From owner-svn-src-all@freebsd.org Mon May 16 20:00:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABC04B3ECE7; Mon, 16 May 2016 20:00: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 7D21D1319; Mon, 16 May 2016 20:00:10 +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 u4GK09mD016574; Mon, 16 May 2016 20:00:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GK09c0016573; Mon, 16 May 2016 20:00:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605162000.u4GK09c0016573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 May 2016 20:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299972 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:00:10 -0000 Author: pfg Date: Mon May 16 20:00:09 2016 New Revision: 299972 URL: https://svnweb.freebsd.org/changeset/base/299972 Log: libefi: Tag an unreachable switch default. Coverity reports an uninitialized "len" in case the switch defaults without hitting any case. Respect the original intent and quell the false positive with the relatively new __unreachable() builtin. CID: 1347796 Modified: head/sys/boot/efi/libefi/efi_console.c Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Mon May 16 19:48:02 2016 (r299971) +++ head/sys/boot/efi/libefi/efi_console.c Mon May 16 20:00:09 2016 (r299972) @@ -266,6 +266,8 @@ CL(int direction) case 2: /* entire line */ len = x; break; + default: /* NOTREACHED */ + __unreachable(); } if (cury == y - 1) From owner-svn-src-all@freebsd.org Mon May 16 20:04:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCF11B3EE96; Mon, 16 May 2016 20:04:39 +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 9BD8118B0; Mon, 16 May 2016 20:04:39 +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 u4GK4cNd019445; Mon, 16 May 2016 20:04:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GK4cOT019444; Mon, 16 May 2016 20:04:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605162004.u4GK4cOT019444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 May 2016 20:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299973 - head/sys/dev/ow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:04:39 -0000 Author: pfg Date: Mon May 16 20:04:38 2016 New Revision: 299973 URL: https://svnweb.freebsd.org/changeset/base/299973 Log: dev/ow: Tag an unreachable switch default. Coverity reports an uninitialized "dir" in case the switch defaults without hitting any case. Respect the original intent and quell the false positive with the relatively new __unreachable() builtin. CID: 1331566 Modified: head/sys/dev/ow/ow.c Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Mon May 16 20:00:09 2016 (r299972) +++ head/sys/dev/ow/ow.c Mon May 16 20:04:38 2016 (r299973) @@ -401,6 +401,8 @@ again: if (++retries > 5) return (EIO); goto again; + default: /* NOTREACHED */ + __unreachable(); } if (dir) { OWLL_WRITE_ONE(lldev, &timing_regular); From owner-svn-src-all@freebsd.org Mon May 16 20:07:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C36CDB3EF92; Mon, 16 May 2016 20:07:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) (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 8E1AD1B3A; Mon, 16 May 2016 20:07:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f174.google.com with SMTP id g133so173088922ywb.2; Mon, 16 May 2016 13:07:05 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=voZtJY+sFNFFPzWJh8Cr3yJlqpA/K0Gl+zEY24ZGm+o=; b=dPyDOYDsAVgeHWiy4T2kZ/3985yunj3i+oFgMk9YVjDlMgDzmUSJeKFxkAa2+tAAyU bBmiILRh3RJfeM4TJvUyMAv7aIbZbwxUArevGp0R2NYqyFQX35RkKNad20NzeZuZDTeK nl7hTrt6m/UN4dKta/4i53/BBMDPVq92DU3u4Bkh8ZISlftx7k1jygoHUi8WHdpVlhGH UDrY5Cr5bsW8kEh1U9BWTxng/S9Uckny8zl99/7pnLacnHCNLGKlPjQFjxBETDDKhj33 5sCINo/Cih0NxGlYQSAK4ngT+yopdr4aMy0r12qnV8BMNgIc554ihTXmHxI1RUD+4uwi oNOw== X-Gm-Message-State: AOPr4FW+jadHAeeZjaavNcPfkJcX6IyL+TeH49rC1tzKGBZ6M8Cmgh2Tnn+vB+ovD0FYww== X-Received: by 10.37.214.83 with SMTP id n80mr14730738ybg.90.1463414013735; Mon, 16 May 2016 08:53:33 -0700 (PDT) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com. [209.85.218.45]) by smtp.gmail.com with ESMTPSA id l132sm19612656ywb.26.2016.05.16.08.53.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 May 2016 08:53:33 -0700 (PDT) Received: by mail-oi0-f45.google.com with SMTP id v145so273948845oie.0; Mon, 16 May 2016 08:53:33 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.240.68 with SMTP id o65mr17963772oih.0.1463414012920; Mon, 16 May 2016 08:53:32 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Mon, 16 May 2016 08:53:32 -0700 (PDT) In-Reply-To: <201605160916.u4G9GFLl013293@repo.freebsd.org> References: <201605160916.u4G9GFLl013293@repo.freebsd.org> Date: Mon, 16 May 2016 08:53:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299930 - in head/sys/compat/linuxkpi/common: include/linux src From: Conrad Meyer To: Hans Petter Selasky 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:07:05 -0000 On Mon, May 16, 2016 at 2:16 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon May 16 09:16:15 2016 > New Revision: 299930 > URL: https://svnweb.freebsd.org/changeset/base/299930 > > Log: > Properly implement "cpu_has_clflush" macro. > ... > @@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$"); > > #include > > +#if defined(__i386__) || defined(__amd64__) > +#include > +#endif > + > #include > #include > #include > @@ -67,6 +71,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include Hi Hans, In Linux code, usually linux/kernel.h is included first. In FreeBSD, we mostly sort alphabetically. Pick a system, but this is the wrong place for this include :-). Best, Conrad From owner-svn-src-all@freebsd.org Mon May 16 20:18:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B258BB3D36B; Mon, 16 May 2016 20:18:55 +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 7FFEE11F5; Mon, 16 May 2016 20:18:55 +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 u4GKIsmQ022890; Mon, 16 May 2016 20:18:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GKIs2h022889; Mon, 16 May 2016 20:18:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162018.u4GKIs2h022889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 20:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299974 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:18:55 -0000 Author: adrian Date: Mon May 16 20:18:54 2016 New Revision: 299974 URL: https://svnweb.freebsd.org/changeset/base/299974 Log: [siba] add SIBA_DEBUG option. Sponsored by: Palm Springs Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon May 16 20:04:38 2016 (r299973) +++ head/sys/conf/options Mon May 16 20:18:54 2016 (r299974) @@ -857,6 +857,9 @@ BWI_DEBUG_VERBOSE opt_bwi.h # options for the Brodacom BCM43xx driver (bwn) BWN_DEBUG opt_bwn.h +# Options for the SIBA driver +SIBA_DEBUG opt_siba.h + # options for the Marvell 8335 wireless driver MALO_DEBUG opt_malo.h MALO_TXBUF opt_malo.h From owner-svn-src-all@freebsd.org Mon May 16 20:22:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E388B3D736; Mon, 16 May 2016 20:22:54 +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 D78B818CC; Mon, 16 May 2016 20:22:53 +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 u4GKMrIL025868; Mon, 16 May 2016 20:22:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GKMque025867; Mon, 16 May 2016 20:22:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162022.u4GKMque025867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 20:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299975 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:22:54 -0000 Author: adrian Date: Mon May 16 20:22:52 2016 New Revision: 299975 URL: https://svnweb.freebsd.org/changeset/base/299975 Log: [siba] fix up debugging. * unbreak non-debug builds - don't default to debugging SCAN; that was left-over from my testing. * include opt_siba.h, now that it's generated as appropriate. * stick the debug enum outside the debug block, just so it's there for any code that wants to set siba_debug for some reason (like say, my debugging muckup.) * make DPRINTF() use __VA_ARGS__ for formatting too, so it correctly handles printing w/ no args. * Make DPRINTF() use device_printf(). Sponsored by: Palm Springs Modified: head/sys/dev/siba/siba_core.c Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Mon May 16 20:18:54 2016 (r299974) +++ head/sys/dev/siba/siba_core.c Mon May 16 20:22:52 2016 (r299975) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); * the Sonics Silicon Backplane driver. */ +#include "opt_siba.h" + #include #include #include @@ -60,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SIBA_DEBUG enum { SIBA_DEBUG_SCAN = 0x00000001, /* scan */ SIBA_DEBUG_PMU = 0x00000002, /* PMU */ @@ -70,13 +71,16 @@ enum { SIBA_DEBUG_CORE = 0x00000020, /* handling cores */ SIBA_DEBUG_ANY = 0xffffffff }; -#define DPRINTF(siba, m, fmt, ...) do { \ - if (siba->siba_debug & (m)) \ - printf(fmt, __VA_ARGS__); \ + +#ifdef SIBA_DEBUG +#define DPRINTF(siba, m, ...) do { \ + if (siba->siba_debug & (m)) \ + device_printf(siba->siba_dev, __VA_ARGS__); \ } while (0) #else -#define DPRINTF(siba, m, fmt, ...) do { (void) siba; } while (0) +#define DPRINTF(siba, m, ...) do { (void) siba; } while (0) #endif + #define N(a) (sizeof(a) / sizeof(a[0])) static void siba_pci_gpio(struct siba_softc *, uint32_t, int); @@ -184,8 +188,6 @@ siba_core_attach(struct siba_softc *siba siba->siba_ops = &siba_pci_ops; - siba->siba_debug = SIBA_DEBUG_SCAN; - siba_pci_gpio(siba, SIBA_GPIO_CRYSTAL | SIBA_GPIO_PLL, 1); siba_scan(siba); From owner-svn-src-all@freebsd.org Mon May 16 20:26:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B51B3D94E; Mon, 16 May 2016 20:26: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 5CA761CCE; Mon, 16 May 2016 20:26:31 +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 u4GKQUao026250; Mon, 16 May 2016 20:26:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GKQU7E026249; Mon, 16 May 2016 20:26:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162026.u4GKQU7E026249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 20:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299976 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:26:31 -0000 Author: adrian Date: Mon May 16 20:26:30 2016 New Revision: 299976 URL: https://svnweb.freebsd.org/changeset/base/299976 Log: [bwn] check DUALPHY; add BCM4322 to the don't-override list. * DUALPHY in TGSHIGH tells us there's a phy that is dualband, rather than two separate PHYs/MACs (which we almost but don't quite yet support.) Use it. * Add the BCM4322 PCI ID to the list of devices we don't override. This means the 2g/5g flags are preserved, and thus we get 5GHz operation (with N-PHY, of course.) Tested: * BCM4311, STA mode (11bg) * BCM4312, STA mode (11bg) * BCM4321, STA mode (11abg) Sponsored by: Palm Springs Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon May 16 20:22:52 2016 (r299975) +++ head/sys/dev/bwn/if_bwn.c Mon May 16 20:26:30 2016 (r299976) @@ -1147,15 +1147,32 @@ bwn_attach_core(struct bwn_mac *mac) siba_powerup(sc->sc_dev, 0); high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH); + + /* + * Guess at whether it has A-PHY or G-PHY. + * This is just used for resetting the core to probe things; + * we will re-guess once it's all up and working. + * + * XXX TODO: there's the TGSHIGH DUALPHY flag based on + * the PHY revision. + */ bwn_reset_core(mac, !!(high & BWN_TGSHIGH_HAVE_2GHZ)); + + /* + * Get the PHY version. + */ error = bwn_phy_getinfo(mac, high); if (error) goto fail; - /* XXX need bhnd */ + /* XXX TODO need bhnd */ if (bwn_is_bus_siba(mac)) { have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; + if (high & BWN_TGSHIGH_DUALPHY) { + have_bg = 1; + have_a = 1; + } } else { device_printf(sc->sc_dev, "%s: not siba; bailing\n", __func__); error = ENXIO; @@ -1175,7 +1192,8 @@ bwn_attach_core(struct bwn_mac *mac) if (siba_get_pci_device(sc->sc_dev) != 0x4312 && siba_get_pci_device(sc->sc_dev) != 0x4319 && - siba_get_pci_device(sc->sc_dev) != 0x4324) { + siba_get_pci_device(sc->sc_dev) != 0x4324 && + siba_get_pci_device(sc->sc_dev) != 0x4328) { have_a = have_bg = 0; if (mac->mac_phy.type == BWN_PHYTYPE_A) have_a = 1; @@ -1187,9 +1205,17 @@ bwn_attach_core(struct bwn_mac *mac) KASSERT(0 == 1, ("%s: unknown phy type (%d)", __func__, mac->mac_phy.type)); } - /* XXX turns off PHY A because it's not supported */ + + /* + * XXX turns off PHY A because it's not supported. + * Implement PHY-A support so we can use it for PHY-G + * dual-band support. + */ if (mac->mac_phy.type != BWN_PHYTYPE_LP && mac->mac_phy.type != BWN_PHYTYPE_N) { + device_printf(sc->sc_dev, + "%s: forcing 2GHz only; missing PHY-A support\n", + __func__); have_a = 0; have_bg = 1; } From owner-svn-src-all@freebsd.org Mon May 16 20:48:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C3C0B3E483; Mon, 16 May 2016 20:48:27 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7733B1E9A; Mon, 16 May 2016 20:48:25 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:RN7UOxVrzarQO8pZT4JO49ujiyvV8LGtZVwlr6E/grcLSJyIuqrYZhOBt8tkgFKBZ4jH8fUM07OQ6PCxHzZeqs/d4DgrS99laVwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oM2CJV8Wz2PhMftbF1afk0b4joEum4xsK6I8mFPig0BjXKBo/15uPk+ZhB3m5829r9ZJ+iVUvO89pYYbCf2pN58/V6BVAHw8Pms0/Naj9UWbDFjH2nxJe2EbghdZSyTC7wzxXp78rGOuuuN71iSyE9f7QJoPdXKl9ag9GzHyjyJSDT8y8ynyg8dziK9e6Ea7ohV0wIrZZamIM/Vjc6fFfZURTDwSDY5qSyVdD9bkPMM0BO0bMLME94Q= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DPAQBiMTpX/61jaINdhAx+BrlnAQ2BdiKFbwKBZxQBAQEBAQEBAWQngi2CFgEBBCNWEAIBCA4KAgINGQICVwIEiEIOr1GRHgEBAQEBAQEBAQEBAQEBAQEBARoFgQGFJIRNhz+CWQWYJ4V+igmHeYU3jz8CHgEBQoQIIDIBhwZ/AQEB X-IronPort-AV: E=Sophos;i="5.26,627,1459828800"; d="scan'208";a="283715838" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 16 May 2016 16:48:18 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id A62FE15F56E; Mon, 16 May 2016 16:48:18 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id v-7LYJ4NTGMd; Mon, 16 May 2016 16:48:18 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 152CE15F571; Mon, 16 May 2016 16:48:18 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Pt17D9OPW3rR; Mon, 16 May 2016 16:48:17 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id E851715F565; Mon, 16 May 2016 16:48:17 -0400 (EDT) Date: Mon, 16 May 2016 16:48:17 -0400 (EDT) From: Rick Macklem To: Alexey Dokuchaev Cc: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1797334216.102341060.1463431697742.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <20160514203542.GA21013@FreeBSD.org> References: <201605142003.u4EK3MwV021470@repo.freebsd.org> <20160514203542.GA21013@FreeBSD.org> Subject: Re: svn commit: r299753 - head/sys/fs/fuse MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.11] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - GC46 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r299753 - head/sys/fs/fuse Thread-Index: G13fuideeY5QBbIu86aLbkgsHyu1sQ== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:48:27 -0000 Alexey Dokuchaev wrote: > On Sat, May 14, 2016 at 08:03:22PM +0000, Rick Macklem wrote: > > New Revision: 299753 > > URL: https://svnweb.freebsd.org/changeset/base/299753 > > > > Log: > > Fix fuse to use DIRECT_IO when required. > > > > When a file is opened write-only and a partial block was written, > > buffered I/O would try and read the whole block in. This would > > result in a hung thread, since there was no open (fuse filehandle) > > that allowed reading. This patch avoids the problem by forcing > > DIRECT_IO for this case. > > It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO > > flag in its reply to the open. > > Since you're at fuse now, perhaps you could also have a look at PR 195000? > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195000 > > ./danfe > Yea, the patch in PR#195000 looks ok. I'll try to reproduce the crash and if I can test the patch, I can commit it. Or would you prefer to do so? I think fuse can be made to handle special files by creating separate tables of vop methods (like the NFS client does), but that is a fair amount of work, so I think committing this patch to stop the crash makes sense in the meantime. rick From owner-svn-src-all@freebsd.org Mon May 16 21:33:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C96B3812A; Mon, 16 May 2016 21:33:32 +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 71A9C1BE5; Mon, 16 May 2016 21:33:32 +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 u4GLXVh1048796; Mon, 16 May 2016 21:33:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GLXV3S048795; Mon, 16 May 2016 21:33:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605162133.u4GLXV3S048795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 16 May 2016 21:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299977 - head/sys/dev/acpica/Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 21:33:32 -0000 Author: jhb Date: Mon May 16 21:33:31 2016 New Revision: 299977 URL: https://svnweb.freebsd.org/changeset/base/299977 Log: Use polling spin loops for timeouts during early boot. Some ACPI operations such as mutex acquires and event waits accept a timeout. The ACPI OSD layer implements these timeouts by using regular sleep timeouts. However, this doesn't work during early boot before event timers are setup. Instead, use polling combined with DELAY() to spin. This fixes booting on upcoming Intel systems with Kaby Lake processors. Tested by: "Jeffrey E Pieper" Reviewed by: jimharris MFC after: 1 week Modified: head/sys/dev/acpica/Osd/OsdSynch.c Modified: head/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSynch.c Mon May 16 20:26:30 2016 (r299976) +++ head/sys/dev/acpica/Osd/OsdSynch.c Mon May 16 21:33:31 2016 (r299977) @@ -188,6 +188,23 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl } break; default: + if (cold) { + /* + * Just spin polling the semaphore once a + * millisecond. + */ + while (!ACPISEM_AVAIL(as, Units)) { + if (Timeout == 0) { + status = AE_TIME; + break; + } + Timeout--; + mtx_unlock(&as->as_lock); + DELAY(1000); + mtx_lock(&as->as_lock); + } + break; + } tmo = timeout2hz(Timeout); while (!ACPISEM_AVAIL(as, Units)) { prevtick = ticks; @@ -381,6 +398,23 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UI } break; default: + if (cold) { + /* + * Just spin polling the mutex once a + * millisecond. + */ + while (!ACPIMTX_AVAIL(am)) { + if (Timeout == 0) { + status = AE_TIME; + break; + } + Timeout--; + mtx_unlock(&am->am_lock); + DELAY(1000); + mtx_lock(&am->am_lock); + } + break; + } tmo = timeout2hz(Timeout); while (!ACPIMTX_AVAIL(am)) { prevtick = ticks; From owner-svn-src-all@freebsd.org Mon May 16 22:39:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75400B3D79E; Mon, 16 May 2016 22:39:18 +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 4CCF31703; Mon, 16 May 2016 22:39:18 +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 u4GMdHTQ069123; Mon, 16 May 2016 22:39:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GMdHbD069122; Mon, 16 May 2016 22:39:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162239.u4GMdHbD069122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 22:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299982 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 22:39:18 -0000 Author: adrian Date: Mon May 16 22:39:17 2016 New Revision: 299982 URL: https://svnweb.freebsd.org/changeset/base/299982 Log: [bwn] switch to ieee80211_add_channel() This is an updated version of D6140. Tested: * BCM4321 11abgn, STA mode (11a) Submitted by: avos Differential Revision: https://reviews.freebsd.org/D6140 Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon May 16 22:36:10 2016 (r299981) +++ head/sys/dev/bwn/if_bwn.c Mon May 16 22:39:17 2016 (r299982) @@ -128,7 +128,7 @@ static int bwn_setup_channels(struct bwn static void bwn_shm_ctlword(struct bwn_mac *, uint16_t, uint16_t); static void bwn_addchannels(struct ieee80211_channel [], int, int *, - const struct bwn_channelinfo *, int); + const struct bwn_channelinfo *, const uint8_t []); static int bwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static void bwn_updateslot(struct ieee80211com *); @@ -1459,14 +1459,12 @@ error: return (ENODEV); } -#define IEEE80211_CHAN_HTG (IEEE80211_CHAN_HT | IEEE80211_CHAN_G) -#define IEEE80211_CHAN_HTA (IEEE80211_CHAN_HT | IEEE80211_CHAN_A) - static int bwn_setup_channels(struct bwn_mac *mac, int have_bg, int have_a) { struct bwn_softc *sc = mac->mac_sc; struct ieee80211com *ic = &sc->sc_ic; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; memset(ic->ic_channels, 0, sizeof(ic->ic_channels)); ic->ic_nchans = 0; @@ -1476,26 +1474,20 @@ bwn_setup_channels(struct bwn_mac *mac, have_bg, have_a); - if (have_bg) + if (have_bg) { + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, - &ic->ic_nchans, &bwn_chantable_bg, IEEE80211_CHAN_G); -#if 0 - if (mac->mac_phy.type == BWN_PHYTYPE_N) { - if (have_a) - bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, - &ic->ic_nchans, &bwn_chantable_n, - IEEE80211_CHAN_HTA); - } else { - if (have_a) - bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, - &ic->ic_nchans, &bwn_chantable_a, - IEEE80211_CHAN_A); + &ic->ic_nchans, &bwn_chantable_bg, bands); } -#endif - if (have_a) + + if (have_a) { + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11A); bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, - &ic->ic_nchans, &bwn_chantable_a, - IEEE80211_CHAN_A); + &ic->ic_nchans, &bwn_chantable_a, bands); + } mac->mac_phy.supports_2ghz = have_bg; mac->mac_phy.supports_5ghz = have_a; @@ -1609,63 +1601,16 @@ bwn_shm_write_2(struct bwn_mac *mac, uin } static void -bwn_addchan(struct ieee80211_channel *c, int freq, int flags, int ieee, - int txpow) -{ - - c->ic_freq = freq; - c->ic_flags = flags; - c->ic_ieee = ieee; - c->ic_minpower = 0; - c->ic_maxpower = 2 * txpow; - c->ic_maxregpower = txpow; -} - -static void bwn_addchannels(struct ieee80211_channel chans[], int maxchans, int *nchans, - const struct bwn_channelinfo *ci, int flags) + const struct bwn_channelinfo *ci, const uint8_t bands[]) { - struct ieee80211_channel *c; - int i; + int i, error; - c = &chans[*nchans]; + for (i = 0, error = 0; i < ci->nchannels && error == 0; i++) { + const struct bwn_channel *hc = &ci->channels[i]; - for (i = 0; i < ci->nchannels; i++) { - const struct bwn_channel *hc; - - hc = &ci->channels[i]; - if (*nchans >= maxchans) - break; - bwn_addchan(c, hc->freq, flags, hc->ieee, hc->maxTxPow); - c++, (*nchans)++; - if (flags == IEEE80211_CHAN_G || flags == IEEE80211_CHAN_HTG) { - /* g channel have a separate b-only entry */ - if (*nchans >= maxchans) - break; - c[0] = c[-1]; - c[-1].ic_flags = IEEE80211_CHAN_B; - c++, (*nchans)++; - } - if (flags == IEEE80211_CHAN_HTG) { - /* HT g channel have a separate g-only entry */ - if (*nchans >= maxchans) - break; - c[-1].ic_flags = IEEE80211_CHAN_G; - c[0] = c[-1]; - c[0].ic_flags &= ~IEEE80211_CHAN_HT; - c[0].ic_flags |= IEEE80211_CHAN_HT20; /* HT20 */ - c++, (*nchans)++; - } - if (flags == IEEE80211_CHAN_HTA) { - /* HT a channel have a separate a-only entry */ - if (*nchans >= maxchans) - break; - c[-1].ic_flags = IEEE80211_CHAN_A; - c[0] = c[-1]; - c[0].ic_flags &= ~IEEE80211_CHAN_HT; - c[0].ic_flags |= IEEE80211_CHAN_HT20; /* HT20 */ - c++, (*nchans)++; - } + error = ieee80211_add_channel(chans, maxchans, nchans, + hc->ieee, hc->freq, hc->maxTxPow, 0, bands); } } From owner-svn-src-all@freebsd.org Mon May 16 22:42:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEAC9B3D94E; Mon, 16 May 2016 22:42:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4621A18; Mon, 16 May 2016 22:42:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GMg9I9071932; Mon, 16 May 2016 22:42:09 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GMg9AO071928; Mon, 16 May 2016 22:42:09 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605162242.u4GMg9AO071928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 16 May 2016 22:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299983 - in stable/10: crypto/openssl/crypto crypto/openssl/crypto/perlasm secure/lib/libcrypto/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 22:42:11 -0000 Author: jkim Date: Mon May 16 22:42:09 2016 New Revision: 299983 URL: https://svnweb.freebsd.org/changeset/base/299983 Log: Hide OPENSSL_cpuid_setup and OPENSSL_ia32cap_P symbols from libcrypto.so. Note this is a direct commit because it is merged from OpenSSL upstream and head (OpenSSL 1.0.2 branch) already has the same change: https://github.com/openssl/openssl/commit/6206682 Modified: stable/10/crypto/openssl/crypto/perlasm/x86asm.pl stable/10/crypto/openssl/crypto/perlasm/x86gas.pl stable/10/crypto/openssl/crypto/x86cpuid.pl stable/10/secure/lib/libcrypto/i386/x86cpuid.S Modified: stable/10/crypto/openssl/crypto/perlasm/x86asm.pl ============================================================================== --- stable/10/crypto/openssl/crypto/perlasm/x86asm.pl Mon May 16 22:39:17 2016 (r299982) +++ stable/10/crypto/openssl/crypto/perlasm/x86asm.pl Mon May 16 22:42:09 2016 (r299983) @@ -257,4 +257,6 @@ EOF &file($filename); } +sub ::hidden {} + 1; Modified: stable/10/crypto/openssl/crypto/perlasm/x86gas.pl ============================================================================== --- stable/10/crypto/openssl/crypto/perlasm/x86gas.pl Mon May 16 22:39:17 2016 (r299982) +++ stable/10/crypto/openssl/crypto/perlasm/x86gas.pl Mon May 16 22:42:09 2016 (r299983) @@ -250,4 +250,6 @@ ___ sub ::dataseg { push(@out,".data\n"); } +*::hidden = sub { push(@out,".hidden\t$nmdecor$_[0]\n"); } if ($::elf); + 1; Modified: stable/10/crypto/openssl/crypto/x86cpuid.pl ============================================================================== --- stable/10/crypto/openssl/crypto/x86cpuid.pl Mon May 16 22:39:17 2016 (r299982) +++ stable/10/crypto/openssl/crypto/x86cpuid.pl Mon May 16 22:42:09 2016 (r299983) @@ -355,4 +355,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA3 &initseg("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_ia32cap_P"); + &asm_finish(); Modified: stable/10/secure/lib/libcrypto/i386/x86cpuid.S ============================================================================== --- stable/10/secure/lib/libcrypto/i386/x86cpuid.S Mon May 16 22:39:17 2016 (r299982) +++ stable/10/secure/lib/libcrypto/i386/x86cpuid.S Mon May 16 22:42:09 2016 (r299983) @@ -344,6 +344,8 @@ OPENSSL_ia32_rdrand: cmovel %ecx,%eax ret .size OPENSSL_ia32_rdrand,.-.L_OPENSSL_ia32_rdrand_begin +.hidden OPENSSL_cpuid_setup +.hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,8,4 .section .init call OPENSSL_cpuid_setup @@ -679,6 +681,8 @@ OPENSSL_ia32_rdrand: cmovel %ecx,%eax ret .size OPENSSL_ia32_rdrand,.-.L_OPENSSL_ia32_rdrand_begin +.hidden OPENSSL_cpuid_setup +.hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,8,4 .section .init call OPENSSL_cpuid_setup From owner-svn-src-all@freebsd.org Mon May 16 22:56:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B4C6B3DD41; Mon, 16 May 2016 22:56:38 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 8822413CC; Mon, 16 May 2016 22:56:37 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:SQA0rBw6zGTQ1kDXCy+O+j09IxM/srCxBDY+r6Qd0e0SIJqq85mqBkHD//Il1AaPBtWKragbwLOL+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuSt+U1Zv8jr360qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGxrvOg9+sIIS6jxfrwjBfwEVHV1e1wyseTvuAnOXEOj4XgBWWUfnwQAVwTM6h/3drnrvybQjcY73zOVa57YV7cxDA6j5KQjbRbjiyMKMnZt6mTegc90gadzvRWuuhF7246Sa4jDZ6k2Rb/UYd5PHTkJZc1WTSEUXtux X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DPAQCqTjpX/61jaINchAx+BrlmAQ2BdiKFbwKBaBQBAQEBAQEBAWQngi2CFgEBBCNWEAIBCA4KAgINGQICVwIEiEIOr2+RLwEBAQEBAQEBAQEBAQEBAQEBARoFgQGFJIRNhBERAYMcglkFmCeFfooJh3mFN48/Ah4BAUKECCAyAYZQNn8BAQE X-IronPort-AV: E=Sophos;i="5.26,322,1459828800"; d="scan'208";a="283730409" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 16 May 2016 18:56:35 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 03A1715F577; Mon, 16 May 2016 18:56:36 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RhS66-No9Ej1; Mon, 16 May 2016 18:56:35 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 8128115F578; Mon, 16 May 2016 18:56:35 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id orlHd19VG6NQ; Mon, 16 May 2016 18:56:35 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 62A7715F577; Mon, 16 May 2016 18:56:35 -0400 (EDT) Date: Mon, 16 May 2016 18:56:35 -0400 (EDT) From: Rick Macklem To: Alexey Dokuchaev Cc: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1941668157.102490217.1463439395249.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <20160514203542.GA21013@FreeBSD.org> References: <201605142003.u4EK3MwV021470@repo.freebsd.org> <20160514203542.GA21013@FreeBSD.org> Subject: Re: svn commit: r299753 - head/sys/fs/fuse MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.11] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - GC46 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r299753 - head/sys/fs/fuse Thread-Index: 2kXzwnpC8emQz1BIeisCs2G7ECIf5w== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 22:56:38 -0000 Alexey Dokuchaev wrote: > On Sat, May 14, 2016 at 08:03:22PM +0000, Rick Macklem wrote: > > New Revision: 299753 > > URL: https://svnweb.freebsd.org/changeset/base/299753 > > > > Log: > > Fix fuse to use DIRECT_IO when required. > > > > When a file is opened write-only and a partial block was written, > > buffered I/O would try and read the whole block in. This would > > result in a hung thread, since there was no open (fuse filehandle) > > that allowed reading. This patch avoids the problem by forcing > > DIRECT_IO for this case. > > It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO > > flag in its reply to the open. > > Since you're at fuse now, perhaps you could also have a look at PR 195000? > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195000 > > ./danfe > I was able to test the patch and it stops the crash. I took out the MPASS() call because I didn't see why it should panic for VFIFO instead of returning EINVAL like the rest. If you'd like to commit it, email soon. Otherwise I will commit it. Thanks for pointing this out, rick From owner-svn-src-all@freebsd.org Mon May 16 22:56:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E220B3DD87; Mon, 16 May 2016 22:56:47 +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 1F8341651; Mon, 16 May 2016 22:56:46 +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 u4GMukMM075520; Mon, 16 May 2016 22:56:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GMuj7M075513; Mon, 16 May 2016 22:56:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162256.u4GMuj7M075513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 22:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299984 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 22:56:47 -0000 Author: adrian Date: Mon May 16 22:56:45 2016 New Revision: 299984 URL: https://svnweb.freebsd.org/changeset/base/299984 Log: [bwn] add opt_wlan.h and opt_bwn.h so we can enable bwn debugging as appropriate. Tested: * BCM4322, STA mode (11a) Sponsored by: Palm Springs Modified: head/sys/dev/bwn/bwn_mac.c head/sys/dev/bwn/if_bwn_debug.h head/sys/dev/bwn/if_bwn_pci.c head/sys/dev/bwn/if_bwn_phy_common.c head/sys/dev/bwn/if_bwn_phy_g.c head/sys/dev/bwn/if_bwn_phy_lp.c head/sys/dev/bwn/if_bwn_util.c Modified: head/sys/dev/bwn/bwn_mac.c ============================================================================== --- head/sys/dev/bwn/bwn_mac.c Mon May 16 22:42:09 2016 (r299983) +++ head/sys/dev/bwn/bwn_mac.c Mon May 16 22:56:45 2016 (r299984) @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bwn.h" +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/bwn/if_bwn_debug.h ============================================================================== --- head/sys/dev/bwn/if_bwn_debug.h Mon May 16 22:42:09 2016 (r299983) +++ head/sys/dev/bwn/if_bwn_debug.h Mon May 16 22:56:45 2016 (r299984) @@ -32,8 +32,6 @@ #ifndef __IF_BWN_DEBUG_H__ #define __IF_BWN_DEBUG_H__ -#define BWN_DEBUG - enum { BWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ BWN_DEBUG_RECV = 0x00000002, /* basic recv operation */ Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Mon May 16 22:42:09 2016 (r299983) +++ head/sys/dev/bwn/if_bwn_pci.c Mon May 16 22:56:45 2016 (r299984) @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bwn.h" +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/bwn/if_bwn_phy_common.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_common.c Mon May 16 22:42:09 2016 (r299983) +++ head/sys/dev/bwn/if_bwn_phy_common.c Mon May 16 22:56:45 2016 (r299984) @@ -31,6 +31,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bwn.h" +#include "opt_wlan.h" + /* * The Broadcom Wireless LAN controller driver. */ Modified: head/sys/dev/bwn/if_bwn_phy_g.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_g.c Mon May 16 22:42:09 2016 (r299983) +++ head/sys/dev/bwn/if_bwn_phy_g.c Mon May 16 22:56:45 2016 (r299984) @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bwn.h" +#include "opt_wlan.h" + /* * The Broadcom Wireless LAN controller driver. */ Modified: head/sys/dev/bwn/if_bwn_phy_lp.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_lp.c Mon May 16 22:42:09 2016 (r299983) +++ head/sys/dev/bwn/if_bwn_phy_lp.c Mon May 16 22:56:45 2016 (r299984) @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bwn.h" +#include "opt_wlan.h" + /* * The Broadcom Wireless LAN controller driver. */ Modified: head/sys/dev/bwn/if_bwn_util.c ============================================================================== --- head/sys/dev/bwn/if_bwn_util.c Mon May 16 22:42:09 2016 (r299983) +++ head/sys/dev/bwn/if_bwn_util.c Mon May 16 22:56:45 2016 (r299984) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); * The Broadcom Wireless LAN controller driver. */ +#include "opt_bwn.h" +#include "opt_wlan.h" + #include #include #include From owner-svn-src-all@freebsd.org Mon May 16 22:57:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E114EB3DE4E; Mon, 16 May 2016 22:57:37 +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 AF1651967; Mon, 16 May 2016 22:57:37 +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 u4GMva5d075720; Mon, 16 May 2016 22:57:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GMva9V075719; Mon, 16 May 2016 22:57:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162257.u4GMva9V075719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 22:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299985 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 22:57:38 -0000 Author: adrian Date: Mon May 16 22:57:36 2016 New Revision: 299985 URL: https://svnweb.freebsd.org/changeset/base/299985 Log: [bwn] add opt_wlan.h / opt_bwn.h for build-time control This is a separate commit as I have local changes to bwn for now and this needs a manual merge/commit. Sponsored by: Palm Springs Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon May 16 22:56:45 2016 (r299984) +++ head/sys/dev/bwn/if_bwn.c Mon May 16 22:57:36 2016 (r299985) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); * The Broadcom Wireless LAN controller driver. */ +#include "opt_bwn.h" +#include "opt_wlan.h" + #include #include #include From owner-svn-src-all@freebsd.org Mon May 16 23:00:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E922AB3DEE6; Mon, 16 May 2016 23:00:49 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF73A1B45; Mon, 16 May 2016 23:00:49 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GN0mj4075953; Mon, 16 May 2016 23:00:48 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GN0mAh075952; Mon, 16 May 2016 23:00:48 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605162300.u4GN0mAh075952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 23:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299986 - head/usr.sbin/rpc.lockd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 23:00:50 -0000 Author: truckman Date: Mon May 16 23:00:48 2016 New Revision: 299986 URL: https://svnweb.freebsd.org/changeset/base/299986 Log: Actually use the loop interation limit so carefully computed on the previous line to prevent buffer overflow. This turns out to not be important because the upstream xdr code already capped the object size at the proper value. Using the correct limit here looks a lot less scary and should please Coverity. Reported by: Coverity CID: 1199309, 1199310 MFC after: 1 week Modified: head/usr.sbin/rpc.lockd/lock_proc.c Modified: head/usr.sbin/rpc.lockd/lock_proc.c ============================================================================== --- head/usr.sbin/rpc.lockd/lock_proc.c Mon May 16 22:57:36 2016 (r299985) +++ head/usr.sbin/rpc.lockd/lock_proc.c Mon May 16 23:00:48 2016 (r299986) @@ -112,7 +112,7 @@ log_netobj(netobj *obj) } /* Prevent the security hazard from the buffer overflow */ maxlen = (obj->n_len < MAX_NETOBJ_SZ ? obj->n_len : MAX_NETOBJ_SZ); - for (i=0, tmp1 = objvalbuffer, tmp2 = objascbuffer; i < obj->n_len; + for (i=0, tmp1 = objvalbuffer, tmp2 = objascbuffer; i < maxlen; i++, tmp1 +=2, tmp2 +=1) { sprintf(tmp1,"%02X",*(obj->n_bytes+i)); sprintf(tmp2,"%c",*(obj->n_bytes+i)); From owner-svn-src-all@freebsd.org Mon May 16 23:29:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B2FEB3E5DD; Mon, 16 May 2016 23:29:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6E9B1DA0; Mon, 16 May 2016 23:29:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GNT4ji085904; Mon, 16 May 2016 23:29:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GNT4Si085903; Mon, 16 May 2016 23:29:04 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605162329.u4GNT4Si085903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 23:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299988 - head/usr.sbin/rpc.statd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 23:29:06 -0000 Author: truckman Date: Mon May 16 23:29:04 2016 New Revision: 299988 URL: https://svnweb.freebsd.org/changeset/base/299988 Log: Set ai2 to NULL in in find_host() before the loop and after calling freeaddrinfo() on it to indicate that it doesn't point to a valid addrinfo list. This fixes this Coverity issues: 1006368 Uninitialized pointer read 1018506 Double free 1305590 Resource leak that can be triggered in the hp->hostname[0] != '\0' case. Don't treat a character as a boolean. Fix these Coverity issues: 1009293 Unchecked return value from library 1194246 Wrong size argument by tweaking the status file extend code. Reported by: Coverity CID: 1006368, 1018506, 1305590, 1009293, 1194246 Reviewed by: rmacklem Feedback from: hrs MFC after: 1 week Differential Revision: D6398 Modified: head/usr.sbin/rpc.statd/file.c Modified: head/usr.sbin/rpc.statd/file.c ============================================================================== --- head/usr.sbin/rpc.statd/file.c Mon May 16 23:20:19 2016 (r299987) +++ head/usr.sbin/rpc.statd/file.c Mon May 16 23:29:04 2016 (r299988) @@ -82,6 +82,7 @@ HostInfo *find_host(char *hostname, int struct addrinfo *ai1, *ai2; int i; + ai2 = NULL; if (getaddrinfo(hostname, NULL, NULL, &ai1) != 0) ai1 = NULL; for (i = 0, hp = status_info->hosts; i < status_info->noOfHosts; i++, hp++) @@ -91,7 +92,7 @@ HostInfo *find_host(char *hostname, int result = hp; break; } - if (hp->hostname[0] && + if (hp->hostname[0] != '\0' && getaddrinfo(hp->hostname, NULL, NULL, &ai2) != 0) ai2 = NULL; if (ai1 && ai2) @@ -113,8 +114,10 @@ HostInfo *find_host(char *hostname, int if (result) break; } - if (ai2) + if (ai2) { freeaddrinfo(ai2); + ai2 = NULL; + } if (!spare_slot && !hp->monList && !hp->notifyReqd) spare_slot = hp; } @@ -134,9 +137,8 @@ HostInfo *find_host(char *hostname, int if (desired_size > status_file_len) { /* Extend file by writing 1 byte of junk at the desired end pos */ - lseek(status_fd, desired_size - 1, SEEK_SET); - i = write(status_fd, &i, 1); - if (i < 1) + if (lseek(status_fd, desired_size - 1, SEEK_SET) == -1 || + write(status_fd, "\0", 1) < 0) { syslog(LOG_ERR, "Unable to extend status file"); return (NULL); From owner-svn-src-all@freebsd.org Mon May 16 23:37:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75158B3E757; Mon, 16 May 2016 23:37: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 45B5711BB; Mon, 16 May 2016 23:37: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 u4GNbI6Y089009; Mon, 16 May 2016 23:37:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GNbIZb089008; Mon, 16 May 2016 23:37:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162337.u4GNbIZb089008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 23:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299989 - head/sys/dev/bhnd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 23:37:19 -0000 Author: adrian Date: Mon May 16 23:37:18 2016 New Revision: 299989 URL: https://svnweb.freebsd.org/changeset/base/299989 Log: [bhnd] Add support for matching of MIPS & ARM cores Extend macros for MIPS & ARM cores. Now only BCM cores can be matched by matching mechanism. Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6246 Modified: head/sys/dev/bhnd/bhnd.h Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Mon May 16 23:29:04 2016 (r299988) +++ head/sys/dev/bhnd/bhnd.h Mon May 16 23:37:18 2016 (r299989) @@ -316,12 +316,18 @@ struct bhnd_device { uint32_t device_flags; /**< required BHND_DF_* flags */ }; -#define _BHND_DEVICE(_device, _desc, _quirks, _flags, ...) \ - { BHND_CORE_MATCH(BHND_MFGID_BCM, BHND_COREID_ ## _device, \ +#define _BHND_DEVICE(_vendor, _device, _desc, _quirks, _flags, ...) \ + { BHND_CORE_MATCH(BHND_MFGID_ ## _vendor, BHND_COREID_ ## _device, \ BHND_HWREV_ANY), _desc, _quirks, _flags } +#define BHND_MIPS_DEVICE(_device, _desc, _quirks, ...) \ + _BHND_DEVICE(MIPS, _device, _desc, _quirks, ## __VA_ARGS__, 0) + +#define BHND_ARM_DEVICE(_device, _desc, _quirks, ...) \ + _BHND_DEVICE(ARM, _device, _desc, _quirks, ## __VA_ARGS__, 0) + #define BHND_DEVICE(_device, _desc, _quirks, ...) \ - _BHND_DEVICE(_device, _desc, _quirks, ## __VA_ARGS__, 0) + _BHND_DEVICE(BCM, _device, _desc, _quirks, ## __VA_ARGS__, 0) #define BHND_DEVICE_END { BHND_CORE_MATCH_ANY, NULL, NULL, 0 } From owner-svn-src-all@freebsd.org Mon May 16 23:40:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17D83B3E819; Mon, 16 May 2016 23:40: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 E6B46135E; Mon, 16 May 2016 23:40:33 +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 u4GNeXpZ089884; Mon, 16 May 2016 23:40:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GNeWrj089872; Mon, 16 May 2016 23:40:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162340.u4GNeWrj089872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 23:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299990 - in head/sys: conf dev/bhnd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 23:40:34 -0000 Author: adrian Date: Mon May 16 23:40:32 2016 New Revision: 299990 URL: https://svnweb.freebsd.org/changeset/base/299990 Log: [bhnd] Add logging macros to BHND. There are 5 logging levels: * ERROR * WARN * INFO * DEBUG * TRACE There are 2 logging context: * with * without device DEBUG and TRACE records are printed only if bootverbose. Logging records are printed with source code line information if acceptable logging level is DEBUG or TRACE. Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6247 Added: head/sys/dev/bhnd/bhnd_debug.h (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/bhnd/bhnd.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon May 16 23:37:18 2016 (r299989) +++ head/sys/conf/NOTES Mon May 16 23:40:32 2016 (r299990) @@ -3061,3 +3061,6 @@ options EM_MULTIQUEUE # Activate multiq # zlib I/O stream support # This enables support for compressed core dumps. options GZIO + +# BHND(4) drivers +options BHND_LOGLEVEL # Logging threshold level \ No newline at end of file Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon May 16 23:37:18 2016 (r299989) +++ head/sys/conf/options Mon May 16 23:40:32 2016 (r299990) @@ -979,3 +979,6 @@ RANDOM_ENABLE_UMA opt_global.h # Intel em(4) driver EM_MULTIQUEUE opt_em.h + +# BHND(4) driver +BHND_LOGLEVEL opt_global.h Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Mon May 16 23:37:18 2016 (r299989) +++ head/sys/dev/bhnd/bhnd.h Mon May 16 23:40:32 2016 (r299990) @@ -39,6 +39,7 @@ #include "bhnd_ids.h" #include "bhnd_types.h" +#include "bhnd_debug.h" #include "bhnd_bus_if.h" extern devclass_t bhnd_devclass; Added: head/sys/dev/bhnd/bhnd_debug.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bhnd_debug.h Mon May 16 23:40:32 2016 (r299990) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +/* $FreeBSD$ */ + +/* + * This file provides set of macros for logging: + * - BHND_ and + * - BHND__DEV + * where LEVEL = {ERROR,WARN,INFO,DEBUG} + * + * BHND_ macros is proxies to printf call and accept same parameters, + * for instance: + * BHND_INFO("register %d has value %d", reg, val); + * + * BHND__DEV macros is proxies to device_printf call and accept + * same parameters, for instance: + * BHND_INFO_DEV(dev, "register %d has value %d", reg, val); + * + * All macros contains newline char at the end of each call + * + * ERROR, WARN, INFO messages are printed only if: + * - log message level is lower than BHND_LOGGING (logging threshold) + * + * DEBUG, TRACE messages are printed only if: + * - bootverbose and + * - log message level is lower than BHND_LOGGING (logging threshold) + * + * In addition, for debugging purpose log message contains information about + * file name and line number if BHND_LOGGING is more than BHND_INFO_LEVEL + * + * NOTE: macros starting with underscore (_) are private and should be not used + * + * To override logging (for instance, force tracing), you can use: + * - "options BHND_LOGLEVEL=BHND_TRACE_LEVEL" in kernel configuration + * - "#define BHND_LOGGING BHND_TRACE_LEVEL" in source code file + * + * NOTE: kernel config option doesn't override log level defined on file level, + * so try to avoid "#define BHND_LOGGING" + */ + +#ifndef _BHND_BHND_DEBUG_H_ +#define _BHND_BHND_DEBUG_H_ + +#include + +#include "opt_global.h" + +#define BHND_ERROR_LEVEL 0x00 +#define BHND_ERROR_MSG "ERROR" +#define BHND_WARN_LEVEL 0x10 +#define BHND_WARN_MSG "!WARN" +#define BHND_INFO_LEVEL 0x20 +#define BHND_INFO_MSG " info" +#define BHND_DEBUG_LEVEL 0x30 +#define BHND_DEBUG_MSG "debug" +#define BHND_TRACE_LEVEL 0x40 +#define BHND_TRACE_MSG "trace" + +#if !(defined(BHND_LOGGING)) +#if !(defined(BHND_LOGLEVEL)) +/* By default logging will print only INFO+ message*/ +#define BHND_LOGGING BHND_INFO_LEVEL +#else /* defined(BHND_LOGLEVEL) */ +/* Kernel configuration specifies logging level */ +#define BHND_LOGGING BHND_LOGLEVEL +#endif /* !(defined(BHND_LOGLEVEL)) */ +#endif /* !(defined(BHND_LOGGING)) */ + +#if BHND_LOGGING > BHND_INFO_LEVEL +#define _BHND_PRINT(fn, level, fmt, ...) \ + do { \ + if (level##LEVEL < BHND_DEBUG_LEVEL || bootverbose) \ + fn "[BHND " level##MSG "] %s:%d => " fmt "\n", \ + __func__, __LINE__, ## __VA_ARGS__); \ + } while(0); +#else /* BHND_LOGGING <= BHND_INFO_LEVEL */ +#define _BHND_PRINT(fn, level, fmt, ...) \ + do { \ + if (level##LEVEL < BHND_DEBUG_LEVEL || bootverbose) \ + fn "bhnd: " fmt "\n", ## __VA_ARGS__); \ + } while(0); +#endif /* BHND_LOGGING > BHND_INFO_LEVEL */ + + +#define _BHND_RAWPRINTFN printf( +#define _BHND_DEVPRINTFN(dev) device_printf(dev, + +#define _BHND_LOGPRINT(level, fmt, ...) \ + _BHND_PRINT(_BHND_RAWPRINTFN, level, fmt, ## __VA_ARGS__) +#define _BHND_DEVPRINT(dev, level, fmt, ...) \ + _BHND_PRINT(_BHND_DEVPRINTFN(dev), level, fmt, ## __VA_ARGS__) + +#define BHND_ERROR(fmt, ...) \ + _BHND_LOGPRINT(BHND_ERROR_, fmt, ## __VA_ARGS__); +#define BHND_ERROR_DEV(dev, fmt, ...) \ + _BHND_DEVPRINT(dev, BHND_ERROR_, fmt, ## __VA_ARGS__) + +#if BHND_LOGGING >= BHND_WARN_LEVEL +#define BHND_WARN(fmt, ...) \ + _BHND_LOGPRINT(BHND_WARN_, fmt, ## __VA_ARGS__) +#define BHND_WARN_DEV(dev, fmt, ...) \ + _BHND_DEVPRINT(dev, BHND_WARN_, fmt, ## __VA_ARGS__) + +#if BHND_LOGGING >= BHND_INFO_LEVEL +#define BHND_INFO(fmt, ...) \ + _BHND_LOGPRINT(BHND_INFO_, fmt, ## __VA_ARGS__) +#define BHND_INFO_DEV(dev, fmt, ...) \ + _BHND_DEVPRINT(dev, BHND_INFO_, fmt, ## __VA_ARGS__) + +#if BHND_LOGGING >= BHND_DEBUG_LEVEL +#define BHND_DEBUG(fmt, ...) \ + _BHND_LOGPRINT(BHND_DEBUG_, fmt, ## __VA_ARGS__) +#define BHND_DEBUG_DEV(dev, fmt, ...) \ + _BHND_DEVPRINT(dev, BHND_DEBUG_, fmt, ## __VA_ARGS__) + +#if BHND_LOGGING >= BHND_TRACE_LEVEL +#define BHND_TRACE(fmt, ...) \ + _BHND_LOGPRINT(BHND_TRACE_, fmt, ## __VA_ARGS__) +#define BHND_TRACE_DEV(dev, fmt, ...) \ + _BHND_DEVPRINT(dev, BHND_TRACE_, fmt, ## __VA_ARGS__) + +#endif /* BHND_LOGGING >= BHND_TRACE_LEVEL */ +#endif /* BHND_LOGGING >= BHND_DEBUG_LEVEL */ +#endif /* BHND_LOGGING >= BHND_INFO_LEVEL */ +#endif /* BHND_LOGGING >= BHND_WARN_LEVEL */ + +/* + * Empty defines without device context + */ +#if !(defined(BHND_WARN)) +#define BHND_WARN(fmt, ...); +#endif + +#if !(defined(BHND_INFO)) +#define BHND_INFO(fmt, ...); +#endif + +#if !(defined(BHND_DEBUG)) +#define BHND_DEBUG(fmt, ...); +#endif + +#if !(defined(BHND_TRACE)) +#define BHND_TRACE(fmt, ...); +#endif + +/* + * Empty defines with device context + */ +#if !(defined(BHND_WARN_DEV)) +#define BHND_WARN_DEV(dev, fmt, ...); +#endif + +#if !(defined(BHND_INFO_DEV)) +#define BHND_INFO_DEV(dev, fmt, ...); +#endif + +#if !(defined(BHND_DEBUG_DEV)) +#define BHND_DEBUG_DEV(dev, fmt, ...); +#endif + +#if !(defined(BHND_TRACE_DEV)) +#define BHND_TRACE_DEV(dev, fmt, ...); +#endif + +#endif /* _BHND_BHND_DEBUG_H_ */ From owner-svn-src-all@freebsd.org Mon May 16 23:47:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 510FBB3E9AD; Mon, 16 May 2016 23:47:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22FB218DB; Mon, 16 May 2016 23:47:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GNl8LK092251; Mon, 16 May 2016 23:47:08 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GNl857092250; Mon, 16 May 2016 23:47:08 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605162347.u4GNl857092250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 16 May 2016 23:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299991 - head/usr.sbin/ppp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 23:47:09 -0000 Author: truckman Date: Mon May 16 23:47:08 2016 New Revision: 299991 URL: https://svnweb.freebsd.org/changeset/base/299991 Log: Don't walk off the end of the array when proto isn't explicitly listed above. Instead update the catch-all "Others" bucket. Reported by: Coverity CID: 1007571, 1007572 MFC after: 1 week Modified: head/usr.sbin/ppp/link.c Modified: head/usr.sbin/ppp/link.c ============================================================================== --- head/usr.sbin/ppp/link.c Mon May 16 23:40:32 2016 (r299990) +++ head/usr.sbin/ppp/link.c Mon May 16 23:47:08 2016 (r299991) @@ -209,7 +209,7 @@ static struct protostatheader { { PROTO_LQR, "LQR" }, { PROTO_CHAP, "CHAP" }, { PROTO_MP, "MULTILINK" }, - { 0, "Others" } + { 0, "Others" } /* must be last */ }; void @@ -218,13 +218,13 @@ link_ProtocolRecord(struct link *l, u_sh int i; for (i = 0; i < NPROTOSTAT; i++) - if (ProtocolStat[i].number == proto) + if (ProtocolStat[i].number == proto || ProtocolStat[i].number == 0) { + if (type == PROTO_IN) + l->proto_in[i]++; + else + l->proto_out[i]++; break; - - if (type == PROTO_IN) - l->proto_in[i]++; - else - l->proto_out[i]++; + } } void From owner-svn-src-all@freebsd.org Mon May 16 23:54:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 501B4B3EB1F; Mon, 16 May 2016 23:54:29 +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 2BFE41D72; Mon, 16 May 2016 23:54:29 +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 u4GNsS8o095281; Mon, 16 May 2016 23:54:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GNsS65095279; Mon, 16 May 2016 23:54:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162354.u4GNsS65095279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 23:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299992 - head/sys/mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 23:54:29 -0000 Author: adrian Date: Mon May 16 23:54:28 2016 New Revision: 299992 URL: https://svnweb.freebsd.org/changeset/base/299992 Log: [mips/broadcom] Add initial code for interrupts on the Broadcom MIPS processor Broadcom MIPS processor doesn't reset TI flag if additional manipulation is done. Thanks to @sobomax! Added: head/sys/mips/broadcom/ head/sys/mips/broadcom/bcm_mipscore.c (contents, props changed) head/sys/mips/broadcom/bcm_mipscore.h (contents, props changed) Added: head/sys/mips/broadcom/bcm_mipscore.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/bcm_mipscore.c Mon May 16 23:54:28 2016 (r299992) @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "bcm_mipscore.h" + +static const struct resource_spec mipscore_rspec[MIPSCORE_MAX_RSPEC] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, -1, 0 } +}; + +struct bhnd_device mipscore_match[] = { + BHND_MIPS_DEVICE(MIPS, "BHND MIPS processor", NULL), + BHND_MIPS_DEVICE(MIPS33, "BHND MIPS3302 processor", NULL), + BHND_MIPS_DEVICE(MIPS74K, "BHND MIPS74K processor", NULL), + BHND_DEVICE_END +}; + +static int +mipscore_probe(device_t dev) +{ + const struct bhnd_device *id; + + id = bhnd_device_lookup(dev, mipscore_match, sizeof(mipscore_match[0])); + if (id == NULL) + return (ENXIO); + + bhnd_set_default_core_desc(dev); + return (BUS_PROBE_DEFAULT); +} + +static int +mipscore_attach(device_t dev) +{ + struct mipscore_softc *sc; + struct resource *res; + uint32_t intmask; + uint16_t devid; + int error; + + sc = device_get_softc(dev); + devid = bhnd_get_device(dev); + + sc->devid = devid; + sc->dev = dev; + + /* Allocate bus resources */ + memcpy(sc->rspec, mipscore_rspec, sizeof(sc->rspec)); + error = bhnd_alloc_resources(dev, sc->rspec, sc->res); + if (error) + return (error); + + res = sc->res[0]->res; + if (res == NULL) + return (ENXIO); + + if (devid == BHND_COREID_MIPS74K) { + intmask = (1 << 31); + /* Use intmask5 register to route the timer interrupt */ + bus_write_4(res, offsetof(struct mipscore_regs, intmask[5]), + intmask); + } + + return (0); +} + +static device_method_t mipscore_methods[] = { + DEVMETHOD(device_probe, mipscore_probe), + DEVMETHOD(device_attach, mipscore_attach), + DEVMETHOD_END +}; + +devclass_t bhnd_mipscore_devclass; + +DEFINE_CLASS_0(bhnd_mipscore, mipscore_driver, mipscore_methods, + sizeof(struct mipscore_softc)); +DRIVER_MODULE(bhnd_mipscore, bhnd, mipscore_driver, bhnd_mipscore_devclass, + 0, 0); +MODULE_VERSION(bhnd_mipscore, 1); Added: head/sys/mips/broadcom/bcm_mipscore.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/bcm_mipscore.h Mon May 16 23:54:28 2016 (r299992) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * 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 + * 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 NONINFRINGEMENT, 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. + * + * $FreeBSD$ + */ + +#ifndef _BHND_CORES_MIPS_MIPSCOREVAR_H_ +#define _BHND_CORES_MIPS_MIPSCOREVAR_H_ + +#define MIPSCORE_MAX_RSPEC 2 + +struct mipscore_softc { + device_t dev; /* CPU device */ + uint32_t devid; + struct resource_spec rspec[MIPSCORE_MAX_RSPEC]; + struct bhnd_resource *res[MIPSCORE_MAX_RSPEC]; +}; + +struct mipscore_regs { + uint32_t corecontrol; + uint32_t exceptionbase; + uint32_t PAD1[1]; /* unmapped address */ + uint32_t biststatus; + uint32_t intstatus; + uint32_t intmask[6]; + uint32_t nmimask; + uint32_t PAD2[4]; /* unmapped addresses */ + uint32_t gpioselect; + uint32_t gpiooutput; + uint32_t gpioenable; + uint32_t PAD3[101]; /* unmapped addresses */ + uint32_t clkcontrolstatus; +}; + +#endif /* _BHND_CORES_MIPS_MIPSCOREVAR_H_ */ From owner-svn-src-all@freebsd.org Mon May 16 23:56:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF473B3EBB9; Mon, 16 May 2016 23:56:32 +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 7CC6F1EF7; Mon, 16 May 2016 23:56:32 +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 u4GNuVMh095460; Mon, 16 May 2016 23:56:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GNuVfk095459; Mon, 16 May 2016 23:56:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162356.u4GNuVfk095459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 23:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299993 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 23:56:32 -0000 Author: adrian Date: Mon May 16 23:56:31 2016 New Revision: 299993 URL: https://svnweb.freebsd.org/changeset/base/299993 Log: [mips] Improve MIPS trampoline code This patch fix trampoline build. inckern.S increases stack and calls _startC of elf_trampoline, so inckern.S should be called before elf_trampoline. gcc4.2 puts text (code) into image according to order of source files in this call, so order has changed. In addition make will install trampoline kernel. It allows to use kernel for firmware build. Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6242 Modified: head/sys/conf/Makefile.mips Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Mon May 16 23:54:28 2016 (r299992) +++ head/sys/conf/Makefile.mips Mon May 16 23:56:31 2016 (r299993) @@ -62,6 +62,7 @@ ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE .if !defined(WITHOUT_KERNEL_TRAMPOLINE) KERNEL_EXTRA=trampoline +KERNEL_EXTRA_INSTALL=${KERNEL_KO}.tramp.bin trampoline: ${KERNEL_KO}.tramp.bin ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \ $S/$M/$M/inckern.S @@ -72,7 +73,7 @@ ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/ ${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \ -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \ -DKERNNAME="\"${KERNEL_KO}.tmp\"" -DELFSIZE=${TRAMP_ELFSIZE} \ - $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \ + $S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c \ -o ${KERNEL_KO}.tramp.elf ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.elf \ ${KERNEL_KO}.tramp.bin From owner-svn-src-all@freebsd.org Tue May 17 00:00:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E55DB3EE38; Tue, 17 May 2016 00:00:03 +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 283B714E7; Tue, 17 May 2016 00:00:03 +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 u4H002GG095769; Tue, 17 May 2016 00:00:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H001Bj095759; Tue, 17 May 2016 00:00:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170000.u4H001Bj095759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 00:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299994 - in head/sys/mips: broadcom conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:00:03 -0000 Author: adrian Date: Tue May 17 00:00:01 2016 New Revision: 299994 URL: https://svnweb.freebsd.org/changeset/base/299994 Log: [mips/broadcom] Add initial support for Broadcom MIPS processor Relies on BHND(4) driver. There files contains machine-dependent code for Broadcom MIPS processor and provide UART driver. This is a work in progress; it and the current bhnd code is enough to boot on the ASUS RT-N16 and RT-N53 platforms. Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6251 Added: head/sys/mips/broadcom/bcm_machdep.c (contents, props changed) head/sys/mips/broadcom/bcm_socinfo.c (contents, props changed) head/sys/mips/broadcom/bcm_socinfo.h (contents, props changed) head/sys/mips/broadcom/files.broadcom (contents, props changed) head/sys/mips/broadcom/std.broadcom (contents, props changed) head/sys/mips/broadcom/uart_bus_chipc.c (contents, props changed) head/sys/mips/broadcom/uart_cpu_chipc.c (contents, props changed) head/sys/mips/conf/BCM (contents, props changed) head/sys/mips/conf/BCM.hints (contents, props changed) Added: head/sys/mips/broadcom/bcm_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/bcm_machdep.c Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,221 @@ +/*- + * Copyright (c) 2007 Bruce M. Simpson. + * Copyright (c) 2016 Michael Zhilin + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "bcm_socinfo.h" + +#ifdef CFE +#include +#endif + +#if 0 +#define BROADCOM_TRACE 0 +#endif + +extern int *edata; +extern int *end; + +void +platform_cpu_init() +{ + /* Nothing special */ +} + +static void +mips_init(void) +{ + int i, j; + + printf("entry: mips_init()\n"); + +#ifdef CFE + /* + * Query DRAM memory map from CFE. + */ + physmem = 0; + for (i = 0; i < 10; i += 2) { + int result; + uint64_t addr, len, type; + + result = cfe_enummem(i / 2, 0, &addr, &len, &type); + if (result < 0) { +#ifdef BROADCOM_TRACE + printf("There is no phys memory for: %d\n", i); +#endif + phys_avail[i] = phys_avail[i + 1] = 0; + break; + } + if (type != CFE_MI_AVAILABLE){ +#ifdef BROADCOM_TRACE + printf("phys memory is not available: %d\n", i); +#endif + continue; + } + + phys_avail[i] = addr; + if (i == 0 && addr == 0) { + /* + * If this is the first physical memory segment probed + * from CFE, omit the region at the start of physical + * memory where the kernel has been loaded. + */ + phys_avail[i] += MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); + } +#ifdef BROADCOM_TRACE + printf("phys memory is available for: %d\n", i); + printf(" => addr = %jx\n", addr); + printf(" => len = %jd\n", len); +#endif + phys_avail[i + 1] = addr + len; + physmem += len; + } + +#ifdef BROADCOM_TRACE + printf("Total phys memory is : %ld\n", physmem); +#endif + + realmem = btoc(physmem); +#endif + + for (j = 0; j < i; j++) + dump_avail[j] = phys_avail[j]; + + physmem = realmem; + + init_param1(); + init_param2(physmem); + mips_cpu_init(); + pmap_bootstrap(); + mips_proc0_init(); + mutex_init(); + kdb_init(); +#ifdef KDB + if (boothowto & RB_KDB) + kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); +#endif +} + +#define BCM_REG_CHIPC 0x18000000 + + +void +platform_reset(void) +{ + printf("bcm::platform_reset()\n"); + intr_disable(); + BCM_WRITE_REG32(BCM_REG_CHIPC_PMUWD_OFFS, 2); /* PMU watchdog */ + for (;;); +} + +void +platform_start(__register_t a0, __register_t a1, __register_t a2, + __register_t a3) +{ + vm_offset_t kernend; + uint64_t platform_counter_freq; + struct bcm_socinfo *socinfo; + + /* clear the BSS and SBSS segments */ + kernend = (vm_offset_t)&end; + memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + + mips_postboot_fixup(); + + /* Initialize pcpu stuff */ + mips_pcpu0_init(); + + socinfo = bcm_get_socinfo(); + platform_counter_freq = socinfo->cpurate * 1000 * 1000; /* BCM4718 is 480MHz */ + + mips_timer_early_init(platform_counter_freq); + +#ifdef CFE + /* + * Initialize CFE firmware trampolines before + * we initialize the low-level console. + * + * CFE passes the following values in registers: + * a0: firmware handle + * a2: firmware entry point + * a3: entry point seal + */ + if (a3 == CFE_EPTSEAL) + cfe_init(a0, a2); +#endif + cninit(); + + mips_init(); + + /* BCM471x timer is 1/2 of Clk */ + mips_timer_init_params(platform_counter_freq, 1); +} Added: head/sys/mips/broadcom/bcm_socinfo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/bcm_socinfo.c Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "bcm_socinfo.h" + +/* found on https://wireless.wiki.kernel.org/en/users/drivers/b43/soc */ +struct bcm_socinfo bcm_socinfos[] = { + {0x00005300, 600, 25000000}, /* BCM4706 to check */ + {0x0022B83A, 300, 20000000}, /* BCM4716B0 ASUS RT-N12 */ + {0x00914716, 354, 20000000}, /* BCM4717A1 to check */ + {0x00A14716, 480, 20000000}, /* BCM4718A1 ASUS RT-N16 */ + {0x00435356, 300, 25000000}, /* BCM5356A1 (RT-N10, WNR1000v3) */ + {0x00825357, 500, 20000000}, /* BCM5358UB0 ASUS RT-N53A1 */ + {0x00845357, 300, 20000000}, /* BCM5357B0 to check */ + {0x00945357, 500, 20000000}, /* BCM5358 */ + {0x00A45357, 500, 20000000}, /* BCM47186B0 Tenda N60 */ + {0x0085D144, 300, 20000000}, /* BCM5356C0 */ + {0x00B5D144, 300, 20000000}, /* BCM5357C0 */ + {0,0,0} +}; + +/* Most popular BCM SoC info */ +struct bcm_socinfo BCM_DEFAULT_SOCINFO = {0x0, 300, 20000000}; + +struct bcm_socinfo* +bcm_get_socinfo_by_socid(uint32_t key) +{ + struct bcm_socinfo* start; + + if(!key) + return (NULL); + + for(start = bcm_socinfos; start->id > 0; start++) + if(start->id == key) + return (start); + + return (NULL); +} + +struct bcm_socinfo* +bcm_get_socinfo(void) +{ + uint32_t socid; + struct bcm_socinfo *socinfo; + + /* + * We need Chip ID + Revision + Package + * -------------------------------------------------------------- + * | Mask | Usage | + * -------------------------------------------------------------- + * | 0x0000FFFF | Chip ID | + * | 0x000F0000 | Chip Revision | + * | 0x00F00000 | Package Options | + * | 0x0F000000 | Number of Cores (ChipCommon Rev. >= 4)| + * | 0xF0000000 | Chip Type | + * -------------------------------------------------------------- + */ + + socid = BCM_READ_REG32(BCM_REG_CHIPC_ID) & 0x00FFFFFF; + socinfo = bcm_get_socinfo_by_socid(socid); + return (socinfo != NULL) ? socinfo : &BCM_DEFAULT_SOCINFO; +} Added: head/sys/mips/broadcom/bcm_socinfo.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/bcm_socinfo.h Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * + * 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 _MIPS_BROADCOM_BCM_SOCINFO_H_ +#define _MIPS_BROADCOM_BCM_SOCINFO_H_ + +#include + +struct bcm_socinfo { + uint32_t id; + uint32_t cpurate; /* in MHz */ + uint32_t uartrate; /* in Hz */ +}; + +struct bcm_socinfo* bcm_get_socinfo_by_socid(uint32_t key); +struct bcm_socinfo* bcm_get_socinfo(void); + +#define BCM_SOCADDR 0x18000000 +#define BCM_REG_CHIPC_ID 0x0 +#define BCM_REG_CHIPC_UART 0x300 +#define BCM_REG_CHIPC_PMUWD_OFFS 0x634 +#define BCM_SOCREG(reg) \ + MIPS_PHYS_TO_KSEG1((BCM_SOCADDR + (reg))) +#define BCM_READ_REG32(reg) \ + *((volatile uint32_t *)BCM_SOCREG(reg)) +#define BCM_WRITE_REG32(reg, value) \ + do { \ + writel((void*)BCM_SOCREG((reg)),value); \ + } while (0); + +#endif /* _MIPS_BROADCOM_BCM_SOCINFO_H_ */ Added: head/sys/mips/broadcom/files.broadcom ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/files.broadcom Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,47 @@ +# $FreeBSD$ + +# TODO: Add attachment elsewhere in the tree +# for USB 1.1 OHCI, Ethernet and IPSEC cores +# which are believed to be devices we have drivers for +# which just need to be tweaked for attachment to an BHND system bus. +mips/broadcom/bcm_machdep.c standard +mips/mips/tick.c standard +mips/mips/mips_pic.c standard +kern/subr_intr.c standard +kern/pic_if.m standard + +kern/msi_if.m optional intrng + +mips/broadcom/uart_cpu_chipc.c optional uart +mips/broadcom/uart_bus_chipc.c optional uart +mips/broadcom/bcm_socinfo.c standard +mips/broadcom/bcm_mipscore.c standard + +# +geom/geom_flashmap.c standard +# +dev/bhnd/bhnd.c standard +dev/bhnd/bhnd_subr.c standard +dev/bhnd/bhnd_bus_if.m standard +dev/bhnd/bhndb/bhndb_if.m standard +dev/bhnd/bhndb/bhndb_bus_if.m standard +dev/bhnd/bcma/bcma.c standard +dev/bhnd/bcma/bcma_nexus.c standard +#dev/bhnd/bcma/bcma_bhndb.c standard +dev/bhnd/bcma/bcma_erom.c standard +dev/bhnd/bcma/bcma_subr.c standard +dev/bhnd/cores/chipc/chipc_subr.c standard +dev/bhnd/cores/chipc/chipc_cfi.c optional cfi +dev/bhnd/cores/chipc/chipc_spi.c optional spibus +dev/bhnd/cores/chipc/chipc_slicer.c optional cfi | spibus +dev/bhnd/cores/chipc/chipc.c standard +#to remove +#dev/bhnd/cores/chipc/chipcbus.c standard +dev/bhnd/cores/chipc/bhnd_chipc_if.m standard +dev/bhnd/nvram/bhnd_nvram_if.m standard +#dev/bhnd/siba/siba.c standard +#dev/bhnd/siba/siba_bhndb.c standard +#dev/bhnd/siba/siba_nexus.c standard +#dev/bhnd/siba/siba_subr.c standard +dev/bhnd/soc/bhnd_soc.c standard +# \ No newline at end of file Added: head/sys/mips/broadcom/std.broadcom ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/std.broadcom Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# + +machine mips mipsel + +cpu CPU_MIPS74K +files "../broadcom/files.broadcom" Added: head/sys/mips/broadcom/uart_bus_chipc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/uart_bus_chipc.c Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_uart.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "uart_if.h" +#include "bhnd_chipc_if.h" + +static int uart_chipc_probe(device_t dev); + +extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; + +static void +uart_chipc_identify(driver_t *driver, device_t parent) +{ + struct chipc_capabilities *caps; + + caps = BHND_CHIPC_GET_CAPABILITIES(parent); + + if (caps->num_uarts == 0) + return; + + /* + * TODO: add more than one UART + */ + BUS_ADD_CHILD(parent, 0, "uart", -1); +} + +static int +uart_chipc_probe(device_t dev) +{ + struct uart_softc *sc; + struct resource *res; + int rid; + + rid = 0; + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "can't allocate main resource\n"); + return (ENXIO); + } + + sc = device_get_softc(dev); + sc->sc_class = &uart_ns8250_class; + sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); + if (sc->sc_sysdev == NULL) { + device_printf(dev, "missing sysdev\n"); + return (EINVAL); + } + + bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); + + sc->sc_sysdev->bas.bst = rman_get_bustag(res); + sc->sc_sysdev->bas.bsh = rman_get_bushandle(res); + sc->sc_bas.bst = sc->sc_sysdev->bas.bst; + sc->sc_bas.bsh = sc->sc_sysdev->bas.bsh; + + bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + + /* We use internal SoC clock generator with non-standart freq MHz */ + return (uart_bus_probe(dev, 0, sc->sc_sysdev->bas.rclk, 0, 0)); +} + +static device_method_t uart_chipc_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, uart_chipc_identify), + DEVMETHOD(device_probe, uart_chipc_probe), + DEVMETHOD(device_attach, uart_bus_attach), + DEVMETHOD(device_detach, uart_bus_detach), + { 0, 0 } +}; + +static driver_t uart_chipc_driver = { + uart_driver_name, + uart_chipc_methods, + sizeof(struct uart_softc), +}; + +DRIVER_MODULE(uart, bhnd_chipc, uart_chipc_driver, uart_devclass, 0, 0); Added: head/sys/mips/broadcom/uart_cpu_chipc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/uart_cpu_chipc.c Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_uart.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "bcm_socinfo.h" + +bus_space_tag_t uart_bus_space_io; +bus_space_tag_t uart_bus_space_mem; + +int +uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) +{ + return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); +} + +int +uart_cpu_getdev(int devtype, struct uart_devinfo *di) +{ + struct uart_class *class; + struct bcm_socinfo *socinfo; + + socinfo = bcm_get_socinfo(); + class = &uart_ns8250_class; + di->ops = uart_getops(class); + di->bas.chan = 0; + di->bas.bst = mips_bus_space_generic; + di->bas.bsh = (bus_space_handle_t)BCM_SOCREG(BCM_REG_CHIPC_UART); + di->bas.regshft = 0; + di->bas.rclk = socinfo->uartrate; /* in Hz */ + di->baudrate = 115200; + di->databits = 8; + di->stopbits = 1; + di->parity = UART_PARITY_NONE; + uart_bus_space_io = NULL; + uart_bus_space_mem = mips_bus_space_generic; + return (0); +} Added: head/sys/mips/conf/BCM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BCM Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,95 @@ +# +# $FreeBSD$ +# +# The Broadcom 470x/471x/535x series of processors and boards is very commonly +# used in COTS hardware including the ASUS RT-N12, RT-N16, RT-N53. +# + +ident BCM + +hints "BCM.hints" +include "../broadcom/std.broadcom" + +# ships with cfe firmware +options CFE +options ALT_BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER +options BOOTVERBOSE=0 + +makeoptions INTRNG +options INTRNG + +makeoptions TRAMPLOADADDR=0x80800000 +makeoptions DEBUG="-g3" #Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCL #Network Filesystem Client +#options NFS_ROOT #NFS usable as /, requires NFSCL +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories + +device geom_uzip +options GEOM_UZIP +options GEOM_LABEL # Providers labelization. +options ROOTDEVNAME=\"ufs:ufs/FBSD\" # assumes FW built by + # freebsd-build-wifi + +# Debugging for use in -current +#options DEADLKRES +options INVARIANTS +options INVARIANT_SUPPORT + +#options BHND_LOGLEVEL=BHND_DEBUG_LEVEL +#options BUS_DEBUG +#makeoptions BUS_DEBUG +#options VERBOSE_SYSINIT +#makeoptions VERBOSE_SYSINIT + +device pci + +#device bgmac # Broadcom GMAC - not yet +device bhnd + +device mdio + +#Flash +device spibus +device mx25l # Serial Flash +device cfi # Parallel Flash +device cfid + +#UART +device uart + +#Base +device loop +device ether +device random +device md + +#Performance +#options HWPMC_HOOKS +#device hwpmc +#device hwpmc_mips74k + +#Ethernet +# device bfe # XXX will build both pci and siba +device miibus # attachments + +# pci devices + +# USB is not yet ready +#options USB_DEBUG # enable debug msgs +#device usb # USB Bus (required) +#device uhci # UHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface (USB 2.0) Added: head/sys/mips/conf/BCM.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BCM.hints Tue May 17 00:00:01 2016 (r299994) @@ -0,0 +1,6 @@ +# $FreeBSD$ +hint.bhnd_soc.0.at="nexus0" +# XXX ? +hint.bhnd_soc.0.maddr="0x00000000" +hint.bhnd_soc.0.msize="0x20000000" + From owner-svn-src-all@freebsd.org Tue May 17 00:08:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B957DB3D1CA; Tue, 17 May 2016 00:08:44 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 870C51BFC; Tue, 17 May 2016 00:08:44 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H08h7J098977; Tue, 17 May 2016 00:08:43 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H08hEB098976; Tue, 17 May 2016 00:08:43 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201605170008.u4H08hEB098976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 17 May 2016 00:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299995 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:08:44 -0000 Author: sjg Date: Tue May 17 00:08:43 2016 New Revision: 299995 URL: https://svnweb.freebsd.org/changeset/base/299995 Log: Allow -f - to read from stdin. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue May 17 00:00:01 2016 (r299994) +++ head/usr.bin/kdump/kdump.c Tue May 17 00:08:43 2016 (r299995) @@ -298,8 +298,9 @@ main(int argc, char *argv[]) m = malloc(size = 1025); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); - if (!freopen(tracefile, "r", stdin)) - err(1, "%s", tracefile); + if (strcmp(tracefile, "-")) + if (!freopen(tracefile, "r", stdin)) + err(1, "%s", tracefile); strerror_init(); localtime_init(); From owner-svn-src-all@freebsd.org Tue May 17 00:20:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAF8B3D6C6; Tue, 17 May 2016 00:20:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (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 4F62A10F1; Tue, 17 May 2016 00:20:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qg0-x22a.google.com with SMTP id f74so257498qge.2; Mon, 16 May 2016 17:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Wu55Jb0SH8TNgaeGWq5DJOrqfV/bJhA3CJDycdOVqqY=; b=KyAfZ46LYuPNnsNHU7rIw58+GqKwcp+Jyxg/enWCk2NkUpvoG2Gv5U/ueZaB5gDJZf uh5eFM5af8uW6EkP84EN7zTneBaQRVgg3ebPEHRvNaVjSVMKuc3klO+XMskMk5av0NLJ Ux6iPNVp1zFzSyjGkAv96CXvlOLI7RLlgd0oyIG5qyfkgEqmo/lSF5wmdV5A5Ig8Xb+J unnt94XKq/Bw7dg13CvItJ6xC+VnKoEH+d9Ys1hGCbwLTwx1HS0dL1qJXJZk/V+1z5XG qDwkqgvni4LiyYaElQt0a8Uuiazv5PPkiFglEtOgrT6uBhK9q8nXnIazdjuPlsAcWnr4 JGbA== 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:date :message-id:subject:from:to:cc; bh=Wu55Jb0SH8TNgaeGWq5DJOrqfV/bJhA3CJDycdOVqqY=; b=d/bdYBpC4xJjjCoFUUlVjl8poE8d17LGwD40/hVgm3648NUekUTmu+2rN85JIuV3gE z0R3x1WX5h+bdlJ7b9j3Vz59vAWqQe1/lR/oqZ9vx+ZQ3nWYs4qUYMq3Pe66/g9xm45d yrWADyGZvISufp8QljvUhYKS7if3xI1nNmqVCangCgfgJNI+2jHVrIJTgd9DSSzUwOnA 1H7YN/Pjnn1vu+Csp6ZLdetOQ54YWFg1OmRHgZOUI9RJIC9cd5us6dWsWn95OHGaI1rT 8d3ZpaQ4GYp+77S9yYHDU9yR91yGC+vnaj55iUMSFPFSaSXUAZZ5FayJjarhFr7DeJaj LqHw== X-Gm-Message-State: AOPr4FVxHkt288s164FxPDH7q9FdSkyYLql9Taczu7BWY3uY84PD050DCWnA02zPlhP92/kpUlgnyyRz/XKvhw== MIME-Version: 1.0 X-Received: by 10.141.44.135 with SMTP id v129mr34035174qhe.46.1463444438430; Mon, 16 May 2016 17:20:38 -0700 (PDT) Received: by 10.55.170.201 with HTTP; Mon, 16 May 2016 17:20:38 -0700 (PDT) In-Reply-To: <201605170008.u4H08hEB098976@repo.freebsd.org> References: <201605170008.u4H08hEB098976@repo.freebsd.org> Date: Mon, 16 May 2016 17:20:38 -0700 Message-ID: Subject: Re: svn commit: r299995 - head/usr.bin/kdump From: Ngie Cooper To: "Simon J. Gerraty" 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:20:39 -0000 On Mon, May 16, 2016 at 5:08 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Tue May 17 00:08:43 2016 > New Revision: 299995 > URL: https://svnweb.freebsd.org/changeset/base/299995 > > Log: > Allow -f - to read from stdin. > > Modified: > head/usr.bin/kdump/kdump.c > > Modified: head/usr.bin/kdump/kdump.c > ============================================================================== > --- head/usr.bin/kdump/kdump.c Tue May 17 00:00:01 2016 (r299994) > +++ head/usr.bin/kdump/kdump.c Tue May 17 00:08:43 2016 (r299995) > @@ -298,8 +298,9 @@ main(int argc, char *argv[]) > m = malloc(size = 1025); > if (m == NULL) > errx(1, "%s", strerror(ENOMEM)); > - if (!freopen(tracefile, "r", stdin)) > - err(1, "%s", tracefile); > + if (strcmp(tracefile, "-")) Please use `!= 0` for explicitness. Thanks, -Ngie From owner-svn-src-all@freebsd.org Tue May 17 00:23:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5728B3D74C; Tue, 17 May 2016 00:23:47 +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 9BA8A14CB; Tue, 17 May 2016 00:23:47 +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 u4H0NkC7005424; Tue, 17 May 2016 00:23:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H0Nkpm005417; Tue, 17 May 2016 00:23:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170023.u4H0Nkpm005417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 00:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299996 - in head/sys/dev/bhnd: . bcma bhndb cores/chipc cores/pci nvram siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:23:48 -0000 Author: adrian Date: Tue May 17 00:23:46 2016 New Revision: 299996 URL: https://svnweb.freebsd.org/changeset/base/299996 Log: [bhnd] Centralize fetching of board information Centralizes fetching of board information (vendor, type, revision, etc), and adds support for matching quirks against board identification info. * Adds a BHND_BUS_READ_BOARD_INFO(), allowing bhnd bus/bus parent(s) to handle implementation-specific fetching of board info. * Integrates board type constants from the latest Broadcom ISC-licensed bcmdevs.h included in dd-wrt's Broadcom driver source drops. * Adds support for matching on chip/board quirks to bhnd_device_quirks()/ bhnd_chip_quirks(). * Use the new board/chip quirk matching to match Apple devices that failed to set BFL2_PCIEWAR_OVR in SROM. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6361 Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_if.m head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/pci/bhnd_pci.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostbvar.h head/sys/dev/bhnd/nvram/nvram_map head/sys/dev/bhnd/siba/siba_bhndb.c Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_bhndb.c Tue May 17 00:08:43 2016 (r299995) +++ head/sys/dev/bhnd/bcma/bcma_bhndb.c Tue May 17 00:23:46 2016 (r299996) @@ -166,6 +166,20 @@ bcma_bhndb_resume_child(device_t dev, de return (0); } +static int +bcma_bhndb_read_board_info(device_t dev, device_t child, + struct bhnd_board_info *info) +{ + int error; + + /* Initialize with NVRAM-derived values */ + if ((error = bhnd_bus_generic_read_board_info(dev, child, info))) + return (error); + + /* Let the bridge fill in any additional data */ + return (BHNDB_POPULATE_BOARD_INFO(device_get_parent(dev), dev, info)); +} + static device_method_t bcma_bhndb_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcma_bhndb_probe), @@ -175,6 +189,9 @@ static device_method_t bcma_bhndb_method DEVMETHOD(bus_suspend_child, bcma_bhndb_suspend_child), DEVMETHOD(bus_resume_child, bcma_bhndb_resume_child), + /* BHND interface */ + DEVMETHOD(bhnd_bus_read_board_info, bcma_bhndb_read_board_info), + DEVMETHOD_END }; Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue May 17 00:08:43 2016 (r299995) +++ head/sys/dev/bhnd/bhnd.c Tue May 17 00:23:46 2016 (r299996) @@ -58,11 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "nvram/bhnd_nvram.h" - -#include "bhnd_chipc_if.h" -#include "bhnd_nvram_if.h" - #include "bhnd.h" #include "bhndvar.h" @@ -85,8 +80,6 @@ static const struct bhnd_nomatch { { BHND_MFGID_INVALID, BHND_COREID_INVALID, false } }; -static device_t find_nvram_child(device_t dev); - static int compare_ascending_probe_order(const void *lhs, const void *rhs); static int compare_descending_probe_order(const void *lhs, @@ -314,7 +307,9 @@ bhnd_generic_get_probe_order(device_t de { switch (bhnd_get_class(child)) { case BHND_DEVCLASS_CC: - return (BHND_PROBE_BUS + BHND_PROBE_ORDER_FIRST); + /* Must be early enough to provide NVRAM access to the + * host bridge */ + return (BHND_PROBE_ROOT + BHND_PROBE_ORDER_FIRST); case BHND_DEVCLASS_CC_B: /* fall through */ @@ -381,68 +376,6 @@ bhnd_generic_is_region_valid(device_t de } /** - * Find an NVRAM child device on @p dev, if any. - * - * @retval device_t An NVRAM device. - * @retval NULL If no NVRAM device is found. - */ -static device_t -find_nvram_child(device_t dev) -{ - device_t chipc, nvram; - - /* Look for a directly-attached NVRAM child */ - nvram = device_find_child(dev, "bhnd_nvram", 0); - if (nvram != NULL) - return (nvram); - - /* Remaining checks are only applicable when searching a bhnd(4) - * bus. */ - if (device_get_devclass(dev) != bhnd_devclass) - return (NULL); - - /* Look for a ChipCommon device */ - if ((chipc = bhnd_find_child(dev, BHND_DEVCLASS_CC, -1)) != NULL) { - bhnd_nvram_src_t src; - - /* Query the NVRAM source and determine whether it's - * accessible via the ChipCommon device */ - src = BHND_CHIPC_NVRAM_SRC(chipc); - if (BHND_NVRAM_SRC_CC(src)) - return (chipc); - } - - /* Not found */ - return (NULL); -} - -/** - * Default bhnd(4) bus driver implementation of BHND_BUS_GET_NVRAM_VAR(). - * - * This implementation searches @p dev for a usable NVRAM child device: - * - The first child device implementing the bhnd_nvram devclass is - * returned, otherwise - * - If @p dev is a bhnd(4) bus, a ChipCommon core that advertises an - * attached NVRAM source. - * - * If no usable child device is found on @p dev, the request is delegated to - * the BHND_BUS_GET_NVRAM_VAR() method on the parent of @p dev. - */ -static int -bhnd_generic_get_nvram_var(device_t dev, device_t child, const char *name, - void *buf, size_t *size) -{ - device_t nvram; - - /* Try to find an NVRAM device applicable to @p child */ - if ((nvram = find_nvram_child(dev)) == NULL) - return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), child, - name, buf, size)); - - return BHND_NVRAM_GETVAR(nvram, name, buf, size); -} - -/** * Default bhnd(4) bus driver implementation of BUS_PRINT_CHILD(). * * This implementation requests the device's struct resource_list via @@ -693,7 +626,7 @@ static device_method_t bhnd_methods[] = DEVMETHOD(bhnd_bus_get_probe_order, bhnd_generic_get_probe_order), DEVMETHOD(bhnd_bus_is_region_valid, bhnd_generic_is_region_valid), DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_bus_generic_is_hw_disabled), - DEVMETHOD(bhnd_bus_get_nvram_var, bhnd_generic_get_nvram_var), + DEVMETHOD(bhnd_bus_get_nvram_var, bhnd_bus_generic_get_nvram_var), DEVMETHOD(bhnd_bus_read_1, bhnd_read_1), DEVMETHOD(bhnd_bus_read_2, bhnd_read_2), DEVMETHOD(bhnd_bus_read_4, bhnd_read_4), Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue May 17 00:08:43 2016 (r299995) +++ head/sys/dev/bhnd/bhnd.h Tue May 17 00:23:46 2016 (r299996) @@ -110,6 +110,34 @@ BHND_ACCESSOR(core_unit, CORE_UNIT, int) #undef BHND_ACCESSOR /** + * A bhnd(4) board descriptor. + */ +struct bhnd_board_info { + uint16_t board_vendor; /**< PCI-SIG vendor ID (even on non-PCI + * devices). + * + * On PCI devices, this will generally + * be the subsystem vendor ID, but the + * value may be overridden in device + * NVRAM. + */ + uint16_t board_type; /**< Board type (See BHND_BOARD_*) + * + * On PCI devices, this will generally + * be the subsystem device ID, but the + * value may be overridden in device + * NVRAM. + */ + uint16_t board_rev; /**< Board revision. */ + uint8_t board_srom_rev; /**< Board SROM format revision */ + + uint32_t board_flags; /**< Board flags (see BHND_BFL_*) */ + uint32_t board_flags2; /**< Board flags 2 (see BHND_BFL2_*) */ + uint32_t board_flags3; /**< Board flags 3 (see BHND_BFL3_*) */ +}; + + +/** * Chip Identification * * This is read from the ChipCommon ID register; on earlier bhnd(4) devices @@ -131,23 +159,10 @@ struct bhnd_chipid { }; /** -* A bhnd(4) bus resource. -* -* This provides an abstract interface to per-core resources that may require -* bus-level remapping of address windows prior to access. -*/ -struct bhnd_resource { - struct resource *res; /**< the system resource. */ - bool direct; /**< false if the resource requires - * bus window remapping before it - * is MMIO accessible. */ -}; - -/** * A bhnd(4) core descriptor. */ struct bhnd_core_info { - uint16_t vendor; /**< vendor */ + uint16_t vendor; /**< JEP-106 vendor (BHND_MFGID_*) */ uint16_t device; /**< device */ uint16_t hwrev; /**< hardware revision */ u_int core_idx; /**< bus-assigned core index */ @@ -165,6 +180,19 @@ struct bhnd_hwrev_match { to match on any revision. */ }; +/** +* A bhnd(4) bus resource. +* +* This provides an abstract interface to per-core resources that may require +* bus-level remapping of address windows prior to access. +*/ +struct bhnd_resource { + struct resource *res; /**< the system resource. */ + bool direct; /**< false if the resource requires + * bus window remapping before it + * is MMIO accessible. */ +}; + /** * Wildcard hardware revision match descriptor. */ @@ -233,31 +261,51 @@ struct bhnd_core_match { .unit = -1 \ } -/** A chipset match descriptor. */ +/** + * A chipset match descriptor. + * + * @warning Matching on board/nvram attributes relies on NVRAM access, and will + * fail if a valid NVRAM device cannot be found, or is not yet attached. + */ struct bhnd_chip_match { /** Select fields to be matched */ - uint8_t + uint16_t match_id:1, match_rev:1, match_pkg:1, - match_flags_unused:5; + match_bvendor:1, + match_btype:1, + match_brev:1, + match_srom_rev:1, + match_any:1, + match_flags_unused:8; uint16_t chip_id; /**< required chip id */ struct bhnd_hwrev_match chip_rev; /**< matching chip revisions */ uint8_t chip_pkg; /**< required package */ + + uint16_t board_vendor; /**< required board vendor */ + uint16_t board_type; /**< required board type */ + struct bhnd_hwrev_match board_rev; /**< matching board revisions */ + + struct bhnd_hwrev_match board_srom_rev; /**< matching board srom revisions */ }; #define BHND_CHIP_MATCH_ANY \ - { .match_id = 0, .match_rev = 0, .match_pkg = 0 } + { .match_any = 1 } #define BHND_CHIP_MATCH_IS_ANY(_m) \ - ((_m)->match_id == 0 && (_m)->match_rev == 0 && (_m)->match_pkg == 0) + ((_m)->match_any == 1) + +#define BHND_CHIP_MATCH_REQ_BOARD_INFO(_m) \ + ((_m)->match_srom_rev || (_m)->match_bvendor || \ + (_m)->match_btype || (_m)->match_brev) /** Set the required chip ID within a bhnd_chip_match instance */ #define BHND_CHIP_ID(_cid) \ .match_id = 1, .chip_id = BHND_CHIPID_BCM ## _cid -/** Set the required revision range within a bhnd_chip_match instance */ +/** Set the required chip revision range within a bhnd_chip_match instance */ #define BHND_CHIP_REV(_rev) \ .match_rev = 1, .chip_rev = BHND_ ## _rev @@ -265,6 +313,31 @@ struct bhnd_chip_match { #define BHND_CHIP_PKG(_pkg) \ .match_pkg = 1, .chip_pkg = BHND_PKGID_BCM ## _pkg +/** Set the required board vendor within a bhnd_chip_match instance */ +#define BHND_CHIP_BVENDOR(_vend) \ + .match_bvendor = 1, .board_vendor = _vend + +/** Set the required board type within a bhnd_chip_match instance */ +#define BHND_CHIP_BT(_btype) \ + .match_btype = 1, .board_type = BHND_BOARD_BCM ## _btype + +/** Set the required SROM revision range within a bhnd_chip_match instance */ +#define BHND_CHIP_SROMREV(_rev) \ + .match_srom_rev = 1, .board_srom_rev = BHND_ ## _rev + +/** Set the required board revision range within a bhnd_chip_match instance */ +#define BHND_CHIP_BREV(_rev) \ + .match_brev = 1, .board_rev = BHND_ ## _rev + +/** Set the required board vendor and type within a bhnd_chip_match instance */ +#define BHND_CHIP_BVT(_vend, _type) \ + BHND_CHIP_BVEND(_vend), BHND_CHIP_BTYPE(_type) + +/** Set the required board vendor, type, and revision within a bhnd_chip_match + * instance */ +#define BHND_CHIP_BVTR(_vend, _type, _rev) \ + BHND_CHIP_BVT(_vend, _type), BHND_CHIP_BREV(_rev) + /** Set the required chip and package ID within a bhnd_chip_match instance */ #define BHND_CHIP_IP(_cid, _pkg) \ BHND_CHIP_ID(_cid), BHND_CHIP_PKG(_pkg) @@ -314,23 +387,29 @@ struct bhnd_device { const struct bhnd_core_match core; /**< core match descriptor */ const char *desc; /**< device description, or NULL. */ const struct bhnd_device_quirk *quirks_table; /**< quirks table for this device, or NULL */ + const struct bhnd_chip_quirk *chip_quirks_table; /**< chipset-specific quirks for this device, or NULL */ uint32_t device_flags; /**< required BHND_DF_* flags */ }; -#define _BHND_DEVICE(_vendor, _device, _desc, _quirks, _flags, ...) \ - { BHND_CORE_MATCH(BHND_MFGID_ ## _vendor, BHND_COREID_ ## _device, \ - BHND_HWREV_ANY), _desc, _quirks, _flags } - -#define BHND_MIPS_DEVICE(_device, _desc, _quirks, ...) \ - _BHND_DEVICE(MIPS, _device, _desc, _quirks, ## __VA_ARGS__, 0) - -#define BHND_ARM_DEVICE(_device, _desc, _quirks, ...) \ - _BHND_DEVICE(ARM, _device, _desc, _quirks, ## __VA_ARGS__, 0) +#define _BHND_DEVICE(_vendor, _device, _desc, _quirks, _chip_quirks, \ + _flags, ...) \ + { BHND_CORE_MATCH(BHND_MFGID_ ## _vendor, \ + BHND_COREID_ ## _device, BHND_HWREV_ANY), _desc, _quirks, \ + _chip_quirks, _flags } + +#define BHND_MIPS_DEVICE(_device, _desc, _quirks, _chip_quirks, ...) \ + _BHND_DEVICE(MIPS, _device, _desc, _quirks, _chip_quirks, \ + ## __VA_ARGS__, 0) + +#define BHND_ARM_DEVICE(_device, _desc, _quirks, _chip_quirks, ...) \ + _BHND_DEVICE(ARM, _device, _desc, _quirks, _chip_quirks, \ + ## __VA_ARGS__, 0) + +#define BHND_DEVICE(_device, _desc, _quirks, _chip_quirks, ...) \ + _BHND_DEVICE(BCM, _device, _desc, _quirks, _chip_quirks, \ + ## __VA_ARGS__, 0) -#define BHND_DEVICE(_device, _desc, _quirks, ...) \ - _BHND_DEVICE(BCM, _device, _desc, _quirks, ## __VA_ARGS__, 0) - -#define BHND_DEVICE_END { BHND_CORE_MATCH_ANY, NULL, NULL, 0 } +#define BHND_DEVICE_END { BHND_CORE_MATCH_ANY, NULL, NULL, NULL, 0 } const char *bhnd_vendor_name(uint16_t vendor); const char *bhnd_port_type_name(bhnd_port_type port_type); @@ -365,6 +444,7 @@ bool bhnd_core_matches( bool bhnd_chip_matches( const struct bhnd_chipid *chipid, + const struct bhnd_board_info *binfo, const struct bhnd_chip_match *desc); bool bhnd_hwrev_matches(uint16_t hwrev, @@ -418,6 +498,12 @@ int bhnd_bus_generic_read_nvram_var( void *buf, size_t *size); const struct bhnd_chipid *bhnd_bus_generic_get_chipid(device_t dev, device_t child); +int bhnd_bus_generic_read_board_info(device_t dev, + device_t child, + struct bhnd_board_info *info); +int bhnd_bus_generic_get_nvram_var(device_t dev, + device_t child, const char *name, + void *buf, size_t *size); struct bhnd_resource *bhnd_bus_generic_alloc_resource (device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, @@ -472,6 +558,28 @@ bhnd_get_chipid(device_t dev) { }; /** + * Attempt to read the BHND board identification from the bhnd bus. + * + * This relies on NVRAM access, and will fail if a valid NVRAM device cannot + * be found, or is not yet attached. + * + * @param dev The parent of @p child. + * @param child The bhnd device requesting board info. + * @param[out] info On success, will be populated with the bhnd(4) device's + * board information. + * + * @retval 0 success + * @retval ENODEV No valid NVRAM source could be found. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +static inline int +bhnd_read_board_info(device_t dev, struct bhnd_board_info *info) +{ + return (BHND_BUS_READ_BOARD_INFO(device_get_parent(dev), dev, info)); +} + +/** * Determine an NVRAM variable's expected size. * * @param dev A bhnd bus child device. @@ -480,6 +588,7 @@ bhnd_get_chipid(device_t dev) { * * @retval 0 success * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ @@ -502,6 +611,7 @@ bhnd_nvram_getvarlen(device_t dev, const * @retval 0 success * @retval ENOENT The requested variable was not found. * @retval EINVAL If @p len does not match the actual variable size. + * @retval ENODEV No valid NVRAM source could be found. * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Tue May 17 00:08:43 2016 (r299995) +++ head/sys/dev/bhnd/bhnd_bus_if.m Tue May 17 00:23:46 2016 (r299996) @@ -38,10 +38,10 @@ INTERFACE bhnd_bus; HEADER { /* forward declarations */ + struct bhnd_board_info; struct bhnd_core_info; struct bhnd_chipid; struct bhnd_resource; - struct bhnd_bus_ctx; } CODE { @@ -54,7 +54,14 @@ CODE { { panic("bhnd_bus_get_chipid unimplemented"); } - + + static int + bhnd_bus_null_read_board_info(device_t dev, device_t child, + struct bhnd_board_info *info) + { + panic("bhnd_bus_read_boardinfo unimplemented"); + } + static device_t bhnd_bus_null_find_hostb_device(device_t dev) { @@ -99,7 +106,7 @@ CODE { bhnd_bus_null_get_nvram_var(device_t dev, device_t child, const char *name, void *buf, size_t *size) { - return (ENOENT); + return (ENODEV); } } @@ -177,6 +184,28 @@ METHOD const struct bhnd_chipid * get_ch } DEFAULT bhnd_bus_null_get_chipid; /** + * Attempt to read the BHND board identification from the parent bus. + * + * This relies on NVRAM access, and will fail if a valid NVRAM device cannot + * be found, or is not yet attached. + * + * @param dev The parent of @p child. + * @param child The bhnd device requesting board info. + * @param[out] info On success, will be populated with the bhnd(4) device's + * board information. + * + * @retval 0 success + * @retval ENODEV No valid NVRAM source could be found. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +METHOD int read_board_info { + device_t dev; + device_t child; + struct bhnd_board_info *info; +} DEFAULT bhnd_bus_null_read_board_info; + +/** * Reset the device's hardware core. * * @param dev The parent of @p child. @@ -400,6 +429,7 @@ METHOD int get_region_addr { * @retval ENOENT The requested variable was not found. * @retval ENOMEM If @p buf is non-NULL and a buffer of @p size is too * small to hold the requested value. + * @retval ENODEV No valid NVRAM source could be found. * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Tue May 17 00:08:43 2016 (r299995) +++ head/sys/dev/bhnd/bhnd_ids.h Tue May 17 00:23:46 2016 (r299996) @@ -1,10 +1,12 @@ /*- - * Copyright (C) 1999-2013, Broadcom Corporation + * Copyright (c) 2015-2016 Landon Fuller + * Copyright (c) 1999-2015, Broadcom Corporation * * This file is derived from the bcmdevs.h header contributed by Broadcom - * to Android's bcmdhd driver module, and the hndsoc.h header distributed with - * with Broadcom's initial brcm80211 Linux driver release, as contributed to - * the Linux staging repository. + * to Android's bcmdhd driver module, later revisions of bcmdevs.h distributed + * with the dd-wrt project, and the hndsoc.h header distributed with Broadcom's + * initial brcm80211 Linux driver release as contributed to the Linux staging + * repository. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,8 +20,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: bcmdevs.h 387183 2013-02-24 07:42:07Z $ - * * $FreeBSD$ */ @@ -669,22 +669,22 @@ /* board specific GPIO assignment, gpio 0-3 are also customer-configurable led */ -#define BHND_BOARD_GPIO_BTC3W_IN 0x850 /* bit 4 is RF_ACTIVE, bit 6 is STATUS, bit 11 is PRI */ -#define BHND_BOARD_GPIO_BTC3W_OUT 0x020 /* bit 5 is TX_CONF */ -#define BHND_BOARD_GPIO_BTCMOD_IN 0x010 /* bit 4 is the alternate BT Coexistence Input */ -#define BHND_BOARD_GPIO_BTCMOD_OUT 0x020 /* bit 5 is the alternate BT Coexistence Out */ -#define BHND_BOARD_GPIO_BTC_IN 0x080 /* bit 7 is BT Coexistence Input */ -#define BHND_BOARD_GPIO_BTC_OUT 0x100 /* bit 8 is BT Coexistence Out */ -#define BHND_BOARD_GPIO_PACTRL 0x200 /* bit 9 controls the PA on new 4306 boards */ -#define BHND_BOARD_GPIO_12 0x1000 /* gpio 12 */ -#define BHND_BOARD_GPIO_13 0x2000 /* gpio 13 */ -#define BHND_BOARD_GPIO_BTC4_IN 0x0800 /* gpio 11, coex4, in */ -#define BHND_BOARD_GPIO_BTC4_BT 0x2000 /* gpio 12, coex4, bt active */ -#define BHND_BOARD_GPIO_BTC4_STAT 0x4000 /* gpio 14, coex4, status */ -#define BHND_BOARD_GPIO_BTC4_WLAN 0x8000 /* gpio 15, coex4, wlan active */ -#define BHND_BOARD_GPIO_1_WLAN_PWR 0x02 /* throttle WLAN power on X21 board */ -#define BHND_BOARD_GPIO_3_WLAN_PWR 0x08 /* throttle WLAN power on X28 board */ -#define BHND_BOARD_GPIO_4_WLAN_PWR 0x10 /* throttle WLAN power on X19 board */ +#define BHND_GPIO_BOARD_BTC3W_IN 0x850 /* bit 4 is RF_ACTIVE, bit 6 is STATUS, bit 11 is PRI */ +#define BHND_GPIO_BOARD_BTC3W_OUT 0x020 /* bit 5 is TX_CONF */ +#define BHND_GPIO_BOARD_BTCMOD_IN 0x010 /* bit 4 is the alternate BT Coexistence Input */ +#define BHND_GPIO_BOARD_BTCMOD_OUT 0x020 /* bit 5 is the alternate BT Coexistence Out */ +#define BHND_GPIO_BOARD_BTC_IN 0x080 /* bit 7 is BT Coexistence Input */ +#define BHND_GPIO_BOARD_BTC_OUT 0x100 /* bit 8 is BT Coexistence Out */ +#define BHND_GPIO_BOARD_PACTRL 0x200 /* bit 9 controls the PA on new 4306 boards */ +#define BHND_GPIO_BOARD_12 0x1000 /* gpio 12 */ +#define BHND_GPIO_BOARD_13 0x2000 /* gpio 13 */ +#define BHND_GPIO_BOARD_BTC4_IN 0x0800 /* gpio 11, coex4, in */ +#define BHND_GPIO_BOARD_BTC4_BT 0x2000 /* gpio 12, coex4, bt active */ +#define BHND_GPIO_BOARD_BTC4_STAT 0x4000 /* gpio 14, coex4, status */ +#define BHND_GPIO_BOARD_BTC4_WLAN 0x8000 /* gpio 15, coex4, wlan active */ +#define BHND_GPIO_BOARD_1_WLAN_PWR 0x02 /* throttle WLAN power on X21 board */ +#define BHND_GPIO_BOARD_3_WLAN_PWR 0x08 /* throttle WLAN power on X28 board */ +#define BHND_GPIO_BOARD_4_WLAN_PWR 0x10 /* throttle WLAN power on X19 board */ #define BHND_GPIO_BTC4W_OUT_4312 0x010 /* bit 4 is BT_IODISABLE */ #define BHND_GPIO_BTC4W_OUT_43224 0x020 /* bit 5 is BT_IODISABLE */ @@ -700,11 +700,385 @@ #define BHND_CHIPC_MIN_SLOW_CLK 32 /* us Slow clock period */ #define BHND_CHIPC_XTAL_ON_DELAY 1000 /* us crystal power-on delay */ +/* Board Types */ +#define BHND_BOARD_BU4710 0x0400 +#define BHND_BOARD_VSIM4710 0x0401 +#define BHND_BOARD_QT4710 0x0402 + +#define BHND_BOARD_BU4309 0x040a +#define BHND_BOARD_BCM94309CB 0x040b +#define BHND_BOARD_BCM94309MP 0x040c +#define BHND_BOARD_BCM4309AP 0x040d + +#define BHND_BOARD_BCM94302MP 0x040e + +#define BHND_BOARD_BU4306 0x0416 +#define BHND_BOARD_BCM94306CB 0x0417 +#define BHND_BOARD_BCM94306MP 0x0418 + +#define BHND_BOARD_BCM94710D 0x041a +#define BHND_BOARD_BCM94710R1 0x041b +#define BHND_BOARD_BCM94710R4 0x041c +#define BHND_BOARD_BCM94710AP 0x041d + +#define BHND_BOARD_BU2050 0x041f + + +#define BHND_BOARD_BCM94309G 0x0421 + +#define BHND_BOARD_BU4704 0x0423 +#define BHND_BOARD_BU4702 0x0424 + +#define BHND_BOARD_BCM94306PC 0x0425 /* pcmcia 3.3v 4306 card */ + + +#define BHND_BOARD_BCM94702MN 0x0428 + +/* BCM4702 1U CompactPCI Board */ +#define BHND_BOARD_BCM94702CPCI 0x0429 + +/* BCM4702 with BCM95380 VLAN Router */ +#define BHND_BOARD_BCM95380RR 0x042a + +/* cb4306 with SiGe PA */ +#define BHND_BOARD_BCM94306CBSG 0x042b + +/* cb4306 with SiGe PA */ +#define BHND_BOARD_PCSG94306 0x042d + +/* bu4704 with sdram */ +#define BHND_BOARD_BU4704SD 0x042e + +/* Dual 11a/11g Router */ +#define BHND_BOARD_BCM94704AGR 0x042f + +/* 11a-only minipci */ +#define BHND_BOARD_BCM94308MP 0x0430 + + + +#define BHND_BOARD_BU4712 0x0444 +#define BHND_BOARD_BU4712SD 0x045d +#define BHND_BOARD_BU4712L 0x045f + +/* BCM4712 boards */ +#define BHND_BOARD_BCM94712AP 0x0445 +#define BHND_BOARD_BCM94712P 0x0446 + +/* BCM4318 boards */ +#define BHND_BOARD_BU4318 0x0447 +#define BHND_BOARD_CB4318 0x0448 +#define BHND_BOARD_MPG4318 0x0449 +#define BHND_BOARD_MP4318 0x044a +#define BHND_BOARD_SD4318 0x044b + +/* BCM4313 boards */ +#define BHND_BOARD_BCM94313BU 0x050f +#define BHND_BOARD_BCM94313HM 0x0510 +#define BHND_BOARD_BCM94313EPA 0x0511 +#define BHND_BOARD_BCM94313HMG 0x051C + +/* BCM63XX boards */ +#define BHND_BOARD_BCM96338 0x6338 +#define BHND_BOARD_BCM96348 0x6348 +#define BHND_BOARD_BCM96358 0x6358 +#define BHND_BOARD_BCM96368 0x6368 + +/* Another mp4306 with SiGe */ +#define BHND_BOARD_BCM94306P 0x044c + +/* mp4303 */ +#define BHND_BOARD_BCM94303MP 0x044e + +/* mpsgh4306 */ +#define BHND_BOARD_BCM94306MPSGH 0x044f + +/* BRCM 4306 w/ Front End Modules */ +#define BHND_BOARD_BCM94306MPM 0x0450 +#define BHND_BOARD_BCM94306MPL 0x0453 + +/* 4712agr */ +#define BHND_BOARD_BCM94712AGR 0x0451 + +/* pcmcia 4303 */ +#define BHND_BOARD_PC4303 0x0454 + +/* 5350K */ +#define BHND_BOARD_BCM95350K 0x0455 + +/* 5350R */ +#define BHND_BOARD_BCM95350R 0x0456 + +/* 4306mplna */ +#define BHND_BOARD_BCM94306MPLNA 0x0457 + +/* 4320 boards */ +#define BHND_BOARD_BU4320 0x0458 +#define BHND_BOARD_BU4320S 0x0459 +#define BHND_BOARD_BCM94320PH 0x045a + +/* 4306mph */ +#define BHND_BOARD_BCM94306MPH 0x045b + +/* 4306pciv */ +#define BHND_BOARD_BCM94306PCIV 0x045c + +#define BHND_BOARD_BU4712SD 0x045d + +#define BHND_BOARD_BCM94320PFLSH 0x045e + +#define BHND_BOARD_BU4712L 0x045f +#define BHND_BOARD_BCM94712LGR 0x0460 +#define BHND_BOARD_BCM94320R 0x0461 + +#define BHND_BOARD_BU5352 0x0462 + +#define BHND_BOARD_BCM94318MPGH 0x0463 + +#define BHND_BOARD_BU4311 0x0464 +#define BHND_BOARD_BCM94311MC 0x0465 +#define BHND_BOARD_BCM94311MCAG 0x0466 + +#define BHND_BOARD_BCM95352GR 0x0467 + +/* bcm95351agr */ +#define BHND_BOARD_BCM95351AGR 0x0470 + +/* bcm94704mpcb */ +#define BHND_BOARD_BCM94704MPCB 0x0472 + +/* 4785 boards */ +#define BHND_BOARD_BU4785 0x0478 + +/* 4321 boards */ +#define BHND_BOARD_BU4321 0x046b +#define BHND_BOARD_BU4321E 0x047c +#define BHND_BOARD_MP4321 0x046c +#define BHND_BOARD_CB2_4321 0x046d +#define BHND_BOARD_CB2_4321_AG 0x0066 +#define BHND_BOARD_MC4321 0x046e + +/* 4328 boards */ +#define BHND_BOARD_BU4328 0x0481 +#define BHND_BOARD_BCM4328SDG 0x0482 +#define BHND_BOARD_BCM4328SDAG 0x0483 +#define BHND_BOARD_BCM4328UG 0x0484 +#define BHND_BOARD_BCM4328UAG 0x0485 +#define BHND_BOARD_BCM4328PC 0x0486 +#define BHND_BOARD_BCM4328CF 0x0487 + +/* 4325 boards */ +#define BHND_BOARD_BCM94325DEVBU 0x0490 +#define BHND_BOARD_BCM94325BGABU 0x0491 + +#define BHND_BOARD_BCM94325SDGWB 0x0492 + +#define BHND_BOARD_BCM94325SDGMDL 0x04aa +#define BHND_BOARD_BCM94325SDGMDL2 0x04c6 +#define BHND_BOARD_BCM94325SDGMDL3 0x04c9 + +#define BHND_BOARD_BCM94325SDABGWBA 0x04e1 + +/* 4322 boards */ +#define BHND_BOARD_BCM94322MC 0x04a4 +#define BHND_BOARD_BCM94322USB 0x04a8 /* dualband */ +#define BHND_BOARD_BCM94322HM 0x04b0 +#define BHND_BOARD_BCM94322USB2D 0x04bf /* single band discrete front end */ + +/* 4312 boards */ +#define BHND_BOARD_BCM4312MCGSG 0x04b5 + +/* 4315 boards */ +#define BHND_BOARD_BCM94315DEVBU 0x04c2 +#define BHND_BOARD_BCM94315USBGP 0x04c7 +#define BHND_BOARD_BCM94315BGABU 0x04ca +#define BHND_BOARD_BCM94315USBGP41 0x04cb + +/* 4319 boards */ +#define BHND_BOARD_BCM94319DEVBU 0X04e5 +#define BHND_BOARD_BCM94319USB 0X04e6 +#define BHND_BOARD_BCM94319SD 0X04e7 + +/* 4716 boards */ +#define BHND_BOARD_BCM94716NR2 0x04cd + +/* 4319 boards */ +#define BHND_BOARD_BCM94319DEVBU 0X04e5 +#define BHND_BOARD_BCM94319USBNP4L 0X04e6 +#define BHND_BOARD_BCM94319WLUSBN4L 0X04e7 +#define BHND_BOARD_BCM94319SDG 0X04ea +#define BHND_BOARD_BCM94319LCUSBSDN4L 0X04eb +#define BHND_BOARD_BCM94319USBB 0x04ee +#define BHND_BOARD_BCM94319LCSDN4L 0X0507 +#define BHND_BOARD_BCM94319LSUSBN4L 0X0508 +#define BHND_BOARD_BCM94319SDNA4L 0X0517 +#define BHND_BOARD_BCM94319SDELNA4L 0X0518 +#define BHND_BOARD_BCM94319SDELNA6L 0X0539 +#define BHND_BOARD_BCM94319ARCADYAN 0X0546 +#define BHND_BOARD_BCM94319WINDSOR 0x0561 +#define BHND_BOARD_BCM94319MLAP 0x0562 +#define BHND_BOARD_BCM94319SDNA 0x058b +#define BHND_BOARD_BCM94319BHEMU3 0x0563 +#define BHND_BOARD_BCM94319SDHMB 0x058c +#define BHND_BOARD_BCM94319SDBREF 0x05a1 +#define BHND_BOARD_BCM94319USBSDB 0x05a2 + +/* 4329 boards */ +#define BHND_BOARD_BCM94329AGB 0X04b9 +#define BHND_BOARD_BCM94329TDKMDL1 0X04ba +#define BHND_BOARD_BCM94329TDKMDL11 0X04fc +#define BHND_BOARD_BCM94329OLYMPICN18 0X04fd +#define BHND_BOARD_BCM94329OLYMPICN90 0X04fe +#define BHND_BOARD_BCM94329OLYMPICN90U 0X050c +#define BHND_BOARD_BCM94329OLYMPICN90M 0X050b +#define BHND_BOARD_BCM94329AGBF 0X04ff +#define BHND_BOARD_BCM94329OLYMPICX17 0X0504 +#define BHND_BOARD_BCM94329OLYMPICX17M 0X050a +#define BHND_BOARD_BCM94329OLYMPICX17U 0X0509 +#define BHND_BOARD_BCM94329OLYMPICUNO 0X0564 +#define BHND_BOARD_BCM94329MOTOROLA 0X0565 +#define BHND_BOARD_BCM94329OLYMPICLOCO 0X0568 + +/* 4336 SDIO board types */ +#define BHND_BOARD_BCM94336SD_WLBGABU 0x0511 +#define BHND_BOARD_BCM94336SD_WLBGAREF 0x0519 +#define BHND_BOARD_BCM94336SDGP 0x0538 +#define BHND_BOARD_BCM94336SDG 0x0519 +#define BHND_BOARD_BCM94336SDGN 0x0538 +#define BHND_BOARD_BCM94336SDGFC 0x056B + +/* 4330 SDIO board types */ +#define BHND_BOARD_BCM94330SDG 0x0528 +#define BHND_BOARD_BCM94330SD_FCBGABU 0x052e +#define BHND_BOARD_BCM94330SD_WLBGABU 0x052f +#define BHND_BOARD_BCM94330SD_FCBGA 0x0530 +#define BHND_BOARD_BCM94330FCSDAGB 0x0532 +#define BHND_BOARD_BCM94330OLYMPICAMG 0x0549 +#define BHND_BOARD_BCM94330OLYMPICAMGEPA 0x054F +#define BHND_BOARD_BCM94330OLYMPICUNO3 0x0551 +#define BHND_BOARD_BCM94330WLSDAGB 0x0547 +#define BHND_BOARD_BCM94330CSPSDAGBB 0x054A + +/* 43224 boards */ +#define BHND_BOARD_BCM943224X21 0x056e +#define BHND_BOARD_BCM943224X21_FCC 0x00d1 +#define BHND_BOARD_BCM943224X21B 0x00e9 +#define BHND_BOARD_BCM943224M93 0x008b +#define BHND_BOARD_BCM943224M93A 0x0090 +#define BHND_BOARD_BCM943224X16 0x0093 +#define BHND_BOARD_BCM94322X9 0x008d +#define BHND_BOARD_BCM94322M35e 0x008e + +/* 43228 Boards */ +#define BHND_BOARD_BCM943228BU8 0x0540 +#define BHND_BOARD_BCM943228BU9 0x0541 +#define BHND_BOARD_BCM943228BU 0x0542 +#define BHND_BOARD_BCM943227HM4L 0x0543 +#define BHND_BOARD_BCM943227HMB 0x0544 +#define BHND_BOARD_BCM943228HM4L 0x0545 +#define BHND_BOARD_BCM943228SD 0x0573 + +/* 43239 Boards */ +#define BHND_BOARD_BCM943239MOD 0x05ac +#define BHND_BOARD_BCM943239REF 0x05aa + +/* 4331 boards */ +#define BHND_BOARD_BCM94331X19 0x00D6 /* X19B */ +#define BHND_BOARD_BCM94331X28 0x00E4 /* X28 */ +#define BHND_BOARD_BCM94331X28B 0x010E /* X28B */ +#define BHND_BOARD_BCM94331PCIEBT3Ax BCM94331X28 +#define BHND_BOARD_BCM94331X12_2G 0x00EC /* X12 2G */ +#define BHND_BOARD_BCM94331X12_5G 0x00ED /* X12 5G */ +#define BHND_BOARD_BCM94331X29B 0x00EF /* X29B */ +#define BHND_BOARD_BCM94331X29D 0x010F /* X29D */ +#define BHND_BOARD_BCM94331CSAX BCM94331X29B +#define BHND_BOARD_BCM94331X19C 0x00F5 /* X19C */ +#define BHND_BOARD_BCM94331X33 0x00F4 /* X33 */ +#define BHND_BOARD_BCM94331BU 0x0523 +#define BHND_BOARD_BCM94331S9BU 0x0524 +#define BHND_BOARD_BCM94331MC 0x0525 +#define BHND_BOARD_BCM94331MCI 0x0526 +#define BHND_BOARD_BCM94331PCIEBT4 0x0527 +#define BHND_BOARD_BCM94331HM 0x0574 +#define BHND_BOARD_BCM94331PCIEDUAL 0x059B +#define BHND_BOARD_BCM94331MCH5 0x05A9 +#define BHND_BOARD_BCM94331CS 0x05C6 +#define BHND_BOARD_BCM94331CD 0x05DA + +/* 4314 Boards */ +#define BHND_BOARD_BCM94314BU 0x05b1 + +/* 53572 Boards */ +#define BHND_BOARD_BCM953572BU 0x058D +#define BHND_BOARD_BCM953572NR2 0x058E +#define BHND_BOARD_BCM947188NR2 0x058F +#define BHND_BOARD_BCM953572SDRNR2 0x0590 + +/* 43236 boards */ +#define BHND_BOARD_BCM943236OLYMPICSULLEY 0x594 +#define BHND_BOARD_BCM943236PREPROTOBLU2O3 0x5b9 +#define BHND_BOARD_BCM943236USBELNA 0x5f8 + +/* 4314 Boards */ +#define BHND_BOARD_BCM94314BUSDIO 0x05c8 +#define BHND_BOARD_BCM94314BGABU 0x05c9 +#define BHND_BOARD_BCM94314HMEPA 0x05ca +#define BHND_BOARD_BCM94314HMEPABK 0x05cb +#define BHND_BOARD_BCM94314SUHMEPA 0x05cc +#define BHND_BOARD_BCM94314SUHM 0x05cd +#define BHND_BOARD_BCM94314HM 0x05d1 + +/* 4334 Boards */ +#define BHND_BOARD_BCM94334FCAGBI 0x05df +#define BHND_BOARD_BCM94334WLAGBI 0x05dd + +/* 4335 Boards */ +#define BHND_BOARD_BCM94335X52 0x0114 + +/* 4345 Boards */ +#define BHND_BOARD_BCM94345 0x0687 + +/* 4360 Boards */ +#define BHND_BOARD_BCM94360X52C 0X0117 +#define BHND_BOARD_BCM94360X52D 0X0137 +#define BHND_BOARD_BCM94360X29C 0X0112 +#define BHND_BOARD_BCM94360X29CP2 0X0134 +#define BHND_BOARD_BCM94360X51 0x0111 +#define BHND_BOARD_BCM94360X51P2 0x0129 +#define BHND_BOARD_BCM94360X51A 0x0135 +#define BHND_BOARD_BCM94360X51B 0x0136 +#define BHND_BOARD_BCM94360CS 0x061B +#define BHND_BOARD_BCM94360J28_D11AC2G 0x0c00 +#define BHND_BOARD_BCM94360J28_D11AC5G 0x0c01 +#define BHND_BOARD_BCM94360USBH5_D11AC5G 0x06aa + +/* 4350 Boards */ +#define BHND_BOARD_BCM94350X52B 0X0116 +#define BHND_BOARD_BCM94350X14 0X0131 + +/* 43217 Boards */ +#define BHND_BOARD_BCM943217BU 0x05d5 +#define BHND_BOARD_BCM943217HM2L 0x05d6 +#define BHND_BOARD_BCM943217HMITR2L 0x05d7 + +/* 43142 Boards */ +#define BHND_BOARD_BCM943142HM 0x05e0 + /* 43341 Boards */ -#define BCM943341WLABGS_SSID 0x062d +#define BHND_BOARD_BCM943341WLABGS 0x062d /* 43342 Boards */ -#define BCM943342FCAGBI_SSID 0x0641 +#define BHND_BOARD_BCM943342FCAGBI 0x0641 + +/* 43602 Boards, unclear yet what boards will be created. */ +#define BHND_BOARD_BCM943602RSVD1 0x06a5 +#define BHND_BOARD_BCM943602RSVD2 0x06a6 +#define BHND_BOARD_BCM943602X87 0X0133 +#define BHND_BOARD_BCM943602X238 0X0132 + +/* 4354 board types */ +#define BHND_BOARD_BCM94354WLSAGBI 0x06db +#define BHND_BOARD_BCM94354Z 0x0707 /* # of GPIO pins */ #define BHND_BCM43XX_GPIO_NUMPINS 32 Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue May 17 00:08:43 2016 (r299995) +++ head/sys/dev/bhnd/bhnd_subr.c Tue May 17 00:23:46 2016 (r299996) @@ -41,9 +41,18 @@ __FBSDID("$FreeBSD$"); #include +#include "nvram/bhnd_nvram.h" + +#include "bhnd_chipc_if.h" + +#include "bhnd_nvram_if.h" +#include "bhnd_nvram_map.h" + #include "bhndreg.h" #include "bhndvar.h" +static device_t find_nvram_child(device_t dev); + /* BHND core device description table. */ static const struct bhnd_core_desc { uint16_t vendor; @@ -427,6 +436,7 @@ bhnd_core_matches(const struct bhnd_core * Return true if the @p chip matches @p desc. * * @param chip A bhnd chip identifier. + * @param board The bhnd board info, or NULL if unavailable. * @param desc A match descriptor to compare against @p chip. * * @retval true if @p chip matches @p match @@ -434,8 +444,19 @@ bhnd_core_matches(const struct bhnd_core */ bool bhnd_chip_matches(const struct bhnd_chipid *chip, + const struct bhnd_board_info *board, const struct bhnd_chip_match *desc) { + /* Explicit wildcard match */ + if (desc->match_any) + return (true); + + /* If board_info is missing, but required, we cannot match. */ + if (BHND_CHIP_MATCH_REQ_BOARD_INFO(desc) && board == NULL) + return (false); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 17 00:24:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74DACB3D7BF; Tue, 17 May 2016 00:24:54 +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 473CC1788; Tue, 17 May 2016 00:24:54 +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 u4H0OrXL005520; Tue, 17 May 2016 00:24:53 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H0Orra005519; Tue, 17 May 2016 00:24:53 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201605170024.u4H0Orra005519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Tue, 17 May 2016 00:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299997 - head/sys/boot/i386/zfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:24:54 -0000 Author: peter Date: Tue May 17 00:24:53 2016 New Revision: 299997 URL: https://svnweb.freebsd.org/changeset/base/299997 Log: Attempt to fix r299660: slba is used only for the GPT case. elba is used if either GPT or LOADER_GELI_SUPPORT is enabled. Modified: head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Tue May 17 00:23:46 2016 (r299996) +++ head/sys/boot/i386/zfsboot/zfsboot.c Tue May 17 00:24:53 2016 (r299997) @@ -397,10 +397,12 @@ probe_drive(struct dsk *dsk) struct gpt_hdr hdr; struct gpt_ent *ent; unsigned part, entries_per_sec; + daddr_t slba; #endif -#ifdef LOADER_GELI_SUPPORT - daddr_t slba, elba; +#if defined(GPT) || defined(LOADER_GELI_SUPPORT) + daddr_t elba; #endif + struct dos_partition *dp; char *sec; unsigned i; From owner-svn-src-all@freebsd.org Tue May 17 00:27:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A520B3D871; Tue, 17 May 2016 00:27:19 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D06919C6; Tue, 17 May 2016 00:27:19 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H0RI8s005707; Tue, 17 May 2016 00:27:18 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H0RIP9005706; Tue, 17 May 2016 00:27:18 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201605170027.u4H0RIP9005706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 17 May 2016 00:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299998 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:27:19 -0000 Author: sjg Date: Tue May 17 00:27:18 2016 New Revision: 299998 URL: https://svnweb.freebsd.org/changeset/base/299998 Log: Use != 0 to be clear Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue May 17 00:24:53 2016 (r299997) +++ head/usr.bin/kdump/kdump.c Tue May 17 00:27:18 2016 (r299998) @@ -298,7 +298,7 @@ main(int argc, char *argv[]) m = malloc(size = 1025); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); - if (strcmp(tracefile, "-")) + if (strcmp(tracefile, "-") != 0) if (!freopen(tracefile, "r", stdin)) err(1, "%s", tracefile); From owner-svn-src-all@freebsd.org Tue May 17 00:27:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2346BB3D8A3; Tue, 17 May 2016 00:27:30 +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 EF7B31B1E; Tue, 17 May 2016 00:27:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id f89so4122914ioi.0; Mon, 16 May 2016 17:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=buih/q+fsuKV5wpaPESUmssAI6x9RT+nSoEwHq4g5lc=; b=k2GwWeG2BNXE03gRlPuIShw8OrZC8ujYFCFhATpMpzT2jNaxqlp0ZopzRnsJp/vFJc XmcAB/mOmRkSg+g44UqPTSzLjtyrvG5DGhFE5cDZILJRCv4F8fd7FeLlIPZM07X0QFf0 tl5MxoPC/tjc2Pk9W59hbEQ2ITU2bn7/WJgh2z6Gyo13+i/gsaJQki8sIBFv9lfwgp7h xJ0DHzVfQqZnL5+LgbUyRkAzyidZ6JXh1x0mdtaN9MlMZS7j5gGVZna5U3yDZ9ENHfQx NS54ZEksaXAMeskK6dBE43QXrGECguQ18Pvq7D9PU4GQNMUlrOtXbD93uJDBFqgC8Qkq GvbA== 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:date :message-id:subject:from:to:cc; bh=buih/q+fsuKV5wpaPESUmssAI6x9RT+nSoEwHq4g5lc=; b=Z9GWiVnE+ydyx/E7iuHSxnwZox+Gz3+QER3BHMH5C1apeGlxq8SueCcEN29mM3r8Zz OtPDlhJBSIOkDtvI5IoS+j6JoWmI00LNLTQT68OHv0YApdBhwmZ/UQDL+PKRcA8/dFrQ 346Q9or2BIbO3L+2VM4CGnxYizvTIAk0NY+oUUDzvaxKmnRm/EDDmTLK7glcIgdfhB8M Jdlj/SqvmhFiuo8J6Gwau7hFJoGfTj0Yz+M0ur+j5+kkHUquOmbX1+fQKyFtCu4jJvQY Ol1sw3xENxaom6SFTxHyHQVECHterzrz/lyODApr77YywfPpr1xy3KxYiGNhU8dasKSk L0Ew== X-Gm-Message-State: AOPr4FW7AOs7E1iMTGJXCSvTaKNXAYTMgqjcjSyhfVoO63JZdgBA7ahg/WEy5LOnvvrObeEdxe8nGgVgu/jTDw== MIME-Version: 1.0 X-Received: by 10.107.16.137 with SMTP id 9mr21411573ioq.75.1463444848983; Mon, 16 May 2016 17:27:28 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Mon, 16 May 2016 17:27:28 -0700 (PDT) In-Reply-To: <201605121822.u4CIMYVg007108@repo.freebsd.org> References: <201605121822.u4CIMYVg007108@repo.freebsd.org> Date: Mon, 16 May 2016 17:27:28 -0700 Message-ID: Subject: Re: svn commit: r299556 - head/sys/dev/ixl From: Adrian Chadd To: Eric Joyner 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:27:30 -0000 Hi, ixl doesn't build on -HEAD. The netmap ixl bits also aren't building for me. What gives? :) -a From owner-svn-src-all@freebsd.org Tue May 17 00:30:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F9ACB3D995; Tue, 17 May 2016 00:30: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 E34BD1D64; Tue, 17 May 2016 00:30:35 +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 u4H0UZfX005958; Tue, 17 May 2016 00:30:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H0UZWU005957; Tue, 17 May 2016 00:30:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170030.u4H0UZWU005957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 00:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299999 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:30:36 -0000 Author: adrian Date: Tue May 17 00:30:34 2016 New Revision: 299999 URL: https://svnweb.freebsd.org/changeset/base/299999 Log: [mips] add urtwn and otus NIC modules. I'm using this platform for testing USB wifi on MIPS. Modified: head/sys/mips/conf/AR934X_BASE Modified: head/sys/mips/conf/AR934X_BASE ============================================================================== --- head/sys/mips/conf/AR934X_BASE Tue May 17 00:27:18 2016 (r299998) +++ head/sys/mips/conf/AR934X_BASE Tue May 17 00:30:34 2016 (r299999) @@ -20,7 +20,7 @@ files "../atheros/files.ar71xx" hints "AR934X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_vlan if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc ipfw ipfw_nat libalias" +makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_vlan if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc ipfw ipfw_nat libalias urtwn urtwnfw otus otusfw" # makeoptions MODULES_OVERRIDE="" options DDB From owner-svn-src-all@freebsd.org Tue May 17 00:31:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB1BB3DACD; Tue, 17 May 2016 00:31:39 +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 F13EA1F83; Tue, 17 May 2016 00:31:38 +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 u4H0VcCt008026; Tue, 17 May 2016 00:31:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H0VcC6008025; Tue, 17 May 2016 00:31:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170031.u4H0VcC6008025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 00:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300000 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:31:39 -0000 Author: adrian Date: Tue May 17 00:31:37 2016 New Revision: 300000 URL: https://svnweb.freebsd.org/changeset/base/300000 Log: [mips] also add otus/urtwn USB modules. I'm using both AR933x (because the boards fit in small boxes) as well as AR934x for doing USB wifi testing on MIPS. So far so good, for both of them. Modified: head/sys/mips/conf/AR933X_BASE Modified: head/sys/mips/conf/AR933X_BASE ============================================================================== --- head/sys/mips/conf/AR933X_BASE Tue May 17 00:30:34 2016 (r299999) +++ head/sys/mips/conf/AR933X_BASE Tue May 17 00:31:37 2016 (r300000) @@ -20,7 +20,7 @@ files "../atheros/files.ar71xx" hints "AR933X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw" +makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw urtwn urtwnfw otus otusfw" options DDB options KDB From owner-svn-src-all@freebsd.org Tue May 17 00:32:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCD07B3DB2C; Tue, 17 May 2016 00:32:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F5361259; Tue, 17 May 2016 00:32:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H0WajH008755; Tue, 17 May 2016 00:32:36 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H0Waj1008754; Tue, 17 May 2016 00:32:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605170032.u4H0Waj1008754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 17 May 2016 00:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300001 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:32:37 -0000 Author: bz Date: Tue May 17 00:32:36 2016 New Revision: 300001 URL: https://svnweb.freebsd.org/changeset/base/300001 Log: Mark the unused arguments of various SYSINIT functions __unused. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Tue May 17 00:31:37 2016 (r300000) +++ head/sys/net/vnet.c Tue May 17 00:32:36 2016 (r300001) @@ -304,7 +304,7 @@ vnet_destroy(struct vnet *vnet) * Boot time initialization and allocation of virtual network stacks. */ static void -vnet_init_prelink(void *arg) +vnet_init_prelink(void *arg __unused) { rw_init(&vnet_rwlock, "vnet_rwlock"); @@ -316,7 +316,7 @@ SYSINIT(vnet_init_prelink, SI_SUB_VNET_P vnet_init_prelink, NULL); static void -vnet0_init(void *arg) +vnet0_init(void *arg __unused) { /* Warn people before take off - in case we crash early. */ @@ -333,7 +333,7 @@ vnet0_init(void *arg) SYSINIT(vnet0_init, SI_SUB_VNET, SI_ORDER_FIRST, vnet0_init, NULL); static void -vnet_init_done(void *unused) +vnet_init_done(void *unused __unused) { curvnet = NULL; From owner-svn-src-all@freebsd.org Tue May 17 00:34:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C986AB3DBBA; Tue, 17 May 2016 00:34:40 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0114.outbound.protection.outlook.com [157.56.111.114]) (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 126E813D2; Tue, 17 May 2016 00:34:39 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=g7e4FsJeAoULxB9Qph3uUMClAsrrsuv4KGF37VHqM+E=; b=MXqPrJofc+pwJ5PSmdUKnY6jktyHbWPHayNjjG8xAXpJN0ugSvdnHcv9gIxpnAi8QUJYXewysq1kvwkIQ2+Df9mkfUXL7z4zAhi2KIbcVIrX5u5IDjghY9eEbc8lc/fDluUUJ37TZMDz9Mh7yRTWBmkTHELm2ij9/+5mO4Je3f8= Received: from CO2PR05CA046.namprd05.prod.outlook.com (10.141.241.174) by CO2PR05MB2488.namprd05.prod.outlook.com (10.166.95.146) with Microsoft SMTP Server (TLS) id 15.1.497.12; Tue, 17 May 2016 00:34:32 +0000 Received: from BN1BFFO11FD055.protection.gbl (2a01:111:f400:7c10::1:171) by CO2PR05CA046.outlook.office365.com (2a01:111:e400:1429::46) with Microsoft SMTP Server (TLS) id 15.1.497.12 via Frontend Transport; Tue, 17 May 2016 00:34:32 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.18) by BN1BFFO11FD055.mail.protection.outlook.com (10.58.145.10) with Microsoft SMTP Server (TLS) id 15.1.492.8 via Frontend Transport; Tue, 17 May 2016 00:34:31 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 16 May 2016 17:26:02 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u4H0Q2582887; Mon, 16 May 2016 17:26:02 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 7C142385541; Mon, 16 May 2016 17:26:02 -0700 (PDT) To: Ngie Cooper CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Subject: Re: svn commit: r299995 - head/usr.bin/kdump In-Reply-To: References: <201605170008.u4H08hEB098976@repo.freebsd.org> Comments: In-reply-to: Ngie Cooper message dated "Mon, 16 May 2016 17:20:38 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <98692.1463444762.1@kaos.jnpr.net> Date: Mon, 16 May 2016 17:26:02 -0700 Message-ID: <98693.1463444762@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.18; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(24454002)(199003)(189002)(9170700003)(47776003)(5003600100002)(105596002)(81166006)(87936001)(4326007)(2906002)(106466001)(19580395003)(2810700001)(50226002)(117636001)(46406003)(19580405001)(9686002)(97756001)(107886002)(5008740100001)(110136002)(6806005)(1411001)(92566002)(558084003)(4001430100002)(2950100001)(1220700001)(586003)(11100500001)(8936002)(77096005)(23726003)(53416004)(76506005)(8676002)(189998001)(86362001)(76176999)(50986999)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR05MB2488; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD055; 1:hEUY7zyXKY7wK4aA9MlRLeM9pRsdOPGXOFqeFnMY0gH5eWgCZilqErXQV/G7SEc7763XFScikrb9vz3R4fbdgu0pbwlbSl3WbXialQoKR0AjWT8IusSvGB0NrbO8Xi4t7BFASInUGTLyrTlwz2n8CUPTWy5lksCVDI2oLn+fh2abP4hDARltKp4Ay96XG5n56neVuXE5eHfRxZw0ZWKlmCP9ZedbpWBwCmvmivFYzyNN7dk9H32OmkaMe7VFh66eEPqiTYhsiYGpcbT9lbJS2m/MyGhnFchgJ94yek7gpB0VnWOzZg+XTdYipiMtfw/bmpqo2jcoBZ1Em9v436yGZmExi3ExLVxAdYcC8unWgfevMln4qPuPT1QkBdIRkQwAH2bt96f3z3Y5hg6NFs7Il2UxS9XKF8Fps//BFCgFWbt2E+dVjp1+sIvQMFBh5mLA/LejFIULnkzvSSef1PIffToG2E4XjoEJyx9Rwkou8o1w8a56zNl7zDOk8QhNs5t1ipvs0ODv+q0W1Y3eqThKkt4bSUKmT0PMc9jt/dEee1c= X-MS-Office365-Filtering-Correlation-Id: 17c2d9d6-d201-4785-0895-08d37deb03aa X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2488; 2:9DjEtu/72MKD7MamHFioTM7GS5B1B8W+Cr865jgqhyVwt0m+sCDmfSC8XQM/5DFpgyoQuz5pKqanjBaswbox47rYcO/fpjtbbyjqY18lHkNO2tkdwi422qe3I3wjuw1lwVhwpHdmywy1sn9RVHh3DhLFBA9e5HtBi4ua+zG5QgFCwl9XGSiNA+qxbevfddVB; 3:NU7vOPRihpbekpnaLFKGWel0uBn/YZdCjpaDPkus3zO7CKGqRhqotmk/OeYNf3RFVMJiL7imi9itYBuyUdOj3EXA5egghDm2JklI17uwm9yevNUMdvQvTTTwG97YFYo0wpB4C7txBdx6GGogPSrZFJQ7oX27IhwqRtqfg15AoIOjVZqyp6VyriBMnPZ1Cik41KIqoXfSkTvCCEkCeViacnYkXW8c8EWUZ/9E7rn+Lyk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR05MB2488; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2488; 25:RBVq0skuhgm9RMg9IzuCVaDrOj+C2RRQ92B8goBjmEqwZJcwFQ9HTySNbNUMiDqaCaDCRj7mEGNw5e3goR54YlAl7sHoj2mRwJ0cxAyHpjk1rEXgn5LdzUQ4gxQeJ4oFB+f7qEz7WLGck7yqRiuCMk4jKHSaPGHnr3L8rcGKIkSJwoSxLa0BeooTxHNxBBBG9ERhIYIN6xVsODLdKuplUZvj7dA0VFXvHcgxtGK/voWmJzcj+KunrVX+kSqRjNt8fpRq7cr1759ISwcVMiEQSvuTCpNMSi3MNIksUlCO7dgXWeBl7i+tKnfNAvD3fgcn+PFulasfIclSkdEHy+6UdrdF89gGRnLcWefd3WP+CX7mF3cd8oCKsI71H2pMVOGufboLiBl3FJL/ao3oQy1rWfRTMZNwlvnlZcalwONl3EFwpG26ztLw9fYy7Ac4PaoPYFk2lfEgVGsnL2dgRHXPzCHnxukkOTN+9iINELRrbfunkgsbwbDz0JqTFZbr7YYzI7BulFhwdKxdOXD0O4NxTztN9D770MBNd4h7w10ptZKzguqnauYu6wITXR8w1WvQr7MVUyvdxsGCFU8IOWLzUzcTf2ni2UXYqyHnZOSadDOHPyHCfUXrB6QY7pHiAzT32Uyiklx5FFiA13QIq1TJcOMCQmvrr3vDNk19Jq4IgnExMXa/NCukxr1nFWOccwjqvObrtXUQ0uygct8qbG6mma2t6nwG9mzatXuZ38XhUx0= X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2488; 20:w+VJA2k8fh6n1Z1M4FjloakbGzoonYds7ht/nm33lN8gT3WQ1oZy5JwDA4PzcJe5v0JQYq7JpYXIHh9eOGoWW3fH7ZreCnYYntW8UzVUO4+QgUL2nCE784qWAkNxDIDt27inpPLsH8llyGXoZFBzEtIqYU+ABW9xem84VCHg7Yy0UDFUH3+R7ByntrmFWfttQKjJbWVut94rz3sQ9H8/OX4ln9oESvHbed1IB5ik3Iodtb1eLnxvQWCX4/3aXwQ3t07/iU8r+5vM2PF77wqDd5V/HFD6gIQXy8QzCSCPNgCVYFsntr2FDIAA0p8+yzQMogZYLMzCLkVx+wKAvEidV6aw3L1of2JDg8AwAt43QT1H57KbtFVhIvNPz+ZXVuDKMxU4e8km7yUHqDm+I9AzAzBdELNdq3dKdwjDo2clbRW3lLRrNO0u8AzR2Lc2VBQ3lEJ/+E55woWjqvAa7GrhV3AWZXC57M73FaEgX9iyfqVUry2EtqU26oSA8eswvCMI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13023025)(8121501046)(5005006)(13015025)(13024025)(13018025)(10201501046)(3002001)(6055026); SRVR:CO2PR05MB2488; BCL:0; PCL:0; RULEID:; SRVR:CO2PR05MB2488; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2488; 4:YhhIhV4/QJCWtH0D92At80pKbxN/Yw3JSsD29Ad/t3R3KVfK42MC4IdE69wBSzJT04Oq1kpwyTs+7sbhKMMlEjqcE/BK08FuqVwRTEMykcFT4cObMnaQhldqbsVBY0Bxx3a8bTxXXBPfA1Q5kBny+DOBXNV8mYzbfh9SWNyYmmwBgfK2iHEWfw/+PblxmIa6yXw1XGgj8j3tV4x92GrSM/O6Z18uFZRla6K5T3V0hJxQ0y5eU7n2wyzD06IyH8d6isTE+CcmtlK/DIOIf2IO7IhhshiEQ0Ic7yliFSRznmaV/qeEee+J60ULE2iuDW/lfJ4OmVRD3++ZUqVPvzqJmRNsckRn9WrcZMTbvhp7I+ClR7xyCiX5HbQoNc7YWNjDrzHtqVrLK/fqa+g5tQ1bQ/pyKtZahdDVHxKND+4H9WPHttEA33uCyJojmpV2U3QP/5ZevGdaM9fEMRy47ltiUbZ6uxUDK9dmafV2/sq5CpA= X-Forefront-PRVS: 0945B0CC72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR05MB2488; 23:7HISvTxoYNp0vIxy9o4k6+6hPF9MmzD6ks4Qp0Koy?= =?us-ascii?Q?ICqmbLUWCCZ0DaT1eUdLwStKgeAcln6A42Nyp5+a1foKb24HCCqnoSrg6K8v?= =?us-ascii?Q?mGnqcC5AyWS7/3SvSSNd8hsuPn5GnsnXEOSWdMn+FM7nA47gwjFllWYIODBT?= =?us-ascii?Q?uChOK6uYEV6rJA2WN+Xns7vBQXgYMnFHqgoIpjmx84VkqxLh64S6M4mxuou1?= =?us-ascii?Q?O5tcBc0XK4W4skJTaomkr1BYhjgnySt0Ba9PwHilMDP0toXlcVabREjEHTZB?= =?us-ascii?Q?6dXs3ScTtoWFE8ryNniyuG7IhxRT8tRNtdA7yj/T8mj5kt3o5Qpnw71e88mk?= =?us-ascii?Q?8Z99Qrb+hO5Csm1xFhkA3wXGYx5a59yk1XmlGoqNQJ9arTv/9G3/g4Ue/zeY?= =?us-ascii?Q?q/acTMggHRkcukQS9Yu+6v6BrAT6cqlRYmEpvjg94X+fle1qbvK6aNpHpRCi?= =?us-ascii?Q?W3/l/yoLCoWllJaGhjXKBKXMgPNJIEV8v4CQy3kmEz/D5PY5xt5LKTj9xf2A?= =?us-ascii?Q?SwfyrKulwFdpExpWkICO9cldHivy5km0+sTI4bz4jL0T253cW9ssVT9IJkoq?= =?us-ascii?Q?XiuTHAEzd8f7pQ+mZC4pjuSfzgPb4rPeqzBJQQD3PniWtoUb/Af68qdZo8AF?= =?us-ascii?Q?s3bXaLdTS3zuxfv4UUk91NFN4wykwxL1JC9zV7wEqVJJsJtWLSSrZj5AJBq2?= =?us-ascii?Q?mLnmgZHlkmqTy2zawoFY8BYZ22zUKyURO7G7tcLEnO94mrrmWlksNfCSIAP8?= =?us-ascii?Q?x/lSBfQQHGEU0+GohTuY/vhCXYR+BHeGiAkAxY+2cVlPavBFvrSrgCxQI2tD?= =?us-ascii?Q?EuSKKEl+V52QpCbDzFS8DQVaOvbq8RfpTxkAf4KP2/9GA0vTYPCW9HAh9d8Y?= =?us-ascii?Q?CrHTdB3ZBojzQCeGjxVwyQcenZtcFty864y09uGFdDpJb8Z7Xfq7X+An2URK?= =?us-ascii?Q?kvZKnrgcqhLO+LbcPVYCyk2jhhIx6aH/LKuoaWLwelsJbtOF5Xkid2dkZ45w?= =?us-ascii?Q?6lMaP6pAixhzRVuxjE8Zd2oG49f/Ec8+BEGrbtPhGzMIjmFw2lCkqpvTe042?= =?us-ascii?Q?2vpAobDsRRP/IMrRQ9K1guf8Ys3W1HTE1ThpskwAvaT0RG28QXHA2VJ2QZ6R?= =?us-ascii?Q?RIbj9OzN94fJHaL2ZZZeeylgnhmnsfB4QmMQHfj7Pto8JqAA5y6gg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2488; 5:ZrqDCjb7QH8c1DK0eps8moPaFRhL1FW2VxTswAu/SbY4ASNmEm5P9R+ZkaGOtsMVcOdEQKB7o9qfb2VNd4G/v0DFRO4BFjlz17SZ1P1zsMq0aFhxSWU0zXJedTFko6/ebgRFDdpFz4ak1MHXp3hRsg==; 24:+QSLDVmOGqCzVGH5n8jiBwQ92e9JlJqrIYDCCC2AsN+fKt8r0F3GZRVZ9UlpcScy2gZ1TKNnmxBA6BkzfLxKwIEMomabmDq/RTzNcJ8vZ2Y=; 7:fuPE7jbCrCymssFsCtb2XdrfSamnRIOBfACY+pBWTX8WBuuAHmNsGzAaw2RbrzW4XiDJX3pov7MeuWgz+nzYl9/moR6+NTfdIJuPWwAoVqMOQbFyzJ33iqh/0YIlluDjmGt2s2gnkbfaQICbGEqC+t/GO7piU9YCHi1ljEkZVocl3QOzcHBAnQc8IEub2rQ3 SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2016 00:34:31.7889 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB2488 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:34:40 -0000 Ngie Cooper wrote: > Please use `!= 0` for explicitness. Sure. From owner-svn-src-all@freebsd.org Tue May 17 00:42:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C12F8B3DE4F; Tue, 17 May 2016 00:42:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::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 804711A76; Tue, 17 May 2016 00:42:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x230.google.com with SMTP id x7so456977qkd.3; Mon, 16 May 2016 17:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=rpkmFd9kpxUF2nMhSb5mmkNkOlkaDLyyB/fmlTkO62Q=; b=eMBE8f6yrFzTDYj2Hi7EWWJNgevyLU+2cpwmin/29j700vzFAq/NohfL6O1N1vVp9U vrKOaEtFpe4f7iccFJAC4RNZ+keg08eHpFkT3gUuONpNLSNuwcgqxKY9I9TUm7NMdSK6 l0Hb+yOquv8rXVQUhwqmBDKWy9fsr7CTDlg0n59oGkJcwCH3a4kYXBY7x45vS5rnVekQ zAIyHkWaRRYUTfRaEx8NNrvl4lPOkGBXFBsVaMBNw8lJSdt3YCO8pONC3ATl/FYWnYX/ FKUzgzgJRANmwFBOQ0lunz7gL+Ew69FMPtfjioWaoVNXa0VAtyneWtaDeY2fVr+FT/c5 fvpw== 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:date :message-id:subject:from:to:cc; bh=rpkmFd9kpxUF2nMhSb5mmkNkOlkaDLyyB/fmlTkO62Q=; b=QX/2h9NB4sSos8FFpp0ZkIQHsCo0Q0HWF2dGOmSpZJS160L/GZOkW1w8Sc+fH4S9wk t577pRJmuacZSyNywlVl0ljkst6tezPRnOPa54CNl9umCsnh0sbadEp6KpWCd3s8f5lI llMTyXEdkueAL5vFMkH9rCWBkv6q41Qgr576vzqHslykUQ5CbQOIaDuq0+EXX+uX5vmN yI0cnmTQI8qBeQbGpdhaJjscEo0QfjmyczFugsmYb8vs8NnrG8VibSr5GIRVd4Xb1mWc UGTtuX/TYjNLxeut1yi/LPt0oLkHmpT8CyBLItbFVOYY/xGS+27FsDD+zcX9NDpoOcv4 wAkw== X-Gm-Message-State: AOPr4FXOfDI1vCxcaAZ9SWL1uL0ja7t0Jq32ZKckDW1/qm76E6TCf+9HgYNLxP3R6cjhtmSi6vxBUl2X/1Ae5Q== MIME-Version: 1.0 X-Received: by 10.55.215.88 with SMTP id m85mr22407212qki.153.1463445754697; Mon, 16 May 2016 17:42:34 -0700 (PDT) Received: by 10.55.170.201 with HTTP; Mon, 16 May 2016 17:42:34 -0700 (PDT) In-Reply-To: <201605170024.u4H0Orra005519@repo.freebsd.org> References: <201605170024.u4H0Orra005519@repo.freebsd.org> Date: Mon, 16 May 2016 17:42:34 -0700 Message-ID: Subject: Re: svn commit: r299997 - head/sys/boot/i386/zfsboot From: Ngie Cooper To: Peter Wemm 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 00:42:35 -0000 On Mon, May 16, 2016 at 5:24 PM, Peter Wemm wrote: > Author: peter > Date: Tue May 17 00:24:53 2016 > New Revision: 299997 > URL: https://svnweb.freebsd.org/changeset/base/299997 > > Log: > Attempt to fix r299660: > slba is used only for the GPT case. > elba is used if either GPT or LOADER_GELI_SUPPORT is enabled. Ugh -- sorry :(... Pointyhat to: ngie From owner-svn-src-all@freebsd.org Tue May 17 04:03:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C50B3EF3A; Tue, 17 May 2016 04:03:46 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2209B1443; Tue, 17 May 2016 04:03:46 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H43jg6073022; Tue, 17 May 2016 04:03:45 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H43j9H073021; Tue, 17 May 2016 04:03:45 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605170403.u4H43j9H073021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 17 May 2016 04:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300002 - head/usr.sbin/rarpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 04:03:46 -0000 Author: truckman Date: Tue May 17 04:03:45 2016 New Revision: 300002 URL: https://svnweb.freebsd.org/changeset/base/300002 Log: When clearing rtmsg, pass &rtmsg to bzero() instead of the address of just the header Reported by: Coverity CID: 1007568, 1194256 MFC after: 1 week Modified: head/usr.sbin/rarpd/rarpd.c Modified: head/usr.sbin/rarpd/rarpd.c ============================================================================== --- head/usr.sbin/rarpd/rarpd.c Tue May 17 00:32:36 2016 (r300001) +++ head/usr.sbin/rarpd/rarpd.c Tue May 17 04:03:45 2016 (r300002) @@ -739,7 +739,7 @@ update_arptab(u_char *ep, in_addr_t ipad /* Get the type and interface index */ rt = &rtmsg.rthdr; - bzero(rt, sizeof(rtmsg)); + bzero(&rtmsg, sizeof(rtmsg)); rt->rtm_version = RTM_VERSION; rt->rtm_addrs = RTA_DST; rt->rtm_type = RTM_GET; From owner-svn-src-all@freebsd.org Tue May 17 04:40:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FAA5B3DB7E; Tue, 17 May 2016 04:40:02 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0003513C5; Tue, 17 May 2016 04:40:01 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H4e1in082376; Tue, 17 May 2016 04:40:01 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H4e1Fe082375; Tue, 17 May 2016 04:40:01 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201605170440.u4H4e1Fe082375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Tue, 17 May 2016 04:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300003 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 04:40:02 -0000 Author: grog Date: Tue May 17 04:40:00 2016 New Revision: 300003 URL: https://svnweb.freebsd.org/changeset/base/300003 Log: Correct use of incorrect grammar. Modified: head/share/man/man4/gdb.4 Modified: head/share/man/man4/gdb.4 ============================================================================== --- head/share/man/man4/gdb.4 Tue May 17 04:03:45 2016 (r300002) +++ head/share/man/man4/gdb.4 Tue May 17 04:40:00 2016 (r300003) @@ -595,7 +595,7 @@ run the link at more than 9600 bps. Firewire connections do not have this problem. .Pp The debugging macros -.Dq "just grown" . +.Dq "just growed" . In general, the person who wrote them did so while looking for a specific problem, so they may not be general enough, and they may behave badly when used in ways for which they were not intended, even if those ways make sense. From owner-svn-src-all@freebsd.org Tue May 17 04:53:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17081B3E237; Tue, 17 May 2016 04:53:23 +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 E2F461F9D; Tue, 17 May 2016 04:53:22 +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 u4H4rMp3088069; Tue, 17 May 2016 04:53:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H4rME4088068; Tue, 17 May 2016 04:53:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605170453.u4H4rME4088068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 17 May 2016 04:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300004 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 04:53:23 -0000 Author: sephe Date: Tue May 17 04:53:21 2016 New Revision: 300004 URL: https://svnweb.freebsd.org/changeset/base/300004 Log: MFC r298769, r299315 r298769 ============= tcp/syncache: Set flowid and hash type properly for SYN|ACK So the underlying drivers can use it to select the sending queue properly for SYN|ACK instead of rolling their own hash. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6120 r299315 ============= tcp/syncache: Add comment for syncache_respond Suggested by: hiren, hps Reviewed by: sbruno Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6148 Modified: stable/10/sys/netinet/tcp_syncache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_syncache.c ============================================================================== --- stable/10/sys/netinet/tcp_syncache.c Tue May 17 04:40:00 2016 (r300003) +++ stable/10/sys/netinet/tcp_syncache.c Tue May 17 04:53:21 2016 (r300004) @@ -124,7 +124,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *); +static int syncache_respond(struct syncache *, const struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS); @@ -480,7 +480,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } - (void) syncache_respond(sc); + (void) syncache_respond(sc, NULL); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -1307,7 +1307,7 @@ syncache_add(struct in_conninfo *inc, st s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc) == 0) { + if (syncache_respond(sc, m) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1476,7 +1476,7 @@ skip_alloc: /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc) == 0) { + if (syncache_respond(sc, m) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1506,8 +1506,12 @@ tfo_done: return (rv); } +/* + * Send SYN|ACK to the peer. Either in response to the peer's SYN, + * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL. + */ static int -syncache_respond(struct syncache *sc) +syncache_respond(struct syncache *sc, const struct mbuf *m0) { struct ip *ip = NULL; struct mbuf *m; @@ -1664,6 +1668,15 @@ syncache_respond(struct syncache *sc) M_SETFIB(m, sc->sc_inc.inc_fibnum); m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + /* + * If we have peer's SYN and it has a flowid, then let's assign it to + * our SYN|ACK. ip6_output() and ip_output() will not assign flowid + * to SYN|ACK due to lack of inp here. + */ + if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) { + m->m_pkthdr.flowid = m0->m_pkthdr.flowid; + M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); + } #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; From owner-svn-src-all@freebsd.org Tue May 17 05:05:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5200B3E6D6; Tue, 17 May 2016 05:05:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 827D3164F; Tue, 17 May 2016 05:05:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H55Up4091153; Tue, 17 May 2016 05:05:30 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H55Uwr091152; Tue, 17 May 2016 05:05:30 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605170505.u4H55Uwr091152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 17 May 2016 05:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300005 - head/usr.bin/ncal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 05:05:31 -0000 Author: truckman Date: Tue May 17 05:05:30 2016 New Revision: 300005 URL: https://svnweb.freebsd.org/changeset/base/300005 Log: swprintf() and apparently wcsftime() want the their output buffer size specified in terms of the the number of wide characters and not sizeof(buffer). Reported by: Coverity CID: 1007605, 1007606 MFC after: 1 week Modified: head/usr.bin/ncal/ncal.c Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Tue May 17 04:53:21 2016 (r300004) +++ head/usr.bin/ncal/ncal.c Tue May 17 05:05:30 2016 (r300005) @@ -642,8 +642,8 @@ monthrangeb(int y, int m, int jd_flag, i wprintf(L"%-*ls ", mw, wcenter(ws, year[i].name, mw)); else { - swprintf(ws, sizeof(ws), L"%-ls %d", - year[i].name, M2Y(m + i)); + swprintf(ws, sizeof(ws)/sizeof(ws[0]), + L"%-ls %d", year[i].name, M2Y(m + i)); wprintf(L"%-*ls ", mw, wcenter(ws1, ws, mw)); } printf("\n"); @@ -958,7 +958,7 @@ mkweekdays(struct weekdays *wds) for (i = 0; i != 7; i++) { tm.tm_wday = (i+1) % 7; - wcsftime(buf, sizeof(buf), L"%a", &tm); + wcsftime(buf, sizeof(buf)/sizeof(buf[0]), L"%a", &tm); for (len = 2; len > 0; --len) { if ((width = wcswidth(buf, len)) <= 2) break; From owner-svn-src-all@freebsd.org Tue May 17 05:14:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D2A8B3E98B; Tue, 17 May 2016 05:14:28 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x230.google.com (mail-vk0-x230.google.com [IPv6:2607:f8b0:400c:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB141B22; Tue, 17 May 2016 05:14:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x230.google.com with SMTP id s184so6268431vkb.3; Mon, 16 May 2016 22:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=GfH6J1KQN6SZnUjdU3wAmI07fjsl2FALTlXmkIFwRH4=; b=zY7oalC8KuewCB0Rq6e0jHl5Bcu9AsgF5S3Pzx6Vs5uC7aG/d+4KgKXwgIrqV2hJux riwc5YhmHSlq5/UQ0nHDpdtpsyNxPRPferQJVgjDW6ZMDpNCarWdEtieTZlmm2j1VNKP 2IyaHOZx1cRCYm3PPX1C6D42ljWpYI8pLu4WjFy7y0T6r8YqJNgnckR7hw7mJFrksU29 cazez9RrQ/sIO2fKRaDjtAU4hsf/r8x6xARqwP+mHMCjQqZk/n3HK4ovkx7B/g0XmyUh tom94p7ivrJI0ZZI57Kd8zth6MhtrS3582QXYZepOZzGRGbXY8rOIBkQsrqZ++KcEIXZ ubSw== 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:date :message-id:subject:from:to:cc; bh=GfH6J1KQN6SZnUjdU3wAmI07fjsl2FALTlXmkIFwRH4=; b=Rs3qE9ejh/rx5yt2dvlW/rtQfYAKIWPQUd2r4Ew0A+DYICOWORQi4mMmrE9xfpWJ6k 2h+WNl4G3/nJSVzeVqf6+dhJGSeJn7FdRg4iG6OnHbUcqGZFatl+6K1Y1h+z7ZDF/Qz6 KZ72XxaaP7ntvCLDiIY1MmcJ25lUne35Z0Pypn96aOy0LHaYqmg/HUGU8fiSXOdiOLbu 6aIsSpV9JJdz2gcdBeW2n1ztuua/VjjmsEIaHZDxeLalRP2eRI7zxjP3qZ1N4bgopkjw isG8wjtWhKgiUgGQq+6kCom3Kw5rRZHgAWyZE705JbXge7qnsngOMGHNOOfVV2oX0Ni9 nDUg== X-Gm-Message-State: AOPr4FW/S3MmFuxRUlK1zuygheLsut0NNGISnXoSOqxKnMqd3vFuhT/ExWwuo7giLBKu0PM3KD3fL27ZLTM12A== MIME-Version: 1.0 X-Received: by 10.31.156.198 with SMTP id f189mr16627433vke.11.1463462067063; Mon, 16 May 2016 22:14:27 -0700 (PDT) Received: by 10.176.65.99 with HTTP; Mon, 16 May 2016 22:14:27 -0700 (PDT) In-Reply-To: <201605170031.u4H0VcC6008025@repo.freebsd.org> References: <201605170031.u4H0VcC6008025@repo.freebsd.org> Date: Tue, 17 May 2016 13:14:27 +0800 Message-ID: Subject: Re: svn commit: r300000 - head/sys/mips/conf From: Sepherosa Ziehau To: Adrian Chadd 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 05:14:28 -0000 On Tue, May 17, 2016 at 8:31 AM, Adrian Chadd wrote: > Author: adrian > Date: Tue May 17 00:31:37 2016 > New Revision: 300000 > URL: https://svnweb.freebsd.org/changeset/base/300000 300000! Congrats! :P From owner-svn-src-all@freebsd.org Tue May 17 06:01:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B380B3E371; Tue, 17 May 2016 06:01:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) (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 3FD7D1E26; Tue, 17 May 2016 06:01:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f44.google.com with SMTP id x201so9243084oif.3; Mon, 16 May 2016 23:01:11 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=Mv85xx285Ws4JyY6aX99eA2x7w753DwD98Dg6yL3m3w=; b=bvdzIaHhhJAdAbKzQk2SFZ3daMaQPlBdTqHcmkNgO9Xy8u0TbiPEdLj3gwYkgzgR1y BeK5rskhsJNmqa1jaFv6bzaI3zse4OJxE60N55VJ+AgsonGRbGNTZAxIr/PTeDRiC5FQ Py9uT+41y+Eo0g72KUTlqQV0fCWndAQ7RJ8Bhj6NTle7GtkX+tzD1BgyQYCbrERfhV8L Vk2MHBPXXCu5Fhh6s3mtuHEx1Y7pxZ+0DCkpSjOQUwsA5qYHJZxxdxjolc5l87DqWI77 IG1kkGo+LduDv/FKsYwuZBxUh+TjJRy0K4YxKsFnsQZI5oc5HDw5WyZpMhPh+mHM2vak z9hg== X-Gm-Message-State: AOPr4FVccbYqfmaoQMrwqiYh6vcSIRP4aisAVF2dWr+FDBaNDN2r70SslgeIecdGBhjZNA== X-Received: by 10.157.8.133 with SMTP id 5mr13036262otf.52.1463464475688; Mon, 16 May 2016 22:54:35 -0700 (PDT) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com. [209.85.218.46]) by smtp.gmail.com with ESMTPSA id z3sm347187ota.21.2016.05.16.22.54.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 May 2016 22:54:35 -0700 (PDT) Received: by mail-oi0-f46.google.com with SMTP id x201so9075367oif.3; Mon, 16 May 2016 22:54:35 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.35.225 with SMTP id t88mr19998957otb.18.1463464475194; Mon, 16 May 2016 22:54:35 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Mon, 16 May 2016 22:54:35 -0700 (PDT) In-Reply-To: <201605170505.u4H55Uwr091152@repo.freebsd.org> References: <201605170505.u4H55Uwr091152@repo.freebsd.org> Date: Mon, 16 May 2016 22:54:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300005 - head/usr.bin/ncal From: Conrad Meyer To: Don Lewis 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:01:12 -0000 On Mon, May 16, 2016 at 10:05 PM, Don Lewis wrote: > Author: truckman > Date: Tue May 17 05:05:30 2016 > New Revision: 300005 > URL: https://svnweb.freebsd.org/changeset/base/300005 > > Log: > swprintf() and apparently wcsftime() want the their output buffer size > specified in terms of the the number of wide characters and not > sizeof(buffer). > ... > Modified: head/usr.bin/ncal/ncal.c > ============================================================================== > --- head/usr.bin/ncal/ncal.c Tue May 17 04:53:21 2016 (r300004) > +++ head/usr.bin/ncal/ncal.c Tue May 17 05:05:30 2016 (r300005) > @@ -642,8 +642,8 @@ monthrangeb(int y, int m, int jd_flag, i > wprintf(L"%-*ls ", > mw, wcenter(ws, year[i].name, mw)); > else { > - swprintf(ws, sizeof(ws), L"%-ls %d", > - year[i].name, M2Y(m + i)); > + swprintf(ws, sizeof(ws)/sizeof(ws[0]), Normally we spell this nitems(ws). > + L"%-ls %d", year[i].name, M2Y(m + i)); > wprintf(L"%-*ls ", mw, wcenter(ws1, ws, mw)); > } > printf("\n"); > @@ -958,7 +958,7 @@ mkweekdays(struct weekdays *wds) > > for (i = 0; i != 7; i++) { > tm.tm_wday = (i+1) % 7; > - wcsftime(buf, sizeof(buf), L"%a", &tm); > + wcsftime(buf, sizeof(buf)/sizeof(buf[0]), L"%a", &tm); This one can be nitems(buf) too. > for (len = 2; len > 0; --len) { > if ((width = wcswidth(buf, len)) <= 2) > break; > Best, Conrad From owner-svn-src-all@freebsd.org Tue May 17 06:04:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60C85B3E4D3; Tue, 17 May 2016 06:04:35 +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 1ED63115B; Tue, 17 May 2016 06:04:35 +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 u4H64Yxv009754; Tue, 17 May 2016 06:04:34 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H64Y1G009751; Tue, 17 May 2016 06:04:34 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201605170604.u4H64Y1G009751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 17 May 2016 06:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300006 - head/sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:04:35 -0000 Author: kevlo Date: Tue May 17 06:04:33 2016 New Revision: 300006 URL: https://svnweb.freebsd.org/changeset/base/300006 Log: The EEPROM is lying about antennas. Don't hardcode things based on the chip version which is not what the vendor driver happens to do. Modified: head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860reg.h head/sys/dev/ral/rt2860var.h Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Tue May 17 05:05:30 2016 (r300005) +++ head/sys/dev/ral/rt2860.c Tue May 17 06:04:33 2016 (r300006) @@ -165,7 +165,7 @@ static void rt2860_delete_key(struct iee struct ieee80211_node *, struct ieee80211_key *); #endif static int8_t rt2860_rssi2dbm(struct rt2860_softc *, uint8_t, uint8_t); -static const char *rt2860_get_rf(uint8_t); +static const char *rt2860_get_rf(uint16_t); static int rt2860_read_eeprom(struct rt2860_softc *, uint8_t macaddr[IEEE80211_ADDR_LEN]); static int rt2860_bbp_init(struct rt2860_softc *); @@ -3307,7 +3307,7 @@ b4inc(uint32_t b32, int8_t delta) } static const char * -rt2860_get_rf(uint8_t rev) +rt2860_get_rf(uint16_t rev) { switch (rev) { case RT2860_RF_2820: return "RT2820"; @@ -3321,6 +3321,7 @@ rt2860_get_rf(uint8_t rev) case RT3070_RF_3052: return "RT3052"; case RT3070_RF_3320: return "RT3320"; case RT3070_RF_3053: return "RT3053"; + case RT5390_RF_5360: return "RT5360"; case RT5390_RF_5390: return "RT5390"; default: return "unknown"; } @@ -3343,9 +3344,11 @@ rt2860_read_eeprom(struct rt2860_softc * sc->sc_srom_read = rt3090_efuse_read_2; } +#ifdef RAL_DEBUG /* read EEPROM version */ val = rt2860_srom_read(sc, RT2860_EEPROM_VERSION); DPRINTF(("EEPROM rev=%d, FAE=%d\n", val >> 8, val & 0xff)); +#endif /* read MAC address */ val = rt2860_srom_read(sc, RT2860_EEPROM_MAC01); @@ -3358,9 +3361,11 @@ rt2860_read_eeprom(struct rt2860_softc * macaddr[4] = val & 0xff; macaddr[5] = val >> 8; +#ifdef RAL_DEBUG /* read country code */ val = rt2860_srom_read(sc, RT2860_EEPROM_COUNTRY); DPRINTF(("EEPROM region code=0x%04x\n", val)); +#endif /* read vendor BBP settings */ for (i = 0; i < 8; i++) { @@ -3402,39 +3407,12 @@ rt2860_read_eeprom(struct rt2860_softc * /* read RF information */ val = rt2860_srom_read(sc, RT2860_EEPROM_ANTENNA); - if (val == 0xffff) { - DPRINTF(("invalid EEPROM antenna info, using default\n")); - if (sc->mac_ver >= 0x5390) { - /* default to RF5390 */ - sc->rf_rev = RT5390_RF_5390; - sc->ntxchains = (sc->mac_ver == 0x5392) ? 2 : 1; - sc->nrxchains = (sc->mac_ver == 0x5392) ? 2 : 1; - } else if (sc->mac_ver == 0x3593) { - /* default to RF3053 3T3R */ - sc->rf_rev = RT3070_RF_3053; - sc->ntxchains = 3; - sc->nrxchains = 3; - } else if (sc->mac_ver >= 0x3071) { - /* default to RF3020 1T1R */ - sc->rf_rev = RT3070_RF_3020; - sc->ntxchains = 1; - sc->nrxchains = 1; - } else { - /* default to RF2820 1T2R */ - sc->rf_rev = RT2860_RF_2820; - sc->ntxchains = 1; - sc->nrxchains = 2; - } - } else { + if (sc->mac_ver >= 0x5390) + sc->rf_rev = rt2860_srom_read(sc, RT2860_EEPROM_CHIPID); + else sc->rf_rev = (val >> 8) & 0xf; - if (sc->mac_ver >= 0x5390) { - sc->ntxchains = (sc->mac_ver == 0x5392) ? 2 : 1; - sc->nrxchains = (sc->mac_ver == 0x5392) ? 2 : 1; - } else { - sc->ntxchains = (val >> 4) & 0xf; - sc->nrxchains = val & 0xf; - } - } + sc->ntxchains = (val >> 4) & 0xf; + sc->nrxchains = val & 0xf; DPRINTF(("EEPROM RF rev=0x%02x chains=%dT%dR\n", sc->rf_rev, sc->ntxchains, sc->nrxchains)); Modified: head/sys/dev/ral/rt2860reg.h ============================================================================== --- head/sys/dev/ral/rt2860reg.h Tue May 17 05:05:30 2016 (r300005) +++ head/sys/dev/ral/rt2860reg.h Tue May 17 06:04:33 2016 (r300006) @@ -900,18 +900,19 @@ struct rt2860_rxwi { #define RT2860_RF3 1 #define RT2860_RF4 3 -#define RT2860_RF_2820 1 /* 2T3R */ -#define RT2860_RF_2850 2 /* dual-band 2T3R */ -#define RT2860_RF_2720 3 /* 1T2R */ -#define RT2860_RF_2750 4 /* dual-band 1T2R */ -#define RT3070_RF_3020 5 /* 1T1R */ -#define RT3070_RF_2020 6 /* b/g */ -#define RT3070_RF_3021 7 /* 1T2R */ -#define RT3070_RF_3022 8 /* 2T2R */ -#define RT3070_RF_3052 9 /* dual-band 2T2R */ -#define RT3070_RF_3320 11 /* 1T1R */ -#define RT3070_RF_3053 13 /* dual-band 3T3R */ -#define RT5390_RF_5390 15 /* b/g/n */ +#define RT2860_RF_2820 0x0001 /* 2T3R */ +#define RT2860_RF_2850 0x0002 /* dual-band 2T3R */ +#define RT2860_RF_2720 0x0003 /* 1T2R */ +#define RT2860_RF_2750 0x0004 /* dual-band 1T2R */ +#define RT3070_RF_3020 0x0005 /* 1T1R */ +#define RT3070_RF_2020 0x0006 /* b/g */ +#define RT3070_RF_3021 0x0007 /* 1T2R */ +#define RT3070_RF_3022 0x0008 /* 2T2R */ +#define RT3070_RF_3052 0x0009 /* dual-band 2T2R */ +#define RT3070_RF_3320 0x000b /* 1T1R */ +#define RT3070_RF_3053 0x000d /* dual-band 3T3R */ +#define RT5390_RF_5360 0x5360 /* 1T1R */ +#define RT5390_RF_5390 0x5390 /* 1T1R */ /* USB commands for RT2870 only */ #define RT2870_RESET 1 @@ -922,6 +923,7 @@ struct rt2860_rxwi { #define RT2860_EEPROM_DELAY 1 /* minimum hold time (microsecond) */ +#define RT2860_EEPROM_CHIPID 0x00 #define RT2860_EEPROM_VERSION 0x01 #define RT2860_EEPROM_MAC01 0x02 #define RT2860_EEPROM_MAC23 0x03 Modified: head/sys/dev/ral/rt2860var.h ============================================================================== --- head/sys/dev/ral/rt2860var.h Tue May 17 05:05:30 2016 (r300005) +++ head/sys/dev/ral/rt2860var.h Tue May 17 06:04:33 2016 (r300006) @@ -159,7 +159,7 @@ struct rt2860_softc { uint16_t mac_ver; uint16_t mac_rev; - uint8_t rf_rev; + uint16_t rf_rev; uint8_t freq; uint8_t ntxchains; uint8_t nrxchains; From owner-svn-src-all@freebsd.org Tue May 17 06:07:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 052C2B3E587; Tue, 17 May 2016 06:07:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D7B1413A1; Tue, 17 May 2016 06:07:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4H67VJL074016; Mon, 16 May 2016 23:07:35 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605170607.u4H67VJL074016@gw.catspoiler.org> Date: Mon, 16 May 2016 23:07:31 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300005 - head/usr.bin/ncal To: cem@FreeBSD.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:07:42 -0000 On 16 May, Conrad Meyer wrote: > On Mon, May 16, 2016 at 10:05 PM, Don Lewis wrote: >> Author: truckman >> Date: Tue May 17 05:05:30 2016 >> New Revision: 300005 >> URL: https://svnweb.freebsd.org/changeset/base/300005 >> >> Log: >> swprintf() and apparently wcsftime() want the their output buffer size >> specified in terms of the the number of wide characters and not >> sizeof(buffer). >> ... >> Modified: head/usr.bin/ncal/ncal.c >> ============================================================================== >> --- head/usr.bin/ncal/ncal.c Tue May 17 04:53:21 2016 (r300004) >> +++ head/usr.bin/ncal/ncal.c Tue May 17 05:05:30 2016 (r300005) >> @@ -642,8 +642,8 @@ monthrangeb(int y, int m, int jd_flag, i >> wprintf(L"%-*ls ", >> mw, wcenter(ws, year[i].name, mw)); >> else { >> - swprintf(ws, sizeof(ws), L"%-ls %d", >> - year[i].name, M2Y(m + i)); >> + swprintf(ws, sizeof(ws)/sizeof(ws[0]), > > Normally we spell this nitems(ws). > >> + L"%-ls %d", year[i].name, M2Y(m + i)); >> wprintf(L"%-*ls ", mw, wcenter(ws1, ws, mw)); >> } >> printf("\n"); >> @@ -958,7 +958,7 @@ mkweekdays(struct weekdays *wds) >> >> for (i = 0; i != 7; i++) { >> tm.tm_wday = (i+1) % 7; >> - wcsftime(buf, sizeof(buf), L"%a", &tm); >> + wcsftime(buf, sizeof(buf)/sizeof(buf[0]), L"%a", &tm); > > This one can be nitems(buf) too. > >> for (len = 2; len > 0; --len) { >> if ((width = wcswidth(buf, len)) <= 2) >> break; >> I thought about that, but I didn't see any obvious signs that was included. From owner-svn-src-all@freebsd.org Tue May 17 06:23:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C610EB3EA0B; Tue, 17 May 2016 06:23:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A104F1DE9; Tue, 17 May 2016 06:23:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6Noqe015784; Tue, 17 May 2016 06:23:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6NoBo015780; Tue, 17 May 2016 06:23:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605170623.u4H6NoBo015780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 17 May 2016 06:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300007 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:23:51 -0000 Author: arybchik Date: Tue May 17 06:23:50 2016 New Revision: 300007 URL: https://svnweb.freebsd.org/changeset/base/300007 Log: sfxge(4): store licensing state in efx_lic Check licensing support at NIC startup to avoid multiple checks later. As state is stored, licensing initialisation is moved later in start procedure. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6385 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue May 17 06:04:33 2016 (r300006) +++ head/sys/dev/sfxge/common/efx.h Tue May 17 06:23:50 2016 (r300007) @@ -2314,6 +2314,10 @@ extern void efx_lic_fini( __in efx_nic_t *enp); +extern __checkReturn boolean_t +efx_lic_check_support( + __in efx_nic_t *enp); + extern __checkReturn efx_rc_t efx_lic_update_licenses( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 17 06:04:33 2016 (r300006) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 17 06:23:50 2016 (r300007) @@ -636,6 +636,7 @@ struct efx_nic_s { uint32_t en_vport_id; #if EFSYS_OPT_LICENSING const efx_lic_ops_t *en_elop; + boolean_t en_licensing_supported; #endif union { #if EFSYS_OPT_SIENA Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Tue May 17 06:04:33 2016 (r300006) +++ head/sys/dev/sfxge/common/efx_lic.c Tue May 17 06:23:50 2016 (r300007) @@ -1330,6 +1330,7 @@ efx_lic_init( __in efx_nic_t *enp) { const efx_lic_ops_t *elop; + efx_key_stats_t eks; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -1365,6 +1366,13 @@ efx_lic_init( enp->en_elop = elop; enp->en_mod_flags |= EFX_MOD_LIC; + /* Probe for support */ + if (efx_lic_get_key_stats(enp, &eks) == 0) { + enp->en_licensing_supported = B_TRUE; + } else { + enp->en_licensing_supported = B_FALSE; + } + return (0); fail1: @@ -1373,6 +1381,17 @@ fail1: return (rc); } +extern __checkReturn boolean_t +efx_lic_check_support( + __in efx_nic_t *enp) +{ + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); + + return enp->en_licensing_supported; +} + void efx_lic_fini( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue May 17 06:04:33 2016 (r300006) +++ head/sys/dev/sfxge/common/efx_nic.c Tue May 17 06:23:50 2016 (r300007) @@ -580,7 +580,7 @@ efx_nic_reset( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); /* - * All modules except the MCDI, PROBE, NVRAM, VPD, MON, LIC + * All modules except the MCDI, PROBE, NVRAM, VPD, MON * (which we do not reset here) must have been shut down or never * initialized. * @@ -590,7 +590,7 @@ efx_nic_reset( */ mod_flags = enp->en_mod_flags; mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM | - EFX_MOD_VPD | EFX_MOD_MON | EFX_MOD_LIC); + EFX_MOD_VPD | EFX_MOD_MON); EFSYS_ASSERT3U(mod_flags, ==, 0); if (mod_flags != 0) { rc = EINVAL; From owner-svn-src-all@freebsd.org Tue May 17 06:25:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F00D6B3EB0B; Tue, 17 May 2016 06:25:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE0AC10F9; Tue, 17 May 2016 06:25:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6P1wZ015877; Tue, 17 May 2016 06:25:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6P124015870; Tue, 17 May 2016 06:25:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605170625.u4H6P124015870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 17 May 2016 06:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300008 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:25:03 -0000 Author: arybchik Date: Tue May 17 06:25:00 2016 New Revision: 300008 URL: https://svnweb.freebsd.org/changeset/base/300008 Log: sfxge(4): query and use current MTU if setting the MTU fails This allows the driver to fall back to the largest usable MTU if a user attempts to configure an unprivileged function with an MTU higher than that of the attached port. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6387 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mac.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue May 17 06:23:50 2016 (r300007) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue May 17 06:25:00 2016 (r300008) @@ -236,6 +236,11 @@ ef10_mac_pdu_set( __in efx_nic_t *enp); extern __checkReturn efx_rc_t +ef10_mac_pdu_get( + __in efx_nic_t *enp, + __out size_t *pdu); + +extern __checkReturn efx_rc_t ef10_mac_reconfigure( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Tue May 17 06:23:50 2016 (r300007) +++ head/sys/dev/sfxge/common/ef10_mac.c Tue May 17 06:25:00 2016 (r300008) @@ -199,6 +199,53 @@ fail1: return (rc); } +static __checkReturn efx_rc_t +efx_mcdi_mtu_get( + __in efx_nic_t *enp, + __out size_t *mtu) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_SET_MAC_EXT_IN_LEN, + MC_CMD_SET_MAC_V2_OUT_LEN)]; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_SET_MAC; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_SET_MAC_EXT_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_SET_MAC_V2_OUT_LEN; + + /* + * With MC_CMD_SET_MAC_EXT_IN_CONTROL set to 0, this just queries the + * MTU. This should always be supported on Medford, but it is not + * supported on older Huntington firmware. + */ + MCDI_IN_SET_DWORD(req, SET_MAC_EXT_IN_CONTROL, 0); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + if (req.emr_out_length_used < MC_CMD_SET_MAC_V2_OUT_MTU_OFST + 4) { + rc = EMSGSIZE; + goto fail2; + } + + *mtu = MCDI_OUT_DWORD(req, SET_MAC_V2_OUT_MTU); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t ef10_mac_pdu_set( __in efx_nic_t *enp) @@ -230,6 +277,24 @@ fail1: return (rc); } + __checkReturn efx_rc_t +ef10_mac_pdu_get( + __in efx_nic_t *enp, + __out size_t *pdu) +{ + efx_rc_t rc; + + if ((rc = efx_mcdi_mtu_get(enp, pdu)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t ef10_mac_reconfigure( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue May 17 06:23:50 2016 (r300007) +++ head/sys/dev/sfxge/common/efx.h Tue May 17 06:25:00 2016 (r300008) @@ -442,18 +442,30 @@ typedef enum efx_link_mode_e { #define EFX_MAC_SDU_MAX 9202 -#define EFX_MAC_PDU(_sdu) \ - P2ROUNDUP(((_sdu) \ - + /* EtherII */ 14 \ - + /* VLAN */ 4 \ - + /* CRC */ 4 \ - + /* bug16011 */ 16), \ - (1 << 3)) +#define EFX_MAC_PDU_ADJUSTMENT \ + (/* EtherII */ 14 \ + + /* VLAN */ 4 \ + + /* CRC */ 4 \ + + /* bug16011 */ 16) \ + +#define EFX_MAC_PDU(_sdu) \ + P2ROUNDUP((_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8) + +/* + * Due to the P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give + * the SDU rounded up slightly. + */ +#define EFX_MAC_SDU_FROM_PDU(_pdu) ((_pdu) - EFX_MAC_PDU_ADJUSTMENT) #define EFX_MAC_PDU_MIN 60 #define EFX_MAC_PDU_MAX EFX_MAC_PDU(EFX_MAC_SDU_MAX) extern __checkReturn efx_rc_t +efx_mac_pdu_get( + __in efx_nic_t *enp, + __out size_t *pdu); + +extern __checkReturn efx_rc_t efx_mac_pdu_set( __in efx_nic_t *enp, __in size_t pdu); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 17 06:23:50 2016 (r300007) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 17 06:25:00 2016 (r300008) @@ -183,6 +183,7 @@ typedef struct efx_mac_ops_s { efx_rc_t (*emo_up)(efx_nic_t *, boolean_t *); efx_rc_t (*emo_addr_set)(efx_nic_t *); efx_rc_t (*emo_pdu_set)(efx_nic_t *); + efx_rc_t (*emo_pdu_get)(efx_nic_t *, size_t *); efx_rc_t (*emo_reconfigure)(efx_nic_t *); efx_rc_t (*emo_multicast_list_set)(efx_nic_t *); efx_rc_t (*emo_filter_default_rxq_set)(efx_nic_t *, Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue May 17 06:23:50 2016 (r300007) +++ head/sys/dev/sfxge/common/efx_mac.c Tue May 17 06:25:00 2016 (r300008) @@ -48,6 +48,7 @@ static const efx_mac_ops_t __efx_siena_m siena_mac_up, /* emo_up */ siena_mac_reconfigure, /* emo_addr_set */ siena_mac_reconfigure, /* emo_pdu_set */ + siena_mac_pdu_get, /* emo_pdu_get */ siena_mac_reconfigure, /* emo_reconfigure */ siena_mac_multicast_list_set, /* emo_multicast_list_set */ NULL, /* emo_filter_set_default_rxq */ @@ -69,6 +70,7 @@ static const efx_mac_ops_t __efx_ef10_ma ef10_mac_up, /* emo_up */ ef10_mac_addr_set, /* emo_addr_set */ ef10_mac_pdu_set, /* emo_pdu_set */ + ef10_mac_pdu_get, /* emo_pdu_get */ ef10_mac_reconfigure, /* emo_reconfigure */ ef10_mac_multicast_list_set, /* emo_multicast_list_set */ ef10_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */ @@ -85,7 +87,6 @@ static const efx_mac_ops_t __efx_ef10_ma }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ - __checkReturn efx_rc_t efx_mac_pdu_set( __in efx_nic_t *enp, @@ -130,6 +131,26 @@ fail1: return (rc); } + __checkReturn efx_rc_t +efx_mac_pdu_get( + __in efx_nic_t *enp, + __out size_t *pdu) +{ + efx_port_t *epp = &(enp->en_port); + const efx_mac_ops_t *emop = epp->ep_emop; + efx_rc_t rc; + + if ((rc = emop->emo_pdu_get(enp, pdu)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t efx_mac_addr_set( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Tue May 17 06:23:50 2016 (r300007) +++ head/sys/dev/sfxge/common/siena_impl.h Tue May 17 06:25:00 2016 (r300008) @@ -388,6 +388,11 @@ extern __checkReturn efx_rc_t siena_mac_reconfigure( __in efx_nic_t *enp); +extern __checkReturn efx_rc_t +siena_mac_pdu_get( + __in efx_nic_t *enp, + __out size_t *pdu); + #if EFSYS_OPT_LOOPBACK extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Tue May 17 06:23:50 2016 (r300007) +++ head/sys/dev/sfxge/common/siena_mac.c Tue May 17 06:25:00 2016 (r300008) @@ -432,4 +432,12 @@ siena_mac_stats_update( #endif /* EFSYS_OPT_MAC_STATS */ + __checkReturn efx_rc_t +siena_mac_pdu_get( + __in efx_nic_t *enp, + __out size_t *pdu) +{ + return (ENOTSUP); +} + #endif /* EFSYS_OPT_SIENA */ From owner-svn-src-all@freebsd.org Tue May 17 06:26:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3870B3EBE4; Tue, 17 May 2016 06:26:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABEBA1298; Tue, 17 May 2016 06:26:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6Q2lu015956; Tue, 17 May 2016 06:26:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6Q2Vs015951; Tue, 17 May 2016 06:26:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605170626.u4H6Q2Vs015951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 17 May 2016 06:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300009 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:26:03 -0000 Author: arybchik Date: Tue May 17 06:26:02 2016 New Revision: 300009 URL: https://svnweb.freebsd.org/changeset/base/300009 Log: sfxge(4): fix Medford timer quantum calculation in common code The event/timer block used sysclk in Huntington, but has been moved to the dpcpu clock domain for Medford. Fix the computed timer quantum to use the right clock. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6389 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue May 17 06:25:00 2016 (r300008) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue May 17 06:26:02 2016 (r300009) @@ -1061,7 +1061,9 @@ efx_mcdi_get_mac_address_vf( extern __checkReturn efx_rc_t efx_mcdi_get_clock( __in efx_nic_t *enp, - __out uint32_t *sys_freqp); + __out uint32_t *sys_freqp, + __out uint32_t *dpcpu_freqp); + extern __checkReturn efx_rc_t efx_mcdi_get_vector_cfg( Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue May 17 06:25:00 2016 (r300008) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue May 17 06:26:02 2016 (r300009) @@ -389,7 +389,8 @@ fail1: __checkReturn efx_rc_t efx_mcdi_get_clock( __in efx_nic_t *enp, - __out uint32_t *sys_freqp) + __out uint32_t *sys_freqp, + __out uint32_t *dpcpu_freqp) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_CLOCK_IN_LEN, @@ -423,9 +424,16 @@ efx_mcdi_get_clock( rc = EINVAL; goto fail3; } + *dpcpu_freqp = MCDI_OUT_DWORD(req, GET_CLOCK_OUT_DPCPU_FREQ); + if (*dpcpu_freqp == 0) { + rc = EINVAL; + goto fail4; + } return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Tue May 17 06:25:00 2016 (r300008) +++ head/sys/dev/sfxge/common/hunt_nic.c Tue May 17 06:26:02 2016 (r300009) @@ -114,7 +114,7 @@ hunt_board_cfg( uint32_t vf; uint32_t mask; uint32_t flags; - uint32_t sysclk; + uint32_t sysclk, dpcpu_clk; uint32_t base, nvec; uint32_t bandwidth; efx_rc_t rc; @@ -274,13 +274,13 @@ hunt_board_cfg( goto fail10; } - /* Get sysclk frequency (in MHz). */ - if ((rc = efx_mcdi_get_clock(enp, &sysclk)) != 0) + /* Get clock frequencies (in MHz). */ + if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) goto fail11; /* - * The timer quantum is 1536 sysclk cycles, documented for the - * EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. + * The Huntington timer quantum is 1536 sysclk cycles, documented for + * the EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. */ encp->enc_evq_timer_quantum_ns = 1536000UL / sysclk; /* 1536 cycles */ if (encp->enc_bug35388_workaround) { Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue May 17 06:25:00 2016 (r300008) +++ head/sys/dev/sfxge/common/medford_nic.c Tue May 17 06:26:02 2016 (r300009) @@ -141,7 +141,7 @@ medford_board_cfg( uint32_t pf; uint32_t vf; uint32_t mask; - uint32_t sysclk; + uint32_t sysclk, dpcpu_clk; uint32_t base, nvec; uint32_t end_padding; uint32_t bandwidth; @@ -231,15 +231,15 @@ medford_board_cfg( /* Chained multicast is always enabled on Medford */ encp->enc_bug26807_workaround = B_TRUE; - /* Get sysclk frequency (in MHz). */ - if ((rc = efx_mcdi_get_clock(enp, &sysclk)) != 0) + /* Get clock frequencies (in MHz). */ + if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) goto fail8; /* - * The timer quantum is 1536 sysclk cycles, documented for the - * EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. + * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for + * the EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. */ - encp->enc_evq_timer_quantum_ns = 1536000UL / sysclk; /* 1536 cycles */ + encp->enc_evq_timer_quantum_ns = 1536000UL / dpcpu_clk; /* 1536 cycles */ encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; From owner-svn-src-all@freebsd.org Tue May 17 06:27:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07ACBB3ECF3; Tue, 17 May 2016 06:27:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDF221456; Tue, 17 May 2016 06:27:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6RKsU016038; Tue, 17 May 2016 06:27:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6RKS8016037; Tue, 17 May 2016 06:27:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605170627.u4H6RKS8016037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 17 May 2016 06:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300010 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:27:21 -0000 Author: arybchik Date: Tue May 17 06:27:19 2016 New Revision: 300010 URL: https://svnweb.freebsd.org/changeset/base/300010 Log: sfxge(4): restore clearing of MCDI new epoch flag in common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6390 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue May 17 06:26:02 2016 (r300009) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue May 17 06:27:19 2016 (r300010) @@ -535,6 +535,9 @@ efx_mcdi_request_poll( /* Request complete */ emip->emi_pending_req = NULL; + /* Ensure stale MCDI requests fail after an MC reboot. */ + emip->emi_new_epoch = B_FALSE; + EFSYS_UNLOCK(enp->en_eslp, state); if ((rc = emrp->emr_rc) != 0) From owner-svn-src-all@freebsd.org Tue May 17 06:28:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 038DEB3ED6B; Tue, 17 May 2016 06:28:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA39F1705; Tue, 17 May 2016 06:28:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6S4su016106; Tue, 17 May 2016 06:28:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6S49H016105; Tue, 17 May 2016 06:28:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605170628.u4H6S49H016105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 17 May 2016 06:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300011 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:28:05 -0000 Author: arybchik Date: Tue May 17 06:28:03 2016 New Revision: 300011 URL: https://svnweb.freebsd.org/changeset/base/300011 Log: sfxge(4): only raise an exception after MC assert or reboot in the common code Fix efx_mcdi_request_poll so it only raises an exception if EIO is reported from a detected MC assert or reboot. This prevents an unnecessary exception being raised if an MCDI response error code is trandlated to EIO. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6392 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue May 17 06:27:19 2016 (r300010) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue May 17 06:28:03 2016 (r300011) @@ -519,6 +519,11 @@ efx_mcdi_request_poll( if ((rc = efx_mcdi_poll_reboot(enp)) != 0) { emip->emi_pending_req = NULL; EFSYS_UNLOCK(enp->en_eslp, state); + + /* Reboot/Assertion */ + if (rc == EIO || rc == EINTR) + efx_mcdi_raise_exception(enp, emrp, rc); + goto fail1; } } @@ -553,10 +558,6 @@ fail1: if (!emrp->emr_quiet) EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* Reboot/Assertion */ - if (rc == EIO || rc == EINTR) - efx_mcdi_raise_exception(enp, emrp, rc); - return (B_TRUE); } From owner-svn-src-all@freebsd.org Tue May 17 06:30:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6957B3EE1A; Tue, 17 May 2016 06:30:47 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1EFD194E; Tue, 17 May 2016 06:30:47 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6Uk5D018207; Tue, 17 May 2016 06:30:46 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6Uk4p018205; Tue, 17 May 2016 06:30:46 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605170630.u4H6Uk4p018205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Tue, 17 May 2016 06:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300012 - head/sys/dev/etherswitch/mtkswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:30:48 -0000 Author: sgalabov Date: Tue May 17 06:30:46 2016 New Revision: 300012 URL: https://svnweb.freebsd.org/changeset/base/300012 Log: Fix issues with mt762x etherswitch driver Fix issues that crept in with initial import. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6393 Modified: head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.h Modified: head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c ============================================================================== --- head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c Tue May 17 06:28:03 2016 (r300011) +++ head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c Tue May 17 06:30:46 2016 (r300012) @@ -119,7 +119,6 @@ static uint32_t mtkswitch_reg_read32(struct mtkswitch_softc *sc, int reg) { - MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); return (MTKSWITCH_READ(sc, reg)); } @@ -127,7 +126,6 @@ static uint32_t mtkswitch_reg_write32(struct mtkswitch_softc *sc, int reg, uint32_t val) { - MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); MTKSWITCH_WRITE(sc, reg, val); return (0); } @@ -230,15 +228,21 @@ mtkswitch_port_init(struct mtkswitch_sof /* Called early and hence unlocked */ /* Set the port to secure mode */ - sc->hal.mtkswitch_write(sc, MTKSWITCH_PCR(port), PCR_PORT_VLAN_SECURE); + val = sc->hal.mtkswitch_read(sc, MTKSWITCH_PCR(port)); + val |= PCR_PORT_VLAN_SECURE; + sc->hal.mtkswitch_write(sc, MTKSWITCH_PCR(port), val); /* Set port's vlan_attr to user port */ val = sc->hal.mtkswitch_read(sc, MTKSWITCH_PVC(port)); - val &= PVC_VLAN_ATTR_MASK; + val &= ~PVC_VLAN_ATTR_MASK; sc->hal.mtkswitch_write(sc, MTKSWITCH_PVC(port), val); + val = PMCR_CFG_DEFAULT; + if (port == sc->cpuport) + val |= PMCR_FORCE_LINK | PMCR_FORCE_DPX | PMCR_FORCE_SPD_1000 | + PMCR_FORCE_MODE; /* Set port's MAC to default settings */ - sc->hal.mtkswitch_write(sc, MTKSWITCH_PMCR(port), PMCR_CFG_DEFAULT); + sc->hal.mtkswitch_write(sc, MTKSWITCH_PMCR(port), val); } static uint32_t @@ -353,13 +357,12 @@ mtkswitch_vlan_init_hw(struct mtkswitch_ MTKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); MTKSWITCH_LOCK(sc); - /* Reset all VLANs to defaults first */ for (i = 0; i < sc->info.es_nvlangroups; i++) { mtkswitch_invalidate_vlan(sc, i); if (sc->sc_switchtype == MTK_SWITCH_MT7620) { val = sc->hal.mtkswitch_read(sc, MTKSWITCH_VTIM(i)); - val &= (VTIM_MASK << VTIM_OFF(i)); + val &= ~(VTIM_MASK << VTIM_OFF(i)); val |= ((i + 1) << VTIM_OFF(i)); sc->hal.mtkswitch_write(sc, MTKSWITCH_VTIM(i), val); } @@ -464,7 +467,7 @@ mtkswitch_vlan_setvgroup(struct mtkswitc if (sc->sc_switchtype == MTK_SWITCH_MT7620) { val = sc->hal.mtkswitch_read(sc, MTKSWITCH_VTIM(v->es_vlangroup)); - val &= (VTIM_MASK << VTIM_OFF(v->es_vlangroup)); + val &= ~(VTIM_MASK << VTIM_OFF(v->es_vlangroup)); val |= ((v->es_vid & VTIM_MASK) << VTIM_OFF(v->es_vlangroup)); sc->hal.mtkswitch_write(sc, MTKSWITCH_VTIM(v->es_vlangroup), val); Modified: head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.h ============================================================================== --- head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.h Tue May 17 06:28:03 2016 (r300011) +++ head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.h Tue May 17 06:30:46 2016 (r300012) @@ -85,13 +85,21 @@ #define PPBV_VID_MASK 0xfff #define MTKSWITCH_PMCR(x) MTKSWITCH_PORTREG(0x3000, (x)) +#define PMCR_FORCE_LINK (1u<<0) +#define PMCR_FORCE_DPX (1u<<1) +#define PMCR_FORCE_SPD_1000 (2u<<2) +#define PMCR_FORCE_TX_FC (1u<<4) +#define PMCR_FORCE_RX_FC (1u<<5) #define PMCR_BACKPR_EN (1u<<8) #define PMCR_BKOFF_EN (1u<<9) #define PMCR_MAC_RX_EN (1u<<13) #define PMCR_MAC_TX_EN (1u<<14) +#define PMCR_FORCE_MODE (1u<<15) +#define PMCR_RES_1 (1u<<16) #define PMCR_IPG_CFG_RND (1u<<18) #define PMCR_CFG_DEFAULT (PMCR_BACKPR_EN | PMCR_BKOFF_EN | \ - PMCR_MAC_RX_EN | PMCR_MAC_TX_EN | PMCR_IPG_CFG_RND) + PMCR_MAC_RX_EN | PMCR_MAC_TX_EN | PMCR_IPG_CFG_RND | \ + PMCR_FORCE_RX_FC | PMCR_FORCE_TX_FC | PMCR_RES_1) #define MTKSWITCH_PMSR(x) MTKSWITCH_PORTREG(0x3008, (x)) #define PMSR_MAC_LINK_STS (1u<<0) From owner-svn-src-all@freebsd.org Tue May 17 06:42:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7936B3E1DE; Tue, 17 May 2016 06:42:26 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87CAE10BB; Tue, 17 May 2016 06:42:26 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6gPwo021878; Tue, 17 May 2016 06:42:25 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6gOAf021867; Tue, 17 May 2016 06:42:24 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605170642.u4H6gOAf021867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Tue, 17 May 2016 06:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300013 - in head/sys: boot/fdt/dts/mips gnu/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:42:26 -0000 Author: sgalabov Date: Tue May 17 06:42:24 2016 New Revision: 300013 URL: https://svnweb.freebsd.org/changeset/base/300013 Log: Import LEDE dts files for Ralink/Mediatek This is an import of the reworked LEDE dts files. Besides other things they make it easier for us to reuse. The only diffs left are for the following SoCs: MT7620A (fbsd-mt7620a.dtsi) MT7621 (fbsd-mt7621.dtsi) MT7628 (fbsd-mt7628an.dtsi) RT3883 (fbsd-rt3883.dtsi) So we include the fbsd-*.dtsi files at the end of the original LEDE dtsi files, using '#include "fbsd-xxxx.dtsi"'. For example, for MT7621, the LEDE dtsi file is mt7621.dtsi. At the end of it we add: #include "fbsd-mt7621.dtsi" Approved by: adrian (mentor) Obtained from: LEDE project Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6394 Added: head/sys/gnu/dts/mips/CS-QR10.dts (contents, props changed) head/sys/gnu/dts/mips/MZK-EX300NP.dts (contents, props changed) head/sys/gnu/dts/mips/MZK-EX750NP.dts (contents, props changed) head/sys/gnu/dts/mips/SK-WB8.dts (contents, props changed) head/sys/gnu/dts/mips/WNDR3700V5.dts (contents, props changed) head/sys/gnu/dts/mips/WRH-300CR.dts (contents, props changed) head/sys/gnu/dts/mips/ZBT-WG3526.dts (contents, props changed) Deleted: head/sys/boot/fdt/dts/mips/fbsd-mt7620n.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt2880.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt3050.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt3352.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt5350.dtsi Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi head/sys/gnu/dts/mips/3G-6200N.dts head/sys/gnu/dts/mips/3G-6200NL.dts head/sys/gnu/dts/mips/3G150B.dts head/sys/gnu/dts/mips/3G300M.dts head/sys/gnu/dts/mips/A5-V11.dts head/sys/gnu/dts/mips/AI-BR100.dts head/sys/gnu/dts/mips/AIR3GII.dts head/sys/gnu/dts/mips/ALL0239-3G.dts head/sys/gnu/dts/mips/ALL0256N-4M.dts head/sys/gnu/dts/mips/ALL0256N-8M.dts head/sys/gnu/dts/mips/ALL5002.dts head/sys/gnu/dts/mips/ALL5003.dts head/sys/gnu/dts/mips/AR670W.dts head/sys/gnu/dts/mips/AR725W.dts head/sys/gnu/dts/mips/ASL26555-16M.dts head/sys/gnu/dts/mips/ASL26555-8M.dts head/sys/gnu/dts/mips/ATP-52B.dts head/sys/gnu/dts/mips/AWAPN2403.dts head/sys/gnu/dts/mips/AWM002-4M.dtsi head/sys/gnu/dts/mips/AWM002-8M.dtsi head/sys/gnu/dts/mips/AWM002-EVB-4M.dts head/sys/gnu/dts/mips/AWM002-EVB-8M.dts head/sys/gnu/dts/mips/AWM002.dtsi head/sys/gnu/dts/mips/AWM003-EVB.dts head/sys/gnu/dts/mips/ArcherC20i.dts head/sys/gnu/dts/mips/BC2.dts head/sys/gnu/dts/mips/BR-6425.dts head/sys/gnu/dts/mips/BR-6475ND.dts head/sys/gnu/dts/mips/BROADWAY.dts head/sys/gnu/dts/mips/CARAMBOLA.dts head/sys/gnu/dts/mips/CF-WR800N.dts head/sys/gnu/dts/mips/CY-SWR1100.dts head/sys/gnu/dts/mips/D105.dts head/sys/gnu/dts/mips/DAP-1350.dts head/sys/gnu/dts/mips/DB-WRT01.dts head/sys/gnu/dts/mips/DCS-930.dts head/sys/gnu/dts/mips/DCS-930L-B1.dts head/sys/gnu/dts/mips/DIR-300-B1.dts head/sys/gnu/dts/mips/DIR-300-B7.dts head/sys/gnu/dts/mips/DIR-320-B1.dts head/sys/gnu/dts/mips/DIR-600-B1.dts head/sys/gnu/dts/mips/DIR-600-B2.dts head/sys/gnu/dts/mips/DIR-610-A1.dts head/sys/gnu/dts/mips/DIR-615-D.dts head/sys/gnu/dts/mips/DIR-615-H1.dts head/sys/gnu/dts/mips/DIR-620-A1.dts head/sys/gnu/dts/mips/DIR-620-D1.dts head/sys/gnu/dts/mips/DIR-645.dts head/sys/gnu/dts/mips/DIR-810L.dts head/sys/gnu/dts/mips/DIR-860L-B1.dts head/sys/gnu/dts/mips/E1700.dts head/sys/gnu/dts/mips/ESR-9753.dts head/sys/gnu/dts/mips/EX2700.dts head/sys/gnu/dts/mips/F5D8235_V1.dts head/sys/gnu/dts/mips/F5D8235_V2.dts head/sys/gnu/dts/mips/F7C027.dts head/sys/gnu/dts/mips/FIREWRT.dts head/sys/gnu/dts/mips/FONERA20N.dts head/sys/gnu/dts/mips/FREESTATION5.dts head/sys/gnu/dts/mips/GL-MT300A.dts head/sys/gnu/dts/mips/GL-MT300N.dts head/sys/gnu/dts/mips/GL-MT750.dts head/sys/gnu/dts/mips/HC5661.dts head/sys/gnu/dts/mips/HC5761.dts head/sys/gnu/dts/mips/HC5861.dts head/sys/gnu/dts/mips/HC5XXX.dtsi head/sys/gnu/dts/mips/HG255D.dts head/sys/gnu/dts/mips/HLKRM04.dts head/sys/gnu/dts/mips/HPM.dts head/sys/gnu/dts/mips/HT-TM02.dts head/sys/gnu/dts/mips/HW550-3G.dts head/sys/gnu/dts/mips/IP2202.dts head/sys/gnu/dts/mips/JHR-N805R.dts head/sys/gnu/dts/mips/JHR-N825R.dts head/sys/gnu/dts/mips/JHR-N926R.dts head/sys/gnu/dts/mips/LINKIT7688.dts head/sys/gnu/dts/mips/M2M.dts head/sys/gnu/dts/mips/M3.dts head/sys/gnu/dts/mips/M4-4M.dts head/sys/gnu/dts/mips/M4-8M.dts head/sys/gnu/dts/mips/MINIEMBPLUG.dts head/sys/gnu/dts/mips/MINIEMBWIFI.dts head/sys/gnu/dts/mips/MIWIFI-MINI.dts head/sys/gnu/dts/mips/MIWIFI-NANO.dts head/sys/gnu/dts/mips/MLW221.dts head/sys/gnu/dts/mips/MLWG2.dts head/sys/gnu/dts/mips/MOFI3500-3GN.dts head/sys/gnu/dts/mips/MPRA1.dts head/sys/gnu/dts/mips/MPRA2.dts head/sys/gnu/dts/mips/MR-102N.dts head/sys/gnu/dts/mips/MT7620a.dts head/sys/gnu/dts/mips/MT7620a_MT7530.dts head/sys/gnu/dts/mips/MT7620a_MT7610e.dts head/sys/gnu/dts/mips/MT7620a_V22SG.dts head/sys/gnu/dts/mips/MT7621.dts head/sys/gnu/dts/mips/MT7628.dts head/sys/gnu/dts/mips/MZK-750DHP.dts head/sys/gnu/dts/mips/MZK-DP150N.dts head/sys/gnu/dts/mips/MZK-W300NH2.dts head/sys/gnu/dts/mips/MZK-WDPR.dts head/sys/gnu/dts/mips/MicroWRT.dts head/sys/gnu/dts/mips/NA930.dts head/sys/gnu/dts/mips/NBG-419N.dts head/sys/gnu/dts/mips/NCS601W.dts head/sys/gnu/dts/mips/NW718.dts head/sys/gnu/dts/mips/OY-0001.dts head/sys/gnu/dts/mips/PBR-M1.dts head/sys/gnu/dts/mips/PSG1208.dts head/sys/gnu/dts/mips/PSR-680W.dts head/sys/gnu/dts/mips/PWH2004.dts head/sys/gnu/dts/mips/PX-4885-4M.dts head/sys/gnu/dts/mips/PX-4885-8M.dts head/sys/gnu/dts/mips/PX-4885.dtsi head/sys/gnu/dts/mips/RE6500.dts head/sys/gnu/dts/mips/RP-N53.dts head/sys/gnu/dts/mips/RT-G32-B1.dts head/sys/gnu/dts/mips/RT-N10-PLUS.dts head/sys/gnu/dts/mips/RT-N13U.dts head/sys/gnu/dts/mips/RT-N14U.dts head/sys/gnu/dts/mips/RT-N15.dts head/sys/gnu/dts/mips/RT-N56U.dts head/sys/gnu/dts/mips/RT5350F-OLINUXINO-EVB.dts head/sys/gnu/dts/mips/RT5350F-OLINUXINO.dts head/sys/gnu/dts/mips/RUT5XX.dts head/sys/gnu/dts/mips/SAP-G3200U3.dts head/sys/gnu/dts/mips/SL-R7205.dts head/sys/gnu/dts/mips/TEW-691GR.dts head/sys/gnu/dts/mips/TEW-692GR.dts head/sys/gnu/dts/mips/TINY-AC.dts head/sys/gnu/dts/mips/UBNT-ERX.dts head/sys/gnu/dts/mips/UR-326N4G.dts head/sys/gnu/dts/mips/UR-336UN.dts head/sys/gnu/dts/mips/V11STFE.dts head/sys/gnu/dts/mips/V22RW-2X2.dts head/sys/gnu/dts/mips/VOCORE-16M.dts head/sys/gnu/dts/mips/VOCORE-8M.dts head/sys/gnu/dts/mips/VOCORE.dtsi head/sys/gnu/dts/mips/W150M.dts head/sys/gnu/dts/mips/W306R_V20.dts head/sys/gnu/dts/mips/W502U.dts head/sys/gnu/dts/mips/WCR150GN.dts head/sys/gnu/dts/mips/WF-2881.dts head/sys/gnu/dts/mips/WHR-1166D.dts head/sys/gnu/dts/mips/WHR-300HP2.dts head/sys/gnu/dts/mips/WHR-600D.dts head/sys/gnu/dts/mips/WHR-G300N.dts head/sys/gnu/dts/mips/WITI.dts head/sys/gnu/dts/mips/WIZARD8800.dts head/sys/gnu/dts/mips/WIZFI630A.dts head/sys/gnu/dts/mips/WL-330N.dts head/sys/gnu/dts/mips/WL-330N3G.dts head/sys/gnu/dts/mips/WL-341V3.dts head/sys/gnu/dts/mips/WL-351.dts head/sys/gnu/dts/mips/WLI-TX4-AG300N.dts head/sys/gnu/dts/mips/WMR-300.dts head/sys/gnu/dts/mips/WNCE2001.dts head/sys/gnu/dts/mips/WR512-3GN-4M.dts head/sys/gnu/dts/mips/WR512-3GN-8M.dts head/sys/gnu/dts/mips/WR6202.dts head/sys/gnu/dts/mips/WRTNODE.dts head/sys/gnu/dts/mips/WRTNODE2.dtsi head/sys/gnu/dts/mips/WRTNODE2P.dts head/sys/gnu/dts/mips/WRTNODE2R.dts head/sys/gnu/dts/mips/WSR-1166.dts head/sys/gnu/dts/mips/WSR-600.dts head/sys/gnu/dts/mips/WT1520-4M.dts head/sys/gnu/dts/mips/WT1520-8M.dts head/sys/gnu/dts/mips/WT1520.dtsi head/sys/gnu/dts/mips/WT3020-4M.dts head/sys/gnu/dts/mips/WT3020-8M.dts head/sys/gnu/dts/mips/WZR-AGL300NH.dts head/sys/gnu/dts/mips/X5.dts head/sys/gnu/dts/mips/X8.dts head/sys/gnu/dts/mips/XDXRN502J.dts head/sys/gnu/dts/mips/Y1.dts head/sys/gnu/dts/mips/Y1.dtsi head/sys/gnu/dts/mips/Y1S.dts head/sys/gnu/dts/mips/YOUKU-YK1.dts head/sys/gnu/dts/mips/ZBT-WA05.dts head/sys/gnu/dts/mips/ZBT-WE826.dts head/sys/gnu/dts/mips/ZBT-WG2626.dts head/sys/gnu/dts/mips/ZBT-WR8305RT.dts head/sys/gnu/dts/mips/ZTE-Q7.dts head/sys/gnu/dts/mips/mt7620a.dtsi head/sys/gnu/dts/mips/mt7620n.dtsi head/sys/gnu/dts/mips/mt7621.dtsi head/sys/gnu/dts/mips/mt7628an.dtsi head/sys/gnu/dts/mips/rt2880.dtsi head/sys/gnu/dts/mips/rt3050.dtsi head/sys/gnu/dts/mips/rt3352.dtsi head/sys/gnu/dts/mips/rt3883.dtsi head/sys/gnu/dts/mips/rt5350.dtsi Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi Tue May 17 06:30:46 2016 (r300012) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi Tue May 17 06:42:24 2016 (r300013) @@ -1,35 +1,9 @@ /* $FreeBSD$ */ -/ { - /* Specify alias for serial0 so we have a working console */ - aliases { - serial0 = "/palmbus@10000000/uartlite@c00"; - }; - +&pcie { /* - * OpenWRT doesn't define a clock controller, but we currently need one + * Our driver is different that OpenWRT's, so we need slightly + * different values for the reg property */ - clkctrl: cltctrl { - compatible = "ralink,rt2880-clock"; - #clock-cells = <1>; - }; - - /* Specify the clocks node for the usbphy */ - usbphy: usbphy { - clocks = <&clkctrl 22 &clkctrl 25>; - }; - - pcie@10140000 { - /* - * Our driver is different that OpenWRT's, so we need slightly - * different values for the reg property - */ - reg = <0x10140000 0x10000>; - - /* - * Also, we need resets and clocks defined, so we can properly - * initialize the PCIe - */ - clocks = <&clkctrl 26>; - }; + reg = <0x10140000 0x10000>; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi Tue May 17 06:30:46 2016 (r300012) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi Tue May 17 06:42:24 2016 (r300013) @@ -1,73 +1,49 @@ /* $FreeBSD$ */ -/ { - /* Specify alias for serial0 so we have a working console */ - aliases { - serial0 = "/palmbus@1E000000/uartlite@c00"; - }; - - /* - * OpenWRT doesn't define a clock controller, but we currently need one - */ - clkctrl: cltctrl { - compatible = "ralink,rt2880-clock"; - #clock-cells = <1>; - }; - - palmbus@1E000000 { - uartlite@c00 { clock-frequency = <50000000>; }; +&palmbus { + gpio@600 { + /* + * Mark gpio as compatible to simple-bus and override + * its #size-cells and provide a default ranges property + * so we can attach instances of our mtk_gpio_v2 driver + * to it for now. Provide exactly the same resources to + * the instances of mtk_gpio_v2. + */ + compatible = "simple-bus"; + ranges = <0x0 0x600 0x100>; + #size-cells = <1>; + + interrupt-parent = <&gic>; + + gpio0: bank@0 { + reg = <0x0 0x100>; + interrupts = <0 6 4>; + }; - gpio@600 { - /* - * Mark gpio as compatible to simple-bus and override - * its #size-cells and provide a default ranges property - * so we can attach instances of our mtk_gpio_v2 driver - * to it for now. Provide exactly the same resources to - * the instances of mtk_gpio_v2. - */ - compatible = "simple-bus"; - ranges = <0x0 0x600 0x100>; - #size-cells = <1>; - - interrupt-parent = <&gic>; - - gpio0: bank@0 { - reg = <0x0 0x100>; - interrupts = <0 6 4>; - }; - - gpio1: bank@1 { - reg = <0x0 0x100>; - interrupts = <0 6 4>; - }; - - gpio2: bank@2 { - reg = <0x0 0x100>; - interrupts = <0 6 4>; - }; + gpio1: bank@1 { + reg = <0x0 0x100>; + interrupts = <0 6 4>; }; - }; - xhci@1E1C0000 { - /* - * A slightly different value for reg size is needed by our - * driver for the moment - */ - reg = <0x1e1c0000 0x20000>; + gpio2: bank@2 { + reg = <0x0 0x100>; + interrupts = <0 6 4>; + }; }; +}; - pcie@1e140000 { - /* - * Our driver is different that OpenWRT's, so we need slightly - * different values for the reg property - */ - reg = <0x1e140000 0x10000>; +&xhci { + /* + * A slightly different value for reg size is needed by our + * driver for the moment + */ + reg = <0x1e1c0000 0x20000>; +}; - /* - * Also, we need resets and clocks defined, so we can properly - * initialize the PCIe - */ - resets = <&rstctrl 24>, <&rstctrl 25>, <&rstctrl 26>; - clocks = <&clkctrl 24>, <&clkctrl 25>, <&clkctrl 26>; - }; +&pcie { + /* + * Our driver is different that OpenWRT's, so we need slightly + * different values for the reg property + */ + reg = <0x1e140000 0x10000>; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi Tue May 17 06:30:46 2016 (r300012) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi Tue May 17 06:42:24 2016 (r300013) @@ -1,70 +1,39 @@ /* $FreeBSD$ */ -/ { - /* Specify alias for serial0 so we have a working console */ - aliases { - serial0 = "/palmbus@10000000/uart2@e00"; - }; - - /* - * OpenWRT doesn't define a clock controller, but we currently need one - */ - clkctrl: cltctrl { - compatible = "ralink,rt2880-clock"; - #clock-cells = <1>; - }; - - palmbus@10000000 { - uartlite@c00 { clock-frequency = <40000000>; }; - uart1@d00 { clock-frequency = <40000000>; }; - uart2@e00 { clock-frequency = <40000000>; }; - - gpio@600 { - /* - * Mark gpio as compatible to simple-bus and override - * its #size-cells and provide a default ranges property - * so we can attach instances of our mtk_gpio_v2 driver - * to it for now. Provide exactly the same resources to - * the instances of mtk_gpio_v2. - */ - compatible = "simple-bus"; - ranges = <0x0 0x600 0x100>; - #size-cells = <1>; - - gpio0: bank@0 { - reg = <0x0 0x100>; - interrupts = <6>; - }; - - gpio1: bank@1 { - reg = <0x0 0x100>; - interrupts = <6>; - }; +&palmbus { + gpio@600 { + /* + * Mark gpio as compatible to simple-bus and override + * its #size-cells and provide a default ranges property + * so we can attach instances of our mtk_gpio_v2 driver + * to it for now. Provide exactly the same resources to + * the instances of mtk_gpio_v2. + */ + compatible = "simple-bus"; + ranges = <0x0 0x600 0x100>; + #size-cells = <1>; + + gpio0: bank@0 { + reg = <0x0 0x100>; + interrupts = <6>; + }; - gpio2: bank@2 { - reg = <0x0 0x100>; - interrupts = <6>; - }; + gpio1: bank@1 { + reg = <0x0 0x100>; + interrupts = <6>; }; - }; - /* Specify the clocks node for the usbphy */ - usbphy: usbphy@10120000 { - clocks = <&clkctrl 22 &clkctrl 25>; + gpio2: bank@2 { + reg = <0x0 0x100>; + interrupts = <6>; + }; }; +}; - pcie@10140000 { +&pcie { /* * Our driver is different that OpenWRT's, so we need slightly * different values for the reg property */ reg = <0x10140000 0x10000>; - - /* - * Also, we need resets and clocks defined, so we can properly - * initialize the PCIe - */ - resets = <&rstctrl 26>, <&rstctrl 27>; - clocks = <&clkctrl 26>, <&clkctrl 27>; - }; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi Tue May 17 06:30:46 2016 (r300012) +++ head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi Tue May 17 06:42:24 2016 (r300013) @@ -1,37 +1,16 @@ /* $FreeBSD$ */ -/ { - /* Specify alias for serial0 so we have a working console */ - aliases { - serial0 = "/palmbus@10000000/uartlite@c00"; - }; +&pci { + #address-cells = <3>; + #size-cells = <2>; + ranges = < + 0x02000000 0 0x00000000 0x20000000 0 0x10000000 + 0x01000000 0 0x00000000 0x10160000 0 0x00010000 + >; - /* - * OpenWRT doesn't define a clock controller, but we currently need one - */ - clkctrl: cltctrl { - compatible = "ralink,rt2880-clock"; - #clock-cells = <1>; - }; + interrupt-parent = <&cpuintc>; + interrupts = <4>; - /* Specify the clocks node for the usbphy */ - usbphy: usbphy { - clocks = <&clkctrl 22 &clkctrl 25>; - clock-names = "host", "device"; - }; - - pci@10140000 { - #address-cells = <3>; - #size-cells = <2>; - ranges = < - 0x02000000 0 0x00000000 0x20000000 0 0x10000000 - 0x01000000 0 0x00000000 0x10160000 0 0x00010000 - >; - - interrupt-parent = <&cpuintc>; - interrupts = <4>; - - resets = <&rstctrl 23>; - clocks = <&clkctrl 21>; - }; + resets = <&rstctrl 23>; + clocks = <&clkctrl 21>; }; Modified: head/sys/gnu/dts/mips/3G-6200N.dts ============================================================================== --- head/sys/gnu/dts/mips/3G-6200N.dts Tue May 17 06:30:46 2016 (r300012) +++ head/sys/gnu/dts/mips/3G-6200N.dts Tue May 17 06:42:24 2016 (r300013) @@ -1,20 +1,11 @@ /dts-v1/; -/include/ "rt3050.dtsi" +#include "rt3050.dtsi" / { compatible = "3G-6200N", "ralink,rt3050-soc"; model = "Edimax 3g-6200n"; - pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf"; - ralink,function = "gpio"; - }; - }; - }; - cfi@1f000000 { compatible = "cfi-flash"; reg = <0x1f000000 0x800000>; @@ -53,18 +44,6 @@ }; }; - ethernet@10100000 { - mtd-mac-address = <&factory 0x4>; - }; - - esw@10110000 { - mediatek,portmap = <0x2f>; - }; - - wmac@10180000 { - ralink,mtd-eeprom = <&factory 0>; - }; - gpio-leds { compatible = "gpio-leds"; @@ -102,8 +81,29 @@ linux,code = <0x100>; }; }; +}; - otg@101c0000 { - status = "okay"; +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf"; + ralink,function = "gpio"; + }; }; }; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&otg { + status = "okay"; +}; Modified: head/sys/gnu/dts/mips/3G-6200NL.dts ============================================================================== --- head/sys/gnu/dts/mips/3G-6200NL.dts Tue May 17 06:30:46 2016 (r300012) +++ head/sys/gnu/dts/mips/3G-6200NL.dts Tue May 17 06:42:24 2016 (r300013) @@ -1,20 +1,11 @@ /dts-v1/; -/include/ "rt3050.dtsi" +#include "rt3050.dtsi" / { compatible = "3G-6200NL", "ralink,rt3050-soc"; model = "Edimax 3g-6200nl"; - pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf"; - ralink,function = "gpio"; - }; - }; - }; - cfi@1f000000 { compatible = "cfi-flash"; reg = <0x1f000000 0x800000>; @@ -53,18 +44,6 @@ }; }; - ethernet@10100000 { - mtd-mac-address = <&factory 0x4>; - }; - - esw@10110000 { - mediatek,portmap = <0x2f>; - }; - - wmac@10180000 { - ralink,mtd-eeprom = <&factory 0>; - }; - gpio-leds { compatible = "gpio-leds"; @@ -86,8 +65,29 @@ linux,code = <0x211>; }; }; +}; - otg@101c0000 { - status = "okay"; +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf"; + ralink,function = "gpio"; + }; }; }; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&otg { + status = "okay"; +}; Modified: head/sys/gnu/dts/mips/3G150B.dts ============================================================================== --- head/sys/gnu/dts/mips/3G150B.dts Tue May 17 06:30:46 2016 (r300012) +++ head/sys/gnu/dts/mips/3G150B.dts Tue May 17 06:42:24 2016 (r300013) @@ -1,83 +1,11 @@ /dts-v1/; -/include/ "rt5350.dtsi" +#include "rt5350.dtsi" / { compatible = "3G150B", "ralink,rt5350-soc"; model = "Tenda 3G150B"; - palmbus@10000000 { - spi@b00 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0 0>; - linux,modalias = "m25p80", "s25fl064k"; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; - - gpio1: gpio@660 { - status = "okay"; - }; - }; - - pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf", "led"; - ralink,function = "gpio"; - }; - }; - }; - - ethernet@10100000 { - mtd-mac-address = <&factory 0x4>; - }; - - esw@10110000 { - mediatek,portmap = <0x2f>; - }; - - wmac@10180000 { - ralink,mtd-eeprom = <&factory 0>; - ralink,led-polarity = <1>; - }; - - ehci@101c0000 { - status = "okay"; - }; - - ohci@101c1000 { - status = "okay"; - }; - gpio-leds { compatible = "gpio-leds"; @@ -116,3 +44,73 @@ }; }; }; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0 0>; + linux,modalias = "m25p80", "s25fl064k"; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3b0000>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf", "led"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; + ralink,led-polarity = <1>; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; Modified: head/sys/gnu/dts/mips/3G300M.dts ============================================================================== --- head/sys/gnu/dts/mips/3G300M.dts Tue May 17 06:30:46 2016 (r300012) +++ head/sys/gnu/dts/mips/3G300M.dts Tue May 17 06:42:24 2016 (r300013) @@ -1,58 +1,11 @@ /dts-v1/; -/include/ "rt3050.dtsi" +#include "rt3050.dtsi" / { compatible = "3G300M", "ralink,rt3052-soc"; model = "Tenda 3G300M"; - palmbus@10000000 { - spi@b00 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0 0>; - linux,modalias = "m25p80", "mx25l3205d"; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; - }; - - pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf"; - ralink,function = "gpio"; - }; - }; - }; - gpio-leds { compatible = "gpio-leds"; @@ -105,20 +58,65 @@ linux,code = <0x100>; }; }; +}; - ethernet@10100000 { - mtd-mac-address = <&factory 0x4>; - }; +&spi0 { + status = "okay"; - esw@10110000 { - mediatek,portmap = <0x2f>; - }; + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0 0>; + linux,modalias = "m25p80", "mx25l3205d"; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; - wmac@10180000 { - ralink,mtd-eeprom = <&factory 0>; + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3b0000>; + }; }; +}; - otg@101c0000 { - status = "okay"; +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf"; + ralink,function = "gpio"; + }; }; }; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&otg { + status = "okay"; +}; Modified: head/sys/gnu/dts/mips/A5-V11.dts ============================================================================== --- head/sys/gnu/dts/mips/A5-V11.dts Tue May 17 06:30:46 2016 (r300012) +++ head/sys/gnu/dts/mips/A5-V11.dts Tue May 17 06:42:24 2016 (r300013) @@ -1,82 +1,11 @@ /dts-v1/; -/include/ "rt5350.dtsi" +#include "rt5350.dtsi" / { compatible = "A5-V11", "ralink,rt5350-soc"; model = "A5-V11"; - palmbus@10000000 { - spi@b00 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0 0>; - linux,modalias = "m25p80", "pm25lq032"; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; - - gpio1: gpio@660 { - status = "okay"; - }; - }; - - pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "i2c", "jtag", "uartf", "led"; - ralink,function = "gpio"; - }; - }; - }; - - ethernet@10100000 { - mtd-mac-address = <&factory 0x4>; - }; - - esw@10110000 { - mediatek,portmap = <0x2f>; - }; - - wmac@10180000 { - ralink,mtd-eeprom = <&factory 0>; - }; - - ehci@101c0000 { - status = "okay"; - }; - - ohci@101c1000 { - status = "okay"; - }; - gpio-leds { compatible = "gpio-leds"; @@ -121,3 +50,73 @@ }; }; }; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0 0>; + linux,modalias = "m25p80", "pm25lq032"; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3b0000>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag", "uartf", "led"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&esw { + mediatek,portmap = <0x1>; + mediatek,portdisable = <0x3e>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; Modified: head/sys/gnu/dts/mips/AI-BR100.dts ============================================================================== --- head/sys/gnu/dts/mips/AI-BR100.dts Tue May 17 06:30:46 2016 (r300012) +++ head/sys/gnu/dts/mips/AI-BR100.dts Tue May 17 06:42:24 2016 (r300013) @@ -1,85 +1,11 @@ /dts-v1/; -/include/ "mt7620a.dtsi" +#include "mt7620a.dtsi" / { compatible = "AI-BR100", "ralink,mt7620a-soc"; model = "Aigale Ai-BR100"; - palmbus@10000000 { - gpio2: gpio@660 { - status = "okay"; - }; - - gpio3: gpio@688 { - status = "okay"; - }; - - spi@b00 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0 0>; - linux,modalias = "m25p80", "en25q64"; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x20000>; - read-only; - }; - - partition@20000 { - label = "u-boot-env"; - reg = <0x20000 0x10000>; - read-only; - }; - - factory: partition@30000 { - label = "factory"; - reg = <0x30000 0x10000>; - read-only; - }; - - partition@40000 { - label = "firmware"; - reg = <0x40000 0x7c0000>; - }; - }; - }; - }; - - ehci@101c0000 { - status = "okay"; - }; - - ohci@101c1000 { - status = "okay"; - }; - - pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd"; - ralink,function = "gpio"; - }; - }; - }; - - ethernet@10100000 { - pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; - mtd-mac-address = <&factory 0x4>; - mediatek,portmap = "llllw"; - }; - - wmac@10180000 { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 17 06:45:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6914B3E298; Tue, 17 May 2016 06:45:26 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3A9212B6; Tue, 17 May 2016 06:45:26 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H6jPEi022036; Tue, 17 May 2016 06:45:25 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6jPTl022034; Tue, 17 May 2016 06:45:25 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605170645.u4H6jPTl022034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Tue, 17 May 2016 06:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300014 - in head/sys: boot/fdt/dts/mips mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:45:26 -0000 Author: sgalabov Date: Tue May 17 06:45:25 2016 New Revision: 300014 URL: https://svnweb.freebsd.org/changeset/base/300014 Log: Add proper PCIe init for MT7628/MT7688 SoCs PCIe PHY needs different initialization on MT7628/MT7688 SoCs than it does on MT7620. However, LEDE (and OpenWRT) dts files have the PCIe node for MT7628/MT7688 as compatible with mt7620-pci. We already can handle this properly in our driver, so we just need to add compat strings to fbsd-mt7628an.dtsi and the PCIe driver. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6395 Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi head/sys/mips/mediatek/mtk_pcie.c Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi Tue May 17 06:42:24 2016 (r300013) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi Tue May 17 06:45:25 2016 (r300014) @@ -36,4 +36,5 @@ * different values for the reg property */ reg = <0x10140000 0x10000>; + compatible = "mediatek,mt7628-pci"; }; Modified: head/sys/mips/mediatek/mtk_pcie.c ============================================================================== --- head/sys/mips/mediatek/mtk_pcie.c Tue May 17 06:42:24 2016 (r300013) +++ head/sys/mips/mediatek/mtk_pcie.c Tue May 17 06:45:25 2016 (r300014) @@ -203,6 +203,7 @@ mtk_pci_ranges(phandle_t node, struct mt static struct ofw_compat_data compat_data[] = { { "ralink,rt3883-pci", MTK_SOC_RT3883 }, { "mediatek,mt7620-pci", MTK_SOC_MT7620A }, + { "mediatek,mt7628-pci", MTK_SOC_MT7628 }, { "mediatek,mt7621-pci", MTK_SOC_MT7621 }, { NULL, MTK_SOC_UNKNOWN } }; From owner-svn-src-all@freebsd.org Tue May 17 06:52:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34F63B3E61D; Tue, 17 May 2016 06:52: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 C9B1D1898; Tue, 17 May 2016 06:52:55 +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 u4H6qtwo024912; Tue, 17 May 2016 06:52:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H6qsmQ024900; Tue, 17 May 2016 06:52:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170652.u4H6qsmQ024900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 06:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300015 - in head/sys: conf dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/pci dev/bhnd/cores/pcie2 dev/bhnd/siba modules/bhnd/cores/bhnd_pci modules/bhnd/cores/bhnd_pci_ho... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:52:56 -0000 Author: adrian Date: Tue May 17 06:52:53 2016 New Revision: 300015 URL: https://svnweb.freebsd.org/changeset/base/300015 Log: [bhnd] Finish bhnd(4) PCI/PCIe-G1 hostb support. Now that we've got access to SPROM and can access board identification, this implements all known remaining hardware work-arounds for the bhnd(4) PCI and PCIe-G1 cores operating endpoint mode. Additionally, this adds an initial set of skeleton PCIe-G2 hostb and pcib drivers, required by fullmac and newer softmac devices. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6377 Added: head/sys/dev/bhnd/cores/pcie2/ head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c (contents, props changed) head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c (contents, props changed) head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostbvar.h (contents, props changed) head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_reg.h (contents, props changed) head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_var.h (contents, props changed) head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2b.c (contents, props changed) head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2b_var.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pcireg.h head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/pci/bhnd_pci.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostbvar.h head/sys/dev/bhnd/cores/pci/bhnd_pcib.c head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/dev/bhnd/siba/sibavar.h head/sys/modules/bhnd/cores/bhnd_pci/Makefile head/sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile head/sys/modules/bhnd/cores/bhnd_pcib/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 17 06:45:25 2016 (r300014) +++ head/sys/conf/files Tue May 17 06:52:53 2016 (r300015) @@ -1142,6 +1142,9 @@ dev/bhnd/cores/chipc/bhnd_chipc_if.m opt dev/bhnd/cores/pci/bhnd_pci.c optional bhndbus pci | bhnd pci dev/bhnd/cores/pci/bhnd_pci_hostb.c optional bhndbus pci | bhndb pci dev/bhnd/cores/pci/bhnd_pcib.c optional bhnd_pcib bhnd pci +dev/bhnd/cores/pcie2/bhnd_pcie2.c optional bhndbus pci | bhnd pci +dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c optional bhndbus pci | bhndb pci +dev/bhnd/cores/pcie2/bhnd_pcie2b.c optional bhnd_pcie2b bhnd pci dev/bhnd/nvram/bhnd_nvram_if.m optional bhndbus | bhnd dev/bhnd/nvram/bhnd_sprom.c optional bhndbus | bhnd dev/bhnd/nvram/nvram_subr.c optional bhndbus | bhnd Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/bhnd.h Tue May 17 06:52:53 2016 (r300015) @@ -318,8 +318,8 @@ struct bhnd_chip_match { .match_bvendor = 1, .board_vendor = _vend /** Set the required board type within a bhnd_chip_match instance */ -#define BHND_CHIP_BT(_btype) \ - .match_btype = 1, .board_type = BHND_BOARD_BCM ## _btype +#define BHND_CHIP_BTYPE(_btype) \ + .match_btype = 1, .board_type = BHND_BOARD_ ## _btype /** Set the required SROM revision range within a bhnd_chip_match instance */ #define BHND_CHIP_SROMREV(_rev) \ @@ -331,7 +331,7 @@ struct bhnd_chip_match { /** Set the required board vendor and type within a bhnd_chip_match instance */ #define BHND_CHIP_BVT(_vend, _type) \ - BHND_CHIP_BVEND(_vend), BHND_CHIP_BTYPE(_type) + BHND_CHIP_BVENDOR(_vend), BHND_CHIP_BTYPE(_type) /** Set the required board vendor, type, and revision within a bhnd_chip_match * instance */ @@ -429,6 +429,9 @@ device_t bhnd_match_child(device_t de device_t bhnd_find_child(device_t dev, bhnd_devclass_t class, int unit); +device_t bhnd_find_bridge_root(device_t dev, + devclass_t bus_class); + const struct bhnd_core_info *bhnd_match_core( const struct bhnd_core_info *cores, u_int num_cores, Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/bhnd_ids.h Tue May 17 06:52:53 2016 (r300015) @@ -26,8 +26,6 @@ #ifndef _BHND_BHND_IDS_H_ #define _BHND_BHND_IDS_H_ - - /* * JEDEC JEP-106 Core Vendor IDs * @@ -851,12 +849,12 @@ #define BHND_BOARD_BU4785 0x0478 /* 4321 boards */ -#define BHND_BOARD_BU4321 0x046b -#define BHND_BOARD_BU4321E 0x047c -#define BHND_BOARD_MP4321 0x046c -#define BHND_BOARD_CB2_4321 0x046d -#define BHND_BOARD_CB2_4321_AG 0x0066 -#define BHND_BOARD_MC4321 0x046e +#define BHND_BOARD_BCM4321BU 0x046b +#define BHND_BOARD_BCM4321BUE 0x047c +#define BHND_BOARD_BCM4321MP 0x046c +#define BHND_BOARD_BCM4321CB2 0x046d +#define BHND_BOARD_BCM4321CB2_AG 0x0066 +#define BHND_BOARD_BCM4321MC 0x046e /* 4328 boards */ #define BHND_BOARD_BU4328 0x0481 Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/bhnd_subr.c Tue May 17 06:52:53 2016 (r300015) @@ -350,6 +350,56 @@ done: } /** + * Walk up the bhnd device hierarchy to locate the root device + * to which the bhndb bridge is attached. + * + * This can be used from within bhnd host bridge drivers to locate the + * actual upstream host device. + * + * @param dev A bhnd device. + * @param bus_class The expected bus (e.g. "pci") to which the bridge root + * should be attached. + * + * @retval device_t if a matching parent device is found. + * @retval NULL @p dev is not attached via a bhndb bus + * @retval NULL no parent device is attached via @p bus_class. + */ +device_t +bhnd_find_bridge_root(device_t dev, devclass_t bus_class) +{ + devclass_t bhndb_class; + device_t parent; + + KASSERT(device_get_devclass(device_get_parent(dev)) == bhnd_devclass, + ("%s not a bhnd device", device_get_nameunit(dev))); + + bhndb_class = devclass_find("bhndb"); + + /* Walk the device tree until we hit a bridge */ + parent = dev; + while ((parent = device_get_parent(parent)) != NULL) { + if (device_get_devclass(parent) == bhndb_class) + break; + } + + /* No bridge? */ + if (parent == NULL) + return (NULL); + + /* Search for a parent attached to the expected bus class */ + while ((parent = device_get_parent(parent)) != NULL) { + device_t bus; + + bus = device_get_parent(parent); + if (bus != NULL && device_get_devclass(bus) == bus_class) + return (parent); + } + + /* Not found */ + return (NULL); +} + +/** * Find the first core in @p cores that matches @p desc. * * @param cores The table to search. Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue May 17 06:52:53 2016 (r300015) @@ -37,9 +37,10 @@ __FBSDID("$FreeBSD$"); * bus (e.g. bcma or siba) via a Broadcom PCI core configured in end-point * mode. * - * This driver handles all host-level PCI interactions with a PCI/PCIe bridge - * core operating in endpoint mode. On the bridged bhnd bus, the PCI core - * device will be managed by a bhnd_pci_hostb driver. + * This driver handles all initial generic host-level PCI interactions with a + * PCI/PCIe bridge core operating in endpoint mode. Once the bridged bhnd(4) + * bus has been enumerated, this driver works in tandem with a core-specific + * bhnd_pci_hostb driver to manage the PCI core. */ #include @@ -482,6 +483,35 @@ bhndb_pci_populate_board_info(device_t d sc = device_get_softc(dev); + /* + * On a subset of Apple BCM4360 modules, always prefer the + * PCI subdevice to the SPROM-supplied boardtype. + * + * TODO: + * + * Broadcom's own drivers implement this override, and then later use + * the remapped BCM4360 board type to determine the required + * board-specific workarounds. + * + * Without access to this hardware, it's unclear why this mapping + * is done, and we must do the same. If we can survey the hardware + * in question, it may be possible to replace this behavior with + * explicit references to the SPROM-supplied boardtype(s) in our + * quirk definitions. + */ + if (pci_get_subvendor(sc->parent) == PCI_VENDOR_APPLE) { + switch (info->board_type) { + case BHND_BOARD_BCM94360X29C: + case BHND_BOARD_BCM94360X29CP2: + case BHND_BOARD_BCM94360X51: + case BHND_BOARD_BCM94360X51P2: + info->board_type = 0; /* allow override below */ + break; + default: + break; + } + } + /* If NVRAM did not supply vendor/type info, provide the PCI * subvendor/subdevice values. */ if (info->board_vendor == 0) @@ -560,10 +590,6 @@ bhndb_disable_pci_clocks(struct bhndb_pc if (sc->pci_devclass != BHND_DEVCLASS_PCI) return (0); - // TODO: Check board flags for BFL2_XTALBUFOUTEN? - // TODO: Check PCI core revision? - // TODO: Switch to 'slow' clock? - /* Fetch current config */ gpio_out = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUT, 4); gpio_en = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUTEN, 4); @@ -601,6 +627,7 @@ DEFINE_CLASS_1(bhndb, bhndb_pci_driver, MODULE_VERSION(bhndb_pci, 1); MODULE_DEPEND(bhndb_pci, bhnd_pci_hostb, 1, 1, 1); +MODULE_DEPEND(bhndb_pci, bhnd_pcie2_hostb, 1, 1, 1); MODULE_DEPEND(bhndb_pci, pci, 1, 1, 1); MODULE_DEPEND(bhndb_pci, bhndb, 1, 1, 1); MODULE_DEPEND(bhndb_pci, bhnd, 1, 1, 1); Modified: head/sys/dev/bhnd/bhndb/bhndb_pcireg.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pcireg.h Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/bhndb/bhndb_pcireg.h Tue May 17 06:52:53 2016 (r300015) @@ -29,13 +29,13 @@ * * = MAJOR CORE REVISIONS = * - * There have been four revisions to the BAR0/BAR1 memory mappings used + * There have been four revisions to the BAR0 memory mappings used * in BHND PCI/PCIE bridge cores: * * == PCI_V0 == * Applies to: * - PCI (cid=0x804, revision <= 12) - * BAR size: 8KB + * BAR0 size: 8KB * Address Map: * [offset+ size] type description * [0x0000+0x1000] dynamic mapped backplane address space (window 0). @@ -46,7 +46,7 @@ * Applies to: * - PCI (cid=0x804, revision >= 13) * - PCIE (cid=0x820) with ChipCommon (revision <= 31) - * BAR size: 16KB + * BAR0 size: 16KB * Address Map: * [offset+ size] type description * [0x0000+0x1000] dynamic mapped backplane address space (window 0). @@ -57,7 +57,7 @@ * == PCI_V2 == * Applies to: * - PCIE (cid=0x820) with ChipCommon (revision >= 32) - * BAR size: 16KB + * BAR0 size: 16KB * Address Map: * [offset+ size] type description * [0x0000+0x1000] dynamic mapped backplane address space (window 0). @@ -68,7 +68,7 @@ * == PCI_V3 == * Applies to: * - PCIE Gen 2 (cid=0x83c) - * BAR size: 32KB? + * BAR0 size: 32KB * Address Map: * [offset+ size] type description * [0x0000+0x1000] dynamic mapped backplane address space (window 0). @@ -76,6 +76,12 @@ * [0x2000+0x1000] fixed pci/pcie core registers * [0x3000+0x1000] fixed chipcommon core registers * [???] + * BAR1 size: varies + * Address Map: + * [offset+ size] type description + * [0x0000+0x????] fixed ARM tightly-coupled memory (TCM). + * While fullmac chipsets provided a fixed + * 4KB mapping, newer devices will vary. * * = MINOR CORE REVISIONS = * @@ -86,28 +92,6 @@ * == PCI/PCIE Cores Revision >= 14 == * - Mapped the clock CSR into the PCI config space. Refer to * BHND_PCI_CLK_CTL_ST - * - * = Hardware Bugs = - * == BAR1 == - * - * The BHND PCI(e) cores hypothetically support an additional memory mapping - * of the backplane address space via BAR1, but this appears to be subject - * to a hardware bug in which BAR1 is initially configured with a 4 byte - * length. - * - * A work-around for this bug may be possible by writing to the PCI core's - * BAR1 config register (0x4e0), but this requires further research -- I've - * found three sources for information on the BAR1 PCI core configuration that - * may be relevant: - * - The QLogix NetXTreme 10GB PCIe NIC seems to use the same PCIE - * core IP block as is used in other BHND devices. The bxe(4) driver - * contains example initialization code and register constants - * that may apply (e.g. GRC_BAR2_CONFIG/PCI_CONFIG_2_BAR2_SIZE). - * - The publicly available Broadcom BCM440X data sheet (440X-PG02-R) - * appears to (partially) document a Broadcom PCI(e) core that has a - * seemingly compatible programming model. - * - The Android bcmdhd driver sources include a possible work-around - * implementation (writing to 0x4e0) in dhd_pcie.c */ /* Common PCI/PCIE Config Registers */ @@ -181,12 +165,11 @@ #define BHNDB_PCI_V2_BAR0_CCREGS_OFFSET 0x3000 /* bar0 + 12K accesses chipc core registers */ #define BHNDB_PCI_V2_BAR0_CCREGS_SIZE 0x1000 -/* PCI_V3 */ +/* PCI_V3 (PCIe-G2) */ #define BHNDB_PCI_V3_BAR0_WIN0_CONTROL 0x80 /* backplane address space accessed by BAR0/WIN0 */ -#define BHNDB_PCI_V3_BAR1_WIN0_CONTROL 0x84 /* backplane address space accessed by BAR1/WIN0. */ #define BHNDB_PCI_V3_BAR0_WIN1_CONTROL 0x70 /* backplane address space accessed by BAR0/WIN1 */ -#define BHNDB_PCI_V3_BAR0_SIZE 0x8000 /* 32KB BAR0 (?) */ +#define BHNDB_PCI_V3_BAR0_SIZE 0x8000 /* 32KB BAR0 */ #define BHNDB_PCI_V3_BAR0_WIN0_OFFSET 0x0 /* bar0 + 0x0 accesses configurable 4K region of backplane address space */ #define BHNDB_PCI_V3_BAR0_WIN0_SIZE 0x1000 #define BHNDB_PCI_V3_BAR0_WIN1_OFFSET 0x1000 /* bar0 + 4K accesses second 4K window */ Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Tue May 17 06:52:53 2016 (r300015) @@ -43,4 +43,23 @@ INTERFACE bhnd_chipc; */ METHOD bhnd_nvram_src_t nvram_src { device_t dev; -} \ No newline at end of file +} + +/** + * Write @p value with @p mask directly to the chipctrl register. + * + * @param dev A bhnd(4) ChipCommon device. + * @param value The value to write. + * @param mask The mask of bits to be written from @p value. + * + * Drivers should only use function for functionality that is not + * available via another bhnd_chipc() function. + * + * Currently, the only known valid use-case is in implementing a hardware + * work-around for the BCM4321 PCIe rev7 core revision. + */ +METHOD void write_chipctrl { + device_t dev; + uint32_t value; + uint32_t mask; +} Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Tue May 17 06:52:53 2016 (r300015) @@ -489,20 +489,38 @@ chipc_nvram_setvar(device_t dev, const c return (ENODEV); } +static void +chipc_write_chipctrl(device_t dev, uint32_t value, uint32_t mask) +{ + struct chipc_softc *sc; + uint32_t cctrl; + + sc = device_get_softc(dev); + + CHIPC_LOCK(sc); + + cctrl = bhnd_bus_read_4(sc->core, CHIPC_CHIPCTRL); + cctrl = (cctrl & ~mask) | (value | mask); + bhnd_bus_write_4(sc->core, CHIPC_CHIPCTRL, cctrl); + + CHIPC_UNLOCK(sc); +} + static device_method_t chipc_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, chipc_probe), - DEVMETHOD(device_attach, chipc_attach), - DEVMETHOD(device_detach, chipc_detach), - DEVMETHOD(device_suspend, chipc_suspend), - DEVMETHOD(device_resume, chipc_resume), + DEVMETHOD(device_probe, chipc_probe), + DEVMETHOD(device_attach, chipc_attach), + DEVMETHOD(device_detach, chipc_detach), + DEVMETHOD(device_suspend, chipc_suspend), + DEVMETHOD(device_resume, chipc_resume), /* ChipCommon interface */ - DEVMETHOD(bhnd_chipc_nvram_src, chipc_nvram_src), + DEVMETHOD(bhnd_chipc_nvram_src, chipc_nvram_src), + DEVMETHOD(bhnd_chipc_write_chipctrl, chipc_write_chipctrl), /* NVRAM interface */ - DEVMETHOD(bhnd_nvram_getvar, chipc_nvram_getvar), - DEVMETHOD(bhnd_nvram_setvar, chipc_nvram_setvar), + DEVMETHOD(bhnd_nvram_getvar, chipc_nvram_getvar), + DEVMETHOD(bhnd_nvram_setvar, chipc_nvram_setvar), DEVMETHOD_END }; Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci.c Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci.c Tue May 17 06:52:53 2016 (r300015) @@ -429,8 +429,7 @@ bhnd_pcie_mdio_read_ext(struct bhnd_pci_ int reg) { uint32_t cmd; - uint16_t blk, val; - uint8_t blk_reg; + uint16_t val; int error; if (devaddr == MDIO_DEVADDR_NONE) @@ -438,27 +437,23 @@ bhnd_pcie_mdio_read_ext(struct bhnd_pci_ /* Extended register access is only supported for the SerDes device, * using the non-standard C22 extended address mechanism */ - if (!(sc->quirks & BHND_PCI_QUIRK_SD_C22_EXTADDR)) + if (!(sc->quirks & BHND_PCI_QUIRK_SD_C22_EXTADDR) || + phy != BHND_PCIE_PHYADDR_SD) + { return (~0U); - if (phy != BHND_PCIE_PHYADDR_SD || devaddr != BHND_PCIE_DEVAD_SD) - return (~0U); + } /* Enable MDIO access */ BHND_PCI_LOCK(sc); bhnd_pcie_mdio_enable(sc); - /* Determine the block and register values */ - blk = (reg & BHND_PCIE_SD_ADDREXT_BLK_MASK); - blk_reg = (reg & BHND_PCIE_SD_ADDREXT_REG_MASK); - /* Write the block address to the address extension register */ - cmd = BHND_PCIE_MDIODATA_ADDR(phy, BHND_PCIE_SD_ADDREXT) | - (blk & BHND_PCIE_MDIODATA_DATA_MASK); + cmd = BHND_PCIE_MDIODATA_ADDR(phy, BHND_PCIE_SD_ADDREXT) | devaddr; if ((error = bhnd_pcie_mdio_cmd_write(sc, cmd))) goto cleanup; /* Issue the read */ - cmd = BHND_PCIE_MDIODATA_ADDR(phy, blk_reg); + cmd = BHND_PCIE_MDIODATA_ADDR(phy, reg); error = bhnd_pcie_mdio_cmd_read(sc, cmd, &val); cleanup: @@ -476,8 +471,6 @@ bhnd_pcie_mdio_write_ext(struct bhnd_pci int reg, int val) { uint32_t cmd; - uint16_t blk; - uint8_t blk_reg; int error; if (devaddr == MDIO_DEVADDR_NONE) @@ -485,27 +478,23 @@ bhnd_pcie_mdio_write_ext(struct bhnd_pci /* Extended register access is only supported for the SerDes device, * using the non-standard C22 extended address mechanism */ - if (!(sc->quirks & BHND_PCI_QUIRK_SD_C22_EXTADDR)) + if (!(sc->quirks & BHND_PCI_QUIRK_SD_C22_EXTADDR) || + phy != BHND_PCIE_PHYADDR_SD) + { return (~0U); - if (phy != BHND_PCIE_PHYADDR_SD || devaddr != BHND_PCIE_DEVAD_SD) - return (~0U); + } /* Enable MDIO access */ BHND_PCI_LOCK(sc); bhnd_pcie_mdio_enable(sc); - /* Determine the block and register values */ - blk = (reg & BHND_PCIE_SD_ADDREXT_BLK_MASK); - blk_reg = (reg & BHND_PCIE_SD_ADDREXT_REG_MASK); - /* Write the block address to the address extension register */ - cmd = BHND_PCIE_MDIODATA_ADDR(phy, BHND_PCIE_SD_ADDREXT) | - (blk & BHND_PCIE_MDIODATA_DATA_MASK); + cmd = BHND_PCIE_MDIODATA_ADDR(phy, BHND_PCIE_SD_ADDREXT) | devaddr; if ((error = bhnd_pcie_mdio_cmd_write(sc, cmd))) goto cleanup; /* Issue the write */ - cmd = BHND_PCIE_MDIODATA_ADDR(phy, blk_reg) | + cmd = BHND_PCIE_MDIODATA_ADDR(phy, reg) | (val & BHND_PCIE_MDIODATA_DATA_MASK); error = bhnd_pcie_mdio_cmd_write(sc, cmd); Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Tue May 17 06:52:53 2016 (r300015) @@ -56,28 +56,43 @@ __FBSDID("$FreeBSD$"); #include -#include "bhnd_pcireg.h" -#include "bhnd_pci_hostbvar.h" +#include +#include -#define BHND_PCI_ASSERT_QUIRK(_sc, _name) \ - KASSERT((_sc)->quirks & (_name), ("quirk " __STRING(_name) " not set")) +#include +#include -#define BHND_PCI_DEV(_core, _quirks, _chip_quirks) \ - BHND_DEVICE(_core, "", _quirks, _chip_quirks, BHND_DF_HOSTB) +#include "bhnd_pcireg.h" +#include "bhnd_pci_hostbvar.h" static const struct bhnd_device_quirk bhnd_pci_quirks[]; static const struct bhnd_device_quirk bhnd_pcie_quirks[]; +static const struct bhnd_chip_quirk bhnd_pci_chip_quirks[]; static const struct bhnd_chip_quirk bhnd_pcie_chip_quirks[]; +/* Device driver work-around variations */ +typedef enum { + BHND_PCI_WAR_ATTACH, /**< apply attach workarounds */ + BHND_PCI_WAR_RESUME, /**< apply resume workarounds */ + BHND_PCI_WAR_SUSPEND, /**< apply suspend workarounds */ + BHND_PCI_WAR_DETACH /**< apply detach workarounds */ +} bhnd_pci_war_state; + static int bhnd_pci_wars_early_once(struct bhnd_pcihb_softc *sc); -static int bhnd_pci_wars_hwup(struct bhnd_pcihb_softc *sc); -static int bhnd_pci_wars_hwdown(struct bhnd_pcihb_softc *sc); +static int bhnd_pci_wars_hwup(struct bhnd_pcihb_softc *sc, + bhnd_pci_war_state state); +static int bhnd_pci_wars_hwdown(struct bhnd_pcihb_softc *sc, + bhnd_pci_war_state state); /* * device/quirk tables */ + +#define BHND_PCI_DEV(_core, _quirks, _chip_quirks) \ + BHND_DEVICE(_core, "", _quirks, _chip_quirks, BHND_DF_HOSTB) + static const struct bhnd_device bhnd_pci_devs[] = { - BHND_PCI_DEV(PCI, bhnd_pci_quirks, NULL), + BHND_PCI_DEV(PCI, bhnd_pci_quirks, bhnd_pci_chip_quirks), BHND_PCI_DEV(PCIE, bhnd_pcie_quirks, bhnd_pcie_chip_quirks), BHND_DEVICE_END }; @@ -89,12 +104,22 @@ static const struct bhnd_device_quirk bh BHND_DEVICE_QUIRK_END }; +static const struct bhnd_chip_quirk bhnd_pci_chip_quirks[] = { + /* BCM4321CB2 boards that require 960ns latency timer override */ + {{ BHND_CHIP_BTYPE(BCM4321CB2) }, + BHND_PCI_QUIRK_960NS_LATTIM_OVR }, + {{ BHND_CHIP_BTYPE(BCM4321CB2_AG) }, + BHND_PCI_QUIRK_960NS_LATTIM_OVR }, + + BHND_CHIP_QUIRK_END +}; + static const struct bhnd_device_quirk bhnd_pcie_quirks[] = { { BHND_HWREV_EQ (0), BHND_PCIE_QUIRK_SDR9_L0s_HANG }, - { BHND_HWREV_RANGE (0, 1), BHND_PCIE_QUIRK_UR_STATUS_FIX }, + { BHND_HWREV_RANGE (0,1), BHND_PCIE_QUIRK_UR_STATUS_FIX }, { BHND_HWREV_EQ (1), BHND_PCIE_QUIRK_PCIPM_REQEN }, - { BHND_HWREV_RANGE (3, 5), BHND_PCIE_QUIRK_ASPM_OVR | + { BHND_HWREV_RANGE (3,5), BHND_PCIE_QUIRK_ASPM_OVR | BHND_PCIE_QUIRK_SDR9_POLARITY | BHND_PCIE_QUIRK_SDR9_NO_FREQRETRY }, @@ -102,37 +127,50 @@ static const struct bhnd_device_quirk bh { BHND_HWREV_GTE (6), BHND_PCIE_QUIRK_SPROM_L23_PCI_RESET }, { BHND_HWREV_EQ (7), BHND_PCIE_QUIRK_SERDES_NOPLLDOWN }, { BHND_HWREV_GTE (8), BHND_PCIE_QUIRK_L1_TIMER_PERF }, - { BHND_HWREV_GTE (10), BHND_PCIE_QUIRK_SD_C22_EXTADDR }, + + { BHND_HWREV_LTE (17), BHND_PCIE_QUIRK_MAX_MRRS_128 }, + BHND_DEVICE_QUIRK_END }; static const struct bhnd_chip_quirk bhnd_pcie_chip_quirks[] = { /* Apple boards on which BHND_BFL2_PCIEWAR_OVR should be assumed * to be set. */ - {{ BHND_CHIP_BVENDOR (PCI_VENDOR_APPLE), - BHND_CHIP_SROMREV (HWREV_EQ(4)), - BHND_CHIP_BREV (HWREV_LTE(0x71)) }, - BHND_PCIE_QUIRK_BFL2_PCIEWAR_EN }, + {{ BHND_CHIP_BVENDOR (PCI_VENDOR_APPLE), + BHND_CHIP_SROMREV (HWREV_EQ(4)), + BHND_CHIP_BREV (HWREV_LTE(0x71)) }, + BHND_PCIE_QUIRK_BFL2_PCIEWAR_EN }, + + /* Apple BCM4322 boards that require 700mV SerDes TX drive strength. */ + {{ BHND_CHIP_BVT (PCI_VENDOR_APPLE, BCM94322X9) }, + BHND_PCIE_QUIRK_SERDES_TXDRV_700MV }, + + /* Apple BCM4331 board-specific quirks */ +#define BHND_APPLE_4331_QUIRK(_board, ...) \ + {{ BHND_CHIP_ID (4331), \ + BHND_CHIP_BVT (PCI_VENDOR_APPLE, _board), }, \ + __VA_ARGS__ } + + BHND_APPLE_4331_QUIRK(BCM94331X19, + BHND_PCIE_QUIRK_SERDES_TXDRV_MAX|BHND_PCIE_QUIRK_DEFAULT_MRRS_512), + + BHND_APPLE_4331_QUIRK(BCM94331X28, + BHND_PCIE_QUIRK_SERDES_TXDRV_MAX|BHND_PCIE_QUIRK_DEFAULT_MRRS_512), + BHND_APPLE_4331_QUIRK(BCM94331X28B, BHND_PCIE_QUIRK_DEFAULT_MRRS_512), + + BHND_APPLE_4331_QUIRK(BCM94331X29B, + BHND_PCIE_QUIRK_SERDES_TXDRV_MAX|BHND_PCIE_QUIRK_DEFAULT_MRRS_512), + + BHND_APPLE_4331_QUIRK(BCM94331X19C, + BHND_PCIE_QUIRK_SERDES_TXDRV_MAX|BHND_PCIE_QUIRK_DEFAULT_MRRS_512), + + BHND_APPLE_4331_QUIRK(BCM94331X29D, BHND_PCIE_QUIRK_DEFAULT_MRRS_512), + BHND_APPLE_4331_QUIRK(BCM94331X33, BHND_PCIE_QUIRK_DEFAULT_MRRS_512), +#undef BHND_APPLE_4331_QUIRK BHND_CHIP_QUIRK_END }; -// Quirk handling TODO -// WARs for the following are not yet implemented: -// - BHND_PCIE_QUIRK_ASPM_OVR -// - BHND_PCIE_QUIRK_BFL2_PCIEWAR_EN -// - BHND_PCIE_QUIRK_SERDES_NOPLLDOWN -// Quirks (and WARs) for the following are not yet defined: -// - Power savings via MDIO BLK1/PWR_MGMT3 on PCIe hwrev 15-20, 21-22 -// - WOWL PME enable/disable -// - 4360 PCIe SerDes Tx amplitude/deemphasis (vendor Apple, boards -// BCM94360X51P2, BCM94360X51A). -// - PCI latency timer (boards CB2_4321_BOARD, CB2_4321_AG_BOARD) -// - Max SerDes TX drive strength (vendor Apple, pcie >= rev10, -// board BCM94322X9) -// - 700mV SerDes TX drive strength (chipid BCM4331, boards BCM94331X19, -// BCM94331X28, BCM94331X29B, BCM94331X19C) - #define BHND_PCI_SOFTC(_sc) (&((_sc)->common)) #define BHND_PCI_READ_2(_sc, _reg) \ @@ -159,6 +197,13 @@ static const struct bhnd_chip_quirk bhnd #define BHND_PCI_MDIO_WRITE(_sc, _phy, _reg, _val) \ bhnd_pcie_mdio_write(BHND_PCI_SOFTC(_sc), (_phy), (_reg), (_val)) +#define BHND_PCI_MDIO_READ_EXT(_sc, _phy, _devaddr, _reg) \ + bhnd_pcie_mdio_read_ext(BHND_PCI_SOFTC(_sc), (_phy), (_devaddr), (_reg)) + +#define BHND_PCI_MDIO_WRITE_EXT(_sc, _phy, _devaddr, _reg, _val) \ + bhnd_pcie_mdio_write_ext(BHND_PCI_SOFTC(_sc), (_phy), \ + (_devaddr), (_reg), (_val)) + #define BPCI_REG_SET(_regv, _attr, _val) \ BHND_PCI_REG_SET((_regv), BHND_ ## _attr, (_val)) @@ -180,26 +225,34 @@ bhnd_pci_hostb_attach(device_t dev) int error; sc = device_get_softc(dev); + sc->dev = dev; sc->quirks = bhnd_device_quirks(dev, bhnd_pci_devs, sizeof(bhnd_pci_devs[0])); + /* Find the host PCI bridge device */ + sc->pci_dev = bhnd_find_bridge_root(dev, devclass_find("pci")); + if (sc->pci_dev == NULL) { + device_printf(dev, "parent pci bridge device not found\n"); + return (ENXIO); + } + + /* Common setup */ if ((error = bhnd_pci_generic_attach(dev))) return (error); /* Apply early single-shot work-arounds */ - if ((error = bhnd_pci_wars_early_once(sc))) { - bhnd_pci_generic_detach(dev); - return (error); - } + if ((error = bhnd_pci_wars_early_once(sc))) + goto failed; /* Apply attach/resume work-arounds */ - if ((error = bhnd_pci_wars_hwup(sc))) { - bhnd_pci_generic_detach(dev); - return (error); - } - + if ((error = bhnd_pci_wars_hwup(sc, BHND_PCI_WAR_ATTACH))) + goto failed; return (0); + +failed: + bhnd_pci_generic_detach(dev); + return (error); } static int @@ -211,7 +264,7 @@ bhnd_pci_hostb_detach(device_t dev) sc = device_get_softc(dev); /* Apply suspend/detach work-arounds */ - if ((error = bhnd_pci_wars_hwdown(sc))) + if ((error = bhnd_pci_wars_hwdown(sc, BHND_PCI_WAR_DETACH))) return (error); return (bhnd_pci_generic_detach(dev)); @@ -226,7 +279,7 @@ bhnd_pci_hostb_suspend(device_t dev) sc = device_get_softc(dev); /* Apply suspend/detach work-arounds */ - if ((error = bhnd_pci_wars_hwdown(sc))) + if ((error = bhnd_pci_wars_hwdown(sc, BHND_PCI_WAR_SUSPEND))) return (error); return (bhnd_pci_generic_suspend(dev)); @@ -244,7 +297,7 @@ bhnd_pci_hostb_resume(device_t dev) return (error); /* Apply attach/resume work-arounds */ - if ((error = bhnd_pci_wars_hwup(sc))) { + if ((error = bhnd_pci_wars_hwup(sc, BHND_PCI_WAR_RESUME))) { bhnd_pci_generic_detach(dev); return (error); } @@ -263,6 +316,36 @@ bhnd_pci_hostb_resume(device_t dev) static int bhnd_pci_wars_early_once(struct bhnd_pcihb_softc *sc) { + int error; + + /* Set PCI latency timer */ + if (sc->quirks & BHND_PCI_QUIRK_960NS_LATTIM_OVR) { + pci_write_config(sc->pci_dev, PCIR_LATTIMER, 0x20 /* 960ns */, + 1); + } + + /* Determine whether ASPM/CLKREQ should be forced on, or forced off. */ + if (sc->quirks & BHND_PCIE_QUIRK_ASPM_OVR) { + struct bhnd_board_info board; + bool aspm_en; + + /* Fetch board info */ + if ((error = bhnd_read_board_info(sc->dev, &board))) + return (error); + + /* Check board flags */ + aspm_en = true; + if (board.board_flags2 & BHND_BFL2_PCIEWAR_OVR) + aspm_en = false; + + /* Early Apple devices did not (but should have) set + * BHND_BFL2_PCIEWAR_OVR in SPROM. */ + if (sc->quirks & BHND_PCIE_QUIRK_BFL2_PCIEWAR_EN) + aspm_en = false; + + sc->aspm_quirk_override.aspm_en = aspm_en; + } + /* Determine correct polarity by observing the attach-time PCIe PHY * link status. This is used later to reset/force the SerDes * polarity */ @@ -270,12 +353,23 @@ bhnd_pci_wars_early_once(struct bhnd_pci uint32_t st; bool inv; - st = BHND_PCI_PROTO_READ_4(sc, BHND_PCIE_PLP_STATUSREG); inv = ((st & BHND_PCIE_PLP_POLARITY_INV) != 0); sc->sdr9_quirk_polarity.inv = inv; } + /* Override maximum read request size */ + if (bhnd_get_class(sc->dev) == BHND_DEVCLASS_PCIE) { + int msize; + + msize = 128; /* compatible with all PCIe-G1 core revisions */ + if (sc->quirks & BHND_PCIE_QUIRK_DEFAULT_MRRS_512) + msize = 512; + + if (pci_set_max_read_req(sc->pci_dev, msize) == 0) + panic("set mrrs on non-PCIe device"); + } + return (0); } @@ -284,7 +378,7 @@ bhnd_pci_wars_early_once(struct bhnd_pci * of the bridge device. */ static int -bhnd_pci_wars_hwup(struct bhnd_pcihb_softc *sc) +bhnd_pci_wars_hwup(struct bhnd_pcihb_softc *sc, bhnd_pci_war_state state) { /* Note that the order here matters; these work-arounds * should not be re-ordered without careful review of their @@ -407,6 +501,47 @@ bhnd_pci_wars_hwup(struct bhnd_pcihb_sof BHND_PCI_PROTO_WRITE_4(sc, BHND_PCIE_DLLP_PMTHRESHREG, pmt); } + /* Override ASPM/ECPM settings in SPROM shadow and PCIER_LINK_CTL */ + if (sc->quirks & BHND_PCIE_QUIRK_ASPM_OVR) { + bus_size_t reg; + uint16_t cfg; + + /* Set ASPM L1/L0s flags in SPROM shadow */ + reg = BHND_PCIE_SPROM_SHADOW + BHND_PCIE_SRSH_ASPM_OFFSET; + cfg = BHND_PCI_READ_2(sc, reg); + + if (sc->aspm_quirk_override.aspm_en) + cfg |= BHND_PCIE_SRSH_ASPM_ENB; + else + cfg &= ~BHND_PCIE_SRSH_ASPM_ENB; + + BHND_PCI_WRITE_2(sc, reg, cfg); + + + /* Set ASPM/ECPM (CLKREQ) flags in PCIe link control register */ + cfg = pcie_read_config(sc->pci_dev, PCIER_LINK_CTL, 2); + + if (sc->aspm_quirk_override.aspm_en) + cfg |= PCIEM_LINK_CTL_ASPMC; + else + cfg &= ~PCIEM_LINK_CTL_ASPMC; + + cfg &= ~PCIEM_LINK_CTL_ECPM; /* CLKREQ# */ + + pcie_write_config(sc->pci_dev, PCIER_LINK_CTL, cfg, 2); + + /* Set CLKREQ (ECPM) flags in SPROM shadow */ + reg = BHND_PCIE_SPROM_SHADOW + BHND_PCIE_SRSH_CLKREQ_OFFSET_R5; + cfg = BHND_PCI_READ_2(sc, reg); + + if (sc->aspm_quirk_override.aspm_en) + cfg |= BHND_PCIE_SRSH_CLKREQ_ENB; + else + cfg &= ~BHND_PCIE_SRSH_CLKREQ_ENB; + + BHND_PCI_WRITE_2(sc, reg, cfg); + } + /* Enable L23READY_EXIT_NOPRST if not already set in SPROM. */ if (sc->quirks & BHND_PCIE_QUIRK_SPROM_L23_PCI_RESET) { bus_size_t reg; @@ -423,6 +558,54 @@ bhnd_pci_wars_hwup(struct bhnd_pcihb_sof } } + /* Disable SerDes PLL down */ + if (sc->quirks & BHND_PCIE_QUIRK_SERDES_NOPLLDOWN) { + device_t bhnd, chipc; + bus_size_t reg; + + bhnd = device_get_parent(sc->dev); + chipc = bhnd_find_child(bhnd, BHND_DEVCLASS_CC, 0); + KASSERT(chipc != NULL, ("missing chipcommon device")); + + /* Write SerDes PLL disable flag to the ChipCommon core */ + BHND_CHIPC_WRITE_CHIPCTRL(chipc, CHIPCTRL_4321_PLL_DOWN, + CHIPCTRL_4321_PLL_DOWN); + + /* Clear SPROM shadow backdoor register */ + reg = BHND_PCIE_SPROM_SHADOW + BHND_PCIE_SRSH_BD_OFFSET; + BHND_PCI_WRITE_2(sc, reg, 0); + } + + /* Adjust TX drive strength and pre-emphasis coefficient */ + if (sc->quirks & BHND_PCIE_QUIRK_SERDES_TXDRV_ADJUST) { + uint16_t txdrv; + + /* Fetch current TX driver parameters */ + txdrv = BHND_PCI_MDIO_READ_EXT(sc, BHND_PCIE_PHYADDR_SD, + BHND_PCIE_SD_REGS_TX0, BHND_PCIE_SD_TX_DRIVER); + + /* Set 700mV drive strength */ + if (sc->quirks & BHND_PCIE_QUIRK_SERDES_TXDRV_700MV) { + txdrv = BPCI_REG_SET(txdrv, PCIE_SD_TX_DRIVER_P2_COEFF, + BHND_PCIE_APPLE_TX_P2_COEFF_700MV); + + txdrv = BPCI_REG_SET(txdrv, PCIE_SD_TX_DRIVER_IDRIVER, + BHND_PCIE_APPLE_TX_IDRIVER_700MV); + } + + /* ... or, set max drive strength */ + if (sc->quirks & BHND_PCIE_QUIRK_SERDES_TXDRV_MAX) { + txdrv = BPCI_REG_SET(txdrv, PCIE_SD_TX_DRIVER_P2_COEFF, + BHND_PCIE_APPLE_TX_P2_COEFF_MAX); + + txdrv = BPCI_REG_SET(txdrv, PCIE_SD_TX_DRIVER_IDRIVER, + BHND_PCIE_APPLE_TX_IDRIVER_MAX); + } + + BHND_PCI_MDIO_WRITE_EXT(sc, BHND_PCIE_PHYADDR_SD, + BHND_PCIE_SD_REGS_TX0, BHND_PCIE_SD_TX_DRIVER, txdrv); + } + return (0); } @@ -431,8 +614,8 @@ bhnd_pci_wars_hwup(struct bhnd_pcihb_sof * of the bridge device. */ static int -bhnd_pci_wars_hwdown(struct bhnd_pcihb_softc *sc) -{ +bhnd_pci_wars_hwdown(struct bhnd_pcihb_softc *sc, bhnd_pci_war_state state) +{ /* Reduce L1 timer for better power savings. * TODO: We could enable/disable this on demand for better power * savings if we tie this to HT clock request handling */ @@ -443,6 +626,19 @@ bhnd_pci_wars_hwdown(struct bhnd_pcihb_s BHND_PCI_PROTO_WRITE_4(sc, BHND_PCIE_DLLP_PMTHRESHREG, pmt); } + /* Enable CLKREQ (ECPM). If suspending, also disable ASPM L1 entry */ + if (sc->quirks & BHND_PCIE_QUIRK_ASPM_OVR) { + uint16_t lcreg; + + lcreg = pcie_read_config(sc->pci_dev, PCIER_LINK_CTL, 2); + + lcreg |= PCIEM_LINK_CTL_ECPM; /* CLKREQ# */ + if (state == BHND_PCI_WAR_SUSPEND) + lcreg &= ~PCIEM_LINK_CTL_ASPMC_L1; + + pcie_write_config(sc->pci_dev, PCIER_LINK_CTL, lcreg, 2); + } + return (0); } @@ -456,10 +652,9 @@ static device_method_t bhnd_pci_hostb_me DEVMETHOD_END }; -DEFINE_CLASS_1(bhnd_pci_hostb, bhnd_pci_hostb_driver, bhnd_pci_hostb_methods, +DEFINE_CLASS_1(bhnd_hostb, bhnd_pci_hostb_driver, bhnd_pci_hostb_methods, sizeof(struct bhnd_pcihb_softc), bhnd_pci_driver); - -DRIVER_MODULE(bhnd_hostb, bhnd, bhnd_pci_hostb_driver, bhnd_hostb_devclass, 0, 0); +DRIVER_MODULE(bhnd_pci_hostb, bhnd, bhnd_pci_hostb_driver, bhnd_hostb_devclass, 0, 0); MODULE_VERSION(bhnd_pci_hostb, 1); MODULE_DEPEND(bhnd_pci_hostb, bhnd, 1, 1, 1); Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci_hostbvar.h ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci_hostbvar.h Tue May 17 06:45:25 2016 (r300014) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci_hostbvar.h Tue May 17 06:52:53 2016 (r300015) @@ -43,7 +43,7 @@ DECLARE_CLASS(bhnd_pci_hostb_driver); -/* +/** * PCI/PCIe-Gen1 endpoint-mode device quirks */ enum { @@ -56,7 +56,6 @@ enum { */ BHND_PCI_QUIRK_SBTOPCI2_PREF_BURST = (1<<1), - /** * SBTOPCI_RC_READMULTI must be set on the SSB_PCICORE_SBTOPCI2 * register. @@ -74,18 +73,24 @@ enum { BHND_PCI_QUIRK_CLKRUN_DSBL = (1<<3), /** + * On PCI-attached BCM4321CB* boards, the PCI latency timer must be set + * to 960ns on initial attach. + */ + BHND_PCI_QUIRK_960NS_LATTIM_OVR = (1<<4), + + /** * TLP workaround for unmatched address handling is required. * * This TLP workaround will enable setting of the PCIe UR status bit * on memory access to an unmatched address. */ - BHND_PCIE_QUIRK_UR_STATUS_FIX = (1<<4), + BHND_PCIE_QUIRK_UR_STATUS_FIX = (1<<5), /** * PCI-PM power management must be explicitly enabled via * the data link control register. */ - BHND_PCIE_QUIRK_PCIPM_REQEN = (1<<5), + BHND_PCIE_QUIRK_PCIPM_REQEN = (1<<6), /** * Fix L0s to L0 exit transition on SerDes <= rev9 devices. @@ -98,46 +103,50 @@ enum { * filters must be tweaked to ensure the CDR has fully stabilized * before asserting receive sequencer completion. */ - BHND_PCIE_QUIRK_SDR9_L0s_HANG = (1<<6), + BHND_PCIE_QUIRK_SDR9_L0s_HANG = (1<<7), /** * The idle time for entering L1 low-power state must be * explicitly set (to 114ns) to fix slow L1->L0 transition issues. */ - BHND_PCIE_QUIRK_L1_IDLE_THRESH = (1<<7), + BHND_PCIE_QUIRK_L1_IDLE_THRESH = (1<<8), /** * The ASPM L1 entry timer should be extended for better performance, * and restored for better power savings. */ - BHND_PCIE_QUIRK_L1_TIMER_PERF = (1<<8), + BHND_PCIE_QUIRK_L1_TIMER_PERF = (1<<9), /** * ASPM and ECPM settings must be overridden manually. + * Applies to 4311B0/4321B1 chipset revisions. * * The override behavior is controlled by the BHND_BFL2_PCIEWAR_OVR - * flag. If this flag is set, ASPM/CLKREQ should be overridden as *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 17 07:06:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12999B3E9B5; Tue, 17 May 2016 07:06:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 E88B81E30; Tue, 17 May 2016 07:06:18 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id BA003B93E; Tue, 17 May 2016 03:06:17 -0400 (EDT) From: John Baldwin To: Greg Lehey Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Date: Tue, 17 May 2016 00:04:51 -0700 Message-ID: <1514281.0ZCu4236n8@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605170440.u4H4e1Fe082375@repo.freebsd.org> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> 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.2.7 (bigwig.baldwin.cx); Tue, 17 May 2016 03:06:17 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:06:19 -0000 On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote: > Author: grog > Date: Tue May 17 04:40:00 2016 > New Revision: 300003 > URL: https://svnweb.freebsd.org/changeset/base/300003 > > Log: > Correct use of incorrect grammar. > > Modified: > head/share/man/man4/gdb.4 > > Modified: head/share/man/man4/gdb.4 > ============================================================================== > --- head/share/man/man4/gdb.4 Tue May 17 04:03:45 2016 (r300002) > +++ head/share/man/man4/gdb.4 Tue May 17 04:40:00 2016 (r300003) > @@ -595,7 +595,7 @@ run the link at more than 9600 bps. > Firewire connections do not have this problem. > .Pp > The debugging macros > -.Dq "just grown" . > +.Dq "just growed" . "grew"? -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 17 07:09:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FC64B3EB8C; Tue, 17 May 2016 07:09:26 +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 E7CEA1070; Tue, 17 May 2016 07:09:25 +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 u4H79Pcq028244; Tue, 17 May 2016 07:09:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H79POZ028242; Tue, 17 May 2016 07:09:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170709.u4H79POZ028242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 07:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300016 - in head/sys/gnu/dev: . bwn bwn/phy_n X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:09:26 -0000 Author: adrian Date: Tue May 17 07:09:24 2016 New Revision: 300016 URL: https://svnweb.freebsd.org/changeset/base/300016 Log: [bwn] add initial bwn(4) N-PHY code, ported from Linux b43. This is a GPLv2 PHY-N implementation based on the Linux b43 driver, ported over to work in bwn(4). I've tested this on the BCM4321 11abgn device, in 11bg and 11a modes. The b43 PHY code only supports 11abg, no 11n, and 20MHz only wide channels. Yes, this is a GPLv2 driver, so it won't be included in the default builds. Tested: * BCM4321 11abgn device (Apple!), 11bg and 11a STA mode. Obtained from: Linux b43 Added: head/sys/gnu/dev/ head/sys/gnu/dev/bwn/ head/sys/gnu/dev/bwn/phy_n/ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.h (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.h (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_regs.h (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.h (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2055.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2055.h (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2056.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2056.h (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.h (contents, props changed) Added: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Tue May 17 07:09:24 2016 (r300016) @@ -0,0 +1,6832 @@ + +/* + + Broadcom B43 wireless driver + IEEE 802.11n PHY data tables + + Copyright (c) 2008 Michael Buesch + Copyright (c) 2010 RafaÅ‚ MiÅ‚ecki + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. + +*/ + +#include +__FBSDID("$FreeBSD$"); + +/* + * The Broadcom Wireless LAN controller driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +struct bwn_nphy_txgains { + uint16_t tx_lpf[2]; + uint16_t txgm[2]; + uint16_t pga[2]; + uint16_t pad[2]; + uint16_t ipa[2]; +}; + +struct bwn_nphy_iqcal_params { + uint16_t tx_lpf; + uint16_t txgm; + uint16_t pga; + uint16_t pad; + uint16_t ipa; + uint16_t cal_gain; + uint16_t ncorr[5]; +}; + +struct bwn_nphy_iq_est { + int32_t iq0_prod; + uint32_t i0_pwr; + uint32_t q0_pwr; + int32_t iq1_prod; + uint32_t i1_pwr; + uint32_t q1_pwr; +}; + +enum bwn_nphy_rf_sequence { + BWN_RFSEQ_RX2TX, + BWN_RFSEQ_TX2RX, + BWN_RFSEQ_RESET2RX, + BWN_RFSEQ_UPDATE_GAINH, + BWN_RFSEQ_UPDATE_GAINL, + BWN_RFSEQ_UPDATE_GAINU, +}; + +enum n_rf_ctl_over_cmd { + N_RF_CTL_OVER_CMD_RXRF_PU = 0, + N_RF_CTL_OVER_CMD_RX_PU = 1, + N_RF_CTL_OVER_CMD_TX_PU = 2, + N_RF_CTL_OVER_CMD_RX_GAIN = 3, + N_RF_CTL_OVER_CMD_TX_GAIN = 4, +}; + +enum n_intc_override { + N_INTC_OVERRIDE_OFF = 0, + N_INTC_OVERRIDE_TRSW = 1, + N_INTC_OVERRIDE_PA = 2, + N_INTC_OVERRIDE_EXT_LNA_PU = 3, + N_INTC_OVERRIDE_EXT_LNA_GAIN = 4, +}; + +enum n_rssi_type { + N_RSSI_W1 = 0, + N_RSSI_W2, + N_RSSI_NB, + N_RSSI_IQ, + N_RSSI_TSSI_2G, + N_RSSI_TSSI_5G, + N_RSSI_TBD, +}; + +enum n_rail_type { + N_RAIL_I = 0, + N_RAIL_Q = 1, +}; + +static inline bool bwn_nphy_ipa(struct bwn_mac *mac) +{ + bwn_band_t band = bwn_current_band(mac); + return ((mac->mac_phy.phy_n->ipa2g_on && band == BWN_BAND_2G) || + (mac->mac_phy.phy_n->ipa5g_on && band == BWN_BAND_5G)); +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCoreGetState */ +static uint8_t bwn_nphy_get_rx_core_state(struct bwn_mac *mac) +{ + return (BWN_PHY_READ(mac, BWN_NPHY_RFSEQCA) & BWN_NPHY_RFSEQCA_RXEN) >> + BWN_NPHY_RFSEQCA_RXEN_SHIFT; +} + +/************************************************** + * RF (just without bwn_nphy_rf_ctl_intc_override) + **************************************************/ + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ForceRFSeq */ +static void bwn_nphy_force_rf_sequence(struct bwn_mac *mac, + enum bwn_nphy_rf_sequence seq) +{ + static const uint16_t trigger[] = { + [BWN_RFSEQ_RX2TX] = BWN_NPHY_RFSEQTR_RX2TX, + [BWN_RFSEQ_TX2RX] = BWN_NPHY_RFSEQTR_TX2RX, + [BWN_RFSEQ_RESET2RX] = BWN_NPHY_RFSEQTR_RST2RX, + [BWN_RFSEQ_UPDATE_GAINH] = BWN_NPHY_RFSEQTR_UPGH, + [BWN_RFSEQ_UPDATE_GAINL] = BWN_NPHY_RFSEQTR_UPGL, + [BWN_RFSEQ_UPDATE_GAINU] = BWN_NPHY_RFSEQTR_UPGU, + }; + int i; + uint16_t seq_mode = BWN_PHY_READ(mac, BWN_NPHY_RFSEQMODE); + + if (seq >= nitems(trigger)) { + BWN_WARNPRINTF(mac->mac_sc, "%s: seq %d > max", __func__, seq); + } + + BWN_PHY_SET(mac, BWN_NPHY_RFSEQMODE, + BWN_NPHY_RFSEQMODE_CAOVER | BWN_NPHY_RFSEQMODE_TROVER); + BWN_PHY_SET(mac, BWN_NPHY_RFSEQTR, trigger[seq]); + for (i = 0; i < 200; i++) { + if (!(BWN_PHY_READ(mac, BWN_NPHY_RFSEQST) & trigger[seq])) + goto ok; + DELAY(1000); + } + BWN_ERRPRINTF(mac->mac_sc, "RF sequence status timeout\n"); +ok: + BWN_PHY_WRITE(mac, BWN_NPHY_RFSEQMODE, seq_mode); +} + +static void bwn_nphy_rf_ctl_override_rev19(struct bwn_mac *mac, uint16_t field, + uint16_t value, uint8_t core, bool off, + uint8_t override_id) +{ + /* TODO */ +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlOverrideRev7 */ +static void bwn_nphy_rf_ctl_override_rev7(struct bwn_mac *mac, uint16_t field, + uint16_t value, uint8_t core, bool off, + uint8_t override) +{ + struct bwn_phy *phy = &mac->mac_phy; + const struct bwn_nphy_rf_control_override_rev7 *e; + uint16_t en_addrs[3][2] = { + { 0x0E7, 0x0EC }, { 0x342, 0x343 }, { 0x346, 0x347 } + }; + uint16_t en_addr; + uint16_t en_mask = field; + uint16_t val_addr; + uint8_t i; + + if (phy->rev >= 19 || phy->rev < 3) { + BWN_WARNPRINTF(mac->mac_sc, "%s: phy rev %d out of range\n", + __func__, + phy->rev); + return; + } + + /* Remember: we can get NULL! */ + e = bwn_nphy_get_rf_ctl_over_rev7(mac, field, override); + + for (i = 0; i < 2; i++) { + if (override >= nitems(en_addrs)) { + BWN_ERRPRINTF(mac->mac_sc, "Invalid override value %d\n", override); + return; + } + en_addr = en_addrs[override][i]; + + if (e) + val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1; + + if (off) { + BWN_PHY_MASK(mac, en_addr, ~en_mask); + if (e) /* Do it safer, better than wl */ + BWN_PHY_MASK(mac, val_addr, ~e->val_mask); + } else { + if (!core || (core & (1 << i))) { + BWN_PHY_SET(mac, en_addr, en_mask); + if (e) + BWN_PHY_SETMASK(mac, val_addr, ~e->val_mask, (value << e->val_shift)); + } + } + } +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlOverideOneToMany */ +static void bwn_nphy_rf_ctl_override_one_to_many(struct bwn_mac *mac, + enum n_rf_ctl_over_cmd cmd, + uint16_t value, uint8_t core, bool off) +{ + struct bwn_phy *phy = &mac->mac_phy; + uint16_t tmp; + + if (phy->rev < 7) { + BWN_ERRPRINTF(mac->mac_sc, "%s: phy rev %d out of range\n", + __func__, + phy->rev); + } + + switch (cmd) { + case N_RF_CTL_OVER_CMD_RXRF_PU: + bwn_nphy_rf_ctl_override_rev7(mac, 0x20, value, core, off, 1); + bwn_nphy_rf_ctl_override_rev7(mac, 0x10, value, core, off, 1); + bwn_nphy_rf_ctl_override_rev7(mac, 0x08, value, core, off, 1); + break; + case N_RF_CTL_OVER_CMD_RX_PU: + bwn_nphy_rf_ctl_override_rev7(mac, 0x4, value, core, off, 1); + bwn_nphy_rf_ctl_override_rev7(mac, 0x2, value, core, off, 1); + bwn_nphy_rf_ctl_override_rev7(mac, 0x1, value, core, off, 1); + bwn_nphy_rf_ctl_override_rev7(mac, 0x2, value, core, off, 2); + bwn_nphy_rf_ctl_override_rev7(mac, 0x0800, 0, core, off, 1); + break; + case N_RF_CTL_OVER_CMD_TX_PU: + bwn_nphy_rf_ctl_override_rev7(mac, 0x4, value, core, off, 0); + bwn_nphy_rf_ctl_override_rev7(mac, 0x2, value, core, off, 1); + bwn_nphy_rf_ctl_override_rev7(mac, 0x1, value, core, off, 2); + bwn_nphy_rf_ctl_override_rev7(mac, 0x0800, 1, core, off, 1); + break; + case N_RF_CTL_OVER_CMD_RX_GAIN: + tmp = value & 0xFF; + bwn_nphy_rf_ctl_override_rev7(mac, 0x0800, tmp, core, off, 0); + tmp = value >> 8; + bwn_nphy_rf_ctl_override_rev7(mac, 0x6000, tmp, core, off, 0); + break; + case N_RF_CTL_OVER_CMD_TX_GAIN: + tmp = value & 0x7FFF; + bwn_nphy_rf_ctl_override_rev7(mac, 0x1000, tmp, core, off, 0); + tmp = value >> 14; + bwn_nphy_rf_ctl_override_rev7(mac, 0x4000, tmp, core, off, 0); + break; + } +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlOverride */ +static void bwn_nphy_rf_ctl_override(struct bwn_mac *mac, uint16_t field, + uint16_t value, uint8_t core, bool off) +{ + int i; + uint8_t index = fls(field); + uint8_t addr, en_addr, val_addr; + + /* we expect only one bit set */ + if (field & (~(1 << (index - 1)))) { + BWN_ERRPRINTF(mac->mac_sc, "%s: field 0x%04x has >1 bit set\n", + __func__, + field); + } + + if (mac->mac_phy.rev >= 3) { + const struct bwn_nphy_rf_control_override_rev3 *rf_ctrl; + for (i = 0; i < 2; i++) { + if (index == 0 || index == 16) { + BWN_ERRPRINTF(mac->mac_sc, + "Unsupported RF Ctrl Override call\n"); + return; + } + + rf_ctrl = &tbl_rf_control_override_rev3[index - 1]; + en_addr = BWN_PHY_N((i == 0) ? + rf_ctrl->en_addr0 : rf_ctrl->en_addr1); + val_addr = BWN_PHY_N((i == 0) ? + rf_ctrl->val_addr0 : rf_ctrl->val_addr1); + + if (off) { + BWN_PHY_MASK(mac, en_addr, ~(field)); + BWN_PHY_MASK(mac, val_addr, + ~(rf_ctrl->val_mask)); + } else { + if (core == 0 || ((1 << i) & core)) { + BWN_PHY_SET(mac, en_addr, field); + BWN_PHY_SETMASK(mac, val_addr, + ~(rf_ctrl->val_mask), + (value << rf_ctrl->val_shift)); + } + } + } + } else { + const struct bwn_nphy_rf_control_override_rev2 *rf_ctrl; + if (off) { + BWN_PHY_MASK(mac, BWN_NPHY_RFCTL_OVER, ~(field)); + value = 0; + } else { + BWN_PHY_SET(mac, BWN_NPHY_RFCTL_OVER, field); + } + + for (i = 0; i < 2; i++) { + if (index <= 1 || index == 16) { + BWN_ERRPRINTF(mac->mac_sc, + "Unsupported RF Ctrl Override call\n"); + return; + } + + if (index == 2 || index == 10 || + (index >= 13 && index <= 15)) { + core = 1; + } + + rf_ctrl = &tbl_rf_control_override_rev2[index - 2]; + addr = BWN_PHY_N((i == 0) ? + rf_ctrl->addr0 : rf_ctrl->addr1); + + if ((1 << i) & core) + BWN_PHY_SETMASK(mac, addr, ~(rf_ctrl->bmask), + (value << rf_ctrl->shift)); + + BWN_PHY_SET(mac, BWN_NPHY_RFCTL_OVER, 0x1); + BWN_PHY_SET(mac, BWN_NPHY_RFCTL_CMD, + BWN_NPHY_RFCTL_CMD_START); + DELAY(1); + BWN_PHY_MASK(mac, BWN_NPHY_RFCTL_OVER, 0xFFFE); + } + } +} + +static void bwn_nphy_rf_ctl_intc_override_rev7(struct bwn_mac *mac, + enum n_intc_override intc_override, + uint16_t value, uint8_t core_sel) +{ + uint16_t reg, tmp, tmp2, val; + int core; + + /* TODO: What about rev19+? Revs 3+ and 7+ are a bit similar */ + + for (core = 0; core < 2; core++) { + if ((core_sel == 1 && core != 0) || + (core_sel == 2 && core != 1)) + continue; + + reg = (core == 0) ? BWN_NPHY_RFCTL_INTC1 : BWN_NPHY_RFCTL_INTC2; + + switch (intc_override) { + case N_INTC_OVERRIDE_OFF: + BWN_PHY_WRITE(mac, reg, 0); + BWN_PHY_MASK(mac, 0x2ff, ~0x2000); + bwn_nphy_force_rf_sequence(mac, BWN_RFSEQ_RESET2RX); + break; + case N_INTC_OVERRIDE_TRSW: + BWN_PHY_SETMASK(mac, reg, ~0xC0, value << 6); + BWN_PHY_SET(mac, reg, 0x400); + + BWN_PHY_MASK(mac, 0x2ff, ~0xC000 & 0xFFFF); + BWN_PHY_SET(mac, 0x2ff, 0x2000); + BWN_PHY_SET(mac, 0x2ff, 0x0001); + break; + case N_INTC_OVERRIDE_PA: + tmp = 0x0030; + if (bwn_current_band(mac) == BWN_BAND_5G) + val = value << 5; + else + val = value << 4; + BWN_PHY_SETMASK(mac, reg, ~tmp, val); + BWN_PHY_SET(mac, reg, 0x1000); + break; + case N_INTC_OVERRIDE_EXT_LNA_PU: + if (bwn_current_band(mac) == BWN_BAND_5G) { + tmp = 0x0001; + tmp2 = 0x0004; + val = value; + } else { + tmp = 0x0004; + tmp2 = 0x0001; + val = value << 2; + } + BWN_PHY_SETMASK(mac, reg, ~tmp, val); + BWN_PHY_MASK(mac, reg, ~tmp2); + break; + case N_INTC_OVERRIDE_EXT_LNA_GAIN: + if (bwn_current_band(mac) == BWN_BAND_5G) { + tmp = 0x0002; + tmp2 = 0x0008; + val = value << 1; + } else { + tmp = 0x0008; + tmp2 = 0x0002; + val = value << 3; + } + BWN_PHY_SETMASK(mac, reg, ~tmp, val); + BWN_PHY_MASK(mac, reg, ~tmp2); + break; + } + } +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlIntcOverride */ +static void bwn_nphy_rf_ctl_intc_override(struct bwn_mac *mac, + enum n_intc_override intc_override, + uint16_t value, uint8_t core) +{ + uint8_t i, j; + uint16_t reg, tmp, val; + + if (mac->mac_phy.rev >= 7) { + bwn_nphy_rf_ctl_intc_override_rev7(mac, intc_override, value, + core); + return; + } + + if (mac->mac_phy.rev < 3) { + BWN_ERRPRINTF(mac->mac_sc, "%s: phy rev %d out of range\n", + __func__, + mac->mac_phy.rev); + } + + for (i = 0; i < 2; i++) { + if ((core == 1 && i == 1) || (core == 2 && !i)) + continue; + + reg = (i == 0) ? + BWN_NPHY_RFCTL_INTC1 : BWN_NPHY_RFCTL_INTC2; + BWN_PHY_SET(mac, reg, 0x400); + + switch (intc_override) { + case N_INTC_OVERRIDE_OFF: + BWN_PHY_WRITE(mac, reg, 0); + bwn_nphy_force_rf_sequence(mac, BWN_RFSEQ_RESET2RX); + break; + case N_INTC_OVERRIDE_TRSW: + if (!i) { + BWN_PHY_SETMASK(mac, BWN_NPHY_RFCTL_INTC1, + 0xFC3F, (value << 6)); + BWN_PHY_SETMASK(mac, BWN_NPHY_TXF_40CO_B1S1, + 0xFFFE, 1); + BWN_PHY_SET(mac, BWN_NPHY_RFCTL_CMD, + BWN_NPHY_RFCTL_CMD_START); + for (j = 0; j < 100; j++) { + if (!(BWN_PHY_READ(mac, BWN_NPHY_RFCTL_CMD) & BWN_NPHY_RFCTL_CMD_START)) { + j = 0; + break; + } + DELAY(10); + } + if (j) + BWN_ERRPRINTF(mac->mac_sc, + "intc override timeout\n"); + BWN_PHY_MASK(mac, BWN_NPHY_TXF_40CO_B1S1, + 0xFFFE); + } else { + BWN_PHY_SETMASK(mac, BWN_NPHY_RFCTL_INTC2, + 0xFC3F, (value << 6)); + BWN_PHY_SETMASK(mac, BWN_NPHY_RFCTL_OVER, + 0xFFFE, 1); + BWN_PHY_SET(mac, BWN_NPHY_RFCTL_CMD, + BWN_NPHY_RFCTL_CMD_RXTX); + for (j = 0; j < 100; j++) { + if (!(BWN_PHY_READ(mac, BWN_NPHY_RFCTL_CMD) & BWN_NPHY_RFCTL_CMD_RXTX)) { + j = 0; + break; + } + DELAY(10); + } + if (j) + BWN_ERRPRINTF(mac->mac_sc, + "intc override timeout\n"); + BWN_PHY_MASK(mac, BWN_NPHY_RFCTL_OVER, + 0xFFFE); + } + break; + case N_INTC_OVERRIDE_PA: + if (bwn_current_band(mac) == BWN_BAND_5G) { + tmp = 0x0020; + val = value << 5; + } else { + tmp = 0x0010; + val = value << 4; + } + BWN_PHY_SETMASK(mac, reg, ~tmp, val); + break; + case N_INTC_OVERRIDE_EXT_LNA_PU: + if (bwn_current_band(mac) == BWN_BAND_5G) { + tmp = 0x0001; + val = value; + } else { + tmp = 0x0004; + val = value << 2; + } + BWN_PHY_SETMASK(mac, reg, ~tmp, val); + break; + case N_INTC_OVERRIDE_EXT_LNA_GAIN: + if (bwn_current_band(mac) == BWN_BAND_5G) { + tmp = 0x0002; + val = value << 1; + } else { + tmp = 0x0008; + val = value << 3; + } + BWN_PHY_SETMASK(mac, reg, ~tmp, val); + break; + } + } +} + +/************************************************** + * Various PHY ops + **************************************************/ + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/clip-detection */ +static void bwn_nphy_write_clip_detection(struct bwn_mac *mac, + const uint16_t *clip_st) +{ + BWN_PHY_WRITE(mac, BWN_NPHY_C1_CLIP1THRES, clip_st[0]); + BWN_PHY_WRITE(mac, BWN_NPHY_C2_CLIP1THRES, clip_st[1]); +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/clip-detection */ +static void bwn_nphy_read_clip_detection(struct bwn_mac *mac, uint16_t *clip_st) +{ + clip_st[0] = BWN_PHY_READ(mac, BWN_NPHY_C1_CLIP1THRES); + clip_st[1] = BWN_PHY_READ(mac, BWN_NPHY_C2_CLIP1THRES); +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/classifier */ +static uint16_t bwn_nphy_classifier(struct bwn_mac *mac, uint16_t mask, uint16_t val) +{ + struct bwn_softc *sc = mac->mac_sc; + uint16_t tmp; + + if (siba_get_revid(sc->sc_dev) == 16) + bwn_mac_suspend(mac); + + tmp = BWN_PHY_READ(mac, BWN_NPHY_CLASSCTL); + tmp &= (BWN_NPHY_CLASSCTL_CCKEN | BWN_NPHY_CLASSCTL_OFDMEN | + BWN_NPHY_CLASSCTL_WAITEDEN); + tmp &= ~mask; + tmp |= (val & mask); + BWN_PHY_SETMASK(mac, BWN_NPHY_CLASSCTL, 0xFFF8, tmp); + + if (siba_get_revid(sc->sc_dev) == 16) + bwn_mac_enable(mac); + + return tmp; +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CCA */ +static void bwn_nphy_reset_cca(struct bwn_mac *mac) +{ + uint16_t bbcfg; + + bwn_phy_force_clock(mac, 1); + bbcfg = BWN_PHY_READ(mac, BWN_NPHY_BBCFG); + BWN_PHY_WRITE(mac, BWN_NPHY_BBCFG, bbcfg | BWN_NPHY_BBCFG_RSTCCA); + DELAY(1); + BWN_PHY_WRITE(mac, BWN_NPHY_BBCFG, bbcfg & ~BWN_NPHY_BBCFG_RSTCCA); + bwn_phy_force_clock(mac, 0); + bwn_nphy_force_rf_sequence(mac, BWN_RFSEQ_RESET2RX); +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/carriersearch */ +static void bwn_nphy_stay_in_carrier_search(struct bwn_mac *mac, bool enable) +{ + struct bwn_phy *phy = &mac->mac_phy; + struct bwn_phy_n *nphy = phy->phy_n; + + if (enable) { + static const uint16_t clip[] = { 0xFFFF, 0xFFFF }; + if (nphy->deaf_count++ == 0) { + nphy->classifier_state = bwn_nphy_classifier(mac, 0, 0); + bwn_nphy_classifier(mac, 0x7, + BWN_NPHY_CLASSCTL_WAITEDEN); + bwn_nphy_read_clip_detection(mac, nphy->clip_state); + bwn_nphy_write_clip_detection(mac, clip); + } + bwn_nphy_reset_cca(mac); + } else { + if (--nphy->deaf_count == 0) { + bwn_nphy_classifier(mac, 0x7, nphy->classifier_state); + bwn_nphy_write_clip_detection(mac, nphy->clip_state); + } + } +} + +/* http://bcm-v4.sipsolutions.net/PHY/N/Read_Lpf_Bw_Ctl */ +static uint16_t bwn_nphy_read_lpf_ctl(struct bwn_mac *mac, uint16_t offset) +{ + if (!offset) + offset = bwn_is_40mhz(mac) ? 0x159 : 0x154; + return bwn_ntab_read(mac, BWN_NTAB16(7, offset)) & 0x7; +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/AdjustLnaGainTbl */ +static void bwn_nphy_adjust_lna_gain_table(struct bwn_mac *mac) +{ + struct bwn_phy_n *nphy = mac->mac_phy.phy_n; + + uint8_t i; + int16_t tmp; + uint16_t data[4]; + int16_t gain[2]; + uint16_t minmax[2]; + static const uint16_t lna_gain[4] = { -2, 10, 19, 25 }; + + if (nphy->hang_avoid) + bwn_nphy_stay_in_carrier_search(mac, 1); + + if (nphy->gain_boost) { + if (bwn_current_band(mac) == BWN_BAND_2G) { + gain[0] = 6; + gain[1] = 6; + } else { + tmp = 40370 - 315 * bwn_get_chan(mac); + gain[0] = ((tmp >> 13) + ((tmp >> 12) & 1)); + tmp = 23242 - 224 * bwn_get_chan(mac); + gain[1] = ((tmp >> 13) + ((tmp >> 12) & 1)); + } + } else { + gain[0] = 0; + gain[1] = 0; + } + + for (i = 0; i < 2; i++) { + if (nphy->elna_gain_config) { + data[0] = 19 + gain[i]; + data[1] = 25 + gain[i]; + data[2] = 25 + gain[i]; + data[3] = 25 + gain[i]; + } else { + data[0] = lna_gain[0] + gain[i]; + data[1] = lna_gain[1] + gain[i]; + data[2] = lna_gain[2] + gain[i]; + data[3] = lna_gain[3] + gain[i]; + } + bwn_ntab_write_bulk(mac, BWN_NTAB16(i, 8), 4, data); + + minmax[i] = 23 + gain[i]; + } + + BWN_PHY_SETMASK(mac, BWN_NPHY_C1_MINMAX_GAIN, ~BWN_NPHY_C1_MINGAIN, + minmax[0] << BWN_NPHY_C1_MINGAIN_SHIFT); + BWN_PHY_SETMASK(mac, BWN_NPHY_C2_MINMAX_GAIN, ~BWN_NPHY_C2_MINGAIN, + minmax[1] << BWN_NPHY_C2_MINGAIN_SHIFT); + + if (nphy->hang_avoid) + bwn_nphy_stay_in_carrier_search(mac, 0); +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/SetRfSeq */ +static void bwn_nphy_set_rf_sequence(struct bwn_mac *mac, uint8_t cmd, + uint8_t *events, uint8_t *delays, uint8_t length) +{ + struct bwn_phy_n *nphy = mac->mac_phy.phy_n; + uint8_t i; + uint8_t end = (mac->mac_phy.rev >= 3) ? 0x1F : 0x0F; + uint16_t offset1 = cmd << 4; + uint16_t offset2 = offset1 + 0x80; + + if (nphy->hang_avoid) + bwn_nphy_stay_in_carrier_search(mac, true); + + bwn_ntab_write_bulk(mac, BWN_NTAB8(7, offset1), length, events); + bwn_ntab_write_bulk(mac, BWN_NTAB8(7, offset2), length, delays); + + for (i = length; i < 16; i++) { + bwn_ntab_write(mac, BWN_NTAB8(7, offset1 + i), end); + bwn_ntab_write(mac, BWN_NTAB8(7, offset2 + i), 1); + } + + if (nphy->hang_avoid) + bwn_nphy_stay_in_carrier_search(mac, false); +} + +/************************************************** + * Radio 0x2057 + **************************************************/ + +static void bwn_radio_2057_chantab_upload(struct bwn_mac *mac, + const struct bwn_nphy_chantabent_rev7 *e_r7, + const struct bwn_nphy_chantabent_rev7_2g *e_r7_2g) +{ + if (e_r7_2g) { + BWN_RF_WRITE(mac, R2057_VCOCAL_COUNTVAL0, e_r7_2g->radio_vcocal_countval0); + BWN_RF_WRITE(mac, R2057_VCOCAL_COUNTVAL1, e_r7_2g->radio_vcocal_countval1); + BWN_RF_WRITE(mac, R2057_RFPLL_REFMASTER_SPAREXTALSIZE, e_r7_2g->radio_rfpll_refmaster_sparextalsize); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_R1, e_r7_2g->radio_rfpll_loopfilter_r1); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C2, e_r7_2g->radio_rfpll_loopfilter_c2); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C1, e_r7_2g->radio_rfpll_loopfilter_c1); + BWN_RF_WRITE(mac, R2057_CP_KPD_IDAC, e_r7_2g->radio_cp_kpd_idac); + BWN_RF_WRITE(mac, R2057_RFPLL_MMD0, e_r7_2g->radio_rfpll_mmd0); + BWN_RF_WRITE(mac, R2057_RFPLL_MMD1, e_r7_2g->radio_rfpll_mmd1); + BWN_RF_WRITE(mac, R2057_VCOBUF_TUNE, e_r7_2g->radio_vcobuf_tune); + BWN_RF_WRITE(mac, R2057_LOGEN_MX2G_TUNE, e_r7_2g->radio_logen_mx2g_tune); + BWN_RF_WRITE(mac, R2057_LOGEN_INDBUF2G_TUNE, e_r7_2g->radio_logen_indbuf2g_tune); + BWN_RF_WRITE(mac, R2057_TXMIX2G_TUNE_BOOST_PU_CORE0, e_r7_2g->radio_txmix2g_tune_boost_pu_core0); + BWN_RF_WRITE(mac, R2057_PAD2G_TUNE_PUS_CORE0, e_r7_2g->radio_pad2g_tune_pus_core0); + BWN_RF_WRITE(mac, R2057_LNA2G_TUNE_CORE0, e_r7_2g->radio_lna2g_tune_core0); + BWN_RF_WRITE(mac, R2057_TXMIX2G_TUNE_BOOST_PU_CORE1, e_r7_2g->radio_txmix2g_tune_boost_pu_core1); + BWN_RF_WRITE(mac, R2057_PAD2G_TUNE_PUS_CORE1, e_r7_2g->radio_pad2g_tune_pus_core1); + BWN_RF_WRITE(mac, R2057_LNA2G_TUNE_CORE1, e_r7_2g->radio_lna2g_tune_core1); + + } else { + BWN_RF_WRITE(mac, R2057_VCOCAL_COUNTVAL0, e_r7->radio_vcocal_countval0); + BWN_RF_WRITE(mac, R2057_VCOCAL_COUNTVAL1, e_r7->radio_vcocal_countval1); + BWN_RF_WRITE(mac, R2057_RFPLL_REFMASTER_SPAREXTALSIZE, e_r7->radio_rfpll_refmaster_sparextalsize); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_R1, e_r7->radio_rfpll_loopfilter_r1); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C2, e_r7->radio_rfpll_loopfilter_c2); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C1, e_r7->radio_rfpll_loopfilter_c1); + BWN_RF_WRITE(mac, R2057_CP_KPD_IDAC, e_r7->radio_cp_kpd_idac); + BWN_RF_WRITE(mac, R2057_RFPLL_MMD0, e_r7->radio_rfpll_mmd0); + BWN_RF_WRITE(mac, R2057_RFPLL_MMD1, e_r7->radio_rfpll_mmd1); + BWN_RF_WRITE(mac, R2057_VCOBUF_TUNE, e_r7->radio_vcobuf_tune); + BWN_RF_WRITE(mac, R2057_LOGEN_MX2G_TUNE, e_r7->radio_logen_mx2g_tune); + BWN_RF_WRITE(mac, R2057_LOGEN_MX5G_TUNE, e_r7->radio_logen_mx5g_tune); + BWN_RF_WRITE(mac, R2057_LOGEN_INDBUF2G_TUNE, e_r7->radio_logen_indbuf2g_tune); + BWN_RF_WRITE(mac, R2057_LOGEN_INDBUF5G_TUNE, e_r7->radio_logen_indbuf5g_tune); + BWN_RF_WRITE(mac, R2057_TXMIX2G_TUNE_BOOST_PU_CORE0, e_r7->radio_txmix2g_tune_boost_pu_core0); + BWN_RF_WRITE(mac, R2057_PAD2G_TUNE_PUS_CORE0, e_r7->radio_pad2g_tune_pus_core0); + BWN_RF_WRITE(mac, R2057_PGA_BOOST_TUNE_CORE0, e_r7->radio_pga_boost_tune_core0); + BWN_RF_WRITE(mac, R2057_TXMIX5G_BOOST_TUNE_CORE0, e_r7->radio_txmix5g_boost_tune_core0); + BWN_RF_WRITE(mac, R2057_PAD5G_TUNE_MISC_PUS_CORE0, e_r7->radio_pad5g_tune_misc_pus_core0); + BWN_RF_WRITE(mac, R2057_LNA2G_TUNE_CORE0, e_r7->radio_lna2g_tune_core0); + BWN_RF_WRITE(mac, R2057_LNA5G_TUNE_CORE0, e_r7->radio_lna5g_tune_core0); + BWN_RF_WRITE(mac, R2057_TXMIX2G_TUNE_BOOST_PU_CORE1, e_r7->radio_txmix2g_tune_boost_pu_core1); + BWN_RF_WRITE(mac, R2057_PAD2G_TUNE_PUS_CORE1, e_r7->radio_pad2g_tune_pus_core1); + BWN_RF_WRITE(mac, R2057_PGA_BOOST_TUNE_CORE1, e_r7->radio_pga_boost_tune_core1); + BWN_RF_WRITE(mac, R2057_TXMIX5G_BOOST_TUNE_CORE1, e_r7->radio_txmix5g_boost_tune_core1); + BWN_RF_WRITE(mac, R2057_PAD5G_TUNE_MISC_PUS_CORE1, e_r7->radio_pad5g_tune_misc_pus_core1); + BWN_RF_WRITE(mac, R2057_LNA2G_TUNE_CORE1, e_r7->radio_lna2g_tune_core1); + BWN_RF_WRITE(mac, R2057_LNA5G_TUNE_CORE1, e_r7->radio_lna5g_tune_core1); + } +} + +static void bwn_radio_2057_setup(struct bwn_mac *mac, + const struct bwn_nphy_chantabent_rev7 *tabent_r7, + const struct bwn_nphy_chantabent_rev7_2g *tabent_r7_2g) +{ + struct bwn_phy *phy = &mac->mac_phy; + + bwn_radio_2057_chantab_upload(mac, tabent_r7, tabent_r7_2g); + + switch (phy->rf_rev) { + case 0 ... 4: + case 6: + if (bwn_current_band(mac) == BWN_BAND_2G) { + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_R1, 0x3f); + BWN_RF_WRITE(mac, R2057_CP_KPD_IDAC, 0x3f); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C1, 0x8); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C2, 0x8); + } else { + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_R1, 0x1f); + BWN_RF_WRITE(mac, R2057_CP_KPD_IDAC, 0x3f); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C1, 0x8); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C2, 0x8); + } + break; + case 9: /* e.g. PHY rev 16 */ + BWN_RF_WRITE(mac, R2057_LOGEN_PTAT_RESETS, 0x20); + BWN_RF_WRITE(mac, R2057_VCOBUF_IDACS, 0x18); + if (bwn_current_band(mac) == BWN_BAND_5G) { + BWN_RF_WRITE(mac, R2057_LOGEN_PTAT_RESETS, 0x38); + BWN_RF_WRITE(mac, R2057_VCOBUF_IDACS, 0x0f); + + if (bwn_is_40mhz(mac)) { + /* TODO */ + } else { + BWN_RF_WRITE(mac, + R2057_PAD_BIAS_FILTER_BWS_CORE0, + 0x3c); + BWN_RF_WRITE(mac, + R2057_PAD_BIAS_FILTER_BWS_CORE1, + 0x3c); + } + } + break; + case 14: /* 2 GHz only */ + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_R1, 0x1b); + BWN_RF_WRITE(mac, R2057_CP_KPD_IDAC, 0x3f); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C1, 0x1f); + BWN_RF_WRITE(mac, R2057_RFPLL_LOOPFILTER_C2, 0x1f); + break; + } + + if (bwn_current_band(mac) == BWN_BAND_2G) { + uint16_t txmix2g_tune_boost_pu = 0; + uint16_t pad2g_tune_pus = 0; + + if (bwn_nphy_ipa(mac)) { + switch (phy->rf_rev) { + case 9: + txmix2g_tune_boost_pu = 0x0041; + /* TODO */ + break; + case 14: + txmix2g_tune_boost_pu = 0x21; + pad2g_tune_pus = 0x23; + break; + } + } + + if (txmix2g_tune_boost_pu) + BWN_RF_WRITE(mac, R2057_TXMIX2G_TUNE_BOOST_PU_CORE0, + txmix2g_tune_boost_pu); + if (pad2g_tune_pus) + BWN_RF_WRITE(mac, R2057_PAD2G_TUNE_PUS_CORE0, + pad2g_tune_pus); + if (txmix2g_tune_boost_pu) + BWN_RF_WRITE(mac, R2057_TXMIX2G_TUNE_BOOST_PU_CORE1, + txmix2g_tune_boost_pu); + if (pad2g_tune_pus) + BWN_RF_WRITE(mac, R2057_PAD2G_TUNE_PUS_CORE1, + pad2g_tune_pus); + } + + /* 50..100 */ + DELAY(100); + + /* VCO calibration */ + BWN_RF_MASK(mac, R2057_RFPLL_MISC_EN, ~0x01); + BWN_RF_MASK(mac, R2057_RFPLL_MISC_CAL_RESETN, ~0x04); + BWN_RF_SET(mac, R2057_RFPLL_MISC_CAL_RESETN, 0x4); + BWN_RF_SET(mac, R2057_RFPLL_MISC_EN, 0x01); + /* 300..600 */ + DELAY(600); +} + +/* Calibrate resistors in LPF of PLL? + * http://bcm-v4.sipsolutions.net/PHY/radio205x_rcal + */ +static uint8_t bwn_radio_2057_rcal(struct bwn_mac *mac) +{ + struct bwn_phy *phy = &mac->mac_phy; + uint16_t saved_regs_phy[12]; + uint16_t saved_regs_phy_rf[6]; + uint16_t saved_regs_radio[2] = { }; + static const uint16_t phy_to_store[] = { + BWN_NPHY_RFCTL_RSSIO1, BWN_NPHY_RFCTL_RSSIO2, + BWN_NPHY_RFCTL_LUT_TRSW_LO1, BWN_NPHY_RFCTL_LUT_TRSW_LO2, + BWN_NPHY_RFCTL_RXG1, BWN_NPHY_RFCTL_RXG2, + BWN_NPHY_RFCTL_TXG1, BWN_NPHY_RFCTL_TXG2, + BWN_NPHY_REV7_RF_CTL_MISC_REG3, BWN_NPHY_REV7_RF_CTL_MISC_REG4, + BWN_NPHY_REV7_RF_CTL_MISC_REG5, BWN_NPHY_REV7_RF_CTL_MISC_REG6, + }; + static const uint16_t phy_to_store_rf[] = { + BWN_NPHY_REV3_RFCTL_OVER0, BWN_NPHY_REV3_RFCTL_OVER1, + BWN_NPHY_REV7_RF_CTL_OVER3, BWN_NPHY_REV7_RF_CTL_OVER4, + BWN_NPHY_REV7_RF_CTL_OVER5, BWN_NPHY_REV7_RF_CTL_OVER6, + }; + uint16_t tmp; + int i; + + /* Save */ + for (i = 0; i < nitems(phy_to_store); i++) + saved_regs_phy[i] = BWN_PHY_READ(mac, phy_to_store[i]); + for (i = 0; i < nitems(phy_to_store_rf); i++) + saved_regs_phy_rf[i] = BWN_PHY_READ(mac, phy_to_store_rf[i]); + + /* Set */ + for (i = 0; i < nitems(phy_to_store); i++) + BWN_PHY_WRITE(mac, phy_to_store[i], 0); + BWN_PHY_WRITE(mac, BWN_NPHY_REV3_RFCTL_OVER0, 0x07ff); + BWN_PHY_WRITE(mac, BWN_NPHY_REV3_RFCTL_OVER1, 0x07ff); + BWN_PHY_WRITE(mac, BWN_NPHY_REV7_RF_CTL_OVER3, 0x07ff); + BWN_PHY_WRITE(mac, BWN_NPHY_REV7_RF_CTL_OVER4, 0x07ff); + BWN_PHY_WRITE(mac, BWN_NPHY_REV7_RF_CTL_OVER5, 0x007f); + BWN_PHY_WRITE(mac, BWN_NPHY_REV7_RF_CTL_OVER6, 0x007f); + + switch (phy->rf_rev) { + case 5: + BWN_PHY_MASK(mac, BWN_NPHY_REV7_RF_CTL_OVER3, ~0x2); + DELAY(10); + BWN_RF_SET(mac, R2057_IQTEST_SEL_PU, 0x1); + BWN_RF_SETMASK(mac, R2057v7_IQTEST_SEL_PU2, ~0x2, 0x1); + break; + case 9: + BWN_PHY_SET(mac, BWN_NPHY_REV7_RF_CTL_OVER3, 0x2); + BWN_PHY_SET(mac, BWN_NPHY_REV7_RF_CTL_MISC_REG3, 0x2); + saved_regs_radio[0] = BWN_RF_READ(mac, R2057_IQTEST_SEL_PU); + BWN_RF_WRITE(mac, R2057_IQTEST_SEL_PU, 0x11); + break; + case 14: + saved_regs_radio[0] = BWN_RF_READ(mac, R2057_IQTEST_SEL_PU); + saved_regs_radio[1] = BWN_RF_READ(mac, R2057v7_IQTEST_SEL_PU2); + BWN_PHY_SET(mac, BWN_NPHY_REV7_RF_CTL_MISC_REG3, 0x2); + BWN_PHY_SET(mac, BWN_NPHY_REV7_RF_CTL_OVER3, 0x2); + BWN_RF_WRITE(mac, R2057v7_IQTEST_SEL_PU2, 0x2); + BWN_RF_WRITE(mac, R2057_IQTEST_SEL_PU, 0x1); + break; + } + + /* Enable */ + BWN_RF_SET(mac, R2057_RCAL_CONFIG, 0x1); + DELAY(10); + + /* Start */ + BWN_RF_SET(mac, R2057_RCAL_CONFIG, 0x2); + /* 100..200 */ + DELAY(200); + + /* Stop */ + BWN_RF_MASK(mac, R2057_RCAL_CONFIG, ~0x2); + + /* Wait and check for result */ + if (!bwn_radio_wait_value(mac, R2057_RCAL_STATUS, 1, 1, 100, 1000000)) { + BWN_ERRPRINTF(mac->mac_sc, "Radio 0x2057 rcal timeout\n"); + return 0; + } + tmp = BWN_RF_READ(mac, R2057_RCAL_STATUS) & 0x3E; + + /* Disable */ + BWN_RF_MASK(mac, R2057_RCAL_CONFIG, ~0x1); + + /* Restore */ + for (i = 0; i < nitems(phy_to_store_rf); i++) + BWN_PHY_WRITE(mac, phy_to_store_rf[i], saved_regs_phy_rf[i]); + for (i = 0; i < nitems(phy_to_store); i++) + BWN_PHY_WRITE(mac, phy_to_store[i], saved_regs_phy[i]); + + switch (phy->rf_rev) { + case 0 ... 4: + case 6: + BWN_RF_SETMASK(mac, R2057_TEMPSENSE_CONFIG, ~0x3C, tmp); + BWN_RF_SETMASK(mac, R2057_BANDGAP_RCAL_TRIM, ~0xF0, + tmp << 2); + break; + case 5: + BWN_RF_MASK(mac, R2057_IPA2G_CASCONV_CORE0, ~0x1); + BWN_RF_MASK(mac, R2057v7_IQTEST_SEL_PU2, ~0x2); + break; + case 9: + BWN_RF_WRITE(mac, R2057_IQTEST_SEL_PU, saved_regs_radio[0]); + break; + case 14: + BWN_RF_WRITE(mac, R2057_IQTEST_SEL_PU, saved_regs_radio[0]); + BWN_RF_WRITE(mac, R2057v7_IQTEST_SEL_PU2, saved_regs_radio[1]); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 17 07:10:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9627EB3ED7B; Tue, 17 May 2016 07:10: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 65D7211F4; Tue, 17 May 2016 07:10:31 +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 u4H7AUs7028339; Tue, 17 May 2016 07:10:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7AUhN028338; Tue, 17 May 2016 07:10:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170710.u4H7AUhN028338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 07:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300017 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:10:31 -0000 Author: adrian Date: Tue May 17 07:10:30 2016 New Revision: 300017 URL: https://svnweb.freebsd.org/changeset/base/300017 Log: [bwn] add the BWN_GPL_PHY option. This will eventually enable building the GPL PHY hooks needed for running b43 based PHYs. For now it'll just build PHY-N. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue May 17 07:09:24 2016 (r300016) +++ head/sys/conf/options Tue May 17 07:10:30 2016 (r300017) @@ -856,6 +856,7 @@ BWI_DEBUG_VERBOSE opt_bwi.h # options for the Brodacom BCM43xx driver (bwn) BWN_DEBUG opt_bwn.h +BWN_GPL_PHY opt_bwn.h # Options for the SIBA driver SIBA_DEBUG opt_siba.h From owner-svn-src-all@freebsd.org Tue May 17 07:11:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 610D2B3EE0D; Tue, 17 May 2016 07:11:13 +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 38D6C14B8; Tue, 17 May 2016 07:11:13 +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 u4H7BCML028429; Tue, 17 May 2016 07:11:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7BCY8028427; Tue, 17 May 2016 07:11:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170711.u4H7BCY8028427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 07:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300018 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:11:13 -0000 Author: adrian Date: Tue May 17 07:11:12 2016 New Revision: 300018 URL: https://svnweb.freebsd.org/changeset/base/300018 Log: [bwn] add PHY-N glue. It defaults to stubbing out PHY-N bindings, but it can be flipped to call into the b43 PHY-N port. Added: head/sys/dev/bwn/if_bwn_phy_n.c (contents, props changed) head/sys/dev/bwn/if_bwn_phy_n.h (contents, props changed) Added: head/sys/dev/bwn/if_bwn_phy_n.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_phy_n.c Tue May 17 07:11:12 2016 (r300018) @@ -0,0 +1,281 @@ +/*- + * Copyright (c) 2016 Adrian Chadd + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * This is the top-level N-PHY support for the Broadcom softmac driver. + */ + +#include "opt_bwn.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#ifdef BWN_GPL_PHY +#include +#include +#include +#endif + +/* + * This module is always compiled into the kernel, regardless of + * whether the GPL PHY is enabled. If the GPL PHY isn't enabled + * then it'll just be stubs that will fail to attach. + */ + +int +bwn_phy_n_attach(struct bwn_mac *mac) +{ + +#ifdef BWN_GPL_PHY + return bwn_nphy_op_allocate(mac); +#else + return (ENXIO); +#endif +} + +void +bwn_phy_n_detach(struct bwn_mac *mac) +{ + +#ifdef BWN_GPL_PHY + return bwn_nphy_op_free(mac); +#endif +} + +int +bwn_phy_n_prepare_hw(struct bwn_mac *mac) +{ + +#ifdef BWN_GPL_PHY + bwn_nphy_op_prepare_structs(mac); + return (0); +#else + return (ENXIO); +#endif +} + +void +bwn_phy_n_init_pre(struct bwn_mac *mac) +{ + + /* XXX TODO */ +} + +int +bwn_phy_n_init(struct bwn_mac *mac) +{ +#ifdef BWN_GPL_PHY + return bwn_nphy_op_init(mac); +#else + return (ENXIO); +#endif +} + +void +bwn_phy_n_exit(struct bwn_mac *mac) +{ + + /* XXX TODO */ +} + +uint16_t +bwn_phy_n_read(struct bwn_mac *mac, uint16_t reg) +{ + + BWN_WRITE_2(mac, BWN_PHYCTL, reg); + return BWN_READ_2(mac, BWN_PHYDATA); +} + +void +bwn_phy_n_write(struct bwn_mac *mac, uint16_t reg, uint16_t value) +{ + + BWN_WRITE_2(mac, BWN_PHYCTL, reg); + BWN_WRITE_2(mac, BWN_PHYDATA, value); +} + +uint16_t +bwn_phy_n_rf_read(struct bwn_mac *mac, uint16_t reg) +{ + + /* Register 1 is a 32-bit register. */ + if (mac->mac_phy.rev < 7 && reg == 1) { + BWN_ERRPRINTF(mac->mac_sc, "%s: bad reg access\n", __func__); + } + + if (mac->mac_phy.rev >= 7) + reg |= 0x200; /* radio 0x2057 */ + else + reg |= 0x100; + + BWN_WRITE_2(mac, BWN_RFCTL, reg); + return BWN_READ_2(mac, BWN_RFDATALO); +} + +void +bwn_phy_n_rf_write(struct bwn_mac *mac, uint16_t reg, uint16_t value) +{ + + /* Register 1 is a 32-bit register. */ + if (mac->mac_phy.rev < 7 && reg == 1) { + BWN_ERRPRINTF(mac->mac_sc, "%s: bad reg access\n", __func__); + } + + BWN_WRITE_2(mac, BWN_RFCTL, reg); + BWN_WRITE_2(mac, BWN_RFDATALO, value); +} + +int +bwn_phy_n_hwpctl(struct bwn_mac *mac) +{ + + return (0); +} + +void +bwn_phy_n_rf_onoff(struct bwn_mac *mac, int on) +{ +#ifdef BWN_GPL_PHY + bwn_nphy_op_software_rfkill(mac, on); +#endif +} + +void +bwn_phy_n_switch_analog(struct bwn_mac *mac, int on) +{ +#ifdef BWN_GPL_PHY + bwn_nphy_op_switch_analog(mac, on); +#endif +} + +int +bwn_phy_n_switch_channel(struct bwn_mac *mac, uint32_t newchan) +{ +#ifdef BWN_GPL_PHY + return bwn_nphy_op_switch_channel(mac, newchan); +#else + return (ENXIO); +#endif +} + +uint32_t +bwn_phy_n_get_default_chan(struct bwn_mac *mac) +{ + + if (bwn_current_band(mac) == BWN_BAND_2G) + return (1); + return (36); +} + +void +bwn_phy_n_set_antenna(struct bwn_mac *mac, int antenna) +{ + /* XXX TODO */ +} + +int +bwn_phy_n_im(struct bwn_mac *mac, int mode) +{ + /* XXX TODO */ + return (0); +} + +bwn_txpwr_result_t +bwn_phy_n_recalc_txpwr(struct bwn_mac *mac, int ignore_tssi) +{ +#ifdef BWN_GPL_PHY + return bwn_nphy_op_recalc_txpower(mac, ignore_tssi); +#else + return (BWN_TXPWR_RES_DONE); +#endif +} + +void +bwn_phy_n_set_txpwr(struct bwn_mac *mac) +{ + +} + +void +bwn_phy_n_task_15s(struct bwn_mac *mac) +{ + +} + +void +bwn_phy_n_task_60s(struct bwn_mac *mac) +{ + +} Added: head/sys/dev/bwn/if_bwn_phy_n.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_phy_n.h Tue May 17 07:11:12 2016 (r300018) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2016 Adrian Chadd . + * 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 + * 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 NONINFRINGEMENT, 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. + * + * $FreeBSD$ + */ + +#ifndef __IF_BWN_PHY_N_H__ +#define __IF_BWN_PHY_N_H__ + +extern int bwn_phy_n_attach(struct bwn_mac *mac); +extern void bwn_phy_n_detach(struct bwn_mac *mac); +extern int bwn_phy_n_prepare_hw(struct bwn_mac *mac); +extern void bwn_phy_n_init_pre(struct bwn_mac *mac); +extern int bwn_phy_n_init(struct bwn_mac *mac); +extern void bwn_phy_n_exit(struct bwn_mac *mac); +extern uint16_t bwn_phy_n_read(struct bwn_mac *mac, uint16_t reg); +extern void bwn_phy_n_write(struct bwn_mac *mac, uint16_t reg, uint16_t value); +extern uint16_t bwn_phy_n_rf_read(struct bwn_mac *mac, uint16_t reg); +extern void bwn_phy_n_rf_write(struct bwn_mac *mac, uint16_t reg, uint16_t value); +extern int bwn_phy_n_hwpctl(struct bwn_mac *mac); +extern void bwn_phy_n_rf_onoff(struct bwn_mac *mac, int on); +extern void bwn_phy_n_switch_analog(struct bwn_mac *mac, int on); +extern int bwn_phy_n_switch_channel(struct bwn_mac *mac, uint32_t newchan); +extern uint32_t bwn_phy_n_get_default_chan(struct bwn_mac *mac); +extern void bwn_phy_n_set_antenna(struct bwn_mac *mac, int antenna); +extern int bwn_phy_n_im(struct bwn_mac *mac, int mode); +extern bwn_txpwr_result_t bwn_phy_n_recalc_txpwr(struct bwn_mac *mac, int ignore_tssi); +extern void bwn_phy_n_set_txpwr(struct bwn_mac *mac); +extern void bwn_phy_n_task_15s(struct bwn_mac *mac); +extern void bwn_phy_n_task_60s(struct bwn_mac *mac); + +#endif /* __IF_BWN_PHY_N_H__ */ From owner-svn-src-all@freebsd.org Tue May 17 07:12:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0865B3EE72; Tue, 17 May 2016 07:12:01 +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 770B017E6; Tue, 17 May 2016 07:12:01 +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 u4H7C0TU028502; Tue, 17 May 2016 07:12:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7C0Pd028501; Tue, 17 May 2016 07:12:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170712.u4H7C0Pd028501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 07:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300019 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:12:01 -0000 Author: adrian Date: Tue May 17 07:12:00 2016 New Revision: 300019 URL: https://svnweb.freebsd.org/changeset/base/300019 Log: [bwn] Add PHY-N call hooks. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 17 07:11:12 2016 (r300018) +++ head/sys/dev/bwn/if_bwn.c Tue May 17 07:12:00 2016 (r300019) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); @@ -1223,6 +1224,8 @@ bwn_attach_core(struct bwn_mac *mac) have_bg = 1; } + mac->mac_phy.phy_n = NULL; + if (mac->mac_phy.type == BWN_PHYTYPE_G) { mac->mac_phy.attach = bwn_phy_g_attach; mac->mac_phy.detach = bwn_phy_g_detach; @@ -1259,6 +1262,28 @@ bwn_attach_core(struct bwn_mac *mac) mac->mac_phy.get_default_chan = bwn_phy_lp_get_default_chan; mac->mac_phy.set_antenna = bwn_phy_lp_set_antenna; mac->mac_phy.task_60s = bwn_phy_lp_task_60s; + } else if (mac->mac_phy.type == BWN_PHYTYPE_N) { + mac->mac_phy.attach = bwn_phy_n_attach; + mac->mac_phy.detach = bwn_phy_n_detach; + mac->mac_phy.prepare_hw = bwn_phy_n_prepare_hw; + mac->mac_phy.init_pre = bwn_phy_n_init_pre; + mac->mac_phy.init = bwn_phy_n_init; + mac->mac_phy.exit = bwn_phy_n_exit; + mac->mac_phy.phy_read = bwn_phy_n_read; + mac->mac_phy.phy_write = bwn_phy_n_write; + mac->mac_phy.rf_read = bwn_phy_n_rf_read; + mac->mac_phy.rf_write = bwn_phy_n_rf_write; + mac->mac_phy.use_hwpctl = bwn_phy_n_hwpctl; + mac->mac_phy.rf_onoff = bwn_phy_n_rf_onoff; + mac->mac_phy.switch_analog = bwn_phy_n_switch_analog; + mac->mac_phy.switch_channel = bwn_phy_n_switch_channel; + mac->mac_phy.get_default_chan = bwn_phy_n_get_default_chan; + mac->mac_phy.set_antenna = bwn_phy_n_set_antenna; + mac->mac_phy.set_im = bwn_phy_n_im; + mac->mac_phy.recalc_txpwr = bwn_phy_n_recalc_txpwr; + mac->mac_phy.set_txpwr = bwn_phy_n_set_txpwr; + mac->mac_phy.task_15s = bwn_phy_n_task_15s; + mac->mac_phy.task_60s = bwn_phy_n_task_60s; } else { device_printf(sc->sc_dev, "unsupported PHY type (%d)\n", mac->mac_phy.type); From owner-svn-src-all@freebsd.org Tue May 17 07:15:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EB80B3EF4E; Tue, 17 May 2016 07:15:26 +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 2459E1A35; Tue, 17 May 2016 07:15:26 +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 u4H7FPpr031245; Tue, 17 May 2016 07:15:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7FPHd031243; Tue, 17 May 2016 07:15:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605170715.u4H7FPHd031243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 07:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300020 - in head/sys: conf modules/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:15:26 -0000 Author: adrian Date: Tue May 17 07:15:25 2016 New Revision: 300020 URL: https://svnweb.freebsd.org/changeset/base/300020 Log: [bwn] add in bwn n-phy linking. * The default kernel and options won't build the GPL PHY bits; * bwn(4) defaults to building as a module anyway!; * If BWN_GPL_PHY is specified in the config file, and you uncomment the GPL PHY bits in the module Makefile, you'll get a working N-PHY. This is specifically designed to be obtuse for now, as I don't want to flip it on by default. It's easy enough for people to flip on and build, and it's a module so the default GENERIC kernel won't be GPL tainted. I'll have to add an actual HAL layer that allows the GPL PHY to be loaded before if_bwn so it can be "magic", but that'll come later. Tested: * BCM4321 11abg NIC, STA mode Modified: head/sys/conf/files head/sys/modules/bwn/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 17 07:12:00 2016 (r300019) +++ head/sys/conf/files Tue May 17 07:15:25 2016 (r300020) @@ -1179,6 +1179,7 @@ dev/bwn/if_bwn_phy_g.c optional bwn sib compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn_phy_n.c optional bwn siba_bwn dev/bwn/if_bwn_util.c optional bwn siba_bwn dev/bwn/bwn_mac.c optional bwn bhnd | bwn bhndbus dev/cardbus/cardbus.c optional cardbus Modified: head/sys/modules/bwn/Makefile ============================================================================== --- head/sys/modules/bwn/Makefile Tue May 17 07:12:00 2016 (r300019) +++ head/sys/modules/bwn/Makefile Tue May 17 07:15:25 2016 (r300020) @@ -9,10 +9,23 @@ SRCS+= if_bwn_util.c # PHY SRCS+= if_bwn_phy_common.c SRCS+= if_bwn_phy_g.c if_bwn_phy_lp.c +SRCS+= if_bwn_phy_n.c # Other SRCS+= device_if.h bus_if.h pci_if.h +# Uncomment this for the GPL PHY code; this requires the +# module be built with BWN_GPL_PHY set in the kernel +# configuration. + +#.PATH: ${.CURDIR}/../../gnu/dev/bwn/phy_n +#SRCS+= if_bwn_radio_2055.c +#SRCS+= if_bwn_radio_2056.c +#SRCS+= if_bwn_radio_2057.c +#SRCS+= if_bwn_phy_n_tables.c +#SRCS+= if_bwn_phy_n_ppr.c +#SRCS+= if_bwn_phy_n_core.c + .include # XXX Work around clang warning, until maintainer approves fix. From owner-svn-src-all@freebsd.org Tue May 17 07:16:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0564BB3EFAC; Tue, 17 May 2016 07:16:22 +0000 (UTC) (envelope-from grog@lemis.com) Received: from www.lemis.com (www.lemis.com [208.86.226.86]) by mx1.freebsd.org (Postfix) with ESMTP id D8E4B1BDB; Tue, 17 May 2016 07:16:21 +0000 (UTC) (envelope-from grog@lemis.com) Received: from eureka.lemis.com (www.lemis.com [208.86.226.86]) by www.lemis.com (Postfix) with ESMTP id 656901B72847; Tue, 17 May 2016 07:16:20 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 6618044A5FE; Tue, 17 May 2016 17:16:19 +1000 (AEST) Date: Tue, 17 May 2016 17:16:19 +1000 From: Greg 'groggy' Lehey To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Message-ID: <20160517071619.GX4617@eureka.lemis.com> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <1514281.0ZCu4236n8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eV9cGEf2bJwTs/8b" Content-Disposition: inline In-Reply-To: <1514281.0ZCu4236n8@ralph.baldwin.cx> Organization: The FreeBSD Project Phone: +61-3-5346-1370, +61-3-5309-0418 Mobile: 0401 265 606. Use only as instructed. WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:16:22 -0000 --eV9cGEf2bJwTs/8b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 17 May 2016 at 0:04:51 -0700, John Baldwin wrote: > On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote: >> Author: grog >> Date: Tue May 17 04:40:00 2016 >> New Revision: 300003 >> URL: https://svnweb.freebsd.org/changeset/base/300003 >> >> Log: >> Correct use of incorrect grammar. >> >> Modified: >> head/share/man/man4/gdb.4 >> >> Modified: head/share/man/man4/gdb.4 >> ============================================================================== >> --- head/share/man/man4/gdb.4 Tue May 17 04:03:45 2016 (r300002) >> +++ head/share/man/man4/gdb.4 Tue May 17 04:40:00 2016 (r300003) >> @@ -595,7 +595,7 @@ run the link at more than 9600 bps. >> Firewire connections do not have this problem. >> .Pp >> The debugging macros >> -.Dq "just grown" . >> +.Dq "just growed" . > > "grew"? "Just growed". Did you never read Uncle Tom's Cabin? Check Topsy. Of course, what this page really needs is a good overhaul. I'll see if I can muster the energy. Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft mail program reports problems, please read http://lemis.com/broken-MUA --eV9cGEf2bJwTs/8b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlc6xUMACgkQIubykFB6QiOamQCfQBAHEbZi3Gms+m2yc4pfzxL1 agoAn2jtwb5hb324/X+54TesK84ZUTjr =onyV -----END PGP SIGNATURE----- --eV9cGEf2bJwTs/8b-- From owner-svn-src-all@freebsd.org Tue May 17 07:34:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D37D9B3E37D; Tue, 17 May 2016 07:34:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 94B8413CF; Tue, 17 May 2016 07:34:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4H7YNUX074219; Tue, 17 May 2016 00:34:27 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605170734.u4H7YNUX074219@gw.catspoiler.org> Date: Tue, 17 May 2016 00:34:23 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300005 - head/usr.bin/ncal To: cem@FreeBSD.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605170607.u4H67VJL074016@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:34:33 -0000 On 16 May, To: cem@FreeBSD.org wrote: > On 16 May, Conrad Meyer wrote: >> On Mon, May 16, 2016 at 10:05 PM, Don Lewis wrote: >>> Author: truckman >>> Date: Tue May 17 05:05:30 2016 >>> New Revision: 300005 >>> URL: https://svnweb.freebsd.org/changeset/base/300005 >>> >>> Log: >>> swprintf() and apparently wcsftime() want the their output buffer size >>> specified in terms of the the number of wide characters and not >>> sizeof(buffer). >>> ... >>> Modified: head/usr.bin/ncal/ncal.c >>> ============================================================================== >>> --- head/usr.bin/ncal/ncal.c Tue May 17 04:53:21 2016 (r300004) >>> +++ head/usr.bin/ncal/ncal.c Tue May 17 05:05:30 2016 (r300005) >>> @@ -642,8 +642,8 @@ monthrangeb(int y, int m, int jd_flag, i >>> wprintf(L"%-*ls ", >>> mw, wcenter(ws, year[i].name, mw)); >>> else { >>> - swprintf(ws, sizeof(ws), L"%-ls %d", >>> - year[i].name, M2Y(m + i)); >>> + swprintf(ws, sizeof(ws)/sizeof(ws[0]), >> >> Normally we spell this nitems(ws). >> >>> + L"%-ls %d", year[i].name, M2Y(m + i)); >>> wprintf(L"%-*ls ", mw, wcenter(ws1, ws, mw)); >>> } >>> printf("\n"); >>> @@ -958,7 +958,7 @@ mkweekdays(struct weekdays *wds) >>> >>> for (i = 0; i != 7; i++) { >>> tm.tm_wday = (i+1) % 7; >>> - wcsftime(buf, sizeof(buf), L"%a", &tm); >>> + wcsftime(buf, sizeof(buf)/sizeof(buf[0]), L"%a", &tm); >> >> This one can be nitems(buf) too. >> >>> for (len = 2; len > 0; --len) { >>> if ((width = wcswidth(buf, len)) <= 2) >>> break; >>> > > I thought about that, but I didn't see any obvious signs that > was included. It's not included indirectly, either. cc -O2 -pipe -g -MD -MF.depend.ncal.o -MTncal.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /usr/src/usr.bin/ncal/ncal.c -o ncal.o /usr/src/usr.bin/ncal/ncal.c:645:18: error: implicit declaration of function 'nitems' is invalid in C99 [-Werror,-Wimplicit-function-declaration] swprintf(ws, nitems(ws), L"%-ls %d", From owner-svn-src-all@freebsd.org Tue May 17 07:47:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE218B3E7B5; Tue, 17 May 2016 07:47:24 +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 881461DF6; Tue, 17 May 2016 07:47:24 +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 u4H7lNVe040515; Tue, 17 May 2016 07:47:23 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7lNXI040509; Tue, 17 May 2016 07:47:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605170747.u4H7lNXI040509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 17 May 2016 07:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300021 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:47:24 -0000 Author: ae Date: Tue May 17 07:47:23 2016 New Revision: 300021 URL: https://svnweb.freebsd.org/changeset/base/300021 Log: Make named objects set-aware. Now it is possible to create named objects with the same name in different sets. Add optional manage_sets() callback to objects rewriting framework. It is intended to implement handler for moving and swapping named object's sets. Add ipfw_obj_manage_sets() function that implements generic sets handler. Use new callback to implement sets support for lookup tables. External actions objects are global and they don't support sets. Modify eaction_findbyname() to reflect this. ipfw(8) now may fail to move rules or sets, because some named objects in target set may have conflicting names. Note that ipfw_obj_ntlv type was changed, but since lookup tables actually didn't support sets, this change is harmless. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw2.c head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/ip_fw_eaction.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue May 17 07:15:25 2016 (r300020) +++ head/sbin/ipfw/ipfw2.c Tue May 17 07:47:23 2016 (r300021) @@ -2280,6 +2280,9 @@ ipfw_sets_handler(char *av[]) if (!isdigit(*(av[2])) || rt.new_set > RESVD_SET) errx(EX_DATAERR, "invalid dest. set %s\n", av[1]); i = do_range_cmd(cmd, &rt); + if (i < 0) + err(EX_OSERR, "failed to move %s", + cmd == IP_FW_SET_MOVE ? "set": "rule"); } else if (_substrcmp(*av, "disable") == 0 || _substrcmp(*av, "enable") == 0 ) { int which = _substrcmp(*av, "enable") == 0 ? 1 : 0; Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Tue May 17 07:15:25 2016 (r300020) +++ head/sys/netinet/ip_fw.h Tue May 17 07:47:23 2016 (r300021) @@ -791,9 +791,9 @@ typedef struct _ipfw_obj_tlv { typedef struct _ipfw_obj_ntlv { ipfw_obj_tlv head; /* TLV header */ uint16_t idx; /* Name index */ - uint8_t spare; /* unused */ + uint8_t set; /* set, if applicable */ uint8_t type; /* object type, if applicable */ - uint32_t set; /* set, if applicable */ + uint32_t spare; /* unused */ char name[64]; /* Null-terminated name */ } ipfw_obj_ntlv; Modified: head/sys/netpfil/ipfw/ip_fw_eaction.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_eaction.c Tue May 17 07:15:25 2016 (r300020) +++ head/sys/netpfil/ipfw/ip_fw_eaction.c Tue May 17 07:47:23 2016 (r300021) @@ -137,10 +137,28 @@ static int eaction_findbyname(struct ip_fw_chain *ch, struct tid_info *ti, struct named_object **pno) { + ipfw_obj_ntlv *ntlv; - EACTION_DEBUG("uidx %u, type %u", ti->uidx, ti->type); - return (ipfw_objhash_find_type(CHAIN_TO_SRV(ch), ti, - IPFW_TLV_EACTION, pno)); + if (ti->tlvs == NULL) + return (EINVAL); + + /* Search ntlv in the buffer provided by user */ + ntlv = ipfw_find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx, + IPFW_TLV_EACTION); + if (ntlv == NULL) + return (EINVAL); + EACTION_DEBUG("name %s, uidx %u, type %u", ntlv->name, + ti->uidx, ti->type); + /* + * Search named object with corresponding name. + * Since eaction objects are global - ignore the set value + * and use zero instead. + */ + *pno = ipfw_objhash_lookup_name_type(CHAIN_TO_SRV(ch), + 0, IPFW_TLV_EACTION, ntlv->name); + if (*pno == NULL) + return (ESRCH); + return (0); } static struct named_object * Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Tue May 17 07:15:25 2016 (r300020) +++ head/sys/netpfil/ipfw/ip_fw_private.h Tue May 17 07:47:23 2016 (r300021) @@ -315,9 +315,10 @@ struct named_object { char *name; /* object name */ uint16_t etlv; /* Export TLV id */ uint8_t subtype;/* object subtype within class */ - uint8_t spare[3]; + uint8_t set; /* set object belongs to */ uint16_t kidx; /* object kernel index */ - uint32_t set; /* set object belongs to */ + uint16_t spare; + uint32_t ocnt; /* object counter for internal use */ uint32_t refcnt; /* number of references */ }; TAILQ_HEAD(namedobjects_head, named_object); @@ -571,6 +572,21 @@ typedef int (ipfw_obj_create_cb)(struct */ typedef void (ipfw_obj_destroy_cb)(struct ip_fw_chain *ch, struct named_object *no); +/* + * Sets handler callback. Handles moving and swaping set of named object. + * SWAP_ALL moves all named objects from set `set' to `new_set' and vise versa; + * TEST_ALL checks that there aren't any named object with conflicting names; + * MOVE_ALL moves all named objects from set `set' to `new_set'; + * COUNT_ONE used to count number of references used by object with kidx `set'; + * TEST_ONE checks that named object with kidx `set' can be moved to `new_set`; + * MOVE_ONE moves named object with kidx `set' to set `new_set'. + */ +enum ipfw_sets_cmd { + SWAP_ALL = 0, TEST_ALL, MOVE_ALL, COUNT_ONE, TEST_ONE, MOVE_ONE +}; +typedef int (ipfw_obj_sets_cb)(struct ip_fw_chain *ch, + uint16_t set, uint8_t new_set, enum ipfw_sets_cmd cmd); + struct opcode_obj_rewrite { uint32_t opcode; /* Opcode to act upon */ @@ -581,6 +597,7 @@ struct opcode_obj_rewrite { ipfw_obj_fidx_cb *find_bykidx; /* Find named object by kidx */ ipfw_obj_create_cb *create_object; /* Create named object */ ipfw_obj_destroy_cb *destroy_object;/* Destroy named object */ + ipfw_obj_sets_cb *manage_sets; /* Swap or move sets */ }; #define IPFW_ADD_OBJ_REWRITER(f, c) do { \ @@ -675,8 +692,11 @@ int ipfw_objhash_same_name(struct namedo void ipfw_objhash_add(struct namedobj_instance *ni, struct named_object *no); void ipfw_objhash_del(struct namedobj_instance *ni, struct named_object *no); uint32_t ipfw_objhash_count(struct namedobj_instance *ni); +uint32_t ipfw_objhash_count_type(struct namedobj_instance *ni, uint16_t type); int ipfw_objhash_foreach(struct namedobj_instance *ni, objhash_cb_t *f, void *arg); +int ipfw_objhash_foreach_type(struct namedobj_instance *ni, objhash_cb_t *f, + void *arg, uint16_t type); int ipfw_objhash_free_idx(struct namedobj_instance *ni, uint16_t idx); int ipfw_objhash_alloc_idx(void *n, uint16_t *pidx); void ipfw_objhash_set_funcs(struct namedobj_instance *ni, @@ -698,6 +718,8 @@ int classify_opcode_kidx(ipfw_insn *cmd, void ipfw_init_srv(struct ip_fw_chain *ch); void ipfw_destroy_srv(struct ip_fw_chain *ch); int ipfw_check_object_name_generic(const char *name); +int ipfw_obj_manage_sets(struct namedobj_instance *ni, uint16_t type, + uint16_t set, uint8_t new_set, enum ipfw_sets_cmd cmd); /* In ip_fw_eaction.c */ typedef int (ipfw_eaction_t)(struct ip_fw_chain *ch, struct ip_fw_args *args, Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Tue May 17 07:15:25 2016 (r300020) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Tue May 17 07:47:23 2016 (r300021) @@ -851,6 +851,113 @@ ipfw_match_range(struct ip_fw *rule, ipf return (1); } +struct manage_sets_args { + uint16_t set; + uint8_t new_set; +}; + +static int +swap_sets_cb(struct namedobj_instance *ni, struct named_object *no, + void *arg) +{ + struct manage_sets_args *args; + + args = (struct manage_sets_args *)arg; + if (no->set == (uint8_t)args->set) + no->set = args->new_set; + else if (no->set == args->new_set) + no->set = (uint8_t)args->set; + return (0); +} + +static int +move_sets_cb(struct namedobj_instance *ni, struct named_object *no, + void *arg) +{ + struct manage_sets_args *args; + + args = (struct manage_sets_args *)arg; + if (no->set == (uint8_t)args->set) + no->set = args->new_set; + return (0); +} + +static int +test_sets_cb(struct namedobj_instance *ni, struct named_object *no, + void *arg) +{ + struct manage_sets_args *args; + + args = (struct manage_sets_args *)arg; + if (no->set != (uint8_t)args->set) + return (0); + if (ipfw_objhash_lookup_name_type(ni, args->new_set, + no->etlv, no->name) != NULL) + return (EEXIST); + return (0); +} + +/* + * Generic function to handler moving and swapping sets. + */ +int +ipfw_obj_manage_sets(struct namedobj_instance *ni, uint16_t type, + uint16_t set, uint8_t new_set, enum ipfw_sets_cmd cmd) +{ + struct manage_sets_args args; + struct named_object *no; + + args.set = set; + args.new_set = new_set; + switch (cmd) { + case SWAP_ALL: + return (ipfw_objhash_foreach_type(ni, swap_sets_cb, + &args, type)); + case TEST_ALL: + return (ipfw_objhash_foreach_type(ni, test_sets_cb, + &args, type)); + case MOVE_ALL: + return (ipfw_objhash_foreach_type(ni, move_sets_cb, + &args, type)); + case COUNT_ONE: + /* + * @set used to pass kidx. + * When @new_set is zero - reset object counter, + * otherwise increment it. + */ + no = ipfw_objhash_lookup_kidx(ni, set); + if (new_set != 0) + no->ocnt++; + else + no->ocnt = 0; + return (0); + case TEST_ONE: + /* @set used to pass kidx */ + no = ipfw_objhash_lookup_kidx(ni, set); + /* + * First check number of references: + * when it differs, this mean other rules are holding + * reference to given object, so it is not possible to + * change its set. Note that refcnt may account references + * to some going-to-be-added rules. Since we don't know + * their numbers (and even if they will be added) it is + * perfectly OK to return error here. + */ + if (no->ocnt != no->refcnt) + return (EBUSY); + if (ipfw_objhash_lookup_name_type(ni, new_set, type, + no->name) != NULL) + return (EEXIST); + return (0); + case MOVE_ONE: + /* @set used to pass kidx */ + no = ipfw_objhash_lookup_kidx(ni, set); + no->set = new_set; + return (0); + } + return (EINVAL); +} + /* * Delete rules matching range @rt. * Saves number of deleted rules in @ndel. @@ -935,7 +1042,89 @@ delete_range(struct ip_fw_chain *chain, return (0); } -/* +static int +move_objects(struct ip_fw_chain *ch, ipfw_range_tlv *rt) +{ + struct opcode_obj_rewrite *rw; + struct ip_fw *rule; + ipfw_insn *cmd; + int cmdlen, i, l, c; + uint16_t kidx; + + IPFW_UH_WLOCK_ASSERT(ch); + + /* Stage 1: count number of references by given rules */ + for (c = 0, i = 0; i < ch->n_rules - 1; i++) { + rule = ch->map[i]; + if (ipfw_match_range(rule, rt) == 0) + continue; + if (rule->set == rt->new_set) /* nothing to do */ + continue; + /* Search opcodes with named objects */ + for (l = rule->cmd_len, cmdlen = 0, cmd = rule->cmd; + l > 0; l -= cmdlen, cmd += cmdlen) { + cmdlen = F_LEN(cmd); + rw = find_op_rw(cmd, &kidx, NULL); + if (rw == NULL || rw->manage_sets == NULL) + continue; + /* + * When manage_sets() returns non-zero value to + * COUNT_ONE command, consider this as an object + * doesn't support sets (e.g. disabled with sysctl). + * So, skip checks for this object. + */ + if (rw->manage_sets(ch, kidx, 1, COUNT_ONE) != 0) + continue; + c++; + } + } + if (c == 0) /* No objects found */ + return (0); + /* Stage 2: verify "ownership" */ + for (c = 0, i = 0; (i < ch->n_rules - 1) && c == 0; i++) { + rule = ch->map[i]; + if (ipfw_match_range(rule, rt) == 0) + continue; + if (rule->set == rt->new_set) /* nothing to do */ + continue; + /* Search opcodes with named objects */ + for (l = rule->cmd_len, cmdlen = 0, cmd = rule->cmd; + l > 0 && c == 0; l -= cmdlen, cmd += cmdlen) { + cmdlen = F_LEN(cmd); + rw = find_op_rw(cmd, &kidx, NULL); + if (rw == NULL || rw->manage_sets == NULL) + continue; + /* Test for ownership and conflicting names */ + c = rw->manage_sets(ch, kidx, + (uint8_t)rt->new_set, TEST_ONE); + } + } + /* Stage 3: change set and cleanup */ + for (i = 0; i < ch->n_rules - 1; i++) { + rule = ch->map[i]; + if (ipfw_match_range(rule, rt) == 0) + continue; + if (rule->set == rt->new_set) /* nothing to do */ + continue; + /* Search opcodes with named objects */ + for (l = rule->cmd_len, cmdlen = 0, cmd = rule->cmd; + l > 0; l -= cmdlen, cmd += cmdlen) { + cmdlen = F_LEN(cmd); + rw = find_op_rw(cmd, &kidx, NULL); + if (rw == NULL || rw->manage_sets == NULL) + continue; + /* cleanup object counter */ + rw->manage_sets(ch, kidx, + 0 /* reset counter */, COUNT_ONE); + if (c != 0) + continue; + /* change set */ + rw->manage_sets(ch, kidx, + (uint8_t)rt->new_set, MOVE_ONE); + } + } + return (c); +}/* * Changes set of given rule rannge @rt * with each other. * @@ -956,11 +1145,9 @@ move_range(struct ip_fw_chain *chain, ip * by given rule subset only. Otherwise, we can't move * them to new set and have to return error. */ - if (V_fw_tables_sets != 0) { - if (ipfw_move_tables_sets(chain, rt, rt->new_set) != 0) { - IPFW_UH_WUNLOCK(chain); - return (EBUSY); - } + if ((i = move_objects(chain, rt)) != 0) { + IPFW_UH_WUNLOCK(chain); + return (i); } /* XXX: We have to do swap holding WLOCK */ @@ -1156,24 +1343,48 @@ enable_sets(struct ip_fw_chain *chain, i IPFW_WUNLOCK(chain); } -static void +static int swap_sets(struct ip_fw_chain *chain, ipfw_range_tlv *rt, int mv) { + struct opcode_obj_rewrite *rw; struct ip_fw *rule; int i; IPFW_UH_WLOCK_ASSERT(chain); + if (rt->set == rt->new_set) /* nothing to do */ + return (0); + + if (mv != 0) { + /* + * Berfore moving the rules we need to check that + * there aren't any conflicting named objects. + */ + for (rw = ctl3_rewriters; + rw < ctl3_rewriters + ctl3_rsize; rw++) { + if (rw->manage_sets == NULL) + continue; + i = rw->manage_sets(chain, (uint8_t)rt->set, + (uint8_t)rt->new_set, TEST_ALL); + if (i != 0) + return (EEXIST); + } + } /* Swap or move two sets */ for (i = 0; i < chain->n_rules - 1; i++) { rule = chain->map[i]; - if (rule->set == rt->set) - rule->set = rt->new_set; - else if (rule->set == rt->new_set && mv == 0) - rule->set = rt->set; + if (rule->set == (uint8_t)rt->set) + rule->set = (uint8_t)rt->new_set; + else if (rule->set == (uint8_t)rt->new_set && mv == 0) + rule->set = (uint8_t)rt->set; + } + for (rw = ctl3_rewriters; rw < ctl3_rewriters + ctl3_rsize; rw++) { + if (rw->manage_sets == NULL) + continue; + rw->manage_sets(chain, (uint8_t)rt->set, + (uint8_t)rt->new_set, mv != 0 ? MOVE_ALL: SWAP_ALL); } - if (V_fw_tables_sets != 0) - ipfw_swap_tables_sets(chain, rt->set, rt->new_set, mv); + return (0); } /* @@ -1188,6 +1399,7 @@ manage_sets(struct ip_fw_chain *chain, i struct sockopt_data *sd) { ipfw_range_header *rh; + int ret; if (sd->valsize != sizeof(*rh)) return (EINVAL); @@ -1196,12 +1408,17 @@ manage_sets(struct ip_fw_chain *chain, i if (rh->range.head.length != sizeof(ipfw_range_tlv)) return (1); + if (rh->range.set >= IPFW_MAX_SETS || + rh->range.new_set >= IPFW_MAX_SETS) + return (EINVAL); + ret = 0; IPFW_UH_WLOCK(chain); switch (op3->opcode) { case IP_FW_SET_SWAP: case IP_FW_SET_MOVE: - swap_sets(chain, &rh->range, op3->opcode == IP_FW_SET_MOVE); + ret = swap_sets(chain, &rh->range, + op3->opcode == IP_FW_SET_MOVE); break; case IP_FW_SET_ENABLE: enable_sets(chain, &rh->range); @@ -1209,7 +1426,7 @@ manage_sets(struct ip_fw_chain *chain, i } IPFW_UH_WUNLOCK(chain); - return (0); + return (ret); } /** @@ -1280,14 +1497,14 @@ del_entry(struct ip_fw_chain *chain, uin break; case 3: /* move rules from set "rulenum" to set "new_set" */ IPFW_UH_WLOCK(chain); - swap_sets(chain, &rt, 1); + error = swap_sets(chain, &rt, 1); IPFW_UH_WUNLOCK(chain); - return (0); + return (error); case 4: /* swap sets "rulenum" and "new_set" */ IPFW_UH_WLOCK(chain); - swap_sets(chain, &rt, 0); + error = swap_sets(chain, &rt, 0); IPFW_UH_WUNLOCK(chain); - return (0); + return (error); default: return (ENOTSUP); } @@ -2526,11 +2743,8 @@ rewrite_rule_uidx(struct ip_fw_chain *ch type = 0; memset(&ti, 0, sizeof(ti)); - /* - * Use default set for looking up tables (old way) or - * use set rule is assigned to (new way). - */ - ti.set = (V_fw_tables_sets != 0) ? ci->krule->set : 0; + /* Use set rule is assigned to. */ + ti.set = ci->krule->set; if (ci->ctlv != NULL) { ti.tlvs = (void *)(ci->ctlv + 1); ti.tlen = ci->ctlv->head.length - sizeof(ipfw_obj_ctlv); @@ -4248,6 +4462,23 @@ ipfw_objhash_count(struct namedobj_insta return (ni->count); } +uint32_t +ipfw_objhash_count_type(struct namedobj_instance *ni, uint16_t type) +{ + struct named_object *no; + uint32_t count; + int i; + + count = 0; + for (i = 0; i < ni->nn_size; i++) { + TAILQ_FOREACH(no, &ni->names[i], nn_next) { + if (no->etlv == type) + count++; + } + } + return (count); +} + /* * Runs @func for each found named object. * It is safe to delete objects from callback @@ -4269,6 +4500,29 @@ ipfw_objhash_foreach(struct namedobj_ins } /* + * Runs @f for each found named object with type @type. + * It is safe to delete objects from callback + */ +int +ipfw_objhash_foreach_type(struct namedobj_instance *ni, objhash_cb_t *f, + void *arg, uint16_t type) +{ + struct named_object *no, *no_tmp; + int i, ret; + + for (i = 0; i < ni->nn_size; i++) { + TAILQ_FOREACH_SAFE(no, &ni->names[i], nn_next, no_tmp) { + if (no->etlv != type) + continue; + ret = f(ni, no, arg); + if (ret != 0) + return (ret); + } + } + return (0); +} + +/* * Removes index from given set. * Returns 0 on success. */ Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Tue May 17 07:15:25 2016 (r300020) +++ head/sys/netpfil/ipfw/ip_fw_table.c Tue May 17 07:47:23 2016 (r300021) @@ -1602,64 +1602,6 @@ ipfw_resize_tables(struct ip_fw_chain *c } /* - * Switch between "set 0" and "rule's set" table binding, - * Check all ruleset bindings and permits changing - * IFF each binding has both rule AND table in default set (set 0). - * - * Returns 0 on success. - */ -int -ipfw_switch_tables_namespace(struct ip_fw_chain *ch, unsigned int sets) -{ - struct namedobj_instance *ni; - struct named_object *no; - struct ip_fw *rule; - ipfw_insn *cmd; - int cmdlen, i, l; - uint16_t kidx; - - IPFW_UH_WLOCK(ch); - - if (V_fw_tables_sets == sets) { - IPFW_UH_WUNLOCK(ch); - return (0); - } - - ni = CHAIN_TO_NI(ch); - - /* - * Scan all rules and examine tables opcodes. - */ - for (i = 0; i < ch->n_rules; i++) { - rule = ch->map[i]; - - l = rule->cmd_len; - cmd = rule->cmd; - cmdlen = 0; - for ( ; l > 0 ; l -= cmdlen, cmd += cmdlen) { - cmdlen = F_LEN(cmd); - - if (classify_opcode_kidx(cmd, &kidx) != 0) - continue; - - no = ipfw_objhash_lookup_kidx(ni, kidx); - - /* Check if both table object and rule has the set 0 */ - if (no->set != 0 || rule->set != 0) { - IPFW_UH_WUNLOCK(ch); - return (EBUSY); - } - - } - } - V_fw_tables_sets = sets; - - IPFW_UH_WUNLOCK(ch); - - return (0); -} - -/* * Lookup an IP @addr in table @tbl. * Stores found value in @val. * @@ -2875,39 +2817,190 @@ table_findbykidx(struct ip_fw_chain *ch, return (&tc->no); } +static int +table_manage_sets(struct ip_fw_chain *ch, uint16_t set, uint8_t new_set, + enum ipfw_sets_cmd cmd) +{ + + switch (cmd) { + case SWAP_ALL: + case TEST_ALL: + /* + * Return success for TEST_ALL, since nothing prevents + * move rules from one set to another. All tables are + * accessible from all sets when per-set tables sysctl + * is disabled. + */ + case MOVE_ALL: + case TEST_ONE: + case MOVE_ONE: + /* + * NOTE: we need to use ipfw_objhash_del/ipfw_objhash_add + * if set number will be used in hash function. Currently + * we can just use generic handler that replaces set value. + */ + if (V_fw_tables_sets == 0) + return (0); + break; + case COUNT_ONE: + /* + * Return EOPNOTSUPP for COUNT_ONE when per-set sysctl is + * disabled. This allow skip table's opcodes from additional + * checks when specific rules moved to another set. + */ + if (V_fw_tables_sets == 0) + return (EOPNOTSUPP); + } + /* Use generic sets handler when per-set sysctl is enabled. */ + return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME, + set, new_set, cmd)); +} + static struct opcode_obj_rewrite opcodes[] = { { - O_IP_SRC_LOOKUP, IPFW_TLV_TBL_NAME, - classify_srcdst, update_arg1, - table_findbyname, table_findbykidx, create_table_compat + .opcode = O_IP_SRC_LOOKUP, + .etlv = IPFW_TLV_TBL_NAME, + .classifier = classify_srcdst, + .update = update_arg1, + .find_byname = table_findbyname, + .find_bykidx = table_findbykidx, + .create_object = create_table_compat, + .manage_sets = table_manage_sets, }, { - O_IP_DST_LOOKUP, IPFW_TLV_TBL_NAME, - classify_srcdst, update_arg1, - table_findbyname, table_findbykidx, create_table_compat + .opcode = O_IP_DST_LOOKUP, + .etlv = IPFW_TLV_TBL_NAME, + .classifier = classify_srcdst, + .update = update_arg1, + .find_byname = table_findbyname, + .find_bykidx = table_findbykidx, + .create_object = create_table_compat, + .manage_sets = table_manage_sets, }, { - O_IP_FLOW_LOOKUP, IPFW_TLV_TBL_NAME, - classify_flow, update_arg1, - table_findbyname, table_findbykidx, create_table_compat + .opcode = O_IP_FLOW_LOOKUP, + .etlv = IPFW_TLV_TBL_NAME, + .classifier = classify_flow, + .update = update_arg1, + .find_byname = table_findbyname, + .find_bykidx = table_findbykidx, + .create_object = create_table_compat, + .manage_sets = table_manage_sets, }, { - O_XMIT, IPFW_TLV_TBL_NAME, - classify_via, update_via, - table_findbyname, table_findbykidx, create_table_compat + .opcode = O_XMIT, + .etlv = IPFW_TLV_TBL_NAME, + .classifier = classify_via, + .update = update_via, + .find_byname = table_findbyname, + .find_bykidx = table_findbykidx, + .create_object = create_table_compat, + .manage_sets = table_manage_sets, }, { - O_RECV, IPFW_TLV_TBL_NAME, - classify_via, update_via, - table_findbyname, table_findbykidx, create_table_compat + .opcode = O_RECV, + .etlv = IPFW_TLV_TBL_NAME, + .classifier = classify_via, + .update = update_via, + .find_byname = table_findbyname, + .find_bykidx = table_findbykidx, + .create_object = create_table_compat, + .manage_sets = table_manage_sets, }, { - O_VIA, IPFW_TLV_TBL_NAME, - classify_via, update_via, - table_findbyname, table_findbykidx, create_table_compat + .opcode = O_VIA, + .etlv = IPFW_TLV_TBL_NAME, + .classifier = classify_via, + .update = update_via, + .find_byname = table_findbyname, + .find_bykidx = table_findbykidx, + .create_object = create_table_compat, + .manage_sets = table_manage_sets, }, }; +static int +test_sets_cb(struct namedobj_instance *ni __unused, struct named_object *no, + void *arg __unused) +{ + + /* Check that there aren't any tables in not default set */ + if (no->set != 0) + return (EBUSY); + return (0); +} + +/* + * Switch between "set 0" and "rule's set" table binding, + * Check all ruleset bindings and permits changing + * IFF each binding has both rule AND table in default set (set 0). + * + * Returns 0 on success. + */ +int +ipfw_switch_tables_namespace(struct ip_fw_chain *ch, unsigned int sets) +{ + struct opcode_obj_rewrite *rw; + struct namedobj_instance *ni; + struct named_object *no; + struct ip_fw *rule; + ipfw_insn *cmd; + int cmdlen, i, l; + uint16_t kidx; + uint8_t subtype; + + IPFW_UH_WLOCK(ch); + + if (V_fw_tables_sets == sets) { + IPFW_UH_WUNLOCK(ch); + return (0); + } + ni = CHAIN_TO_NI(ch); + if (sets == 0) { + /* + * Prevent disabling sets support if we have some tables + * in not default sets. + */ + if (ipfw_objhash_foreach_type(ni, test_sets_cb, + NULL, IPFW_TLV_TBL_NAME) != 0) { + IPFW_UH_WUNLOCK(ch); + return (EBUSY); + } + } + /* + * Scan all rules and examine tables opcodes. + */ + for (i = 0; i < ch->n_rules; i++) { + rule = ch->map[i]; + + l = rule->cmd_len; + cmd = rule->cmd; + cmdlen = 0; + for ( ; l > 0 ; l -= cmdlen, cmd += cmdlen) { + cmdlen = F_LEN(cmd); + /* Check only tables opcodes */ + for (kidx = 0, rw = opcodes; + rw < opcodes + nitems(opcodes); rw++) { + if (rw->opcode != cmd->opcode) + continue; + if (rw->classifier(cmd, &kidx, &subtype) == 0) + break; + } + if (kidx == 0) + continue; + no = ipfw_objhash_lookup_kidx(ni, kidx); + /* Check if both table object and rule has the set 0 */ + if (no->set != 0 || rule->set != 0) { + IPFW_UH_WUNLOCK(ch); + return (EBUSY); + } + + } + } + V_fw_tables_sets = sets; + IPFW_UH_WUNLOCK(ch); + return (0); +} /* * Checks table name for validity. @@ -2954,7 +3047,7 @@ find_table_err(struct namedobj_instance * This is needed due to different sets behavior * controlled by V_fw_tables_sets. */ - set = ti->set; + set = (V_fw_tables_sets != 0) ? ti->set : 0; } else { snprintf(bname, sizeof(bname), "%d", ti->uidx); name = bname; @@ -3112,196 +3205,6 @@ unlink_table(struct ip_fw_chain *ch, str tc->ta->change_ti(tc->astate, NULL); } -struct swap_table_args { - int set; - int new_set; - int mv; -}; - -/* - * Change set for each matching table. - * - * Ensure we dispatch each table once by setting/checking ochange - * fields. - */ -static int -swap_table_set(struct namedobj_instance *ni, struct named_object *no, - void *arg) -{ - struct table_config *tc; - struct swap_table_args *sta; - - tc = (struct table_config *)no; - sta = (struct swap_table_args *)arg; - - if (no->set != sta->set && (no->set != sta->new_set || sta->mv != 0)) - return (0); - - if (tc->ochanged != 0) - return (0); - - tc->ochanged = 1; - ipfw_objhash_del(ni, no); - if (no->set == sta->set) - no->set = sta->new_set; - else - no->set = sta->set; - ipfw_objhash_add(ni, no); - return (0); -} - -/* - * Cleans up ochange field for all tables. - */ -static int -clean_table_set_data(struct namedobj_instance *ni, struct named_object *no, - void *arg) -{ - struct table_config *tc; - struct swap_table_args *sta; - - tc = (struct table_config *)no; - sta = (struct swap_table_args *)arg; - - tc->ochanged = 0; - return (0); -} - -/* - * Swaps tables within two sets. - */ -void -ipfw_swap_tables_sets(struct ip_fw_chain *ch, uint32_t set, - uint32_t new_set, int mv) -{ - struct swap_table_args sta; - - IPFW_UH_WLOCK_ASSERT(ch); - - sta.set = set; - sta.new_set = new_set; - sta.mv = mv; - - ipfw_objhash_foreach(CHAIN_TO_NI(ch), swap_table_set, &sta); - ipfw_objhash_foreach(CHAIN_TO_NI(ch), clean_table_set_data, &sta); -} - -/* - * Move all tables which are reference by rules in @rr to set @new_set. - * Makes sure that all relevant tables are referenced ONLLY by given rules. - * - * Returns 0 on success, - */ -int -ipfw_move_tables_sets(struct ip_fw_chain *ch, ipfw_range_tlv *rt, - uint32_t new_set) -{ - struct ip_fw *rule; - struct table_config *tc; - struct named_object *no; - struct namedobj_instance *ni; - int bad, i, l, cmdlen; - uint16_t kidx; - ipfw_insn *cmd; - - IPFW_UH_WLOCK_ASSERT(ch); - - ni = CHAIN_TO_NI(ch); - - /* Stage 1: count number of references by given rules */ - for (i = 0; i < ch->n_rules - 1; i++) { - rule = ch->map[i]; - if (ipfw_match_range(rule, rt) == 0) - continue; - - l = rule->cmd_len; - cmd = rule->cmd; - cmdlen = 0; - for ( ; l > 0 ; l -= cmdlen, cmd += cmdlen) { - cmdlen = F_LEN(cmd); - if (classify_opcode_kidx(cmd, &kidx) != 0) - continue; - no = ipfw_objhash_lookup_kidx(ni, kidx); - KASSERT(no != NULL, - ("objhash lookup failed on index %d", kidx)); - tc = (struct table_config *)no; - tc->ocount++; - } - - } - - /* Stage 2: verify "ownership" */ - bad = 0; - for (i = 0; i < ch->n_rules - 1; i++) { - rule = ch->map[i]; - if (ipfw_match_range(rule, rt) == 0) - continue; - - l = rule->cmd_len; - cmd = rule->cmd; - cmdlen = 0; - for ( ; l > 0 ; l -= cmdlen, cmd += cmdlen) { - cmdlen = F_LEN(cmd); - if (classify_opcode_kidx(cmd, &kidx) != 0) - continue; - no = ipfw_objhash_lookup_kidx(ni, kidx); - KASSERT(no != NULL, - ("objhash lookup failed on index %d", kidx)); - tc = (struct table_config *)no; - if (tc->no.refcnt != tc->ocount) { - - /* - * Number of references differ: - * Other rule(s) are holding reference to given - * table, so it is not possible to change its set. - * - * Note that refcnt may account - * references to some going-to-be-added rules. - * Since we don't know their numbers (and event - * if they will be added) it is perfectly OK - * to return error here. - */ - bad = 1; - break; - } - } - - if (bad != 0) - break; - } - - /* Stage 3: change set or cleanup */ - for (i = 0; i < ch->n_rules - 1; i++) { - rule = ch->map[i]; - if (ipfw_match_range(rule, rt) == 0) - continue; - - l = rule->cmd_len; - cmd = rule->cmd; - cmdlen = 0; - for ( ; l > 0 ; l -= cmdlen, cmd += cmdlen) { - cmdlen = F_LEN(cmd); - if (classify_opcode_kidx(cmd, &kidx) != 0) - continue; - no = ipfw_objhash_lookup_kidx(ni, kidx); - KASSERT(no != NULL, - ("objhash lookup failed on index %d", kidx)); - tc = (struct table_config *)no; - - tc->ocount = 0; - if (bad != 0) - continue; - - /* Actually change set. */ - ipfw_objhash_del(ni, no); - no->set = new_set; - ipfw_objhash_add(ni, no); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 17 07:54:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 506A3B3EA63; Tue, 17 May 2016 07:54:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27D44127F; Tue, 17 May 2016 07:54:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H7srJp043411; Tue, 17 May 2016 07:54:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7srSd043410; Tue, 17 May 2016 07:54:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605170754.u4H7srSd043410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 May 2016 07:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300022 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:54:54 -0000 Author: trasz Date: Tue May 17 07:54:53 2016 New Revision: 300022 URL: https://svnweb.freebsd.org/changeset/base/300022 Log: Add initial support for negotiating iSER parameters to iscsid(8). Some rework might be needed to support asymetrical limits, but this should be ok for now. Obtained from: Mellanox Technologies (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/login.c Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Tue May 17 07:47:23 2016 (r300021) +++ head/usr.sbin/iscsid/login.c Tue May 17 07:54:53 2016 (r300022) @@ -422,8 +422,38 @@ login_negotiate_key(struct connection *c /* Ignore */ } else if (strcmp(name, "IFMarker") == 0) { /* Ignore */ + } else if (strcmp(name, "RDMAExtensions") == 0) { + if (conn->conn_conf.isc_iser == 1 && + strcmp(value, "Yes") != 0) { + log_errx(1, "received unsupported RDMAExtensions"); + } + } else if (strcmp(name, "InitiatorRecvDataSegmentLength") == 0) { + tmp = strtoul(value, NULL, 10); + if (tmp <= 0) + log_errx(1, "received invalid " + "InitiatorRecvDataSegmentLength"); + if ((size_t)tmp > conn->conn_limits.isl_max_data_segment_length) { + log_debugx("capping InitiatorRecvDataSegmentLength " + "from %d to %zd", tmp, + conn->conn_limits.isl_max_data_segment_length); + tmp = conn->conn_limits.isl_max_data_segment_length; + } + conn->conn_max_data_segment_length = tmp; } else if (strcmp(name, "TargetPortalGroupTag") == 0) { /* Ignore */ + } else if (strcmp(name, "TargetRecvDataSegmentLength") == 0) { + tmp = strtoul(value, NULL, 10); + if (tmp <= 0) { + log_errx(1, + "received invalid TargetRecvDataSegmentLength"); + } + if ((size_t)tmp > conn->conn_limits.isl_max_data_segment_length) { + log_debugx("capping TargetRecvDataSegmentLength " + "from %d to %zd", tmp, + conn->conn_limits.isl_max_data_segment_length); + tmp = conn->conn_limits.isl_max_data_segment_length; + } + conn->conn_max_data_segment_length = tmp; } else { log_debugx("unknown key \"%s\"; ignoring", name); } @@ -465,13 +495,23 @@ login_negotiate(struct connection *conn) conn->conn_limits.isl_max_data_segment_length); keys_add(request_keys, "InitialR2T", "Yes"); keys_add(request_keys, "MaxOutstandingR2T", "1"); + if (conn->conn_conf.isc_iser == 1) { + keys_add_int(request_keys, "InitiatorRecvDataSegmentLength", + conn->conn_limits.isl_max_data_segment_length); + keys_add_int(request_keys, "TargetRecvDataSegmentLength", + conn->conn_limits.isl_max_data_segment_length); + keys_add(request_keys, "RDMAExtensions", "Yes"); + } else { + keys_add_int(request_keys, "MaxRecvDataSegmentLength", + conn->conn_limits.isl_max_data_segment_length); + } } else { keys_add(request_keys, "HeaderDigest", "None"); keys_add(request_keys, "DataDigest", "None"); + keys_add_int(request_keys, "MaxRecvDataSegmentLength", + conn->conn_limits.isl_max_data_segment_length); } - keys_add_int(request_keys, "MaxRecvDataSegmentLength", - conn->conn_limits.isl_max_data_segment_length); keys_add(request_keys, "DefaultTime2Wait", "0"); keys_add(request_keys, "DefaultTime2Retain", "0"); keys_add(request_keys, "ErrorRecoveryLevel", "0"); From owner-svn-src-all@freebsd.org Tue May 17 07:55:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B49B3EB02; Tue, 17 May 2016 07:55:50 +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 A57E01464; Tue, 17 May 2016 07:55:50 +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 u4H7tnep043506; Tue, 17 May 2016 07:55:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7tn7K043505; Tue, 17 May 2016 07:55:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605170755.u4H7tn7K043505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 07:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300023 - stable/10/sys/amd64/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:55:50 -0000 Author: kib Date: Tue May 17 07:55:49 2016 New Revision: 300023 URL: https://svnweb.freebsd.org/changeset/base/300023 Log: MFC r299350: Add locking annotations to amd64 struct md_page members. Modified: stable/10/sys/amd64/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/pmap.h ============================================================================== --- stable/10/sys/amd64/include/pmap.h Tue May 17 07:54:53 2016 (r300022) +++ stable/10/sys/amd64/include/pmap.h Tue May 17 07:55:49 2016 (r300023) @@ -280,9 +280,13 @@ extern pt_entry_t pg_nx; struct pv_entry; struct pv_chunk; +/* + * Locks + * (p) PV list lock + */ struct md_page { - TAILQ_HEAD(,pv_entry) pv_list; - int pv_gen; + TAILQ_HEAD(, pv_entry) pv_list; /* (p) */ + int pv_gen; /* (p) */ int pat_mode; }; From owner-svn-src-all@freebsd.org Tue May 17 07:56:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C5EB3EB53; Tue, 17 May 2016 07:56:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 529C516EB; Tue, 17 May 2016 07:56:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H7u5f0043564; Tue, 17 May 2016 07:56:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7u5QT043563; Tue, 17 May 2016 07:56:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170756.u4H7u5QT043563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 07:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300024 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:56:06 -0000 Author: avg Date: Tue May 17 07:56:05 2016 New Revision: 300024 URL: https://svnweb.freebsd.org/changeset/base/300024 Log: zfs_ioc_rename: fix a reversed condition FreeBSD zfs_ioc_rename() has an option, not present upstream, that allows to rename snapshots without unmounting them first. I am not sure what is a rationale for that option, but its actual behavior was the opposite of the intended behavior. That is, by default the snapshots were not unmounted. The option was introduced as part of a large update from upstream in r248498. One of the consequences was a havoc under .zfs/snapshot after the rename. The snapshots got new names but were mounted on top of directories with old names, so readdir would list the new names, but lookup would still find the old mounts. PR: 209093 Reported by: Frédéric VANNIÈRE MFC after: 5 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue May 17 07:55:49 2016 (r300023) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue May 17 07:56:05 2016 (r300024) @@ -3791,7 +3791,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) if (strncmp(zc->zc_name, zc->zc_value, at - zc->zc_name + 1)) return (SET_ERROR(EXDEV)); *at = '\0'; - if (zc->zc_objset_type == DMU_OST_ZFS && allow_mounted) { + if (zc->zc_objset_type == DMU_OST_ZFS && !allow_mounted) { error = dmu_objset_find(zc->zc_name, recursive_unmount, at + 1, recursive ? DS_FIND_CHILDREN : 0); From owner-svn-src-all@freebsd.org Tue May 17 07:56:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A78B4B3EC74; Tue, 17 May 2016 07:56:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C16719CF; Tue, 17 May 2016 07:56:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H7ujf4043640; Tue, 17 May 2016 07:56:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7ujRN043638; Tue, 17 May 2016 07:56:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605170756.u4H7ujRN043638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 May 2016 07:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300025 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 07:56:46 -0000 Author: trasz Date: Tue May 17 07:56:45 2016 New Revision: 300025 URL: https://svnweb.freebsd.org/changeset/base/300025 Log: Make ICL_KERNEL_PROXY compilable. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/icl_proxy.c Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Tue May 17 07:56:05 2016 (r300024) +++ head/sys/dev/iscsi/icl.h Tue May 17 07:56:45 2016 (r300025) @@ -138,22 +138,6 @@ int icl_unregister(const char *offload) struct sockaddr; struct icl_listen; -struct icl_listen_sock { - TAILQ_ENTRY(icl_listen_sock) ils_next; - struct icl_listen *ils_listen; - struct socket *ils_socket; - bool ils_running; - bool ils_disconnecting; - int ils_id; -}; - -struct icl_listen { - TAILQ_HEAD(, icl_listen_sock) il_sockets; - struct sx il_lock; - void (*il_accept)(struct socket *, - struct sockaddr *, int); -}; - /* * Initiator part. */ @@ -177,5 +161,4 @@ int icl_listen_remove(struct icl_liste int icl_conn_handoff_sock(struct icl_conn *ic, struct socket *so); #endif /* ICL_KERNEL_PROXY */ - #endif /* !ICL_H */ Modified: head/sys/dev/iscsi/icl_proxy.c ============================================================================== --- head/sys/dev/iscsi/icl_proxy.c Tue May 17 07:56:05 2016 (r300024) +++ head/sys/dev/iscsi/icl_proxy.c Tue May 17 07:56:45 2016 (r300025) @@ -84,33 +84,27 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include -static int debug = 1; - -#define ICL_DEBUG(X, ...) \ - if (debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ - } while (0) - -#define ICL_WARN(X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ - } while (0) +struct icl_listen_sock { + TAILQ_ENTRY(icl_listen_sock) ils_next; + struct icl_listen *ils_listen; + struct socket *ils_socket; + bool ils_running; + bool ils_disconnecting; + int ils_id; +}; + +struct icl_listen { + TAILQ_HEAD(, icl_listen_sock) il_sockets; + struct sx il_lock; + void (*il_accept)(struct socket *, + struct sockaddr *, int); +}; static MALLOC_DEFINE(M_ICL_PROXY, "ICL_PROXY", "iSCSI common layer proxy"); -#ifdef ICL_RDMA -static int icl_conn_connect_rdma(struct icl_conn *ic, int domain, int socktype, - int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa); -static int icl_listen_add_rdma(struct icl_listen *il, int domain, int socktype, int protocol, - struct sockaddr *sa); -#endif /* ICL_RDMA */ - static int icl_conn_connect_tcp(struct icl_conn *ic, int domain, int socktype, int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa) @@ -172,12 +166,8 @@ icl_conn_connect(struct icl_conn *ic, bo { if (rdma) { -#ifdef ICL_RDMA - return (icl_conn_connect_rdma(ic, domain, socktype, protocol, from_sa, to_sa)); -#else ICL_DEBUG("RDMA not supported"); return (EOPNOTSUPP); -#endif } return (icl_conn_connect_tcp(ic, domain, socktype, protocol, from_sa, to_sa)); @@ -375,13 +365,8 @@ icl_listen_add(struct icl_listen *il, bo { if (rdma) { -#ifndef ICL_RDMA ICL_DEBUG("RDMA not supported"); return (EOPNOTSUPP); -#else - return (icl_listen_add_rdma(il, domain, socktype, protocol, - sa, portal_id)); -#endif } From owner-svn-src-all@freebsd.org Tue May 17 08:18:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 460CFB3E676; Tue, 17 May 2016 08:18:21 +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 1FB3B17C0; Tue, 17 May 2016 08:18:21 +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 u4H8IKPW049895; Tue, 17 May 2016 08:18:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8IJmM049891; Tue, 17 May 2016 08:18:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170818.u4H8IJmM049891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300026 - in stable/9: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/sys/fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:18:21 -0000 Author: avg Date: Tue May 17 08:18:19 2016 New Revision: 300026 URL: https://svnweb.freebsd.org/changeset/base/300026 Log: MFC r298472: MFV r298471: 6052 decouple lzc_create() from the implementation details Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs_core/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue May 17 07:56:45 2016 (r300025) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue May 17 08:18:19 2016 (r300026) @@ -3086,7 +3086,7 @@ zfs_create(libzfs_handle_t *hdl, const c uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); char errbuf[1024]; uint64_t zoned; - dmu_objset_type_t ost; + enum lzc_dataset_type ost; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot create '%s'"), path); @@ -3113,9 +3113,9 @@ zfs_create(libzfs_handle_t *hdl, const c } if (type == ZFS_TYPE_VOLUME) - ost = DMU_OST_ZVOL; + ost = LZC_DATSET_TYPE_ZVOL; else - ost = DMU_OST_ZFS; + ost = LZC_DATSET_TYPE_ZFS; if (props && (props = zfs_valid_proplist(hdl, type, props, zoned, NULL, errbuf)) == 0) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue May 17 07:56:45 2016 (r300025) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue May 17 08:18:19 2016 (r300026) @@ -217,11 +217,11 @@ out: } int -lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props) +lzc_create(const char *fsname, enum lzc_dataset_type type, nvlist_t *props) { int error; nvlist_t *args = fnvlist_alloc(); - fnvlist_add_int32(args, "type", type); + fnvlist_add_int32(args, "type", (dmu_objset_type_t)type); if (props != NULL) fnvlist_add_nvlist(args, "props", props); error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue May 17 07:56:45 2016 (r300025) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue May 17 08:18:19 2016 (r300026) @@ -30,7 +30,6 @@ #include #include #include -#include #ifdef __cplusplus extern "C" { @@ -39,8 +38,16 @@ extern "C" { int libzfs_core_init(void); void libzfs_core_fini(void); +/* + * NB: this type should be kept binary compatible with dmu_objset_type_t. + */ +enum lzc_dataset_type { + LZC_DATSET_TYPE_ZFS = 2, + LZC_DATSET_TYPE_ZVOL +}; + int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); -int lzc_create(const char *, dmu_objset_type_t, nvlist_t *); +int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *); int lzc_clone(const char *, const char *, nvlist_t *); int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **); int lzc_bookmark(nvlist_t *, nvlist_t **); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 17 07:56:45 2016 (r300025) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 17 08:18:19 2016 (r300026) @@ -56,6 +56,10 @@ typedef enum { ZFS_TYPE_BOOKMARK = (1 << 4) } zfs_type_t; +/* + * NB: lzc_dataset_type should be updated whenever a new objset type is added, + * if it represents a real type of a dataset that can be created from userland. + */ typedef enum dmu_objset_type { DMU_OST_NONE, DMU_OST_META, From owner-svn-src-all@freebsd.org Tue May 17 08:19:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA6FB3E776; Tue, 17 May 2016 08:19:21 +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 0F93219CD; Tue, 17 May 2016 08:19:20 +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 u4H8JK7H049978; Tue, 17 May 2016 08:19:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8JKSw049977; Tue, 17 May 2016 08:19:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605170819.u4H8JKSw049977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 08:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300027 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:19:21 -0000 Author: kib Date: Tue May 17 08:19:20 2016 New Revision: 300027 URL: https://svnweb.freebsd.org/changeset/base/300027 Log: Fix typo in the message. Submitted by: bde MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Tue May 17 08:18:19 2016 (r300026) +++ head/sys/ufs/ufs/ufs_lookup.c Tue May 17 08:19:20 2016 (r300027) @@ -1133,7 +1133,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_NORMAL | IO_SYNC, cr); if (error != 0) - vprint("ufs_direnter: failted to truncate", dvp); + vprint("ufs_direnter: failed to truncate", dvp); #ifdef UFS_DIRHASH if (error == 0 && dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); From owner-svn-src-all@freebsd.org Tue May 17 08:20:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ABF0B3E812; Tue, 17 May 2016 08:20:11 +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 55C2E1B78; Tue, 17 May 2016 08:20:11 +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 u4H8KA4Q050069; Tue, 17 May 2016 08:20:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8KAQ8050064; Tue, 17 May 2016 08:20:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170820.u4H8KAQ8050064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300028 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/sys/fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:20:11 -0000 Author: avg Date: Tue May 17 08:20:10 2016 New Revision: 300028 URL: https://svnweb.freebsd.org/changeset/base/300028 Log: MFC r298472: MFV r298471: 6052 decouple lzc_create() from the implementation details Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue May 17 08:19:20 2016 (r300027) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue May 17 08:20:10 2016 (r300028) @@ -3220,7 +3220,7 @@ zfs_create(libzfs_handle_t *hdl, const c uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); char errbuf[1024]; uint64_t zoned; - dmu_objset_type_t ost; + enum lzc_dataset_type ost; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot create '%s'"), path); @@ -3247,9 +3247,9 @@ zfs_create(libzfs_handle_t *hdl, const c } if (type == ZFS_TYPE_VOLUME) - ost = DMU_OST_ZVOL; + ost = LZC_DATSET_TYPE_ZVOL; else - ost = DMU_OST_ZFS; + ost = LZC_DATSET_TYPE_ZFS; /* open zpool handle for prop validation */ char pool_path[MAXNAMELEN]; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue May 17 08:19:20 2016 (r300027) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue May 17 08:20:10 2016 (r300028) @@ -218,11 +218,11 @@ out: } int -lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props) +lzc_create(const char *fsname, enum lzc_dataset_type type, nvlist_t *props) { int error; nvlist_t *args = fnvlist_alloc(); - fnvlist_add_int32(args, "type", type); + fnvlist_add_int32(args, "type", (dmu_objset_type_t)type); if (props != NULL) fnvlist_add_nvlist(args, "props", props); error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue May 17 08:19:20 2016 (r300027) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue May 17 08:20:10 2016 (r300028) @@ -30,7 +30,6 @@ #include #include #include -#include #ifdef __cplusplus extern "C" { @@ -39,8 +38,16 @@ extern "C" { int libzfs_core_init(void); void libzfs_core_fini(void); +/* + * NB: this type should be kept binary compatible with dmu_objset_type_t. + */ +enum lzc_dataset_type { + LZC_DATSET_TYPE_ZFS = 2, + LZC_DATSET_TYPE_ZVOL +}; + int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); -int lzc_create(const char *, dmu_objset_type_t, nvlist_t *); +int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *); int lzc_clone(const char *, const char *, nvlist_t *); int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **); int lzc_bookmark(nvlist_t *, nvlist_t **); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 17 08:19:20 2016 (r300027) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 17 08:20:10 2016 (r300028) @@ -57,6 +57,10 @@ typedef enum { ZFS_TYPE_BOOKMARK = (1 << 4) } zfs_type_t; +/* + * NB: lzc_dataset_type should be updated whenever a new objset type is added, + * if it represents a real type of a dataset that can be created from userland. + */ typedef enum dmu_objset_type { DMU_OST_NONE, DMU_OST_META, From owner-svn-src-all@freebsd.org Tue May 17 08:24:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 035BFB3EA29; Tue, 17 May 2016 08:24:08 +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 C7AC71047; Tue, 17 May 2016 08:24:07 +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 u4H8O6O1052850; Tue, 17 May 2016 08:24:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8O6WX052849; Tue, 17 May 2016 08:24:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170824.u4H8O6WX052849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300029 - stable/10/sys/cddl/dev/dtrace/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:24:08 -0000 Author: avg Date: Tue May 17 08:24:06 2016 New Revision: 300029 URL: https://svnweb.freebsd.org/changeset/base/300029 Log: MFC r298473,298787: add invpcid, fix sahf/lahf in dtrace disassembler Modified: stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:20:10 2016 (r300028) +++ stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:24:06 2016 (r300029) @@ -1182,7 +1182,7 @@ const instable_t dis_op0F38[256] = { /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, -/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),INVALID, INVALID, +/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),TNSy("invpcid", RM_66r),INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, @@ -1931,7 +1931,7 @@ const instable_t dis_distable[16][16] = /* [9,0] */ TNS("nop",NORM), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,4] */ TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,8] */ TNS("cXtX",CBW), TNS("cXtX",CWD), TNSx("lcall",SO), TNS("fwait",NORM), -/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNSx("sahf",NORM), TNSx("lahf",NORM), +/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNS("sahf",NORM), TNS("lahf",NORM), }, { /* [A,0] */ TNS("movb",OA), TS("mov",OA), TNS("movb",AO), TS("mov",AO), /* [A,4] */ TNSZ("movsb",SD,1), TS("movs",SD), TNSZ("cmpsb",SD,1), TS("cmps",SD), From owner-svn-src-all@freebsd.org Tue May 17 08:24:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 866C2B3EA93; Tue, 17 May 2016 08:24:28 +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 562781197; Tue, 17 May 2016 08:24:28 +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 u4H8ORtW052906; Tue, 17 May 2016 08:24:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8ORPU052905; Tue, 17 May 2016 08:24:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605170824.u4H8ORPU052905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 08:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300030 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:24:28 -0000 Author: kib Date: Tue May 17 08:24:27 2016 New Revision: 300030 URL: https://svnweb.freebsd.org/changeset/base/300030 Log: Fix comments. Submitted by: bde MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue May 17 08:24:06 2016 (r300029) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue May 17 08:24:27 2016 (r300030) @@ -512,7 +512,7 @@ ffs_mount(struct mount *mp) * We need the name for the mount point (also used for * "last mounted on") copied in. If an error occurs, * the mount point is discarded by the upper level code. - * Note that vfs_mount() populates f_mntonname for us. + * Note that vfs_mount_alloc() populates f_mntonname for us. */ if ((error = ffs_mountfs(devvp, mp, td)) != 0) { vrele(devvp); @@ -1058,7 +1058,7 @@ ffs_mountfs(devvp, mp, td) (void) ffs_sbupdate(ump, MNT_WAIT, 0); } /* - * Initialize filesystem stat information in mount struct. + * Initialize filesystem state information in mount struct. */ MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | From owner-svn-src-all@freebsd.org Tue May 17 08:28:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20FF8B3EB63; Tue, 17 May 2016 08:28:00 +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 ECB8D1457; Tue, 17 May 2016 08:27:59 +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 u4H8RxAG053205; Tue, 17 May 2016 08:27:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8RxjT053204; Tue, 17 May 2016 08:27:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170827.u4H8RxjT053204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300031 - stable/9/sys/cddl/dev/dtrace/x86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:28:00 -0000 Author: avg Date: Tue May 17 08:27:58 2016 New Revision: 300031 URL: https://svnweb.freebsd.org/changeset/base/300031 Log: MFC r266103: Update dis_tables.c to the latest Illumos version. Latest as of May 2014. On behalf of: grehan Modified: stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:24:27 2016 (r300030) +++ stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:27:58 2016 (r300031) @@ -21,6 +21,7 @@ */ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -104,16 +105,18 @@ enum { Mv, Mw, M, /* register or memory */ + MG9, /* register or memory in group 9 (prefix optional) */ Mb, /* register or memory, always byte sized */ MO, /* memory only (no registers) */ PREF, - SWAPGS, + SWAPGS_RDTSCP, MONITOR_MWAIT, R, RA, SEG, MR, RM, + RM_66r, /* RM, but with a required 0x66 prefix */ IA, MA, SD, @@ -228,7 +231,10 @@ enum { VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ VEX_RM, /* VEX mod_reg -> mod_rm */ VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ - VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_RMX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VMx, /* vmcall/vmlaunch/vmresume/vmxoff */ + VMxo, /* VMx instruction with optional prefix */ + SVM /* AMD SVM instructions */ }; /* @@ -496,8 +502,8 @@ const instable_t dis_op0F00[8] = { */ const instable_t dis_op0F01[8] = { -/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6), -/* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS), +/* [0] */ TNSZ("sgdt",VMx,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",SVM,6), +/* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS_RDTSCP), }; /* @@ -528,15 +534,44 @@ const instable_t dis_op0FBA[8] = { }; /* - * Decode table for 0x0FC7 opcode + * Decode table for 0x0FC7 opcode (group 9) */ const instable_t dis_op0FC7[8] = { /* [0] */ INVALID, TNS("cmpxchg8b",M), INVALID, INVALID, -/* [4] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("vmptrld",MG9), TNS("vmptrst",MG9), }; +/* + * Decode table for 0x0FC7 opcode (group 9) mode 3 + */ + +const instable_t dis_op0FC7m3[8] = { + +/* [0] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("rdrand",MG9), INVALID, +}; + +/* + * Decode table for 0x0FC7 opcode with 0x66 prefix + */ + +const instable_t dis_op660FC7[8] = { + +/* [0] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("vmclear",M), INVALID, +}; + +/* + * Decode table for 0x0FC7 opcode with 0xF3 prefix + */ + +const instable_t dis_opF30FC7[8] = { + +/* [0] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("vmxon",M), INVALID, +}; /* * Decode table for 0x0FC8 opcode -- 486 bswap instruction @@ -1147,7 +1182,7 @@ const instable_t dis_op0F38[256] = { /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, -/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, @@ -1193,7 +1228,7 @@ const instable_t dis_opAVX660F38[256] = /* [08] */ TNSZ("vpsignb",VEX_RMrX,16),TNSZ("vpsignw",VEX_RMrX,16),TNSZ("vpsignd",VEX_RMrX,16),TNSZ("vpmulhrsw",VEX_RMrX,16), /* [0C] */ TNSZ("vpermilps",VEX_RMrX,8),TNSZ("vpermilpd",VEX_RMrX,16),TNSZ("vtestps",VEX_RRI,8), TNSZ("vtestpd",VEX_RRI,16), -/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [10] */ INVALID, INVALID, INVALID, TNSZ("vcvtph2ps",VEX_MX,16), /* [14] */ INVALID, INVALID, INVALID, TNSZ("vptest",VEX_RRI,16), /* [18] */ TNSZ("vbroadcastss",VEX_MX,4),TNSZ("vbroadcastsd",VEX_MX,8),TNSZ("vbroadcastf128",VEX_MX,16),INVALID, /* [1C] */ TNSZ("vpabsb",VEX_MX,16),TNSZ("vpabsw",VEX_MX,16),TNSZ("vpabsd",VEX_MX,16),INVALID, @@ -1359,7 +1394,7 @@ const instable_t dis_opAVX660F3A[256] = /* [10] */ INVALID, INVALID, INVALID, INVALID, /* [14] */ TNSZ("vpextrb",VEX_RRi,8),TNSZ("vpextrw",VEX_RRi,16),TNSZ("vpextrd",VEX_RRi,16),TNSZ("vextractps",VEX_RM,16), /* [18] */ TNSZ("vinsertf128",VEX_RMRX,16),TNSZ("vextractf128",VEX_RX,16),INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, TNSZ("vcvtps2ph",VEX_RX,16), INVALID, INVALID, /* [20] */ TNSZ("vpinsrb",VEX_RMRX,8),TNSZ("vinsertps",VEX_RMRX,16),TNSZ("vpinsrd",VEX_RMRX,16),INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, @@ -1446,7 +1481,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), +/* [1C] */ INVALID, INVALID, INVALID, TS("nop",Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, @@ -1475,7 +1510,7 @@ const instable_t dis_op0F[16][16] = { }, { /* [70] */ TNSZ("pshufw",MMOPM,8), TNS("psrXXX",MR), TNS("psrXXX",MR), TNS("psrXXX",MR), /* [74] */ TNSZ("pcmpeqb",MMO,8), TNSZ("pcmpeqw",MMO,8), TNSZ("pcmpeqd",MMO,8), TNS("emms",NORM), -/* [78] */ TNS("INVALID",XMMO), TNS("INVALID",XMMO), INVALID, INVALID, +/* [78] */ TNSy("vmread",RM), TNSy("vmwrite",MR), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",MMOS,4), TNSZ("movq",MMOS,8), }, { /* [80] */ TNS("jo",D), TNS("jno",D), TNS("jb",D), TNS("jae",D), @@ -1859,14 +1894,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), /* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), @@ -2905,6 +2940,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod goto error; #endif switch (dp->it_adrmode) { + case RM_66r: case XMM_66r: case XMMM_66r: if (opnd_size_prefix == 0) { @@ -3054,6 +3090,59 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod } break; + case MG9: + /* + * More horribleness: the group 9 (0xF0 0xC7) instructions are + * allowed an optional prefix of 0x66 or 0xF3. This is similar + * to the SIMD business described above, but with a different + * addressing mode (and an indirect table), so we deal with it + * separately (if similarly). + * + * Intel further complicated this with the release of Ivy Bridge + * where they overloaded these instructions based on the ModR/M + * bytes. The VMX instructions have a mode of 0 since they are + * memory instructions but rdrand instructions have a mode of + * 0b11 (REG_ONLY) because they only operate on registers. While + * there are different prefix formats, for now it is sufficient + * to use a single different table. + */ + + /* + * Calculate our offset in dis_op0FC7 (the group 9 table) + */ + if ((uintptr_t)dp - (uintptr_t)dis_op0FC7 > sizeof (dis_op0FC7)) + goto error; + + off = ((uintptr_t)dp - (uintptr_t)dis_op0FC7) / + sizeof (instable_t); + + /* + * If we have a mode of 0b11 then we have to rewrite this. + */ + dtrace_get_modrm(x, &mode, ®, &r_m); + if (mode == REG_ONLY) { + dp = (instable_t *)&dis_op0FC7m3[off]; + break; + } + + /* + * Rewrite if this instruction used one of the magic prefixes. + */ + if (rep_prefix) { + if (rep_prefix == 0xf3) + dp = (instable_t *)&dis_opF30FC7[off]; + else + goto error; + rep_prefix = 0; + } else if (opnd_size_prefix) { + dp = (instable_t *)&dis_op660FC7[off]; + opnd_size_prefix = 0; + if (opnd_size == SIZE16) + opnd_size = SIZE32; + } + break; + + case MMOSH: /* * As with the "normal" SIMD instructions, the MMX @@ -3434,14 +3523,21 @@ just_mem: dtrace_get_operand(x, mode, r_m, wbit, 0); break; - case SWAPGS: + case SWAPGS_RDTSCP: if (cpu_mode == SIZE64 && mode == 3 && r_m == 0) { #ifdef DIS_TEXT (void) strncpy(x->d86_mnem, "swapgs", OPLEN); #endif NOMEM; break; + } else if (mode == 3 && r_m == 1) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "rdtscp", OPLEN); +#endif + NOMEM; + break; } + /*FALLTHROUGH*/ /* prefetch instruction - memory operand, but no memory acess */ @@ -3451,6 +3547,7 @@ just_mem: /* single memory or register operand */ case M: + case MG9: wbit = LONG_OPND; goto just_mem; @@ -3459,6 +3556,76 @@ just_mem: wbit = BYTE_OPND; goto just_mem; + case VMx: + if (mode == 3) { +#ifdef DIS_TEXT + char *vminstr; + + switch (r_m) { + case 1: + vminstr = "vmcall"; + break; + case 2: + vminstr = "vmlaunch"; + break; + case 3: + vminstr = "vmresume"; + break; + case 4: + vminstr = "vmxoff"; + break; + default: + goto error; + } + + (void) strncpy(x->d86_mnem, vminstr, OPLEN); +#else + if (r_m < 1 || r_m > 4) + goto error; +#endif + + NOMEM; + break; + } + /*FALLTHROUGH*/ + case SVM: + if (mode == 3) { +#ifdef DIS_TEXT + char *vinstr; + + switch (r_m) { + case 0: + vinstr = "vmrun"; + break; + case 1: + vinstr = "vmmcall"; + break; + case 2: + vinstr = "vmload"; + break; + case 3: + vinstr = "vmsave"; + break; + case 4: + vinstr = "stgi"; + break; + case 5: + vinstr = "clgi"; + break; + case 6: + vinstr = "skinit"; + break; + case 7: + vinstr = "invlpga"; + break; + } + + (void) strncpy(x->d86_mnem, vinstr, OPLEN); +#endif + NOMEM; + break; + } + /*FALLTHROUGH*/ case MONITOR_MWAIT: if (mode == 3) { if (r_m == 0) { @@ -3597,6 +3764,7 @@ just_mem: break; case RM: + case RM_66r: wbit = LONG_OPND; STANDARD_MODRM(x, mode, reg, r_m, rex_prefix, wbit, 1); break; @@ -4300,7 +4468,8 @@ L_VEX_MX: dtrace_get_operand(x, REG_ONLY, reg, XMM_OPND, 1); dtrace_get_operand(x, mode, r_m, wbit, 0); } else if ((dp == &dis_opAVXF30F[0xE6]) || - (dp == &dis_opAVX0F[0x5][0xA])) { + (dp == &dis_opAVX0F[0x5][0xA]) || + (dp == &dis_opAVX660F38[0x13])) { /* vcvtdq2pd , */ /* or vcvtps2pd , */ dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); @@ -4385,7 +4554,9 @@ L_VEX_MX: case VEX_RX: /* ModR/M.rm := op(ModR/M.reg) */ - if (dp == &dis_opAVX660F3A[0x19]) { /* vextractf128 */ + /* vextractf128 || vcvtps2ph */ + if (dp == &dis_opAVX660F3A[0x19] || + dp == &dis_opAVX660F3A[0x1d]) { x->d86_numopnds = 3; dtrace_get_modrm(x, &mode, ®, &r_m); From owner-svn-src-all@freebsd.org Tue May 17 08:30:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15874B3EC10; Tue, 17 May 2016 08:30:08 +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 D64F8172D; Tue, 17 May 2016 08:30:07 +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 u4H8U6ce053353; Tue, 17 May 2016 08:30:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8U6V5053352; Tue, 17 May 2016 08:30:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170830.u4H8U6V5053352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300032 - stable/9/sys/cddl/dev/dtrace/x86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:30:08 -0000 Author: avg Date: Tue May 17 08:30:06 2016 New Revision: 300032 URL: https://svnweb.freebsd.org/changeset/base/300032 Log: MFC r298473,298787: add invpcid, fix sahf/lahf in dtrace disassembler Modified: stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:27:58 2016 (r300031) +++ stable/9/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:30:06 2016 (r300032) @@ -1182,7 +1182,7 @@ const instable_t dis_op0F38[256] = { /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, -/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),INVALID, INVALID, +/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),TNSy("invpcid", RM_66r),INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, @@ -1931,7 +1931,7 @@ const instable_t dis_distable[16][16] = /* [9,0] */ TNS("nop",NORM), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,4] */ TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,8] */ TNS("cXtX",CBW), TNS("cXtX",CWD), TNSx("lcall",SO), TNS("fwait",NORM), -/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNSx("sahf",NORM), TNSx("lahf",NORM), +/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNS("sahf",NORM), TNS("lahf",NORM), }, { /* [A,0] */ TNS("movb",OA), TS("mov",OA), TNS("movb",AO), TS("mov",AO), /* [A,4] */ TNSZ("movsb",SD,1), TS("movs",SD), TNSZ("cmpsb",SD,1), TS("cmps",SD), From owner-svn-src-all@freebsd.org Tue May 17 08:31:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21BBFB3ED42; Tue, 17 May 2016 08:31:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6CDE1BE9; Tue, 17 May 2016 08:31:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H8VlHX055478; Tue, 17 May 2016 08:31:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8VlHi055477; Tue, 17 May 2016 08:31:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170831.u4H8VlHi055477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300034 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:31:48 -0000 Author: avg Date: Tue May 17 08:31:46 2016 New Revision: 300034 URL: https://svnweb.freebsd.org/changeset/base/300034 Log: MFC r298106: zfs_rezget: z_vnode can not be NULL if zp is valid Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue May 17 08:30:22 2016 (r300033) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue May 17 08:31:46 2016 (r300034) @@ -1341,7 +1341,7 @@ zfs_rezget(znode_t *zp) * recycled when the last vnode reference is dropped. */ vp = ZTOV(zp); - if (vp != NULL && vp->v_type != IFTOVT((mode_t)zp->z_mode)) { + if (vp->v_type != IFTOVT((mode_t)zp->z_mode)) { zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); return (EIO); @@ -1349,11 +1349,9 @@ zfs_rezget(znode_t *zp) zp->z_unlinked = (zp->z_links == 0); zp->z_blksz = doi.doi_data_block_size; - if (vp != NULL) { - vn_pages_remove(vp, 0, 0); - if (zp->z_size != size) - vnode_pager_setsize(vp, zp->z_size); - } + vn_pages_remove(vp, 0, 0); + if (zp->z_size != size) + vnode_pager_setsize(vp, zp->z_size); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); From owner-svn-src-all@freebsd.org Tue May 17 08:31:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 301CBB3ED96; Tue, 17 May 2016 08:31:56 +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 F3B421D41; Tue, 17 May 2016 08:31:55 +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 u4H8Vt1e056154; Tue, 17 May 2016 08:31:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8Vtmo056153; Tue, 17 May 2016 08:31:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170831.u4H8Vtmo056153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300035 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:31:56 -0000 Author: avg Date: Tue May 17 08:31:54 2016 New Revision: 300035 URL: https://svnweb.freebsd.org/changeset/base/300035 Log: MFC r298106: zfs_rezget: z_vnode can not be NULL if zp is valid Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue May 17 08:31:46 2016 (r300034) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue May 17 08:31:54 2016 (r300035) @@ -1339,7 +1339,7 @@ zfs_rezget(znode_t *zp) * recycled when the last vnode reference is dropped. */ vp = ZTOV(zp); - if (vp != NULL && vp->v_type != IFTOVT((mode_t)zp->z_mode)) { + if (vp->v_type != IFTOVT((mode_t)zp->z_mode)) { zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); return (EIO); @@ -1347,11 +1347,9 @@ zfs_rezget(znode_t *zp) zp->z_unlinked = (zp->z_links == 0); zp->z_blksz = doi.doi_data_block_size; - if (vp != NULL) { - vn_pages_remove(vp, 0, 0); - if (zp->z_size != size) - vnode_pager_setsize(vp, zp->z_size); - } + vn_pages_remove(vp, 0, 0); + if (zp->z_size != size) + vnode_pager_setsize(vp, zp->z_size); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); From owner-svn-src-all@freebsd.org Tue May 17 08:33:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD433B3EFD4; Tue, 17 May 2016 08:33:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE7BD1015; Tue, 17 May 2016 08:33:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H8Xe3t056295; Tue, 17 May 2016 08:33:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8XeAd056294; Tue, 17 May 2016 08:33:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170833.u4H8XeAd056294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300036 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:33:42 -0000 Author: avg Date: Tue May 17 08:33:40 2016 New Revision: 300036 URL: https://svnweb.freebsd.org/changeset/base/300036 Log: MFC r298736: ensure that initial local apic id is sane on AMD 10h systems Modified: stable/10/sys/amd64/amd64/initcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:31:54 2016 (r300035) +++ stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:33:40 2016 (r300036) @@ -111,6 +111,19 @@ init_amd(void) wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } + + /* + * BIOS may fail to set InitApicIdCpuIdLo to 1 as it should per BKDG. + * So, do it here or otherwise some tools could be confused by + * Initial Local APIC ID reported with CPUID Function 1 in EBX. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(MSR_NB_CFG1); + msr |= (uint64_t)1 << 54; + wrmsr(MSR_NB_CFG1, msr); + } + } } /* From owner-svn-src-all@freebsd.org Tue May 17 08:36:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6D65B3D0E3; Tue, 17 May 2016 08:36:13 +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 A3D3A11E1; Tue, 17 May 2016 08:36:13 +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 u4H8aCWt056444; Tue, 17 May 2016 08:36:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8aCMq056443; Tue, 17 May 2016 08:36:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170836.u4H8aCMq056443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300037 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:36:13 -0000 Author: avg Date: Tue May 17 08:36:12 2016 New Revision: 300037 URL: https://svnweb.freebsd.org/changeset/base/300037 Log: MFC r298736,298737: ensure that initial local apic id is sane on AMD 10h systems Modified: stable/9/sys/amd64/amd64/initcpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/initcpu.c Tue May 17 08:33:40 2016 (r300036) +++ stable/9/sys/amd64/amd64/initcpu.c Tue May 17 08:36:12 2016 (r300037) @@ -84,6 +84,7 @@ SYSCTL_UINT(_hw, OID_AUTO, via_feature_x static void init_amd(void) { + uint64_t msr; /* * Work around Erratum 721 for Family 10h and 12h processors. @@ -106,6 +107,19 @@ init_amd(void) wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } + + /* + * BIOS may fail to set InitApicIdCpuIdLo to 1 as it should per BKDG. + * So, do it here or otherwise some tools could be confused by + * Initial Local APIC ID reported with CPUID Function 1 in EBX. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(MSR_NB_CFG1); + msr |= (uint64_t)1 << 54; + wrmsr(MSR_NB_CFG1, msr); + } + } } /* From owner-svn-src-all@freebsd.org Tue May 17 08:36:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4DC8B3D209; Tue, 17 May 2016 08:36:55 +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 A106B1369; Tue, 17 May 2016 08:36:55 +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 u4H8askp056511; Tue, 17 May 2016 08:36:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8asAf056510; Tue, 17 May 2016 08:36:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170836.u4H8asAf056510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300038 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:36:55 -0000 Author: avg Date: Tue May 17 08:36:54 2016 New Revision: 300038 URL: https://svnweb.freebsd.org/changeset/base/300038 Log: MFC r298737: fix up r300036 Modified: stable/10/sys/amd64/amd64/initcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:36:12 2016 (r300037) +++ stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:36:54 2016 (r300038) @@ -89,6 +89,7 @@ SYSCTL_UINT(_hw, OID_AUTO, via_feature_x static void init_amd(void) { + uint64_t msr; /* * Work around Erratum 721 for Family 10h and 12h processors. From owner-svn-src-all@freebsd.org Tue May 17 08:43:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4FFBB3D4C0; Tue, 17 May 2016 08:43:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70F9319FF; Tue, 17 May 2016 08:43:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H8hoh6059412; Tue, 17 May 2016 08:43:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8hosF059410; Tue, 17 May 2016 08:43:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170843.u4H8hosF059410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300039 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:43:51 -0000 Author: avg Date: Tue May 17 08:43:50 2016 New Revision: 300039 URL: https://svnweb.freebsd.org/changeset/base/300039 Log: MFC r297848: l2arc: make sure that all writes honor ashift of a cache device Note: no MFC stable/9 because it has become quite out of date with head, so the merge would be quite labourious and, thus, risky. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue May 17 08:36:54 2016 (r300038) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue May 17 08:43:50 2016 (r300039) @@ -565,6 +565,7 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_compress_successes; kstat_named_t arcstat_l2_compress_zeros; kstat_named_t arcstat_l2_compress_failures; + kstat_named_t arcstat_l2_padding_needed; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; @@ -666,6 +667,7 @@ static arc_stats_t arc_stats = { { "l2_compress_successes", KSTAT_DATA_UINT64 }, { "l2_compress_zeros", KSTAT_DATA_UINT64 }, { "l2_compress_failures", KSTAT_DATA_UINT64 }, + { "l2_padding_needed", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, @@ -839,7 +841,7 @@ typedef struct l1arc_buf_hdr { refcount_t b_refcnt; arc_callback_t *b_acb; - /* temporary buffer holder for in-flight compressed data */ + /* temporary buffer holder for in-flight compressed or padded data */ void *b_tmp_cdata; } l1arc_buf_hdr_t; @@ -1100,6 +1102,7 @@ typedef struct l2arc_read_callback { zbookmark_phys_t l2rcb_zb; /* original bookmark */ int l2rcb_flags; /* original flags */ enum zio_compress l2rcb_compress; /* applied compress */ + void *l2rcb_data; /* temporary buffer */ } l2arc_read_callback_t; typedef struct l2arc_write_callback { @@ -1130,7 +1133,7 @@ static uint32_t arc_bufc_to_flags(arc_bu static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *); static void l2arc_read_done(zio_t *); -static boolean_t l2arc_compress_buf(arc_buf_hdr_t *); +static boolean_t l2arc_transform_buf(arc_buf_hdr_t *, boolean_t); static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); static void l2arc_release_cdata_buf(arc_buf_hdr_t *); @@ -2217,6 +2220,8 @@ arc_buf_data_free(arc_buf_t *buf, void ( static void arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr) { + size_t align, asize, len; + ASSERT(HDR_HAS_L2HDR(hdr)); ASSERT(MUTEX_HELD(&hdr->b_l2hdr.b_dev->l2ad_mtx)); @@ -2238,16 +2243,15 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr } /* - * The header does not have compression enabled. This can be due - * to the buffer not being compressible, or because we're - * freeing the buffer before the second phase of - * l2arc_write_buffer() has started (which does the compression - * step). In either case, b_tmp_cdata does not point to a - * separately compressed buffer, so there's nothing to free (it - * points to the same buffer as the arc_buf_t's b_data field). - */ - if (hdr->b_l2hdr.b_compress == ZIO_COMPRESS_OFF) { - hdr->b_l1hdr.b_tmp_cdata = NULL; + * The bufer has been chosen for writing to L2ARC, but it's + * not being written just yet. In other words, + * b_tmp_cdata points to exactly the same buffer as b_data, + * l2arc_transform_buf hasn't been called. + */ + if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET) { + ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, + hdr->b_l1hdr.b_buf->b_data); + ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_OFF); return; } @@ -2260,12 +2264,18 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr return; } - ASSERT(L2ARC_IS_VALID_COMPRESS(hdr->b_l2hdr.b_compress)); - - arc_buf_free_on_write(hdr->b_l1hdr.b_tmp_cdata, - hdr->b_size, zio_data_buf_free); + /* + * Nothing to do if the temporary buffer was not required. + */ + if (hdr->b_l1hdr.b_tmp_cdata == NULL) + return; ARCSTAT_BUMP(arcstat_l2_cdata_free_on_write); + len = hdr->b_size; + align = (size_t)1 << hdr->b_l2hdr.b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + arc_buf_free_on_write(hdr->b_l1hdr.b_tmp_cdata, asize, + zio_data_buf_free); hdr->b_l1hdr.b_tmp_cdata = NULL; } @@ -4528,6 +4538,7 @@ top: !HDR_L2_WRITING(hdr) && !HDR_L2_EVICTED(hdr) && !(l2arc_noprefetch && HDR_PREFETCH(hdr))) { l2arc_read_callback_t *cb; + void* b_data; DTRACE_PROBE1(l2arc__hit, arc_buf_hdr_t *, hdr); ARCSTAT_BUMP(arcstat_l2_hits); @@ -4540,6 +4551,14 @@ top: cb->l2rcb_zb = *zb; cb->l2rcb_flags = zio_flags; cb->l2rcb_compress = b_compress; + if (b_asize > hdr->b_size) { + ASSERT3U(b_compress, ==, + ZIO_COMPRESS_OFF); + b_data = zio_data_buf_alloc(b_asize); + cb->l2rcb_data = b_data; + } else { + b_data = buf->b_data; + } ASSERT(addr >= VDEV_LABEL_START_SIZE && addr + size < vd->vdev_psize - @@ -4552,6 +4571,7 @@ top: * was squashed to zero size by compression. */ if (b_compress == ZIO_COMPRESS_EMPTY) { + ASSERT3U(b_asize, ==, 0); rzio = zio_null(pio, spa, vd, l2arc_read_done, cb, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -4560,7 +4580,7 @@ top: ZIO_FLAG_DONT_RETRY); } else { rzio = zio_read_phys(pio, vd, addr, - b_asize, buf->b_data, + b_asize, b_data, ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -6045,6 +6065,32 @@ l2arc_read_done(zio_t *zio) ASSERT3P(hash_lock, ==, HDR_LOCK(hdr)); /* + * If the data was read into a temporary buffer, + * move it and free the buffer. + */ + if (cb->l2rcb_data != NULL) { + ASSERT3U(hdr->b_size, <, zio->io_size); + ASSERT3U(cb->l2rcb_compress, ==, ZIO_COMPRESS_OFF); + if (zio->io_error == 0) + bcopy(cb->l2rcb_data, buf->b_data, hdr->b_size); + + /* + * The following must be done regardless of whether + * there was an error: + * - free the temporary buffer + * - point zio to the real ARC buffer + * - set zio size accordingly + * These are required because zio is either re-used for + * an I/O of the block in the case of the error + * or the zio is passed to arc_read_done() and it + * needs real data. + */ + zio_data_buf_free(cb->l2rcb_data, zio->io_size); + zio->io_size = zio->io_orig_size = hdr->b_size; + zio->io_data = zio->io_orig_data = buf->b_data; + } + + /* * If the buffer was compressed, decompress it first. */ if (cb->l2rcb_compress != ZIO_COMPRESS_OFF) @@ -6328,6 +6374,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de kmutex_t *hash_lock; uint64_t buf_sz; uint64_t buf_a_sz; + size_t align; if (arc_warm == B_FALSE) hdr_prev = multilist_sublist_next(mls, hdr); @@ -6365,7 +6412,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * disk block size. */ buf_sz = hdr->b_size; - buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); + align = (size_t)1 << dev->l2ad_vdev->vdev_ashift; + buf_a_sz = P2ROUNDUP(buf_sz, align); if ((write_asize + buf_a_sz) > target_sz) { full = B_TRUE; @@ -6469,26 +6517,15 @@ l2arc_write_buffers(spa_t *spa, l2arc_de mutex_enter(&dev->l2ad_mtx); /* - * Note that elsewhere in this file arcstat_l2_asize - * and the used space on l2ad_vdev are updated using b_asize, - * which is not necessarily rounded up to the device block size. - * Too keep accounting consistent we do the same here as well: - * stats_size accumulates the sum of b_asize of the written buffers, - * while write_asize accumulates the sum of b_asize rounded up - * to the device block size. - * The latter sum is used only to validate the corectness of the code. - */ - uint64_t stats_size = 0; - write_asize = 0; - - /* * Now start writing the buffers. We're starting at the write head * and work backwards, retracing the course of the buffer selector * loop above. */ + write_asize = 0; for (hdr = list_prev(&dev->l2ad_buflist, head); hdr; hdr = list_prev(&dev->l2ad_buflist, hdr)) { uint64_t buf_sz; + boolean_t compress; /* * We rely on the L1 portion of the header below, so @@ -6507,22 +6544,26 @@ l2arc_write_buffers(spa_t *spa, l2arc_de */ hdr->b_l2hdr.b_daddr = dev->l2ad_hand; - if ((HDR_L2COMPRESS(hdr)) && - hdr->b_l2hdr.b_asize >= buf_compress_minsz) { - if (l2arc_compress_buf(hdr)) { - /* - * If compression succeeded, enable headroom - * boost on the next scan cycle. - */ - *headroom_boost = B_TRUE; - } + /* + * Save a pointer to the original buffer data we had previously + * stashed away. + */ + buf_data = hdr->b_l1hdr.b_tmp_cdata; + + compress = HDR_L2COMPRESS(hdr) && + hdr->b_l2hdr.b_asize >= buf_compress_minsz; + if (l2arc_transform_buf(hdr, compress)) { + /* + * If compression succeeded, enable headroom + * boost on the next scan cycle. + */ + *headroom_boost = B_TRUE; } /* - * Pick up the buffer data we had previously stashed away - * (and now potentially also compressed). + * Get the new buffer size that accounts for compression + * and padding. */ - buf_data = hdr->b_l1hdr.b_tmp_cdata; buf_sz = hdr->b_l2hdr.b_asize; /* @@ -6534,8 +6575,12 @@ l2arc_write_buffers(spa_t *spa, l2arc_de /* Compression may have squashed the buffer to zero length. */ if (buf_sz != 0) { - uint64_t buf_a_sz; - + /* + * If the data was padded or compressed, then it + * it is in a new buffer. + */ + if (hdr->b_l1hdr.b_tmp_cdata != NULL) + buf_data = hdr->b_l1hdr.b_tmp_cdata; wzio = zio_write_phys(pio, dev->l2ad_vdev, dev->l2ad_hand, buf_sz, buf_data, ZIO_CHECKSUM_OFF, NULL, NULL, ZIO_PRIORITY_ASYNC_WRITE, @@ -6545,14 +6590,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de zio_t *, wzio); (void) zio_nowait(wzio); - stats_size += buf_sz; - - /* - * Keep the clock hand suitably device-aligned. - */ - buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); - write_asize += buf_a_sz; - dev->l2ad_hand += buf_a_sz; + write_asize += buf_sz; + dev->l2ad_hand += buf_sz; } } @@ -6562,8 +6601,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ARCSTAT_BUMP(arcstat_l2_writes_sent); ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); ARCSTAT_INCR(arcstat_l2_size, write_sz); - ARCSTAT_INCR(arcstat_l2_asize, stats_size); - vdev_space_update(dev->l2ad_vdev, stats_size, 0, 0); + ARCSTAT_INCR(arcstat_l2_asize, write_asize); + vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); /* * Bump device hand to the device start if it is approaching the end. @@ -6582,12 +6621,18 @@ l2arc_write_buffers(spa_t *spa, l2arc_de } /* - * Compresses an L2ARC buffer. + * Transforms, possibly compresses and pads, an L2ARC buffer. * The data to be compressed must be prefilled in l1hdr.b_tmp_cdata and its * size in l2hdr->b_asize. This routine tries to compress the data and * depending on the compression result there are three possible outcomes: - * *) The buffer was incompressible. The original l2hdr contents were left - * untouched and are ready for writing to an L2 device. + * *) The buffer was incompressible. The buffer size was already ashift aligned. + * The original hdr contents were left untouched except for b_tmp_cdata, + * which is reset to NULL. The caller must keep a pointer to the original + * data. + * *) The buffer was incompressible. The buffer size was not ashift aligned. + * b_tmp_cdata was replaced with a temporary data buffer which holds a padded + * (aligned) copy of the data. Once writing is done, invoke + * l2arc_release_cdata_buf on this hdr to free the temporary buffer. * *) The buffer was all-zeros, so there is no need to write it to an L2 * device. To indicate this situation b_tmp_cdata is NULL'ed, b_asize is * set to zero and b_compress is set to ZIO_COMPRESS_EMPTY. @@ -6601,10 +6646,11 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * buffer was incompressible). */ static boolean_t -l2arc_compress_buf(arc_buf_hdr_t *hdr) +l2arc_transform_buf(arc_buf_hdr_t *hdr, boolean_t compress) { void *cdata; - size_t csize, len, rounded; + size_t align, asize, csize, len, rounded; + ASSERT(HDR_HAS_L2HDR(hdr)); l2arc_buf_hdr_t *l2hdr = &hdr->b_l2hdr; @@ -6613,14 +6659,19 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) ASSERT(hdr->b_l1hdr.b_tmp_cdata != NULL); len = l2hdr->b_asize; - cdata = zio_data_buf_alloc(len); + align = (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + cdata = zio_data_buf_alloc(asize); ASSERT3P(cdata, !=, NULL); - csize = zio_compress_data(ZIO_COMPRESS_LZ4, hdr->b_l1hdr.b_tmp_cdata, - cdata, l2hdr->b_asize); + if (compress) + csize = zio_compress_data(ZIO_COMPRESS_LZ4, + hdr->b_l1hdr.b_tmp_cdata, cdata, len); + else + csize = len; if (csize == 0) { /* zero block, indicate that there's nothing to write */ - zio_data_buf_free(cdata, len); + zio_data_buf_free(cdata, asize); l2hdr->b_compress = ZIO_COMPRESS_EMPTY; l2hdr->b_asize = 0; hdr->b_l1hdr.b_tmp_cdata = NULL; @@ -6628,8 +6679,8 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) return (B_TRUE); } - rounded = P2ROUNDUP(csize, - (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); + rounded = P2ROUNDUP(csize, align); + ASSERT3U(rounded, <=, asize); if (rounded < len) { /* * Compression succeeded, we'll keep the cdata around for @@ -6646,11 +6697,32 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) return (B_TRUE); } else { /* - * Compression failed, release the compressed buffer. - * l2hdr will be left unmodified. + * Compression did not save space. */ - zio_data_buf_free(cdata, len); - ARCSTAT_BUMP(arcstat_l2_compress_failures); + if (P2PHASE(len, align) != 0) { + /* + * Use compression buffer for a copy of data padded to + * the proper size. Compression algorithm remains set + * to ZIO_COMPRESS_OFF. + */ + ASSERT3U(len, <, asize); + bcopy(hdr->b_l1hdr.b_tmp_cdata, cdata, len); + bzero((char *)cdata + len, asize - len); + l2hdr->b_asize = asize; + hdr->b_l1hdr.b_tmp_cdata = cdata; + ARCSTAT_BUMP(arcstat_l2_padding_needed); + } else { + ASSERT3U(len, ==, asize); + /* + * The original buffer is good as is, + * release the compressed buffer. + * l2hdr will be left unmodified except for b_tmp_cdata. + */ + zio_data_buf_free(cdata, asize); + hdr->b_l1hdr.b_tmp_cdata = NULL; + } + if (compress) + ARCSTAT_BUMP(arcstat_l2_compress_failures); return (B_FALSE); } } @@ -6719,44 +6791,30 @@ l2arc_decompress_zio(zio_t *zio, arc_buf /* * Releases the temporary b_tmp_cdata buffer in an l2arc header structure. - * This buffer serves as a temporary holder of compressed data while + * This buffer serves as a temporary holder of compressed or padded data while * the buffer entry is being written to an l2arc device. Once that is * done, we can dispose of it. */ static void l2arc_release_cdata_buf(arc_buf_hdr_t *hdr) { - ASSERT(HDR_HAS_L2HDR(hdr)); + size_t align, asize, len; enum zio_compress comp = hdr->b_l2hdr.b_compress; + ASSERT(HDR_HAS_L2HDR(hdr)); ASSERT(HDR_HAS_L1HDR(hdr)); ASSERT(comp == ZIO_COMPRESS_OFF || L2ARC_IS_VALID_COMPRESS(comp)); - if (comp == ZIO_COMPRESS_OFF) { - /* - * In this case, b_tmp_cdata points to the same buffer - * as the arc_buf_t's b_data field. We don't want to - * free it, since the arc_buf_t will handle that. - */ + if (hdr->b_l1hdr.b_tmp_cdata != NULL) { + ASSERT(comp != ZIO_COMPRESS_EMPTY); + len = hdr->b_size; + align = (size_t)1 << hdr->b_l2hdr.b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + zio_data_buf_free(hdr->b_l1hdr.b_tmp_cdata, asize); hdr->b_l1hdr.b_tmp_cdata = NULL; - } else if (comp == ZIO_COMPRESS_EMPTY) { - /* - * In this case, b_tmp_cdata was compressed to an empty - * buffer, thus there's nothing to free and b_tmp_cdata - * should have been set to NULL in l2arc_write_buffers(). - */ - ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, NULL); } else { - /* - * If the data was compressed, then we've allocated a - * temporary buffer for it, so now we need to release it. - */ - ASSERT(hdr->b_l1hdr.b_tmp_cdata != NULL); - zio_data_buf_free(hdr->b_l1hdr.b_tmp_cdata, - hdr->b_size); - hdr->b_l1hdr.b_tmp_cdata = NULL; + ASSERT(comp == ZIO_COMPRESS_OFF || comp == ZIO_COMPRESS_EMPTY); } - } /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue May 17 08:36:54 2016 (r300038) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue May 17 08:43:50 2016 (r300039) @@ -2810,11 +2810,13 @@ zio_vdev_io_start(zio_t *zio) ASSERT0(P2PHASE(zio->io_size, align)); } else { /* - * For physical writes, we allow 512b aligned writes and assume - * the device will perform a read-modify-write as necessary. + * For the physical io we allow alignment + * to a logical block size. */ - ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); - ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); + uint64_t log_align = + 1ULL << vd->vdev_top->vdev_logical_ashift; + ASSERT0(P2PHASE(zio->io_offset, log_align)); + ASSERT0(P2PHASE(zio->io_size, log_align)); } VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); From owner-svn-src-all@freebsd.org Tue May 17 08:55:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B56DB3D796; Tue, 17 May 2016 08:55:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F44A1EBB; Tue, 17 May 2016 08:55:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H8tMRI062637; Tue, 17 May 2016 08:55:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8tMbs062632; Tue, 17 May 2016 08:55:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605170855.u4H8tMbs062632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 May 2016 08:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300040 - in head/sys/dev: cxgbe/cxgbei iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 08:55:23 -0000 Author: trasz Date: Tue May 17 08:55:21 2016 New Revision: 300040 URL: https://svnweb.freebsd.org/changeset/base/300040 Log: Extend the ICL interface to include the PDU pointer in the task_setup method. This is required for upcoming iSER support. Obtained from: Mellanox Technologies (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c head/sys/dev/iscsi/icl_conn_if.m head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/icl_wrappers.h head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue May 17 08:43:50 2016 (r300039) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue May 17 08:55:21 2016 (r300040) @@ -777,8 +777,8 @@ icl_cxgbei_conn_close(struct icl_conn *i } int -icl_cxgbei_conn_task_setup(struct icl_conn *ic, struct ccb_scsiio *csio, - uint32_t *task_tagp, void **prvp) +icl_cxgbei_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip, + struct ccb_scsiio *csio, uint32_t *task_tagp, void **prvp) { void *prv; Modified: head/sys/dev/iscsi/icl_conn_if.m ============================================================================== --- head/sys/dev/iscsi/icl_conn_if.m Tue May 17 08:43:50 2016 (r300039) +++ head/sys/dev/iscsi/icl_conn_if.m Tue May 17 08:55:21 2016 (r300040) @@ -84,6 +84,7 @@ METHOD void close { METHOD int task_setup { struct icl_conn *_ic; + struct icl_pdu *_ip; struct ccb_scsiio *_csio; uint32_t *_task_tag; void **_prvp; Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Tue May 17 08:43:50 2016 (r300039) +++ head/sys/dev/iscsi/icl_soft.c Tue May 17 08:55:21 2016 (r300040) @@ -1424,8 +1424,8 @@ icl_soft_conn_close(struct icl_conn *ic) } int -icl_soft_conn_task_setup(struct icl_conn *ic, struct ccb_scsiio *csio, - uint32_t *task_tagp, void **prvp) +icl_soft_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip, + struct ccb_scsiio *csio, uint32_t *task_tagp, void **prvp) { return (0); Modified: head/sys/dev/iscsi/icl_wrappers.h ============================================================================== --- head/sys/dev/iscsi/icl_wrappers.h Tue May 17 08:43:50 2016 (r300039) +++ head/sys/dev/iscsi/icl_wrappers.h Tue May 17 08:55:21 2016 (r300040) @@ -106,11 +106,11 @@ icl_conn_close(struct icl_conn *ic) } static inline int -icl_conn_task_setup(struct icl_conn *ic, struct ccb_scsiio *csio, - uint32_t *task_tagp, void **prvp) +icl_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip, + struct ccb_scsiio *csio, uint32_t *task_tagp, void **prvp) { - return (ICL_CONN_TASK_SETUP(ic, csio, task_tagp, prvp)); + return (ICL_CONN_TASK_SETUP(ic, ip, csio, task_tagp, prvp)); } static inline void Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue May 17 08:43:50 2016 (r300039) +++ head/sys/dev/iscsi/iscsi.c Tue May 17 08:55:21 2016 (r300040) @@ -172,7 +172,8 @@ static void iscsi_poll(struct cam_sim *s static struct iscsi_outstanding *iscsi_outstanding_find(struct iscsi_session *is, uint32_t initiator_task_tag); static struct iscsi_outstanding *iscsi_outstanding_add(struct iscsi_session *is, - union ccb *ccb, uint32_t *initiator_task_tagp); + struct icl_pdu *request, union ccb *ccb, + uint32_t *initiator_task_tagp); static void iscsi_outstanding_remove(struct iscsi_session *is, struct iscsi_outstanding *io); @@ -2012,7 +2013,7 @@ iscsi_outstanding_find_ccb(struct iscsi_ } static struct iscsi_outstanding * -iscsi_outstanding_add(struct iscsi_session *is, +iscsi_outstanding_add(struct iscsi_session *is, struct icl_pdu *request, union ccb *ccb, uint32_t *initiator_task_tagp) { struct iscsi_outstanding *io; @@ -2027,7 +2028,7 @@ iscsi_outstanding_add(struct iscsi_sessi return (NULL); } - error = icl_conn_task_setup(is->is_conn, &ccb->csio, + error = icl_conn_task_setup(is->is_conn, request, &ccb->csio, initiator_task_tagp, &io->io_icl_prv); if (error != 0) { ISCSI_SESSION_WARN(is, @@ -2093,7 +2094,7 @@ iscsi_action_abort(struct iscsi_session initiator_task_tag = is->is_initiator_task_tag++; - io = iscsi_outstanding_add(is, NULL, &initiator_task_tag); + io = iscsi_outstanding_add(is, request, NULL, &initiator_task_tag); if (io == NULL) { icl_pdu_free(request); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -2152,7 +2153,7 @@ iscsi_action_scsiio(struct iscsi_session } initiator_task_tag = is->is_initiator_task_tag++; - io = iscsi_outstanding_add(is, ccb, &initiator_task_tag); + io = iscsi_outstanding_add(is, request, ccb, &initiator_task_tag); if (io == NULL) { icl_pdu_free(request); if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { From owner-svn-src-all@freebsd.org Tue May 17 09:24:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B6EEB3DF04; Tue, 17 May 2016 09:24:56 +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 D86AE1CE5; Tue, 17 May 2016 09:24:55 +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 u4H9OtZ7071429; Tue, 17 May 2016 09:24:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H9Osb2071427; Tue, 17 May 2016 09:24:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605170924.u4H9Osb2071427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 09:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300041 - head/contrib/groff/tmac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 09:24:56 -0000 Author: kib Date: Tue May 17 09:24:54 2016 New Revision: 300041 URL: https://svnweb.freebsd.org/changeset/base/300041 Log: Add SUSv4 reference macro to our groff mdoc. mdocml already supports it. Sponsored by: The FreeBSD Foundation Modified: head/contrib/groff/tmac/doc-syms head/contrib/groff/tmac/groff_mdoc.man Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Tue May 17 08:55:21 2016 (r300040) +++ head/contrib/groff/tmac/doc-syms Tue May 17 09:24:54 2016 (r300041) @@ -659,6 +659,8 @@ .as doc-str-St--susv2 " (\*[Lq]\*[doc-Tn-font-size]SUSv2\*[doc-str-St]\*[Rq]) .ds doc-str-St--susv3 Version\~3 of the Single \*[doc-Tn-font-size]UNIX\*[doc-str-St] Specification .as doc-str-St--susv3 " (\*[Lq]\*[doc-Tn-font-size]SUSv3\*[doc-str-St]\*[Rq]) +.ds doc-str-St--susv4 Version\~4 of the Single \*[doc-Tn-font-size]UNIX\*[doc-str-St] Specification +.as doc-str-St--susv4 " (\*[Lq]\*[doc-Tn-font-size]SUSv4\*[doc-str-St]\*[Rq]) .ds doc-str-St--svid4 System\~V Interface Definition, Fourth Edition .as doc-str-St--svid4 " (\*[Lq]\*[doc-Tn-font-size]SVID\*[doc-str-St]\^4\*[Rq]) .ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] Base Definitions Issue\~5 Modified: head/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- head/contrib/groff/tmac/groff_mdoc.man Tue May 17 08:55:21 2016 (r300040) +++ head/contrib/groff/tmac/groff_mdoc.man Tue May 17 09:24:54 2016 (r300041) @@ -2097,6 +2097,8 @@ X/Open .St -susv2 .It Li \-susv3 .St -susv3 +.It Li \-susv4 +.St -susv4 .It Li \-svid4 .St -svid4 .It Li \-xbd5 From owner-svn-src-all@freebsd.org Tue May 17 09:53:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CACAB3E6B4; Tue, 17 May 2016 09:53:23 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5261B71; Tue, 17 May 2016 09:53:23 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H9rM2w080661; Tue, 17 May 2016 09:53:22 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H9rM2j080658; Tue, 17 May 2016 09:53:22 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201605170953.u4H9rM2j080658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 17 May 2016 09:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300042 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 09:53:23 -0000 Author: rrs Date: Tue May 17 09:53:22 2016 New Revision: 300042 URL: https://svnweb.freebsd.org/changeset/base/300042 Log: This small change adopts the excellent suggestion for using named structures in the add of a new tcp-stack that came in late to me via email after the last commit. It also makes it so that a new stack may optionally get a callback during a retransmit timeout. This allows the new stack to clear specific state (think sack scoreboards or other such structures). Sponsored by: Netflix Inc. Differential Revision: http://reviews.freebsd.org/D6303 Modified: head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Tue May 17 09:24:54 2016 (r300041) +++ head/sys/netinet/tcp_stacks/fastpath.c Tue May 17 09:53:22 2016 (r300042) @@ -2375,34 +2375,17 @@ tcp_do_segment_fastack(struct mbuf *m, s } struct tcp_function_block __tcp_fastslow = { - "fastslow", - tcp_output, - tcp_do_segment_fastslow, - tcp_default_ctloutput, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - 0 - + .tfb_tcp_block_name = "fastslow", + .tfb_tcp_output = tcp_output, + .tfb_tcp_do_segment = tcp_do_segment_fastslow, + .tfb_tcp_ctloutput = tcp_default_ctloutput, }; struct tcp_function_block __tcp_fastack = { - "fastack", - tcp_output, - tcp_do_segment_fastack, - tcp_default_ctloutput, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - 0 + .tfb_tcp_block_name = "fastack", + .tfb_tcp_output = tcp_output, + .tfb_tcp_do_segment = tcp_do_segment_fastack, + .tfb_tcp_ctloutput = tcp_default_ctloutput }; static int Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue May 17 09:24:54 2016 (r300041) +++ head/sys/netinet/tcp_timer.c Tue May 17 09:53:22 2016 (r300042) @@ -604,6 +604,10 @@ tcp_timer_rexmt(void * xtp) KASSERT((tp->t_timers->tt_flags & TT_REXMT) != 0, ("%s: tp %p rexmt callout should be running", __func__, tp)); tcp_free_sackholes(tp); + if (tp->t_fb->tfb_tcp_rexmit_tmr) { + /* The stack has a timer action too. */ + (*tp->t_fb->tfb_tcp_rexmit_tmr)(tp); + } /* * Retransmission timer went off. Message has not * been acked within retransmit interval. Back off Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue May 17 09:24:54 2016 (r300041) +++ head/sys/netinet/tcp_var.h Tue May 17 09:53:22 2016 (r300042) @@ -135,6 +135,7 @@ struct tcp_function_block { uint32_t, u_int); int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); + void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); volatile uint32_t tfb_refcnt; uint32_t tfb_flags; }; From owner-svn-src-all@freebsd.org Tue May 17 09:56:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EE83B3E7B4; Tue, 17 May 2016 09:56:24 +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 29D8D1D87; Tue, 17 May 2016 09:56:24 +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 u4H9uNsY080838; Tue, 17 May 2016 09:56:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H9uM5V080828; Tue, 17 May 2016 09:56:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605170956.u4H9uM5V080828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 09:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300043 - in head: include lib/libc/gen lib/libc/include lib/libthr lib/libthr/thread share/man/man3 sys/compat/cloudabi sys/compat/linux sys/kern sys/sys 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 09:56:24 -0000 Author: kib Date: Tue May 17 09:56:22 2016 New Revision: 300043 URL: https://svnweb.freebsd.org/changeset/base/300043 Log: Add implementation of robust mutexes, hopefully close enough to the intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013. A robust mutex is guaranteed to be cleared by the system upon either thread or process owner termination while the mutex is held. The next mutex locker is then notified about inconsistent mutex state and can execute (or abandon) corrective actions. The patch mostly consists of small changes here and there, adding neccessary checks for the inconsistent and abandoned conditions into existing paths. Additionally, the thread exit handler was extended to iterate over the userspace-maintained list of owned robust mutexes, unlocking and marking as terminated each of them. The list of owned robust mutexes cannot be maintained atomically synchronous with the mutex lock state (it is possible in kernel, but is too expensive). Instead, for the duration of lock or unlock operation, the current mutex is remembered in a special slot that is also checked by the kernel at thread termination. Kernel must be aware about the per-thread location of the heads of robust mutex lists and the current active mutex slot. When a thread touches a robust mutex for the first time, a new umtx op syscall is issued which informs about location of lists heads. The umtx sleep queues for PP and PI mutexes are split between non-robust and robust. Somewhat unrelated changes in the patch: 1. Style. 2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared pi mutexes. 3. Removal of the userspace struct pthread_mutex m_owner field. 4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls the lifetime of the shared mutex associated with a vnode' page. Reviewed by: jilles (previous version, supposedly the objection was fixed) Discussed with: brooks, Martin Simmons (some aspects) Tested by: pho Sponsored by: The FreeBSD Foundation Added: head/share/man/man3/pthread_mutex_consistent.3 (contents, props changed) Modified: head/include/pthread.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/_pthread_stubs.c head/lib/libc/include/libc_private.h head/lib/libthr/pthread.map head/lib/libthr/thread/thr_cond.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_mutex.c head/lib/libthr/thread/thr_mutexattr.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_umtx.c head/lib/libthr/thread/thr_umtx.h head/share/man/man3/Makefile head/share/man/man3/pthread_cond_wait.3 head/share/man/man3/pthread_mutex_lock.3 head/share/man/man3/pthread_mutex_timedlock.3 head/share/man/man3/pthread_mutex_trylock.3 head/share/man/man3/pthread_mutex_unlock.3 head/share/man/man3/pthread_mutexattr.3 head/sys/compat/cloudabi/cloudabi_thread.c head/sys/compat/linux/linux_fork.c head/sys/kern/kern_exit.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/kern/kern_umtx.c head/sys/sys/_umtx.h head/sys/sys/proc.h head/sys/sys/umtx.h head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vnode_pager.c Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Tue May 17 09:53:22 2016 (r300042) +++ head/include/pthread.h Tue May 17 09:56:22 2016 (r300043) @@ -135,6 +135,9 @@ enum pthread_mutextype { #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK +#define PTHREAD_MUTEX_STALLED 0 +#define PTHREAD_MUTEX_ROBUST 1 + struct _pthread_cleanup_info { __uintptr_t pthread_cleanup_pad[8]; }; @@ -229,6 +232,8 @@ int pthread_mutexattr_settype(pthread_m __nonnull(1); int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int) __nonnull(1); +int pthread_mutex_consistent(pthread_mutex_t *__mutex) + __nonnull(1) __requires_exclusive(*__mutex); int pthread_mutex_destroy(pthread_mutex_t *__mutex) __nonnull(1) __requires_unlocked(*__mutex); int pthread_mutex_init(pthread_mutex_t *__mutex, @@ -310,6 +315,11 @@ int pthread_mutex_setprioceiling(pthrea int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *); int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); +int pthread_mutexattr_getrobust(pthread_mutexattr_t *__restrict, + int *__restrict) __nonnull_all; +int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int) + __nonnull(1); + int pthread_attr_getinheritsched(const pthread_attr_t *, int *); int pthread_attr_getschedparam(const pthread_attr_t *, struct sched_param *) __nonnull_all; Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Tue May 17 09:53:22 2016 (r300042) +++ head/lib/libc/gen/Symbol.map Tue May 17 09:56:22 2016 (r300043) @@ -410,6 +410,9 @@ FBSD_1.3 { }; FBSD_1.4 { + pthread_mutex_consistent; + pthread_mutexattr_getrobust; + pthread_mutexattr_setrobust; scandir_b; }; Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Tue May 17 09:53:22 2016 (r300042) +++ head/lib/libc/gen/_pthread_stubs.c Tue May 17 09:56:22 2016 (r300043) @@ -125,6 +125,9 @@ pthread_func_entry_t __thr_jtable[PJT_MA {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_PUSH_IMP */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_ENTER */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_LEAVE */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_CONSISTENT */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_GETROBUST */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_SETROBUST */ }; /* @@ -226,9 +229,14 @@ STUB_FUNC2(pthread_mutex_init, PJT_MUTEX STUB_FUNC1(pthread_mutex_lock, PJT_MUTEX_LOCK, int, void *) STUB_FUNC1(pthread_mutex_trylock, PJT_MUTEX_TRYLOCK, int, void *) STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) +STUB_FUNC1(pthread_mutex_consistent, PJT_MUTEX_CONSISTENT, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) +STUB_FUNC2(pthread_mutexattr_getrobust, PJT_MUTEXATTR_GETROBUST, int, void *, + int *) +STUB_FUNC2(pthread_mutexattr_setrobust, PJT_MUTEXATTR_SETROBUST, int, void *, + int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init, PJT_RWLOCK_INIT, int, void *, void *) Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Tue May 17 09:53:22 2016 (r300042) +++ head/lib/libc/include/libc_private.h Tue May 17 09:56:22 2016 (r300043) @@ -168,6 +168,9 @@ typedef enum { PJT_CLEANUP_PUSH_IMP, PJT_CANCEL_ENTER, PJT_CANCEL_LEAVE, + PJT_MUTEX_CONSISTENT, + PJT_MUTEXATTR_GETROBUST, + PJT_MUTEXATTR_SETROBUST, PJT_MAX } pjt_index_t; Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Tue May 17 09:53:22 2016 (r300042) +++ head/lib/libthr/pthread.map Tue May 17 09:56:22 2016 (r300043) @@ -315,3 +315,9 @@ FBSD_1.1 { FBSD_1.2 { pthread_getthreadid_np; }; + +FBSD_1.4 { + pthread_mutex_consistent; + pthread_mutexattr_getrobust; + pthread_mutexattr_setrobust; +}; Modified: head/lib/libthr/thread/thr_cond.c ============================================================================== --- head/lib/libthr/thread/thr_cond.c Tue May 17 09:53:22 2016 (r300042) +++ head/lib/libthr/thread/thr_cond.c Tue May 17 09:56:22 2016 (r300043) @@ -188,46 +188,57 @@ _pthread_cond_destroy(pthread_cond_t *co */ static int cond_wait_kernel(struct pthread_cond *cvp, struct pthread_mutex *mp, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, int cancel) { - struct pthread *curthread = _get_curthread(); - int recurse; - int error, error2 = 0; + struct pthread *curthread; + int error, error2, recurse, robust; + + curthread = _get_curthread(); + robust = _mutex_enter_robust(curthread, mp); error = _mutex_cv_detach(mp, &recurse); - if (error != 0) + if (error != 0) { + if (robust) + _mutex_leave_robust(curthread, mp); return (error); + } - if (cancel) { + if (cancel) _thr_cancel_enter2(curthread, 0); - error = _thr_ucond_wait((struct ucond *)&cvp->__has_kern_waiters, - (struct umutex *)&mp->m_lock, abstime, - CVWAIT_ABSTIME|CVWAIT_CLOCKID); + error = _thr_ucond_wait((struct ucond *)&cvp->__has_kern_waiters, + (struct umutex *)&mp->m_lock, abstime, CVWAIT_ABSTIME | + CVWAIT_CLOCKID); + if (cancel) _thr_cancel_leave(curthread, 0); - } else { - error = _thr_ucond_wait((struct ucond *)&cvp->__has_kern_waiters, - (struct umutex *)&mp->m_lock, abstime, - CVWAIT_ABSTIME|CVWAIT_CLOCKID); - } /* * Note that PP mutex and ROBUST mutex may return * interesting error codes. */ if (error == 0) { - error2 = _mutex_cv_lock(mp, recurse); + error2 = _mutex_cv_lock(mp, recurse, true); } else if (error == EINTR || error == ETIMEDOUT) { - error2 = _mutex_cv_lock(mp, recurse); + error2 = _mutex_cv_lock(mp, recurse, true); + /* + * Do not do cancellation on EOWNERDEAD there. The + * cancellation cleanup handler will use the protected + * state and unlock the mutex without making the state + * consistent and the state will be unrecoverable. + */ if (error2 == 0 && cancel) _thr_testcancel(curthread); + if (error == EINTR) error = 0; } else { /* We know that it didn't unlock the mutex. */ - error2 = _mutex_cv_attach(mp, recurse); - if (error2 == 0 && cancel) + _mutex_cv_attach(mp, recurse); + if (cancel) _thr_testcancel(curthread); + error2 = 0; } + if (robust) + _mutex_leave_robust(curthread, mp); return (error2 != 0 ? error2 : error); } @@ -240,14 +251,13 @@ cond_wait_kernel(struct pthread_cond *cv static int cond_wait_user(struct pthread_cond *cvp, struct pthread_mutex *mp, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, int cancel) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; struct sleepqueue *sq; - int recurse; - int error; - int defered; + int deferred, error, error2, recurse; + curthread = _get_curthread(); if (curthread->wchan != NULL) PANIC("thread was already on queue."); @@ -260,32 +270,31 @@ cond_wait_user(struct pthread_cond *cvp, * us to check it without locking in pthread_cond_signal(). */ cvp->__has_user_waiters = 1; - defered = 0; - (void)_mutex_cv_unlock(mp, &recurse, &defered); + deferred = 0; + (void)_mutex_cv_unlock(mp, &recurse, &deferred); curthread->mutex_obj = mp; _sleepq_add(cvp, curthread); for(;;) { _thr_clear_wake(curthread); _sleepq_unlock(cvp); - if (defered) { - defered = 0; + if (deferred) { + deferred = 0; if ((mp->m_lock.m_owner & UMUTEX_CONTESTED) == 0) - (void)_umtx_op_err(&mp->m_lock, UMTX_OP_MUTEX_WAKE2, - mp->m_lock.m_flags, 0, 0); + (void)_umtx_op_err(&mp->m_lock, + UMTX_OP_MUTEX_WAKE2, mp->m_lock.m_flags, + 0, 0); } if (curthread->nwaiter_defer > 0) { _thr_wake_all(curthread->defer_waiters, - curthread->nwaiter_defer); + curthread->nwaiter_defer); curthread->nwaiter_defer = 0; } - if (cancel) { + if (cancel) _thr_cancel_enter2(curthread, 0); - error = _thr_sleep(curthread, cvp->__clock_id, abstime); + error = _thr_sleep(curthread, cvp->__clock_id, abstime); + if (cancel) _thr_cancel_leave(curthread, 0); - } else { - error = _thr_sleep(curthread, cvp->__clock_id, abstime); - } _sleepq_lock(cvp); if (curthread->wchan == NULL) { @@ -293,25 +302,26 @@ cond_wait_user(struct pthread_cond *cvp, break; } else if (cancel && SHOULD_CANCEL(curthread)) { sq = _sleepq_lookup(cvp); - cvp->__has_user_waiters = - _sleepq_remove(sq, curthread); + cvp->__has_user_waiters = _sleepq_remove(sq, curthread); _sleepq_unlock(cvp); curthread->mutex_obj = NULL; - _mutex_cv_lock(mp, recurse); + error2 = _mutex_cv_lock(mp, recurse, false); if (!THR_IN_CRITICAL(curthread)) _pthread_exit(PTHREAD_CANCELED); else /* this should not happen */ - return (0); + return (error2); } else if (error == ETIMEDOUT) { sq = _sleepq_lookup(cvp); cvp->__has_user_waiters = - _sleepq_remove(sq, curthread); + _sleepq_remove(sq, curthread); break; } } _sleepq_unlock(cvp); curthread->mutex_obj = NULL; - _mutex_cv_lock(mp, recurse); + error2 = _mutex_cv_lock(mp, recurse, false); + if (error == 0) + error = error2; return (error); } @@ -338,12 +348,12 @@ cond_wait_common(pthread_cond_t *cond, p return (error); if (curthread->attr.sched_policy != SCHED_OTHER || - (mp->m_lock.m_flags & (UMUTEX_PRIO_PROTECT|UMUTEX_PRIO_INHERIT| - USYNC_PROCESS_SHARED)) != 0 || + (mp->m_lock.m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT | + USYNC_PROCESS_SHARED)) != 0 || (cvp->__flags & USYNC_PROCESS_SHARED) != 0) - return cond_wait_kernel(cvp, mp, abstime, cancel); + return (cond_wait_kernel(cvp, mp, abstime, cancel)); else - return cond_wait_user(cvp, mp, abstime, cancel); + return (cond_wait_user(cvp, mp, abstime, cancel)); } int @@ -420,15 +430,15 @@ cond_signal_common(pthread_cond_t *cond) td = _sleepq_first(sq); mp = td->mutex_obj; cvp->__has_user_waiters = _sleepq_remove(sq, td); - if (mp->m_owner == TID(curthread)) { + if (PMUTEX_OWNER_ID(mp) == TID(curthread)) { if (curthread->nwaiter_defer >= MAX_DEFER_WAITERS) { _thr_wake_all(curthread->defer_waiters, - curthread->nwaiter_defer); + curthread->nwaiter_defer); curthread->nwaiter_defer = 0; } curthread->defer_waiters[curthread->nwaiter_defer++] = - &td->wake_addr->value; - mp->m_flags |= PMUTEX_FLAG_DEFERED; + &td->wake_addr->value; + mp->m_flags |= PMUTEX_FLAG_DEFERRED; } else { waddr = &td->wake_addr->value; } @@ -452,15 +462,15 @@ drop_cb(struct pthread *td, void *arg) struct pthread *curthread = ba->curthread; mp = td->mutex_obj; - if (mp->m_owner == TID(curthread)) { + if (PMUTEX_OWNER_ID(mp) == TID(curthread)) { if (curthread->nwaiter_defer >= MAX_DEFER_WAITERS) { _thr_wake_all(curthread->defer_waiters, - curthread->nwaiter_defer); + curthread->nwaiter_defer); curthread->nwaiter_defer = 0; } curthread->defer_waiters[curthread->nwaiter_defer++] = - &td->wake_addr->value; - mp->m_flags |= PMUTEX_FLAG_DEFERED; + &td->wake_addr->value; + mp->m_flags |= PMUTEX_FLAG_DEFERRED; } else { if (ba->count >= MAX_DEFER_WAITERS) { _thr_wake_all(ba->waddrs, ba->count); Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Tue May 17 09:53:22 2016 (r300042) +++ head/lib/libthr/thread/thr_init.c Tue May 17 09:56:22 2016 (r300043) @@ -94,6 +94,7 @@ struct pthread_mutex_attr _pthread_mutex .m_protocol = PTHREAD_PRIO_NONE, .m_ceiling = 0, .m_pshared = PTHREAD_PROCESS_PRIVATE, + .m_robust = PTHREAD_MUTEX_STALLED, }; struct pthread_mutex_attr _pthread_mutexattr_adaptive_default = { @@ -101,6 +102,7 @@ struct pthread_mutex_attr _pthread_mutex .m_protocol = PTHREAD_PRIO_NONE, .m_ceiling = 0, .m_pshared = PTHREAD_PROCESS_PRIVATE, + .m_robust = PTHREAD_MUTEX_STALLED, }; /* Default condition variable attributes: */ @@ -265,7 +267,10 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(__pthread_cleanup_pop_imp)},/* PJT_CLEANUP_POP_IMP */ {DUAL_ENTRY(__pthread_cleanup_push_imp)},/* PJT_CLEANUP_PUSH_IMP */ {DUAL_ENTRY(_pthread_cancel_enter)}, /* PJT_CANCEL_ENTER */ - {DUAL_ENTRY(_pthread_cancel_leave)} /* PJT_CANCEL_LEAVE */ + {DUAL_ENTRY(_pthread_cancel_leave)}, /* PJT_CANCEL_LEAVE */ + {DUAL_ENTRY(_pthread_mutex_consistent)},/* PJT_MUTEX_CONSISTENT */ + {DUAL_ENTRY(_pthread_mutexattr_getrobust)},/* PJT_MUTEXATTR_GETROBUST */ + {DUAL_ENTRY(_pthread_mutexattr_setrobust)},/* PJT_MUTEXATTR_SETROBUST */ }; static int init_once = 0; @@ -308,7 +313,7 @@ _libpthread_init(struct pthread *curthre int first, dlopened; /* Check if this function has already been called: */ - if ((_thr_initial != NULL) && (curthread == NULL)) + if (_thr_initial != NULL && curthread == NULL) /* Only initialize the threaded application once. */ return; @@ -316,7 +321,7 @@ _libpthread_init(struct pthread *curthre * Check the size of the jump table to make sure it is preset * with the correct number of entries. */ - if (sizeof(jmp_table) != (sizeof(pthread_func_t) * PJT_MAX * 2)) + if (sizeof(jmp_table) != sizeof(pthread_func_t) * PJT_MAX * 2) PANIC("Thread jump table not properly initialized"); memcpy(__thr_jtable, jmp_table, sizeof(jmp_table)); __thr_interpose_libc(); Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Tue May 17 09:53:22 2016 (r300042) +++ head/lib/libthr/thread/thr_mutex.c Tue May 17 09:56:22 2016 (r300043) @@ -1,7 +1,7 @@ /* * Copyright (c) 1995 John Birrell . * Copyright (c) 2006 David Xu . - * Copyright (c) 2015 The FreeBSD Foundation + * Copyright (c) 2015, 2016 The FreeBSD Foundation * * All rights reserved. * @@ -39,7 +39,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include "namespace.h" #include #include @@ -64,6 +63,7 @@ _Static_assert(sizeof(struct pthread_mut /* * Prototypes */ +int __pthread_mutex_consistent(pthread_mutex_t *mutex); int __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutex_attr); int __pthread_mutex_trylock(pthread_mutex_t *mutex); @@ -82,9 +82,13 @@ int __pthread_mutex_setyieldloops_np(pth static int mutex_self_trylock(pthread_mutex_t); static int mutex_self_lock(pthread_mutex_t, const struct timespec *abstime); -static int mutex_unlock_common(struct pthread_mutex *, int, int *); +static int mutex_unlock_common(struct pthread_mutex *, bool, int *); static int mutex_lock_sleep(struct pthread *, pthread_mutex_t, const struct timespec *); +static void mutex_init_robust(struct pthread *curthread); +static int mutex_qidx(struct pthread_mutex *m); +static bool is_robust_mutex(struct pthread_mutex *m); +static bool is_pshared_mutex(struct pthread_mutex *m); __weak_reference(__pthread_mutex_init, pthread_mutex_init); __strong_reference(__pthread_mutex_init, _pthread_mutex_init); @@ -94,6 +98,8 @@ __weak_reference(__pthread_mutex_timedlo __strong_reference(__pthread_mutex_timedlock, _pthread_mutex_timedlock); __weak_reference(__pthread_mutex_trylock, pthread_mutex_trylock); __strong_reference(__pthread_mutex_trylock, _pthread_mutex_trylock); +__weak_reference(_pthread_mutex_consistent, pthread_mutex_consistent); +__strong_reference(_pthread_mutex_consistent, __pthread_mutex_consistent); /* Single underscore versions provided for libc internal usage: */ /* No difference between libc and application usage of these: */ @@ -125,23 +131,23 @@ mutex_init_link(struct pthread_mutex *m) } static void -mutex_assert_is_owned(struct pthread_mutex *m) +mutex_assert_is_owned(struct pthread_mutex *m __unused) { #if defined(_PTHREADS_INVARIANTS) if (__predict_false(m->m_qe.tqe_prev == NULL)) { char msg[128]; snprintf(msg, sizeof(msg), - "mutex %p own %#x %#x is not on list %p %p", - m, m->m_lock.m_owner, m->m_owner, m->m_qe.tqe_prev, - m->m_qe.tqe_next); + "mutex %p own %#x is not on list %p %p", + m, m->m_lock.m_owner, m->m_qe.tqe_prev, m->m_qe.tqe_next); PANIC(msg); } #endif } static void -mutex_assert_not_owned(struct pthread_mutex *m) +mutex_assert_not_owned(struct pthread *curthread __unused, + struct pthread_mutex *m __unused) { #if defined(_PTHREADS_INVARIANTS) @@ -149,21 +155,68 @@ mutex_assert_not_owned(struct pthread_mu m->m_qe.tqe_next != NULL)) { char msg[128]; snprintf(msg, sizeof(msg), - "mutex %p own %#x %#x is on list %p %p", - m, m->m_lock.m_owner, m->m_owner, m->m_qe.tqe_prev, - m->m_qe.tqe_next); + "mutex %p own %#x is on list %p %p", + m, m->m_lock.m_owner, m->m_qe.tqe_prev, m->m_qe.tqe_next); + PANIC(msg); + } + if (__predict_false(is_robust_mutex(m) && + (m->m_lock.m_rb_lnk != 0 || m->m_rb_prev != NULL || + (is_pshared_mutex(m) && curthread->robust_list == + (uintptr_t)&m->m_lock) || + (!is_pshared_mutex(m) && curthread->priv_robust_list == + (uintptr_t)&m->m_lock)))) { + char msg[128]; + snprintf(msg, sizeof(msg), + "mutex %p own %#x is on robust linkage %p %p head %p phead %p", + m, m->m_lock.m_owner, (void *)m->m_lock.m_rb_lnk, + m->m_rb_prev, (void *)curthread->robust_list, + (void *)curthread->priv_robust_list); PANIC(msg); } #endif } -static int +static bool is_pshared_mutex(struct pthread_mutex *m) { return ((m->m_lock.m_flags & USYNC_PROCESS_SHARED) != 0); } +static bool +is_robust_mutex(struct pthread_mutex *m) +{ + + return ((m->m_lock.m_flags & UMUTEX_ROBUST) != 0); +} + +int +_mutex_enter_robust(struct pthread *curthread, struct pthread_mutex *m) +{ + +#if defined(_PTHREADS_INVARIANTS) + if (__predict_false(curthread->inact_mtx != 0)) + PANIC("inact_mtx enter"); +#endif + if (!is_robust_mutex(m)) + return (0); + + mutex_init_robust(curthread); + curthread->inact_mtx = (uintptr_t)&m->m_lock; + return (1); +} + +void +_mutex_leave_robust(struct pthread *curthread, struct pthread_mutex *m __unused) +{ + +#if defined(_PTHREADS_INVARIANTS) + if (__predict_false(curthread->inact_mtx != (uintptr_t)&m->m_lock)) + PANIC("inact_mtx leave"); +#endif + curthread->inact_mtx = 0; +} + static int mutex_check_attr(const struct pthread_mutex_attr *attr) { @@ -178,12 +231,27 @@ mutex_check_attr(const struct pthread_mu } static void +mutex_init_robust(struct pthread *curthread) +{ + struct umtx_robust_lists_params rb; + + if (curthread == NULL) + curthread = _get_curthread(); + if (curthread->robust_inited) + return; + rb.robust_list_offset = (uintptr_t)&curthread->robust_list; + rb.robust_priv_list_offset = (uintptr_t)&curthread->priv_robust_list; + rb.robust_inact_offset = (uintptr_t)&curthread->inact_mtx; + _umtx_op(NULL, UMTX_OP_ROBUST_LISTS, sizeof(rb), &rb, NULL); + curthread->robust_inited = 1; +} + +static void mutex_init_body(struct pthread_mutex *pmutex, const struct pthread_mutex_attr *attr) { pmutex->m_flags = attr->m_type; - pmutex->m_owner = 0; pmutex->m_count = 0; pmutex->m_spinloops = 0; pmutex->m_yieldloops = 0; @@ -205,7 +273,10 @@ mutex_init_body(struct pthread_mutex *pm } if (attr->m_pshared == PTHREAD_PROCESS_SHARED) pmutex->m_lock.m_flags |= USYNC_PROCESS_SHARED; - + if (attr->m_robust == PTHREAD_MUTEX_ROBUST) { + mutex_init_robust(NULL); + pmutex->m_lock.m_flags |= UMUTEX_ROBUST; + } if (PMUTEX_TYPE(pmutex->m_flags) == PTHREAD_MUTEX_ADAPTIVE_NP) { pmutex->m_spinloops = _thr_spinloops ? _thr_spinloops: MUTEX_ADAPTIVE_SPINS; @@ -262,7 +333,7 @@ set_inherited_priority(struct pthread *c { struct pthread_mutex *m2; - m2 = TAILQ_LAST(&curthread->mq[TMQ_NORM_PP], mutex_queue); + m2 = TAILQ_LAST(&curthread->mq[mutex_qidx(m)], mutex_queue); if (m2 != NULL) m->m_lock.m_ceilings[1] = m2->m_lock.m_ceilings[0]; else @@ -277,7 +348,8 @@ shared_mutex_init(struct pthread_mutex * .m_type = PTHREAD_MUTEX_DEFAULT, .m_protocol = PTHREAD_PRIO_NONE, .m_ceiling = 0, - .m_pshared = PTHREAD_PROCESS_SHARED + .m_pshared = PTHREAD_PROCESS_SHARED, + .m_robust = PTHREAD_MUTEX_STALLED, }; bool done; @@ -329,7 +401,7 @@ __pthread_mutex_init(pthread_mutex_t *mu if (mutex_attr == NULL || (*mutex_attr)->m_pshared == PTHREAD_PROCESS_PRIVATE) { return (mutex_init(mutex, mutex_attr ? *mutex_attr : NULL, - calloc)); + calloc)); } pmtx = __thr_pshared_offpage(mutex, 1); if (pmtx == NULL) @@ -349,6 +421,7 @@ _pthread_mutex_init_calloc_cb(pthread_mu .m_protocol = PTHREAD_PRIO_NONE, .m_ceiling = 0, .m_pshared = PTHREAD_PROCESS_PRIVATE, + .m_robust = PTHREAD_MUTEX_STALLED, }; int ret; @@ -378,7 +451,6 @@ queue_fork(struct pthread *curthread, st TAILQ_FOREACH(m, qp, m_pqe) { TAILQ_INSERT_TAIL(q, m, m_qe); m->m_lock.m_owner = TID(curthread) | bit; - m->m_owner = TID(curthread); } } @@ -390,6 +462,9 @@ _mutex_fork(struct pthread *curthread) &curthread->mq[TMQ_NORM_PRIV], 0); queue_fork(curthread, &curthread->mq[TMQ_NORM_PP], &curthread->mq[TMQ_NORM_PP_PRIV], UMUTEX_CONTESTED); + queue_fork(curthread, &curthread->mq[TMQ_ROBUST_PP], + &curthread->mq[TMQ_ROBUST_PP_PRIV], UMUTEX_CONTESTED); + curthread->robust_list = 0; } int @@ -407,17 +482,18 @@ _pthread_mutex_destroy(pthread_mutex_t * if (m == THR_PSHARED_PTR) { m1 = __thr_pshared_offpage(mutex, 0); if (m1 != NULL) { - mutex_assert_not_owned(m1); + mutex_assert_not_owned(_get_curthread(), m1); __thr_pshared_destroy(mutex); } *mutex = THR_MUTEX_DESTROYED; return (0); } - if (m->m_owner != 0) { + if (PMUTEX_OWNER_ID(m) != 0 && + (uint32_t)m->m_lock.m_owner != UMUTEX_RB_NOTRECOV) { ret = EBUSY; } else { *mutex = THR_MUTEX_DESTROYED; - mutex_assert_not_owned(m); + mutex_assert_not_owned(_get_curthread(), m); free(m); ret = 0; } @@ -432,31 +508,81 @@ mutex_qidx(struct pthread_mutex *m) if ((m->m_lock.m_flags & UMUTEX_PRIO_PROTECT) == 0) return (TMQ_NORM); - return (TMQ_NORM_PP); + return (is_robust_mutex(m) ? TMQ_ROBUST_PP : TMQ_NORM_PP); } +/* + * Both enqueue_mutex() and dequeue_mutex() operate on the + * thread-private linkage of the locked mutexes and on the robust + * linkage. + * + * Robust list, as seen by kernel, must be consistent even in the case + * of thread termination at arbitrary moment. Since either enqueue or + * dequeue for list walked by kernel consists of rewriting a single + * forward pointer, it is safe. On the other hand, rewrite of the + * back pointer is not atomic WRT the forward one, but kernel does not + * care. + */ static void -enqueue_mutex(struct pthread *curthread, struct pthread_mutex *m) +enqueue_mutex(struct pthread *curthread, struct pthread_mutex *m, + int error) { + struct pthread_mutex *m1; + uintptr_t *rl; int qidx; - m->m_owner = TID(curthread); /* Add to the list of owned mutexes: */ - mutex_assert_not_owned(m); + if (error != EOWNERDEAD) + mutex_assert_not_owned(curthread, m); qidx = mutex_qidx(m); TAILQ_INSERT_TAIL(&curthread->mq[qidx], m, m_qe); if (!is_pshared_mutex(m)) TAILQ_INSERT_TAIL(&curthread->mq[qidx + 1], m, m_pqe); + if (is_robust_mutex(m)) { + rl = is_pshared_mutex(m) ? &curthread->robust_list : + &curthread->priv_robust_list; + m->m_rb_prev = NULL; + if (*rl != 0) { + m1 = __containerof((void *)*rl, + struct pthread_mutex, m_lock); + m->m_lock.m_rb_lnk = (uintptr_t)&m1->m_lock; + m1->m_rb_prev = m; + } else { + m1 = NULL; + m->m_lock.m_rb_lnk = 0; + } + *rl = (uintptr_t)&m->m_lock; + } } static void dequeue_mutex(struct pthread *curthread, struct pthread_mutex *m) { + struct pthread_mutex *mp, *mn; int qidx; - m->m_owner = 0; mutex_assert_is_owned(m); qidx = mutex_qidx(m); + if (is_robust_mutex(m)) { + mp = m->m_rb_prev; + if (mp == NULL) { + if (is_pshared_mutex(m)) { + curthread->robust_list = m->m_lock.m_rb_lnk; + } else { + curthread->priv_robust_list = + m->m_lock.m_rb_lnk; + } + } else { + mp->m_lock.m_rb_lnk = m->m_lock.m_rb_lnk; + } + if (m->m_lock.m_rb_lnk != 0) { + mn = __containerof((void *)m->m_lock.m_rb_lnk, + struct pthread_mutex, m_lock); + mn->m_rb_prev = m->m_rb_prev; + } + m->m_lock.m_rb_lnk = 0; + m->m_rb_prev = NULL; + } TAILQ_REMOVE(&curthread->mq[qidx], m, m_qe); if (!is_pshared_mutex(m)) TAILQ_REMOVE(&curthread->mq[qidx + 1], m, m_pqe); @@ -496,7 +622,7 @@ __pthread_mutex_trylock(pthread_mutex_t struct pthread *curthread; struct pthread_mutex *m; uint32_t id; - int ret; + int ret, robust; ret = check_and_init_mutex(mutex, &m); if (ret != 0) @@ -505,27 +631,32 @@ __pthread_mutex_trylock(pthread_mutex_t id = TID(curthread); if (m->m_flags & PMUTEX_FLAG_PRIVATE) THR_CRITICAL_ENTER(curthread); + robust = _mutex_enter_robust(curthread, m); ret = _thr_umutex_trylock(&m->m_lock, id); - if (__predict_true(ret == 0)) { - enqueue_mutex(curthread, m); - } else if (m->m_owner == id) { + if (__predict_true(ret == 0) || ret == EOWNERDEAD) { + enqueue_mutex(curthread, m, ret); + if (ret == EOWNERDEAD) + m->m_lock.m_flags |= UMUTEX_NONCONSISTENT; + } else if (PMUTEX_OWNER_ID(m) == id) { ret = mutex_self_trylock(m); } /* else {} */ - if (ret && (m->m_flags & PMUTEX_FLAG_PRIVATE)) + if (robust) + _mutex_leave_robust(curthread, m); + if ((ret == 0 || ret == EOWNERDEAD) && + (m->m_flags & PMUTEX_FLAG_PRIVATE) != 0) THR_CRITICAL_LEAVE(curthread); return (ret); } static int mutex_lock_sleep(struct pthread *curthread, struct pthread_mutex *m, - const struct timespec *abstime) + const struct timespec *abstime) { - uint32_t id, owner; - int count; - int ret; + uint32_t id, owner; + int count, ret; id = TID(curthread); - if (m->m_owner == id) + if (PMUTEX_OWNER_ID(m) == id) return (mutex_self_lock(m, abstime)); /* @@ -534,10 +665,9 @@ mutex_lock_sleep(struct pthread *curthre * the lock is likely to be released quickly and it is * faster than entering the kernel */ - if (__predict_false( - (m->m_lock.m_flags & - (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) != 0)) - goto sleep_in_kernel; + if (__predict_false((m->m_lock.m_flags & (UMUTEX_PRIO_PROTECT | + UMUTEX_PRIO_INHERIT | UMUTEX_ROBUST | UMUTEX_NONCONSISTENT)) != 0)) + goto sleep_in_kernel; if (!_thr_is_smp) goto yield_loop; @@ -546,7 +676,8 @@ mutex_lock_sleep(struct pthread *curthre while (count--) { owner = m->m_lock.m_owner; if ((owner & ~UMUTEX_CONTESTED) == 0) { - if (atomic_cmpset_acq_32(&m->m_lock.m_owner, owner, id|owner)) { + if (atomic_cmpset_acq_32(&m->m_lock.m_owner, owner, + id | owner)) { ret = 0; goto done; } @@ -560,7 +691,8 @@ yield_loop: _sched_yield(); owner = m->m_lock.m_owner; if ((owner & ~UMUTEX_CONTESTED) == 0) { - if (atomic_cmpset_acq_32(&m->m_lock.m_owner, owner, id|owner)) { + if (atomic_cmpset_acq_32(&m->m_lock.m_owner, owner, + id | owner)) { ret = 0; goto done; } @@ -568,38 +700,46 @@ yield_loop: } sleep_in_kernel: - if (abstime == NULL) { + if (abstime == NULL) ret = __thr_umutex_lock(&m->m_lock, id); - } else if (__predict_false( - abstime->tv_nsec < 0 || - abstime->tv_nsec >= 1000000000)) { + else if (__predict_false(abstime->tv_nsec < 0 || + abstime->tv_nsec >= 1000000000)) ret = EINVAL; - } else { + else ret = __thr_umutex_timedlock(&m->m_lock, id, abstime); - } done: - if (ret == 0) - enqueue_mutex(curthread, m); - + if (ret == 0 || ret == EOWNERDEAD) { + enqueue_mutex(curthread, m, ret); + if (ret == EOWNERDEAD) + m->m_lock.m_flags |= UMUTEX_NONCONSISTENT; + } return (ret); } static inline int -mutex_lock_common(struct pthread_mutex *m, - const struct timespec *abstime, int cvattach) +mutex_lock_common(struct pthread_mutex *m, const struct timespec *abstime, + bool cvattach, bool rb_onlist) { - struct pthread *curthread = _get_curthread(); - int ret; + struct pthread *curthread; + int ret, robust; + curthread = _get_curthread(); if (!cvattach && m->m_flags & PMUTEX_FLAG_PRIVATE) THR_CRITICAL_ENTER(curthread); - if (_thr_umutex_trylock2(&m->m_lock, TID(curthread)) == 0) { - enqueue_mutex(curthread, m); - ret = 0; + if (!rb_onlist) + robust = _mutex_enter_robust(curthread, m); + ret = _thr_umutex_trylock2(&m->m_lock, TID(curthread)); + if (ret == 0 || ret == EOWNERDEAD) { + enqueue_mutex(curthread, m, ret); + if (ret == EOWNERDEAD) + m->m_lock.m_flags |= UMUTEX_NONCONSISTENT; } else { ret = mutex_lock_sleep(curthread, m, abstime); } - if (ret && (m->m_flags & PMUTEX_FLAG_PRIVATE) && !cvattach) + if (!rb_onlist && robust) + _mutex_leave_robust(curthread, m); + if (ret != 0 && ret != EOWNERDEAD && + (m->m_flags & PMUTEX_FLAG_PRIVATE) != 0 && !cvattach) THR_CRITICAL_LEAVE(curthread); return (ret); } @@ -613,7 +753,7 @@ __pthread_mutex_lock(pthread_mutex_t *mu _thr_check_init(); ret = check_and_init_mutex(mutex, &m); if (ret == 0) - ret = mutex_lock_common(m, NULL, 0); + ret = mutex_lock_common(m, NULL, false, false); return (ret); } @@ -627,7 +767,7 @@ __pthread_mutex_timedlock(pthread_mutex_ _thr_check_init(); ret = check_and_init_mutex(mutex, &m); if (ret == 0) - ret = mutex_lock_common(m, abstime, 0); + ret = mutex_lock_common(m, abstime, false, false); return (ret); } @@ -644,16 +784,16 @@ _pthread_mutex_unlock(pthread_mutex_t *m } else { mp = *mutex; } - return (mutex_unlock_common(mp, 0, NULL)); + return (mutex_unlock_common(mp, false, NULL)); } int -_mutex_cv_lock(struct pthread_mutex *m, int count) +_mutex_cv_lock(struct pthread_mutex *m, int count, bool rb_onlist) { - int error; + int error; - error = mutex_lock_common(m, NULL, 1); - if (error == 0) + error = mutex_lock_common(m, NULL, true, rb_onlist); + if (error == 0 || error == EOWNERDEAD) m->m_count = count; return (error); } @@ -667,16 +807,17 @@ _mutex_cv_unlock(struct pthread_mutex *m */ *count = m->m_count; m->m_count = 0; - (void)mutex_unlock_common(m, 1, defer); + (void)mutex_unlock_common(m, true, defer); return (0); } int _mutex_cv_attach(struct pthread_mutex *m, int count) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; - enqueue_mutex(curthread, m); + curthread = _get_curthread(); + enqueue_mutex(curthread, m, 0); m->m_count = count; return (0); } @@ -684,12 +825,12 @@ _mutex_cv_attach(struct pthread_mutex *m int _mutex_cv_detach(struct pthread_mutex *mp, int *recurse) { - struct pthread *curthread = _get_curthread(); - int defered; - int error; + struct pthread *curthread; + int deferred, error; + curthread = _get_curthread(); if ((error = _mutex_owned(curthread, mp)) != 0) - return (error); + return (error); /* * Clear the count in case this is a recursive mutex. @@ -699,15 +840,15 @@ _mutex_cv_detach(struct pthread_mutex *m dequeue_mutex(curthread, mp); /* Will this happen in real-world ? */ - if ((mp->m_flags & PMUTEX_FLAG_DEFERED) != 0) { - defered = 1; - mp->m_flags &= ~PMUTEX_FLAG_DEFERED; + if ((mp->m_flags & PMUTEX_FLAG_DEFERRED) != 0) { + deferred = 1; + mp->m_flags &= ~PMUTEX_FLAG_DEFERRED; } else - defered = 0; + deferred = 0; - if (defered) { + if (deferred) { _thr_wake_all(curthread->defer_waiters, - curthread->nwaiter_defer); + curthread->nwaiter_defer); curthread->nwaiter_defer = 0; } return (0); @@ -716,7 +857,7 @@ _mutex_cv_detach(struct pthread_mutex *m static int mutex_self_trylock(struct pthread_mutex *m) { - int ret; + int ret; switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: @@ -746,7 +887,7 @@ static int mutex_self_lock(struct pthread_mutex *m, const struct timespec *abstime) { struct timespec ts1, ts2; - int ret; + int ret; switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: @@ -812,11 +953,11 @@ mutex_self_lock(struct pthread_mutex *m, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 17 11:10:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75ACAB3F9DF; Tue, 17 May 2016 11:10:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2605A1529; Tue, 17 May 2016 11:10:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HBAjwQ002275; Tue, 17 May 2016 11:10:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HBAiDu002267; Tue, 17 May 2016 11:10:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605171110.u4HBAiDu002267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 May 2016 11:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300044 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 11:10:46 -0000 Author: trasz Date: Tue May 17 11:10:44 2016 New Revision: 300044 URL: https://svnweb.freebsd.org/changeset/base/300044 Log: Add icl_conn_connect() ICL method, required for iSER. Obtained from: Mellanox Technologies (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/icl_conn_if.m head/sys/dev/iscsi/icl_proxy.c head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/icl_wrappers.h head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue May 17 09:56:22 2016 (r300043) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue May 17 11:10:44 2016 (r300044) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue May 17 09:56:22 2016 (r300043) +++ head/sys/dev/iscsi/icl.c Tue May 17 11:10:44 2016 (r300044) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Tue May 17 09:56:22 2016 (r300043) +++ head/sys/dev/iscsi/icl.h Tue May 17 11:10:44 2016 (r300044) @@ -139,12 +139,6 @@ struct sockaddr; struct icl_listen; /* - * Initiator part. - */ -int icl_conn_connect(struct icl_conn *ic, bool rdma, - int domain, int socktype, int protocol, - struct sockaddr *from_sa, struct sockaddr *to_sa); -/* * Target part. */ struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *, @@ -156,9 +150,11 @@ int icl_listen_add(struct icl_listen * int icl_listen_remove(struct icl_listen *il, struct sockaddr *sa); /* - * This one is not a public API; only to be used by icl_proxy.c. + * Those two are not a public API; only to be used between icl_soft.c and icl_proxy.c. */ -int icl_conn_handoff_sock(struct icl_conn *ic, struct socket *so); - +int icl_soft_handoff_sock(struct icl_conn *ic, struct socket *so); +int icl_soft_proxy_connect(struct icl_conn *ic, int domain, + int socktype, int protocol, struct sockaddr *from_sa, + struct sockaddr *to_sa); #endif /* ICL_KERNEL_PROXY */ #endif /* !ICL_H */ Modified: head/sys/dev/iscsi/icl_conn_if.m ============================================================================== --- head/sys/dev/iscsi/icl_conn_if.m Tue May 17 09:56:22 2016 (r300043) +++ head/sys/dev/iscsi/icl_conn_if.m Tue May 17 11:10:44 2016 (r300044) @@ -29,6 +29,7 @@ # $FreeBSD$ # +#include #include INTERFACE icl_conn; @@ -106,3 +107,15 @@ METHOD void transfer_done { struct icl_conn *_ic; void *_prv; }; + +# +# The function below is only used with ICL_KERNEL_PROXY. +# +METHOD int connect { + struct icl_conn *_ic; + int _domain; + int _socktype; + int _protocol; + struct sockaddr *_from_sa; + struct sockaddr *_to_sa; +}; Modified: head/sys/dev/iscsi/icl_proxy.c ============================================================================== --- head/sys/dev/iscsi/icl_proxy.c Tue May 17 09:56:22 2016 (r300043) +++ head/sys/dev/iscsi/icl_proxy.c Tue May 17 11:10:44 2016 (r300044) @@ -105,8 +105,8 @@ struct icl_listen { static MALLOC_DEFINE(M_ICL_PROXY, "ICL_PROXY", "iSCSI common layer proxy"); -static int -icl_conn_connect_tcp(struct icl_conn *ic, int domain, int socktype, +int +icl_soft_proxy_connect(struct icl_conn *ic, int domain, int socktype, int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa) { struct socket *so; @@ -153,26 +153,13 @@ icl_conn_connect_tcp(struct icl_conn *ic return (error); } - error = icl_conn_handoff_sock(ic, so); + error = icl_soft_handoff_sock(ic, so); if (error != 0) soclose(so); return (error); } -int -icl_conn_connect(struct icl_conn *ic, bool rdma, int domain, int socktype, - int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa) -{ - - if (rdma) { - ICL_DEBUG("RDMA not supported"); - return (EOPNOTSUPP); - } - - return (icl_conn_connect_tcp(ic, domain, socktype, protocol, from_sa, to_sa)); -} - struct icl_listen * icl_listen_new(void (*accept_cb)(struct socket *, struct sockaddr *, int)) { Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Tue May 17 09:56:22 2016 (r300043) +++ head/sys/dev/iscsi/icl_soft.c Tue May 17 11:10:44 2016 (r300044) @@ -101,6 +101,9 @@ static icl_conn_task_setup_t icl_soft_co static icl_conn_task_done_t icl_soft_conn_task_done; static icl_conn_transfer_setup_t icl_soft_conn_transfer_setup; static icl_conn_transfer_done_t icl_soft_conn_transfer_done; +#ifdef ICL_KERNEL_PROXY +static icl_conn_connect_t icl_soft_conn_connect; +#endif static kobj_method_t icl_soft_methods[] = { KOBJMETHOD(icl_conn_new_pdu, icl_soft_conn_new_pdu), @@ -117,6 +120,9 @@ static kobj_method_t icl_soft_methods[] KOBJMETHOD(icl_conn_task_done, icl_soft_conn_task_done), KOBJMETHOD(icl_conn_transfer_setup, icl_soft_conn_transfer_setup), KOBJMETHOD(icl_conn_transfer_done, icl_soft_conn_transfer_done), +#ifdef ICL_KERNEL_PROXY + KOBJMETHOD(icl_conn_connect, icl_soft_conn_connect), +#endif { 0, 0 } }; @@ -1460,7 +1466,16 @@ icl_soft_limits(size_t *limitp) #ifdef ICL_KERNEL_PROXY int -icl_conn_handoff_sock(struct icl_conn *ic, struct socket *so) +icl_soft_conn_connect(struct icl_conn *ic, int domain, int socktype, + int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa) +{ + + return (icl_soft_proxy_connect(ic, domain, socktype, protocol, + from_sa, to_sa)); +} + +int +icl_soft_handoff_sock(struct icl_conn *ic, struct socket *so) { int error; Modified: head/sys/dev/iscsi/icl_wrappers.h ============================================================================== --- head/sys/dev/iscsi/icl_wrappers.h Tue May 17 09:56:22 2016 (r300043) +++ head/sys/dev/iscsi/icl_wrappers.h Tue May 17 11:10:44 2016 (r300044) @@ -135,4 +135,16 @@ icl_conn_transfer_done(struct icl_conn * ICL_CONN_TRANSFER_DONE(ic, prv); } +/* + * The function below is only used with ICL_KERNEL_PROXY. + */ +static inline int +icl_conn_connect(struct icl_conn *ic, int domain, int socktype, + int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa) +{ + + return (ICL_CONN_CONNECT(ic, domain, socktype, protocol, + from_sa, to_sa)); +} + #endif /* !ICL_WRAPPERS_H */ Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue May 17 09:56:22 2016 (r300043) +++ head/sys/dev/iscsi/iscsi.c Tue May 17 11:10:44 2016 (r300044) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1559,7 +1560,7 @@ iscsi_ioctl_daemon_connect(struct iscsi_ is->is_timeout = 0; ISCSI_SESSION_UNLOCK(is); - error = icl_conn_connect(is->is_conn, idc->idc_iser, idc->idc_domain, + error = icl_conn_connect(is->is_conn, idc->idc_domain, idc->idc_socktype, idc->idc_protocol, from_sa, to_sa); free(from_sa, M_SONAME); free(to_sa, M_SONAME); From owner-svn-src-all@freebsd.org Tue May 17 11:22:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2556FB3E009; Tue, 17 May 2016 11:22:10 +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 EA716134E; Tue, 17 May 2016 11:22:09 +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 u4HBM9Dh007705; Tue, 17 May 2016 11:22:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HBM9sG007704; Tue, 17 May 2016 11:22:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605171122.u4HBM9sG007704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 17 May 2016 11:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300045 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 11:22:10 -0000 Author: ae Date: Tue May 17 11:22:08 2016 New Revision: 300045 URL: https://svnweb.freebsd.org/changeset/base/300045 Log: Make `ipfw internal olist` output more user friendly. Print object type as string for known types. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue May 17 11:10:44 2016 (r300044) +++ head/sbin/ipfw/ipfw2.c Tue May 17 11:22:08 2016 (r300045) @@ -5131,11 +5131,35 @@ static struct _s_x intcmds[] = { { NULL, 0 } }; +static struct _s_x otypes[] = { + { "EACTION", IPFW_TLV_EACTION }, + { NULL, 0 } +}; + +static const char* +lookup_eaction_name(ipfw_obj_ntlv *ntlv, int cnt, uint16_t type) +{ + const char *name; + int i; + + name = NULL; + for (i = 0; i < cnt; i++) { + if (ntlv[i].head.type != IPFW_TLV_EACTION) + continue; + if (IPFW_TLV_EACTION_NAME(ntlv[i].idx) != type) + continue; + name = ntlv[i].name; + break; + } + return (name); +} + static void ipfw_list_objects(int ac, char *av[]) { ipfw_obj_lheader req, *olh; ipfw_obj_ntlv *ntlv; + const char *name; size_t sz; int i; @@ -5161,8 +5185,17 @@ ipfw_list_objects(int ac, char *av[]) printf("There are no objects\n"); ntlv = (ipfw_obj_ntlv *)(olh + 1); for (i = 0; i < olh->count; i++) { - printf(" kidx: %4d\ttype: %6d\tname: %s\n", ntlv->idx, - ntlv->head.type, ntlv->name); + name = match_value(otypes, ntlv->head.type); + if (name == NULL) + name = lookup_eaction_name( + (ipfw_obj_ntlv *)(olh + 1), olh->count, + ntlv->head.type); + if (name == NULL) + printf(" kidx: %4d\ttype: %10d\tname: %s\n", + ntlv->idx, ntlv->head.type, ntlv->name); + else + printf(" kidx: %4d\ttype: %10s\tname: %s\n", + ntlv->idx, name, ntlv->name); ntlv++; } free(olh); From owner-svn-src-all@freebsd.org Tue May 17 11:59:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A393B3EE0E; Tue, 17 May 2016 11:59:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE941A32; Tue, 17 May 2016 11:59:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HBxcUd017578; Tue, 17 May 2016 11:59:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HBxchG017577; Tue, 17 May 2016 11:59:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605171159.u4HBxchG017577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 May 2016 11:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300046 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 11:59:39 -0000 Author: trasz Date: Tue May 17 11:59:38 2016 New Revision: 300046 URL: https://svnweb.freebsd.org/changeset/base/300046 Log: Make iscsi_ioctl_daemon_send() actually work by adding missing locking. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue May 17 11:22:08 2016 (r300045) +++ head/sys/dev/iscsi/iscsi.c Tue May 17 11:59:38 2016 (r300046) @@ -1620,7 +1620,9 @@ iscsi_ioctl_daemon_send(struct iscsi_sof KASSERT(error == 0, ("icl_pdu_append_data(..., M_WAITOK) failed")); free(data, M_ISCSI); } + ISCSI_SESSION_LOCK(is); icl_pdu_queue(ip); + ISCSI_SESSION_UNLOCK(is); return (0); } From owner-svn-src-all@freebsd.org Tue May 17 12:04:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8795B3F62F; Tue, 17 May 2016 12:04:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B3C11CE; Tue, 17 May 2016 12:04:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HC4dFb020389; Tue, 17 May 2016 12:04:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HC4dKX020388; Tue, 17 May 2016 12:04:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605171204.u4HC4dKX020388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 May 2016 12:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300047 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 12:04:40 -0000 Author: trasz Date: Tue May 17 12:04:39 2016 New Revision: 300047 URL: https://svnweb.freebsd.org/changeset/base/300047 Log: Silence down the "insmntque() failed" autofs error; it happens on shutdown and is perfectly normal. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Tue May 17 11:59:38 2016 (r300046) +++ head/sys/fs/autofs/autofs_vnops.c Tue May 17 12:04:39 2016 (r300047) @@ -686,7 +686,7 @@ autofs_node_vn(struct autofs_node *anp, error = insmntque(vp, mp); if (error != 0) { - AUTOFS_WARN("insmntque() failed with error %d", error); + AUTOFS_DEBUG("insmntque() failed with error %d", error); sx_xunlock(&anp->an_vnode_lock); return (error); } From owner-svn-src-all@freebsd.org Tue May 17 12:19:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59C76B3F934; Tue, 17 May 2016 12:19:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 0DED91A84; Tue, 17 May 2016 12:19:52 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 8C3C6D78FE; Tue, 17 May 2016 12:19:46 +0000 (UTC) Date: Tue, 17 May 2016 13:19:45 +0100 From: Andrew Turner To: Zbigniew Bodek Cc: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299944 - in head/sys: arm64/arm64 conf Message-ID: <20160517131945.65cd9ccc@zapp> In-Reply-To: References: <201605161407.u4GE7h9n002600@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 12:19:53 -0000 On Mon, 16 May 2016 18:08:49 +0200 Zbigniew Bodek wrote: > Hello Andrew, > > I think committing this code should be preceded by at least brief > review. Few remarks to the code found on the first glance below. See below for comments. > > Kind regards > zbb > > 2016-05-16 16:07 GMT+02:00 Andrew Turner : > > > Author: andrew > > Date: Mon May 16 14:07:43 2016 > > New Revision: 299944 > > URL: https://svnweb.freebsd.org/changeset/base/299944 > > > > Log: > > Add intrng support to the GICv3 driver. It lacks ITS support so > > won't handle > > MSI or MSI-X interrupts, however this is enought to boot FreeBSD > > under the > > ARM Foundation Model with a GICv3 interrupt controller. > > > > Approved by: ABT Systems Ltd > > Relnotes: yes > > Sponsored by: The FreeBSD Foundation ... > > +#ifdef INTRNG > > +int > > +arm_gic_v3_intr(void *arg) > > +{ > > + struct gic_v3_softc *sc = arg; > > + struct gic_v3_irqsrc *gi; > > + uint64_t active_irq; > > + struct trapframe *tf; > > + bool first; > > + > > + first = true; > > + > > + while (1) { > > + if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) { > > + /* > > + * Hardware: Cavium ThunderX > > + * Chip revision: Pass 1.0 (early > > version) > > + * Pass 1.1 > > (production) > > + * ERRATUM: 22978, 23154 > > + */ > > + __asm __volatile( > > + "nop;nop;nop;nop;nop;nop;nop;nop; \n" > > + "mrs %0, ICC_IAR1_EL1 \n" > > + "nop;nop;nop;nop; \n" > > + "dsb sy \n" > > + : "=&r" (active_irq)); > > + } else { > > + active_irq = gic_icc_read(IAR1); > > + } > > + > > + if (__predict_false(active_irq >= sc->gic_nirqs)) > > + return (FILTER_HANDLED); > > > > IMHO this is not true. Active IRQ could be much bigger than number of > supported IRQs. We are asking for debugging in the future when we > enable ITS. It is correct, the ITS change to this file is missing so we are unable to enable ITS interrupts. ... > > + > > +#ifdef FDT > > +static int > > +gic_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int > > *irqp, > > + enum intr_polarity *polp, enum intr_trigger *trigp) > > > > All other functions are called gic_v3 and this one is just gic_ > Why can't we move as much FDT code to the dedicated file which is > gic_v3_fdt.c? Unfortunately due to the current code in subr_intr.c this is needed for simplicity. It it my understanding there is work to fix this, so for now I would prefer to keep this. ... > > + /* Set the trigger and polarity */ > > + if (irq <= GIC_LAST_PPI) > > + reg = gic_r_read(sc, 4, > > + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq)); > > + else > > + reg = gic_d_read(sc, 4, GICD_ICFGR(irq)); > > + if (trig == INTR_TRIGGER_LEVEL) > > + reg &= ~(2 << ((irq % 16) * 2)); > > + else > > + reg |= 2 << ((irq % 16) * 2); > > > > The rule of not using magic numbers does not apply here ;-) ? This is partially why this is still disabled by default, the code still needs a little polish, however it will be needed to help with a future review for changes to subr_intr.c. ... > > +static void > > +gic_v3_disable_intr(device_t dev, struct intr_irqsrc *isrc) > > +{ > > + struct gic_v3_softc *sc; > > + struct gic_v3_irqsrc *gi; > > + u_int irq; > > + > > + sc = device_get_softc(dev); > > + gi = (struct gic_v3_irqsrc *)isrc; > > + irq = gi->gi_irq; > > + > > + if (irq <= GIC_LAST_PPI) { > > + /* SGIs and PPIs in corresponding Re-Distributor */ > > + gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + > > GICD_ICENABLER(irq), > > + GICD_I_MASK(irq)); > > + gic_v3_wait_for_rwp(sc, REDIST); > > + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { > > + /* SPIs in distributor */ > > + gic_d_write(sc, 4, GICD_ICENABLER(irq), > > GICD_I_MASK(irq)); > > + gic_v3_wait_for_rwp(sc, DIST); > > > > In gic_v3_setup_intr() we need spin lock and here we don't ? The locking was based on the existing intrng gic driver, I think they are both bogus. ... > > +static void > > +gic_v3_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t > > cpus, > > + u_int ipi) > > > > What exactly is the functional difference between the current > implementation and this one? > Maybe we should exchange an old one to this or the opposite way > instead of having two different implementations? This one only needs to loop through the list of cpus once. In the common case I would expect this to be optimal as FreeBSD cpuids will align with the hardware clusters so a contiguous groups of CPUs will be on a single cluster. The only hardware I know where this isn't the case is the ARM Juno where we boot on hardware CPU 2. > > > > +{ > > + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; > > + uint64_t aff, val, irq; > > + int i; > > + > > +#define GIC_AFF_MASK (CPU_AFF3_MASK | CPU_AFF2_MASK | > > CPU_AFF1_MASK) > > +#define GIC_AFFINITY(i) (CPU_AFFINITY(i) & GIC_AFF_MASK) > > + aff = GIC_AFFINITY(0); > > + irq = gi->gi_irq; > > + val = 0; > > + > > + /* Iterate through all CPUs in set */ > > + for (i = 0; i < mp_ncpus; i++) { > > + /* Move to the next affinity group */ > > + if (aff != GIC_AFFINITY(i)) { > > + /* Send the IPI */ > > + if (val != 0) { > > + gic_icc_write(SGI1R, val); > > + val = 0; > > + } > > + aff = GIC_AFFINITY(i); > > + } > > + > > + /* Send the IPI to this cpu */ > > + if (CPU_ISSET(i, &cpus)) { > > +#define > > ICC_SGI1R_AFFINITY(aff) \ > > + (((uint64_t)CPU_AFF3(aff) << ICC_SGI1R_EL1_AFF3_SHIFT) | \ > > + ((uint64_t)CPU_AFF2(aff) << ICC_SGI1R_EL1_AFF2_SHIFT) | \ > > + ((uint64_t)CPU_AFF1(aff) << ICC_SGI1R_EL1_AFF1_SHIFT)) > > + /* Set the affinity when the first at this > > level */ > > + if (val == 0) > > + val = ICC_SGI1R_AFFINITY(aff) | > > + irq << > > ICC_SGI1R_EL1_SGIID_SHIFT; > > + /* Set the bit to send the IPI to te CPU */ > > + val |= 1 << CPU_AFF0(CPU_AFFINITY(i)); > > + } > > + } > > + > > + /* Send the IPI to the last cpu affinity group */ > > + if (val != 0) > > + gic_icc_write(SGI1R, val); > > +#undef GIC_AFF_MASK > > +#undef GIC_AFFINITY > > > > Couldn't we just use variables instead of defining and undefinining > those ugly macros here? > It really looks like they are here just to look different than it was > in the previous implementation. What's ugly about them? They never change so I'm unsure why a variable is needed. Andrew From owner-svn-src-all@freebsd.org Tue May 17 12:46:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 485ABB3C1DF; Tue, 17 May 2016 12:46:51 +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 1AB291B96; Tue, 17 May 2016 12:46:51 +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 u4HCkoBF032548; Tue, 17 May 2016 12:46:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HCkoN8032547; Tue, 17 May 2016 12:46:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605171246.u4HCkoN8032547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 17 May 2016 12:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300048 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 12:46:51 -0000 Author: andrew Date: Tue May 17 12:46:50 2016 New Revision: 300048 URL: https://svnweb.freebsd.org/changeset/base/300048 Log: Clean up the GICv3 intrng code: * In gic_v3_attach free the correct data on failure. * Implement gic_v3_teardown_intr. * Update the panic string when enabling/disabling an invalid interrupt. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3.c Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Tue May 17 12:04:39 2016 (r300047) +++ head/sys/arm64/arm64/gic_v3.c Tue May 17 12:46:50 2016 (r300048) @@ -267,7 +267,7 @@ gic_v3_attach(device_t dev) } if (err != 0) { /* XXX call intr_isrc_deregister() */ - free(irqs, M_DEVBUF); + free(sc->gic_irqs, M_DEVBUF); return (err); } } @@ -611,8 +611,14 @@ static int gic_v3_teardown_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + + if (isrc->isrc_handlers == 0) { + gi->gi_pol = INTR_POLARITY_CONFORM; + gi->gi_trig = INTR_TRIGGER_CONFORM; + } - panic("gic_v3_teardown_intr"); + return (0); } static void @@ -636,7 +642,7 @@ gic_v3_disable_intr(device_t dev, struct gic_d_write(sc, 4, GICD_ICENABLER(irq), GICD_I_MASK(irq)); gic_v3_wait_for_rwp(sc, DIST); } else - panic("gic_v3_disable_intr"); + panic("%s: Unsupported IRQ %u", __func__, irq); } static void @@ -660,7 +666,7 @@ gic_v3_enable_intr(device_t dev, struct gic_d_write(sc, 4, GICD_ISENABLER(irq), GICD_I_MASK(irq)); gic_v3_wait_for_rwp(sc, DIST); } else - panic("gic_v3_enable_intr"); + panic("%s: Unsupported IRQ %u", __func__, irq); } static void From owner-svn-src-all@freebsd.org Tue May 17 12:48:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD986B3C26C; Tue, 17 May 2016 12:48:31 +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 7F7851BFA; Tue, 17 May 2016 12:48:31 +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 u4HCmUaR032644; Tue, 17 May 2016 12:48:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HCmUcY032643; Tue, 17 May 2016 12:48:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605171248.u4HCmUcY032643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 17 May 2016 12:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300049 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 12:48:31 -0000 Author: andrew Date: Tue May 17 12:48:30 2016 New Revision: 300049 URL: https://svnweb.freebsd.org/changeset/base/300049 Log: Add an arm64 kernel config to help testing intrng. It is expected this config will only last a few weeks until we switch to this interrupt framework. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Added: head/sys/arm64/conf/GENERIC-INTRNG (contents, props changed) Added: head/sys/arm64/conf/GENERIC-INTRNG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/conf/GENERIC-INTRNG Tue May 17 12:48:30 2016 (r300049) @@ -0,0 +1,15 @@ +# +# GENERIC-INTRNG -- intrng testing kernel for FreeBSD/arm64 +# +# This config adds intrng support for testing, and to ensure intrng is not +# broken before switching to it. The config is expected to be removed soon +# when intrng becomes the default on arm64. +# +# $FreeBSD$ +# + +include GENERIC + +ident GENERIC-INTRNG + +options INTRNG From owner-svn-src-all@freebsd.org Tue May 17 12:52:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BFFFB3C40D; Tue, 17 May 2016 12:52:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7091EC8; Tue, 17 May 2016 12:52:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HCqZ05035460; Tue, 17 May 2016 12:52:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HCqVeM035419; Tue, 17 May 2016 12:52:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201605171252.u4HCqVeM035419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 17 May 2016 12:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300050 - in head: share/doc/usd/07.mail share/man/man9 sys/amd64/vmm/io sys/arm/allwinner sys/arm/freescale/imx sys/arm/include sys/cam sys/dev/bhnd sys/dev/bxe sys/dev/drm2/i915 sys/d... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 12:52:36 -0000 Author: eadler Date: Tue May 17 12:52:31 2016 New Revision: 300050 URL: https://svnweb.freebsd.org/changeset/base/300050 Log: Don't repeat the the word 'the' (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix) Modified: head/share/doc/usd/07.mail/mail6.nr head/share/man/man9/BUS_GET_CPUS.9 head/sys/amd64/vmm/io/vhpet.c head/sys/arm/allwinner/a10_ahci.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/arm/include/asm.h head/sys/cam/cam_periph.c head/sys/dev/bhnd/bhnd.c head/sys/dev/bxe/ecore_hsi.h head/sys/dev/drm2/i915/intel_crt.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/radeon/atombios.h head/sys/dev/drm2/radeon/r300_reg.h head/sys/dev/drm2/radeon/radeon_device.c head/sys/dev/drm2/radeon/radeon_fence.c head/sys/dev/drm2/radeon/radeon_gart.c head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/iwm/if_iwmreg.h head/sys/dev/netmap/netmap.c head/sys/dev/ow/ow.c head/sys/dev/pms/RefTisa/sallsdk/spc/mpi.c head/sys/dev/pms/RefTisa/sat/src/smsat.c head/sys/dev/pms/RefTisa/tisa/sassata/sata/host/sat.c head/sys/dev/random/fortuna.c head/sys/dev/sfxge/common/ef10_ev.c head/sys/mips/conf/DIR-825C1.hints head/sys/net/altq/altq_cbq.c head/sys/ofed/drivers/infiniband/debug/memtrack.c head/sys/ofed/drivers/infiniband/debug/memtrack.h head/sys/ofed/drivers/net/mlx4/main.c head/sys/xen/interface/io/blkif.h head/usr.bin/numactl/numactl.1 head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/pciconf/pciconf.8 Modified: head/share/doc/usd/07.mail/mail6.nr ============================================================================== --- head/share/doc/usd/07.mail/mail6.nr Tue May 17 12:48:30 2016 (r300049) +++ head/share/doc/usd/07.mail/mail6.nr Tue May 17 12:52:31 2016 (r300050) @@ -75,7 +75,7 @@ is a shorthand way of doing Use the .b \-v flag when invoking sendmail. This feature may also be enabled -by setting the the option "verbose". +by setting the option "verbose". .pp The following command line flags are also recognized, but are intended for use by programs invoking Modified: head/share/man/man9/BUS_GET_CPUS.9 ============================================================================== --- head/share/man/man9/BUS_GET_CPUS.9 Tue May 17 12:48:30 2016 (r300049) +++ head/share/man/man9/BUS_GET_CPUS.9 Tue May 17 12:52:31 2016 (r300050) @@ -62,7 +62,7 @@ argument specifies the size in bytes of .Fa cpuset . .Pp .Fn BUS_GET_CPUS -supports querying different types of CPU sets via the the +supports querying different types of CPU sets via the .Fa op argument. Not all set types are supported for every device. If a set type is not supported, Modified: head/sys/amd64/vmm/io/vhpet.c ============================================================================== --- head/sys/amd64/vmm/io/vhpet.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/amd64/vmm/io/vhpet.c Tue May 17 12:52:31 2016 (r300050) @@ -163,7 +163,7 @@ vhpet_counter(struct vhpet *vhpet, sbint /* * The sbinuptime corresponding to the 'countbase' is * meaningless when the counter is disabled. Make sure - * that the the caller doesn't want to use it. + * that the caller doesn't want to use it. */ KASSERT(nowptr == NULL, ("vhpet_counter: nowptr must be NULL")); } Modified: head/sys/arm/allwinner/a10_ahci.c ============================================================================== --- head/sys/arm/allwinner/a10_ahci.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/arm/allwinner/a10_ahci.c Tue May 17 12:52:31 2016 (r300050) @@ -158,7 +158,7 @@ ahci_a10_phy_reset(device_t dev) struct ahci_controller *ctlr = device_get_softc(dev); /* - * Here start the the magic -- most of the comments are based + * Here starts the magic -- most of the comments are based * on guesswork, names of routines and printf error * messages. The code works, but it will do that even if the * comments are 100% BS. Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/arm/freescale/imx/imx_sdhci.c Tue May 17 12:52:31 2016 (r300050) @@ -625,7 +625,7 @@ imx_sdhci_intr(void *arg) * out of the hardware now so that we can present it later when the DAT0 * line is released. * - * If we need to wait for the the DAT0 line to be released, we set up a + * If we need to wait for the DAT0 line to be released, we set up a * timeout point 250ms in the future. This number comes from the SD * spec, which allows a command to take that long. In the real world, * cards tend to take 10-20ms for a long-running command such as a write Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Tue May 17 12:48:30 2016 (r300049) +++ head/sys/arm/include/asm.h Tue May 17 12:52:31 2016 (r300050) @@ -79,7 +79,7 @@ /* * EENTRY()/EEND() mark "extra" entry/exit points from a function. - * LEENTRY()/LEEND() are the the same for local symbols. + * LEENTRY()/LEEND() are the same for local symbols. * The unwind info cannot handle the concept of a nested function, or a function * with multiple .fnstart directives, but some of our assembler code is written * with multiple labels to allow entry at several points. The EENTRY() macro Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/cam/cam_periph.c Tue May 17 12:52:31 2016 (r300050) @@ -844,7 +844,7 @@ cam_periph_mapmem(union ccb *ccb, struct } /* - * This keeps the the kernel stack of current thread from getting + * This keeps the kernel stack of current thread from getting * swapped. In low-memory situations where the kernel stack might * otherwise get swapped out, this holds it and allows the thread * to make progress and release the kernel mapped pages sooner. Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/bhnd/bhnd.c Tue May 17 12:52:31 2016 (r300050) @@ -117,7 +117,7 @@ bhnd_generic_attach(device_t dev) /** * Default bhnd(4) bus driver implementation of DEVICE_DETACH(). * - * This implementation calls device_detach() for each of the the device's + * This implementation calls device_detach() for each of the device's * children, in reverse bhnd probe order, terminating if any call to * device_detach() fails. */ Modified: head/sys/dev/bxe/ecore_hsi.h ============================================================================== --- head/sys/dev/bxe/ecore_hsi.h Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/bxe/ecore_hsi.h Tue May 17 12:52:31 2016 (r300050) @@ -3709,9 +3709,9 @@ struct cstorm_toe_ag_context uint32_t snd_max /* The ACK sequence number received in the last completed DDP */; #if defined(__BIG_ENDIAN) uint16_t __agg_vars3 /* Various aggregative variables*/; - uint16_t __reserved67 /* A counter for the number of RQ WQEs with invalidate the the USTORM encountered */; + uint16_t __reserved67 /* A counter for the number of RQ WQEs with invalidate the USTORM encountered */; #elif defined(__LITTLE_ENDIAN) - uint16_t __reserved67 /* A counter for the number of RQ WQEs with invalidate the the USTORM encountered */; + uint16_t __reserved67 /* A counter for the number of RQ WQEs with invalidate the USTORM encountered */; uint16_t __agg_vars3 /* Various aggregative variables*/; #endif #if defined(__BIG_ENDIAN) Modified: head/sys/dev/drm2/i915/intel_crt.c ============================================================================== --- head/sys/dev/drm2/i915/intel_crt.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/drm2/i915/intel_crt.c Tue May 17 12:52:31 2016 (r300050) @@ -794,7 +794,7 @@ void intel_crt_init(struct drm_device *d dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS; /* - * TODO: find a proper way to discover whether we need to set the the + * TODO: find a proper way to discover whether we need to set the * polarity and link reversal bits or not, instead of relying on the * BIOS. */ Modified: head/sys/dev/drm2/i915/intel_display.c ============================================================================== --- head/sys/dev/drm2/i915/intel_display.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/drm2/i915/intel_display.c Tue May 17 12:52:31 2016 (r300050) @@ -7971,7 +7971,7 @@ bool intel_set_mode(struct drm_crtc *crt crtc->mode = *mode; /* Only after disabling all output pipelines that will be changed can we - * update the the output configuration. */ + * update the output configuration. */ intel_modeset_update_state(dev, prepare_pipes); if (dev_priv->display.modeset_global_resources) Modified: head/sys/dev/drm2/radeon/atombios.h ============================================================================== --- head/sys/dev/drm2/radeon/atombios.h Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/drm2/radeon/atombios.h Tue May 17 12:52:31 2016 (r300050) @@ -2734,8 +2734,8 @@ ucMaxNBVoltageHigh: Voltage regulato ucMinNBVoltageHigh: Voltage regulator dependent PWM value. High 8 bits of the value for the min voltage.Set this one to 0x00 if VC without PWM or no VC at all. -usInterNBVoltageLow: Voltage regulator dependent PWM value. The value makes the the voltage >=Min NB voltage but <=InterNBVoltageHigh. Set this to 0x0000 if VC without PWM or no VC at all. -usInterNBVoltageHigh: Voltage regulator dependent PWM value. The value makes the the voltage >=InterNBVoltageLow but <=Max NB voltage.Set this to 0x0000 if VC without PWM or no VC at all. +usInterNBVoltageLow: Voltage regulator dependent PWM value. The value makes the voltage >=Min NB voltage but <=InterNBVoltageHigh. Set this to 0x0000 if VC without PWM or no VC at all. +usInterNBVoltageHigh: Voltage regulator dependent PWM value. The value makes the voltage >=InterNBVoltageLow but <=Max NB voltage.Set this to 0x0000 if VC without PWM or no VC at all. */ Modified: head/sys/dev/drm2/radeon/r300_reg.h ============================================================================== --- head/sys/dev/drm2/radeon/r300_reg.h Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/drm2/radeon/r300_reg.h Tue May 17 12:52:31 2016 (r300050) @@ -356,7 +356,7 @@ __FBSDID("$FreeBSD$"); # define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0 # define R300_PVS_CNTL_1_POS_END_SHIFT 10 # define R300_PVS_CNTL_1_PROGRAM_END_SHIFT 20 -/* Addresses are relative the the vertex program parameters area. */ +/* Addresses are relative the vertex program parameters area. */ #define R300_VAP_PVS_CNTL_2 0x22D4 # define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0 # define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT 16 Modified: head/sys/dev/drm2/radeon/radeon_device.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_device.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/drm2/radeon/radeon_device.c Tue May 17 12:52:31 2016 (r300050) @@ -191,7 +191,7 @@ void radeon_scratch_free(struct radeon_d /* * radeon_wb_*() - * Writeback is the the method by which the the GPU updates special pages + * Writeback is the method by which the GPU updates special pages * in memory with the status of certain GPU events (fences, ring pointers, * etc.). */ Modified: head/sys/dev/drm2/radeon/radeon_fence.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_fence.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/drm2/radeon/radeon_fence.c Tue May 17 12:52:31 2016 (r300050) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); * for GPU/CPU synchronization. When the fence is written, * it is expected that all buffers associated with that fence * are no longer in use by the associated ring on the GPU and - * that the the relevant GPU caches have been flushed. Whether + * that the relevant GPU caches have been flushed. Whether * we use a scratch register or memory location depends on the asic * and whether writeback is enabled. */ Modified: head/sys/dev/drm2/radeon/radeon_gart.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_gart.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/drm2/radeon/radeon_gart.c Tue May 17 12:52:31 2016 (r300050) @@ -413,7 +413,7 @@ void radeon_gart_fini(struct radeon_devi * (uncached system pages). * Each VM has an ID associated with it and there is a page table * associated with each VMID. When execting a command buffer, - * the kernel tells the the ring what VMID to use for that command + * the kernel tells the ring what VMID to use for that command * buffer. VMIDs are allocated dynamically as commands are submitted. * The userspace drivers maintain their own address space and the kernel * sets up their pages tables accordingly when they submit their Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/e1000/e1000_82575.c Tue May 17 12:52:31 2016 (r300050) @@ -2416,7 +2416,7 @@ out: * e1000_reset_mdicnfg_82580 - Reset MDICNFG destination and com_mdio bits * @hw: pointer to the HW structure * - * This resets the the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on + * This resets the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on * the values found in the EEPROM. This addresses an issue in which these * bits are not restored from EEPROM after reset. **/ Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/e1000/e1000_ich8lan.c Tue May 17 12:52:31 2016 (r300050) @@ -4904,7 +4904,7 @@ static s32 e1000_id_led_init_pchlan(stru * @hw: pointer to the HW structure * * ICH8 use the PCI Express bus, but does not contain a PCI Express Capability - * register, so the the bus width is hard coded. + * register, so the bus width is hard coded. **/ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw) { Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue May 17 12:52:31 2016 (r300050) @@ -304,7 +304,7 @@ MODULE_DEPEND(storvsc, vmbus, 1, 1, 1); * We address this issue by implementing a sequentially * consistent protocol: * - * 1. Channel callback is invoked while holding the the channel lock + * 1. Channel callback is invoked while holding the channel lock * and an unloading driver will reset the channel callback under * the protection of this channel lock. * Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/iwm/if_iwmreg.h Tue May 17 12:52:31 2016 (r300050) @@ -3923,7 +3923,7 @@ enum iwm_tx_flags { * cleared. Combination of IWM_RATE_MCS_* * @sta_id: index of destination station in FW station table * @sec_ctl: security control, IWM_TX_CMD_SEC_* - * @initial_rate_index: index into the the rate table for initial TX attempt. + * @initial_rate_index: index into the rate table for initial TX attempt. * Applied if IWM_TX_CMD_FLG_STA_RATE_MSK is set, normally 0 for data frames. * @key: security key * @next_frame_flags: IWM_TX_CMD_SEC_* and IWM_TX_CMD_NEXT_FRAME_* @@ -4274,7 +4274,7 @@ struct iwm_beacon_notif { /** * enum iwm_dump_control - dump (flush) control flags - * @IWM_DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty + * @IWM_DUMP_TX_FIFO_FLUSH: Dump MSDUs until the FIFO is empty * and the TFD queues are empty. */ enum iwm_dump_control { Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/netmap/netmap.c Tue May 17 12:52:31 2016 (r300050) @@ -2700,7 +2700,7 @@ netmap_detach_common(struct netmap_adapt } /* Wrapper for the register callback provided hardware drivers. - * na->ifp == NULL means the the driver module has been + * na->ifp == NULL means the driver module has been * unloaded, so we cannot call into it. * Note that module unloading, in our patched linux drivers, * happens under NMG_LOCK and after having stopped all the Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/ow/ow.c Tue May 17 12:52:31 2016 (r300050) @@ -343,7 +343,7 @@ again: * See AN397 section 5.II.C.3 for the algorithm (though a bit * poorly stated). The search command forces each device to * send ROM ID bits one at a time (first the bit, then the - * complement) the the master (us) sends back a bit. If the + * complement) the master (us) sends back a bit. If the * device's bit doesn't match what we send back, that device * stops sending bits back. So each time through we remember * where we made the last decision (always 0). If there's a Modified: head/sys/dev/pms/RefTisa/sallsdk/spc/mpi.c ============================================================================== --- head/sys/dev/pms/RefTisa/sallsdk/spc/mpi.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/pms/RefTisa/sallsdk/spc/mpi.c Tue May 17 12:52:31 2016 (r300050) @@ -806,7 +806,7 @@ mpiMsgConsume( * \param messagePtr1 Pointer to the returned message buffer to free * \param messagePtr2 Pointer to the returned message buffer to free if bc > 1 * - * Returns consumed and processed message to the the specified outbounf queue + * Returns consumed and processed message to the specified outbounf queue * * Return: * AGSA_RC_SUCCESS if the message has been returned succesfully Modified: head/sys/dev/pms/RefTisa/sat/src/smsat.c ============================================================================== --- head/sys/dev/pms/RefTisa/sat/src/smsat.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/pms/RefTisa/sat/src/smsat.c Tue May 17 12:52:31 2016 (r300050) @@ -10883,7 +10883,7 @@ smsatReadCapacity10( /* * Setting RETURNED LOGICAL BLOCK ADDRESS in READ CAPACITY(10) response data: * SBC-2 specifies that if the capacity exceeded the 4-byte RETURNED LOGICAL - * BLOCK ADDRESS in READ CAPACITY(10) parameter data, the the RETURNED LOGICAL + * BLOCK ADDRESS in READ CAPACITY(10) parameter data, the RETURNED LOGICAL * BLOCK ADDRESS should be set to 0xFFFFFFFF so the application client would * then issue a READ CAPACITY(16) command. */ Modified: head/sys/dev/pms/RefTisa/tisa/sassata/sata/host/sat.c ============================================================================== --- head/sys/dev/pms/RefTisa/tisa/sassata/sata/host/sat.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/pms/RefTisa/tisa/sassata/sata/host/sat.c Tue May 17 12:52:31 2016 (r300050) @@ -5975,7 +5975,7 @@ GLOBAL bit32 satReadCapacity10( /* * Setting RETURNED LOGICAL BLOCK ADDRESS in READ CAPACITY(10) response data: * SBC-2 specifies that if the capacity exceeded the 4-byte RETURNED LOGICAL - * BLOCK ADDRESS in READ CAPACITY(10) parameter data, the the RETURNED LOGICAL + * BLOCK ADDRESS in READ CAPACITY(10) parameter data, the RETURNED LOGICAL * BLOCK ADDRESS should be set to 0xFFFFFFFF so the application client would * then issue a READ CAPACITY(16) command. */ Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/random/fortuna.c Tue May 17 12:52:31 2016 (r300050) @@ -234,7 +234,7 @@ random_fortuna_process_event(struct harv pl = event->he_destination % RANDOM_FORTUNA_NPOOLS; randomdev_hash_iterate(&fortuna_state.fs_pool[pl].fsp_hash, event, sizeof(*event)); /*- - * Don't wrap the length. Doing the the hard way so as not to wrap at MAXUINT. + * Don't wrap the length. Doing this the hard way so as not to wrap at MAXUINT. * This is a "saturating" add. * XXX: FIX!!: We don't actually need lengths for anything but fs_pool[0], * but it's been useful debugging to see them all. Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/dev/sfxge/common/ef10_ev.c Tue May 17 12:52:31 2016 (r300050) @@ -547,7 +547,7 @@ ef10_ev_rx( flags |= EFX_PKT_PREFIX_LEN; } - /* Calculate the index of the the last descriptor consumed */ + /* Calculate the index of the last descriptor consumed */ last_used_id = (eersp->eers_rx_read_ptr - 1) & eersp->eers_rx_mask; /* Check for errors that invalidate checksum and L3/L4 fields */ Modified: head/sys/mips/conf/DIR-825C1.hints ============================================================================== --- head/sys/mips/conf/DIR-825C1.hints Tue May 17 12:48:30 2016 (r300049) +++ head/sys/mips/conf/DIR-825C1.hints Tue May 17 12:52:31 2016 (r300050) @@ -6,7 +6,7 @@ hint.argemdio.0.maddr=0x19000000 hint.argemdio.0.msize=0x1000 hint.argemdio.0.order=0 -# 0x1ffe0004 is the the "unit MAC". +# 0x1ffe0004 is the "unit MAC". # 0x1ffe0018 is the second "MAC". # Right now this doesn't have any option for more than one # "unit MACs", so: Modified: head/sys/net/altq/altq_cbq.c ============================================================================== --- head/sys/net/altq/altq_cbq.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/net/altq/altq_cbq.c Tue May 17 12:52:31 2016 (r300050) @@ -702,7 +702,7 @@ cbq_modify_class(acp) * * This function create a new traffic class in the CBQ class hierarchy of * given parameters. The class that created is either the root, default, - * or a new dynamic class. If CBQ is not initilaized, the the root class + * or a new dynamic class. If CBQ is not initilaized, the root class * will be created. */ static int Modified: head/sys/ofed/drivers/infiniband/debug/memtrack.c ============================================================================== --- head/sys/ofed/drivers/infiniband/debug/memtrack.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/ofed/drivers/infiniband/debug/memtrack.c Tue May 17 12:52:31 2016 (r300050) @@ -510,7 +510,7 @@ EXPORT_SYMBOL(is_non_trackable_free_func /* WA - In this function handles confirm - the the function name is + the function name is '__ib_umem_release' or 'ib_umem_get' In this case we won't track the memory there because the kernel Modified: head/sys/ofed/drivers/infiniband/debug/memtrack.h ============================================================================== --- head/sys/ofed/drivers/infiniband/debug/memtrack.h Tue May 17 12:48:30 2016 (r300049) +++ head/sys/ofed/drivers/infiniband/debug/memtrack.h Tue May 17 12:52:31 2016 (r300050) @@ -64,7 +64,7 @@ int is_non_trackable_alloc_func(const ch int is_non_trackable_free_func(const char *func_name); /* WA - In this function handles confirm - the the function name is + the function name is '__ib_umem_release' or 'ib_umem_get' In this case we won't track the memory there because the kernel Modified: head/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/main.c Tue May 17 12:48:30 2016 (r300049) +++ head/sys/ofed/drivers/net/mlx4/main.c Tue May 17 12:52:31 2016 (r300050) @@ -164,7 +164,7 @@ MODULE_PARM_DESC(fast_drop, int mlx4_enable_64b_cqe_eqe = 1; module_param_named(enable_64b_cqe_eqe, mlx4_enable_64b_cqe_eqe, int, 0644); MODULE_PARM_DESC(enable_64b_cqe_eqe, - "Enable 64 byte CQEs/EQEs when the the FW supports this if non-zero (default: 1)"); + "Enable 64 byte CQEs/EQEs when the FW supports this if non-zero (default: 1)"); #define HCA_GLOBAL_CAP_MASK 0 Modified: head/sys/xen/interface/io/blkif.h ============================================================================== --- head/sys/xen/interface/io/blkif.h Tue May 17 12:48:30 2016 (r300049) +++ head/sys/xen/interface/io/blkif.h Tue May 17 12:52:31 2016 (r300050) @@ -324,7 +324,7 @@ * access (even when it should be read-only). If the frontend hits the * maximum number of allowed persistently mapped grants, it can fallback * to non persistent mode. This will cause a performance degradation, - * since the the backend driver will still try to map those grants + * since the backend driver will still try to map those grants * persistently. Since the persistent grants protocol is compatible with * the previous protocol, a frontend driver can choose to work in * persistent mode even when the backend doesn't support it. Modified: head/usr.bin/numactl/numactl.1 ============================================================================== --- head/usr.bin/numactl/numactl.1 Tue May 17 12:48:30 2016 (r300049) +++ head/usr.bin/numactl/numactl.1 Tue May 17 12:52:31 2016 (r300050) @@ -83,7 +83,7 @@ The options are as follows: .Bl -tag -width ".Fl -cpudomain Ar domain" .It Fl -cpudomain Ar domain , Fl c Ar domain Set the given CPU scheduling policy. -Constrain the the object (tid, pid, command) to run on CPUs +Constrain the object (tid, pid, command) to run on CPUs that belong to the given domain. .It Fl -get , Fl g Retrieve the NUMA policy for the given thread or process id. Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Tue May 17 12:48:30 2016 (r300049) +++ head/usr.sbin/bsdconfig/share/dialog.subr Tue May 17 12:52:31 2016 (r300050) @@ -1815,7 +1815,7 @@ f_dialog_inputstr_fetch() # f_dialog_input $var_to_set $prompt [$init [$hline]] # # Prompt the user with a dialog(1) inputbox to enter some value. The inputbox -# remains until the the user presses ENTER or ESC, or otherwise ends the +# remains until the user presses ENTER or ESC, or otherwise ends the # editing session (by selecting `Cancel' for example). # # If the user presses ENTER, the exit status is zero (success), otherwise if Modified: head/usr.sbin/pciconf/pciconf.8 ============================================================================== --- head/usr.sbin/pciconf/pciconf.8 Tue May 17 12:48:30 2016 (r300049) +++ head/usr.sbin/pciconf/pciconf.8 Tue May 17 12:52:31 2016 (r300050) @@ -237,7 +237,7 @@ prefix indicates if the keyword is read- or read-write .Dq rw . The second string provides the keyword name. -The text after the the equals sign lists the value of the keyword which is +The text after the equals sign lists the value of the keyword which is usually an ASCII string. .Pp If the optional From owner-svn-src-all@freebsd.org Tue May 17 13:12:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9270EB3CB79; Tue, 17 May 2016 13:12:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50E6B285F; Tue, 17 May 2016 13:12:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HDCQES040940; Tue, 17 May 2016 13:12:26 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HDCQDc040937; Tue, 17 May 2016 13:12:26 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605171312.u4HDCQDc040937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 17 May 2016 13:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300051 - in head/sys: arm/arm 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 13:12:27 -0000 Author: bz Date: Tue May 17 13:12:26 2016 New Revision: 300051 URL: https://svnweb.freebsd.org/changeset/base/300051 Log: The GIC (v2 at least) has a bit in the TYPER register to indicate whether the GIC supports the Security Extensions or not. This bit is not the same as the CPU one. Currently we are not checking for either before trying to write to the special registers. This can lead to problems on hardware or simulators that do not provide the security extensions. Add the missing checks. Their interactions with the CPU flag is not entirely clear to me but using a macro will make it easier to quickly adjust the condition once the CPU bits are sorted as well. Reviewed by: br Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D6397 Modified: head/sys/arm/arm/gic.c head/sys/arm64/arm64/gic.c head/sys/arm64/arm64/gic.h Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue May 17 12:52:31 2016 (r300050) +++ head/sys/arm/arm/gic.c Tue May 17 13:12:26 2016 (r300051) @@ -108,6 +108,11 @@ __FBSDID("$FreeBSD$"); #define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ #define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ +/* TYPER Registers */ +#define GICD_TYPER_SECURITYEXT 0x400 +#define GIC_SUPPORT_SECEXT(_sc) \ + ((_sc->typer & GICD_TYPER_SECURITYEXT) == GICD_TYPER_SECURITYEXT) + /* First bit is a polarity bit (0 - low, 1 - high) */ #define GICD_ICFGR_POL_LOW (0 << 0) #define GICD_ICFGR_POL_HIGH (1 << 0) @@ -172,6 +177,7 @@ struct arm_gic_softc { uint8_t ver; struct mtx mutex; uint32_t nirqs; + uint32_t typer; #ifdef GIC_DEBUG_SPURIOUS uint32_t last_irq[MAXCPU]; #endif @@ -299,7 +305,7 @@ arm_gic_init_secondary(device_t dev) gic_d_write_4(sc, GICD_IPRIORITYR(irq >> 2), 0); /* Set all the interrupts to be in Group 0 (secure) */ - for (irq = 0; irq < sc->nirqs; irq += 32) { + for (irq = 0; GIC_SUPPORT_SECEXT(sc) && irq < sc->nirqs; irq += 32) { gic_d_write_4(sc, GICD_IGROUPR(irq >> 5), 0); } @@ -336,7 +342,7 @@ arm_gic_init_secondary(device_t dev) gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0); /* Set all the interrupts to be in Group 0 (secure) */ - for (i = 0; i < sc->nirqs; i += 32) { + for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) { gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0); } @@ -639,8 +645,8 @@ arm_gic_attach(device_t dev) gic_d_write_4(sc, GICD_CTLR, 0x00); /* Get the number of interrupts */ - nirqs = gic_d_read_4(sc, GICD_TYPER); - nirqs = 32 * ((nirqs & 0x1f) + 1); + sc->typer = gic_d_read_4(sc, GICD_TYPER); + nirqs = 32 * ((sc->typer & 0x1f) + 1); #ifdef INTRNG if (arm_gic_register_isrcs(sc, nirqs)) { @@ -686,7 +692,7 @@ arm_gic_attach(device_t dev) } /* Set all the interrupts to be in Group 0 (secure) */ - for (i = 0; i < sc->nirqs; i += 32) { + for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) { gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0); } Modified: head/sys/arm64/arm64/gic.c ============================================================================== --- head/sys/arm64/arm64/gic.c Tue May 17 12:52:31 2016 (r300050) +++ head/sys/arm64/arm64/gic.c Tue May 17 13:12:26 2016 (r300051) @@ -94,6 +94,11 @@ __FBSDID("$FreeBSD$"); #define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ #define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ +/* TYPER Registers */ +#define GICD_TYPER_SECURITYEXT 0x400 +#define GIC_SUPPORT_SECEXT(_sc) \ + ((_sc->typer & GICD_TYPER_SECURITYEXT) == GICD_TYPER_SECURITYEXT) + /* First bit is a polarity bit (0 - low, 1 - high) */ #define GICD_ICFGR_POL_LOW (0 << 0) #define GICD_ICFGR_POL_HIGH (1 << 0) @@ -164,7 +169,7 @@ gic_init_secondary(device_t dev) gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0); /* Set all the interrupts to be in Group 0 (secure) */ - for (i = 0; i < sc->nirqs; i += 32) { + for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) { gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0); } @@ -221,8 +226,8 @@ arm_gic_attach(device_t dev) gic_d_write_4(sc, GICD_CTLR, 0x00); /* Get the number of interrupts */ - sc->nirqs = gic_d_read_4(sc, GICD_TYPER); - sc->nirqs = 32 * ((sc->nirqs & 0x1f) + 1); + sc->typer = gic_d_read_4(sc, GICD_TYPER); + sc->nirqs = 32 * ((sc->typer & 0x1f) + 1); arm_register_root_pic(dev, sc->nirqs); @@ -257,7 +262,7 @@ arm_gic_attach(device_t dev) } /* Set all the interrupts to be in Group 0 (secure) */ - for (i = 0; i < sc->nirqs; i += 32) { + for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) { gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0); } Modified: head/sys/arm64/arm64/gic.h ============================================================================== --- head/sys/arm64/arm64/gic.h Tue May 17 12:52:31 2016 (r300050) +++ head/sys/arm64/arm64/gic.h Tue May 17 13:12:26 2016 (r300051) @@ -49,6 +49,7 @@ struct arm_gic_softc { uint8_t ver; struct mtx mutex; uint32_t nirqs; + uint32_t typer; }; DECLARE_CLASS(arm_gicv2m_driver); From owner-svn-src-all@freebsd.org Tue May 17 13:18:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C76FBB3CD5A; Tue, 17 May 2016 13:18:58 +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 887302AAC; Tue, 17 May 2016 13:18:58 +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 u4HDIv4a041819; Tue, 17 May 2016 13:18:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HDIvAm041816; Tue, 17 May 2016 13:18:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605171318.u4HDIvAm041816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 17 May 2016 13:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300052 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 13:18:58 -0000 Author: mav Date: Tue May 17 13:18:57 2016 New Revision: 300052 URL: https://svnweb.freebsd.org/changeset/base/300052 Log: Completely remove broken now autologin port flag. Firmware automatically logs in only to local loop ports, and those ports can be easily identified without extra flag by zero domain and area IDs. MFC after: 1 week Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue May 17 13:12:26 2016 (r300051) +++ head/sys/dev/isp/isp.c Tue May 17 13:18:57 2016 (r300052) @@ -3206,7 +3206,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) case FC_PORTDB_STATE_DEAD: lp->state = FC_PORTDB_STATE_NIL; isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); - if (lp->autologin == 0) { + if ((lp->portid & 0xffff00) != 0) { (void) isp_plogx(isp, chan, lp->handle, lp->portid, PLOGX_FLG_CMD_LOGO | @@ -3304,7 +3304,6 @@ isp_pdb_add_update(ispsoftc_t *isp, int } ISP_MEMZERO(lp, sizeof (fcportdb_t)); - lp->autologin = 1; lp->probational = 0; lp->state = FC_PORTDB_STATE_NEW; lp->portid = lp->new_portid = pdb->portid; Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Tue May 17 13:12:26 2016 (r300051) +++ head/sys/dev/isp/isp_library.c Tue May 17 13:18:57 2016 (r300052) @@ -437,8 +437,8 @@ isp_dump_portdb(ispsoftc_t *isp, int cha } isp_gen_role_str(buf1, sizeof (buf1), lp->prli_word3); isp_gen_role_str(buf2, sizeof (buf2), lp->new_prli_word3); - isp_prt(isp, ISP_LOGALL, "Chan %d [%d]: hdl 0x%x %s al%d %s 0x%06x =>%s 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x", - chan, i, lp->handle, dbs[lp->state], lp->autologin, buf1, lp->portid, buf2, lp->new_portid, + isp_prt(isp, ISP_LOGALL, "Chan %d [%d]: hdl 0x%x %s %s 0x%06x =>%s 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x", + chan, i, lp->handle, dbs[lp->state], buf1, lp->portid, buf2, lp->new_portid, (uint32_t) (lp->node_wwn >> 32), (uint32_t) (lp->node_wwn), (uint32_t) (lp->port_wwn >> 32), (uint32_t) (lp->port_wwn)); } } Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Tue May 17 13:12:26 2016 (r300051) +++ head/sys/dev/isp/ispvar.h Tue May 17 13:18:57 2016 (r300052) @@ -380,9 +380,6 @@ typedef struct { uint16_t handle; /* - * A device is 'autologin' if the firmware automatically logs into - * it (re-logins as needed). Basically, local private loop devices. - * * PRLI word 3 parameters contains role as well as other things. * * The state is the current state of this entry. @@ -396,8 +393,7 @@ typedef struct { */ uint16_t prli_word3; /* PRLI parameters */ uint16_t new_prli_word3; /* Incoming new PRLI parameters */ - uint16_t : 11, - autologin : 1, /* F/W does PLOGI/PLOGO */ + uint16_t : 12, probational : 1, state : 3; uint32_t : 6, From owner-svn-src-all@freebsd.org Tue May 17 14:02:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6DBEB3DAAA; Tue, 17 May 2016 14:02:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E01A24D3; Tue, 17 May 2016 14:02:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HE25pf055013; Tue, 17 May 2016 14:02:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HE2515055012; Tue, 17 May 2016 14:02:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605171402.u4HE2515055012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 14:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300053 - stable/9/sys/amd64/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 14:02:06 -0000 Author: avg Date: Tue May 17 14:02:05 2016 New Revision: 300053 URL: https://svnweb.freebsd.org/changeset/base/300053 Log: pick up specialreg.h changes from r273338 to fix r300037 The original change applies to x86 family of platforms, in this branch it's only for amd64 where it is really required. This is a direct commit. Reported by: Eugene Grosbein Modified: stable/9/sys/amd64/include/specialreg.h Modified: stable/9/sys/amd64/include/specialreg.h ============================================================================== --- stable/9/sys/amd64/include/specialreg.h Tue May 17 13:18:57 2016 (r300052) +++ stable/9/sys/amd64/include/specialreg.h Tue May 17 14:02:05 2016 (r300053) @@ -81,6 +81,7 @@ #define EFER_LME 0x000000100 /* Long mode enable (R/W) */ #define EFER_LMA 0x000000400 /* Long mode active (R) */ #define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ +#define EFER_SVM 0x000001000 /* SVM enable bit for AMD, reserved for Intel */ /* * Intel Extended Features registers @@ -580,8 +581,21 @@ #define MSR_IORRMASK1 0xc0010019 #define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ +#define MSR_NB_CFG1 0xc001001f /* NB configuration 1 */ +#define MSR_P_STATE_LIMIT 0xc0010061 /* P-state Current Limit Register */ +#define MSR_P_STATE_CONTROL 0xc0010062 /* P-state Control Register */ +#define MSR_P_STATE_STATUS 0xc0010063 /* P-state Status Register */ +#define MSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */ +#define MSR_SMM_ADDR 0xc0010112 /* SMM TSEG base address */ +#define MSR_SMM_MASK 0xc0010113 /* SMM TSEG address mask */ +#define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 +#define MSR_VM_CR 0xc0010114 /* SVM: feature control */ +#define MSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area address */ + +/* MSR_VM_CR related */ +#define VM_CR_SVMDIS 0x10 /* SVM: disabled by BIOS */ /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ From owner-svn-src-all@freebsd.org Tue May 17 14:06:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFF41B3DB4A; Tue, 17 May 2016 14:06:56 +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 AFEF4259D; Tue, 17 May 2016 14:06:56 +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 u4HE6t2h057165; Tue, 17 May 2016 14:06:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HE6tkJ057164; Tue, 17 May 2016 14:06:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605171406.u4HE6tkJ057164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 17 May 2016 14:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300054 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 14:06:57 -0000 Author: ae Date: Tue May 17 14:06:55 2016 New Revision: 300054 URL: https://svnweb.freebsd.org/changeset/base/300054 Log: Call RO_RTFREE() when we have detected the change of destination address, otherwise the old route will be used with new destination. MFC after: 1 week Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Tue May 17 14:02:05 2016 (r300053) +++ head/sys/netinet6/ip6_output.c Tue May 17 14:06:55 2016 (r300054) @@ -826,8 +826,10 @@ again: #endif error = netisr_queue(NETISR_IPV6, m); goto done; - } else + } else { + RO_RTFREE(ro); needfiblookup = 1; /* Redo the routing table lookup. */ + } } /* See if fib was changed by packet filter. */ if (fibnum != M_GETFIB(m)) { From owner-svn-src-all@freebsd.org Tue May 17 14:10:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFFDB3DBDF; Tue, 17 May 2016 14:10: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 D0E332944; Tue, 17 May 2016 14:10:45 +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 u4HEAiLT057347; Tue, 17 May 2016 14:10:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HEAi9d057346; Tue, 17 May 2016 14:10:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605171410.u4HEAi9d057346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 May 2016 14:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300055 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 14:10:46 -0000 Author: imp Date: Tue May 17 14:10:44 2016 New Revision: 300055 URL: https://svnweb.freebsd.org/changeset/base/300055 Log: Minor space tweak to make things consistent. MFC After: 3 days Modified: head/sys/boot/ficl/words.c Modified: head/sys/boot/ficl/words.c ============================================================================== --- head/sys/boot/ficl/words.c Tue May 17 14:06:55 2016 (r300054) +++ head/sys/boot/ficl/words.c Tue May 17 14:10:44 2016 (r300055) @@ -5198,12 +5198,11 @@ void ficlCompileCore(FICL_SYSTEM *pSys) /* ** Set up system's outer interpreter loop - maybe this should be in initSystem? */ - pSys->pInterp[0] = pSys->pInterpret; - pSys->pInterp[1] = pSys->pBranchParen; - pSys->pInterp[2] = (FICL_WORD *)(void *)(-2); + pSys->pInterp[0] = pSys->pInterpret; + pSys->pInterp[1] = pSys->pBranchParen; + pSys->pInterp[2] = (FICL_WORD *)(void *)(-2); assert(dictCellsAvail(dp) > 0); return; } - From owner-svn-src-all@freebsd.org Tue May 17 14:10:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44DFBB3DBE4; Tue, 17 May 2016 14:10:47 +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 F182E294A; Tue, 17 May 2016 14:10: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 u4HEAkHU057393; Tue, 17 May 2016 14:10:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HEAjRP057390; Tue, 17 May 2016 14:10:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605171410.u4HEAjRP057390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 May 2016 14:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300056 - in head/sys/boot: common efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 14:10:47 -0000 Author: imp Date: Tue May 17 14:10:45 2016 New Revision: 300056 URL: https://svnweb.freebsd.org/changeset/base/300056 Log: It sure would be nice to use printf with wide strings. Implement %S to do that. The C_WIDEOUT flag indicates that the console supports it. Mark the EFI console as supporting this. MFC After: 3 days Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/util.c head/sys/boot/efi/libefi/efi_console.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Tue May 17 14:10:44 2016 (r300055) +++ head/sys/boot/common/bootstrap.h Tue May 17 14:10:45 2016 (r300056) @@ -102,6 +102,7 @@ struct console #define C_PRESENTOUT (1<<1) /* console can provide output */ #define C_ACTIVEIN (1<<2) /* user wants input from console */ #define C_ACTIVEOUT (1<<3) /* user wants output to console */ +#define C_WIDEOUT (1<<4) /* c_out routine groks wide chars */ void (* c_probe)(struct console *cp); /* set c_flags to match hardware */ int (* c_init)(int arg); /* reinit XXX may need more args */ void (* c_out)(int c); /* emit c */ Modified: head/sys/boot/common/util.c ============================================================================== --- head/sys/boot/common/util.c Tue May 17 14:10:44 2016 (r300055) +++ head/sys/boot/common/util.c Tue May 17 14:10:45 2016 (r300056) @@ -120,6 +120,7 @@ printf(const char *fmt, ...) va_list ap; const char *hex = "0123456789abcdef"; char buf[32], *s; + uint16_t *S; unsigned long long u; int c, l; @@ -143,6 +144,10 @@ nextfmt: for (s = va_arg(ap, char *); *s != '\0'; s++) putchar(*s); break; + case 'S': /* Assume console can cope with wide chars */ + for (S = va_arg(ap, uint16_t *); *S != 0; S++) + putchar(*S); + break; case 'd': /* A lie, always prints unsigned */ case 'u': case 'x': Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Tue May 17 14:10:44 2016 (r300055) +++ head/sys/boot/efi/libefi/efi_console.c Tue May 17 14:10:45 2016 (r300056) @@ -61,7 +61,7 @@ int efi_cons_poll(void); struct console efi_console = { "efi", "EFI console", - 0, + C_WIDEOUT, efi_cons_probe, efi_cons_init, efi_cons_putchar, From owner-svn-src-all@freebsd.org Tue May 17 14:52:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E66CDB3E66E; Tue, 17 May 2016 14:52:06 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6798641EB; Tue, 17 May 2016 14:52:06 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HEq540072027; Tue, 17 May 2016 14:52:05 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HEq5ES072026; Tue, 17 May 2016 14:52:05 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201605171452.u4HEq5ES072026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 17 May 2016 14:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300057 - stable/10/sbin/reboot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 14:52:07 -0000 Author: garga (ports committer) Date: Tue May 17 14:52:05 2016 New Revision: 300057 URL: https://svnweb.freebsd.org/changeset/base/300057 Log: MFC r299196: Add missing parameters -N and -l to reroot and halt usage() Approved by: bapt Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D6173 Modified: stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/reboot/reboot.c ============================================================================== --- stable/10/sbin/reboot/reboot.c Tue May 17 14:10:45 2016 (r300056) +++ stable/10/sbin/reboot/reboot.c Tue May 17 14:52:05 2016 (r300057) @@ -248,8 +248,8 @@ usage(void) { (void)fprintf(stderr, dohalt ? - "usage: halt [-lnpq] [-k kernel]\n" : - "usage: reboot [-dlnpq] [-k kernel]\n"); + "usage: halt [-lNnpq] [-k kernel]\n" : + "usage: reboot [-dlNnpqr] [-k kernel]\n"); exit(1); } From owner-svn-src-all@freebsd.org Tue May 17 15:12:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0865B3EF5B; Tue, 17 May 2016 15:12:58 +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 5CAF465148; Tue, 17 May 2016 15:12:58 +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 u4HFCvA0078060; Tue, 17 May 2016 15:12:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HFCvhB078059; Tue, 17 May 2016 15:12:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605171512.u4HFCvhB078059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 17 May 2016 15:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300058 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 15:12:58 -0000 Author: mav Date: Tue May 17 15:12:57 2016 New Revision: 300058 URL: https://svnweb.freebsd.org/changeset/base/300058 Log: Make RQCS_PORT_LOGGED_OUT for ZOMBIE ports retriable. It is normal for ZOMBIE ports to be logged out. This status is not really an error until Gone Device Timeout expires, so make CAM retry after delay. MFC after: 1 week Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue May 17 14:52:05 2016 (r300057) +++ head/sys/dev/isp/isp.c Tue May 17 15:12:57 2016 (r300058) @@ -6517,6 +6517,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta { const char *reason; uint8_t sts = sp->req_completion_status & 0xff; + fcparam *fcp = FCPARAM(isp, 0); + fcportdb_t *lp; /* * It was there (maybe)- treat as a selection timeout. @@ -6534,8 +6536,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta * to force a re-login of this unit. If we're on fabric, * then we'll have to log in again as a matter of course. */ - if (FCPARAM(isp, 0)->isp_topo == TOPO_NL_PORT || - FCPARAM(isp, 0)->isp_topo == TOPO_FL_PORT) { + if (fcp->isp_topo == TOPO_NL_PORT || + fcp->isp_topo == TOPO_FL_PORT) { mbreg_t mbs; MBSINIT(&mbs, MBOX_INIT_LIP, MBLOGALL, 0); if (ISP_CAP_2KLOGIN(isp)) { @@ -6544,7 +6546,12 @@ isp_parse_status(ispsoftc_t *isp, ispsta isp_mboxcmd_qnw(isp, &mbs, 1); } if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_SELTIMEOUT); + lp = &fcp->portdb[XS_TGT(xs)]; + if (lp->state == FC_PORTDB_STATE_ZOMBIE) { + *XS_STSP(xs) = SCSI_BUSY; + XS_SETERR(xs, HBA_TGTBSY); + } else + XS_SETERR(xs, HBA_SELTIMEOUT); } return; } @@ -6668,6 +6675,8 @@ isp_parse_status_24xx(ispsoftc_t *isp, i { const char *reason; uint8_t sts = sp->req_completion_status & 0xff; + fcparam *fcp = FCPARAM(isp, XS_CHANNEL(xs)); + fcportdb_t *lp; /* * It was there (maybe)- treat as a selection timeout. @@ -6685,7 +6694,12 @@ isp_parse_status_24xx(ispsoftc_t *isp, i * There is no MBOX_INIT_LIP for the 24XX. */ if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_SELTIMEOUT); + lp = &fcp->portdb[XS_TGT(xs)]; + if (lp->state == FC_PORTDB_STATE_ZOMBIE) { + *XS_STSP(xs) = SCSI_BUSY; + XS_SETERR(xs, HBA_TGTBSY); + } else + XS_SETERR(xs, HBA_SELTIMEOUT); } return; } From owner-svn-src-all@freebsd.org Tue May 17 15:17:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 804B9B3F116; Tue, 17 May 2016 15:17:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57BA5652AE; Tue, 17 May 2016 15:17:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HFHNxq078245; Tue, 17 May 2016 15:17:23 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HFHNqw078244; Tue, 17 May 2016 15:17:23 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605171517.u4HFHNqw078244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 17 May 2016 15:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300059 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 15:17:24 -0000 Author: asomers Date: Tue May 17 15:17:23 2016 New Revision: 300059 URL: https://svnweb.freebsd.org/changeset/base/300059 Log: Speed up vdev_geom_open_by_guids Speedup is hard to measure because the only time vdev_geom_open_by_guids gets called on many drives at the same time is during boot. But with vdev_geom_open hacked to always call vdev_geom_open_by_guids, operations like "zpool create" speed up by 65%. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c * Read all of a vdev's labels in parallel instead of sequentially. * In vdev_geom_read_config, don't read the entire label, including the uberblock. That's a waste of RAM. Just read the vdev config nvlist. Reduces the IO and RAM involved with tasting from 1MB to 448KB. Reviewed by: avg MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6153 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue May 17 15:12:57 2016 (r300058) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue May 17 15:17:23 2016 (r300059) @@ -325,52 +325,82 @@ nvlist_get_guids(nvlist_t *list, uint64_ (void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_POOL_GUID, pguid); } -static int -vdev_geom_io(struct g_consumer *cp, int cmd, void *data, off_t offset, off_t size) +/* + * Issue one or more bios to the vdev in parallel + * cmds, datas, offsets, errors, and sizes are arrays of length ncmds. Each IO + * operation is described by parallel entries from each array. There may be + * more bios actually issued than entries in the array + */ +static void +vdev_geom_io(struct g_consumer *cp, int *cmds, void **datas, off_t *offsets, + off_t *sizes, int *errors, int ncmds) { - struct bio *bp; + struct bio **bios; u_char *p; - off_t off, maxio; - int error; + off_t off, maxio, s, end; + int i, n_bios, j; + size_t bios_size; - ASSERT((offset % cp->provider->sectorsize) == 0); - ASSERT((size % cp->provider->sectorsize) == 0); - - bp = g_alloc_bio(); - off = offset; - offset += size; - p = data; maxio = MAXPHYS - (MAXPHYS % cp->provider->sectorsize); - error = 0; + n_bios = 0; - for (; off < offset; off += maxio, p += maxio, size -= maxio) { - g_reset_bio(bp); - bp->bio_cmd = cmd; - bp->bio_done = NULL; - bp->bio_offset = off; - bp->bio_length = MIN(size, maxio); - bp->bio_data = p; - g_io_request(bp, cp); - error = biowait(bp, "vdev_geom_io"); - if (error != 0) - break; + /* How many bios are required for all commands ? */ + for (i = 0; i < ncmds; i++) + n_bios += (sizes[i] + maxio - 1) / maxio; + + /* Allocate memory for the bios */ + bios_size = n_bios * sizeof(struct bio*); + bios = kmem_zalloc(bios_size, KM_SLEEP); + + /* Prepare and issue all of the bios */ + for (i = j = 0; i < ncmds; i++) { + off = offsets[i]; + p = datas[i]; + s = sizes[i]; + end = off + s; + ASSERT((off % cp->provider->sectorsize) == 0); + ASSERT((s % cp->provider->sectorsize) == 0); + + for (; off < end; off += maxio, p += maxio, s -= maxio, j++) { + bios[j] = g_alloc_bio(); + bios[j]->bio_cmd = cmds[i]; + bios[j]->bio_done = NULL; + bios[j]->bio_offset = off; + bios[j]->bio_length = MIN(s, maxio); + bios[j]->bio_data = p; + g_io_request(bios[j], cp); + } + } + ASSERT(j == n_bios); + + /* Wait for all of the bios to complete, and clean them up */ + for (i = j = 0; i < ncmds; i++) { + off = offsets[i]; + s = sizes[i]; + end = off + s; + + for (; off < end; off += maxio, s -= maxio, j++) { + errors[i] = biowait(bios[j], "vdev_geom_io") || errors[i]; + g_destroy_bio(bios[j]); + } } - - g_destroy_bio(bp); - return (error); + kmem_free(bios, bios_size); } static int vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) { struct g_provider *pp; - vdev_label_t *label; + vdev_phys_t *vdev_lists[VDEV_LABELS]; char *p, *buf; size_t buflen; - uint64_t psize; - off_t offset, size; - uint64_t state, txg; - int error, l, len; + uint64_t psize, state, txg; + off_t offsets[VDEV_LABELS]; + off_t size; + off_t sizes[VDEV_LABELS]; + int cmds[VDEV_LABELS]; + int errors[VDEV_LABELS]; + int l, len; g_topology_assert_not(); @@ -380,22 +410,32 @@ vdev_geom_read_config(struct g_consumer psize = pp->mediasize; psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t)); - size = sizeof(*label) + pp->sectorsize - - ((sizeof(*label) - 1) % pp->sectorsize) - 1; + size = sizeof(*vdev_lists[0]) + pp->sectorsize - + ((sizeof(*vdev_lists[0]) - 1) % pp->sectorsize) - 1; - label = kmem_alloc(size, KM_SLEEP); - buflen = sizeof(label->vl_vdev_phys.vp_nvlist); + buflen = sizeof(vdev_lists[0]->vp_nvlist); *config = NULL; + /* Create all of the IO requests */ for (l = 0; l < VDEV_LABELS; l++) { + cmds[l] = BIO_READ; + vdev_lists[l] = kmem_alloc(size, KM_SLEEP); + offsets[l] = vdev_label_offset(psize, l, 0) + VDEV_SKIP_SIZE; + sizes[l] = size; + errors[l] = 0; + ASSERT(offsets[l] % pp->sectorsize == 0); + } - offset = vdev_label_offset(psize, l, 0); - if ((offset % pp->sectorsize) != 0) - continue; + /* Issue the IO requests */ + vdev_geom_io(cp, cmds, (void**)vdev_lists, offsets, sizes, errors, + VDEV_LABELS); - if (vdev_geom_io(cp, BIO_READ, label, offset, size) != 0) + /* Parse the labels */ + for (l = 0; l < VDEV_LABELS; l++) { + if (errors[l] != 0) continue; - buf = label->vl_vdev_phys.vp_nvlist; + + buf = vdev_lists[l]->vp_nvlist; if (nvlist_unpack(buf, buflen, config, 0) != 0) continue; @@ -407,7 +447,8 @@ vdev_geom_read_config(struct g_consumer continue; } - if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + if (state != POOL_STATE_SPARE && + state != POOL_STATE_L2CACHE && (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, &txg) != 0 || txg == 0)) { nvlist_free(*config); @@ -418,7 +459,10 @@ vdev_geom_read_config(struct g_consumer break; } - kmem_free(label, size); + /* Free the label storage */ + for (l = 0; l < VDEV_LABELS; l++) + kmem_free(vdev_lists[l], size); + return (*config == NULL ? ENOENT : 0); } From owner-svn-src-all@freebsd.org Tue May 17 15:18:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98D2AB3F164; Tue, 17 May 2016 15:18:06 +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 35C74652F5; Tue, 17 May 2016 15:18:06 +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 u4HFI5ZG078353; Tue, 17 May 2016 15:18:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HFI2xK078320; Tue, 17 May 2016 15:18:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605171518.u4HFI2xK078320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 17 May 2016 15:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300060 - in stable/10/sys: dev/aic7xxx dev/aic7xxx/aicasm dev/ciss dev/drm2/radeon dev/drm2/ttm dev/hptiop dev/hwpmc dev/isci/scil dev/pccbb dev/wbwd dev/wtap dev/wtap/plugins sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 15:18:06 -0000 Author: pfg Date: Tue May 17 15:18:01 2016 New Revision: 300060 URL: https://svnweb.freebsd.org/changeset/base/300060 Log: MFC r298931, r298981, r299375: Minor spelling fixes in: sys/dev, sys/sys Many of these have user-visible strings. Modified: stable/10/sys/dev/aic7xxx/aic79xx.c stable/10/sys/dev/aic7xxx/aic79xx.h stable/10/sys/dev/aic7xxx/aic79xx.reg stable/10/sys/dev/aic7xxx/aic79xx.seq stable/10/sys/dev/aic7xxx/aic79xx_inline.h stable/10/sys/dev/aic7xxx/aic79xx_pci.c stable/10/sys/dev/aic7xxx/aic7xxx.c stable/10/sys/dev/aic7xxx/aic7xxx.h stable/10/sys/dev/aic7xxx/aic7xxx.reg stable/10/sys/dev/aic7xxx/aic7xxx.seq stable/10/sys/dev/aic7xxx/aic7xxx_inline.h stable/10/sys/dev/aic7xxx/aic7xxx_pci.c stable/10/sys/dev/aic7xxx/aicasm/aicasm.c stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y stable/10/sys/dev/ciss/ciss.c stable/10/sys/dev/drm2/radeon/radeon_fb.c stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c stable/10/sys/dev/hptiop/hptiop.c stable/10/sys/dev/hwpmc/hwpmc_mod.c stable/10/sys/dev/isci/scil/scic_phy.h stable/10/sys/dev/isci/scil/scic_sds_phy.c stable/10/sys/dev/pccbb/pccbb_pci.c stable/10/sys/dev/wbwd/wbwd.c stable/10/sys/dev/wtap/if_wtap.c stable/10/sys/dev/wtap/if_wtap_module.c stable/10/sys/dev/wtap/plugins/visibility.c stable/10/sys/sys/ata.h stable/10/sys/sys/buf.h stable/10/sys/sys/buf_ring.h stable/10/sys/sys/iconv.h stable/10/sys/sys/imgact_binmisc.h stable/10/sys/sys/imgact_elf.h stable/10/sys/sys/ipc.h stable/10/sys/sys/ipmi.h stable/10/sys/sys/linker.h stable/10/sys/sys/memrange.h stable/10/sys/sys/pmc.h stable/10/sys/sys/priority.h stable/10/sys/sys/priv.h stable/10/sys/sys/proc.h stable/10/sys/sys/procctl.h stable/10/sys/sys/shm.h stable/10/sys/sys/sockio.h stable/10/sys/sys/soundcard.h stable/10/sys/sys/sx.h stable/10/sys/sys/sysctl.h stable/10/sys/sys/user.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.c Tue May 17 15:18:01 2016 (r300060) @@ -1209,7 +1209,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, * that requires host assistance for completion. * While handling the message phase(s), we will be * notified by the sequencer after each byte is - * transfered so we can track bus phase changes. + * transferred so we can track bus phase changes. * * If this is the first time we've seen a HOST_MSG_LOOP * interrupt, initialize the state of the host message @@ -1623,7 +1623,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd /* * Although the driver does not care about the * 'Selection in Progress' status bit, the busy - * LED does. SELINGO is only cleared by a sucessfull + * LED does. SELINGO is only cleared by a successful * selection, so we must manually clear it to insure * the LED turns off just incase no future successful * selections occur (e.g. no devices on the bus). @@ -2699,7 +2699,7 @@ ahd_clear_critical_section(struct ahd_so ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) & ~STEP); ahd_outb(ahd, SIMODE1, simode1); /* - * SCSIINT seems to glitch occassionally when + * SCSIINT seems to glitch occasionally when * the interrupt masks are restored. Clear SCSIINT * one more time so that only persistent errors * are seen as a real interrupt. @@ -3029,7 +3029,7 @@ ahd_validate_width(struct ahd_softc *ahd /* * Update the bitmask of targets for which the controller should - * negotiate with at the next convenient oportunity. This currently + * negotiate with at the next convenient opportunity. This currently * means the next time we send the initial identify messages for * a new transaction. */ @@ -3380,7 +3380,7 @@ ahd_update_neg_table(struct ahd_softc *a /* * During packetized transfers, the target will - * give us the oportunity to send command packets + * give us the opportunity to send command packets * without us asserting attention. */ if ((tinfo->ppr_options & MSG_EXT_PPR_IU_REQ) == 0) @@ -4845,7 +4845,7 @@ ahd_handle_msg_reject(struct ahd_softc * /* * Requeue all tagged commands for this target - * currently in our posession so they can be + * currently in our possession so they can be * converted to untagged commands. */ ahd_search_qinfifo(ahd, SCB_GET_TARGET(ahd, scb), @@ -5498,7 +5498,7 @@ ahd_shutdown(void *arg) /* * Reset the controller and record some information about it * that is only available just after a reset. If "reinit" is - * non-zero, this reset occured after initial configuration + * non-zero, this reset occurred after initial configuration * and the caller requests that the chip be fully reinitialized * to a runable state. Chip interrupts are *not* enabled after * a reinitialization. The caller must enable interrupts via @@ -5751,7 +5751,7 @@ ahd_init_scbdata(struct ahd_softc *ahd) } /* - * Note that we were successfull + * Note that we were successful */ return (0); @@ -8794,7 +8794,7 @@ ahd_check_patch(struct ahd_softc *ahd, s cur_patch += cur_patch->skip_patch; } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch++; @@ -9673,7 +9673,7 @@ ahd_write_seeprom(struct ahd_softc *ahd, return (error); /* - * Write the data. If we don't get throught the loop at + * Write the data. If we don't get through the loop at * least once, the arguments were invalid. */ retval = EINVAL; Modified: stable/10/sys/dev/aic7xxx/aic79xx.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.h Tue May 17 15:18:01 2016 (r300060) @@ -478,7 +478,7 @@ struct hardware_scb { * each S/G element is expired, its datacnt field is checked to see * if the LAST_SEG flag is set. If so, SG_LIST_NULL is set in the * residual sg ptr and the transfer is considered complete. If the - * sequencer determines that there is a residual in the tranfer, or + * sequencer determines that there is a residual in the transfer, or * there is non-zero status, it will set the SG_STATUS_VALID flag in * sgptr and dma the scb back into host memory. To sumarize: * @@ -486,7 +486,7 @@ struct hardware_scb { * o A residual has occurred if SG_FULL_RESID is set in sgptr, * or residual_sgptr does not have SG_LIST_NULL set. * - * o We are transfering the last segment if residual_datacnt has + * o We are transferring the last segment if residual_datacnt has * the SG_LAST_SEG flag set. * * Host: @@ -529,7 +529,7 @@ struct hardware_scb { */ /* - * Definition of a scatter/gather element as transfered to the controller. + * Definition of a scatter/gather element as transferred to the controller. * The aic7xxx chips only support a 24bit length. We use the top byte of * the length to store additional address bits and a flag to indicate * that a given segment terminates the transfer. This gives us an Modified: stable/10/sys/dev/aic7xxx/aic79xx.reg ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.reg Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.reg Tue May 17 15:18:01 2016 (r300060) @@ -283,7 +283,7 @@ register HS_MAILBOX { } /* - * Sequencer Interupt Status + * Sequencer Interrupt Status */ register SEQINTSTAT { address 0x00C @@ -643,7 +643,7 @@ register DCHRXMSG0 { } /* - * CMC Recieve Message 0 + * CMC Receive Message 0 */ register CMCRXMSG0 { address 0x090 @@ -654,7 +654,7 @@ register CMCRXMSG0 { } /* - * Overlay Recieve Message 0 + * Overlay Receive Message 0 */ register OVLYRXMSG0 { address 0x090 @@ -690,7 +690,7 @@ register DCHRXMSG1 { } /* - * CMC Recieve Message 1 + * CMC Receive Message 1 */ register CMCRXMSG1 { address 0x091 @@ -700,7 +700,7 @@ register CMCRXMSG1 { } /* - * Overlay Recieve Message 1 + * Overlay Receive Message 1 */ register OVLYRXMSG1 { address 0x091 @@ -735,7 +735,7 @@ register DCHRXMSG2 { } /* - * CMC Recieve Message 2 + * CMC Receive Message 2 */ register CMCRXMSG2 { address 0x092 @@ -745,7 +745,7 @@ register CMCRXMSG2 { } /* - * Overlay Recieve Message 2 + * Overlay Receive Message 2 */ register OVLYRXMSG2 { address 0x092 @@ -774,7 +774,7 @@ register DCHRXMSG3 { } /* - * CMC Recieve Message 3 + * CMC Receive Message 3 */ register CMCRXMSG3 { address 0x093 @@ -784,7 +784,7 @@ register CMCRXMSG3 { } /* - * Overlay Recieve Message 3 + * Overlay Receive Message 3 */ register OVLYRXMSG3 { address 0x093 @@ -1192,7 +1192,7 @@ register TARGPCISTAT { /* * LQ Packet In - * The last LQ Packet recieved + * The last LQ Packet received */ register LQIN { address 0x020 @@ -2424,7 +2424,7 @@ register IOPDNCTL { } /* - * Shaddow Host Address. + * Shadow Host Address. */ register SHADDR { address 0x060 @@ -3726,7 +3726,7 @@ scratch_ram { /* * The maximum amount of time to wait, when interrupt coalescing - * is enabled, before issueing a CMDCMPLT interrupt for a completed + * is enabled, before issuing a CMDCMPLT interrupt for a completed * command. */ INT_COALESCING_TIMER { Modified: stable/10/sys/dev/aic7xxx/aic79xx.seq ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.seq Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.seq Tue May 17 15:18:01 2016 (r300060) @@ -217,7 +217,7 @@ BEGIN_CRITICAL; scbdma_tohost_done: test CCSCBCTL, CCARREN jz fill_qoutfifo_dmadone; /* - * An SCB has been succesfully uploaded to the host. + * An SCB has been successfully uploaded to the host. * If the SCB was uploaded for some reason other than * bad SCSI status (currently only for underruns), we * queue the SCB for normal completion. Otherwise, we @@ -960,7 +960,7 @@ p_status_okay: * This is done to allow the host to send messages outside of an identify * sequence while protecting the seqencer from testing the MK_MESSAGE bit * on an SCB that might not be for the current nexus. (For example, a - * BDR message in responce to a bad reselection would leave us pointed to + * BDR message in response to a bad reselection would leave us pointed to * an SCB that doesn't have anything to do with the current target). * * Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag, @@ -1507,7 +1507,7 @@ service_fifo: * If the other FIFO needs loading, then it * must not have claimed the S/G cache yet * (SG_CACHE_AVAIL would have been cleared in - * the orginal FIFO mode and we test this above). + * the original FIFO mode and we test this above). * Return to the idle loop so we can process the * FIFO not currently on the bus first. */ @@ -1551,7 +1551,7 @@ idle_sg_avail: test DFSTATUS, PRELOAD_AVAIL jz return; /* * On the A, preloading a segment before HDMAENACK - * comes true can clobber the shaddow address of the + * comes true can clobber the shadow address of the * first segment in the S/G FIFO. Wait until it is * safe to proceed. */ @@ -2004,10 +2004,10 @@ pkt_handle_xfer: * Defer handling of this NONPACKREQ until we * can be sure it pertains to this FIFO. SAVEPTRS * will not be asserted if the NONPACKREQ is for us, - * so we must simulate it if shaddow is valid. If - * shaddow is not valid, keep running this FIFO until we + * so we must simulate it if shadow is valid. If + * shadow is not valid, keep running this FIFO until we * have satisfied the transfer by loading segments and - * waiting for either shaddow valid or last_seg_done. + * waiting for either shadow valid or last_seg_done. */ test MDFFSTAT, SHVALID jnz pkt_saveptrs; pkt_service_fifo: @@ -2171,7 +2171,7 @@ pkt_status_check_nonpackreq: /* * The unexpected nonpkt phase handler assumes that any * data channel use will have a FIFO reference count. It - * turns out that the status handler doesn't need a refernce + * turns out that the status handler doesn't need a references * count since the status received flag, and thus completion * processing, cannot be set until the handler is finished. * We increment the count here to make the nonpkt handler Modified: stable/10/sys/dev/aic7xxx/aic79xx_inline.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx_inline.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx_inline.h Tue May 17 15:18:01 2016 (r300060) @@ -417,7 +417,7 @@ ahd_targetcmd_offset(struct ahd_softc *a - (uint8_t *)ahd->qoutfifo); } -/*********************** Miscelaneous Support Functions ***********************/ +/********************** Miscellaneous Support Functions ***********************/ static __inline void ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb); static __inline void ahd_update_residual(struct ahd_softc *ahd, @@ -534,7 +534,7 @@ static __inline void ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) { /* - * Write low byte first to accomodate registers + * Write low byte first to accommodate registers * such as PRGMCNT where the order maters. */ ahd_outb(ahd, port, value & 0xFF); Modified: stable/10/sys/dev/aic7xxx/aic79xx_pci.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx_pci.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx_pci.c Tue May 17 15:18:01 2016 (r300060) @@ -491,7 +491,7 @@ ahd_pci_test_register_access(struct ahd_ * Next create a situation where write combining * or read prefetching could be initiated by the * CPU or host bridge. Our device does not support - * either, so look for data corruption and/or flaged + * either, so look for data corruption and/or flagged * PCI errors. First pause without causing another * chip reset. */ @@ -1013,7 +1013,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) | AHD_FAINT_LED_BUG; /* - * IO Cell paramter setup. + * IO Cell parameter setup. */ AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29); @@ -1034,7 +1034,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) | AHD_BUSFREEREV_BUG; /* - * IO Cell paramter setup. + * IO Cell parameter setup. */ AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29); AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB); Modified: stable/10/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.c Tue May 17 15:18:01 2016 (r300060) @@ -116,7 +116,7 @@ static const u_int num_phases = NUM_ELEM /* * Valid SCSIRATE values. (p. 3-17) - * Provides a mapping of tranfer periods in ns to the proper value to + * Provides a mapping of transfer periods in ns to the proper value to * stick in the scsixfer reg. */ static struct ahc_syncrate ahc_syncrates[] = @@ -682,7 +682,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, * that requires host assistance for completion. * While handling the message phase(s), we will be * notified by the sequencer after each byte is - * transfered so we can track bus phase changes. + * transferred so we can track bus phase changes. * * If this is the first time we've seen a HOST_MSG_LOOP * interrupt, initialize the state of the host message @@ -925,7 +925,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, scbptr, ahc_inb(ahc, ARG_1), ahc->scb_data->hscbs[scbptr].tag); ahc_dump_card_state(ahc); - panic("for saftey"); + panic("for safety"); break; } case OUT_OF_RANGE: @@ -1171,7 +1171,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc /* * Although the driver does not care about the * 'Selection in Progress' status bit, the busy - * LED does. SELINGO is only cleared by a sucessfull + * LED does. SELINGO is only cleared by a successful * selection, so we must manually clear it to insure * the LED turns off just incase no future successful * selections occur (e.g. no devices on the bus). @@ -1381,7 +1381,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc if (lastphase != P_BUSFREE) { /* * Renegotiate with this device at the - * next oportunity just in case this busfree + * next opportunity just in case this busfree * is due to a negotiation mismatch with the * device. */ @@ -1857,7 +1857,7 @@ ahc_validate_width(struct ahc_softc *ahc /* * Update the bitmask of targets for which the controller should - * negotiate with at the next convenient oportunity. This currently + * negotiate with at the next convenient opportunity. This currently * means the next time we send the initial identify messages for * a new transaction. */ @@ -3627,7 +3627,7 @@ ahc_handle_msg_reject(struct ahc_softc * /* * Requeue all tagged commands for this target - * currently in our posession so they can be + * currently in our possession so they can be * converted to untagged commands. */ ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb), @@ -4138,7 +4138,7 @@ ahc_shutdown(void *arg) /* * Reset the controller and record some information about it * that is only available just after a reset. If "reinit" is - * non-zero, this reset occured after initial configuration + * non-zero, this reset occurred after initial configuration * and the caller requests that the chip be fully reinitialized * to a runable state. Chip interrupts are *not* enabled after * a reinitialization. The caller must enable interrupts via @@ -4460,7 +4460,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) ahc->next_queued_scb = ahc_get_scb(ahc); /* - * Note that we were successfull + * Note that we were successful */ return (0); @@ -6549,7 +6549,7 @@ ahc_check_patch(struct ahc_softc *ahc, s cur_patch += cur_patch->skip_patch; } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch++; @@ -7253,7 +7253,7 @@ bus_reset: ahc_outb(ahc, SCBPTR, saved_scbptr); aic_scb_timer_reset(scb, 2 * 1000); } else { - /* Go "immediatly" to the bus reset */ + /* Go "immediately" to the bus reset */ /* This shouldn't happen */ ahc_set_recoveryscb(ahc, scb); ahc_print_path(ahc, scb); Modified: stable/10/sys/dev/aic7xxx/aic7xxx.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.h Tue May 17 15:18:01 2016 (r300060) @@ -448,7 +448,7 @@ struct hardware_scb { * each S/G element is expired, its datacnt field is checked to see * if the LAST_SEG flag is set. If so, SG_LIST_NULL is set in the * residual sg ptr and the transfer is considered complete. If the - * sequencer determines that there is a residual in the tranfer, it + * sequencer determines that there is a residual in the transfer, it * will set the SG_RESID_VALID flag in sgptr and dma the scb back into * host memory. To sumarize: * @@ -456,7 +456,7 @@ struct hardware_scb { * o A residual has occurred if SG_FULL_RESID is set in sgptr, * or residual_sgptr does not have SG_LIST_NULL set. * - * o We are transfering the last segment if residual_datacnt has + * o We are transferring the last segment if residual_datacnt has * the SG_LAST_SEG flag set. * * Host: @@ -510,7 +510,7 @@ struct hardware_scb { */ /* - * Definition of a scatter/gather element as transfered to the controller. + * Definition of a scatter/gather element as transferred to the controller. * The aic7xxx chips only support a 24bit length. We use the top byte of * the length to store additional address bits and a flag to indicate * that a given segment terminates the transfer. This gives us an Modified: stable/10/sys/dev/aic7xxx/aic7xxx.reg ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.reg Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.reg Tue May 17 15:18:01 2016 (r300060) @@ -329,7 +329,7 @@ register SSTAT2 { address 0x00d access_mode RO field OVERRUN 0x80 - field SHVALID 0x40 /* Shaddow Layer non-zero */ + field SHVALID 0x40 /* Shadow Layer non-zero */ field EXP_ACTIVE 0x10 /* SCSI Expander Active */ field CRCVALERR 0x08 /* CRC doesn't match (U3 only) */ field CRCENDERR 0x04 /* No terminal CRC packet (U3 only) */ Modified: stable/10/sys/dev/aic7xxx/aic7xxx.seq ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.seq Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.seq Tue May 17 15:18:01 2016 (r300060) @@ -60,7 +60,7 @@ PREFIX = "ahc_" * use byte 27 of the SCB as a psuedo-next pointer and to thread a list * of SCBs that are awaiting selection. Since 0-0xfe are valid SCB indexes, * SCB_LIST_NULL is 0xff which is out of range. An entry is also added to - * this list everytime a request sense occurs or after completing a non-tagged + * this list every time a request sense occurs or after completing a non-tagged * command for which a second SCB has been queued. The sequencer will * automatically consume the entries. */ @@ -1489,7 +1489,7 @@ p_status_okay: * This is done to allow the host to send messages outside of an identify * sequence while protecting the seqencer from testing the MK_MESSAGE bit * on an SCB that might not be for the current nexus. (For example, a - * BDR message in responce to a bad reselection would leave us pointed to + * BDR message in response to a bad reselection would leave us pointed to * an SCB that doesn't have anything to do with the current target). * * Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag, Modified: stable/10/sys/dev/aic7xxx/aic7xxx_inline.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx_inline.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx_inline.h Tue May 17 15:18:01 2016 (r300060) @@ -229,7 +229,7 @@ ahc_name(struct ahc_softc *ahc) return (ahc->name); } -/*********************** Miscelaneous Support Functions ***********************/ +/********************** Miscellaneous Support Functions ***********************/ static __inline void ahc_update_residual(struct ahc_softc *ahc, struct scb *scb); Modified: stable/10/sys/dev/aic7xxx/aic7xxx_pci.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx_pci.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx_pci.c Tue May 17 15:18:01 2016 (r300060) @@ -865,7 +865,7 @@ ahc_pci_config(struct ahc_softc *ahc, st ahc->bus_suspend = ahc_pci_suspend; ahc->bus_resume = ahc_pci_resume; - /* Remeber how the card was setup in case there is no SEEPROM */ + /* Remember how the card was setup in case there is no SEEPROM */ if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) { ahc_pause(ahc); if ((ahc->features & AHC_ULTRA2) != 0) @@ -936,7 +936,7 @@ ahc_pci_config(struct ahc_softc *ahc, st } /* - * We cannot perform ULTRA speeds without the presense + * We cannot perform ULTRA speeds without the presence * of the external precision resistor. */ if ((ahc->features & AHC_ULTRA) != 0) { @@ -1054,7 +1054,7 @@ ahc_pci_config(struct ahc_softc *ahc, st } /* - * Test for the presense of external sram in an + * Test for the presence of external sram in an * "unshared" configuration. */ static int Modified: stable/10/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aicasm/aicasm.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aicasm/aicasm.c Tue May 17 15:18:01 2016 (r300060) @@ -668,7 +668,7 @@ check_patch(patch_t **start_patch, unsig cur_patch = STAILQ_NEXT(cur_patch, links); } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch = STAILQ_NEXT(cur_patch, links); Modified: stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y ============================================================================== --- stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y Tue May 17 15:18:01 2016 (r300060) @@ -1286,8 +1286,8 @@ code: ; /* - * This grammer differs from the one in the aic7xxx - * reference manual since the grammer listed there is + * This grammar differs from the one in the aic7xxx + * reference manual since the grammar listed there is * ambiguous and causes a shift/reduce conflict. * It also seems more logical as the "immediate" * argument is listed as the second arg like the @@ -1753,7 +1753,7 @@ format_3_instr(int opcode, symbol_ref_t instr = seq_alloc(); f3_instr = &instr->format.format3; if (address->symbol == NULL) { - /* 'dot' referrence. Use the current instruction pointer */ + /* 'dot' reference. Use the current instruction pointer */ addr = instruction_ptr + address->offset; } else if (address->symbol->type == UNINITIALIZED) { /* forward reference */ Modified: stable/10/sys/dev/ciss/ciss.c ============================================================================== --- stable/10/sys/dev/ciss/ciss.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/ciss/ciss.c Tue May 17 15:18:01 2016 (r300060) @@ -464,7 +464,7 @@ ciss_attach(device_t dev) ciss_initq_notify(sc); /* - * Initalize device sysctls. + * Initialize device sysctls. */ ciss_init_sysctl(sc); @@ -619,7 +619,7 @@ ciss_init_pci(struct ciss_softc *sc) /* * XXX Big hammer, masks/unmasks all possible interrupts. This should * work on all hardware variants. Need to add code to handle the - * "controller crashed" interupt bit that this unmasks. + * "controller crashed" interrupt bit that this unmasks. */ sqmask = ~0; } @@ -4499,7 +4499,7 @@ ciss_name_ldrive_org(int org) case CISS_LDRIVE_RAIDADG: return("RAID ADG"); } - return("unkown"); + return("unknown"); } /************************************************************************ Modified: stable/10/sys/dev/drm2/radeon/radeon_fb.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_fb.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/drm2/radeon/radeon_fb.c Tue May 17 15:18:01 2016 (r300060) @@ -228,7 +228,7 @@ static int radeonfb_create(struct radeon ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); if (ret) { - DRM_ERROR("failed to initalise framebuffer %d\n", ret); + DRM_ERROR("failed to initialise framebuffer %d\n", ret); goto out_unref; } Modified: stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Tue May 17 15:18:01 2016 (r300060) @@ -299,7 +299,7 @@ ttm_bo_vm_ctor(void *handle, vm_ooffset_ * acquired either in ttm_bo_mmap() or ttm_bo_vm_open(). It's * then released in ttm_bo_vm_close(). * - * Here, this function is called during mmap() intialization. + * Here, this function is called during mmap() initialization. * Thus, the reference acquired in ttm_bo_mmap_single() is * sufficient. */ Modified: stable/10/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/10/sys/dev/hptiop/hptiop.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/hptiop/hptiop.c Tue May 17 15:18:01 2016 (r300060) @@ -2405,7 +2405,7 @@ static void hptiop_post_req_itl(struct h iop_req32 = BUS_SPACE_RD4_ITL(inbound_queue); if (iop_req32 == IOPMU_QUEUE_EMPTY) { - device_printf(hba->pcidev, "invaild req offset\n"); + device_printf(hba->pcidev, "invalid req offset\n"); ccb->ccb_h.status = CAM_BUSY; bus_dmamap_unload(hba->io_dmat, srb->dma_map); hptiop_free_srb(hba, srb); Modified: stable/10/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_mod.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/hwpmc/hwpmc_mod.c Tue May 17 15:18:01 2016 (r300060) @@ -1128,7 +1128,7 @@ pmc_detach_one_process(struct proc *p, s pmclog_process_pmcdetach(pm, p->p_pid); /* - * If there are no PMCs targetting this process, we remove its + * If there are no PMCs targeting this process, we remove its * descriptor from the target hash table and unset the P_HWPMC * flag in the struct proc. */ @@ -1237,7 +1237,7 @@ pmc_process_csw_in(struct thread *td) p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[pmc,%d] wierd CPU id %d", __LINE__, cpu)); + ("[pmc,%d] weird CPU id %d", __LINE__, cpu)); pc = pmc_pcpu[cpu]; @@ -1382,7 +1382,7 @@ pmc_process_csw_out(struct thread *td) p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[pmc,%d wierd CPU id %d", __LINE__, cpu)); + ("[pmc,%d weird CPU id %d", __LINE__, cpu)); pc = pmc_pcpu[cpu]; @@ -1912,7 +1912,7 @@ pmc_hook_handler(struct thread *td, int /* * Log the exec event to all monitoring owners. Skip - * owners who have already recieved the event because + * owners who have already received the event because * they had system sampling PMCs active. */ for (ri = 0; ri < md->pmd_npmc; ri++) @@ -1938,7 +1938,7 @@ pmc_hook_handler(struct thread *td, int /* * If the newly exec()'ed process has a different credential * than before, allow it to be the target of a PMC only if - * the PMC's owner has sufficient priviledge. + * the PMC's owner has sufficient privilege. */ for (ri = 0; ri < md->pmd_npmc; ri++) @@ -4424,7 +4424,7 @@ pmc_process_exit(void *arg __unused, str * process, we would have context switched IN at some prior * point. However, with PREEMPTION, kernel mode context * switches may happen any time, so we want to disable a - * context switch OUT till we get any PMCs targetting this + * context switch OUT till we get any PMCs targeting this * process off the hardware. * * We also need to atomically remove this process' @@ -4527,7 +4527,7 @@ pmc_process_exit(void *arg __unused, str /* * Unlink this process from the PMCs that are - * targetting it. This will send a signal to + * targeting it. This will send a signal to * all PMC owner's whose PMCs are orphaned. * * Log PMC value at exit time if requested. Modified: stable/10/sys/dev/isci/scil/scic_phy.h ============================================================================== --- stable/10/sys/dev/isci/scil/scic_phy.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/isci/scil/scic_phy.h Tue May 17 15:18:01 2016 (r300060) @@ -308,7 +308,7 @@ SCI_STATUS scic_sas_phy_get_properties( /** * @brief This method will enable the user to retrieve information - * specific to a SATA phy, such as: the recieved signature + * specific to a SATA phy, such as: the received signature * FIS, if a port selector is present, etc. * * @param[in] phy this parameter specifies the phy for which to Modified: stable/10/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- stable/10/sys/dev/isci/scil/scic_sds_phy.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/isci/scil/scic_sds_phy.c Tue May 17 15:18:01 2016 (r300060) @@ -749,7 +749,7 @@ SCI_STATUS scic_sds_phy_initialize( this_phy, link_layer_registers )); - // Perfrom the initialization of the TL hardware + // Perform the initialization of the TL hardware scic_sds_phy_transport_layer_initialization(this_phy, transport_layer_registers); // Perofrm the initialization of the PE hardware @@ -1029,7 +1029,7 @@ SCI_STATUS scic_sds_phy_reset( } /** - * @brief This method will process the event code recieved. + * @brief This method will process the event code received. * * @param[in] this_phy * @param[in] event_code @@ -1052,7 +1052,7 @@ SCI_STATUS scic_sds_phy_event_handler( } /** - * @brief This method will process the frame index recieved. + * @brief This method will process the frame index received. * * @param[in] this_phy * @param[in] frame_index @@ -1754,7 +1754,7 @@ SCI_STATUS scic_sds_phy_default_frame_ha SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY, - "SCIC Phy 0x%08x recieved unexpected frame data %d while in state %d\n", + "SCIC Phy 0x%08x received unexpected frame data %d while in state %d\n", this_phy, frame_index, sci_base_state_machine_get_state(&this_phy->parent.state_machine) )); @@ -1866,7 +1866,7 @@ SCI_STATUS scic_sds_phy_stopped_state_st * This method takes the SCIC_SDS_PHY from a stopped state and destroys it. * - This function takes no action. * - * @todo Shouldnt this function transition the SCI_BASE_PHY::state_machine to + * @todo Shouldn't this function transition the SCI_BASE_PHY::state_machine to * the SCI_BASE_PHY_STATE_FINAL? * * @param[in] phy This is the SCI_BASE_PHY object which is cast into a @@ -1964,7 +1964,7 @@ SCI_STATUS scic_sds_phy_ready_state_rese * - decoded event is a link failure * - transition the SCIC_SDS_PHY back to the SCI_BASE_PHY_STATE_STARTING * state. - * - any other event recived will report a warning message + * - any other event received will report a warning message * * @param[in] phy This is the SCIC_SDS_PHY object which has received the * event. @@ -2020,7 +2020,7 @@ SCI_STATUS scic_sds_phy_ready_state_even SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "SCIC PHY 0x%x ready state machine recieved unexpected event_code %x\n", + "SCIC PHY 0x%x ready state machine received unexpected event_code %x\n", this_phy, event_code )); result = SCI_FAILURE_INVALID_STATE; @@ -2066,7 +2066,7 @@ SCI_STATUS scic_sds_phy_resetting_state_ SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "SCIC PHY 0x%x resetting state machine recieved unexpected event_code %x\n", + "SCIC PHY 0x%x resetting state machine received unexpected event_code %x\n", this_phy, event_code )); @@ -2691,7 +2691,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2772,7 +2772,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2834,7 +2834,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2879,7 +2879,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2935,7 +2935,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3003,7 +3003,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3090,7 +3090,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3147,7 +3147,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3246,7 +3246,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES, - "PHY starting substate machine recieved unexpected frame id %x\n", + "PHY starting substate machine received unexpected frame id %x\n", frame_index )); } @@ -3332,7 +3332,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES, - "PHY starting substate machine recieved unexpected frame id %x\n", + "PHY starting substate machine received unexpected frame id %x\n", frame_index )); } Modified: stable/10/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- stable/10/sys/dev/pccbb/pccbb_pci.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/pccbb/pccbb_pci.c Tue May 17 15:18:01 2016 (r300060) @@ -366,7 +366,7 @@ cbb_pci_attach(device_t brdev) SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "memory", CTLFLAG_RD, &sc->subbus, 0, "Memory window open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "premem", - CTLFLAG_RD, &sc->subbus, 0, "Prefetch memroy window open"); + CTLFLAG_RD, &sc->subbus, 0, "Prefetch memory window open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "io1", CTLFLAG_RD, &sc->subbus, 0, "io range 1 open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "io2", Modified: stable/10/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/10/sys/dev/wbwd/wbwd.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wbwd/wbwd.c Tue May 17 15:18:01 2016 (r300060) @@ -754,7 +754,7 @@ wb_attach(device_t dev) sc = device_get_softc(dev); KASSERT(sc->ext_cfg_enter_f != NULL && sc->ext_cfg_exit_f != NULL, - ("%s: successfull probe result but not setup correctly", __func__)); + ("%s: successful probe result but not setup correctly", __func__)); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); Modified: stable/10/sys/dev/wtap/if_wtap.c ============================================================================== --- stable/10/sys/dev/wtap/if_wtap.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wtap/if_wtap.c Tue May 17 15:18:01 2016 (r300060) @@ -131,7 +131,7 @@ wtap_node_ioctl(struct cdev *dev, u_long switch(cmd) { default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } return error; Modified: stable/10/sys/dev/wtap/if_wtap_module.c ============================================================================== --- stable/10/sys/dev/wtap/if_wtap_module.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wtap/if_wtap_module.c Tue May 17 15:18:01 2016 (r300060) @@ -89,7 +89,7 @@ MALLOC_DEFINE(M_WTAP, "wtap", "wtap wireless simulator"); MALLOC_DEFINE(M_WTAP_PACKET, "wtap packet", "wtap wireless simulator packet"); MALLOC_DEFINE(M_WTAP_RXBUF, "wtap rxbuf", - "wtap wireless simulator recieve buffer"); + "wtap wireless simulator receive buffer"); MALLOC_DEFINE(M_WTAP_PLUGIN, "wtap plugin", "wtap wireless simulator plugin"); static struct wtap_hal *hal; @@ -123,7 +123,7 @@ wtap_ioctl(struct cdev *dev, u_long cmd, error = EINVAL; break; default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } Modified: stable/10/sys/dev/wtap/plugins/visibility.c ============================================================================== --- stable/10/sys/dev/wtap/plugins/visibility.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wtap/plugins/visibility.c Tue May 17 15:18:01 2016 (r300060) @@ -231,7 +231,7 @@ vis_ioctl(struct cdev *sdev, u_long cmd, #endif break; default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/ata.h Tue May 17 15:18:01 2016 (r300060) @@ -377,10 +377,10 @@ struct ata_params { #define ATA_NCQ_NON_DATA 0x63 /* NCQ non-data command */ #define ATA_SEND_FPDMA_QUEUED 0x64 /* send DMA NCQ */ #define ATA_SFPDMA_DSM 0x00 /* Data set management */ -#define ATA_SFPDMA_DSM_TRIM 0x01 /* Set trim bit in auxilary */ +#define ATA_SFPDMA_DSM_TRIM 0x01 /* Set trim bit in auxiliary */ #define ATA_SFPDMA_HYBRID_EVICT 0x01 /* Hybrid Evict */ #define ATA_SFPDMA_WLDMA 0x02 /* Write Log DMA EXT */ -#define ATA_RECV_FPDMA_QUEUED 0x65 /* recieve DMA NCQ */ +#define ATA_RECV_FPDMA_QUEUED 0x65 /* receive DMA NCQ */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ Modified: stable/10/sys/sys/buf.h ============================================================================== --- stable/10/sys/sys/buf.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/buf.h Tue May 17 15:18:01 2016 (r300060) @@ -204,7 +204,7 @@ struct buf { #define B_UNMAPPED 0x00000800 /* KVA is not mapped. */ #define B_KVAALLOC 0x00001000 /* But allocated. */ #define B_INVAL 0x00002000 /* Does not contain valid info. */ -#define B_BARRIER 0x00004000 /* Write this and all preceeding first. */ +#define B_BARRIER 0x00004000 /* Write this and all preceding first. */ #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ Modified: stable/10/sys/sys/buf_ring.h ============================================================================== --- stable/10/sys/sys/buf_ring.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/buf_ring.h Tue May 17 15:18:01 2016 (r300060) @@ -98,7 +98,7 @@ buf_ring_enqueue(struct buf_ring *br, vo /* * If there are other enqueues in progress - * that preceeded us, we need to wait for them + * that preceded us, we need to wait for them * to complete */ while (br->br_prod_tail != prod_head) @@ -135,7 +135,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) #endif /* * If there are other dequeues in progress - * that preceeded us, we need to wait for them + * that preceded us, we need to wait for them * to complete */ while (br->br_cons_tail != cons_head) Modified: stable/10/sys/sys/iconv.h ============================================================================== --- stable/10/sys/sys/iconv.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/iconv.h Tue May 17 15:18:01 2016 (r300060) @@ -65,7 +65,7 @@ struct iconv_cspair_info { }; /* - * Paramters for 'add' sysctl + * Parameters for 'add' sysctl */ #define ICONV_ADD_VER 1 Modified: stable/10/sys/sys/imgact_binmisc.h ============================================================================== --- stable/10/sys/sys/imgact_binmisc.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/imgact_binmisc.h Tue May 17 15:18:01 2016 (r300060) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 17 15:21:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44FF4B3F331; Tue, 17 May 2016 15:21:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1605065658; Tue, 17 May 2016 15:21:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HFLIxw081106; Tue, 17 May 2016 15:21:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HFLHUB081102; Tue, 17 May 2016 15:21:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605171521.u4HFLHUB081102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 May 2016 15:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300061 - in head/sys: conf dev/iscsi modules/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 15:21:19 -0000 Author: trasz Date: Tue May 17 15:21:17 2016 New Revision: 300061 URL: https://svnweb.freebsd.org/changeset/base/300061 Log: Rename icl_proxy.c to icl_soft_proxy.c, to make it clear it's a part of software ICL backend. MFC after: 1 month Sponsored by: The FreeBSD Foundation Added: head/sys/dev/iscsi/icl_soft_proxy.c - copied unchanged from r300060, head/sys/dev/iscsi/icl_proxy.c Deleted: head/sys/dev/iscsi/icl_proxy.c Modified: head/sys/conf/files head/sys/dev/iscsi/icl.h head/sys/modules/iscsi/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 17 15:18:01 2016 (r300060) +++ head/sys/conf/files Tue May 17 15:21:17 2016 (r300061) @@ -1629,8 +1629,8 @@ ipw_monitor.fw optional ipwmonitorfw | clean "ipw_monitor.fw" dev/iscsi/icl.c optional iscsi | ctl dev/iscsi/icl_conn_if.m optional iscsi | ctl -dev/iscsi/icl_proxy.c optional iscsi | ctl dev/iscsi/icl_soft.c optional iscsi | ctl +dev/iscsi/icl_soft_proxy.c optional iscsi | ctl dev/iscsi/iscsi.c optional iscsi scbus dev/iscsi_initiator/iscsi.c optional iscsi_initiator scbus dev/iscsi_initiator/iscsi_subr.c optional iscsi_initiator scbus Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Tue May 17 15:18:01 2016 (r300060) +++ head/sys/dev/iscsi/icl.h Tue May 17 15:21:17 2016 (r300061) @@ -150,7 +150,8 @@ int icl_listen_add(struct icl_listen * int icl_listen_remove(struct icl_listen *il, struct sockaddr *sa); /* - * Those two are not a public API; only to be used between icl_soft.c and icl_proxy.c. + * Those two are not a public API; only to be used between icl_soft.c + * and icl_soft_proxy.c. */ int icl_soft_handoff_sock(struct icl_conn *ic, struct socket *so); int icl_soft_proxy_connect(struct icl_conn *ic, int domain, Copied: head/sys/dev/iscsi/icl_soft_proxy.c (from r300060, head/sys/dev/iscsi/icl_proxy.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iscsi/icl_soft_proxy.c Tue May 17 15:21:17 2016 (r300061, copy of r300060, head/sys/dev/iscsi/icl_proxy.c) @@ -0,0 +1,375 @@ +/*- + * Copyright (c) 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Edward Tomasz Napierala under sponsorship + * from the FreeBSD Foundation. + * + * 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. + * + */ +/*- + * Copyright (c) 1982, 1986, 1989, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * sendfile(2) and related extensions: + * Copyright (c) 1998, David Greenman. 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. + * 4. 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. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 + */ + +/* + * iSCSI Common Layer, kernel proxy part. + */ + +#ifdef ICL_KERNEL_PROXY + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct icl_listen_sock { + TAILQ_ENTRY(icl_listen_sock) ils_next; + struct icl_listen *ils_listen; + struct socket *ils_socket; + bool ils_running; + bool ils_disconnecting; + int ils_id; +}; + +struct icl_listen { + TAILQ_HEAD(, icl_listen_sock) il_sockets; + struct sx il_lock; + void (*il_accept)(struct socket *, + struct sockaddr *, int); +}; + +static MALLOC_DEFINE(M_ICL_PROXY, "ICL_PROXY", "iSCSI common layer proxy"); + +int +icl_soft_proxy_connect(struct icl_conn *ic, int domain, int socktype, + int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa) +{ + struct socket *so; + int error; + int interrupted = 0; + + error = socreate(domain, &so, socktype, protocol, + curthread->td_ucred, curthread); + if (error != 0) + return (error); + + if (from_sa != NULL) { + error = sobind(so, from_sa, curthread); + if (error != 0) { + soclose(so); + return (error); + } + } + + error = soconnect(so, to_sa, curthread); + if (error != 0) { + soclose(so); + return (error); + } + + SOCK_LOCK(so); + while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { + error = msleep(&so->so_timeo, SOCK_MTX(so), PSOCK | PCATCH, + "icl_connect", 0); + if (error) { + if (error == EINTR || error == ERESTART) + interrupted = 1; + break; + } + } + if (error == 0) { + error = so->so_error; + so->so_error = 0; + } + SOCK_UNLOCK(so); + + if (error != 0) { + soclose(so); + return (error); + } + + error = icl_soft_handoff_sock(ic, so); + if (error != 0) + soclose(so); + + return (error); +} + +struct icl_listen * +icl_listen_new(void (*accept_cb)(struct socket *, struct sockaddr *, int)) +{ + struct icl_listen *il; + + il = malloc(sizeof(*il), M_ICL_PROXY, M_ZERO | M_WAITOK); + TAILQ_INIT(&il->il_sockets); + sx_init(&il->il_lock, "icl_listen"); + il->il_accept = accept_cb; + + return (il); +} + +void +icl_listen_free(struct icl_listen *il) +{ + struct icl_listen_sock *ils; + + sx_xlock(&il->il_lock); + while (!TAILQ_EMPTY(&il->il_sockets)) { + ils = TAILQ_FIRST(&il->il_sockets); + while (ils->ils_running) { + ICL_DEBUG("waiting for accept thread to terminate"); + sx_xunlock(&il->il_lock); + ils->ils_disconnecting = true; + wakeup(&ils->ils_socket->so_timeo); + pause("icl_unlisten", 1 * hz); + sx_xlock(&il->il_lock); + } + + TAILQ_REMOVE(&il->il_sockets, ils, ils_next); + soclose(ils->ils_socket); + free(ils, M_ICL_PROXY); + } + sx_xunlock(&il->il_lock); + + free(il, M_ICL_PROXY); +} + +/* + * XXX: Doing accept in a separate thread in each socket might not be the best way + * to do stuff, but it's pretty clean and debuggable - and you probably won't + * have hundreds of listening sockets anyway. + */ +static void +icl_accept_thread(void *arg) +{ + struct icl_listen_sock *ils; + struct socket *head, *so; + struct sockaddr *sa; + int error; + + ils = arg; + head = ils->ils_socket; + + ils->ils_running = true; + + for (;;) { + ACCEPT_LOCK(); + while (TAILQ_EMPTY(&head->so_comp) && head->so_error == 0 && ils->ils_disconnecting == false) { + if (head->so_rcv.sb_state & SBS_CANTRCVMORE) { + head->so_error = ECONNABORTED; + break; + } + error = msleep(&head->so_timeo, &accept_mtx, PSOCK | PCATCH, + "accept", 0); + if (error) { + ACCEPT_UNLOCK(); + ICL_WARN("msleep failed with error %d", error); + continue; + } + if (ils->ils_disconnecting) { + ACCEPT_UNLOCK(); + ICL_DEBUG("terminating"); + ils->ils_running = false; + kthread_exit(); + return; + } + } + if (head->so_error) { + error = head->so_error; + head->so_error = 0; + ACCEPT_UNLOCK(); + ICL_WARN("socket error %d", error); + continue; + } + so = TAILQ_FIRST(&head->so_comp); + KASSERT(so != NULL, ("NULL so")); + KASSERT(!(so->so_qstate & SQ_INCOMP), ("accept1: so SQ_INCOMP")); + KASSERT(so->so_qstate & SQ_COMP, ("accept1: so not SQ_COMP")); + + /* + * Before changing the flags on the socket, we have to bump the + * reference count. Otherwise, if the protocol calls sofree(), + * the socket will be released due to a zero refcount. + */ + SOCK_LOCK(so); /* soref() and so_state update */ + soref(so); /* file descriptor reference */ + + TAILQ_REMOVE(&head->so_comp, so, so_list); + head->so_qlen--; + so->so_state |= (head->so_state & SS_NBIO); + so->so_qstate &= ~SQ_COMP; + so->so_head = NULL; + + SOCK_UNLOCK(so); + ACCEPT_UNLOCK(); + + sa = NULL; + error = soaccept(so, &sa); + if (error != 0) { + ICL_WARN("soaccept error %d", error); + if (sa != NULL) + free(sa, M_SONAME); + soclose(so); + continue; + } + + (ils->ils_listen->il_accept)(so, sa, ils->ils_id); + } +} + +static int +icl_listen_add_tcp(struct icl_listen *il, int domain, int socktype, + int protocol, struct sockaddr *sa, int portal_id) +{ + struct icl_listen_sock *ils; + struct socket *so; + struct sockopt sopt; + int error, one = 1; + + error = socreate(domain, &so, socktype, protocol, + curthread->td_ucred, curthread); + if (error != 0) { + ICL_WARN("socreate failed with error %d", error); + return (error); + } + + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_REUSEADDR; + sopt.sopt_val = &one; + sopt.sopt_valsize = sizeof(one); + sopt.sopt_td = NULL; + error = sosetopt(so, &sopt); + if (error != 0) { + ICL_WARN("failed to set SO_REUSEADDR with error %d", error); + soclose(so); + return (error); + } + + error = sobind(so, sa, curthread); + if (error != 0) { + ICL_WARN("sobind failed with error %d", error); + soclose(so); + return (error); + } + + error = solisten(so, -1, curthread); + if (error != 0) { + ICL_WARN("solisten failed with error %d", error); + soclose(so); + return (error); + } + + ils = malloc(sizeof(*ils), M_ICL_PROXY, M_ZERO | M_WAITOK); + ils->ils_listen = il; + ils->ils_socket = so; + ils->ils_id = portal_id; + + error = kthread_add(icl_accept_thread, ils, NULL, NULL, 0, 0, "iclacc"); + if (error != 0) { + ICL_WARN("kthread_add failed with error %d", error); + soclose(so); + free(ils, M_ICL_PROXY); + + return (error); + } + + sx_xlock(&il->il_lock); + TAILQ_INSERT_TAIL(&il->il_sockets, ils, ils_next); + sx_xunlock(&il->il_lock); + + return (0); +} + +int +icl_listen_add(struct icl_listen *il, bool rdma, int domain, int socktype, + int protocol, struct sockaddr *sa, int portal_id) +{ + + if (rdma) { + ICL_DEBUG("RDMA not supported"); + return (EOPNOTSUPP); + } + + + return (icl_listen_add_tcp(il, domain, socktype, protocol, sa, + portal_id)); +} + +int +icl_listen_remove(struct icl_listen *il, struct sockaddr *sa) +{ + + /* + * XXX + */ + + return (EOPNOTSUPP); +} + +#endif /* ICL_KERNEL_PROXY */ Modified: head/sys/modules/iscsi/Makefile ============================================================================== --- head/sys/modules/iscsi/Makefile Tue May 17 15:18:01 2016 (r300060) +++ head/sys/modules/iscsi/Makefile Tue May 17 15:21:17 2016 (r300061) @@ -5,8 +5,8 @@ KMOD= iscsi SRCS= iscsi.c SRCS+= icl.c -SRCS+= icl_proxy.c SRCS+= icl_soft.c +SRCS+= icl_soft_proxy.c SRCS+= opt_cam.h SRCS+= bus_if.h SRCS+= device_if.h From owner-svn-src-all@freebsd.org Tue May 17 15:36:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6982B3F5E1; Tue, 17 May 2016 15:36:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8D1167074; Tue, 17 May 2016 15:36:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HFaeLL084697; Tue, 17 May 2016 15:36:40 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HFae3R084696; Tue, 17 May 2016 15:36:40 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201605171536.u4HFae3R084696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 17 May 2016 15:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 15:36:41 -0000 Author: gnn Date: Tue May 17 15:36:40 2016 New Revision: 300062 URL: https://svnweb.freebsd.org/changeset/base/300062 Log: Kill off ReiserFS as it is no longer supported, for obvious reasons. Deleted: head/sys/gnu/fs/ head/sys/modules/reiserfs/ Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue May 17 15:21:17 2016 (r300061) +++ head/sys/modules/Makefile Tue May 17 15:36:40 2016 (r300062) @@ -312,7 +312,6 @@ SUBDIR= \ ${_rdma} \ ${_rdrand_rng} \ re \ - reiserfs \ rl \ rtwn \ ${_rtwnfw} \ From owner-svn-src-all@freebsd.org Tue May 17 15:44:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 158DEB3F763; Tue, 17 May 2016 15:44:56 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 AC00167726; Tue, 17 May 2016 15:44:55 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id a17so38337279wme.0; Tue, 17 May 2016 08:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=rxkuSn2+wsR3st/WX++7vk81Y+Ym0ybBHRJwULx0LCQ=; b=WgxBqoZKuFkWD0YeTl1kLD0kqFa54ViYec0V2zuetDUGLNDiZxjzhQdUjgbQ+zOXaX lA6UGs8bVUl2ZO07pa/TGZGq6dKlmhLvB3gvZwpElf3igmQ3dXnrVWIOo1Wg9T6cKAOf 794Lz7UJ4Koty8NCBdD6W+3Pv5F7GHK8jGpaKkoLrradGl5JUtVtVlrBnu0+mLp7S6FE BmeHrFsNMn4MEhJiiXiqaxTyMWWKmCx7lk+AsV+792YiTwewq4UHqMEpMfay19mezB6T wH7wTC6QEpggROKjNSMMI+L0cF/tXYyin38hTGg55CFMWCXvlfwb5qXxIoTkNzSc4hzy J0YQ== 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:date :message-id:subject:from:to:cc; bh=rxkuSn2+wsR3st/WX++7vk81Y+Ym0ybBHRJwULx0LCQ=; b=Ec/FjvczoxmGf3b4kUwRw1AEhaqngX7HZySqNlbQBof8RN5IQn3D4jFJAm4KIBJd2u GJxPZPiR/h33rj3H7GWbFifHa/jE0Vdyk9t5e5pnajiSlyVvNS67eoSOmsR9lMU6Jdhl 2oQ8L8MDfDbMgRpIeaSS8C/3P2yYUbjqWiZFNWuvwvJwZ2fvzYCHkVrEWgCSIH7kBvpU 2lFSXFtopQYr8Z/pSM1m+ay1mNWs9FE/GWbfVgi/PtClkS+u6AuZWOBt3MKCEKz1E8XI e18R7rMPyQblEhNv4Se94drhhULMODy2yd0rH1pKrq70WN1cYLbcZMFoB+Q9yPZEUHev s/LA== X-Gm-Message-State: AOPr4FUtlNrfKgvysguEZtxR5g3q/XVL315bBI8I/pZJtF5FZ4Zwd+eFuCcZTSRtzBNASMhrfyC4Gay4zBKCBA== MIME-Version: 1.0 X-Received: by 10.28.138.13 with SMTP id m13mr2378101wmd.3.1463499894297; Tue, 17 May 2016 08:44:54 -0700 (PDT) Received: by 10.194.161.4 with HTTP; Tue, 17 May 2016 08:44:54 -0700 (PDT) In-Reply-To: <201605162133.u4GLXV3S048795@repo.freebsd.org> References: <201605162133.u4GLXV3S048795@repo.freebsd.org> Date: Tue, 17 May 2016 08:44:54 -0700 Message-ID: Subject: Re: svn commit: r299977 - head/sys/dev/acpica/Osd From: Jim Harris To: John Baldwin 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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 15:44:56 -0000 On Mon, May 16, 2016 at 2:33 PM, John Baldwin wrote: > Author: jhb > Date: Mon May 16 21:33:31 2016 > New Revision: 299977 > URL: https://svnweb.freebsd.org/changeset/base/299977 > > Log: > Use polling spin loops for timeouts during early boot. > > Some ACPI operations such as mutex acquires and event waits accept a > timeout. The ACPI OSD layer implements these timeouts by using regular > sleep timeouts. However, this doesn't work during early boot before > event timers are setup. Instead, use polling combined with DELAY() > to spin. > > This fixes booting on upcoming Intel systems with Kaby Lake processors. > Thanks! > > Tested by: "Jeffrey E Pieper" > Reviewed by: jimharris > MFC after: 1 week > > Modified: > head/sys/dev/acpica/Osd/OsdSynch.c > > Modified: head/sys/dev/acpica/Osd/OsdSynch.c > > ============================================================================== > --- head/sys/dev/acpica/Osd/OsdSynch.c Mon May 16 20:26:30 2016 > (r299976) > +++ head/sys/dev/acpica/Osd/OsdSynch.c Mon May 16 21:33:31 2016 > (r299977) > @@ -188,6 +188,23 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl > } > break; > default: > + if (cold) { > + /* > + * Just spin polling the semaphore once a > + * millisecond. > + */ > + while (!ACPISEM_AVAIL(as, Units)) { > + if (Timeout == 0) { > + status = AE_TIME; > + break; > + } > + Timeout--; > + mtx_unlock(&as->as_lock); > + DELAY(1000); > + mtx_lock(&as->as_lock); > + } > + break; > + } > tmo = timeout2hz(Timeout); > while (!ACPISEM_AVAIL(as, Units)) { > prevtick = ticks; > @@ -381,6 +398,23 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UI > } > break; > default: > + if (cold) { > + /* > + * Just spin polling the mutex once a > + * millisecond. > + */ > + while (!ACPIMTX_AVAIL(am)) { > + if (Timeout == 0) { > + status = AE_TIME; > + break; > + } > + Timeout--; > + mtx_unlock(&am->am_lock); > + DELAY(1000); > + mtx_lock(&am->am_lock); > + } > + break; > + } > tmo = timeout2hz(Timeout); > while (!ACPIMTX_AVAIL(am)) { > prevtick = ticks; > > From owner-svn-src-all@freebsd.org Tue May 17 15:46:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6A8B3F7B8; Tue, 17 May 2016 15:46:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 8E1D467779; Tue, 17 May 2016 15:46:05 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 7F420B97F; Tue, 17 May 2016 11:46:04 -0400 (EDT) From: John Baldwin To: Greg 'groggy' Lehey Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Date: Tue, 17 May 2016 08:44:01 -0700 Message-ID: <4621317.8YDbq6YmRn@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160517071619.GX4617@eureka.lemis.com> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <1514281.0ZCu4236n8@ralph.baldwin.cx> <20160517071619.GX4617@eureka.lemis.com> 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.2.7 (bigwig.baldwin.cx); Tue, 17 May 2016 11:46:04 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 15:46:05 -0000 On Tuesday, May 17, 2016 05:16:19 PM Greg 'groggy' Lehey wrote: > On Tuesday, 17 May 2016 at 0:04:51 -0700, John Baldwin wrote: > > On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote: > >> Author: grog > >> Date: Tue May 17 04:40:00 2016 > >> New Revision: 300003 > >> URL: https://svnweb.freebsd.org/changeset/base/300003 > >> > >> Log: > >> Correct use of incorrect grammar. > >> > >> Modified: > >> head/share/man/man4/gdb.4 > >> > >> Modified: head/share/man/man4/gdb.4 > >> ============================================================================== > >> --- head/share/man/man4/gdb.4 Tue May 17 04:03:45 2016 (r300002) > >> +++ head/share/man/man4/gdb.4 Tue May 17 04:40:00 2016 (r300003) > >> @@ -595,7 +595,7 @@ run the link at more than 9600 bps. > >> Firewire connections do not have this problem. > >> .Pp > >> The debugging macros > >> -.Dq "just grown" . > >> +.Dq "just growed" . > > > > "grew"? > > "Just growed". Did you never read Uncle Tom's Cabin? Check Topsy. http://www.dictionary.com/browse/grow?s=t We attempt to write our documentation in English. If you're going to do a token commit to fix incorrect grammar, you should at least use correct grammar. Alternatively, if you want to make a token commit, at least pick a patch in a docs PR and do something a bit more substantial. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 17 16:05:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB85CB3FC0A; Tue, 17 May 2016 16:05:13 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.51.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A61AA3352; Tue, 17 May 2016 16:05:12 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from static-100-12-0-6.nycmny.fios.verizon.net ([100.12.0.6]:51052 helo=[192.168.10.61]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1b2hUc-00013V-BU; Tue, 17 May 2016 12:05:10 -0400 From: "George Neville-Neil" To: "Greg 'groggy' Lehey" Cc: "John Baldwin" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Date: Tue, 17 May 2016 12:05:09 -0400 Message-ID: In-Reply-To: <20160517071619.GX4617@eureka.lemis.com> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <1514281.0ZCu4236n8@ralph.baldwin.cx> <20160517071619.GX4617@eureka.lemis.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_BBAA2B9F-471D-42FF-8BE2-EFD3770FA14A_="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Mailer: MailMate (1.9.4r5234) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Authenticated-Sender: vps.hungerhost.com: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:05:13 -0000 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_BBAA2B9F-471D-42FF-8BE2-EFD3770FA14A_= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 17 May 2016, at 3:16, Greg 'groggy' Lehey wrote: > On Tuesday, 17 May 2016 at 0:04:51 -0700, John Baldwin wrote: >> On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote: >>> Author: grog >>> Date: Tue May 17 04:40:00 2016 >>> New Revision: 300003 >>> URL: https://svnweb.freebsd.org/changeset/base/300003 >>> >>> Log: >>> Correct use of incorrect grammar. >>> >>> Modified: >>> head/share/man/man4/gdb.4 >>> >>> Modified: head/share/man/man4/gdb.4 >>> =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/share/man/man4/gdb.4 Tue May 17 04:03:45 2016 (r300002) >>> +++ head/share/man/man4/gdb.4 Tue May 17 04:40:00 2016 (r300003) >>> @@ -595,7 +595,7 @@ run the link at more than 9600 bps. >>> Firewire connections do not have this problem. >>> .Pp >>> The debugging macros >>> -.Dq "just grown" . >>> +.Dq "just growed" . >> >> "grew"? > > "Just growed". Did you never read Uncle Tom's Cabin? Check Topsy. > > Of course, what this page really needs is a good overhaul. I'll see > if I can muster the energy. > Can you just be honest and admit that this is a trivial commit to you can= vote in the core elections? And Seriously? Uncle Toms Cabin? Best, George --=_MailMate_BBAA2B9F-471D-42FF-8BE2-EFD3770FA14A_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlc7QTUACgkQYdh2wUQKM9IKQQCgvahLHXgDuHljSYcT74HjCzWe 3xMAoJnWelXzsH38qSen5zSU8F1FLybw =A4qZ -----END PGP SIGNATURE----- --=_MailMate_BBAA2B9F-471D-42FF-8BE2-EFD3770FA14A_=-- From owner-svn-src-all@freebsd.org Tue May 17 16:24:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F4F6B3F259 for ; Tue, 17 May 2016 16:24:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F3F62191 for ; Tue, 17 May 2016 16:24:55 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c364ff3e-1c4b-11e6-896e-fd5016d7ee1b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 17 May 2016 16:24:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4HGOloL050125; Tue, 17 May 2016 10:24:47 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463502287.1180.202.camel@freebsd.org> Subject: Re: svn commit: r300003 - head/share/man/man4 From: Ian Lepore To: George Neville-Neil , "Greg 'groggy' Lehey" Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 17 May 2016 10:24:47 -0600 In-Reply-To: References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <1514281.0ZCu4236n8@ralph.baldwin.cx> <20160517071619.GX4617@eureka.lemis.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:24:56 -0000 On Tue, 2016-05-17 at 12:05 -0400, George Neville-Neil wrote: > > On 17 May 2016, at 3:16, Greg 'groggy' Lehey wrote: > > > On Tuesday, 17 May 2016 at 0:04:51 -0700, John Baldwin wrote: > > > On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote: > > > > Author: grog > > > > Date: Tue May 17 04:40:00 2016 > > > > New Revision: 300003 > > > > URL: https://svnweb.freebsd.org/changeset/base/300003 > > > > > > > > Log: > > > > Correct use of incorrect grammar. > > > > > > > > Modified: > > > > head/share/man/man4/gdb.4 > > > > > > > > Modified: head/share/man/man4/gdb.4 > > > > =============================================================== > > > > =============== > > > > --- head/share/man/man4/gdb.4 Tue May 17 04:03:45 2016 > > > > (r300002) > > > > +++ head/share/man/man4/gdb.4 Tue May 17 04:40:00 2016 > > > > (r300003) > > > > @@ -595,7 +595,7 @@ run the link at more than 9600 bps. > > > > Firewire connections do not have this problem. > > > > .Pp > > > > The debugging macros > > > > -.Dq "just grown" . > > > > +.Dq "just growed" . > > > > > > "grew"? > > > > "Just growed". Did you never read Uncle Tom's Cabin? Check Topsy. > > > > Of course, what this page really needs is a good overhaul. I'll > > see > > if I can muster the energy. > > > > Can you just be honest and admit that this is a trivial commit to you > can vote in the core elections? > > And Seriously? Uncle Toms Cabin? > > Best, > George I hadn't heard that our manpage style guidelines had changed to 1850s U.S. southern colloquial. I applaud the bold move, it's going to make the mundane task of reading manpages much more entertaining, and is sure to bring new attention to the FreeBSD project in general as the word of the change spreads. -- Ian From owner-svn-src-all@freebsd.org Tue May 17 16:29:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2ABBB3F2CD for ; Tue, 17 May 2016 16:29:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm20.bullet.mail.bf1.yahoo.com (nm20.bullet.mail.bf1.yahoo.com [98.139.212.179]) (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 A0FB629DE for ; Tue, 17 May 2016 16:29:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463502535; bh=ZJwcpH7mIK3qg4h3SgOUdfPL6t/3eOFVE/yjseGdA2I=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=Qgqz0tEfCvuBwnc4EidsLJ2yEgyfFUXodfaQBmeBlvtTApiMJSSIkCXvwuCwa+lrNfspZh4jW3LE+kJHGnFR06jukYXxBDj5xFNJHRMmtIMBQQuX6hUIuhewZja82wPdz3Ry2pelu1VDCngjZEsmYjcMQtyUSqwNeyOG03e6diK4/9EJ8VidtSYb2De3Ur7hsycO0CApO4l6rko9Ya2dhd7C8ciDOwHnWTe00a/W/WR6hxujPQXx8IKc9ND8JaKkl3s31yA39+YKHxd72cG0P4OGS5v7IuNfdlzfvDc5oVk9AamIoSs6mgn1oFiUs188M8W80Kp0L9Rx+mIKqM9nRQ== Received: from [98.139.170.178] by nm20.bullet.mail.bf1.yahoo.com with NNFMP; 17 May 2016 16:28:55 -0000 Received: from [98.139.213.14] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 17 May 2016 16:28:55 -0000 Received: from [127.0.0.1] by smtp114.mail.bf1.yahoo.com with NNFMP; 17 May 2016 16:28:55 -0000 X-Yahoo-Newman-Id: 405093.64343.bm@smtp114.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: yrekXuEVM1mYoWf_LyR8IMe121uWjnSWmJaa0XZ_CPMSuQ0 QEngFR9ZaKOejycQUNRHMHrh6gx0I4g9eB_mSVoJfoBRPAFvUmiQ79BV232h JL_BcR9wSf3Fk.a7xp_UUaAeOK9x7Q4ZBFQFIUnDelJ.DQ6a8IwsFlS4ah3w 3P2paiMAnpr2b60SCG4Lv2fPWhbp4voxUxrTAj2uR__y9VTNGkmIPDahrZCk CZFtUFlA9UcbQy5bhEW_QBn2RzXLlRkr_nvrsu282VRQ7ncKzaT22NFWwpp3 okScy7x50Y4SotdDOyDoOzD8EV.q95hlJ.dky.CUrMyjU_DTflh5wm44BSBP 4W9m2HqdP578SUPouFLGdPqAMzuy_zYPd8j1nGRQPSggdOxCDcat8Fos1SIC am2wCXZ38qFElc0iYwosOgvw2V1DqErQ3aNv6X28.Pf5cd6E5TW_gByLgoCj b9EPVZbDd2a9TDOFUbvg4pHsB5VKM7_NMapy_5nu4rRa2eYLGoRqwuBjHTuz MvkDuNfROcpp9UbEtyToEfSejvxwzIFKu X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs To: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605171536.u4HFae3R084696@repo.freebsd.org> From: Pedro Giffuni Message-ID: <7ba425bb-6dc8-f56f-1353-abd7291cdb5e@FreeBSD.org> Date: Tue, 17 May 2016 11:29:01 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605171536.u4HFae3R084696@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:29:04 -0000 Hello; On 05/17/16 10:36, George V. Neville-Neil wrote: > Author: gnn > Date: Tue May 17 15:36:40 2016 > New Revision: 300062 > URL: https://svnweb.freebsd.org/changeset/base/300062 > > Log: > Kill off ReiserFS as it is no longer supported, for obvious reasons. > It's not so obvious since the fs worked and could've been useful for people migrating from ancient linux. It's a welcome move though. > Deleted: > head/sys/gnu/fs/ > head/sys/modules/reiserfs/ > Modified: > head/sys/modules/Makefile > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Tue May 17 15:21:17 2016 (r300061) > +++ head/sys/modules/Makefile Tue May 17 15:36:40 2016 (r300062) > @@ -312,7 +312,6 @@ SUBDIR= \ > ${_rdma} \ > ${_rdrand_rng} \ > re \ > - reiserfs \ > rl \ > rtwn \ > ${_rtwnfw} \ > You will have to cleanup sys/conf/files (at least lines 3158-3166) as well. If you are cleaning old cruft, can we please kill ctm(1)? Regards, Pedro. From owner-svn-src-all@freebsd.org Tue May 17 16:33:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC341B3F507 for ; Tue, 17 May 2016 16:33:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (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 961492430 for ; Tue, 17 May 2016 16:33:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id d62so30541882iof.2 for ; Tue, 17 May 2016 09:33:45 -0700 (PDT) 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:date:message-id:subject :from:to:cc; bh=oI85Sp5bryOMoZrxjEZ8MSsVEKv0t6AF81VcPxelxf0=; b=QlkBwK4xrT/qDjaDh5eGALAJaMgo0SdEjc1LYP6hUyLebPTFSr2hjEpiyT81DFvnJl 1YtkM6nKrBB7m13WnKkNZsqaRyNykrmCu522uZrX3hSt5bg9QSZnoduGUVycQViS43Wk fVpaajr/GVI9F1w3gPWwFhA2j0KqUGAniij7U4VpzUK/LRWK5fz46ENp1v8m41p25baG 0/9JAPbuMGdbDsUbyGukqTwJ7iGiSYCjogQxl/x3xb1vT0trfNu+mPSg7i4wrKHadnYY 7X8TtKIUlJef0ao3SmPRk/WTYQr/jsvbEBl0eW3PjTnixN4zOW/jo5/MBN4Oh/2ACcwy v4Dw== 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:date :message-id:subject:from:to:cc; bh=oI85Sp5bryOMoZrxjEZ8MSsVEKv0t6AF81VcPxelxf0=; b=knH62wcwgrS5IfwPaBnHr06bttC3XTA6bvbX+YTSbGaXpdY5X4zM0OqOxk6K2N4M9f vvhyrRc0uO50KKOphBh40qF0TqQ75UUSOg3G5a4Pu+Tg6YUubvEGSyCEpNlvLfX6SOeK yxhe5Oxq3urMMEdpDJOFQ+v9eH4lobiyuF8BqvNuhfNlDseX71rjbKTtxzjdVfGFwg2o vi9yMAdwF+/H8fCWRguYYrpQEOHU7yfC6NytQyXwNeS4SLs0vHVzQ9Vmkp/u9uYA6EG2 XCHDcRHBXnTi4ppJ5/daiVjgZBOhnGmvhbS+jausQAbGCXvPTVMt/UBmHWti6aVRcKh/ k0Ug== X-Gm-Message-State: AOPr4FXfauzKQIqjrA7e5Zo64oR0uYe2Hmu01F4Sun7qO3XUogdOuNTNIrSJ2GtyjkmqU4AZYUHhN8I5e2fAyQ== MIME-Version: 1.0 X-Received: by 10.36.70.7 with SMTP id j7mr14139271itb.72.1463502824860; Tue, 17 May 2016 09:33:44 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.75.68 with HTTP; Tue, 17 May 2016 09:33:44 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201602171716.u1HHG2c2098316@repo.freebsd.org> <405a3410-a0ee-a638-eefe-c1f8980e5624@freebsd.org> <14D0B1CA-8F30-4DE4-A4F7-424F75BFE07E@bsdimp.com> Date: Tue, 17 May 2016 10:33:44 -0600 X-Google-Sender-Auth: MzDGjVFsub3HY4ft3otSjO5erDo Message-ID: Subject: Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern From: Warner Losh To: Steven Hartland Cc: Alan Somers , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:33:45 -0000 I've updated the g_bio man page with all the info presented here. Please let me know if I missed anything, or if you have suggestions for improvement. Warner On Mon, May 9, 2016 at 12:21 PM, Steven Hartland wrote: > On 09/05/2016 18:21, Warner Losh wrote: > > On May 9, 2016, at 11:14 AM, Steven Hartland wrote: > > > > On 09/05/2016 18:04, Alan Somers wrote: > > > On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh wrote: > Author: imp > Date: Wed Feb 17 17:16:02 2016 > New Revision: 295707 > URL: https://svnweb.freebsd.org/changeset/base/295707 > > Log: > Create an API to reset a struct bio (g_reset_bio). This is mandatory > for all struct bio you get back from g_{new,alloc}_bio. Temporary > bios that you create on the stack or elsewhere should use this before > first use of the bio, and between uses of the bio. At the moment, it > is nothing more than a wrapper around bzero, but that may change in > the future. The wrapper also removes one place where we encode the > size of struct bio in the KBI. > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/dev/mmc/mmcsd.c > head/sys/dev/virtio/block/virtio_blk.c > head/sys/geom/geom.h > head/sys/geom/geom_io.c > head/sys/geom/journal/g_journal.c > head/sys/geom/mirror/g_mirror.c > head/sys/geom/raid/g_raid.c > head/sys/geom/raid3/g_raid3.c > head/sys/kern/kern_physio.c > > smh noticed that while your commit message says that g_reset_bio is manda= tory after g_{new,alloc}_bio, your diff only replaced existing calls to bze= ro. You didn't insert g_reset_bio calls after all g_alloc_bio calls, for e= xample in vdev_geom_io_start. Do you intend to follow up this change with = a g_reset_bio everywhere that g_alloc_bio is called, or did you mean that g= _reset_bio is optional after all bios returned by g_{new,alloc}_bio? > > > Yer I was just penning this too: > This commit was just referenced in https://reviews.freebsd.org/D6153 > It seems rather odd to require all callers to g_{new,alloc}_bio to also c= all g_reset_bio. > > I don=E2=80=99t. Please see my other reply. It=E2=80=99s only when you *R= E*use the bio that you need to call g_reset_bio(), not when you use it in t= he first place. You can no longer call bzero() on the bio to reset it. > > > I assume this is because uma can return an existing object instead of fre= sh one hence its not guaranteed to be bzeroed? If so why have the caller re= sponsible, seems petty error prone. A quick look at users of g_alloc_bio it= seems like this is something that's not done currently done in all places,= even some usages of memset still hanging around, are these cases a bug? > > No. That=E2=80=99s not the case at all. There=E2=80=99s going to be conte= nts of the BIO that cannot be blithely cleared by the users of the memory. = Many other structures in the kernel are like this, but bio wasn=E2=80=99t p= reviously. > > > If the concept of this was to ensure correctly initialised objects from u= ma would the callback handers to uma_zcreate not be a better option as that= would guarantee things are correct instead of leaving it to the caller? > > No. It=E2=80=99s to ensure internal state to the bio isn=E2=80=99t blown = away by a subsequent bzero() call before calling g_destroy_bio(). > > > As a side matter, this area really needs some man pages so the its clear = to all what is needed and when. > > Agreed. The whole storage stack, however, is wonderfully under-documented= . I=E2=80=99ve started documenting CAM, but handn=E2=80=99t worked my way b= ack to geom=E2=80=A6 > > > Thanks for the clarifications Warner, appreciated :) > > Regards > Steve > From owner-svn-src-all@freebsd.org Tue May 17 16:38:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BEB6B3F60D; Tue, 17 May 2016 16:38:20 +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 ED0B92F3E; Tue, 17 May 2016 16:38:19 +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 u4HGcJUl003395; Tue, 17 May 2016 16:38:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HGcIor003392; Tue, 17 May 2016 16:38:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605171638.u4HGcIor003392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 17 May 2016 16:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300063 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:38:20 -0000 Author: avos Date: Tue May 17 16:38:18 2016 New Revision: 300063 URL: https://svnweb.freebsd.org/changeset/base/300063 Log: net80211: unbreak 'show all vaps(/a)' ddb command Replace ifnet list lookup (which is broken since r287197, because IFT_IEEE80211 type is not used anymore) with iteration on ieee80211com list. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6419 Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue May 17 15:36:40 2016 (r300062) +++ head/sys/net80211/ieee80211.c Tue May 17 16:38:18 2016 (r300063) @@ -406,6 +406,17 @@ ieee80211_find_com(const char *name) return (ic); } +void +ieee80211_iterate_coms(ieee80211_com_iter_func *f, void *arg) +{ + struct ieee80211com *ic; + + mtx_lock(&ic_list_mtx); + LIST_FOREACH(ic, &ic_head, ic_next) + (*f)(arg, ic); + mtx_unlock(&ic_list_mtx); +} + /* * Default reset method for use with the ioctl support. This * method is invoked after any state change in the 802.11 Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Tue May 17 15:36:40 2016 (r300062) +++ head/sys/net80211/ieee80211_ddb.c Tue May 17 16:38:18 2016 (r300063) @@ -69,6 +69,8 @@ static void _db_show_vap(const struct ie static void _db_show_com(const struct ieee80211com *, int showvaps, int showsta, int showmesh, int showprocs); +static void _db_show_all_vaps(void *, struct ieee80211com *); + static void _db_show_node_table(const char *tag, const struct ieee80211_node_table *); static void _db_show_channel(const char *tag, const struct ieee80211_channel *); @@ -161,8 +163,6 @@ DB_SHOW_COMMAND(com, db_show_com) DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps) { - VNET_ITERATOR_DECL(vnet_iter); - const struct ifnet *ifp; int i, showall = 0; for (i = 0; modif[i] != '\0'; i++) @@ -172,24 +172,7 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_va break; } - VNET_FOREACH(vnet_iter) { - TAILQ_FOREACH(ifp, &V_ifnet, if_list) - if (ifp->if_type == IFT_IEEE80211) { - const struct ieee80211com *ic = ifp->if_l2com; - - if (!showall) { - const struct ieee80211vap *vap; - db_printf("%s: com %p vaps:", - ifp->if_xname, ic); - TAILQ_FOREACH(vap, &ic->ic_vaps, - iv_next) - db_printf(" %s(%p)", - vap->iv_ifp->if_xname, vap); - db_printf("\n"); - } else - _db_show_com(ic, 1, 1, 1, 1); - } - } + ieee80211_iterate_coms(_db_show_all_vaps, &showall); } #ifdef IEEE80211_SUPPORT_MESH @@ -683,6 +666,21 @@ _db_show_com(const struct ieee80211com * } static void +_db_show_all_vaps(void *arg, struct ieee80211com *ic) +{ + int showall = *(int *)arg; + + if (!showall) { + const struct ieee80211vap *vap; + db_printf("%s: com %p vaps:", ic->ic_name, ic); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + db_printf(" %s(%p)", vap->iv_ifp->if_xname, vap); + db_printf("\n"); + } else + _db_show_com(ic, 1, 1, 1, 1); +} + +static void _db_show_node_table(const char *tag, const struct ieee80211_node_table *nt) { int i; Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue May 17 15:36:40 2016 (r300062) +++ head/sys/net80211/ieee80211_var.h Tue May 17 16:38:18 2016 (r300063) @@ -714,6 +714,8 @@ void ieee80211_drain(struct ieee80211com void ieee80211_chan_init(struct ieee80211com *); struct ieee80211com *ieee80211_find_vap(const uint8_t mac[IEEE80211_ADDR_LEN]); struct ieee80211com *ieee80211_find_com(const char *name); +typedef void ieee80211_com_iter_func(void *, struct ieee80211com *); +void ieee80211_iterate_coms(ieee80211_com_iter_func *, void *); int ieee80211_media_change(struct ifnet *); void ieee80211_media_status(struct ifnet *, struct ifmediareq *); int ieee80211_ioctl(struct ifnet *, u_long, caddr_t); From owner-svn-src-all@freebsd.org Tue May 17 16:50:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B203B3FA99; Tue, 17 May 2016 16:50:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) (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 EF7CE2170; Tue, 17 May 2016 16:50:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f54.google.com with SMTP id x19so34507456oix.2; Tue, 17 May 2016 09:50:51 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=ZuFparWvpw2edc+h8p7lEzHGSPt8cGdHTc7EqbklHVE=; b=PvviWNC0FNrX2xdXskQ56mYmMnirOJZ6bLQ3wHwWpBFjzrZAtyiV1M1OJ+V7aOOGif /3UHELIVGhTJ6SnprDx9+ldkjE8D8dh6RDKiSiOr5YIQ5cmI5jE++NO2nS3//pBJ2hi8 O+V9glgFK8bFxawsC/K6KzGWohp/dzMOrS62E7UrPqnWUvaS6DPi2KzoID0icy9IrHHs 8VixucrbB4wtSTrAkrJGQmhGm4EA0SKHRGojhMabBumaPXqT0//jBkNiyjtvM7TUpTdo wIMkCZCbUkUxu87jutNYIfRJSEhZdclDdbDlM3Tbon0bql+Evq8hTwNYxKowfJn/nOj0 qytQ== X-Gm-Message-State: AOPr4FUAm3eL+MDriaPIvQnDyhjarZRxaFa4oAmzKjOlYb0mEO7ksFnnn3P4VWSmgb/L6g== X-Received: by 10.157.43.3 with SMTP id o3mr1413383otb.107.1463503845349; Tue, 17 May 2016 09:50:45 -0700 (PDT) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com. [209.85.218.47]) by smtp.gmail.com with ESMTPSA id 74sm1032527oty.3.2016.05.17.09.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 May 2016 09:50:45 -0700 (PDT) Received: by mail-oi0-f47.google.com with SMTP id x19so34506894oix.2; Tue, 17 May 2016 09:50:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.83.199 with SMTP id h190mr1328542oib.131.1463503844829; Tue, 17 May 2016 09:50:44 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Tue, 17 May 2016 09:50:44 -0700 (PDT) In-Reply-To: <7ba425bb-6dc8-f56f-1353-abd7291cdb5e@FreeBSD.org> References: <201605171536.u4HFae3R084696@repo.freebsd.org> <7ba425bb-6dc8-f56f-1353-abd7291cdb5e@FreeBSD.org> Date: Tue, 17 May 2016 09:50:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs From: Conrad Meyer To: Pedro Giffuni Cc: "George V. Neville-Neil" , 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:50:52 -0000 On Tue, May 17, 2016 at 9:29 AM, Pedro Giffuni wrote: >> Log: >> Kill off ReiserFS as it is no longer supported, for obvious reasons. >> > > It's not so obvious since the fs worked and could've been useful for > people migrating from ancient linux. This may still be possible through e.g. sysutils/fusefs-lkl (ReiserFS isn't included in the port yet, but it's possible that it could be). Best, Conrad From owner-svn-src-all@freebsd.org Tue May 17 16:58:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D48AB3FD3E; Tue, 17 May 2016 16:58:41 +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 AFAA22C94; Tue, 17 May 2016 16:58:40 +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 u4HGwdU4009363; Tue, 17 May 2016 16:58:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HGwdYK009362; Tue, 17 May 2016 16:58:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605171658.u4HGwdYK009362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 17 May 2016 16:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300064 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:58:41 -0000 Author: pfg Date: Tue May 17 16:58:39 2016 New Revision: 300064 URL: https://svnweb.freebsd.org/changeset/base/300064 Log: makefs(8): use NULL instead of zero for pointers. Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Tue May 17 16:38:18 2016 (r300063) +++ head/usr.sbin/makefs/cd9660.c Tue May 17 16:58:39 2016 (r300064) @@ -774,7 +774,7 @@ cd9660_setup_volume_descriptors(void) temp->next = t; memset(t->volumeDescriptorData, 0, 2048); t->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_TERMINATOR; - t->next = 0; + t->next = NULL; t->volumeDescriptorData[6] = 1; t->sector = sector; memcpy(t->volumeDescriptorData + 1, @@ -1403,7 +1403,7 @@ cd9660_convert_structure(fsnode *root, c this_node->level = working_level - 1; if (cd9660_rrip_move_directory( - this_node) == 0) { + this_node) == NULL) { warnx("Failure in " "cd9660_rrip_" "move_directory" @@ -1416,7 +1416,7 @@ cd9660_convert_structure(fsnode *root, c } /* Do the recursive call on the children */ - if (iterator->child != 0) { + if (iterator->child != NULL) { cd9660_convert_structure( iterator->child, this_node, working_level, @@ -1445,7 +1445,7 @@ cd9660_convert_structure(fsnode *root, c } /*Allocate new temp_node */ - if (iterator->next != 0) { + if (iterator->next != NULL) { this_node = cd9660_allocate_cd9660node(); if (this_node == NULL) CD9660_MEM_ALLOC_ERROR(__func__); @@ -1733,7 +1733,7 @@ cd9660_convert_filename(const char *oldn { assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* NEW */ - cd9660_filename_conversion_functor conversion_function = 0; + cd9660_filename_conversion_functor conversion_function = NULL; if (diskStructure.isoLevel == 1) conversion_function = &cd9660_level1_convert_filename; else if (diskStructure.isoLevel == 2) From owner-svn-src-all@freebsd.org Tue May 17 16:59:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE516B3FDDA; Tue, 17 May 2016 16:59:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81F3A2EE0; Tue, 17 May 2016 16:59:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HGxrSL009547; Tue, 17 May 2016 16:59:53 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HGxrmc009545; Tue, 17 May 2016 16:59:53 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201605171659.u4HGxrmc009545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 17 May 2016 16:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300065 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 16:59:54 -0000 Author: gnn Date: Tue May 17 16:59:53 2016 New Revision: 300065 URL: https://svnweb.freebsd.org/changeset/base/300065 Log: Finish cleaning up after killing ReiserFS. Remove LINT/NOTES option and file linkages. Modified: head/sys/conf/NOTES head/sys/conf/files Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue May 17 16:58:39 2016 (r300064) +++ head/sys/conf/NOTES Tue May 17 16:59:53 2016 (r300065) @@ -1139,12 +1139,6 @@ options NFS_DEBUG # Enable NFS Debuggi # options EXT2FS -# -# Add support for the ReiserFS filesystem (used in Linux). Currently, -# this is limited to read-only access. -# -options REISERFS - # Cryptographically secure random number generator; /dev/random device random @@ -3063,4 +3057,4 @@ options EM_MULTIQUEUE # Activate multiq options GZIO # BHND(4) drivers -options BHND_LOGLEVEL # Logging threshold level \ No newline at end of file +options BHND_LOGLEVEL # Logging threshold level Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 17 16:58:39 2016 (r300064) +++ head/sys/conf/files Tue May 17 16:59:53 2016 (r300065) @@ -3155,15 +3155,6 @@ fs/ext2fs/ext2_lookup.c optional ext2fs fs/ext2fs/ext2_subr.c optional ext2fs fs/ext2fs/ext2_vfsops.c optional ext2fs fs/ext2fs/ext2_vnops.c optional ext2fs -gnu/fs/reiserfs/reiserfs_hashes.c optional reiserfs \ - warning "kernel contains GPL contaminated ReiserFS filesystem" -gnu/fs/reiserfs/reiserfs_inode.c optional reiserfs -gnu/fs/reiserfs/reiserfs_item_ops.c optional reiserfs -gnu/fs/reiserfs/reiserfs_namei.c optional reiserfs -gnu/fs/reiserfs/reiserfs_prints.c optional reiserfs -gnu/fs/reiserfs/reiserfs_stree.c optional reiserfs -gnu/fs/reiserfs/reiserfs_vfsops.c optional reiserfs -gnu/fs/reiserfs/reiserfs_vnops.c optional reiserfs # isa/isa_if.m standard isa/isa_common.c optional isa From owner-svn-src-all@freebsd.org Tue May 17 17:08:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04BA3B3F409; Tue, 17 May 2016 17:08:15 +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 B032911EA; Tue, 17 May 2016 17:08:14 +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 u4HH8DIY012801; Tue, 17 May 2016 17:08:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HH8Dkk012799; Tue, 17 May 2016 17:08:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605171708.u4HH8Dkk012799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 May 2016 17:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300066 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 17:08:15 -0000 Author: imp Date: Tue May 17 17:08:13 2016 New Revision: 300066 URL: https://svnweb.freebsd.org/changeset/base/300066 Log: Per Ravi Pokala's suggestion, rewrite the g_reset_bio description to be clearer. It also describes it with more nuance. Add missing MLINKS noticed by trasz@. Bump the date. Modified: head/share/man/man9/Makefile head/share/man/man9/g_bio.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue May 17 16:59:53 2016 (r300065) +++ head/share/man/man9/Makefile Tue May 17 17:08:13 2016 (r300066) @@ -787,7 +787,8 @@ MLINKS+=g_bio.9 g_alloc_bio.9 \ g_bio.9 g_destroy_bio.9 \ g_bio.9 g_duplicate_bio.9 \ g_bio.9 g_new_bio.9 \ - g_bio.9 g_print_bio.9 + g_bio.9 g_print_bio.9 \ + g_bio.9 g_reset_bio.9 MLINKS+=g_consumer.9 g_destroy_consumer.9 \ g_consumer.9 g_new_consumer.9 MLINKS+=g_data.9 g_read_data.9 \ Modified: head/share/man/man9/g_bio.9 ============================================================================== --- head/share/man/man9/g_bio.9 Tue May 17 16:59:53 2016 (r300065) +++ head/share/man/man9/g_bio.9 Tue May 17 17:08:13 2016 (r300066) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2016 +.Dd May 17, 2016 .Dt G_BIO 9 .Os .Sh NAME @@ -213,27 +213,27 @@ The .Fn g_reset_bio function resets the given .Vt bio -for reuse. -Prior to -.Fx 11 -a -.Vt bio -was reset for reuse with -.Xr bzero 3 . +structure back to its initial state. .Fn g_reset_bio -preserves internal data structures, while resetting all -user visible values. -Its use is required for any +preserves internal data structures, while setting all +user visible fields to their initial values. +When reusing a .Vt bio -that has been returned by +obtained from .Fn g_new_bio , .Fn g_alloc_bio , .Fn g_clone_bio , or -.Fn g_duplicate_bio . -It may be used for a +.Fn g_duplicate_bio +for multiple transactions, +.Fn g_reset_bio +must be called between the transactions in lieu of +.Fn bzero . +While not strictly required for a .Vt bio -created in another way, but that is not required. +structure created by other means, +.Fn g_reset_bio +should be used to initialize it and between transactions. .Sh RETURN VALUES The .Fn g_new_bio From owner-svn-src-all@freebsd.org Tue May 17 17:09:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82FFFB3F494; Tue, 17 May 2016 17:09:46 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 547C2138C; Tue, 17 May 2016 17:09:46 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HH9jUx012900; Tue, 17 May 2016 17:09:45 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HH9jC4012899; Tue, 17 May 2016 17:09:45 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201605171709.u4HH9jC4012899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 17 May 2016 17:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300067 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 17:09:46 -0000 Author: gnn Date: Tue May 17 17:09:45 2016 New Revision: 300067 URL: https://svnweb.freebsd.org/changeset/base/300067 Log: Final nit in ReiserFS removal. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue May 17 17:08:13 2016 (r300066) +++ head/sys/conf/options Tue May 17 17:09:45 2016 (r300067) @@ -242,7 +242,6 @@ NANDFS opt_dontuse.h NULLFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h -REISERFS opt_dontuse.h SMBFS opt_dontuse.h TMPFS opt_dontuse.h UDF opt_dontuse.h From owner-svn-src-all@freebsd.org Tue May 17 17:21:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 184EFB3F8D9 for ; Tue, 17 May 2016 17:21:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm47-vm8.bullet.mail.bf1.yahoo.com (nm47-vm8.bullet.mail.bf1.yahoo.com [216.109.115.143]) (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 C52AA1F6F for ; Tue, 17 May 2016 17:21:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463504885; bh=axzAlhJZVU4NaNSYKO9MGn90M6gCelONMxmFl16qusU=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=LCckGLZXrhHhn2XE5w/gX+lLEHgUOEYiiHtGdnba/hDKqIXD26RQ3dBExLr2jDfY6EFoPFlO0Kxw6iymPifbIp0cMQ6oZIfxPaGziqCp1CvERQkeI/YnZ0AD31IRzUkEZSqFL98fhD9EwlShDqvXTnQQ0x+LS/yza1eHUDb2N6GGNXAikOGQILcw81UJPz+AyScfZWVTwG+JVfTb7sqCipt47xJA+yySnknz5dZ8ZukPFJ8ArHMoc0567+TVu1jj2Olh+RTM9UGym7Fudn/ZrYi0EjiOrxpD74kBaJ+WoOIkAUPm/xP0WyUHPRA/zbOQohsb1ERmwykNMiQ5Ej+6tw== Received: from [98.139.215.141] by nm47.bullet.mail.bf1.yahoo.com with NNFMP; 17 May 2016 17:08:05 -0000 Received: from [98.139.213.10] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 17 May 2016 17:08:05 -0000 Received: from [127.0.0.1] by smtp110.mail.bf1.yahoo.com with NNFMP; 17 May 2016 17:08:05 -0000 X-Yahoo-Newman-Id: 851247.58959.bm@smtp110.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: qfcjVpcVM1n7VfAsS3S7kkYTwAB3VvIklk5ajDyLlB8e5wI OM.r_EaM1I6DXvKYdict331XgzpWTD9P8VMrVV6ZlAHb824DYkvQ31lynEqM gTDeReg2YbuQpdJlrnELUNCLn6kfCHwIn7TvUhoYRZeXClinf1_NIoS22DOs YT3N8YkjgC_mMdaDvXmsEwwPfd9w.nMrUowJ2lA8Gbsv3ZFubc.Co9DRSrse B.nR6EUE1pf1hVEKjVk.8Cpt_wKjyFMgPSSAmQVyvvIEXdhKIZ8aYYzuZTI5 i6xsP1syWB3yPbyCHrqO3jEz5ZbyIemzlJHTkEifHG4XmtEBqkg5WSCrUp4H kh.MmtnvxWNIMZCcVKA8yYX_xxnZ4O71z4yH6.4tVARGm25UhAzTMrrteQfb Jmp.GFEq8qyObt3sn98SpCCD2MheWIHPD6qmTamboN0V6rDn7HmUNfZbDCIK VGh7uy8ImDD_g6vrLvE.4XMI0c5hsrW.NUN3z1qFMfZFk18t8VKxc5eaaQoP KGKXYPAYhqywxy1cGR2u0P2Oj_CMatJAM X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs To: cem@FreeBSD.org References: <201605171536.u4HFae3R084696@repo.freebsd.org> <7ba425bb-6dc8-f56f-1353-abd7291cdb5e@FreeBSD.org> Cc: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <929e781b-fd6b-462f-31f7-8985aeaf1fae@FreeBSD.org> Date: Tue, 17 May 2016 12:07:50 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 17:21:21 -0000 On 05/17/16 11:50, Conrad Meyer wrote: > On Tue, May 17, 2016 at 9:29 AM, Pedro Giffuni wrote: >>> Log: >>> Kill off ReiserFS as it is no longer supported, for obvious reasons. >>> >> >> It's not so obvious since the fs worked and could've been useful for >> people migrating from ancient linux. > > This may still be possible through e.g. sysutils/fusefs-lkl (ReiserFS > isn't included in the port yet, but it's possible that it could be). > And that's a pretty cool port but since it's not base it involves adding a package and some digging for documentation. Quite honestly, it's a pretty hypothetical situation. By far the most common migration cases are ext4 (which is covered by base) and XFS. We should make fusefs-lkl more visible. Pedro. From owner-svn-src-all@freebsd.org Tue May 17 17:22:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6890B3F930; Tue, 17 May 2016 17:22:15 +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 DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98AC6118B; Tue, 17 May 2016 17:22:15 +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.36.0 64bit (built Sep 8 2015)) id <0O7C00P000236T00@mr11p00im-asmtp004.me.com>; Tue, 17 May 2016 17:22:15 +0000 (GMT) Received: from [192.168.1.4] (c-67-169-142-6.hsd1.ca.comcast.net [67.169.142.6]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7C006A90917200@mr11p00im-asmtp004.me.com>; Tue, 17 May 2016 17:22:14 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-17_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605170209 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Tue, 17 May 2016 10:22:13 -0700 Subject: Re: svn commit: r300066 - head/share/man/man9 From: Ravi Pokala Sender: "Pokala, Ravi" To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r300066 - head/share/man/man9 References: <201605171708.u4HH8Dkk012799@repo.freebsd.org> In-reply-to: <201605171708.u4HH8Dkk012799@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1463505735; bh=ZQnMEnP7GNZ5rP89Kl12GtdlcQto0WJuVnZKBG2qv6E=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=f8HOFUHbsGI9p8gKBGeYWZYx1By9swLqBmpaXIymNk9xkAarsw9prkl5u0rCvrBTr 7lYMMSO48vl482+EPcgmO4i7fEHqzsyMnLgKkAyqxiTkJ1YhbQjCzMUJ85EspKCdlP hUiEqPX7qNBoppnIPsIa0eNyeKUVFkx9/gjl5AC4tj1Mc2nnn0Ljghg8JMh8FowkYo 1boVNoFOCdvajoDLfxN9FxVcmoa1LR84y4mXqT89dtDMtEwj7D9d2mDnkmdGdOh5gv THdlrqZdIKP7EuDWdsB2HLCWmsEGKVb8dyX2EmqrO5qqircSWLmFDXNtCt4ywZM9Kd a3RaSywB3isZw== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 17:22:15 -0000 -----Original Message----- From: on behalf of Warner Losh Date: 2016-05-17, Tuesday at 10:08 To: , , Subject: svn commit: r300066 - head/share/man/man9 >Author: imp >Date: Tue May 17 17:08:13 2016 >New Revision: 300066 >URL: https://svnweb.freebsd.org/changeset/base/300066 > >Log: > Per Ravi Pokala's suggestion, rewrite the g_reset_bio description to > be clearer. It also describes it with more nuance. Add missing MLINKS > noticed by trasz@. Bump the date. Much clearer. Thank you sir. -Ravi (rpokala@) From owner-svn-src-all@freebsd.org Tue May 17 17:46:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1FF0B3FEE6; Tue, 17 May 2016 17:46:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1B91F54; Tue, 17 May 2016 17:46:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HHkDla024709; Tue, 17 May 2016 17:46:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HHkDNL024704; Tue, 17 May 2016 17:46:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201605171746.u4HHkDNL024704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 17 May 2016 17:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300068 - in head/sys: arm/allwinner arm/conf dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 17:46:14 -0000 Author: manu Date: Tue May 17 17:46:12 2016 New Revision: 300068 URL: https://svnweb.freebsd.org/changeset/base/300068 Log: Add driver for "generic-ohci" as defined by FDT. If platform support EXT_RESOURCES, clocks and resets are handled out of the box. If not driver can be subclassed using the generic_usb interface. generic_usb name was choosed because at one point I'll add generic-ehci FDT driver. Reviewed by: jmcneill, hselasky Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D5481 Added: head/sys/dev/usb/controller/generic_ohci.c (contents, props changed) head/sys/dev/usb/controller/generic_usb_if.m (contents, props changed) Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/A10 head/sys/arm/conf/ALLWINNER Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue May 17 17:09:45 2016 (r300067) +++ head/sys/arm/allwinner/files.allwinner Tue May 17 17:46:12 2016 (r300068) @@ -24,6 +24,8 @@ arm/allwinner/if_awg.c optional awg arm/allwinner/if_emac.c optional emac arm/allwinner/sunxi_dma_if.m standard dev/iicbus/twsi/a10_twsi.c optional twsi +dev/usb/controller/generic_ohci.c optional ohci +dev/usb/controller/generic_usb_if.m optional ohci arm/allwinner/aw_sid.c standard arm/allwinner/aw_thermal.c standard #arm/allwinner/console.c standard Modified: head/sys/arm/conf/A10 ============================================================================== --- head/sys/arm/conf/A10 Tue May 17 17:09:45 2016 (r300067) +++ head/sys/arm/conf/A10 Tue May 17 17:46:12 2016 (r300068) @@ -98,7 +98,7 @@ options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE #device uhci -#device ohci +device ohci device ehci device umass Modified: head/sys/arm/conf/ALLWINNER ============================================================================== --- head/sys/arm/conf/ALLWINNER Tue May 17 17:09:45 2016 (r300067) +++ head/sys/arm/conf/ALLWINNER Tue May 17 17:46:12 2016 (r300068) @@ -113,7 +113,7 @@ options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE #device uhci -#device ohci +device ohci device ehci device umass Added: head/sys/dev/usb/controller/generic_ohci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_ohci.c Tue May 17 17:46:12 2016 (r300068) @@ -0,0 +1,308 @@ +/*- + * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2016 Emmanuel Vadot + * 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. + */ + +/* + * Generic OHCI driver based on AT91 OHCI + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef EXT_RESOURCES +#include +#include +#endif + +#include "generic_usb_if.h" + +#ifdef EXT_RESOURCES +struct clk_list { + TAILQ_ENTRY(clk_list) next; + clk_t clk; +}; +#endif + +struct generic_ohci_softc { + ohci_softc_t ohci_sc; + +#ifdef EXT_RESOURCES + hwreset_t rst; + TAILQ_HEAD(, clk_list) clk_list; +#endif +}; + +static int generic_ohci_detach(device_t); + +static int +generic_ohci_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "generic-ohci")) + return (ENXIO); + + device_set_desc(dev, "Generic OHCI Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +generic_ohci_attach(device_t dev) +{ + struct generic_ohci_softc *sc = device_get_softc(dev); + int err, rid; +#ifdef EXT_RESOURCES + int off; + struct clk_list *clkp; + clk_t clk; +#endif + + sc->ohci_sc.sc_bus.parent = dev; + sc->ohci_sc.sc_bus.devices = sc->ohci_sc.sc_devices; + sc->ohci_sc.sc_bus.devices_max = OHCI_MAX_DEVICES; + sc->ohci_sc.sc_bus.dma_bits = 32; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->ohci_sc.sc_bus, + USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { + return (ENOMEM); + } + + rid = 0; + sc->ohci_sc.sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->ohci_sc.sc_io_res == 0) { + err = ENOMEM; + goto error; + } + + sc->ohci_sc.sc_io_tag = rman_get_bustag(sc->ohci_sc.sc_io_res); + sc->ohci_sc.sc_io_hdl = rman_get_bushandle(sc->ohci_sc.sc_io_res); + sc->ohci_sc.sc_io_size = rman_get_size(sc->ohci_sc.sc_io_res); + + rid = 0; + sc->ohci_sc.sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->ohci_sc.sc_irq_res == 0) { + err = ENXIO; + goto error; + } + sc->ohci_sc.sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (sc->ohci_sc.sc_bus.bdev == 0) { + err = ENXIO; + goto error; + } + device_set_ivars(sc->ohci_sc.sc_bus.bdev, &sc->ohci_sc.sc_bus); + + strlcpy(sc->ohci_sc.sc_vendor, "Generic", + sizeof(sc->ohci_sc.sc_vendor)); + + err = bus_setup_intr(dev, sc->ohci_sc.sc_irq_res, + INTR_TYPE_BIO | INTR_MPSAFE, NULL, + (driver_intr_t *)ohci_interrupt, sc, &sc->ohci_sc.sc_intr_hdl); + if (err) { + sc->ohci_sc.sc_intr_hdl = NULL; + goto error; + } + +#ifdef EXT_RESOURCES + TAILQ_INIT(&sc->clk_list); + /* Enable clock */ + for (off = 0; clk_get_by_ofw_index(dev, off, &clk) == 0; off++) { + err = clk_enable(clk); + if (err != 0) { + device_printf(dev, "Could not enable clock %s\n", + clk_get_name(clk)); + goto error; + } + clkp = malloc(sizeof(clkp), M_DEVBUF, M_WAITOK | M_ZERO); + clkp->clk = clk; + TAILQ_INSERT_TAIL(&sc->clk_list, clkp, next); + } + + /* De-assert reset */ + if (hwreset_get_by_ofw_idx(dev, 0, &sc->rst) == 0) { + err = hwreset_deassert(sc->rst); + if (err != 0) { + device_printf(dev, "Could not de-assert reset %d\n", + off); + goto error; + } + } +#endif + + if (GENERIC_USB_INIT(dev) != 0) { + err = ENXIO; + goto error; + } + + err = ohci_init(&sc->ohci_sc); + if (err == 0) + err = device_probe_and_attach(sc->ohci_sc.sc_bus.bdev); + if (err) + goto error; + + return (0); +error: + generic_ohci_detach(dev); + return (err); +} + +static int +generic_ohci_detach(device_t dev) +{ + struct generic_ohci_softc *sc = device_get_softc(dev); + device_t bdev; + int err; +#ifdef EXT_RESOURCES + struct clk_list *clk, *clk_tmp; +#endif + + if (sc->ohci_sc.sc_bus.bdev) { + bdev = sc->ohci_sc.sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + /* + * Put the controller into reset, then disable clocks and do + * the MI tear down. We have to disable the clocks/hardware + * after we do the rest of the teardown. We also disable the + * clocks in the opposite order we acquire them, but that + * doesn't seem to be absolutely necessary. We free up the + * clocks after we disable them, so the system could, in + * theory, reuse them. + */ + bus_space_write_4(sc->ohci_sc.sc_io_tag, sc->ohci_sc.sc_io_hdl, + OHCI_CONTROL, 0); + + if (sc->ohci_sc.sc_irq_res && sc->ohci_sc.sc_intr_hdl) { + /* + * only call ohci_detach() after ohci_init() + */ + ohci_detach(&sc->ohci_sc); + + err = bus_teardown_intr(dev, sc->ohci_sc.sc_irq_res, + sc->ohci_sc.sc_intr_hdl); + sc->ohci_sc.sc_intr_hdl = NULL; + } + if (sc->ohci_sc.sc_irq_res) { + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->ohci_sc.sc_irq_res); + sc->ohci_sc.sc_irq_res = NULL; + } + if (sc->ohci_sc.sc_io_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, + sc->ohci_sc.sc_io_res); + sc->ohci_sc.sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->ohci_sc.sc_bus, &ohci_iterate_hw_softc); + +#ifdef EXT_RESOURCES + /* Disable clock */ + TAILQ_FOREACH_SAFE(clk, &sc->clk_list, next, clk_tmp) { + err = clk_disable(clk->clk); + if (err != 0) + device_printf(dev, "Could not disable clock %s\n", + clk_get_name(clk->clk)); + err = clk_release(clk->clk); + if (err != 0) + device_printf(dev, "Could not release clock %s\n", + clk_get_name(clk->clk)); + TAILQ_REMOVE(&sc->clk_list, clk, next); + free(clk, M_DEVBUF); + } + + /* De-assert reset */ + if (sc->rst) { + err = hwreset_assert(sc->rst); + if (err != 0) + device_printf(dev, "Could not assert reset\n"); + hwreset_release(sc->rst); + } +#endif + + if (GENERIC_USB_DEINIT(dev) != 0) + return (ENXIO); + + return (0); +} + +static device_method_t generic_ohci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, generic_ohci_probe), + DEVMETHOD(device_attach, generic_ohci_attach), + DEVMETHOD(device_detach, generic_ohci_detach), + + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +driver_t generic_ohci_driver = { + .name = "ohci", + .methods = generic_ohci_methods, + .size = sizeof(struct generic_ohci_softc), +}; + +static devclass_t generic_ohci_devclass; + +DRIVER_MODULE(ohci, simplebus, generic_ohci_driver, + generic_ohci_devclass, 0, 0); +MODULE_DEPEND(ohci, usb, 1, 1, 1); Added: head/sys/dev/usb/controller/generic_usb_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_usb_if.m Tue May 17 17:46:12 2016 (r300068) @@ -0,0 +1,60 @@ +#- +# Copyright (c) 2016 Emmanuel Vadot +# 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$ +# + +INTERFACE generic_usb; + +CODE { + static int + generic_usb_default_init(device_t dev) + { + return (0); + } + + static int + generic_usb_default_deinit(device_t dev) + { + return (0); + } +}; + +HEADER { +}; + +# +# Initialize the SoC bits +# +METHOD int init { + device_t dev; +} DEFAULT generic_usb_default_init; + +# +# Deinitialize the SoC bits +# +METHOD int deinit { + device_t dev; +} DEFAULT generic_usb_default_deinit; From owner-svn-src-all@freebsd.org Tue May 17 17:48:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1EA4B3FFA4; Tue, 17 May 2016 17:48:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E3761139; Tue, 17 May 2016 17:48:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 1403725D3857; Tue, 17 May 2016 17:48:45 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 4F1C4D1F8BA; Tue, 17 May 2016 17:48:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id N0IWxjNZwtTa; Tue, 17 May 2016 17:48:43 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4BB28D1F8A6; Tue, 17 May 2016 17:48:43 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299994 - in head/sys/mips: broadcom conf From: "Bjoern A. Zeeb" In-Reply-To: <201605170000.u4H001Bj095759@repo.freebsd.org> Date: Tue, 17 May 2016 17:48:40 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6C64DB85-43F9-4773-8EE2-0537400386E3@FreeBSD.org> References: <201605170000.u4H001Bj095759@repo.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 17:48:55 -0000 > On 17 May 2016, at 00:00 , Adrian Chadd wrote: >=20 > Author: adrian > Date: Tue May 17 00:00:01 2016 > New Revision: 299994 > URL: https://svnweb.freebsd.org/changeset/base/299994 >=20 > Log: > [mips/broadcom] Add initial support for Broadcom MIPS processor >=20 > Relies on BHND(4) driver. >=20 > There files contains machine-dependent code for Broadcom MIPS = processor and > provide UART driver. >=20 > This is a work in progress; it and the current bhnd code is enough to = boot > on the ASUS RT-N16 and RT-N53 platforms. >=20 > Submitted by: Michael Zhilin > Differential Revision: https://reviews.freebsd.org/D6251 >=20 > Added: > head/sys/mips/broadcom/bcm_machdep.c (contents, props changed) > head/sys/mips/broadcom/bcm_socinfo.c (contents, props changed) > head/sys/mips/broadcom/bcm_socinfo.h (contents, props changed) > head/sys/mips/broadcom/files.broadcom (contents, props changed) > head/sys/mips/broadcom/std.broadcom (contents, props changed) > head/sys/mips/broadcom/uart_bus_chipc.c (contents, props changed) > head/sys/mips/broadcom/uart_cpu_chipc.c (contents, props changed) > head/sys/mips/conf/BCM (contents, props changed) > head/sys/mips/conf/BCM.hints (contents, props changed) Seems you missed a file.. bz@zoo:/tank/users/bz/head.svn% grep -r bcma_nexus.c sys/ sys/mips/broadcom/files.broadcom:dev/bhnd/bcma/bcma_nexus.c = standard bz@zoo:/tank/users/bz/head.svn% find sys/ -name bcma_nexus.c bz@zoo:/tank/users/bz/head.svn% /bz =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-all@freebsd.org Tue May 17 17:58:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B89DB3F242 for ; Tue, 17 May 2016 17:58:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (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 334CA198D for ; Tue, 17 May 2016 17:58:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id i75so33675450ioa.3 for ; Tue, 17 May 2016 10:58:29 -0700 (PDT) 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:date:message-id:subject :from:to; bh=xTFk3c/7dGBw2vrJCe5CBU7ZyVT205rSLsEaQmjByvU=; b=IY8UJkq93MKrKXSEBV7LQnIe6QE8WfIpKOnCbni8Rnl+xWtZ9KF5HZyMWDGF4xpAss 20KA/2ZuOponImpLZ6/owLhpd7uNS7ptkQH/QF2rDrkc240ufKw8lWhk2t0aDdB9o47H 9vpWOv5Mj2ymoRIXIeFLbA7OR7R2OIV6t9/lQMORvlyyP/Njjy+DgYEbZ4C1xh4iklC9 iZ8NuIrSMLio/ittQ5MeE5EoggNdq6nvBAJqCtw2aHnHjZ8fvKo8CvAnA3r/qtIRfheD W/QyyaCIMLbIbbj/n4vJi87DPQGNdtshHDrB77WMuzKG0Q7pv4bMHLK3b682oVNmEgiy BwmA== 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:date :message-id:subject:from:to; bh=xTFk3c/7dGBw2vrJCe5CBU7ZyVT205rSLsEaQmjByvU=; b=F7j+nfOYUh5usCjz3fTU9RZVQqv+qQJghAIAY50swb3vRv6aLzWcPqmZqymNvS8+O9 lwFsKCdVdHm0gyPIK2A/ElJNjFNoDtv9jTZaEDxD5dgChGQ0H9YS4Vm9LrSwgTjDXpNh geuNgLYJzCYatZEbfBl4HyF2jwA1KD1KPm4b+ucfzcquJ+saknI/IvG9pM8xDcQAz3Qm nG/XsWMJUxodXbQdf007EORBdykE7THl6syLsFtvm5/KU/CfD5d1vDA9RAYRbn1nf3K9 s973ivN5dNZhVo5ScP3CdPkY413kSPlkDnYVIDIJklB6kRgmjrCszVlLFfLiOMMlHP5K d3vg== X-Gm-Message-State: AOPr4FV7tJcmKsXsVn2bwTKOMk4zD5hMx6fzEOPM8r9e4mArHbgsQluJH0ZjvuhGK+F27fE3qfH4p+dEWMHYkA== MIME-Version: 1.0 X-Received: by 10.107.40.201 with SMTP id o192mr1966555ioo.183.1463507908593; Tue, 17 May 2016 10:58:28 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.75.68 with HTTP; Tue, 17 May 2016 10:58:28 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160510173351.GA4176@brick> References: <201605101546.u4AFkX0w073701@repo.freebsd.org> <20160510173351.GA4176@brick> Date: Tue, 17 May 2016 11:58:28 -0600 X-Google-Sender-Auth: iE4jpgxp4oUISRv4v-nU9mN6RaE Message-ID: Subject: Re: svn commit: r299371 - in head: sbin/camcontrol sys/cam sys/cam/scsi From: Warner Losh To: Alan Somers , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Kenneth D. Merry" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 17:58:29 -0000 On Tue, May 10, 2016 at 11:33 AM, Edward Tomasz Napierala wrote: > On 0510T1020, Alan Somers wrote: > > On Tue, May 10, 2016 at 9:46 AM, Edward Tomasz Napierala < > trasz@freebsd.org> > > wrote: > > > > > Author: trasz > > > Date: Tue May 10 15:46:33 2016 > > > New Revision: 299371 > > > URL: https://svnweb.freebsd.org/changeset/base/299371 > > > > > > Log: > > > Add "camcontrol reprobe" subcommand, and implement it for da(4). > > > This makes it possible to manually force updating capacity data > > > after the disk got resized. Without it it might be neccessary to > > > reboot before FreeBSD notices updated disk size under eg VMWare. > > > > > > Discussed with: imp@ > > > MFC after: 1 month > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D6108 > > > > > > Modified: > > > head/sbin/camcontrol/camcontrol.8 > > > head/sbin/camcontrol/camcontrol.c > > > head/sys/cam/cam_ccb.h > > > head/sys/cam/cam_xpt.c > > > head/sys/cam/scsi/scsi_da.c > > > > > > > > > > I too have been annoyed that "camcontrol rescan" won't update capacity > > data. But could we solve the problem by simply adding logic to > "camcontrol > > rescan" instead of adding an entirely new command? Would a user ever > want > > to rescan a device without reprobing it too? > > Two reasons. First, I want to be able to pass the device name (like > 'da0') and not the CAM path (like 1:0:0) for usability reasons - it seems > easy to figure out the latter from the former, using "camcontrol devlist", > but it suddenly becomes complicated when you try to explain it in a man > page. You can look up one or the other. fwdownload uses the daX name. > Second - I don't understand the "camcontrol rescan" logic well > enough, and "camcontrol rescan all" sometimes fails for me anyway, > in a way I'm not sure how to debug. > That's a cop-out. CAM is hard, but if you aren't willing to figure itout, adding hacks that the other CAM maintainers have to cope with doesn't help. Also, to be honest I'm not sure those two are actually that related. > Rescanning is about discovering new devices on the bus. "Reprobe" > is about updating... well, mostly updating the capacity. The former > requires enumerating the bus using a mechanism built into XPT; the > latter is just notifying the periph driver (in this case da(4)) that > it needs to query the capacity and call disk_resize(4). > The two are very related. Now we have two stupid paths in CAM instead of one. and you didn't do ada like I asked. Not happy with this at all, but not asking for a back out. Warner From owner-svn-src-all@freebsd.org Tue May 17 18:20:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC916B3FB63; Tue, 17 May 2016 18:20:34 +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 BF0931BCB; Tue, 17 May 2016 18:20:34 +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 u4HIKX3P034713; Tue, 17 May 2016 18:20:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HIKX4N034712; Tue, 17 May 2016 18:20:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605171820.u4HIKX4N034712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 17 May 2016 18:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300069 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 18:20:35 -0000 Author: pfg Date: Tue May 17 18:20:33 2016 New Revision: 300069 URL: https://svnweb.freebsd.org/changeset/base/300069 Log: makefs(1): use all the random(3) range. The generation number is uint32_t so we can fit the complete range of random(3). We could have used arc4random() but the result would be unpredictable and it would prohibit reproducible builds. While here add a comment where seeding is done: this affects reproducible builds and might have to be re-visited to use a release dependent value. MFC after: 2 weeks Modified: head/usr.sbin/makefs/ffs.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Tue May 17 17:46:12 2016 (r300068) +++ head/usr.sbin/makefs/ffs.c Tue May 17 18:20:33 2016 (r300069) @@ -1125,9 +1125,10 @@ ffs_write_inode(union dinode *dp, uint32 initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; + /* Seeding affects reproducible builds. */ srandom(time(NULL)); for (i = 0; i < INOPB(fs); i++) { - dip->di_gen = random() / 2 + 1; + dip->di_gen = random(); dip++; } ffs_wtfs(fsbtodb(fs, ino_to_fsba(fs, From owner-svn-src-all@freebsd.org Tue May 17 18:42:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48057B3F3A0; Tue, 17 May 2016 18:42:40 +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 16F261015; Tue, 17 May 2016 18:42:40 +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 u4HIgdMI043811; Tue, 17 May 2016 18:42:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HIgdnb043808; Tue, 17 May 2016 18:42:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605171842.u4HIgdnb043808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 17 May 2016 18:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300071 - in head: . share/man/man5 sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 18:42:40 -0000 Author: jhb Date: Tue May 17 18:42:38 2016 New Revision: 300071 URL: https://svnweb.freebsd.org/changeset/base/300071 Log: Remove the reiserfs(5) manpage and an example of loading the kernel module. Deleted: head/share/man/man5/reiserfs.5 Modified: head/ObsoleteFiles.inc head/share/man/man5/Makefile head/sys/boot/forth/loader.conf Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue May 17 18:25:09 2016 (r300070) +++ head/ObsoleteFiles.inc Tue May 17 18:42:38 2016 (r300071) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160517: ReiserFS removed +OLD_FILES+=usr/share/man/man5/reiserfs.5.gz # 20160430: kvm_getfiles(3) removed from kvm(3) OLD_LIBS+=usr/lib/libkvm.so.6 OLD_FILES+=usr/share/man/man3/kvm_getfiles.3.gz Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Tue May 17 18:25:09 2016 (r300070) +++ head/share/man/man5/Makefile Tue May 17 18:42:38 2016 (r300071) @@ -57,7 +57,6 @@ MAN= acct.5 \ rc.conf.5 \ rctl.conf.5 \ regdomain.5 \ - reiserfs.5 \ remote.5 \ resolver.5 \ services.5 \ Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue May 17 18:25:09 2016 (r300070) +++ head/sys/boot/forth/loader.conf Tue May 17 18:42:38 2016 (r300071) @@ -215,7 +215,6 @@ nfsclient_load="NO" # NFS client nfsserver_load="NO" # NFS server nullfs_load="NO" # Null filesystem procfs_load="NO" # Process filesystem -reiserfs_load="NO" # ReiserFS unionfs_load="NO" # Union filesystem zfs_load="NO" # ZFS From owner-svn-src-all@freebsd.org Tue May 17 19:00:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D3B4B3FFA3; Tue, 17 May 2016 19:00:11 +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 D27991276; Tue, 17 May 2016 19:00:10 +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 u4HJ0Akb047393; Tue, 17 May 2016 19:00:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HJ0AHn047392; Tue, 17 May 2016 19:00:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605171900.u4HJ0AHn047392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 17 May 2016 19:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300072 - head/sys/dev/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 19:00:11 -0000 Author: mav Date: Tue May 17 19:00:09 2016 New Revision: 300072 URL: https://svnweb.freebsd.org/changeset/base/300072 Log: Fix NULL-dereference panic if VESA reports zero modes. MFC after: 1 week Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Tue May 17 18:42:38 2016 (r300071) +++ head/sys/dev/fb/vesa.c Tue May 17 19:00:09 2016 (r300072) @@ -1025,7 +1025,8 @@ vesa_bios_init(void) ++modes; } - vesa_vmode[modes].vi_mode = EOT; + if (vesa_vmode != NULL) + vesa_vmode[modes].vi_mode = EOT; if (bootverbose) printf("VESA: %d mode(s) found\n", modes); From owner-svn-src-all@freebsd.org Tue May 17 19:34:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14094B3ED6D; Tue, 17 May 2016 19:34:09 +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 B257E18A4; Tue, 17 May 2016 19:34:08 +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 u4HJY7Of059505; Tue, 17 May 2016 19:34:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HJY7ol059504; Tue, 17 May 2016 19:34:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605171934.u4HJY7ol059504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 17 May 2016 19:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300073 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 19:34:09 -0000 Author: jhb Date: Tue May 17 19:34:07 2016 New Revision: 300073 URL: https://svnweb.freebsd.org/changeset/base/300073 Log: Document the formatting requirements of location and pnpinfo strings. devd requires location and pnpinfo strings generated by bus drivers to be formatted as a list of name=value keypairs. Non-conforming bus drivers cause devd to mis-parse device events for these buses. Note that this documents the desired requirements. devctl_safe_quote() doesn't yet escape backslash characters, and devd doesn't handle escaped characters in quoted values. Differential Revision: https://reviews.freebsd.org/D6252 Modified: head/sys/kern/bus_if.m Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Tue May 17 19:00:09 2016 (r300072) +++ head/sys/kern/bus_if.m Tue May 17 19:34:07 2016 (r300073) @@ -532,6 +532,13 @@ METHOD int child_present { * * Return it as a string. If the string is insufficient for the * storage, then return EOVERFLOW. + * + * The string must be formatted as a space-separated list of + * name=value pairs. Names may only contain alphanumeric characters, + * underscores ('_') and hyphens ('-'). Values can contain any + * non-whitespace characters. Values containing whitespace can be + * quoted with double quotes ('"'). Double quotes and backslashes in + * quoted values can be escaped with backslashes ('\'). * * @param _dev the parent device of @p _child * @param _child the device which is being examined @@ -551,7 +558,14 @@ METHOD int child_pnpinfo_str { * * Return it as a string. If the string is insufficient for the * storage, then return EOVERFLOW. - * + * + * The string must be formatted as a space-separated list of + * name=value pairs. Names may only contain alphanumeric characters, + * underscores ('_') and hyphens ('-'). Values can contain any + * non-whitespace characters. Values containing whitespace can be + * quoted with double quotes ('"'). Double quotes and backslashes in + * quoted values can be escaped with backslashes ('\'). + * * @param _dev the parent device of @p _child * @param _child the device which is being examined * @param _buf the address of a buffer to receive the location From owner-svn-src-all@freebsd.org Tue May 17 19:48:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADA77B3D5D9; Tue, 17 May 2016 19:48:29 +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 7048D1344; Tue, 17 May 2016 19:48:29 +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 u4HJmSBR062767; Tue, 17 May 2016 19:48:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HJmShN062765; Tue, 17 May 2016 19:48:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605171948.u4HJmShN062765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 17 May 2016 19:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300074 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 19:48:29 -0000 Author: jhb Date: Tue May 17 19:48:28 2016 New Revision: 300074 URL: https://svnweb.freebsd.org/changeset/base/300074 Log: Rework managing hotplug commands with command completions. Previously the command completion interrupt would post any pending command immediately before pcib_pcie_hotplug_update() had been run to inspect the current status. Now, the command completion interrupt merely clears the flag and stops the timer assuming that the caller is always going to call pcib_pcie_hotplug_update() to generate the next hotplug command if one is needed. While here, fix a bug for systems with command completion where the old (existing) value was written to the slot control register instead of the new value. This fixes the complaint about a missing hotplug interrupt on my T400. Differential Revision: https://reviews.freebsd.org/D6363 Modified: head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_private.h Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue May 17 19:34:07 2016 (r300073) +++ head/sys/dev/pci/pci_pci.c Tue May 17 19:48:28 2016 (r300074) @@ -874,8 +874,11 @@ pcib_probe_hotplug(struct pcib_softc *sc /* * Send a HotPlug command to the slot control register. If this slot - * uses command completion interrupts, these updates will be buffered - * while a previous command is completing. + * uses command completion interrupts and a previous command is still + * in progress, then the command is dropped. Once the previous + * command completes or times out, pcib_pcie_hotplug_update() will be + * invoked to post a new command based on the slot's state at that + * time. */ static void pcib_pcie_hotplug_command(struct pcib_softc *sc, uint16_t val, uint16_t mask) @@ -884,28 +887,20 @@ pcib_pcie_hotplug_command(struct pcib_so uint16_t ctl, new; dev = sc->dev; - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) { - ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2); - new = (ctl & ~mask) | val; - if (new != ctl) - pcie_write_config(dev, PCIER_SLOT_CTL, new, 2); + + if (sc->flags & PCIB_HOTPLUG_CMD_PENDING) return; - } - if (sc->flags & PCIB_HOTPLUG_CMD_PENDING) { - sc->pcie_pending_link_ctl_val &= ~mask; - sc->pcie_pending_link_ctl_val |= val; - sc->pcie_pending_link_ctl_mask |= mask; - } else { - ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2); - new = (ctl & ~mask) | val; - if (new != ctl) { - pcie_write_config(dev, PCIER_SLOT_CTL, ctl, 2); - sc->flags |= PCIB_HOTPLUG_CMD_PENDING; - if (!cold) - callout_reset(&sc->pcie_cc_timer, hz, - pcib_pcie_cc_timeout, sc); - } + ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2); + new = (ctl & ~mask) | val; + if (new == ctl) + return; + pcie_write_config(dev, PCIER_SLOT_CTL, new, 2); + if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS)) { + sc->flags |= PCIB_HOTPLUG_CMD_PENDING; + if (!cold) + callout_reset(&sc->pcie_cc_timer, hz, + pcib_pcie_cc_timeout, sc); } } @@ -913,7 +908,6 @@ static void pcib_pcie_hotplug_command_completed(struct pcib_softc *sc) { device_t dev; - uint16_t ctl, new; dev = sc->dev; @@ -921,23 +915,8 @@ pcib_pcie_hotplug_command_completed(stru device_printf(dev, "Command Completed\n"); if (!(sc->flags & PCIB_HOTPLUG_CMD_PENDING)) return; - if (sc->pcie_pending_link_ctl_mask != 0) { - ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2); - new = ctl & ~sc->pcie_pending_link_ctl_mask; - new |= sc->pcie_pending_link_ctl_val; - if (new != ctl) { - pcie_write_config(dev, PCIER_SLOT_CTL, ctl, 2); - if (!cold) - callout_reset(&sc->pcie_cc_timer, hz, - pcib_pcie_cc_timeout, sc); - } else - sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; - sc->pcie_pending_link_ctl_mask = 0; - sc->pcie_pending_link_ctl_val = 0; - } else { - callout_stop(&sc->pcie_cc_timer); - sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; - } + callout_stop(&sc->pcie_cc_timer); + sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; } /* @@ -1041,11 +1020,10 @@ pcib_pcie_hotplug_update(struct pcib_sof * Interlock. */ if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) { + mask |= PCIEM_SLOT_CTL_EIC; if (card_inserted != - !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS)) { - mask |= PCIEM_SLOT_CTL_EIC; + !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS)) val |= PCIEM_SLOT_CTL_EIC; - } } /* Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Tue May 17 19:34:07 2016 (r300073) +++ head/sys/dev/pci/pcib_private.h Tue May 17 19:48:28 2016 (r300074) @@ -134,8 +134,6 @@ struct pcib_softc uint16_t pcie_slot_sta; uint32_t pcie_link_cap; uint32_t pcie_slot_cap; - uint16_t pcie_pending_link_ctl_mask; - uint16_t pcie_pending_link_ctl_val; struct resource *pcie_irq; void *pcie_ihand; struct task pcie_hp_task; From owner-svn-src-all@freebsd.org Tue May 17 20:18:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C92CB3DC1D; Tue, 17 May 2016 20:18:24 +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 744FD1139; Tue, 17 May 2016 20:18:24 +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 u4HKINns071596; Tue, 17 May 2016 20:18:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HKIN7e071593; Tue, 17 May 2016 20:18:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605172018.u4HKIN7e071593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 20:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300075 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 20:18:24 -0000 Author: adrian Date: Tue May 17 20:18:23 2016 New Revision: 300075 URL: https://svnweb.freebsd.org/changeset/base/300075 Log: [bwn] always allocate maximum size txhdr entries; prepare for fw 598 * always allocate maximum size txhdr entries * set the right rx header offset/framesize based on firmware This still isn't what's completely required for fw 598 support; there's more to come. Tested: * Apple BCM94321MC 11abgn NIC, 11a STA mode, firmware version 4xx. Obtained from: DragonflyBSD (txhdr entry sizing), fw 598 RX header size (linux b43) Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnreg.h head/sys/dev/bwn/if_bwnvar.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 17 19:48:28 2016 (r300074) +++ head/sys/dev/bwn/if_bwn.c Tue May 17 20:18:23 2016 (r300075) @@ -2656,8 +2656,21 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i dr->dr_curslot = -1; } else { if (dr->dr_index == 0) { - dr->dr_rx_bufsize = BWN_DMA0_RX_BUFFERSIZE; - dr->dr_frameoffset = BWN_DMA0_RX_FRAMEOFFSET; + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + case BWN_FW_HDR_410: + dr->dr_rx_bufsize = + BWN_DMA0_RX_BUFFERSIZE_FW351; + dr->dr_frameoffset = + BWN_DMA0_RX_FRAMEOFFSET_FW351; + break; + case BWN_FW_HDR_598: + dr->dr_rx_bufsize = + BWN_DMA0_RX_BUFFERSIZE_FW598; + dr->dr_frameoffset = + BWN_DMA0_RX_FRAMEOFFSET_FW598; + break; + } } else KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__)); } @@ -2676,7 +2689,7 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i dr->dr_txhdr_cache = contigmalloc( (dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_HDRSIZE(mac), M_DEVBUF, M_ZERO, + BWN_MAXTXHDRSIZE, M_DEVBUF, M_ZERO, 0, BUS_SPACE_MAXADDR, 8, 0); if (dr->dr_txhdr_cache == NULL) { device_printf(sc->sc_dev, @@ -2773,7 +2786,7 @@ fail2: if (dr->dr_txhdr_cache != NULL) { contigfree(dr->dr_txhdr_cache, (dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_HDRSIZE(mac), M_DEVBUF); + BWN_MAXTXHDRSIZE, M_DEVBUF); } fail1: free(dr->dr_meta, M_DEVBUF); @@ -2795,7 +2808,7 @@ bwn_dma_ringfree(struct bwn_dma_ring **d if ((*dr)->dr_txhdr_cache != NULL) { contigfree((*dr)->dr_txhdr_cache, ((*dr)->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_HDRSIZE((*dr)->dr_mac), M_DEVBUF); + BWN_MAXTXHDRSIZE, M_DEVBUF); } free((*dr)->dr_meta, M_DEVBUF); free(*dr, M_DEVBUF); Modified: head/sys/dev/bwn/if_bwnreg.h ============================================================================== --- head/sys/dev/bwn/if_bwnreg.h Tue May 17 19:48:28 2016 (r300074) +++ head/sys/dev/bwn/if_bwnreg.h Tue May 17 20:18:23 2016 (r300075) @@ -453,11 +453,13 @@ #define BWN_DMA64_RXSTAT 0xf0000000 #define BWN_DMA64_RXSTAT_DISABLED 0x00000000 #define BWN_DMA_RINGMEMSIZE PAGE_SIZE -#define BWN_DMA0_RX_FRAMEOFFSET 30 +#define BWN_DMA0_RX_FRAMEOFFSET_FW351 30 +#define BWN_DMA0_RX_FRAMEOFFSET_FW598 38 #define BWN_TXRING_SLOTS 64 #define BWN_RXRING_SLOTS 64 -#define BWN_DMA0_RX_BUFFERSIZE IEEE80211_MAX_LEN +#define BWN_DMA0_RX_BUFFERSIZE_FW351 (IEEE80211_MAX_LEN + BWN_DMA0_RX_FRAMEOFFSET_FW351) +#define BWN_DMA0_RX_BUFFERSIZE_FW598 (IEEE80211_MAX_LEN + BWN_DMA0_RX_FRAMEOFFSET_FW598) #define BWN_PHYROUTE_BASE 0x0000 #define BWN_PHYROUTE_MASK 0x0c00 Modified: head/sys/dev/bwn/if_bwnvar.h ============================================================================== --- head/sys/dev/bwn/if_bwnvar.h Tue May 17 19:48:28 2016 (r300074) +++ head/sys/dev/bwn/if_bwnvar.h Tue May 17 20:18:23 2016 (r300075) @@ -59,6 +59,7 @@ struct bwn_mac; #define BWN_TSSI2DBM(num, den) \ ((int32_t)((num < 0) ? num / den : (num + den / 2) / den)) #define BWN_HDRSIZE(mac) bwn_tx_hdrsize(mac) +#define BWN_MAXTXHDRSIZE (112 + (sizeof(struct bwn_plcp6))) #define BWN_PIO_COOKIE(tq, tp) \ ((uint16_t)((((uint16_t)tq->tq_index + 1) << 12) | tp->tp_index)) From owner-svn-src-all@freebsd.org Tue May 17 20:21:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E46B3DCAA; Tue, 17 May 2016 20:21:41 +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 0120E13AE; Tue, 17 May 2016 20:21: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 u4HKLeRG071754; Tue, 17 May 2016 20:21:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HKLeE4071753; Tue, 17 May 2016 20:21:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605172021.u4HKLeE4071753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 20:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300076 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 20:21:41 -0000 Author: adrian Date: Tue May 17 20:21:39 2016 New Revision: 300076 URL: https://svnweb.freebsd.org/changeset/base/300076 Log: [bwn] print out a very obvious notice that GPLv2 code is compiled in if it is. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 17 20:18:23 2016 (r300075) +++ head/sys/dev/bwn/if_bwn.c Tue May 17 20:21:39 2016 (r300076) @@ -564,6 +564,11 @@ bwn_attach(device_t dev) else device_printf(sc->sc_dev, "PIO\n"); +#ifdef BWN_GPL_PHY + device_printf(sc->sc_dev, + "Note: compiled with BWN_GPL_PHY; includes GPLv2 code\n"); +#endif + /* * setup PCI resources and interrupt. */ From owner-svn-src-all@freebsd.org Tue May 17 20:53:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B586B3FF4A; Tue, 17 May 2016 20:53:57 +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 6904C107D; Tue, 17 May 2016 20:53:57 +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 u4HKruob083925; Tue, 17 May 2016 20:53:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HKrulS083924; Tue, 17 May 2016 20:53:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605172053.u4HKrulS083924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 17 May 2016 20:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300077 - head/sys/dev/mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 20:53:57 -0000 Author: avos Date: Tue May 17 20:53:56 2016 New Revision: 300077 URL: https://svnweb.freebsd.org/changeset/base/300077 Log: mwl: drop unneeded NULL pointer check. mh_streams[] is a fixed-length array, not a pointer. Modified: head/sys/dev/mwl/mwlhal.c Modified: head/sys/dev/mwl/mwlhal.c ============================================================================== --- head/sys/dev/mwl/mwlhal.c Tue May 17 20:21:39 2016 (r300076) +++ head/sys/dev/mwl/mwlhal.c Tue May 17 20:53:56 2016 (r300077) @@ -1440,7 +1440,7 @@ mwl_hal_bastream_alloc(struct mwl_hal_va sp->setup = 0; sp->ba_policy = ba_policy; MWL_HAL_UNLOCK(mh); - return sp != NULL ? &sp->public : NULL; + return &sp->public; } const MWL_HAL_BASTREAM * From owner-svn-src-all@freebsd.org Tue May 17 21:23:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84D5EB3F67C; Tue, 17 May 2016 21:23:14 +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 577991122; Tue, 17 May 2016 21:23:14 +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 u4HLND7I092912; Tue, 17 May 2016 21:23:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HLND4w092911; Tue, 17 May 2016 21:23:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605172123.u4HLND4w092911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 May 2016 21:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300078 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 21:23:14 -0000 Author: imp Date: Tue May 17 21:23:13 2016 New Revision: 300078 URL: https://svnweb.freebsd.org/changeset/base/300078 Log: Add support for %S to libstand as well so /boot/loader and friends can use it. Modified: head/lib/libstand/printf.c Modified: head/lib/libstand/printf.c ============================================================================== --- head/lib/libstand/printf.c Tue May 17 20:53:56 2016 (r300077) +++ head/lib/libstand/printf.c Tue May 17 21:23:13 2016 (r300078) @@ -204,6 +204,7 @@ kvprintf(char const *fmt, kvprintf_fn_t char nbuf[MAXNBUF]; char *d; const char *p, *percent, *q; + uint16_t *S; u_char *up; int ch, n; uintmax_t num; @@ -398,6 +399,10 @@ reswitch: switch (ch = (u_char)*fmt++) { while (width--) PCHAR(padc); break; + case 'S': /* Assume console can cope with wide chars */ + for (S = va_arg(ap, uint16_t *); *S != 0; S++) + PCHAR(*S); + break; case 't': tflag = 1; goto reswitch; From owner-svn-src-all@freebsd.org Tue May 17 21:24:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFE7B3F6DC; Tue, 17 May 2016 21:24:11 +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 6D3BA12AD; Tue, 17 May 2016 21:24:11 +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 u4HLOATS092984; Tue, 17 May 2016 21:24:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HLOAYN092983; Tue, 17 May 2016 21:24:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605172124.u4HLOAYN092983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 May 2016 21:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300079 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 21:24:11 -0000 Author: adrian Date: Tue May 17 21:24:10 2016 New Revision: 300079 URL: https://svnweb.freebsd.org/changeset/base/300079 Log: [bwn] correctly calculate RSSI level. Tested: * BCM4311, PHY-G, STA mode * BCM4312, PHY-LP, STA mode * BCM4321, PHY-N, STA moe Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 17 21:23:13 2016 (r300078) +++ head/sys/dev/bwn/if_bwn.c Tue May 17 21:24:10 2016 (r300079) @@ -5770,13 +5770,25 @@ bwn_rxeof(struct bwn_mac *mac, struct mb rssi = max(rxhdr->phy.n.power1, rxhdr->ps2.n.power2); else rssi = max(rxhdr->phy.n.power0, rxhdr->phy.n.power1); +#if 0 + DPRINTF(mac->mac_sc, BWN_DEBUG_RECV, + "%s: power0=%d, power1=%d, power2=%d\n", + __func__, + rxhdr->phy.n.power0, + rxhdr->phy.n.power1, + rxhdr->ps2.n.power2); +#endif break; default: /* XXX TODO: implement rssi for other PHYs */ break; } + /* + * RSSI here is absolute, not relative to the noise floor. + */ noise = mac->mac_stats.link_noise; + rssi = rssi - noise; /* RX radio tap */ if (ieee80211_radiotap_active(ic)) From owner-svn-src-all@freebsd.org Tue May 17 21:25:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C54A5B3F7E3; Tue, 17 May 2016 21:25:21 +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 8996C169D; Tue, 17 May 2016 21:25:21 +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 u4HLPKpV093117; Tue, 17 May 2016 21:25:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HLPKYo093113; Tue, 17 May 2016 21:25:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605172125.u4HLPKYo093113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 May 2016 21:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300081 - in head/sys/boot: efi/libefi efi/loader ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 21:25:21 -0000 Author: imp Date: Tue May 17 21:25:20 2016 New Revision: 300081 URL: https://svnweb.freebsd.org/changeset/base/300081 Log: Implement UEFI set environment variable, as well as exporting the EFI version. This is also scriptable, though additional scripting will be needed. Differential Review: https://reviews.freebsd.org/D4494 MFC After: 3 days Added: head/sys/boot/efi/libefi/env.c (contents, props changed) head/sys/boot/ficl/efi.c (contents, props changed) Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue May 17 21:25:18 2016 (r300080) +++ head/sys/boot/efi/libefi/Makefile Tue May 17 21:25:20 2016 (r300081) @@ -4,7 +4,7 @@ LIB= efi INTERNALLIB= WARNS?= 2 -SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ +SRCS= delay.c efi_console.c efinet.c efipart.c env.c errno.c handles.c \ libefi.c time.c .if ${MACHINE_CPUARCH} == "aarch64" Added: head/sys/boot/efi/libefi/env.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/env.c Tue May 17 21:25:20 2016 (r300081) @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2015 Netflix, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +/* + * Simple wrappers to the underlying UEFI functions. + * See http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES + * for details. + */ +EFI_STATUS +efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, EFI_GUID *vendor_guid) +{ + return RS->GetNextVariableName(variable_name_size, variable_name, vendor_guid); +} + +EFI_STATUS +efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 *attributes, UINTN *data_size, + void *data) +{ + return RS->GetVariable(variable_name, vendor_guid, attributes, data_size, data); +} + +EFI_STATUS +efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 attributes, UINTN data_size, + void *data) +{ + return RS->SetVariable(variable_name, vendor_guid, attributes, data_size, data); +} Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue May 17 21:25:18 2016 (r300080) +++ head/sys/boot/efi/loader/main.c Tue May 17 21:25:20 2016 (r300081) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -336,11 +338,8 @@ main(int argc, CHAR16 *argv[]) printf("Image base: 0x%lx\n", (u_long)img->ImageBase); printf("EFI version: %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff); - printf("EFI Firmware: "); - /* printf doesn't understand EFI Unicode */ - ST->ConOut->OutputString(ST->ConOut, ST->FirmwareVendor); - printf(" (rev %d.%02d)\n", ST->FirmwareRevision >> 16, - ST->FirmwareRevision & 0xffff); + printf("EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor, + ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); @@ -394,6 +393,9 @@ main(int argc, CHAR16 *argv[]) } } + snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16, + ST->Hdr.Revision & 0xffff); + env_setenv("efi-version", EV_VOLATILE, var, env_noset, env_nounset); setenv("LINES", "24", 1); /* optional */ for (k = 0; k < ST->NumberOfTableEntries; k++) { @@ -409,6 +411,19 @@ main(int argc, CHAR16 *argv[]) return (EFI_SUCCESS); /* keep compiler happy */ } +/* XXX move to lib stand ? */ +static int +wcscmp(CHAR16 *a, CHAR16 *b) +{ + + while (*a && *b && *a == *b) { + a++; + b++; + } + return *a - *b; +} + + COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int @@ -616,6 +631,7 @@ command_mode(int argc, char *argv[]) } +/* deprecated */ COMMAND_SET(nvram, "nvram", "get or set NVRAM variables", command_nvram); static int @@ -718,6 +734,186 @@ command_reloadbe(int argc, char *argv[]) } #endif +COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_printenv); + +static int +efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) +{ + UINTN datasz; + EFI_STATUS status; + UINT32 attr; + CHAR16 *data; + char *str; + uint32_t uuid_status; + + datasz = 0; + status = RS->GetVariable(varnamearg, matchguid, &attr, + &datasz, NULL); + if (status != EFI_BUFFER_TOO_SMALL) { + printf("Can't get the variable: error %#lx\n", status); + return (CMD_ERROR); + } + data = malloc(datasz); + status = RS->GetVariable(varnamearg, matchguid, &attr, + &datasz, data); + if (status != EFI_SUCCESS) { + printf("Can't get the variable: error %#lx\n", status); + return (CMD_ERROR); + } + uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); + printf("%s %S=%S\n", str, varnamearg, data); + free(str); + free(data); + return (CMD_OK); +} + +static int +command_efi_printenv(int argc, char *argv[]) +{ + /* + * efi-printenv [-a] + * print all the env + * efi-printenv -u UUID + * print all the env vars tagged with UUID + * efi-printenv -v var + * search all the env vars and print the ones matching var + * eif-printenv -u UUID -v var + * eif-printenv UUID var + * print all the env vars that match UUID and var + */ + /* XXX We assume EFI_GUID is the same as uuid_t */ + int aflag = 0, gflag = 0, lflag = 0, vflag = 0; + int ch; + unsigned i; + EFI_STATUS status; + EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; + EFI_GUID matchguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; + uint32_t uuid_status; + CHAR16 varname[128]; + CHAR16 varnamearg[128]; + UINTN varsz; + + while ((ch = getopt(argc, argv, "ag:lv:")) != -1) { + switch (ch) { + case 'a': + aflag = 1; + break; + case 'g': + gflag = 1; + uuid_from_string(optarg, (uuid_t *)&matchguid, + &uuid_status); + if (uuid_status != uuid_s_ok) { + printf("uid %s could not be parsed\n", optarg); + return (CMD_ERROR); + } + break; + case 'l': + lflag = 1; + break; + case 'v': + vflag = 1; + if (strlen(optarg) >= nitems(varnamearg)) { + printf("Variable %s is longer than %zd characters\n", + optarg, nitems(varnamearg)); + return (CMD_ERROR); + } + for (i = 0; i < strlen(optarg); i++) + varnamearg[i] = optarg[i]; + varnamearg[i] = 0; + default: + printf("Invalid argument %c\n", ch); + return (CMD_ERROR); + } + } + + if (aflag && (gflag || vflag)) { + printf("-a isn't compatible with -v or -u\n"); + return (CMD_ERROR); + } + + if (aflag && optind < argc) { + printf("-a doesn't take any args"); + return (CMD_ERROR); + } + + if (optind == argc) + aflag = 1; + + argc -= optind; + argv += optind; + + if (vflag && gflag) + return efi_print_var(varnamearg, &matchguid, lflag); + + if (argc == 2) { + optarg = argv[0]; + if (strlen(optarg) >= nitems(varnamearg)) { + printf("Variable %s is longer than %zd characters\n", + optarg, nitems(varnamearg)); + return (CMD_ERROR); + } + for (i = 0; i < strlen(optarg); i++) + varnamearg[i] = optarg[i]; + varnamearg[i] = 0; + optarg = argv[1]; + uuid_from_string(optarg, (uuid_t *)&matchguid, + &uuid_status); + if (uuid_status != uuid_s_ok) { + printf("uid %s could not be parsed\n", optarg); + return (CMD_ERROR); + } + return efi_print_var(varnamearg, &matchguid, lflag); + } + + if (argc != 0) { + printf("Too many args\n"); + return (CMD_ERROR); + } + + /* + * Initiate the search -- note the standard takes pain + * to specify the initial call must be a poiner to a NULL + * character. + */ + varsz = nitems(varname); + varname[0] = 0; + status = RS->GetNextVariableName(&varsz, varname, &varguid); + while (status != EFI_NOT_FOUND) { + status = RS->GetNextVariableName(&varsz, varname, + &varguid); + if (aflag) { + efi_print_var(varname, &varguid, lflag); + continue; + } + if (vflag) { + if (wcscmp(varnamearg, varname) == 0) + efi_print_var(varname, &varguid, lflag); + } + if (gflag) { + if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) + efi_print_var(varname, &varguid, lflag); + } + } + + return (CMD_OK); +} + +COMMAND_SET(efiset, "efi-set", "set EFI variables", command_efi_set); + +static int +command_efi_set(int argc, char *argv[]) +{ + return (CMD_OK); +} + +COMMAND_SET(efiunset, "efi-unset", "delete / unset EFI variables", command_efi_unset); + +static int +command_efi_unset(int argc, char *argv[]) +{ + return (CMD_OK); +} + #ifdef LOADER_FDT_SUPPORT extern int command_fdt_internal(int argc, char *argv[]); Added: head/sys/boot/ficl/efi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/ficl/efi.c Tue May 17 21:25:20 2016 (r300081) @@ -0,0 +1,207 @@ +/*- + * Copyright (c) 2014 Netflix, 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. + * + * $FreeBSD$ + */ + +/******************************************************************* +** e f i . c +** Additional words for EFI +** +*******************************************************************/ + +#ifdef TESTMAIN +#include +#include +#include +#include +#include +#include +#include +#else +#include +#endif +#include "bootstrap.h" +#include +#include "ficl.h" + +/* + * FreeBSD's loader interaction words and extras + * + * efi-setenv ( value n name n guid n attr -- 0 | -1) + * efi-getenv ( guid n addr n -- addr' n' | -1 ) + * efi-unsetenv ( name n guid n'' -- ) + */ + +/* + * efi-setenv + * efi-setenv ( value n name n guid n attr -- 0 | -1) + * + * Set environment variables using the SetVariable EFI runtime service. + * + * Value and guid are passed through in binary form (so guid needs to be + * converted to binary form from its string form). Name is converted from + * ASCII to CHAR16. Since ficl doesn't have support for internationalization, + * there's no native CHAR16 interface provided. + * + * attr is an int in the bitmask of the following attributes for this variable. + * + * 1 Non volatile + * 2 Boot service access + * 4 Run time access + * (corresponding to the same bits in the UEFI spec). + */ +void +ficlEfiSetenv(FICL_VM *pVM) +{ +#ifndef TESTMAIN + char *value, *guid; + CHAR16 *name + int i; +#endif + char *namep, *valuep, *guidp; + int names, values, guids, attr; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 6, 0); +#endif + attr = stackPopINT(pVM->pStack); + guids = stackPopINT(pVM->pStack); + guidp = (char*)stackPopPtr(pVM->pStack); + names = stackPopINT(pVM->pStack); + namep = (char*)stackPopPtr(pVM->pStack); + values = stackPopINT(pVM->pStack); + valuep = (char*)stackPopPtr(pVM->pStack); + +#ifndef TESTMAIN + guid = (char*)ficlMalloc(guids); + if (guid != NULL) + vmThrowErr(pVM, "Error: out of memory"); + memcpy(guid, guidp, guids); + + name = (char*)ficlMalloc((names + 1) * sizeof(CHAR16)); + if (name == NULL) + vmThrowErr(pVM, "Error: out of memory"); + for (i = 0; i < names; i++) + name[i] = namep[i]; + name[names] = (CHAR16)0; + + value = (char*)ficlMalloc(values + 1); + if (value != NULL) + vmThrowErr(pVM, "Error: out of memory"); + memcpy(value, valuep, values); + + status = efi_set_variable(name, guid, attr, value); + if (status == EFI_SUCCESS) + stackPushINT(pVM->pStack, 0); + else + stackPushINT(pVM->pStack, -1); + + ficlFree(name); + ficlFree(value); + ficlFree(guid); +#endif + + return; +} + +void +ficlEfiGetenv(FICL_VM *pVM) +{ +#ifndef TESTMAIN + char *name, *value; +#endif + char *namep; + int names; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 2, 2); +#endif + names = stackPopINT(pVM->pStack); + namep = (char*) stackPopPtr(pVM->pStack); + +#ifndef TESTMAIN + name = (char*) ficlMalloc(names+1); + if (!name) + vmThrowErr(pVM, "Error: out of memory"); + strncpy(name, namep, names); + name[names] = '\0'; + + value = getenv(name); + ficlFree(name); + + if(value != NULL) { + stackPushPtr(pVM->pStack, value); + stackPushINT(pVM->pStack, strlen(value)); + } else +#endif + stackPushINT(pVM->pStack, -1); + + return; +} + +void +ficlEfiUnsetenv(FICL_VM *pVM) +{ +#ifndef TESTMAIN + char *name; +#endif + char *namep; + int names; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 2, 0); +#endif + names = stackPopINT(pVM->pStack); + namep = (char*) stackPopPtr(pVM->pStack); + +#ifndef TESTMAIN + name = (char*) ficlMalloc(names+1); + if (!name) + vmThrowErr(pVM, "Error: out of memory"); + strncpy(name, namep, names); + name[names] = '\0'; + + unsetenv(name); + ficlFree(name); +#endif + + return; +} +/************************************************************************** + +** Build FreeBSD platform extensions into the system dictionary +**************************************************************************/ +void ficlEfiCompilePlatform(FICL_SYSTEM *pSys) +{ + FICL_DICT *dp = pSys->dp; + assert (dp); + + dictAppendWord(dp, "efi-setenv", ficlEfiSetenv, FW_DEFAULT); + dictAppendWord(dp, "efi-getenv", ficlEfiGetenv, FW_DEFAULT); + dictAppendWord(dp, "efi-unsetenv", ficlEfiUnsetenv, FW_DEFAULT); + + return; +} From owner-svn-src-all@freebsd.org Tue May 17 21:25:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E7D5B3F7D1; Tue, 17 May 2016 21:25:19 +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 422C3169A; Tue, 17 May 2016 21:25:19 +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 u4HLPIh5093070; Tue, 17 May 2016 21:25:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HLPI32093069; Tue, 17 May 2016 21:25:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605172125.u4HLPI32093069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 May 2016 21:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300080 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 21:25:19 -0000 Author: imp Date: Tue May 17 21:25:18 2016 New Revision: 300080 URL: https://svnweb.freebsd.org/changeset/base/300080 Log: Implement uuid-to-string and uuid-from-string. uuid-from-string takes a string, interprets it as a standard UUID, and returns a binary from of the UUID. uuid-to-string does the reverse. The binary UUID is in allocated memory, so you'll need to free it with 'free' after you are done using it. It won't be automatically garbage collected. Likewise with the string... MFC After: 3 days Modified: head/sys/boot/ficl/loader.c Modified: head/sys/boot/ficl/loader.c ============================================================================== --- head/sys/boot/ficl/loader.c Tue May 17 21:24:10 2016 (r300079) +++ head/sys/boot/ficl/loader.c Tue May 17 21:25:18 2016 (r300080) @@ -45,6 +45,7 @@ #endif #include "bootstrap.h" #include +#include #include "ficl.h" /* FreeBSD's loader interaction words and extras @@ -59,6 +60,8 @@ * pnpdevices ( -- addr ) * pnphandlers ( -- addr ) * ccall ( [[...[p10] p9] ... p1] n addr -- result ) + * uuid-from-string ( addr n -- addr' ) + * uuid-to-string ( addr' -- addr n ) * .# ( value -- ) */ @@ -350,6 +353,75 @@ ficlCcall(FICL_VM *pVM) return; } +void +ficlUuidFromString(FICL_VM *pVM) +{ +#ifndef TESTMAIN + char *uuid; + uint32_t status; +#endif + char *uuidp; + int uuids; + uuid_t *u; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 2, 0); +#endif + + uuids = stackPopINT(pVM->pStack); + uuidp = (char *) stackPopPtr(pVM->pStack); + +#ifndef TESTMAIN + uuid = (char *)ficlMalloc(uuids + 1); + if (!uuid) + vmThrowErr(pVM, "Error: out of memory"); + strncpy(uuid, uuidp, uuids); + uuid[uuids] = '\0'; + + u = (uuid_t *)ficlMalloc(sizeof (*u)); + + uuid_from_string(uuid, u, &status); + ficlFree(uuid); + if (status != uuid_s_ok) { + ficlFree(u); + u = NULL; + } +#else + u = NULL; +#endif + stackPushPtr(pVM->pStack, u); + + + return; +} + +void +ficlUuidToString(FICL_VM *pVM) +{ +#ifndef TESTMAIN + char *uuid; + uint32_t status; +#endif + uuid_t *u; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 1, 0); +#endif + + u = (uuid_t *)stackPopPtr(pVM->pStack); + +#ifndef TESTMAIN + uuid_to_string(u, &uuid, &status); + if (status != uuid_s_ok) { + stackPushPtr(pVM->pStack, uuid); + stackPushINT(pVM->pStack, strlen(uuid)); + } else +#endif + stackPushINT(pVM->pStack, -1); + + return; +} + /************************************************************************** f i c l E x e c F D ** reads in text from file fd and passes it to ficlExec() @@ -920,6 +992,8 @@ void ficlCompilePlatform(FICL_SYSTEM *pS dictAppendWord(dp, "copyout", ficlCopyout, FW_DEFAULT); dictAppendWord(dp, "findfile", ficlFindfile, FW_DEFAULT); dictAppendWord(dp, "ccall", ficlCcall, FW_DEFAULT); + dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT); + dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT); #ifndef TESTMAIN #ifdef __i386__ dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT); From owner-svn-src-all@freebsd.org Tue May 17 21:28:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF1D5B3F919; Tue, 17 May 2016 21:28:29 +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 BEF3D1A47; Tue, 17 May 2016 21:28:29 +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 u4HLSSGV093264; Tue, 17 May 2016 21:28:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HLSSYe093263; Tue, 17 May 2016 21:28:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605172128.u4HLSSYe093263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 21:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300082 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 21:28:30 -0000 Author: kib Date: Tue May 17 21:28:28 2016 New Revision: 300082 URL: https://svnweb.freebsd.org/changeset/base/300082 Log: For async UFS mounts, shrink the directory asynchronously, at least do not pass IO_SYNC to ffs_truncate() unneccessary. Submitted by: bde MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Tue May 17 21:25:20 2016 (r300081) +++ head/sys/ufs/ufs/ufs_lookup.c Tue May 17 21:28:28 2016 (r300082) @@ -1131,7 +1131,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir if (tvp != NULL) VOP_UNLOCK(tvp, 0); error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, - IO_NORMAL | IO_SYNC, cr); + IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); if (error != 0) vprint("ufs_direnter: failed to truncate", dvp); #ifdef UFS_DIRHASH From owner-svn-src-all@freebsd.org Tue May 17 21:31:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 018FFB3FA30; Tue, 17 May 2016 21:31: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 C6B431D54; Tue, 17 May 2016 21:30:59 +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 u4HLUwWY093395; Tue, 17 May 2016 21:30:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HLUwBS093394; Tue, 17 May 2016 21:30:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605172130.u4HLUwBS093394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 21:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300083 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 21:31:00 -0000 Author: kib Date: Tue May 17 21:30:58 2016 New Revision: 300083 URL: https://svnweb.freebsd.org/changeset/base/300083 Log: If IO_SYNC was passed to ffs_truncate(), request synchronous inode update from the final ffs_update(). Noted by: bde MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Tue May 17 21:28:28 2016 (r300082) +++ head/sys/ufs/ffs/ffs_inode.c Tue May 17 21:30:58 2016 (r300083) @@ -610,7 +610,7 @@ extclean: softdep_journal_freeblocks(ip, cred, length, IO_EXT); else softdep_setup_freeblocks(ip, length, IO_EXT); - return (ffs_update(vp, !DOINGASYNC(vp))); + return (ffs_update(vp, (flags & IO_SYNC) != 0 || !DOINGASYNC(vp))); } /* From owner-svn-src-all@freebsd.org Tue May 17 21:35:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 945E5B3FBA3; Tue, 17 May 2016 21:35:36 +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 6586E10F0; Tue, 17 May 2016 21:35:36 +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 u4HLZZSu096184; Tue, 17 May 2016 21:35:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HLZZLv096183; Tue, 17 May 2016 21:35:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605172135.u4HLZZLv096183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 21:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300084 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 21:35:36 -0000 Author: kib Date: Tue May 17 21:35:35 2016 New Revision: 300084 URL: https://svnweb.freebsd.org/changeset/base/300084 Log: Do enable io accounting for read-only mounts and mounts which are remounted to writeable after initial read-only. Assign to dev->si_mountpt earlier to account the accesses done at the mount time. Based on submission by: bde MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue May 17 21:30:58 2016 (r300083) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue May 17 21:35:35 2016 (r300084) @@ -780,6 +780,8 @@ ffs_mountfs(devvp, mp, td) mp->mnt_iosize_max = MAXPHYS; devvp->v_bufobj.bo_ops = &ffs_ops; + if (devvp->v_type == VCHR) + devvp->v_rdev->si_mountpt = mp; fs = NULL; sblockloc = 0; @@ -1049,8 +1051,6 @@ ffs_mountfs(devvp, mp, td) ffs_flushfiles(mp, FORCECLOSE, td); goto out; } - if (devvp->v_type == VCHR && devvp->v_rdev != NULL) - devvp->v_rdev->si_mountpt = mp; if (fs->fs_snapinum[0] != 0) ffs_snapshot_mount(mp); fs->fs_fmod = 1; @@ -1083,6 +1083,8 @@ ffs_mountfs(devvp, mp, td) out: if (bp) brelse(bp); + if (devvp->v_type == VCHR && devvp->v_rdev != NULL) + devvp->v_rdev->si_mountpt = NULL; if (cp != NULL) { DROP_GIANT(); g_topology_lock(); From owner-svn-src-all@freebsd.org Tue May 17 22:08:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43B91B402A0; Tue, 17 May 2016 22:08:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 253F7103E; Tue, 17 May 2016 22:08:50 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id C3699B982; Tue, 17 May 2016 18:08:48 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300071 - in head: . share/man/man5 sys/boot/forth Date: Tue, 17 May 2016 13:39:09 -0700 Message-ID: <5059926.mL06J0FTTS@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605171842.u4HIgdnb043808@repo.freebsd.org> References: <201605171842.u4HIgdnb043808@repo.freebsd.org> 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.2.7 (bigwig.baldwin.cx); Tue, 17 May 2016 18:08:48 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:08:50 -0000 On Tuesday, May 17, 2016 06:42:39 PM John Baldwin wrote: > Author: jhb > Date: Tue May 17 18:42:38 2016 > New Revision: 300071 > URL: https://svnweb.freebsd.org/changeset/base/300071 > > Log: > Remove the reiserfs(5) manpage and an example of loading the kernel module. There is also a glabel backend that parses reiserfs volume labels. It is not GPL'd and might still be useful for someone using a fuse-based reiserfs implementation. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 17 22:28:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D8E6B40574; Tue, 17 May 2016 22:28:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3671B4D; Tue, 17 May 2016 22:28:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMSBUK011969; Tue, 17 May 2016 22:28:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMSBou011965; Tue, 17 May 2016 22:28:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172228.u4HMSBou011965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r300085 - in releng/10.1: . sys/conf sys/dev/kbd sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:28:12 -0000 Author: glebius Date: Tue May 17 22:28:11 2016 New Revision: 300085 URL: https://svnweb.freebsd.org/changeset/base/300085 Log: - Use unsigned version of min() when handling arguments of SETFKEY ioctl. - Validate that user supplied control message length in sendmsg(2) is not negative. Security: SA-16:18 Security: CVE-2016-1886 Security: SA-16:19 Security: CVE-2016-1887 Submitted by: C Turt Approved by: so Modified: releng/10.1/UPDATING releng/10.1/sys/conf/newvers.sh releng/10.1/sys/dev/kbd/kbd.c releng/10.1/sys/kern/uipc_syscalls.c Modified: releng/10.1/UPDATING ============================================================================== --- releng/10.1/UPDATING Tue May 17 21:35:35 2016 (r300084) +++ releng/10.1/UPDATING Tue May 17 22:28:11 2016 (r300085) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20160517 p34 FreeBSD-SA-16:18.atkbd + FreeBSD-SA-16:19.sendmsg + + Fix buffer overflow in keyboard driver. [SA-16:18] + + Fix incorrect argument handling in sendmsg(2). [SA-16:19] + 20160504 p33 FreeBSD-SA-16:17.openssl FreeBSD-EN-16:08.zfs Modified: releng/10.1/sys/conf/newvers.sh ============================================================================== --- releng/10.1/sys/conf/newvers.sh Tue May 17 21:35:35 2016 (r300084) +++ releng/10.1/sys/conf/newvers.sh Tue May 17 22:28:11 2016 (r300085) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RELEASE-p33" +BRANCH="RELEASE-p34" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.1/sys/dev/kbd/kbd.c ============================================================================== --- releng/10.1/sys/dev/kbd/kbd.c Tue May 17 21:35:35 2016 (r300084) +++ releng/10.1/sys/dev/kbd/kbd.c Tue May 17 22:28:11 2016 (r300085) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; Modified: releng/10.1/sys/kern/uipc_syscalls.c ============================================================================== --- releng/10.1/sys/kern/uipc_syscalls.c Tue May 17 21:35:35 2016 (r300084) +++ releng/10.1/sys/kern/uipc_syscalls.c Tue May 17 22:28:11 2016 (r300085) @@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type) struct mbuf *m; int error; + if (buflen < 0) + return (EINVAL); + if (buflen > MLEN) { #ifdef COMPAT_OLDSOCK if (type == MT_SONAME && buflen <= 112) From owner-svn-src-all@freebsd.org Tue May 17 22:28:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA671B4059F; Tue, 17 May 2016 22:28:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F1701CE8; Tue, 17 May 2016 22:28:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMSK2N012022; Tue, 17 May 2016 22:28:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMSKxO012018; Tue, 17 May 2016 22:28:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172228.u4HMSKxO012018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r300086 - in releng/10.2: . sys/conf sys/dev/kbd sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:28:21 -0000 Author: glebius Date: Tue May 17 22:28:20 2016 New Revision: 300086 URL: https://svnweb.freebsd.org/changeset/base/300086 Log: - Use unsigned version of min() when handling arguments of SETFKEY ioctl. - Validate that user supplied control message length in sendmsg(2) is not negative. Security: SA-16:18 Security: CVE-2016-1886 Security: SA-16:19 Security: CVE-2016-1887 Submitted by: C Turt Approved by: so Modified: releng/10.2/UPDATING releng/10.2/sys/conf/newvers.sh releng/10.2/sys/dev/kbd/kbd.c releng/10.2/sys/kern/uipc_syscalls.c Modified: releng/10.2/UPDATING ============================================================================== --- releng/10.2/UPDATING Tue May 17 22:28:11 2016 (r300085) +++ releng/10.2/UPDATING Tue May 17 22:28:20 2016 (r300086) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20160517 p17 FreeBSD-SA-16:18.atkbd + FreeBSD-SA-16:19.sendmsg + + Fix buffer overflow in keyboard driver. [SA-16:18] + + Fix incorrect argument handling in sendmsg(2). [SA-16:19] + 20160504 p16 FreeBSD-SA-16:17.openssl FreeBSD-EN-16:07.ipi FreeBSD-EN-16:08.zfs Modified: releng/10.2/sys/conf/newvers.sh ============================================================================== --- releng/10.2/sys/conf/newvers.sh Tue May 17 22:28:11 2016 (r300085) +++ releng/10.2/sys/conf/newvers.sh Tue May 17 22:28:20 2016 (r300086) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.2" -BRANCH="RELEASE-p16" +BRANCH="RELEASE-p17" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.2/sys/dev/kbd/kbd.c ============================================================================== --- releng/10.2/sys/dev/kbd/kbd.c Tue May 17 22:28:11 2016 (r300085) +++ releng/10.2/sys/dev/kbd/kbd.c Tue May 17 22:28:20 2016 (r300086) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; Modified: releng/10.2/sys/kern/uipc_syscalls.c ============================================================================== --- releng/10.2/sys/kern/uipc_syscalls.c Tue May 17 22:28:11 2016 (r300085) +++ releng/10.2/sys/kern/uipc_syscalls.c Tue May 17 22:28:20 2016 (r300086) @@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type) struct mbuf *m; int error; + if (buflen < 0) + return (EINVAL); + if (buflen > MLEN) { #ifdef COMPAT_OLDSOCK if (type == MT_SONAME && buflen <= 112) From owner-svn-src-all@freebsd.org Tue May 17 22:28:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09DA4B405D0; Tue, 17 May 2016 22:28:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E5D81DD8; Tue, 17 May 2016 22:28:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMSRV7012074; Tue, 17 May 2016 22:28:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMSRP5012070; Tue, 17 May 2016 22:28:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172228.u4HMSRP5012070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r300087 - in releng/10.3: . sys/conf sys/dev/kbd sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:28:29 -0000 Author: glebius Date: Tue May 17 22:28:27 2016 New Revision: 300087 URL: https://svnweb.freebsd.org/changeset/base/300087 Log: - Use unsigned version of min() when handling arguments of SETFKEY ioctl. - Validate that user supplied control message length in sendmsg(2) is not negative. Security: SA-16:18 Security: CVE-2016-1886 Security: SA-16:19 Security: CVE-2016-1887 Submitted by: C Turt Approved by: so Modified: releng/10.3/UPDATING releng/10.3/sys/conf/newvers.sh releng/10.3/sys/dev/kbd/kbd.c releng/10.3/sys/kern/uipc_syscalls.c Modified: releng/10.3/UPDATING ============================================================================== --- releng/10.3/UPDATING Tue May 17 22:28:20 2016 (r300086) +++ releng/10.3/UPDATING Tue May 17 22:28:27 2016 (r300087) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20160517 p3 FreeBSD-SA-16:18.atkbd + FreeBSD-SA-16:19.sendmsg + + Fix buffer overflow in keyboard driver. [SA-16:18] + + Fix incorrect argument handling in sendmsg(2). [SA-16:19] + 20160504 p2 FreeBSD-SA-16:17.openssl FreeBSD-EN-16:06.libc FreeBSD-EN-16:07.ipi Modified: releng/10.3/sys/conf/newvers.sh ============================================================================== --- releng/10.3/sys/conf/newvers.sh Tue May 17 22:28:20 2016 (r300086) +++ releng/10.3/sys/conf/newvers.sh Tue May 17 22:28:27 2016 (r300087) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.3" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.3/sys/dev/kbd/kbd.c ============================================================================== --- releng/10.3/sys/dev/kbd/kbd.c Tue May 17 22:28:20 2016 (r300086) +++ releng/10.3/sys/dev/kbd/kbd.c Tue May 17 22:28:27 2016 (r300087) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; Modified: releng/10.3/sys/kern/uipc_syscalls.c ============================================================================== --- releng/10.3/sys/kern/uipc_syscalls.c Tue May 17 22:28:20 2016 (r300086) +++ releng/10.3/sys/kern/uipc_syscalls.c Tue May 17 22:28:27 2016 (r300087) @@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type) struct mbuf *m; int error; + if (buflen < 0) + return (EINVAL); + if (buflen > MLEN) { #ifdef COMPAT_OLDSOCK if (type == MT_SONAME && buflen <= 112) From owner-svn-src-all@freebsd.org Tue May 17 22:28:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5494EB40606; Tue, 17 May 2016 22:28:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D21F1F82; Tue, 17 May 2016 22:28:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMSbMk012127; Tue, 17 May 2016 22:28:37 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMSbhj012124; Tue, 17 May 2016 22:28:37 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172228.u4HMSbhj012124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:28:38 -0000 Author: glebius Date: Tue May 17 22:28:36 2016 New Revision: 300088 URL: https://svnweb.freebsd.org/changeset/base/300088 Log: - Use unsigned version of min() when handling arguments of SETFKEY ioctl. - Validate that user supplied control message length in sendmsg(2) is not negative. Security: SA-16:18 Security: CVE-2016-1886 Security: SA-16:19 Security: CVE-2016-1887 Submitted by: C Turt Approved by: so Modified: releng/9.3/UPDATING releng/9.3/sys/conf/newvers.sh releng/9.3/sys/dev/kbd/kbd.c Modified: releng/9.3/UPDATING ============================================================================== --- releng/9.3/UPDATING Tue May 17 22:28:27 2016 (r300087) +++ releng/9.3/UPDATING Tue May 17 22:28:36 2016 (r300088) @@ -11,6 +11,10 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20160517 p42 FreeBSD-SA-16:18.atkbd + + Fix buffer overflow in keyboard driver. [SA-16:18] + 20160504 p41 FreeBSD-SA-16:17.openssl FreeBSD-EN-16:08.zfs Modified: releng/9.3/sys/conf/newvers.sh ============================================================================== --- releng/9.3/sys/conf/newvers.sh Tue May 17 22:28:27 2016 (r300087) +++ releng/9.3/sys/conf/newvers.sh Tue May 17 22:28:36 2016 (r300088) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.3" -BRANCH="RELEASE-p41" +BRANCH="RELEASE-p42" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.3/sys/dev/kbd/kbd.c ============================================================================== --- releng/9.3/sys/dev/kbd/kbd.c Tue May 17 22:28:27 2016 (r300087) +++ releng/9.3/sys/dev/kbd/kbd.c Tue May 17 22:28:36 2016 (r300088) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; From owner-svn-src-all@freebsd.org Tue May 17 22:28:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB34AB40639; Tue, 17 May 2016 22:28:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82C9B1040; Tue, 17 May 2016 22:28:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMSgio012175; Tue, 17 May 2016 22:28:42 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMSgqf012174; Tue, 17 May 2016 22:28:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172228.u4HMSgqf012174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300089 - head/sys/dev/kbd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:28:44 -0000 Author: glebius Date: Tue May 17 22:28:42 2016 New Revision: 300089 URL: https://svnweb.freebsd.org/changeset/base/300089 Log: Use unsigned version of min() when handling arguments of SETFKEY ioctl. Submitted by: C Turt Security: SA-16:18 Security: CVE-2016-1886 Modified: head/sys/dev/kbd/kbd.c Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Tue May 17 22:28:36 2016 (r300088) +++ head/sys/dev/kbd/kbd.c Tue May 17 22:28:42 2016 (r300089) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; From owner-svn-src-all@freebsd.org Tue May 17 22:28:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4422B40697; Tue, 17 May 2016 22:28:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B59511255; Tue, 17 May 2016 22:28:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMSrvZ012227; Tue, 17 May 2016 22:28:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMSrrf012226; Tue, 17 May 2016 22:28:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172228.u4HMSrrf012226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300090 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:28:55 -0000 Author: glebius Date: Tue May 17 22:28:53 2016 New Revision: 300090 URL: https://svnweb.freebsd.org/changeset/base/300090 Log: Validate that user supplied control message length is not negative. Submitted by: C Turt Security: SA-16:19 Security: CVE-2016-1887 Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue May 17 22:28:42 2016 (r300089) +++ head/sys/kern/uipc_syscalls.c Tue May 17 22:28:53 2016 (r300090) @@ -1699,6 +1699,9 @@ sockargs(mp, buf, buflen, type) struct mbuf *m; int error; + if (buflen < 0) + return (EINVAL); + if (buflen > MLEN) { #ifdef COMPAT_OLDSOCK if (type == MT_SONAME && buflen <= 112) From owner-svn-src-all@freebsd.org Tue May 17 22:30:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52311B40733; Tue, 17 May 2016 22:30:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F4F713DD; Tue, 17 May 2016 22:30:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMTx19012312; Tue, 17 May 2016 22:29:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMTxLc012311; Tue, 17 May 2016 22:29:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172229.u4HMTxLc012311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300091 - stable/10/sys/dev/kbd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:30:00 -0000 Author: glebius Date: Tue May 17 22:29:59 2016 New Revision: 300091 URL: https://svnweb.freebsd.org/changeset/base/300091 Log: Use unsigned version of min() when handling arguments of SETFKEY ioctl. Submitted by: C Turt Security: SA-16:18 Security: CVE-2016-1886 Modified: stable/10/sys/dev/kbd/kbd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/kbd/kbd.c ============================================================================== --- stable/10/sys/dev/kbd/kbd.c Tue May 17 22:28:53 2016 (r300090) +++ stable/10/sys/dev/kbd/kbd.c Tue May 17 22:29:59 2016 (r300091) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; From owner-svn-src-all@freebsd.org Tue May 17 22:30:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE1F1B40788; Tue, 17 May 2016 22:30:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF56816E0; Tue, 17 May 2016 22:30:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMUhLJ012407; Tue, 17 May 2016 22:30:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMUhPm012406; Tue, 17 May 2016 22:30:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172230.u4HMUhPm012406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300092 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:30:45 -0000 Author: glebius Date: Tue May 17 22:30:43 2016 New Revision: 300092 URL: https://svnweb.freebsd.org/changeset/base/300092 Log: Validate that user supplied control message length is not negative. Submitted by: C Turt Security: SA-16:19 Security: CVE-2016-1887 Modified: stable/10/sys/kern/uipc_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_syscalls.c ============================================================================== --- stable/10/sys/kern/uipc_syscalls.c Tue May 17 22:29:59 2016 (r300091) +++ stable/10/sys/kern/uipc_syscalls.c Tue May 17 22:30:43 2016 (r300092) @@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type) struct mbuf *m; int error; + if (buflen < 0) + return (EINVAL); + if (buflen > MLEN) { #ifdef COMPAT_OLDSOCK if (type == MT_SONAME && buflen <= 112) From owner-svn-src-all@freebsd.org Tue May 17 22:31:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1144DB407E1; Tue, 17 May 2016 22:31:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2DE119B0; Tue, 17 May 2016 22:31:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMVCgd012480; Tue, 17 May 2016 22:31:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMVC0V012479; Tue, 17 May 2016 22:31:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172231.u4HMVC0V012479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300093 - stable/9/sys/dev/kbd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:31:14 -0000 Author: glebius Date: Tue May 17 22:31:12 2016 New Revision: 300093 URL: https://svnweb.freebsd.org/changeset/base/300093 Log: Use unsigned version of min() when handling arguments of SETFKEY ioctl. Submitted by: C Turt Security: SA-16:18 Security: CVE-2016-1886 Modified: stable/9/sys/dev/kbd/kbd.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/kbd/kbd.c ============================================================================== --- stable/9/sys/dev/kbd/kbd.c Tue May 17 22:30:43 2016 (r300092) +++ stable/9/sys/dev/kbd/kbd.c Tue May 17 22:31:12 2016 (r300093) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; From owner-svn-src-all@freebsd.org Tue May 17 22:36:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BD60B40916; Tue, 17 May 2016 22:36:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (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 2B8941C9B; Tue, 17 May 2016 22:36:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x231.google.com with SMTP id s8so18033951ign.0; Tue, 17 May 2016 15:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-transfer-encoding; bh=t/i6AeFs9aAPknf+mFc47CdgHWpB0DHrJsVDXsX8lSM=; b=hZ/CIenk5/RE/lRW5i52vNaIWm2mQnQNSkwQu+Ihm6ZMHybE0TRcswnJTtY2X+JMzH hyq2keSOorSlOR7i4Yimcnbf+NQ10lwGZKgAwNRQ/BGuiyvalECCscguvmZ0g6gVdRBI RekkkZdw2s6xkmFGGAZUIchiC3c0kyy3n3js8emoatQVEwDq8NXwJBeN17oohyjYK8ml zfXgKL4EDWn4rpaVRyaac8BMIWG+9qHd5henmgSWqh404JkkZJyJmvAmswA2Jai1GMOy I+CBMrhX9XGxCDkmGVGICg39WBHMRZUHbm3dps8kw0n+x7O+wDpt/HW2rzNvHgRP1YpX 5KgA== 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:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=t/i6AeFs9aAPknf+mFc47CdgHWpB0DHrJsVDXsX8lSM=; b=HprT1WtHG10ldz/AefsNZ9DaIXJWqHKKX0b7mu0p4ZNECaOGhfiwK8F2jSzqgkpWlM 7ClPTlsSsz+kZWlZ8Xe7CnPvYANUNCMijnaB8GzIOUPoXPdH9FaXUYCyoSSGCYR1zyz8 uXzHiZZgb6kn6Ej6iwzXIDtGtUFljPji76Uca05sYy5prFazfUNyVjwlC0qpckLKZOzT X7aQpA3X8odfSoslNCmuBvvWhSVSYmt+bCEvHAHmBHulWrMuUhOxi9KouVBq/yQ3r2cJ twijKmuPJLUgAm4YlXz3Sgf9bsmvCcCIjVHAE1XZkK5Lw/SfqSbaETP3JXe45uwAAil+ 1SRA== X-Gm-Message-State: AOPr4FV7WHTf03Fvi1AaSBaB/zusr7NtFdvbA71BsSPBzDGNeAOi/97s9xq6L0Bvm8vZL/pOM8pqo6APrmTQzQ== MIME-Version: 1.0 X-Received: by 10.50.40.234 with SMTP id a10mr15799252igl.37.1463524592413; Tue, 17 May 2016 15:36:32 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Tue, 17 May 2016 15:36:32 -0700 (PDT) In-Reply-To: <6C64DB85-43F9-4773-8EE2-0537400386E3@FreeBSD.org> References: <201605170000.u4H001Bj095759@repo.freebsd.org> <6C64DB85-43F9-4773-8EE2-0537400386E3@FreeBSD.org> Date: Tue, 17 May 2016 15:36:32 -0700 X-Google-Sender-Auth: kIJy3votBUBCvL0OIg0E0jE5hVU Message-ID: Subject: Re: svn commit: r299994 - in head/sys/mips: broadcom conf From: Adrian Chadd To: "Bjoern A. Zeeb" Cc: "src-committers@freebsd.org" , "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:36:33 -0000 lemme go see what's missing.. -a On 17 May 2016 at 10:48, Bjoern A. Zeeb wrote: > >> On 17 May 2016, at 00:00 , Adrian Chadd wrote: >> >> Author: adrian >> Date: Tue May 17 00:00:01 2016 >> New Revision: 299994 >> URL: https://svnweb.freebsd.org/changeset/base/299994 >> >> Log: >> [mips/broadcom] Add initial support for Broadcom MIPS processor >> >> Relies on BHND(4) driver. >> >> There files contains machine-dependent code for Broadcom MIPS processor= and >> provide UART driver. >> >> This is a work in progress; it and the current bhnd code is enough to b= oot >> on the ASUS RT-N16 and RT-N53 platforms. >> >> Submitted by: Michael Zhilin >> Differential Revision: https://reviews.freebsd.org/D6251 >> >> Added: >> head/sys/mips/broadcom/bcm_machdep.c (contents, props changed) >> head/sys/mips/broadcom/bcm_socinfo.c (contents, props changed) >> head/sys/mips/broadcom/bcm_socinfo.h (contents, props changed) >> head/sys/mips/broadcom/files.broadcom (contents, props changed) >> head/sys/mips/broadcom/std.broadcom (contents, props changed) >> head/sys/mips/broadcom/uart_bus_chipc.c (contents, props changed) >> head/sys/mips/broadcom/uart_cpu_chipc.c (contents, props changed) >> head/sys/mips/conf/BCM (contents, props changed) >> head/sys/mips/conf/BCM.hints (contents, props changed) > > Seems you missed a file.. > > bz@zoo:/tank/users/bz/head.svn% grep -r bcma_nexus.c sys/ > sys/mips/broadcom/files.broadcom:dev/bhnd/bcma/bcma_nexus.c s= tandard > bz@zoo:/tank/users/bz/head.svn% find sys/ -name bcma_nexus.c > bz@zoo:/tank/users/bz/head.svn% > > /bz > > > =E2=80=94 > Bjoern A. Zeeb Charles Haddon Spurgeon: > "Friendship is one of the sweetest joys of life. Many might have failed > beneath the bitterness of their trial had they not found a friend." > From owner-svn-src-all@freebsd.org Tue May 17 22:39:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AA97B4099E; Tue, 17 May 2016 22:39:01 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001: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 E91CA1E90; Tue, 17 May 2016 22:39:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22b.google.com with SMTP id qe5so79315591igc.1; Tue, 17 May 2016 15:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=3oKkJxHUQVCLjAYkEh+VVFUoMXyrhH00T86sAJJ1+qw=; b=sPXCi0iOvt2fItIi4ke5DtR3afrDkDyY8yzdUeqItaig6Ntz0FJTLd+zgtcPGXq7qi acG2RFQTJSU4q3FBVX2+kaJZcxuLN5dxpb6m8Xt66VwGgCWcxqTArWBcxnijLITAI3Ju HUKSzh5WghP/fFwqAPxv/q1lJv2o/Nlr7/cU+ixK3YMHhMYL6uhAgvyJTCCBJGsJx4Zj YIggvCtxfg3mCUzRlFc6e/rhr1PknDV/6qzrU5qLrNwSDliwZ1TW3Ovtf24Nrtqns/uB aDxOd9ghWTJ2KdqM0jDDiSMIoIBKR5O+fCe98a5hQOte9rS2WbxE1sNOx/rKc608IwbS WJdQ== 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:date :message-id:subject:from:to:cc; bh=3oKkJxHUQVCLjAYkEh+VVFUoMXyrhH00T86sAJJ1+qw=; b=Jyt1uk5z4C2uMW2oFCYXpQky+kQXmA+SJ6Y8xMm4zgDX+gHRYIBVqY8vQvhgnjCoqI Ir5VQ5pGEhh+qD9rU0RQ4Q7ToU9R+Y7TM4YY7Lry5k/ROZCSfBxRBs1i0Q+6y0xevo1g p7AlfuBr+/N48AqthHV+5TElZ2mDNrZVdsp9BzHFRTp81O2Vq3HFtofBrtuQ0M2TgvNZ +xVRUwK2wJxCBw9eWLU14y/QmpOTaA1Q3KWC3uho55l3ia3c7hmfyz9CoJ7zSVbjPlky 6s9phDVrN/icGGBftfQ1+cMQ+Gdgbza8Z0gfqcUu0UecoS4RIe8oNFwHqXZ4Y8ajWtl5 Rnww== X-Gm-Message-State: AOPr4FUvjW5mNotIXsImeCisF/nTktj8DIKKSDrOmNNpdGzy+J/851E3l8AK5uADXZWoykPBtebYW4TwIbOpPA== MIME-Version: 1.0 X-Received: by 10.50.3.73 with SMTP id a9mr14887355iga.22.1463524740491; Tue, 17 May 2016 15:39:00 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Tue, 17 May 2016 15:39:00 -0700 (PDT) In-Reply-To: References: <201605170000.u4H001Bj095759@repo.freebsd.org> <6C64DB85-43F9-4773-8EE2-0537400386E3@FreeBSD.org> Date: Tue, 17 May 2016 15:39:00 -0700 X-Google-Sender-Auth: -iAZLmYvuZWOPdyoJt2sl03qDeI Message-ID: Subject: Re: svn commit: r299994 - in head/sys/mips: broadcom conf From: Adrian Chadd To: "Bjoern A. Zeeb" 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:39:01 -0000 Yeah, I think it's part of another commit. I'll go bug the submitter and find which patch it's sitting in. Ah, the downsides of trying to do things with phabricator and git, with individual reviews for each piece.... -a From owner-svn-src-all@freebsd.org Tue May 17 22:52:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 882FBB40848; Tue, 17 May 2016 22:52:43 +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 55AE3105C; Tue, 17 May 2016 22:52:43 +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 u4HMqg6N021289; Tue, 17 May 2016 22:52:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMqgnO021288; Tue, 17 May 2016 22:52:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605172252.u4HMqgnO021288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 May 2016 22:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300095 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:52:43 -0000 Author: imp Date: Tue May 17 22:52:42 2016 New Revision: 300095 URL: https://svnweb.freebsd.org/changeset/base/300095 Log: Don't forget to quote \ characters with \. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue May 17 22:41:49 2016 (r300094) +++ head/sys/kern/subr_bus.c Tue May 17 22:52:42 2016 (r300095) @@ -862,7 +862,7 @@ devctl_safe_quote(char *dst, const char return; while (src != NULL && walker < ep) { - if (*src == '"') { + if (*src == '"' || *src == '\\') { if (ep - walker < 2) break; *walker++ = '\\'; From owner-svn-src-all@freebsd.org Tue May 17 22:59:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C3C6B40A5D; Tue, 17 May 2016 22:59:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1523412AB; Tue, 17 May 2016 22:59:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 09AF7110D; Tue, 17 May 2016 22:59:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 74A9C1F6B7; Tue, 17 May 2016 22:59:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 96tPMSVjH4B7; Tue, 17 May 2016 22:59:31 +0000 (UTC) Subject: Re: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 56C131F6B2 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org References: <201605172228.u4HMSbhj012124@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <14a8d29d-bc14-3f96-57a4-81f1b6dfdd82@FreeBSD.org> Date: Tue, 17 May 2016 15:59:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605172228.u4HMSbhj012124@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m7UKHXsceuXi7S98v6DVM4uNkrt2tvGKh" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 22:59:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m7UKHXsceuXi7S98v6DVM4uNkrt2tvGKh Content-Type: multipart/mixed; boundary="FAh4wcOMKj9HEW9bGlHNReFxxFPvquB39" From: Bryan Drewery To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Message-ID: <14a8d29d-bc14-3f96-57a4-81f1b6dfdd82@FreeBSD.org> Subject: Re: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd References: <201605172228.u4HMSbhj012124@repo.freebsd.org> In-Reply-To: <201605172228.u4HMSbhj012124@repo.freebsd.org> --FAh4wcOMKj9HEW9bGlHNReFxxFPvquB39 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/17/2016 3:28 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Tue May 17 22:28:36 2016 > New Revision: 300088 > URL: https://svnweb.freebsd.org/changeset/base/300088 >=20 > Log: > - Use unsigned version of min() when handling arguments of SETFKEY io= ctl. > - Validate that user supplied control message length in sendmsg(2) > is not negative. The sendmsg(2) change is not included here (9.3) nor in the advisory but is in the commit log. Was it intended to be changed in 9.3? Plus the only consumer I see is sendit() which seems to be protected already from negative values when not using COMPAT_43: > if (mp->msg_controllen < sizeof(struct cmsghdr) > #ifdef COMPAT_OLDSOCK > && mp->msg_flags !=3D MSG_COMPAT > #endif > ) { > error =3D EINVAL; > goto bad; > } > error =3D sockargs(&control, mp->msg_control, > mp->msg_controllen, MT_CONTROL); =2E.. > =20 > Security: SA-16:18 > Security: CVE-2016-1886 > Security: SA-16:19 > Security: CVE-2016-1887 > Submitted by: C Turt > Approved by: so >=20 > Modified: > releng/9.3/UPDATING > releng/9.3/sys/conf/newvers.sh > releng/9.3/sys/dev/kbd/kbd.c >=20 > Modified: releng/9.3/UPDATING > =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 > --- releng/9.3/UPDATING Tue May 17 22:28:27 2016 (r300087) > +++ releng/9.3/UPDATING Tue May 17 22:28:36 2016 (r300088) > @@ -11,6 +11,10 @@ handbook: > Items affecting the ports and packages system can be found in > /usr/ports/UPDATING. Please read that file before running portupgrade= =2E > =20 > +20160517 p42 FreeBSD-SA-16:18.atkbd > + > + Fix buffer overflow in keyboard driver. [SA-16:18] > + > 20160504 p41 FreeBSD-SA-16:17.openssl > FreeBSD-EN-16:08.zfs > =20 >=20 > Modified: releng/9.3/sys/conf/newvers.sh > =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 > --- releng/9.3/sys/conf/newvers.sh Tue May 17 22:28:27 2016 (r300087) > +++ releng/9.3/sys/conf/newvers.sh Tue May 17 22:28:36 2016 (r300088) > @@ -32,7 +32,7 @@ > =20 > TYPE=3D"FreeBSD" > REVISION=3D"9.3" > -BRANCH=3D"RELEASE-p41" > +BRANCH=3D"RELEASE-p42" > if [ "X${BRANCH_OVERRIDE}" !=3D "X" ]; then > BRANCH=3D${BRANCH_OVERRIDE} > fi >=20 > Modified: releng/9.3/sys/dev/kbd/kbd.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 > --- releng/9.3/sys/dev/kbd/kbd.c Tue May 17 22:28:27 2016 (r300087) > +++ releng/9.3/sys/dev/kbd/kbd.c Tue May 17 22:28:36 2016 (r300088) > @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo > splx(s); > return (error); > } > - kbd->kb_fkeytab[fkeyp->keynum].len =3D imin(fkeyp->flen, MAXFK); > + kbd->kb_fkeytab[fkeyp->keynum].len =3D min(fkeyp->flen, MAXFK); > bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, > kbd->kb_fkeytab[fkeyp->keynum].len); > break; >=20 --=20 Regards, Bryan Drewery --FAh4wcOMKj9HEW9bGlHNReFxxFPvquB39-- --m7UKHXsceuXi7S98v6DVM4uNkrt2tvGKh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXO6JTAAoJEDXXcbtuRpfPvD0IAOGgTX4QeCbPRTBVb+S8d4qa m4/mTeeTuNkhqn8GOpLCPVYepmko7Tv5NIlD/+tjSP+6oIlQlmztD6SuLjpXCJvw jWeG/oFUb+M89wL2nv1lzo0XzQ5W7wX/XeuCgZPu64+8euPmHkaix04kvQwwMFW8 22adL2ox1B9KrLZTN7gAoZtVmywbjsxXC4PgJeLjfmA8286qYlGgGE6IaUjZ1uDQ b5cG0/w2mNUjh5jUbbawX84+e0keGwkE7T/2NwZpTbg00V/QC0t+YTVP/hylyjzS LEAE5Ql0boajRuFqjUGN905zBzeVMiNs79NCQMliVQBJFaLPYyImEq4h8SZWPIw= =Z4O/ -----END PGP SIGNATURE----- --m7UKHXsceuXi7S98v6DVM4uNkrt2tvGKh-- From owner-svn-src-all@freebsd.org Tue May 17 23:07:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6DFBB40BF7; Tue, 17 May 2016 23:07:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BBA1217F7; Tue, 17 May 2016 23:07:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4HN7AeJ038710 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 May 2016 16:07:10 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4HN7AH1038709; Tue, 17 May 2016 16:07:10 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 May 2016 16:07:10 -0700 From: Gleb Smirnoff To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: Re: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd Message-ID: <20160517230710.GB1015@FreeBSD.org> References: <201605172228.u4HMSbhj012124@repo.freebsd.org> <14a8d29d-bc14-3f96-57a4-81f1b6dfdd82@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14a8d29d-bc14-3f96-57a4-81f1b6dfdd82@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 23:07:15 -0000 On Tue, May 17, 2016 at 03:59:26PM -0700, Bryan Drewery wrote: B> > Author: glebius B> > Date: Tue May 17 22:28:36 2016 B> > New Revision: 300088 B> > URL: https://svnweb.freebsd.org/changeset/base/300088 B> > B> > Log: B> > - Use unsigned version of min() when handling arguments of SETFKEY ioctl. B> > - Validate that user supplied control message length in sendmsg(2) B> > is not negative. B> B> The sendmsg(2) change is not included here (9.3) nor in the advisory but B> is in the commit log. Was it intended to be changed in 9.3? That was my failure to mention SA-16:19 in commit message for 9.3. It doesn't apply to 9.x. B> Plus the only consumer I see is sendit() which seems to be protected B> already from negative values when not using COMPAT_43: B> B> > if (mp->msg_controllen < sizeof(struct cmsghdr) B> > #ifdef COMPAT_OLDSOCK B> > && mp->msg_flags != MSG_COMPAT B> > #endif B> > ) { B> > error = EINVAL; B> > goto bad; B> > } B> > error = sockargs(&control, mp->msg_control, B> > mp->msg_controllen, MT_CONTROL); No, it isn't protected. In the comparison (mp->msg_controllen < sizeof(struct cmsghdr)) both values are unsigned. Later in sockargs() it is treated as signed. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue May 17 23:10:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 503CBB40CE4; Tue, 17 May 2016 23:10:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 406A519F8; Tue, 17 May 2016 23:10:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 3A79D1430; Tue, 17 May 2016 23:10:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9AE7A1F6D7; Tue, 17 May 2016 23:10:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 01lt2HfIdmBm; Tue, 17 May 2016 23:10:06 +0000 (UTC) Subject: Re: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5B8B61F6CF To: Gleb Smirnoff References: <201605172228.u4HMSbhj012124@repo.freebsd.org> <14a8d29d-bc14-3f96-57a4-81f1b6dfdd82@FreeBSD.org> <20160517230710.GB1015@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <38ca6091-5607-5796-9f6e-7f2d6c117707@FreeBSD.org> Date: Tue, 17 May 2016 16:10:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160517230710.GB1015@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 23:10:10 -0000 On 5/17/16 4:07 PM, Gleb Smirnoff wrote: > On Tue, May 17, 2016 at 03:59:26PM -0700, Bryan Drewery wrote: > B> > Author: glebius > B> > Date: Tue May 17 22:28:36 2016 > B> > New Revision: 300088 > B> > URL: https://svnweb.freebsd.org/changeset/base/300088 > B> > > B> > Log: > B> > - Use unsigned version of min() when handling arguments of SETFKEY ioctl. > B> > - Validate that user supplied control message length in sendmsg(2) > B> > is not negative. > B> > B> The sendmsg(2) change is not included here (9.3) nor in the advisory but > B> is in the commit log. Was it intended to be changed in 9.3? > > That was my failure to mention SA-16:19 in commit message for 9.3. It doesn't > apply to 9.x. > > B> Plus the only consumer I see is sendit() which seems to be protected > B> already from negative values when not using COMPAT_43: > B> > B> > if (mp->msg_controllen < sizeof(struct cmsghdr) > B> > #ifdef COMPAT_OLDSOCK > B> > && mp->msg_flags != MSG_COMPAT > B> > #endif > B> > ) { > B> > error = EINVAL; > B> > goto bad; > B> > } > B> > error = sockargs(&control, mp->msg_control, > B> > mp->msg_controllen, MT_CONTROL); > > No, it isn't protected. In the comparison (mp->msg_controllen < sizeof(struct cmsghdr)) > both values are unsigned. Later in sockargs() it is treated as signed. Ah, I see the (u_int)buflen casts on the older code now. Thanks. -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Tue May 17 23:14:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D95DB40E85; Tue, 17 May 2016 23:14:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7571E63; Tue, 17 May 2016 23:14:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HNEHMs027937; Tue, 17 May 2016 23:14:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HNEHE5027934; Tue, 17 May 2016 23:14:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172314.u4HNEHE5027934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 23:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300096 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 23:14:18 -0000 Author: glebius Date: Tue May 17 23:14:17 2016 New Revision: 300096 URL: https://svnweb.freebsd.org/changeset/base/300096 Log: Tiny refactor of r294869/r296881: use defines to mask the VNET() macro. Suggested by: bz Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue May 17 22:52:42 2016 (r300095) +++ head/sys/netinet/tcp_input.c Tue May 17 23:14:17 2016 (r300096) @@ -250,7 +250,7 @@ static void tcp_vnet_init(const void *unused) { - COUNTER_ARRAY_ALLOC(VNET(tcps_states), TCP_NSTATES, M_WAITOK); + COUNTER_ARRAY_ALLOC(V_tcps_states, TCP_NSTATES, M_WAITOK); VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); } VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, @@ -261,7 +261,7 @@ static void tcp_vnet_uninit(const void *unused) { - COUNTER_ARRAY_FREE(VNET(tcps_states), TCP_NSTATES); + COUNTER_ARRAY_FREE(V_tcps_states, TCP_NSTATES); VNET_PCPUSTAT_FREE(tcpstat); } VNET_SYSUNINIT(tcp_vnet_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue May 17 22:52:42 2016 (r300095) +++ head/sys/netinet/tcp_subr.c Tue May 17 23:14:17 2016 (r300096) @@ -1642,7 +1642,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == NULL) { n = V_tcbinfo.ipi_count + - counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); + counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb); return (0); @@ -1659,7 +1659,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); - m = counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); + m = counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); error = sysctl_wire_old_buffer(req, 2 * (sizeof xig) + (n + m) * sizeof(struct xtcpcb)); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue May 17 22:52:42 2016 (r300095) +++ head/sys/netinet/tcp_var.h Tue May 17 23:14:17 2016 (r300096) @@ -629,8 +629,9 @@ void kmod_tcpstat_inc(int statnum); * Running TCP connection count by state. */ VNET_DECLARE(counter_u64_t, tcps_states[TCP_NSTATES]); -#define TCPSTATES_INC(state) counter_u64_add(VNET(tcps_states)[state], 1) -#define TCPSTATES_DEC(state) counter_u64_add(VNET(tcps_states)[state], -1) +#define V_tcps_states VNET(tcps_states) +#define TCPSTATES_INC(state) counter_u64_add(V_tcps_states[state], 1) +#define TCPSTATES_DEC(state) counter_u64_add(V_tcps_states[state], -1) /* * TCP specific helper hook point identifiers. From owner-svn-src-all@freebsd.org Tue May 17 23:15:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 237B0B40EE2; Tue, 17 May 2016 23:15:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA1061FFB; Tue, 17 May 2016 23:15:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HNFHfr028024; Tue, 17 May 2016 23:15:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HNFH1M028023; Tue, 17 May 2016 23:15:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172315.u4HNFH1M028023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 23:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300097 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 23:15:18 -0000 Author: glebius Date: Tue May 17 23:15:16 2016 New Revision: 300097 URL: https://svnweb.freebsd.org/changeset/base/300097 Log: Add a comment and KASSERT that a M_NOFREE mbuf has always EXT_EXTREF ext. Submitted by: kmacy Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue May 17 23:14:17 2016 (r300096) +++ head/sys/kern/kern_mbuf.c Tue May 17 23:15:16 2016 (r300097) @@ -638,9 +638,16 @@ mb_free_ext(struct mbuf *m) * Check if the header is embedded in the cluster. It is * important that we can't touch any of the mbuf fields * after we have freed the external storage, since mbuf - * could have been embedded in it. + * could have been embedded in it. For now, the mbufs + * embedded into the cluster are always of type EXT_EXTREF, + * and for this type we won't free the mref. */ - freembuf = (m->m_flags & M_NOFREE) ? 0 : 1; + if (m->m_flags & M_NOFREE) { + freembuf = 0; + KASSERT(m->m_ext.ext_type == EXT_EXTREF, + ("%s: no-free mbuf %p has wrong type", __func__, m)); + } else + freembuf = 1; /* Free attached storage if this mbuf is the only reference to it. */ if (*refcnt == 1 || atomic_fetchadd_int(refcnt, -1) == 1) { From owner-svn-src-all@freebsd.org Tue May 17 23:59:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB06AB3FC96; Tue, 17 May 2016 23:59:40 +0000 (UTC) (envelope-from grog@lemis.com) Received: from www.lemis.com (www.lemis.com [208.86.226.86]) by mx1.freebsd.org (Postfix) with ESMTP id 8C75112A9; Tue, 17 May 2016 23:59:39 +0000 (UTC) (envelope-from grog@lemis.com) Received: from eureka.lemis.com (www.lemis.com [208.86.226.86]) by www.lemis.com (Postfix) with ESMTP id 2B0A61B72800; Tue, 17 May 2016 23:59:32 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id DA60A44A5FE; Wed, 18 May 2016 09:59:30 +1000 (AEST) Date: Wed, 18 May 2016 09:59:30 +1000 From: Greg 'groggy' Lehey To: George Neville-Neil Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Message-ID: <20160517235930.GA61770@eureka.lemis.com> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <1514281.0ZCu4236n8@ralph.baldwin.cx> <20160517071619.GX4617@eureka.lemis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: Organization: The FreeBSD Project Phone: +61-3-5346-1370, +61-3-5309-0418 Mobile: 0401 265 606. Use only as instructed. WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 23:59:41 -0000 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 17 May 2016 at 12:05:09 -0400, George Neville-Neil wrote: > On 17 May 2016, at 3:16, Greg 'groggy' Lehey wrote: >> On Tuesday, 17 May 2016 at 0:04:51 -0700, John Baldwin wrote: >>> On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote: >>>> Author: grog >>>> Date: Tue May 17 04:40:00 2016 >>>> New Revision: 300003 >>>> URL: https://svnweb.freebsd.org/changeset/base/300003 >>>> >>>> Log: >>>> Correct use of incorrect grammar. >>>> >>>> .Pp >>>> The debugging macros >>>> -.Dq "just grown" . >>>> +.Dq "just growed" . >>> >>> "grew"? >> >> "Just growed". Did you never read Uncle Tom's Cabin? Check Topsy. >> >> Of course, what this page really needs is a good overhaul. I'll see >> if I can muster the energy. > > Can you just be honest and admit that this is a trivial commit to > you can vote in the core elections? No. I wouldn't have expected such an underhand accusation from you. I can be honest, but if you had taken the time to check, you would have seen that I was already eligible. And clearly if I had wanted to become eligible, my commit would have been designed not to draw so much attention. > And Seriously? Yes. This wasn't a new change, just reverting a change made in r235317. You'll notice that the expression is in quotes, indicating that it's, well, a quotation and not to be taken literally. And if you quote, you should quote correctly. I stumbled across this by accident doing Something Serious, and it grated. "Just growed" was in this man page from its first commit until 2003-12-30 until 2012-5-12. According to the commit log, the original was reviewed by jkoshy, des, gallatin and njl. > Uncle Toms Cabin? To be fair, I didn't know where it came from either. I only discovered that when searching for the origin of this expression, which until yesterday I had thought well-known. What I have learnt from this exchange is: - Many Americans don't know the expression, though it's American. - Nobody seems to care that the rest of the page is out of date. - People seem to have lost any remnant sense of humour. - You still can't tune a fish. - The bikeshed is blue. Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft mail program reports problems, please read http://lemis.com/broken-MUA --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlc7sGIACgkQIubykFB6QiMAiACgktAgMyqi9aZ7kelNEzHbZWUt WdcAoJKAPDqVrsZHG+gNeyqcafnf48Wu =uhLe -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J-- From owner-svn-src-all@freebsd.org Wed May 18 00:22:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FEEEB3D37C; Wed, 18 May 2016 00:22:53 +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 16BA41FC8; Wed, 18 May 2016 00:22:53 +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 u4I0MqA9048809; Wed, 18 May 2016 00:22:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I0MqSU048808; Wed, 18 May 2016 00:22:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605180022.u4I0MqSU048808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 May 2016 00:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300098 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 00:22:53 -0000 Author: pfg Date: Wed May 18 00:22:52 2016 New Revision: 300098 URL: https://svnweb.freebsd.org/changeset/base/300098 Log: makefs(8): Clarify the comment concerning seeding. Avoid giving the impression makefs currently supports reproduceable builds. Modified: head/usr.sbin/makefs/ffs.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Tue May 17 23:15:16 2016 (r300097) +++ head/usr.sbin/makefs/ffs.c Wed May 18 00:22:52 2016 (r300098) @@ -1125,7 +1125,10 @@ ffs_write_inode(union dinode *dp, uint32 initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; - /* Seeding affects reproducible builds. */ + /* + * XXX: Time-based seeds should be avoided for + * reproduceable builds. + */ srandom(time(NULL)); for (i = 0; i < INOPB(fs); i++) { dip->di_gen = random(); From owner-svn-src-all@freebsd.org Wed May 18 00:33:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C614B3D5EC; Wed, 18 May 2016 00:33: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 E64C61448; Wed, 18 May 2016 00:33: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 u4I0X9eQ051794; Wed, 18 May 2016 00:33:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I0X9pO051793; Wed, 18 May 2016 00:33:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605180033.u4I0X9pO051793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 May 2016 00:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300099 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 00:33:10 -0000 Author: pfg Date: Wed May 18 00:33:08 2016 New Revision: 300099 URL: https://svnweb.freebsd.org/changeset/base/300099 Log: MFC r299089: fsck_msdosfs: Adjust a check. The on-disk FAT array does not include anything before CLUST_FIRST, compensate in size check. Obtained from: NetBSD (CVS Rev. 1.20) Modified: stable/10/sbin/fsck_msdosfs/boot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_msdosfs/boot.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/boot.c Wed May 18 00:22:52 2016 (r300098) +++ stable/10/sbin/fsck_msdosfs/boot.c Wed May 18 00:33:08 2016 (r300099) @@ -221,7 +221,7 @@ readboot(int dosfs, struct bootblock *bo break; } - if (boot->NumFatEntries < boot->NumClusters) { + if (boot->NumFatEntries < boot->NumClusters - CLUST_FIRST) { pfatal("FAT size too small, %u entries won't fit into %u sectors\n", boot->NumClusters, boot->FATsecs); return FSFATAL; From owner-svn-src-all@freebsd.org Wed May 18 01:12:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFE6FB400F5; Wed, 18 May 2016 01:12:22 +0000 (UTC) (envelope-from carpeddiem@gmail.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 777081720; Wed, 18 May 2016 01:12:22 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x234.google.com with SMTP id i75so46418095ioa.3; Tue, 17 May 2016 18:12:22 -0700 (PDT) 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=kjCQK1Wy4Xf1igoNIUhAoBGK+ptSlEY0LAL4rKjKAok=; b=pL9ScBpE1ipeKDNz6HnlWHV1WZ9qug/6IM2CZrC72MzdhNw7fYVC9YxWG3htj9zdpQ jWcmriTFFmQ7ka9jCnUWr2U0guE3rcdmZ0KMvVtH9eQCNlQLeb6OSlP9QulPahc1azc8 xsfNPIKiMhCjs795qGnvlxy47a49vqTfh+IUegcXLu40e5y2WYzy/c51phQuy6367Fuu ukQZWljxioDFpxiL0YGzMhciMQwVpyrNMyd9JPyXyTFyrCyQC5MwnZ7G3yIOV37tBpUM MB08A2OHyyX5N07WxfnDWowoJi5iByDKOan0U2BF7bbBSBEBO41V2o1BKTExA5/h0dgf mNQw== 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=kjCQK1Wy4Xf1igoNIUhAoBGK+ptSlEY0LAL4rKjKAok=; b=MaA2PZaWfbFRVA03H7TL7gf8uVxKooR6qStiXxEc+feS8eerLhQ9xPce16IxwGzl+Y 9P623KzaFbsTlkZyfgdKfUd4O7gxbm6pfzeTmq2L1BfDc11uzLYRcz3KbMov5S9JenjV pb99F5jpVs3f7GbHFCWkNlOQoOTPZXSBKA3fhu7M/1HC4EGFuikzcvGpajm56YWEAans 35FMDztRe+gWYLOP+hWZOeyq+jZJDd+AAW5OtK3urDRzvLDko+khLtio9zGJr0KKNYRS Kz+0QYJ4BnbhBLN+Wy4+z6BQslaQvPDidDezzrzmgXLyggXBD4Lg+kCkZpYDxEnCxofM VTVg== X-Gm-Message-State: AOPr4FXdr0c8cXXJnLBkMDAKVY8kkkyW0O1FUFKhnMhFgQpO7N9Gpis5B/9TUMTp5AcJ3HidgtUWkbbhYpZbtg== X-Received: by 10.107.159.84 with SMTP id i81mr3181966ioe.29.1463533941829; Tue, 17 May 2016 18:12:21 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Tue, 17 May 2016 18:12:02 -0700 (PDT) In-Reply-To: <201605180022.u4I0MqSU048808@repo.freebsd.org> References: <201605180022.u4I0MqSU048808@repo.freebsd.org> From: Ed Maste Date: Wed, 18 May 2016 01:12:02 +0000 X-Google-Sender-Auth: nhK3Z2ZuVtMNeMCrCVSPqf3d2YA Message-ID: Subject: Re: svn commit: r300098 - head/usr.sbin/makefs To: "Pedro F. Giffuni" 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 01:12:22 -0000 On 18 May 2016 at 00:22, Pedro F. Giffuni wrote: > Author: pfg > Date: Wed May 18 00:22:52 2016 > New Revision: 300098 > URL: https://svnweb.freebsd.org/changeset/base/300098 > > Log: > makefs(8): Clarify the comment concerning seeding. > > Avoid giving the impression makefs currently supports reproduceable > builds. Thanks! It might make sense to seed based on SOURCE_DATE_EPOCH (https://reproducible-builds.org/specs/source-date-epoch/) if set, and later on we ought to add an option to set the seed on the command line. But, there are a lot of other reproducible build tasks that are probably more important to tackle before this. From owner-svn-src-all@freebsd.org Wed May 18 02:10:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2E9FB4018B; Wed, 18 May 2016 02:10:06 +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 6D3E51434; Wed, 18 May 2016 02:10:06 +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 u4I2A5JG078793; Wed, 18 May 2016 02:10:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I2A5Ox078791; Wed, 18 May 2016 02:10:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605180210.u4I2A5Ox078791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 18 May 2016 02:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300100 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 02:10:06 -0000 Author: cem Date: Wed May 18 02:10:05 2016 New Revision: 300100 URL: https://svnweb.freebsd.org/changeset/base/300100 Log: ntb_hw(4): Add sysctls for administrative/test link config, state dev.ntb_hw.0.admin_up=0/1: Like ifconfig UP/DOWN. dev.ntb_hw.0.active=0/1: Like ifconfig 'status' Reviewed by: ngie Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6429 Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_hw/ntb_hw.h Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed May 18 00:33:08 2016 (r300099) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed May 18 02:10:05 2016 (r300100) @@ -364,6 +364,8 @@ static bool ntb_poll_link(struct ntb_sof static void save_bar_parameters(struct ntb_pci_bar_info *bar); static void ntb_sysctl_init(struct ntb_softc *); static int sysctl_handle_features(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS); static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS); static int sysctl_handle_register(SYSCTL_HANDLER_ARGS); @@ -2132,6 +2134,8 @@ ntb_link_enable(struct ntb_softc *ntb, e { uint32_t cntl; + ntb_printf(2, "%s\n", __func__); + if (ntb->type == NTB_ATOM) { pci_write_config(ntb->device, NTB_PPD_OFFSET, ntb->ppd | ATOM_PPD_INIT_LINK, 4); @@ -2170,6 +2174,8 @@ ntb_link_disable(struct ntb_softc *ntb) { uint32_t cntl; + ntb_printf(2, "%s\n", __func__); + if (ntb->conn_type == NTB_CONN_TRANSPARENT) { ntb_link_event(ntb); return (0); @@ -2185,6 +2191,23 @@ ntb_link_disable(struct ntb_softc *ntb) return (0); } +bool +ntb_link_enabled(struct ntb_softc *ntb) +{ + uint32_t cntl; + + if (ntb->type == NTB_ATOM) { + cntl = pci_read_config(ntb->device, NTB_PPD_OFFSET, 4); + return ((cntl & ATOM_PPD_INIT_LINK) != 0); + } + + if (ntb->conn_type == NTB_CONN_TRANSPARENT) + return (true); + + cntl = ntb_reg_read(4, ntb->reg->ntb_ctl); + return ((cntl & NTB_CNTL_LINK_DISABLE) == 0); +} + static void recover_atom_link(void *arg) { @@ -2304,16 +2327,26 @@ SYSCTL_NODE(_hw_ntb, OID_AUTO, debug_inf static void ntb_sysctl_init(struct ntb_softc *ntb) { - struct sysctl_oid_list *tree_par, *regpar, *statpar, *errpar; + struct sysctl_oid_list *globals, *tree_par, *regpar, *statpar, *errpar; struct sysctl_ctx_list *ctx; struct sysctl_oid *tree, *tmptree; ctx = device_get_sysctl_ctx(ntb->device); + globals = SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)); - tree = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)), OID_AUTO, - "debug_info", CTLFLAG_RD, NULL, - "Driver state, statistics, and HW registers"); + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "link_status", + CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, + sysctl_handle_link_status_human, "A", + "Link status (human readable)"); + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "active", + CTLFLAG_RD | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_status, + "IU", "Link status (1=active, 0=inactive)"); + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "admin_up", + CTLFLAG_RW | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_admin, + "IU", "Set/get interface status (1=UP, 0=DOWN)"); + + tree = SYSCTL_ADD_NODE(ctx, globals, OID_AUTO, "debug_info", + CTLFLAG_RD, NULL, "Driver state, statistics, and HW registers"); tree_par = SYSCTL_CHILDREN(tree); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "conn_type", CTLFLAG_RD, @@ -2343,10 +2376,6 @@ ntb_sysctl_init(struct ntb_softc *ntb) __DEVOLATILE(uint32_t *, &ntb->lnk_sta), 0, "LNK STA register (cached)"); - SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "link_status", - CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_link_status, - "A", "Link status"); - SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "mw_count", CTLFLAG_RD, &ntb->mw_count, 0, "MW count"); SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "spad_count", CTLFLAG_RD, @@ -2592,7 +2621,37 @@ sysctl_handle_features(SYSCTL_HANDLER_AR } static int -sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) +sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS) +{ + struct ntb_softc *ntb; + unsigned old, new; + int error; + + error = 0; + ntb = arg1; + + old = ntb_link_enabled(ntb); + + error = SYSCTL_OUT(req, &old, sizeof(old)); + if (error != 0 || req->newptr == NULL) + return (error); + + error = SYSCTL_IN(req, &new, sizeof(new)); + if (error != 0) + return (error); + + ntb_printf(0, "Admin set interface state to '%sabled'\n", + (new != 0)? "en" : "dis"); + + if (new != 0) + error = ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); + else + error = ntb_link_disable(ntb); + return (error); +} + +static int +sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS) { struct ntb_softc *ntb; struct sbuf sb; @@ -2620,6 +2679,24 @@ sysctl_handle_link_status(SYSCTL_HANDLER } static int +sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) +{ + struct ntb_softc *ntb; + unsigned res; + int error; + + error = 0; + ntb = arg1; + + res = ntb_link_is_up(ntb, NULL, NULL); + + error = SYSCTL_OUT(req, &res, sizeof(res)); + if (error || !req->newptr) + return (error); + return (EINVAL); +} + +static int sysctl_handle_register(SYSCTL_HANDLER_ARGS) { struct ntb_softc *ntb; Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.h Wed May 18 00:33:08 2016 (r300099) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.h Wed May 18 02:10:05 2016 (r300100) @@ -70,6 +70,7 @@ bool ntb_link_is_up(struct ntb_softc *, void ntb_link_event(struct ntb_softc *); int ntb_link_enable(struct ntb_softc *, enum ntb_speed, enum ntb_width); int ntb_link_disable(struct ntb_softc *); +bool ntb_link_enabled(struct ntb_softc *); int ntb_set_ctx(struct ntb_softc *, void *, const struct ntb_ctx_ops *); void *ntb_get_ctx(struct ntb_softc *, const struct ntb_ctx_ops **); From owner-svn-src-all@freebsd.org Wed May 18 02:41:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47445B4075D; Wed, 18 May 2016 02:41:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id EB75112F6; Wed, 18 May 2016 02:41:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id EDC19D426F7; Wed, 18 May 2016 12:41:54 +1000 (AEST) Date: Wed, 18 May 2016 12:41:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: yBryan Drewery cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: Re: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd In-Reply-To: <38ca6091-5607-5796-9f6e-7f2d6c117707@FreeBSD.org> Message-ID: <20160518124147.V7042@besplex.bde.org> References: <201605172228.u4HMSbhj012124@repo.freebsd.org> <14a8d29d-bc14-3f96-57a4-81f1b6dfdd82@FreeBSD.org> <20160517230710.GB1015@FreeBSD.org> <38ca6091-5607-5796-9f6e-7f2d6c117707@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.1 cv=TuMb/2jh c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=RrjDVB9uFQ6jx_tRzx8A:9 a=xs5e6R2pbfrhoDf7:21 a=vVAk96Y2HvFUoVgZ:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 02:41:58 -0000 On Tue, 17 May 2016, Bryan Drewery wrote: > On 5/17/16 4:07 PM, Gleb Smirnoff wrote: >> On Tue, May 17, 2016 at 03:59:26PM -0700, Bryan Drewery wrote: >> B> > Author: glebius >> B> > Date: Tue May 17 22:28:36 2016 >> B> > New Revision: 300088 >> B> > URL: https://svnweb.freebsd.org/changeset/base/300088 >> B> > >> B> > Log: >> B> > - Use unsigned version of min() when handling arguments of SETFKEY ioctl. >> B> > - Validate that user supplied control message length in sendmsg(2) >> B> > is not negative. >> B> >> B> The sendmsg(2) change is not included here (9.3) nor in the advisory but >> B> is in the commit log. Was it intended to be changed in 9.3? >> >> That was my failure to mention SA-16:19 in commit message for 9.3. It doesn't >> apply to 9.x. >> >> B> Plus the only consumer I see is sendit() which seems to be protected >> B> already from negative values when not using COMPAT_43: >> B> >> B> > if (mp->msg_controllen < sizeof(struct cmsghdr) >> B> > #ifdef COMPAT_OLDSOCK >> B> > && mp->msg_flags != MSG_COMPAT >> B> > #endif >> B> > ) { >> B> > error = EINVAL; >> B> > goto bad; >> B> > } >> B> > error = sockargs(&control, mp->msg_control, >> B> > mp->msg_controllen, MT_CONTROL); >> >> No, it isn't protected. In the comparison (mp->msg_controllen < sizeof(struct cmsghdr)) >> both values are unsigned. Later in sockargs() it is treated as signed. But it is protected (except on exotic unsupported arches). The above is a complete bounds check for mp->msg_controllen, written in an obfuscated way using an unsigned type botch/hack. Negative values are normally promoted to large unsigned values, so they fail this check and sockargs() is never called with them. On exotic arches, the analysis is more complicated and the hack doesn't work. It isn't true in general that both values are unsigned (after promotion). E.g., size_t might be uint31_t and int int32_t. Then the binary promotions give int for both operands. Negative values always pass the bounds check then. Part of the botch is the design error that sizeof() is unsigned. This makes it hard to use. It poisons nearby signed types worse than const poisons pointer types. > Ah, I see the (u_int)buflen casts on the older code now. Thanks. That is a different way of writing the botch/hack. It ensures that the hack works for a left operand that has signed type int or small and a right operand that is >= 0 and is representable as u_int. It ensures that both operands are promoted to u_int, with negative values becoming large unsigned ones. I think. This requires int to not have a very large negative range. (u_int)-1 is UINT_MAX, but it isn't so clear what (u_int)INT_MIN is. In fact, I think it can by 0 with 31-bit u_int padded to 32 bits and 32-bit int with INT_MIN = 0x80000000. If this is allowed, then (u_int)INT_MIN is 0. The botch/hack should never be used. Just check for negative values like sockargs() now does. But it is probably better to check in the caller (not using the botch/hack). I also don't like the change from imin() to min() in kbd.c. One of the args is a small integer (MAXFK = 16). Since this doesn't use sizeof(), it doesn't encourage an unsigned botch. The other arg is 'char flen'. char should never be used for numeric values, but this is an old API written before int8_t was available. Using int8_t instead of simply int might be reasonable packing. flen seems to be only initialized once, from .len. This already gives undefined behaviour from overflow, since len has type u_char. The bounds check should be before this assignment, or just use the same type. Using the unsigned botch for len is probably not justified, but u_char is good for packing. If the common type is int8_t or signed char (or plain char to maximise complications), then a check that the length >= 0 will be needed later if the table is under user control. Perhaps the length needs to be strictly > 0 so you need to check the lower bound even using the unsigned botch. The packing using chars is actually just at the end. struct fkeytab is uchar [16] followed by 1 u_char for 'len' at the end. 4 bytes would be natural. On x86, this gives a 17-byte struct which gives a bad layout in arrays, and on other arches it gives portaility problems. struct fkeyarg is u_short, then char [16], then 1 char for 'flen' at the end. 2 bytes would be natural. Bruce From owner-svn-src-all@freebsd.org Wed May 18 02:59:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D59B40A58; Wed, 18 May 2016 02:59:47 +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 6D9F3198C; Wed, 18 May 2016 02:59:47 +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 u4I2xkb5093776; Wed, 18 May 2016 02:59:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I2xk4G093774; Wed, 18 May 2016 02:59:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180259.u4I2xk4G093774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 02:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300101 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 02:59:47 -0000 Author: sephe Date: Wed May 18 02:59:46 2016 New Revision: 300101 URL: https://svnweb.freebsd.org/changeset/base/300101 Log: hyperv/vmbus: Use unsigned long for event bits. And move base channel id calculation out of inner loop. This prepares for more event processing optimization. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6384 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 02:10:05 2016 (r300100) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 02:59:46 2016 (r300101) @@ -294,13 +294,10 @@ hv_vmbus_disconnect(void) { void hv_vmbus_on_events(int cpu) { - int bit; - int dword; - void *page_addr; - uint32_t* recv_interrupt_page = NULL; - int rel_id; - int maxdword; + unsigned long *intr_page; hv_vmbus_synic_event_flags *event; + void *page_addr; + int page_cnt, pg; KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " "cpu out of range!")); @@ -310,39 +307,42 @@ hv_vmbus_on_events(int cpu) page_addr + HV_VMBUS_MESSAGE_SINT; if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { - maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5; + page_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >> + HV_CHANNEL_ULONG_SHIFT; /* * receive size is 1/2 page and divide that by 4 bytes */ - if (atomic_testandclear_int(&event->flags32[0], 0)) { - recv_interrupt_page = - hv_vmbus_g_connection.recv_interrupt_page; - } else { + if (atomic_testandclear_int(&event->flags32[0], 0)) + intr_page = hv_vmbus_g_connection.recv_interrupt_page; + else return; - } } else { /* * On Host with Win8 or above, the event page can be * checked directly to get the id of the channel * that has the pending interrupt. */ - maxdword = HV_EVENT_FLAGS_DWORD_COUNT; - recv_interrupt_page = event->flags32; + page_cnt = HV_EVENT_FLAGS_ULONG_COUNT; + intr_page = event->flagsul; } /* * Check events */ - for (dword = 0; dword < maxdword; dword++) { - if (recv_interrupt_page[dword] == 0) + for (pg = 0; pg < page_cnt; pg++) { + uint32_t rel_id_base; + int bit; + + if (intr_page[pg] == 0) continue; - for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) { - if (atomic_testandclear_int( - &recv_interrupt_page[dword], bit)) { + rel_id_base = pg << HV_CHANNEL_ULONG_SHIFT; + for (bit = 0; bit < HV_CHANNEL_ULONG_LEN; bit++) { + if (atomic_testandclear_long(&intr_page[pg], bit)) { struct hv_vmbus_channel *channel; + uint32_t rel_id; - rel_id = (dword << 5) + bit; + rel_id = rel_id_base + bit; channel = hv_vmbus_g_connection.channels[rel_id]; @@ -357,7 +357,7 @@ hv_vmbus_on_events(int cpu) taskqueue_enqueue(channel->rxq, &channel->channel_task); } - } + } } } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 18 02:10:05 2016 (r300100) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 18 02:59:46 2016 (r300101) @@ -57,10 +57,18 @@ typedef uint16_t hv_vmbus_status; #define HV_EVENT_FLAGS_COUNT (256 * 8) #define HV_EVENT_FLAGS_BYTE_COUNT (256) #define HV_EVENT_FLAGS_DWORD_COUNT (256 / sizeof(uint32_t)) +#define HV_EVENT_FLAGS_ULONG_COUNT (256 / sizeof(unsigned long)) /** * max channel count <== event_flags_dword_count * bit_of_dword */ +#ifdef __LP64__ +#define HV_CHANNEL_ULONG_LEN (64) +#define HV_CHANNEL_ULONG_SHIFT (6) +#else +#define HV_CHANNEL_ULONG_LEN (32) +#define HV_CHANNEL_ULONG_SHIFT (5) +#endif #define HV_CHANNEL_DWORD_LEN (32) #define HV_CHANNEL_MAX_COUNT \ ((HV_EVENT_FLAGS_DWORD_COUNT) * HV_CHANNEL_DWORD_LEN) @@ -575,7 +583,9 @@ typedef struct { typedef union { uint8_t flags8[HV_EVENT_FLAGS_BYTE_COUNT]; uint32_t flags32[HV_EVENT_FLAGS_DWORD_COUNT]; + unsigned long flagsul[HV_EVENT_FLAGS_ULONG_COUNT]; } hv_vmbus_synic_event_flags; +CTASSERT(sizeof(hv_vmbus_synic_event_flags) == HV_EVENT_FLAGS_BYTE_COUNT); #define HV_X64_CPUID_MIN (0x40000005) #define HV_X64_CPUID_MAX (0x4000ffff) From owner-svn-src-all@freebsd.org Wed May 18 03:19:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72728B40E77; Wed, 18 May 2016 03:19:55 +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 35C25181C; Wed, 18 May 2016 03:19:55 +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 u4I3JsMM000447; Wed, 18 May 2016 03:19:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3JsRu000443; Wed, 18 May 2016 03:19:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180319.u4I3JsRu000443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 03:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300102 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:19:55 -0000 Author: sephe Date: Wed May 18 03:19:53 2016 New Revision: 300102 URL: https://svnweb.freebsd.org/changeset/base/300102 Log: hyperv/vmbus: Reduce the # of event loops by recording event flag count Use vmbus softc to save vmbus per-cpu data. More stuffs will be moved into vmbus softc. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6403 Added: head/sys/dev/hyperv/vmbus/vmbus_var.h (contents, props changed) Modified: head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Wed May 18 02:59:46 2016 (r300101) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Wed May 18 03:19:53 2016 (r300102) @@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include "hv_vmbus_priv.h" +#include +#include static int vmbus_channel_create_gpadl_header( /* must be phys and virt contiguous*/ @@ -199,6 +200,8 @@ hv_vmbus_channel_open( new_channel->on_channel_callback = pfn_on_channel_callback; new_channel->channel_callback_context = context; + vmbus_on_channel_open(new_channel); + new_channel->rxq = hv_vmbus_g_context.hv_event_queue[new_channel->target_cpu]; TASK_INIT(&new_channel->channel_task, 0, VmbusProcessChannelEvent, new_channel); Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 02:59:46 2016 (r300101) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 03:19:53 2016 (r300102) @@ -38,7 +38,8 @@ #include #include -#include "hv_vmbus_priv.h" +#include +#include /* * Globals @@ -294,10 +295,10 @@ hv_vmbus_disconnect(void) { void hv_vmbus_on_events(int cpu) { - unsigned long *intr_page; + unsigned long *intr_flags; hv_vmbus_synic_event_flags *event; void *page_addr; - int page_cnt, pg; + int flag_cnt, f; KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " "cpu out of range!")); @@ -307,13 +308,13 @@ hv_vmbus_on_events(int cpu) page_addr + HV_VMBUS_MESSAGE_SINT; if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { - page_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >> + flag_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >> HV_CHANNEL_ULONG_SHIFT; /* * receive size is 1/2 page and divide that by 4 bytes */ if (atomic_testandclear_int(&event->flags32[0], 0)) - intr_page = hv_vmbus_g_connection.recv_interrupt_page; + intr_flags = hv_vmbus_g_connection.recv_interrupt_page; else return; } else { @@ -322,23 +323,23 @@ hv_vmbus_on_events(int cpu) * checked directly to get the id of the channel * that has the pending interrupt. */ - page_cnt = HV_EVENT_FLAGS_ULONG_COUNT; - intr_page = event->flagsul; + flag_cnt = VMBUS_PCPU_GET(event_flag_cnt, cpu); + intr_flags = event->flagsul; } /* * Check events */ - for (pg = 0; pg < page_cnt; pg++) { + for (f = 0; f < flag_cnt; f++) { uint32_t rel_id_base; int bit; - if (intr_page[pg] == 0) + if (intr_flags[f] == 0) continue; - rel_id_base = pg << HV_CHANNEL_ULONG_SHIFT; + rel_id_base = f << HV_CHANNEL_ULONG_SHIFT; for (bit = 0; bit < HV_CHANNEL_ULONG_LEN; bit++) { - if (atomic_testandclear_long(&intr_page[pg], bit)) { + if (atomic_testandclear_long(&intr_flags[f], bit)) { struct hv_vmbus_channel *channel; uint32_t rel_id; @@ -412,3 +413,30 @@ hv_vmbus_set_event(hv_vmbus_channel *cha return (ret); } + +void +vmbus_on_channel_open(const struct hv_vmbus_channel *chan) +{ + volatile int *flag_cnt_ptr; + int flag_cnt; + + flag_cnt = (chan->offer_msg.child_rel_id / HV_CHANNEL_ULONG_LEN) + 1; + flag_cnt_ptr = VMBUS_PCPU_PTR(event_flag_cnt, chan->target_cpu); + + for (;;) { + int old_flag_cnt; + + old_flag_cnt = *flag_cnt_ptr; + if (old_flag_cnt >= flag_cnt) + break; + if (atomic_cmpset_int(flag_cnt_ptr, old_flag_cnt, flag_cnt)) { + if (bootverbose) { + printf("VMBUS: channel%u update " + "cpu%d flag_cnt to %d\n", + chan->offer_msg.child_rel_id, + chan->target_cpu, flag_cnt); + } + break; + } + } +} Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 02:59:46 2016 (r300101) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:19:53 2016 (r300102) @@ -60,11 +60,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include "hv_vmbus_priv.h" +#include +#include #include #include "acpi_if.h" +struct vmbus_softc *vmbus_sc; + static device_t vmbus_devp; static int vmbus_inited; static hv_setup_args setup_args; /* only CPU 0 supported at this time */ @@ -517,7 +520,9 @@ vmbus_attach(device_t dev) { if(bootverbose) device_printf(dev, "VMBUS: attach dev: %p\n", dev); + vmbus_devp = dev; + vmbus_sc = device_get_softc(dev); #ifndef EARLY_AP_STARTUP /* @@ -537,7 +542,7 @@ vmbus_attach(device_t dev) static void vmbus_init(void) { - if (vm_guest != VM_GUEST_HV) + if (vm_guest != VM_GUEST_HV || vmbus_get_softc() == NULL) return; #ifndef EARLY_AP_STARTUP @@ -646,9 +651,11 @@ static device_method_t vmbus_methods[] = { 0, 0 } }; -static char driver_name[] = "vmbus"; -static driver_t vmbus_driver = { driver_name, vmbus_methods,0, }; - +static driver_t vmbus_driver = { + "vmbus", + vmbus_methods, + sizeof(struct vmbus_softc) +}; devclass_t vmbus_devclass; Added: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 18 03:19:53 2016 (r300102) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VMBUS_VAR_H_ +#define _VMBUS_VAR_H_ + +#include + +struct vmbus_pcpu_data { + int event_flag_cnt; /* # of event flags */ +} __aligned(CACHE_LINE_SIZE); + +struct vmbus_softc { + struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; +}; + +extern struct vmbus_softc *vmbus_sc; + +static __inline struct vmbus_softc * +vmbus_get_softc(void) +{ + return vmbus_sc; +} + +#define VMBUS_PCPU_GET(field, cpu) \ + (vmbus_get_softc())->vmbus_pcpu[cpu].field +#define VMBUS_PCPU_PTR(field, cpu) \ + &(vmbus_get_softc())->vmbus_pcpu[cpu].field + +void vmbus_on_channel_open(const struct hv_vmbus_channel *); + +#endif /* !_VMBUS_VAR_H_ */ From owner-svn-src-all@freebsd.org Wed May 18 03:21:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE63EB40FA7; Wed, 18 May 2016 03:21:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BF491CA8; Wed, 18 May 2016 03:21:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I3LL8T002532; Wed, 18 May 2016 03:21:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3LLWH002531; Wed, 18 May 2016 03:21:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605180321.u4I3LLWH002531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 May 2016 03:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300103 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:21:22 -0000 Author: markj Date: Wed May 18 03:21:21 2016 New Revision: 300103 URL: https://svnweb.freebsd.org/changeset/base/300103 Log: lockstat:::thread-spin should only fire after spinning for the lock. MFC after: 1 week Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed May 18 03:19:53 2016 (r300102) +++ head/sys/kern/kern_mutex.c Wed May 18 03:21:21 2016 (r300103) @@ -714,7 +714,8 @@ retry: LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); - LOCKSTAT_RECORD1(thread__spin, m, spin_time); + if (spin_time != 0) + LOCKSTAT_RECORD1(thread__spin, m, spin_time); } struct mtx * From owner-svn-src-all@freebsd.org Wed May 18 03:23:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21CA7B3F10A; Wed, 18 May 2016 03:23:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E669D1EF4; Wed, 18 May 2016 03:23:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I3N8sc003274; Wed, 18 May 2016 03:23:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3N8dP003273; Wed, 18 May 2016 03:23:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605180323.u4I3N8dP003273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 May 2016 03:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300104 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:23:09 -0000 Author: markj Date: Wed May 18 03:23:07 2016 New Revision: 300104 URL: https://svnweb.freebsd.org/changeset/base/300104 Log: Guard the lockstat:::thread-spin probe with KDTRACE_HOOKS. X-MFC-With: r300103 Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed May 18 03:21:21 2016 (r300103) +++ head/sys/kern/kern_mutex.c Wed May 18 03:23:07 2016 (r300104) @@ -714,8 +714,10 @@ retry: LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); +#ifdef KDTRACE_HOOKS if (spin_time != 0) LOCKSTAT_RECORD1(thread__spin, m, spin_time); +#endif } struct mtx * From owner-svn-src-all@freebsd.org Wed May 18 03:28:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70FA8B3F252; Wed, 18 May 2016 03:28: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 27CE811E9; Wed, 18 May 2016 03:28: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 u4I3Sp4l003632; Wed, 18 May 2016 03:28:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3SpND003631; Wed, 18 May 2016 03:28:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180328.u4I3SpND003631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 03:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300105 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:28:52 -0000 Author: sephe Date: Wed May 18 03:28:51 2016 New Revision: 300105 URL: https://svnweb.freebsd.org/changeset/base/300105 Log: hyperv/vmbus: Use atomic swap and flsl to process event flags Greatly reduce the locked instructions and reduce number of inner loops. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6404 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 03:23:07 2016 (r300104) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 03:28:51 2016 (r300105) @@ -332,32 +332,32 @@ hv_vmbus_on_events(int cpu) */ for (f = 0; f < flag_cnt; f++) { uint32_t rel_id_base; + unsigned long flags; int bit; if (intr_flags[f] == 0) continue; + flags = atomic_swap_long(&intr_flags[f], 0); rel_id_base = f << HV_CHANNEL_ULONG_SHIFT; - for (bit = 0; bit < HV_CHANNEL_ULONG_LEN; bit++) { - if (atomic_testandclear_long(&intr_flags[f], bit)) { - struct hv_vmbus_channel *channel; - uint32_t rel_id; - - rel_id = rel_id_base + bit; - channel = - hv_vmbus_g_connection.channels[rel_id]; - - /* if channel is closed or closing */ - if (channel == NULL || channel->rxq == NULL) - continue; - - if (channel->batched_reading) { - hv_ring_buffer_read_begin( - &channel->inbound); - } - taskqueue_enqueue(channel->rxq, - &channel->channel_task); - } + + while ((bit = ffsl(flags)) != 0) { + struct hv_vmbus_channel *channel; + uint32_t rel_id; + + --bit; /* NOTE: ffsl is 1-based */ + flags &= ~(1UL << bit); + + rel_id = rel_id_base + bit; + channel = hv_vmbus_g_connection.channels[rel_id]; + + /* if channel is closed or closing */ + if (channel == NULL || channel->rxq == NULL) + continue; + + if (channel->batched_reading) + hv_ring_buffer_read_begin(&channel->inbound); + taskqueue_enqueue(channel->rxq, &channel->channel_task); } } } From owner-svn-src-all@freebsd.org Wed May 18 03:34:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB39B3F3DE; Wed, 18 May 2016 03:34:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40A90178B; Wed, 18 May 2016 03:34:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I3Y2DA006636; Wed, 18 May 2016 03:34:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3Y2Me006633; Wed, 18 May 2016 03:34:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605180334.u4I3Y2Me006633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 May 2016 03:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300106 - in head/sys: conf kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:34:03 -0000 Author: markj Date: Wed May 18 03:34:02 2016 New Revision: 300106 URL: https://svnweb.freebsd.org/changeset/base/300106 Log: Remove the MUTEX_DEBUG kernel option. It has no counterpart among the other lock primitives and has been a no-op for years. Mutex consistency checks are generally done whenver INVARIANTS is enabled. Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_mutex.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed May 18 03:28:51 2016 (r300105) +++ head/sys/conf/NOTES Wed May 18 03:34:02 2016 (r300106) @@ -298,7 +298,6 @@ options SX_NOINLINE # performance and increase the frequency of kernel panics by # design. If you aren't sure that you need it then you don't. # Relies on the PREEMPTION option. DON'T TURN THIS ON. -# MUTEX_DEBUG enables various extra assertions in the mutex code. # SLEEPQUEUE_PROFILING enables rudimentary profiling of the hash table # used to hold active sleep queues as well as sleep wait message # frequency. @@ -314,7 +313,6 @@ options SX_NOINLINE # WITNESS_SKIPSPIN disables the witness checks on spin mutexes. options PREEMPTION options FULL_PREEMPTION -options MUTEX_DEBUG options WITNESS options WITNESS_KDB options WITNESS_SKIPSPIN Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed May 18 03:28:51 2016 (r300105) +++ head/sys/conf/options Wed May 18 03:34:02 2016 (r300106) @@ -590,7 +590,6 @@ MAXCPU opt_global.h MAXMEMDOM opt_global.h MAXPHYS opt_global.h MCLSHIFT opt_global.h -MUTEX_DEBUG opt_global.h MUTEX_NOINLINE opt_global.h LOCK_PROFILING opt_global.h LOCK_PROFILING_FAST opt_global.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed May 18 03:28:51 2016 (r300105) +++ head/sys/kern/kern_mutex.c Wed May 18 03:34:02 2016 (r300106) @@ -845,37 +845,6 @@ __mtx_assert(const volatile uintptr_t *c #endif /* - * The MUTEX_DEBUG-enabled mtx_validate() - * - * Most of these checks have been moved off into the LO_INITIALIZED flag - * maintained by the witness code. - */ -#ifdef MUTEX_DEBUG - -void mtx_validate(struct mtx *); - -void -mtx_validate(struct mtx *m) -{ - -/* - * XXX: When kernacc() does not require Giant we can reenable this check - */ -#ifdef notyet - /* - * Can't call kernacc() from early init386(), especially when - * initializing Giant mutex, because some stuff in kernacc() - * requires Giant itself. - */ - if (!cold) - if (!kernacc((caddr_t)m, sizeof(m), - VM_PROT_READ | VM_PROT_WRITE)) - panic("Can't read and write to mutex %p", m); -#endif -} -#endif - -/* * General init routine used by the MTX_SYSINIT() macro. */ void @@ -908,11 +877,6 @@ _mtx_init(volatile uintptr_t *c, const c ("%s: mtx_lock not aligned for %s: %p", __func__, name, &m->mtx_lock)); -#ifdef MUTEX_DEBUG - /* Diagnostic and error correction */ - mtx_validate(m); -#endif - /* Determine lock class and lock flags. */ if (opts & MTX_SPIN) class = &lock_class_mtx_spin; From owner-svn-src-all@freebsd.org Wed May 18 03:41:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A214B3F545; Wed, 18 May 2016 03:41: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 5BC471AC5; Wed, 18 May 2016 03:41:38 +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 u4I3fb3C006928; Wed, 18 May 2016 03:41:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3fbXx006924; Wed, 18 May 2016 03:41:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180341.u4I3fbXx006924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 03:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300107 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:41:38 -0000 Author: sephe Date: Wed May 18 03:41:37 2016 New Revision: 300107 URL: https://svnweb.freebsd.org/changeset/base/300107 Log: hyperv/vmbus: Avoid two unnecessary protocol checks on isr handling path MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6405 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 03:34:02 2016 (r300106) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 03:41:37 2016 (r300107) @@ -289,56 +289,20 @@ hv_vmbus_disconnect(void) { return (ret); } -/** - * Handler for events - */ -void -hv_vmbus_on_events(int cpu) +static __inline void +vmbus_event_flags_proc(unsigned long *event_flags, int flag_cnt) { - unsigned long *intr_flags; - hv_vmbus_synic_event_flags *event; - void *page_addr; - int flag_cnt, f; - - KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " - "cpu out of range!")); - - page_addr = hv_vmbus_g_context.syn_ic_event_page[cpu]; - event = (hv_vmbus_synic_event_flags *) - page_addr + HV_VMBUS_MESSAGE_SINT; - if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || - (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { - flag_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >> - HV_CHANNEL_ULONG_SHIFT; - /* - * receive size is 1/2 page and divide that by 4 bytes - */ - if (atomic_testandclear_int(&event->flags32[0], 0)) - intr_flags = hv_vmbus_g_connection.recv_interrupt_page; - else - return; - } else { - /* - * On Host with Win8 or above, the event page can be - * checked directly to get the id of the channel - * that has the pending interrupt. - */ - flag_cnt = VMBUS_PCPU_GET(event_flag_cnt, cpu); - intr_flags = event->flagsul; - } + int f; - /* - * Check events - */ - for (f = 0; f < flag_cnt; f++) { + for (f = 0; f < flag_cnt; ++f) { uint32_t rel_id_base; unsigned long flags; int bit; - if (intr_flags[f] == 0) + if (event_flags[f] == 0) continue; - flags = atomic_swap_long(&intr_flags[f], 0); + flags = atomic_swap_long(&event_flags[f], 0); rel_id_base = f << HV_CHANNEL_ULONG_SHIFT; while ((bit = ffsl(flags)) != 0) { @@ -362,6 +326,37 @@ hv_vmbus_on_events(int cpu) } } +void +vmbus_event_proc(struct vmbus_softc *sc, int cpu) +{ + hv_vmbus_synic_event_flags *event; + + event = ((hv_vmbus_synic_event_flags *) + hv_vmbus_g_context.syn_ic_event_page[cpu]) + HV_VMBUS_MESSAGE_SINT; + + /* + * On Host with Win8 or above, the event page can be checked directly + * to get the id of the channel that has the pending interrupt. + */ + vmbus_event_flags_proc(event->flagsul, + VMBUS_SC_PCPU_GET(sc, event_flag_cnt, cpu)); +} + +void +vmbus_event_proc_compat(struct vmbus_softc *sc __unused, int cpu) +{ + hv_vmbus_synic_event_flags *event; + + event = ((hv_vmbus_synic_event_flags *) + hv_vmbus_g_context.syn_ic_event_page[cpu]) + HV_VMBUS_MESSAGE_SINT; + + if (atomic_testandclear_int(&event->flags32[0], 0)) { + vmbus_event_flags_proc( + hv_vmbus_g_connection.recv_interrupt_page, + HV_MAX_NUM_CHANNELS_SUPPORTED >> HV_CHANNEL_ULONG_SHIFT); + } +} + /** * Send a msg on the vmbus's message connection */ Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:34:02 2016 (r300106) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:41:37 2016 (r300107) @@ -146,6 +146,7 @@ handled: static inline int hv_vmbus_isr(struct trapframe *frame) { + struct vmbus_softc *sc = vmbus_get_softc(); int cpu; hv_vmbus_message* msg; void* page_addr; @@ -157,8 +158,7 @@ hv_vmbus_isr(struct trapframe *frame) * before checking for messages. This is the way they do it * in Windows when running as a guest in Hyper-V */ - - hv_vmbus_on_events(cpu); + sc->vmbus_event_proc(sc, cpu); /* Check if there are actual msgs to be process */ page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; @@ -388,6 +388,7 @@ extern inthand_t IDTVEC(hv_vmbus_callbac static int vmbus_bus_init(void) { + struct vmbus_softc *sc; int i, j, n, ret; char buf[MAXCOMLEN + 1]; cpuset_t cpu_mask; @@ -396,6 +397,7 @@ vmbus_bus_init(void) return (0); vmbus_inited = 1; + sc = vmbus_get_softc(); ret = hv_vmbus_init(); @@ -481,6 +483,12 @@ vmbus_bus_init(void) if (ret != 0) goto cleanup1; + if (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008 || + hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) + sc->vmbus_event_proc = vmbus_event_proc_compat; + else + sc->vmbus_event_proc = vmbus_event_proc; + hv_vmbus_request_channel_offers(); vmbus_scan(); @@ -515,6 +523,11 @@ vmbus_bus_init(void) return (ret); } +static void +vmbus_event_proc_dummy(struct vmbus_softc *sc __unused, int cpu __unused) +{ +} + static int vmbus_attach(device_t dev) { @@ -524,6 +537,13 @@ vmbus_attach(device_t dev) vmbus_devp = dev; vmbus_sc = device_get_softc(dev); + /* + * Event processing logic will be configured: + * - After the vmbus protocol version negotiation. + * - Before we request channel offers. + */ + vmbus_sc->vmbus_event_proc = vmbus_event_proc_dummy; + #ifndef EARLY_AP_STARTUP /* * If the system has already booted and thread Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 18 03:34:02 2016 (r300106) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 18 03:41:37 2016 (r300107) @@ -753,7 +753,6 @@ int hv_vmbus_connect(void); int hv_vmbus_disconnect(void); int hv_vmbus_post_message(void *buffer, size_t buf_size); int hv_vmbus_set_event(hv_vmbus_channel *channel); -void hv_vmbus_on_events(int cpu); /** * Event Timer interfaces Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 18 03:34:02 2016 (r300106) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 18 03:41:37 2016 (r300107) @@ -36,6 +36,7 @@ struct vmbus_pcpu_data { } __aligned(CACHE_LINE_SIZE); struct vmbus_softc { + void (*vmbus_event_proc)(struct vmbus_softc *, int); struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; }; @@ -47,11 +48,15 @@ vmbus_get_softc(void) return vmbus_sc; } -#define VMBUS_PCPU_GET(field, cpu) \ - (vmbus_get_softc())->vmbus_pcpu[cpu].field -#define VMBUS_PCPU_PTR(field, cpu) \ - &(vmbus_get_softc())->vmbus_pcpu[cpu].field +#define VMBUS_SC_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field +#define VMBUS_SC_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field +#define VMBUS_PCPU_GET(field, cpu) \ + VMBUS_SC_PCPU_GET(vmbus_get_softc(), field, (cpu)) +#define VMBUS_PCPU_PTR(field, cpu) \ + VMBUS_SC_PCPU_PTR(vmbus_get_softc(), field, (cpu)) void vmbus_on_channel_open(const struct hv_vmbus_channel *); +void vmbus_event_proc(struct vmbus_softc *, int); +void vmbus_event_proc_compat(struct vmbus_softc *, int); #endif /* !_VMBUS_VAR_H_ */ From owner-svn-src-all@freebsd.org Wed May 18 03:50:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D794B3F753; Wed, 18 May 2016 03:50:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B2171ECF; Wed, 18 May 2016 03:50:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I3oLWI010005; Wed, 18 May 2016 03:50:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3oLTI010004; Wed, 18 May 2016 03:50:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605180350.u4I3oLTI010004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 May 2016 03:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300109 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:50:22 -0000 Author: markj Date: Wed May 18 03:50:21 2016 New Revision: 300109 URL: https://svnweb.freebsd.org/changeset/base/300109 Log: Micro-optimize sleepq_broadcast(). - Avoid a conditional branch on the return value of sleepq_resume_thread() by ORing its return value into the boolean wakeup_swapper. This is consistent with other sleepqueue functions which just pass this return value to their caller. - sleepq_resume_thread() unconditionally removes the thread from its queue, so there's no need to maintain a pointer to the next element in the queue. MFC after: 2 weeks Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Wed May 18 03:50:18 2016 (r300108) +++ head/sys/kern/subr_sleepqueue.c Wed May 18 03:50:21 2016 (r300109) @@ -865,7 +865,7 @@ int sleepq_broadcast(void *wchan, int flags, int pri, int queue) { struct sleepqueue *sq; - struct thread *td, *tdn; + struct thread *td; int wakeup_swapper; CTR2(KTR_PROC, "sleepq_broadcast(%p, %d)", wchan, flags); @@ -879,10 +879,9 @@ sleepq_broadcast(void *wchan, int flags, /* Resume all blocked threads on the sleep queue. */ wakeup_swapper = 0; - TAILQ_FOREACH_SAFE(td, &sq->sq_blocked[queue], td_slpq, tdn) { + while ((td = TAILQ_FIRST(&sq->sq_blocked[queue])) != NULL) { thread_lock(td); - if (sleepq_resume_thread(sq, td, pri)) - wakeup_swapper = 1; + wakeup_swapper |= sleepq_resume_thread(sq, td, pri); thread_unlock(td); } return (wakeup_swapper); From owner-svn-src-all@freebsd.org Wed May 18 03:50:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 285DBB3F74E; Wed, 18 May 2016 03:50:20 +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 F3D7A1ECE; Wed, 18 May 2016 03:50:19 +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 u4I3oJ2E009957; Wed, 18 May 2016 03:50:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3oJWs009956; Wed, 18 May 2016 03:50:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180350.u4I3oJWs009956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 03:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300108 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:50:20 -0000 Author: sephe Date: Wed May 18 03:50:18 2016 New Revision: 300108 URL: https://svnweb.freebsd.org/changeset/base/300108 Log: hyperv/vmbus: Minor white space and style cleanup MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6407 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:41:37 2016 (r300107) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:50:18 2016 (r300108) @@ -74,28 +74,20 @@ static hv_setup_args setup_args; /* only static char *vmbus_ids[] = { "VMBUS", NULL }; -/** - * @brief Software interrupt thread routine to handle channel messages from - * the hypervisor. - */ static void vmbus_msg_swintr(void *arg, int pending __unused) { - int cpu; - void* page_addr; - hv_vmbus_channel_msg_header *hdr; - hv_vmbus_channel_msg_table_entry *entry; - hv_vmbus_channel_msg_type msg_type; - hv_vmbus_message* msg; + int cpu; + hv_vmbus_message *msg; cpu = (int)(long)arg; - KASSERT(cpu <= mp_maxid, ("VMBUS: vmbus_msg_swintr: " - "cpu out of range!")); - - page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; - msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; - + msg = ((hv_vmbus_message *)hv_vmbus_g_context.syn_ic_msg_page[cpu]) + + HV_VMBUS_MESSAGE_SINT; for (;;) { + const hv_vmbus_channel_msg_table_entry *entry; + hv_vmbus_channel_msg_header *hdr; + hv_vmbus_channel_msg_type msg_type; + if (msg->header.message_type == HV_MESSAGE_TYPE_NONE) break; /* no message */ @@ -108,32 +100,29 @@ vmbus_msg_swintr(void *arg, int pending } entry = &g_channel_message_table[msg_type]; - if (entry->messageHandler) entry->messageHandler(hdr); handled: - msg->header.message_type = HV_MESSAGE_TYPE_NONE; - - /* - * Make sure the write to message_type (ie set to - * HV_MESSAGE_TYPE_NONE) happens before we read the - * message_pending and EOMing. Otherwise, the EOMing will - * not deliver any more messages - * since there is no empty slot - * - * NOTE: - * mb() is used here, since atomic_thread_fence_seq_cst() - * will become compiler fence on UP kernel. - */ - mb(); - - if (msg->header.message_flags.u.message_pending) { + msg->header.message_type = HV_MESSAGE_TYPE_NONE; + /* + * Make sure the write to message_type (ie set to + * HV_MESSAGE_TYPE_NONE) happens before we read the + * message_pending and EOMing. Otherwise, the EOMing will + * not deliver any more messages + * since there is no empty slot + * + * NOTE: + * mb() is used here, since atomic_thread_fence_seq_cst() + * will become compiler fence on UP kernel. + */ + mb(); + if (msg->header.message_flags.u.message_pending) { /* * This will cause message queue rescan to possibly * deliver another msg from the hypervisor */ wrmsr(HV_X64_MSR_EOM, 0); - } + } } } @@ -147,9 +136,9 @@ static inline int hv_vmbus_isr(struct trapframe *frame) { struct vmbus_softc *sc = vmbus_get_softc(); - int cpu; - hv_vmbus_message* msg; - void* page_addr; + int cpu; + hv_vmbus_message *msg; + void *page_addr; cpu = PCPU_GET(cpuid); @@ -162,7 +151,7 @@ hv_vmbus_isr(struct trapframe *frame) /* Check if there are actual msgs to be process */ page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; - msg = (hv_vmbus_message*) page_addr + HV_VMBUS_TIMER_SINT; + msg = ((hv_vmbus_message *)page_addr) + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { @@ -193,7 +182,7 @@ hv_vmbus_isr(struct trapframe *frame) } } - msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; + msg = ((hv_vmbus_message *)page_addr) + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[cpu], &hv_vmbus_g_context.hv_msg_task[cpu]); From owner-svn-src-all@freebsd.org Wed May 18 03:55:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FEB0B3F98E; Wed, 18 May 2016 03:55:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B05B1448; Wed, 18 May 2016 03:55:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I3tsqS012822; Wed, 18 May 2016 03:55:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3tskK012821; Wed, 18 May 2016 03:55:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605180355.u4I3tskK012821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 May 2016 03:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300110 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:55:55 -0000 Author: markj Date: Wed May 18 03:55:54 2016 New Revision: 300110 URL: https://svnweb.freebsd.org/changeset/base/300110 Log: Do not acquire the thread lock in hardclock_cnt() unless needed. This function only sets thread flags if a SIGPROF or SIGVTALRM timer has fired, which is almost never the case. MFC after: 2 weeks Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Wed May 18 03:50:21 2016 (r300109) +++ head/sys/kern/kern_clock.c Wed May 18 03:55:54 2016 (r300110) @@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode) flags |= TDF_PROFPEND | TDF_ASTPENDING; PROC_ITIMUNLOCK(p); } - thread_lock(td); - td->td_flags |= flags; - thread_unlock(td); + if (flags != 0) { + thread_lock(td); + td->td_flags |= flags; + thread_unlock(td); + } #ifdef HWPMC_HOOKS if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid))) From owner-svn-src-all@freebsd.org Wed May 18 03:58:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33299B3FA06; Wed, 18 May 2016 03:58: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 F422E1702; Wed, 18 May 2016 03:58:05 +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 u4I3w5Mi012935; Wed, 18 May 2016 03:58:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I3w5r2012934; Wed, 18 May 2016 03:58:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180358.u4I3w5r2012934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 03:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300111 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 03:58:06 -0000 Author: sephe Date: Wed May 18 03:58:04 2016 New Revision: 300111 URL: https://svnweb.freebsd.org/changeset/base/300111 Log: hyperv/vmbus: Utilize curcpu MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6408 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:55:54 2016 (r300110) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:58:04 2016 (r300111) @@ -77,11 +77,9 @@ static char *vmbus_ids[] = { "VMBUS", NU static void vmbus_msg_swintr(void *arg, int pending __unused) { - int cpu; hv_vmbus_message *msg; - cpu = (int)(long)arg; - msg = ((hv_vmbus_message *)hv_vmbus_g_context.syn_ic_msg_page[cpu]) + + msg = ((hv_vmbus_message *)hv_vmbus_g_context.syn_ic_msg_page[curcpu]) + HV_VMBUS_MESSAGE_SINT; for (;;) { const hv_vmbus_channel_msg_table_entry *entry; @@ -136,12 +134,10 @@ static inline int hv_vmbus_isr(struct trapframe *frame) { struct vmbus_softc *sc = vmbus_get_softc(); - int cpu; + int cpu = curcpu; hv_vmbus_message *msg; void *page_addr; - cpu = PCPU_GET(cpuid); - /* * The Windows team has advised that we check for events * before checking for messages. This is the way they do it @@ -447,7 +443,7 @@ vmbus_bus_init(void) taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_msg_tq[j], 1, PI_NET, &cpu_mask, "hvmsg%d", j); TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, - vmbus_msg_swintr, (void *)(long)j); + vmbus_msg_swintr, NULL); /* * Prepare the per cpu msg and event pages to be called on each cpu. From owner-svn-src-all@freebsd.org Wed May 18 04:04:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C10F8B3FEA1; Wed, 18 May 2016 04:04:15 +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 9342E1C68; Wed, 18 May 2016 04:04:15 +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 u4I44EHE015775; Wed, 18 May 2016 04:04:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I44Exf015774; Wed, 18 May 2016 04:04:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180404.u4I44Exf015774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 04:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300112 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 04:04:15 -0000 Author: sephe Date: Wed May 18 04:04:14 2016 New Revision: 300112 URL: https://svnweb.freebsd.org/changeset/base/300112 Log: hyperv/vmbus: Function renaming vmbus_msg_swintr -> vmbus_msg_task It is not an SWI handler for a long time. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6409 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 03:58:04 2016 (r300111) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 04:04:14 2016 (r300112) @@ -75,7 +75,7 @@ static hv_setup_args setup_args; /* only static char *vmbus_ids[] = { "VMBUS", NULL }; static void -vmbus_msg_swintr(void *arg, int pending __unused) +vmbus_msg_task(void *arg __unused, int pending __unused) { hv_vmbus_message *msg; @@ -443,7 +443,7 @@ vmbus_bus_init(void) taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_msg_tq[j], 1, PI_NET, &cpu_mask, "hvmsg%d", j); TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, - vmbus_msg_swintr, NULL); + vmbus_msg_task, NULL); /* * Prepare the per cpu msg and event pages to be called on each cpu. From owner-svn-src-all@freebsd.org Wed May 18 04:22:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1993BB40293; Wed, 18 May 2016 04:22:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 EE44B1442; Wed, 18 May 2016 04:22:55 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id BE7F1B93C; Wed, 18 May 2016 00:22:54 -0400 (EDT) From: John Baldwin To: Greg 'groggy' Lehey Cc: George Neville-Neil , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Date: Tue, 17 May 2016 21:22:16 -0700 Message-ID: <2483063.Wyogl0a3lX@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160517235930.GA61770@eureka.lemis.com> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <20160517235930.GA61770@eureka.lemis.com> 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.2.7 (bigwig.baldwin.cx); Wed, 18 May 2016 00:22:54 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 04:22:56 -0000 On Wednesday, May 18, 2016 09:59:30 AM Greg 'groggy' Lehey wrote: > Yes. This wasn't a new change, just reverting a change made in > r235317. You'll notice that the expression is in quotes, indicating > that it's, well, a quotation and not to be taken literally. And if > you quote, you should quote correctly. I stumbled across this by > accident doing Something Serious, and it grated. I had read the quotes to mean it was colloquial language, not necessarily a literary quotation. Had the commit message said "restore correct quotation" as similar commits to fortune have used in the past that would have helped with the context as opposed to "Correct incorrect grammar" and then using a word that doesn't exist in English. > What I have learnt from this exchange is: > > - Many Americans don't know the expression, though it's American. There is quite a bit of literature in the world American and non. > - Nobody seems to care that the rest of the page is out of date. Actually not true, but of the things to fix in the manpage, "grown" vs "growed" isn't exactly the most urgent thing to spend time on. > - People seem to have lost any remnant sense of humour. I think a more accurate commit message might have averted much of the reaction. -- John Baldwin From owner-svn-src-all@freebsd.org Wed May 18 04:36:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D8BCB4058C; Wed, 18 May 2016 04:36:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F11A1A8C; Wed, 18 May 2016 04:36:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I4ZxpA025106; Wed, 18 May 2016 04:35:59 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I4ZwYh025096; Wed, 18 May 2016 04:35:58 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605180435.u4I4ZwYh025096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 18 May 2016 04:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300113 - in head/sys: conf kern net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 04:36:00 -0000 Author: scottl Date: Wed May 18 04:35:58 2016 New Revision: 300113 URL: https://svnweb.freebsd.org/changeset/base/300113 Log: Import the 'iflib' API library for network drivers. From the author: "iflib is a library to eliminate the need for frequently duplicated device independent logic propagated (poorly) across many network drivers." Participation is purely optional. The IFLIB kernel config option is provided for drivers that want to transition between legacy and iflib modes of operation. ixl and ixgbe driver conversions will be committed shortly. We hope to see participation from the Broadcom and maybe Chelsio drivers in the near future. Submitted by: mmacy@nextbsd.org Reviewed by: gallatin Differential Revision: D5211 Added: head/sys/net/ifdi_if.m (contents, props changed) head/sys/net/iflib.c (contents, props changed) head/sys/net/iflib.h (contents, props changed) head/sys/net/mp_ring.c (contents, props changed) head/sys/net/mp_ring.h (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options head/sys/kern/device_if.m head/sys/kern/kern_mbuf.c head/sys/kern/subr_taskqueue.c head/sys/net/if.c head/sys/net/if_var.h head/sys/sys/_task.h head/sys/sys/mbuf.h head/sys/sys/taskqueue.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 18 04:04:14 2016 (r300112) +++ head/sys/conf/files Wed May 18 04:35:58 2016 (r300113) @@ -3523,6 +3523,9 @@ net/if_tun.c optional tun net/if_tap.c optional tap net/if_vlan.c optional vlan net/if_vxlan.c optional vxlan inet | vxlan inet6 +net/ifdi_if.m optional ether pci +net/iflib.c optional ether pci +net/mp_ring.c optional ether net/mppcc.c optional netgraph_mppc_compression net/mppcd.c optional netgraph_mppc_compression net/netisr.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed May 18 04:04:14 2016 (r300112) +++ head/sys/conf/options Wed May 18 04:35:58 2016 (r300113) @@ -139,6 +139,7 @@ GEOM_VINUM opt_geom.h GEOM_VIRSTOR opt_geom.h GEOM_VOL opt_geom.h GEOM_ZERO opt_geom.h +IFLIB opt_iflib.h KDTRACE_HOOKS opt_global.h KDTRACE_FRAME opt_kdtrace.h KN_HASHSIZE opt_kqueue.h Modified: head/sys/kern/device_if.m ============================================================================== --- head/sys/kern/device_if.m Wed May 18 04:04:14 2016 (r300112) +++ head/sys/kern/device_if.m Wed May 18 04:35:58 2016 (r300113) @@ -62,6 +62,11 @@ CODE { { return 0; } + + static void * null_register(device_t dev) + { + return NULL; + } }; /** @@ -316,3 +321,24 @@ METHOD int resume { METHOD int quiesce { device_t dev; } DEFAULT null_quiesce; + +/** + * @brief This is called when the driver is asked to register handlers. + * + * + * To include this method in a device driver, use a line like this + * in the driver's method list: + * + * @code + * KOBJMETHOD(device_register, foo_register) + * @endcode + * + * @param dev the device for which handlers are being registered + * + * @retval NULL method not implemented + * @retval non-NULL a pointer to implementation specific static driver state + * + */ +METHOD void * register { + device_t dev; +} DEFAULT null_register; Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed May 18 04:04:14 2016 (r300112) +++ head/sys/kern/kern_mbuf.c Wed May 18 04:35:58 2016 (r300113) @@ -444,7 +444,7 @@ mb_dtor_mbuf(void *mem, int size, void * flags = (unsigned long)arg; KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__)); - if ((m->m_flags & M_PKTHDR) && !SLIST_EMPTY(&m->m_pkthdr.tags)) + if (!(flags & MB_DTOR_SKIP) && (m->m_flags & M_PKTHDR) && !SLIST_EMPTY(&m->m_pkthdr.tags)) m_tag_delete_chain(m, NULL); #ifdef INVARIANTS trash_dtor(mem, size, arg); Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Wed May 18 04:04:14 2016 (r300112) +++ head/sys/kern/subr_taskqueue.c Wed May 18 04:35:58 2016 (r300113) @@ -34,12 +34,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -62,9 +64,11 @@ struct taskqueue { STAILQ_HEAD(, task) tq_queue; taskqueue_enqueue_fn tq_enqueue; void *tq_context; + char *tq_name; TAILQ_HEAD(, taskqueue_busy) tq_active; struct mtx tq_mutex; struct thread **tq_threads; + struct thread *tq_curthread; int tq_tcount; int tq_spin; int tq_flags; @@ -119,11 +123,17 @@ TQ_SLEEP(struct taskqueue *tq, void *p, } static struct taskqueue * -_taskqueue_create(const char *name __unused, int mflags, +_taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context, - int mtxflags, const char *mtxname) + int mtxflags, const char *mtxname __unused) { struct taskqueue *queue; + char *tq_name = NULL; + + if (name != NULL) + tq_name = strndup(name, 32, M_TASKQUEUE); + if (tq_name == NULL) + tq_name = "taskqueue"; queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO); if (!queue) @@ -133,6 +143,7 @@ _taskqueue_create(const char *name __unu TAILQ_INIT(&queue->tq_active); queue->tq_enqueue = enqueue; queue->tq_context = context; + queue->tq_name = tq_name; queue->tq_spin = (mtxflags & MTX_SPIN) != 0; queue->tq_flags |= TQ_FLAGS_ACTIVE; if (enqueue == taskqueue_fast_enqueue || @@ -140,7 +151,7 @@ _taskqueue_create(const char *name __unu enqueue == taskqueue_swi_giant_enqueue || enqueue == taskqueue_thread_enqueue) queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE; - mtx_init(&queue->tq_mutex, mtxname, NULL, mtxflags); + mtx_init(&queue->tq_mutex, tq_name, NULL, mtxflags); return queue; } @@ -149,8 +160,9 @@ struct taskqueue * taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context) { + return _taskqueue_create(name, mflags, enqueue, context, - MTX_DEF, "taskqueue"); + MTX_DEF, name); } void @@ -194,6 +206,7 @@ taskqueue_free(struct taskqueue *queue) KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); mtx_destroy(&queue->tq_mutex); free(queue->tq_threads, M_TASKQUEUE); + free(queue->tq_name, M_TASKQUEUE); free(queue, M_TASKQUEUE); } @@ -203,11 +216,12 @@ taskqueue_enqueue_locked(struct taskqueu struct task *ins; struct task *prev; + KASSERT(task->ta_func != NULL, ("enqueueing task with NULL func")); /* * Count multiple enqueues. */ if (task->ta_pending) { - if (task->ta_pending < USHRT_MAX) + if (task->ta_pending < UCHAR_MAX) task->ta_pending++; TQ_UNLOCK(queue); return (0); @@ -245,6 +259,22 @@ taskqueue_enqueue_locked(struct taskqueu } int +grouptaskqueue_enqueue(struct taskqueue *queue, struct task *task) +{ + TQ_LOCK(queue); + if (task->ta_pending) { + TQ_UNLOCK(queue); + return (0); + } + STAILQ_INSERT_TAIL(&queue->tq_queue, task, ta_link); + task->ta_pending = 1; + TQ_UNLOCK(queue); + if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0) + queue->tq_enqueue(queue->tq_context); + return (0); +} + +int taskqueue_enqueue(struct taskqueue *queue, struct task *task) { int res; @@ -410,6 +440,7 @@ taskqueue_run_locked(struct taskqueue *q struct task *task; int pending; + KASSERT(queue != NULL, ("tq is NULL")); TQ_ASSERT_LOCKED(queue); tb.tb_running = NULL; @@ -421,17 +452,20 @@ taskqueue_run_locked(struct taskqueue *q * zero its pending count. */ task = STAILQ_FIRST(&queue->tq_queue); + KASSERT(task != NULL, ("task is NULL")); STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); pending = task->ta_pending; task->ta_pending = 0; tb.tb_running = task; TQ_UNLOCK(queue); + KASSERT(task->ta_func != NULL, ("task->ta_func is NULL")); task->ta_func(task->ta_context, pending); TQ_LOCK(queue); tb.tb_running = NULL; - wakeup(task); + if ((task->ta_flags & TASK_SKIP_WAKEUP) == 0) + wakeup(task); TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); tb_first = TAILQ_FIRST(&queue->tq_active); @@ -446,7 +480,9 @@ taskqueue_run(struct taskqueue *queue) { TQ_LOCK(queue); + queue->tq_curthread = curthread; taskqueue_run_locked(queue); + queue->tq_curthread = NULL; TQ_UNLOCK(queue); } @@ -679,7 +715,9 @@ taskqueue_thread_loop(void *arg) tq = *tqp; taskqueue_run_callback(tq, TASKQUEUE_CALLBACK_TYPE_INIT); TQ_LOCK(tq); + tq->tq_curthread = curthread; while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { + /* XXX ? */ taskqueue_run_locked(tq); /* * Because taskqueue_run() can drop tq_mutex, we need to @@ -691,7 +729,7 @@ taskqueue_thread_loop(void *arg) TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); } taskqueue_run_locked(tq); - + tq->tq_curthread = NULL; /* * This thread is on its way out, so just drop the lock temporarily * in order to call the shutdown callback. This allows the callback @@ -715,8 +753,8 @@ taskqueue_thread_enqueue(void *context) tqp = context; tq = *tqp; - - wakeup_one(tq); + if (tq->tq_curthread != curthread) + wakeup_one(tq); } TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, NULL, @@ -772,3 +810,334 @@ taskqueue_member(struct taskqueue *queue } return (ret); } + +struct taskqgroup_cpu { + LIST_HEAD(, grouptask) tgc_tasks; + struct taskqueue *tgc_taskq; + int tgc_cnt; + int tgc_cpu; +}; + +struct taskqgroup { + struct taskqgroup_cpu tqg_queue[MAXCPU]; + struct mtx tqg_lock; + char * tqg_name; + int tqg_adjusting; + int tqg_stride; + int tqg_cnt; +}; + +struct taskq_bind_task { + struct task bt_task; + int bt_cpuid; +}; + +static void +taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx) +{ + struct taskqgroup_cpu *qcpu; + + qcpu = &qgroup->tqg_queue[idx]; + LIST_INIT(&qcpu->tgc_tasks); + qcpu->tgc_taskq = taskqueue_create_fast(NULL, M_WAITOK, + taskqueue_thread_enqueue, &qcpu->tgc_taskq); + taskqueue_start_threads(&qcpu->tgc_taskq, 1, PI_SOFT, + "%s_%d", qgroup->tqg_name, idx); + qcpu->tgc_cpu = idx * qgroup->tqg_stride; +} + +static void +taskqgroup_cpu_remove(struct taskqgroup *qgroup, int idx) +{ + + taskqueue_free(qgroup->tqg_queue[idx].tgc_taskq); +} + +/* + * Find the taskq with least # of tasks that doesn't currently have any + * other queues from the uniq identifier. + */ +static int +taskqgroup_find(struct taskqgroup *qgroup, void *uniq) +{ + struct grouptask *n; + int i, idx, mincnt; + int strict; + + mtx_assert(&qgroup->tqg_lock, MA_OWNED); + if (qgroup->tqg_cnt == 0) + return (0); + idx = -1; + mincnt = INT_MAX; + /* + * Two passes; First scan for a queue with the least tasks that + * does not already service this uniq id. If that fails simply find + * the queue with the least total tasks; + */ + for (strict = 1; mincnt == INT_MAX; strict = 0) { + for (i = 0; i < qgroup->tqg_cnt; i++) { + if (qgroup->tqg_queue[i].tgc_cnt > mincnt) + continue; + if (strict) { + LIST_FOREACH(n, + &qgroup->tqg_queue[i].tgc_tasks, gt_list) + if (n->gt_uniq == uniq) + break; + if (n != NULL) + continue; + } + mincnt = qgroup->tqg_queue[i].tgc_cnt; + idx = i; + } + } + if (idx == -1) + panic("taskqgroup_find: Failed to pick a qid."); + + return (idx); +} + +void +taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, + void *uniq, int irq, char *name) +{ + cpuset_t mask; + int qid; + + gtask->gt_uniq = uniq; + gtask->gt_name = name; + gtask->gt_irq = irq; + gtask->gt_cpu = -1; + mtx_lock(&qgroup->tqg_lock); + qid = taskqgroup_find(qgroup, uniq); + qgroup->tqg_queue[qid].tgc_cnt++; + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + if (irq != -1 && smp_started) { + CPU_ZERO(&mask); + CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); + mtx_unlock(&qgroup->tqg_lock); + intr_setaffinity(irq, &mask); + } else + mtx_unlock(&qgroup->tqg_lock); +} + +int +taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask, + void *uniq, int cpu, int irq, char *name) +{ + cpuset_t mask; + int i, qid; + + qid = -1; + gtask->gt_uniq = uniq; + gtask->gt_name = name; + gtask->gt_irq = irq; + gtask->gt_cpu = cpu; + mtx_lock(&qgroup->tqg_lock); + if (smp_started) { + for (i = 0; i < qgroup->tqg_cnt; i++) + if (qgroup->tqg_queue[i].tgc_cpu == cpu) { + qid = i; + break; + } + if (qid == -1) { + mtx_unlock(&qgroup->tqg_lock); + return (EINVAL); + } + } else + qid = 0; + qgroup->tqg_queue[qid].tgc_cnt++; + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + if (irq != -1 && smp_started) { + CPU_ZERO(&mask); + CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); + mtx_unlock(&qgroup->tqg_lock); + intr_setaffinity(irq, &mask); + } else + mtx_unlock(&qgroup->tqg_lock); + return (0); +} + +void +taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask) +{ + int i; + + mtx_lock(&qgroup->tqg_lock); + for (i = 0; i < qgroup->tqg_cnt; i++) + if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue) + break; + if (i == qgroup->tqg_cnt) + panic("taskqgroup_detach: task not in group\n"); + qgroup->tqg_queue[i].tgc_cnt--; + LIST_REMOVE(gtask, gt_list); + mtx_unlock(&qgroup->tqg_lock); + gtask->gt_taskqueue = NULL; +} + +static void +taskqgroup_binder(void *ctx, int pending) +{ + struct taskq_bind_task *task = (struct taskq_bind_task *)ctx; + cpuset_t mask; + int error; + + CPU_ZERO(&mask); + CPU_SET(task->bt_cpuid, &mask); + error = cpuset_setthread(curthread->td_tid, &mask); + thread_lock(curthread); + sched_bind(curthread, task->bt_cpuid); + thread_unlock(curthread); + + if (error) + printf("taskqgroup_binder: setaffinity failed: %d\n", + error); + free(task, M_DEVBUF); +} + +static void +taskqgroup_bind(struct taskqgroup *qgroup) +{ + struct taskq_bind_task *task; + int i; + + /* + * Bind taskqueue threads to specific CPUs, if they have been assigned + * one. + */ + for (i = 0; i < qgroup->tqg_cnt; i++) { + task = malloc(sizeof (*task), M_DEVBUF, M_NOWAIT); + TASK_INIT(&task->bt_task, 0, taskqgroup_binder, task); + task->bt_cpuid = qgroup->tqg_queue[i].tgc_cpu; + taskqueue_enqueue(qgroup->tqg_queue[i].tgc_taskq, + &task->bt_task); + } +} + +static int +_taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride) +{ + LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); + cpuset_t mask; + struct grouptask *gtask; + int i, old_cnt, qid; + + mtx_assert(&qgroup->tqg_lock, MA_OWNED); + + if (cnt < 1 || cnt * stride > mp_ncpus || !smp_started) { + printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: %d smp_started: %d\n", + cnt, stride, mp_ncpus, smp_started); + return (EINVAL); + } + if (qgroup->tqg_adjusting) { + printf("taskqgroup_adjust failed: adjusting\n"); + return (EBUSY); + } + qgroup->tqg_adjusting = 1; + old_cnt = qgroup->tqg_cnt; + mtx_unlock(&qgroup->tqg_lock); + /* + * Set up queue for tasks added before boot. + */ + if (old_cnt == 0) { + LIST_SWAP(>ask_head, &qgroup->tqg_queue[0].tgc_tasks, + grouptask, gt_list); + qgroup->tqg_queue[0].tgc_cnt = 0; + } + + /* + * If new taskq threads have been added. + */ + for (i = old_cnt; i < cnt; i++) + taskqgroup_cpu_create(qgroup, i); + mtx_lock(&qgroup->tqg_lock); + qgroup->tqg_cnt = cnt; + qgroup->tqg_stride = stride; + + /* + * Adjust drivers to use new taskqs. + */ + for (i = 0; i < old_cnt; i++) { + while ((gtask = LIST_FIRST(&qgroup->tqg_queue[i].tgc_tasks))) { + LIST_REMOVE(gtask, gt_list); + qgroup->tqg_queue[i].tgc_cnt--; + LIST_INSERT_HEAD(>ask_head, gtask, gt_list); + } + } + + while ((gtask = LIST_FIRST(>ask_head))) { + LIST_REMOVE(gtask, gt_list); + if (gtask->gt_cpu == -1) + qid = taskqgroup_find(qgroup, gtask->gt_uniq); + else { + for (i = 0; i < qgroup->tqg_cnt; i++) + if (qgroup->tqg_queue[i].tgc_cpu == gtask->gt_cpu) { + qid = i; + break; + } + } + qgroup->tqg_queue[qid].tgc_cnt++; + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, + gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + } + /* + * Set new CPU and IRQ affinity + */ + for (i = 0; i < cnt; i++) { + qgroup->tqg_queue[i].tgc_cpu = i * qgroup->tqg_stride; + CPU_ZERO(&mask); + CPU_SET(qgroup->tqg_queue[i].tgc_cpu, &mask); + LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) { + if (gtask->gt_irq == -1) + continue; + intr_setaffinity(gtask->gt_irq, &mask); + } + } + mtx_unlock(&qgroup->tqg_lock); + + /* + * If taskq thread count has been reduced. + */ + for (i = cnt; i < old_cnt; i++) + taskqgroup_cpu_remove(qgroup, i); + + mtx_lock(&qgroup->tqg_lock); + qgroup->tqg_adjusting = 0; + + taskqgroup_bind(qgroup); + + return (0); +} + +int +taskqgroup_adjust(struct taskqgroup *qgroup, int cpu, int stride) +{ + int error; + + mtx_lock(&qgroup->tqg_lock); + error = _taskqgroup_adjust(qgroup, cpu, stride); + mtx_unlock(&qgroup->tqg_lock); + + return (error); +} + +struct taskqgroup * +taskqgroup_create(char *name) +{ + struct taskqgroup *qgroup; + + qgroup = malloc(sizeof(*qgroup), M_TASKQUEUE, M_WAITOK | M_ZERO); + mtx_init(&qgroup->tqg_lock, "taskqgroup", NULL, MTX_DEF); + qgroup->tqg_name = name; + LIST_INIT(&qgroup->tqg_queue[0].tgc_tasks); + + return (qgroup); +} + +void +taskqgroup_destroy(struct taskqgroup *qgroup) +{ + +} Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed May 18 04:04:14 2016 (r300112) +++ head/sys/net/if.c Wed May 18 04:35:58 2016 (r300113) @@ -3900,6 +3900,19 @@ if_multiaddr_count(if_t ifp, int max) return (count); } +int +if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg) +{ + struct ifmultiaddr *ifma; + int cnt = 0; + + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) + cnt += filter(arg, ifma, cnt); + if_maddr_runlock(ifp); + return (cnt); +} + struct mbuf * if_dequeue(if_t ifp) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed May 18 04:04:14 2016 (r300112) +++ head/sys/net/if_var.h Wed May 18 04:35:58 2016 (r300113) @@ -628,6 +628,7 @@ int if_setupmultiaddr(if_t ifp, void *mt int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max); int if_multiaddr_count(if_t ifp, int max); +int if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg); int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); Added: head/sys/net/ifdi_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/ifdi_if.m Wed May 18 04:35:58 2016 (r300113) @@ -0,0 +1,334 @@ +# +# Copyright (c) 2014, Matthew Macy (kmacy@freebsd.org) +# 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. Neither the name of Matthew Macy nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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$ +# + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +INTERFACE ifdi; + +CODE { + + static void + null_void_op(if_ctx_t _ctx __unused) + { + } + + static void + null_timer_op(if_ctx_t _ctx __unused, uint16_t _qsidx __unused) + { + } + + static int + null_int_op(if_ctx_t _ctx __unused) + { + return (0); + } + + static void + null_queue_intr_enable(if_ctx_t _ctx __unused, uint16_t _qid __unused) + { + } + + static void + null_led_func(if_ctx_t _ctx __unused, int _onoff __unused) + { + } + + static void + null_vlan_register_op(if_ctx_t _ctx __unused, uint16_t vtag __unused) + { + } + + static int + null_q_setup(if_ctx_t _ctx __unused, uint32_t _qid __unused) + { + return (0); + } + + static int + null_i2c_req(if_ctx_t _sctx __unused, struct ifi2creq *_i2c __unused) + { + return (ENOTSUP); + } + + static int + null_sysctl_int_delay(if_ctx_t _sctx __unused, if_int_delay_info_t _iidi __unused) + { + return (0); + } + + static int + null_iov_init(if_ctx_t _ctx __unused, uint16_t num_vfs __unused, const nvlist_t *params __unused) + { + return (ENOTSUP); + } + + static int + null_vf_add(if_ctx_t _ctx __unused, uint16_t num_vfs __unused, const nvlist_t *params __unused) + { + return (ENOTSUP); + } + + static int + null_priv_ioctl(if_ctx_t _ctx __unused, u_long command, caddr_t *data __unused) + { + return (ENOTSUP); + } +}; + +# +# bus interfaces +# + +METHOD int attach_pre { + if_ctx_t _ctx; +}; + +METHOD int attach_post { + if_ctx_t _ctx; +}; + +METHOD int detach { + if_ctx_t _ctx; +}; + +METHOD int suspend { + if_ctx_t _ctx; +} DEFAULT null_int_op; + +METHOD int shutdown { + if_ctx_t _ctx; +} DEFAULT null_int_op; + +METHOD int resume { + if_ctx_t _ctx; +} DEFAULT null_int_op; + +# +# downcall to driver to allocate its +# own queue state and tie it to the parent +# + +METHOD int tx_queues_alloc { + if_ctx_t _ctx; + caddr_t *_vaddrs; + uint64_t *_paddrs; + int ntxqs; + int ntxqsets; +}; + +METHOD int rx_queues_alloc { + if_ctx_t _ctx; + caddr_t *_vaddrs; + uint64_t *_paddrs; + int nrxqs; + int nrxqsets; +}; + +METHOD void queues_free { + if_ctx_t _ctx; +}; + +# +# interface reset / stop +# + +METHOD void init { + if_ctx_t _ctx; +}; + +METHOD void stop { + if_ctx_t _ctx; +}; + +# +# interrupt setup and manipulation +# + +METHOD int msix_intr_assign { + if_ctx_t _sctx; + int msix; +}; + +METHOD void intr_enable { + if_ctx_t _ctx; +}; + +METHOD void intr_disable { + if_ctx_t _ctx; +}; + +METHOD void queue_intr_enable { + if_ctx_t _ctx; + uint16_t _qid; +} DEFAULT null_queue_intr_enable; + +METHOD void link_intr_enable { + if_ctx_t _ctx; +} DEFAULT null_void_op; + +# +# interface configuration +# + +METHOD void multi_set { + if_ctx_t _ctx; +}; + +METHOD int mtu_set { + if_ctx_t _ctx; + uint32_t _mtu; +}; + +METHOD void media_set{ + if_ctx_t _ctx; +} DEFAULT null_void_op; + +METHOD int promisc_set { + if_ctx_t _ctx; + int _flags; +}; + +METHOD void crcstrip_set { + if_ctx_t _ctx; + int _onoff; +}; + +# +# IOV handling +# + +METHOD void vflr_handle { + if_ctx_t _ctx; +} DEFAULT null_void_op; + +METHOD int iov_init { + if_ctx_t _ctx; + uint16_t num_vfs; + const nvlist_t * params; +} DEFAULT null_iov_init; + +METHOD void iov_uninit { + if_ctx_t _ctx; +} DEFAULT null_void_op; + +METHOD int iov_vf_add { + if_ctx_t _ctx; + uint16_t num_vfs; + const nvlist_t * params; +} DEFAULT null_vf_add; + + +# +# Device status +# + +METHOD void update_admin_status { + if_ctx_t _ctx; +}; + +METHOD void media_status { + if_ctx_t _ctx; + struct ifmediareq *_ifm; +}; + +METHOD int media_change { + if_ctx_t _ctx; +}; + +METHOD uint64_t get_counter { + if_ctx_t _ctx; + ift_counter cnt; +}; + +METHOD int priv_ioctl { + if_ctx_t _ctx; + u_long _cmd; + caddr_t _data; +} DEFAULT null_priv_ioctl; + +# +# optional methods +# + +METHOD int i2c_req { + if_ctx_t _ctx; + struct ifi2creq *_req; +} DEFAULT null_i2c_req; + +METHOD int txq_setup { + if_ctx_t _ctx; + uint32_t _txqid; +} DEFAULT null_q_setup; + +METHOD int rxq_setup { + if_ctx_t _ctx; + uint32_t _txqid; +} DEFAULT null_q_setup; + +METHOD void timer { + if_ctx_t _ctx; + uint16_t _txqid; +} DEFAULT null_timer_op; + +METHOD void watchdog_reset { + if_ctx_t _ctx; +} DEFAULT null_void_op; + +METHOD void led_func { + if_ctx_t _ctx; + int _onoff; +} DEFAULT null_led_func; + +METHOD void vlan_register { + if_ctx_t _ctx; + uint16_t _vtag; +} DEFAULT null_vlan_register_op; + +METHOD void vlan_unregister { + if_ctx_t _ctx; + uint16_t _vtag; +} DEFAULT null_vlan_register_op; + +METHOD int sysctl_int_delay { + if_ctx_t _sctx; + if_int_delay_info_t _iidi; +} DEFAULT null_sysctl_int_delay; + + Added: head/sys/net/iflib.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/iflib.c Wed May 18 04:35:58 2016 (r300113) @@ -0,0 +1,4786 @@ +/*- + * Copyright (c) 2014-2016, Matthew Macy + * 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. Neither the name of Matthew Macy nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 18 05:13:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE2FDB40C98; Wed, 18 May 2016 05:13:25 +0000 (UTC) (envelope-from grog@lemis.com) Received: from www.lemis.com (www.lemis.com [208.86.226.86]) by mx1.freebsd.org (Postfix) with ESMTP id AB8621A9F; Wed, 18 May 2016 05:13:25 +0000 (UTC) (envelope-from grog@lemis.com) Received: from eureka.lemis.com (www.lemis.com [208.86.226.86]) by www.lemis.com (Postfix) with ESMTP id 263F51B72800; Wed, 18 May 2016 05:13:24 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id D9D3D44A5FE; Wed, 18 May 2016 15:13:22 +1000 (AEST) Date: Wed, 18 May 2016 15:13:22 +1000 From: Greg 'groggy' Lehey To: John Baldwin Cc: George Neville-Neil , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Message-ID: <20160518051322.GZ4617@eureka.lemis.com> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <20160517235930.GA61770@eureka.lemis.com> <2483063.Wyogl0a3lX@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YvxfeT9y/1FRS2+9" Content-Disposition: inline In-Reply-To: <2483063.Wyogl0a3lX@ralph.baldwin.cx> Organization: The FreeBSD Project Phone: +61-3-5346-1370, +61-3-5309-0418 Mobile: 0401 265 606. Use only as instructed. WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:13:25 -0000 --YvxfeT9y/1FRS2+9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 17 May 2016 at 21:22:16 -0700, John Baldwin wrote: > On Wednesday, May 18, 2016 09:59:30 AM Greg 'groggy' Lehey wrote: >> >> - People seem to have lost any remnant sense of humour. > > I think a more accurate commit message might have averted much of > the reaction. In retrospect, yes. I hadn't really expected anybody to pay any attention. Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft mail program reports problems, please read http://lemis.com/broken-MUA --YvxfeT9y/1FRS2+9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlc7+fIACgkQIubykFB6QiNB5QCfbdokBl6AcLdiY28xse5iTjPU CVAAn2pPlWNpCKCJ8tU6sjVIQYdEs4Wq =d5HF -----END PGP SIGNATURE----- --YvxfeT9y/1FRS2+9-- From owner-svn-src-all@freebsd.org Wed May 18 05:21:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D8E3B40E72; Wed, 18 May 2016 05:21:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E92671E1E; Wed, 18 May 2016 05:21:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 86E4E1A64; Wed, 18 May 2016 05:21:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 18 May 2016 05:21:14 +0000 From: Glen Barber To: Greg 'groggy' Lehey Cc: John Baldwin , svn-src-head@freebsd.org, George Neville-Neil , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Message-ID: <20160518052114.GN3335@FreeBSD.org> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <20160517235930.GA61770@eureka.lemis.com> <2483063.Wyogl0a3lX@ralph.baldwin.cx> <20160518051322.GZ4617@eureka.lemis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7RSDZztPOIOiDgJV" Content-Disposition: inline In-Reply-To: <20160518051322.GZ4617@eureka.lemis.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:21:16 -0000 --7RSDZztPOIOiDgJV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 18, 2016 at 03:13:22PM +1000, Greg 'groggy' Lehey wrote: > On Tuesday, 17 May 2016 at 21:22:16 -0700, John Baldwin wrote: > > On Wednesday, May 18, 2016 09:59:30 AM Greg 'groggy' Lehey wrote: > >> > >> - People seem to have lost any remnant sense of humour. > > > > I think a more accurate commit message might have averted much of > > the reaction. >=20 > In retrospect, yes. I hadn't really expected anybody to pay any > attention. >=20 I think this reply is far worse to the reaction(s) from the original commit overall. You "didn't expect anyone to pay attention." Ridiculous, unnecessary, and still problematic change aside, this raises a far larger red flag for me. Glen --7RSDZztPOIOiDgJV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXO/vKAAoJEAMUWKVHj+KTgc4P/0JmazJVlpbxOLjXSZocMQGI 3Rlo0NRUA0WSZwBpbLvq9O0lV5iP4jdwO9PUVfjlgJ/8vg/WUg+5dDKjN/hXFH9+ JTK1kztvV4+rbqmx1JaTGlkjvBiztKI4rXBo+74zi2LwNia6j8PsPBnlfHfkxJO9 Zyjs+dHPsJgVzubQWzUg+aTdkXWYtAa5Ln3TLvQ1AbjLhRCDWOvDedEnkXQ7mRdW oiW9CzvyY6Bs8hlZzmHb3sHCqNRIKTKWUZO2YbSiiY/cmBJdKD95IaBXfU1WK+k0 wycjmpjpEAr9icum3N6Tst8QdUAz4DQgyLOzCBUj8G3sVsb7O79XeJBDXmclAM/A Z2pkL/bvGp6D1AsVFUQi+MDbFcsk0o1vvLtMjeyVGaCt2ZRQE+y/F8Z4IV+H0LMF Um+do5GlViAo7J6/xj9WMhiQj6UPYwgKKZTQhgaoaOqIqGzWdcemM3Qjk8XMUdb6 oyXqjauU7hev/KGt8fsOCaPR/aZY9i6bjnZsaAs+AiACyR+jnjxbY+swL6QP5jEu Nmr7NSDdw4oyqYxDUe1eGskO1g2DCgPATTcA7lmf/T7oDEHXhosUDASHbWIX1Iou 4IufxWK45/V9e2ige4XddpLoTozdZvaaZx5nJbZG6ktknNYJp/qMESbW+GVBfskS F6O2Q8ldHaT7LFLSrdxf =7jXc -----END PGP SIGNATURE----- --7RSDZztPOIOiDgJV-- From owner-svn-src-all@freebsd.org Wed May 18 05:22:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD369B40FB3; Wed, 18 May 2016 05:22:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (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 85CCB1121; Wed, 18 May 2016 05:22:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id gj5so13874291pac.2; Tue, 17 May 2016 22:22:20 -0700 (PDT) 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=oi8bApsql9zbv9lc8vFyc5ogAUnj/hirAaHAP34782A=; b=aJzEiuaBlnxNJ3HKPHR1pCGeUvF8dxewCwFB9buQeevi3vne5I+8g9dMrF3EN2QeG3 +CYeULxSg4X2d1ymeJxT1QvG6RwgfN8Z/t+WIsDeSG1OJ9K5lpLah0n4suXHzhaLpeLI PShmcpfyYrmmcVlcpmnBNsDQi/ob9TzqTzvoVjj4CEsz4sdeaiw12tNd9KfCxW8a966f p16GpGjAJBGLA5HQULlQFasDyD04UWiQwZ6VtMv2gvNQn5QwInEkiYKLYhi16LwpV6Y1 4EP7m3vGSUq0ywLzSqZhVAgji/YhArs7FA1N1EKNLt7hrMXEEwfd9IzgYYVjUXBPcFIG epQQ== 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=oi8bApsql9zbv9lc8vFyc5ogAUnj/hirAaHAP34782A=; b=T+zSHf/R2Mkh1x6hGQ7q97XPGbri5c+/h0a//z7EKpe4wOZZ3KMJHgj4Egv/WCG8I9 ILK60tzX3vcNt+GvcVHMK3KAYc6DIhcV/qdqe+xC7SU6klDsj+rTt2jBKAQ8YMATF52H 6FEVIm51MqDg3vXG47aRQYxXvarnxieNPrtz9ypf1HIGeSy0xvpVvTvvxoszUi7GDZBo iyGmUIesVwoUhpAIewHrguXjbFRnRaWGLfYOUPHqxp/RdS6ymT5fQqlgrjiKP2Q0MAp9 5QQHb4ACV0sfWnRCegJLz3D5NbMqONIjFgOrXNIvsNvpV5ueqyB3oj+wh7tbW2nY+VAm EEjg== X-Gm-Message-State: AOPr4FXZ8mmc+LmyihsWQUxOGJCtCmLICirAz4uwTfppiDT1kPzlGN0rugKYpK1pUV0nkQ== X-Received: by 10.66.177.16 with SMTP id cm16mr7896290pac.23.1463548939991; Tue, 17 May 2016 22:22:19 -0700 (PDT) Received: from [21.177.199.178] ([172.56.42.6]) by smtp.gmail.com with ESMTPSA id z63sm8616269pfb.47.2016.05.17.22.22.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2016 22:22:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r300110 - head/sys/kern From: NGie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: <201605180355.u4I3tskK012821@repo.freebsd.org> Date: Tue, 17 May 2016 22:22:18 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7D442C5C-E059-40A5-887C-55840BE94425@gmail.com> References: <201605180355.u4I3tskK012821@repo.freebsd.org> To: Mark Johnston X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:22:20 -0000 > On May 17, 2016, at 20:55, Mark Johnston wrote: >=20 > Author: markj > Date: Wed May 18 03:55:54 2016 > New Revision: 300110 > URL: https://svnweb.freebsd.org/changeset/base/300110 >=20 > Log: > Do not acquire the thread lock in hardclock_cnt() unless needed. >=20 > This function only sets thread flags if a SIGPROF or SIGVTALRM timer > has fired, which is almost never the case. >=20 > MFC after: 2 weeks >=20 > Modified: > head/sys/kern/kern_clock.c >=20 > Modified: head/sys/kern/kern_clock.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/sys/kern/kern_clock.c Wed May 18 03:50:21 2016 (r300109) > +++ head/sys/kern/kern_clock.c Wed May 18 03:55:54 2016 (r300110) > @@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode) > flags |=3D TDF_PROFPEND | TDF_ASTPENDING; > PROC_ITIMUNLOCK(p); > } > - thread_lock(td); > - td->td_flags |=3D flags; > - thread_unlock(td); > + if (flags !=3D 0) { > + thread_lock(td); > + td->td_flags |=3D flags; > + thread_unlock(td); > + } Use predict_false? >=20 > #ifdef HWPMC_HOOKS > if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid))) >=20 From owner-svn-src-all@freebsd.org Wed May 18 05:35:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB09CB40201; Wed, 18 May 2016 05:35:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3EF1834; Wed, 18 May 2016 05:35:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 26BE21EC7; Wed, 18 May 2016 05:35:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 18 May 2016 05:35:49 +0000 From: Glen Barber To: Greg 'groggy' Lehey Cc: George Neville-Neil , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300003 - head/share/man/man4 Message-ID: <20160518053549.GO3335@FreeBSD.org> References: <201605170440.u4H4e1Fe082375@repo.freebsd.org> <1514281.0ZCu4236n8@ralph.baldwin.cx> <20160517071619.GX4617@eureka.lemis.com> <20160517235930.GA61770@eureka.lemis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sTMGS+9l7rws3PCr" Content-Disposition: inline In-Reply-To: <20160517235930.GA61770@eureka.lemis.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:35:50 -0000 --sTMGS+9l7rws3PCr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 18, 2016 at 09:59:30AM +1000, Greg 'groggy' Lehey wrote: > I wouldn't have expected such an underhand accusation from you. I can > be honest, but if you had taken the time to check, you would have seen > that I was already eligible. And clearly if I had wanted to become > eligible, my commit would have been designed not to draw so much > attention. >=20 Then let's resort to facts. gjb@nucleus:~/freebsd/src/base % svn log --search grog \ -rHEAD:'{2013-05-01}' | grep -E '^r[0-9]{5}' r300003 | grog | 2016-05-16 22:40:00 -0600 (Mon, 16 May 2016) | 2 lines r276434 | peterj | 2014-12-30 17:08:37 -0700 (Tue, 30 Dec 2014) | 14 lines r276433 | peterj | 2014-12-30 16:52:48 -0700 (Tue, 30 Dec 2014) | 11 lines r276328 | peterj | 2014-12-28 00:16:48 -0700 (Sun, 28 Dec 2014) | 13 lines r276327 | peterj | 2014-12-28 00:14:38 -0700 (Sun, 28 Dec 2014) | 13 lines r275298 | peterj | 2014-11-29 21:50:13 -0700 (Sat, 29 Nov 2014) | 7 lines r264098 | grog | 2014-04-03 19:48:25 -0600 (Thu, 03 Apr 2014) | 2 lines r264093 | grog | 2014-04-03 17:22:04 -0600 (Thu, 03 Apr 2014) | 4 lines r264066 | grog | 2014-04-02 23:49:28 -0600 (Wed, 02 Apr 2014) | 4 lines r264064 | grog | 2014-04-02 23:48:28 -0600 (Wed, 02 Apr 2014) | 21 lines r251678 | grog | 2013-06-12 22:11:21 -0600 (Wed, 12 Jun 2013) | 4 lines r251648 | grog | 2013-06-12 01:53:59 -0600 (Wed, 12 Jun 2013) | 4 lines r251647 | grog | 2013-06-12 01:52:49 -0600 (Wed, 12 Jun 2013) | 11 lines r250905 | grog | 2013-05-22 01:52:41 -0600 (Wed, 22 May 2013) | 12 lines r250799 | grog | 2013-05-18 19:58:00 -0600 (Sat, 18 May 2013) | 4 lines r250733 | grog | 2013-05-16 21:55:03 -0600 (Thu, 16 May 2013) | 2 lines r250732 | grog | 2013-05-16 21:52:20 -0600 (Thu, 16 May 2013) | 2 lines Glen --sTMGS+9l7rws3PCr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXO/81AAoJEAMUWKVHj+KTveYP/13AZsr+2n6+6XRoY3BH+KYR SDkNktrFBjL5fMiXOQ2DbwhC4c/BgECNYdXoBjVvAthHD4EAK5cMTlut9sBK8tHh 9OhxJFGzJlxWt8anqVQbzP0FAVc0mS1hlYvNdnBXsRZMLmEoTZN2Wk1o6jsykPah +ulYGot/Zi40DergDr7z2/hc3VhgZT1XW0E8Xuzd973fEGVGPLN2LkqCNWLgCipI Qj54+3PqF92kSmlbzIWPky1RYBH0S2csFR5J575X43wotqX+mKi7u1PzZ7D+eqF9 JMfUs2QHno6YUW+0t/LjQvRNT41Rks3/GOOL7SotWjHrn4zHKZ5z6eWHNK1vHj8+ ZfWB/O/geYR5trveMjbtaUJ8nkjCuMY9LD1qcNt4BChpqM2gDJXWXafrFmFwelHe 111mnRGL78Hn12fVXBZbyqZuw1+s0gtLGLXyvZMPWYle9Sn2lJFJ28/R+uOK0oSt ngDzqV5GWiRJdJH7bmi18CQovGjQ1ocTk6+jNsQaEuJS0vLsmQdI2ZwaVlhsh0CJ /vuBaA/zMp9cJsTgKM9lMv9MxNXzoY4sIQ1BByxE0GssIZdlHZiGE0iuAPyOwFAh 4MzQ8LB8ze/kWhSHHsVwTAzMA/ApQ7VPfgNykGdKs07O56XwBsOXUydv6nA47a7U f1XzYZ0e0jf8JOoFsDDq =FSoR -----END PGP SIGNATURE----- --sTMGS+9l7rws3PCr-- From owner-svn-src-all@freebsd.org Wed May 18 05:56:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C472BB40551; Wed, 18 May 2016 05:56:26 +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 9FAA11F52; Wed, 18 May 2016 05:56:26 +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 u4I5uPCc049176; Wed, 18 May 2016 05:56:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I5uPu0049174; Wed, 18 May 2016 05:56:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605180556.u4I5uPu0049174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 18 May 2016 05:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300114 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:56:26 -0000 Author: adrian Date: Wed May 18 05:56:25 2016 New Revision: 300114 URL: https://svnweb.freebsd.org/changeset/base/300114 Log: [bwn] add initial 5xx firmware API support * Add the new TX/RX frame formats; * Use the right TX/RX format based on the frame info; * Disable the 5xx firmware check, since now it should somewhat work (but note, we don't yet use it unless you manually add ucode11/initvals11 from the 5.x driver to bwn-kmod-firmware; * Misc: update some comments/debugging now I know what's actually going on. Tested: * BCM4321MC, STA mode, both 4xx and 666 firmware, DMA mode TODO: * The newer firmware ends up logging "warn: firmware state (0)"; not sure yet what's going on there. But, yes, it still works. I'm committing this via a BCM4321MC, 11a station, firmware rev 666. Obtained from: Linux b43 (TX/RX descriptor format for 5xx) Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnvar.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Wed May 18 04:35:58 2016 (r300113) +++ head/sys/dev/bwn/if_bwn.c Wed May 18 05:56:25 2016 (r300114) @@ -1216,14 +1216,12 @@ bwn_attach_core(struct bwn_mac *mac) } /* - * XXX turns off PHY A because it's not supported. - * Implement PHY-A support so we can use it for PHY-G - * dual-band support. + * XXX The PHY-G support doesn't do 5GHz operation. */ if (mac->mac_phy.type != BWN_PHYTYPE_LP && mac->mac_phy.type != BWN_PHYTYPE_N) { device_printf(sc->sc_dev, - "%s: forcing 2GHz only; missing PHY-A support\n", + "%s: forcing 2GHz only; no dual-band support for PHY\n", __func__); have_a = 0; have_bg = 1; @@ -3791,6 +3789,8 @@ bwn_psctl(struct bwn_mac *mac, uint32_t DELAY(10); } } + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: ucstat=%d\n", __func__, + ucstat); } static int @@ -4186,12 +4186,14 @@ bwn_fw_loaducode(struct bwn_mac *mac) * So, complain this is the case and exit out, rather * than attaching and then failing. */ +#if 0 if (mac->mac_fw.fw_hdr_format == BWN_FW_HDR_598) { device_printf(sc->sc_dev, "firmware is too new (>=598); not supported\n"); error = EOPNOTSUPP; goto error; } +#endif mac->mac_fw.patch = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_UCODE_PATCH); @@ -5351,7 +5353,17 @@ bwn_dma_rxeof(struct bwn_dma_ring *dr, i len, dr->dr_rx_bufsize, cnt); return; } - macstat = le32toh(rxhdr->mac_status); + + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + case BWN_FW_HDR_410: + macstat = le32toh(rxhdr->ps4.r351.mac_status); + break; + case BWN_FW_HDR_598: + macstat = le32toh(rxhdr->ps4.r598.mac_status); + break; + } + if (macstat & BWN_RX_MAC_FCSERR) { if (!(mac->mac_sc->sc_filters & BWN_MACCTL_PASS_BADFCS)) { device_printf(sc->sc_dev, "RX drop\n"); @@ -5452,7 +5464,16 @@ ready: goto error; } - macstat = le32toh(rxhdr.mac_status); + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + case BWN_FW_HDR_410: + macstat = le32toh(rxhdr.ps4.r351.mac_status); + break; + case BWN_FW_HDR_598: + macstat = le32toh(rxhdr.ps4.r598.mac_status); + break; + } + if (macstat & BWN_RX_MAC_FCSERR) { if (!(mac->mac_sc->sc_filters & BWN_MACCTL_PASS_BADFCS)) { device_printf(sc->sc_dev, "%s: FCS error", __func__); @@ -5706,11 +5727,25 @@ bwn_rxeof(struct bwn_mac *mac, struct mb BWN_ASSERT_LOCKED(sc); phystat0 = le16toh(rxhdr->phy_status0); - phystat3 = le16toh(rxhdr->phy_status3); - /* XXX Note: mactime, macstat, chanstat need fixing for fw 598 */ - macstat = le32toh(rxhdr->mac_status); - chanstat = le16toh(rxhdr->channel); + /* + * XXX Note: phy_status3 doesn't exist for HT-PHY; it's only + * used for LP-PHY. + */ + phystat3 = le16toh(rxhdr->ps3.lp.phy_status3); + + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + case BWN_FW_HDR_410: + macstat = le32toh(rxhdr->ps4.r351.mac_status); + chanstat = le16toh(rxhdr->ps4.r351.channel); + break; + case BWN_FW_HDR_598: + macstat = le32toh(rxhdr->ps4.r598.mac_status); + chanstat = le16toh(rxhdr->ps4.r598.channel); + break; + } + phytype = chanstat & BWN_RX_CHAN_PHYTYPE; @@ -6181,10 +6216,22 @@ bwn_set_txhdr(struct bwn_mac *mac, struc m->m_pkthdr.len, rate, isshort); /* XXX TX encryption */ - bwn_plcp_genhdr(BWN_ISOLDFMT(mac) ? - (struct bwn_plcp4 *)(&txhdr->body.old.plcp) : - (struct bwn_plcp4 *)(&txhdr->body.new.plcp), - m->m_pkthdr.len + IEEE80211_CRC_LEN, rate); + + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + bwn_plcp_genhdr((struct bwn_plcp4 *)(&txhdr->body.r351.plcp), + m->m_pkthdr.len + IEEE80211_CRC_LEN, rate); + break; + case BWN_FW_HDR_410: + bwn_plcp_genhdr((struct bwn_plcp4 *)(&txhdr->body.r410.plcp), + m->m_pkthdr.len + IEEE80211_CRC_LEN, rate); + break; + case BWN_FW_HDR_598: + bwn_plcp_genhdr((struct bwn_plcp4 *)(&txhdr->body.r598.plcp), + m->m_pkthdr.len + IEEE80211_CRC_LEN, rate); + break; + } + bwn_plcp_genhdr((struct bwn_plcp4 *)(&txhdr->plcp_fb), m->m_pkthdr.len + IEEE80211_CRC_LEN, rate_fb); @@ -6243,9 +6290,22 @@ bwn_set_txhdr(struct bwn_mac *mac, struc + ieee80211_ack_duration(ic->ic_rt, rate, isshort); if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) { - cts = (struct ieee80211_frame_cts *)(BWN_ISOLDFMT(mac) ? - (txhdr->body.old.rts_frame) : - (txhdr->body.new.rts_frame)); + + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + cts = (struct ieee80211_frame_cts *) + txhdr->body.r351.rts_frame; + break; + case BWN_FW_HDR_410: + cts = (struct ieee80211_frame_cts *) + txhdr->body.r410.rts_frame; + break; + case BWN_FW_HDR_598: + cts = (struct ieee80211_frame_cts *) + txhdr->body.r598.rts_frame; + break; + } + mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, protdur); KASSERT(mprot != NULL, ("failed to alloc mbuf\n")); @@ -6255,9 +6315,21 @@ bwn_set_txhdr(struct bwn_mac *mac, struc macctl |= BWN_TX_MAC_SEND_CTSTOSELF; len = sizeof(struct ieee80211_frame_cts); } else { - rts = (struct ieee80211_frame_rts *)(BWN_ISOLDFMT(mac) ? - (txhdr->body.old.rts_frame) : - (txhdr->body.new.rts_frame)); + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + rts = (struct ieee80211_frame_rts *) + txhdr->body.r351.rts_frame; + break; + case BWN_FW_HDR_410: + rts = (struct ieee80211_frame_rts *) + txhdr->body.r410.rts_frame; + break; + case BWN_FW_HDR_598: + rts = (struct ieee80211_frame_rts *) + txhdr->body.r598.rts_frame; + break; + } + /* XXX rate/rate_fb is the hardware rate */ protdur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); @@ -6271,15 +6343,40 @@ bwn_set_txhdr(struct bwn_mac *mac, struc len = sizeof(struct ieee80211_frame_rts); } len += IEEE80211_CRC_LEN; - bwn_plcp_genhdr((struct bwn_plcp4 *)((BWN_ISOLDFMT(mac)) ? - &txhdr->body.old.rts_plcp : - &txhdr->body.new.rts_plcp), len, rts_rate); + + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + bwn_plcp_genhdr((struct bwn_plcp4 *) + &txhdr->body.r351.rts_plcp, len, rts_rate); + break; + case BWN_FW_HDR_410: + bwn_plcp_genhdr((struct bwn_plcp4 *) + &txhdr->body.r410.rts_plcp, len, rts_rate); + break; + case BWN_FW_HDR_598: + bwn_plcp_genhdr((struct bwn_plcp4 *) + &txhdr->body.r598.rts_plcp, len, rts_rate); + break; + } + bwn_plcp_genhdr((struct bwn_plcp4 *)&txhdr->rts_plcp_fb, len, rts_rate_fb); - protwh = (struct ieee80211_frame *)(BWN_ISOLDFMT(mac) ? - (&txhdr->body.old.rts_frame) : - (&txhdr->body.new.rts_frame)); + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + protwh = (struct ieee80211_frame *) + &txhdr->body.r351.rts_frame; + break; + case BWN_FW_HDR_410: + protwh = (struct ieee80211_frame *) + &txhdr->body.r410.rts_frame; + break; + case BWN_FW_HDR_598: + protwh = (struct ieee80211_frame *) + &txhdr->body.r598.rts_frame; + break; + } + txhdr->rts_dur_fb = *(u_int16_t *)protwh->i_dur; if (BWN_ISOFDMRATE(rts_rate)) { @@ -6303,10 +6400,17 @@ bwn_set_txhdr(struct bwn_mac *mac, struc txhdr->phyctl_1fb = htole16(bwn_set_txhdr_phyctl1(mac, rate_fb)); } - if (BWN_ISOLDFMT(mac)) - txhdr->body.old.cookie = htole16(cookie); - else - txhdr->body.new.cookie = htole16(cookie); + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + txhdr->body.r351.cookie = htole16(cookie); + break; + case BWN_FW_HDR_410: + txhdr->body.r410.cookie = htole16(cookie); + break; + case BWN_FW_HDR_598: + txhdr->body.r598.cookie = htole16(cookie); + break; + } txhdr->macctl = htole32(macctl); txhdr->phyctl = htole16(phyctl); @@ -6739,6 +6843,7 @@ bwn_rx_radiotap(struct bwn_mac *mac, str const struct ieee80211_frame_min *wh; uint64_t tsf; uint16_t low_mactime_now; + uint16_t mt; if (htole16(rxhdr->phy_status0) & BWN_RX_PHYST0_SHORTPRMBL) sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; @@ -6750,8 +6855,19 @@ bwn_rx_radiotap(struct bwn_mac *mac, str bwn_tsf_read(mac, &tsf); low_mactime_now = tsf; tsf = tsf & ~0xffffULL; - tsf += le16toh(rxhdr->mac_time); - if (low_mactime_now < le16toh(rxhdr->mac_time)) + + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + case BWN_FW_HDR_410: + mt = le16toh(rxhdr->ps4.r351.mac_time); + break; + case BWN_FW_HDR_598: + mt = le16toh(rxhdr->ps4.r598.mac_time); + break; + } + + tsf += mt; + if (low_mactime_now < mt) tsf -= 0x10000; sc->sc_rx_th.wr_tsf = tsf; Modified: head/sys/dev/bwn/if_bwnvar.h ============================================================================== --- head/sys/dev/bwn/if_bwnvar.h Wed May 18 04:35:58 2016 (r300113) +++ head/sys/dev/bwn/if_bwnvar.h Wed May 18 05:56:25 2016 (r300114) @@ -271,10 +271,29 @@ struct bwn_rxhdr4 { } __packed ht; uint16_t phy_status2; } __packed ps2; - uint16_t phy_status3; - uint32_t mac_status; - uint16_t mac_time; - uint16_t channel; + union { + struct { + uint16_t phy_status3; + } __packed lp; + struct { + int8_t phy_ht_power1; + int8_t phy_ht_power2; + } __packed ht; + } __packed ps3; + union { + struct { + uint32_t mac_status; + uint16_t mac_time; + uint16_t channel; + } __packed r351; + struct { + uint16_t phy_status4; + uint16_t phy_status5; + uint32_t mac_status; + uint16_t mac_time; + uint16_t channel; + } __packed r598; + } __packed ps4; } __packed; struct bwn_txstatus { @@ -765,19 +784,34 @@ struct bwn_txhdr { uint8_t rts_frame[16]; uint8_t pad1[2]; struct bwn_plcp6 plcp; - } __packed old; - /* format > r410 */ + } __packed r351; + /* format > r410 < r598 */ + struct { + uint16_t mimo_antenna; + uint16_t preload_size; + uint8_t pad0[2]; + uint16_t cookie; + uint16_t tx_status; + struct bwn_plcp6 rts_plcp; + uint8_t rts_frame[16]; + uint8_t pad1[2]; + struct bwn_plcp6 plcp; + } __packed r410; struct { uint16_t mimo_antenna; uint16_t preload_size; uint8_t pad0[2]; uint16_t cookie; uint16_t tx_status; + uint16_t max_n_mpdus; + uint16_t max_a_bytes_mrt; + uint16_t max_a_bytes_fbr; + uint16_t min_m_bytes; struct bwn_plcp6 rts_plcp; uint8_t rts_frame[16]; uint8_t pad1[2]; struct bwn_plcp6 plcp; - } __packed new; + } __packed r598; } __packed body; } __packed; From owner-svn-src-all@freebsd.org Wed May 18 05:58:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16C6EB4060A; Wed, 18 May 2016 05:58:59 +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 DCA911100; Wed, 18 May 2016 05:58:58 +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 u4I5ww79049296; Wed, 18 May 2016 05:58:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I5wwPD049295; Wed, 18 May 2016 05:58:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605180558.u4I5wwPD049295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 05:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300115 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:58:59 -0000 Author: imp Date: Wed May 18 05:58:57 2016 New Revision: 300115 URL: https://svnweb.freebsd.org/changeset/base/300115 Log: Explain why extra sutff always outputs even when it shouldn't for the '?' command. Wasted a bunch of time tracking it down tonight. Modified: head/sys/boot/forth/loader.4th Modified: head/sys/boot/forth/loader.4th ============================================================================== --- head/sys/boot/forth/loader.4th Wed May 18 05:56:25 2016 (r300114) +++ head/sys/boot/forth/loader.4th Wed May 18 05:58:57 2016 (r300115) @@ -230,6 +230,13 @@ only forth definitions also support-func : .? 2 spaces 2swap 15 #type 2 spaces type cr ; +\ Execute the ? command to print all the commands defined in +\ C, then list the ones we support here. Please note that this +\ doesn't use pager_* routines that the C implementation of ? +\ does, so these will always appear, even if you stop early +\ there. And they may cause the commands to scroll off the +\ screen if the number of commands modulus LINES is close +\ to LINEs.... : ? ['] ? execute s" boot-conf" s" load kernel and modules, then autoboot" .? From owner-svn-src-all@freebsd.org Wed May 18 05:59:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 134FDB40610; Wed, 18 May 2016 05:59:00 +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 D996F1101; Wed, 18 May 2016 05:58:59 +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 u4I5wxYn049340; Wed, 18 May 2016 05:58:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I5wxSG049339; Wed, 18 May 2016 05:58:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605180558.u4I5wxSG049339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 05:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300116 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:59:00 -0000 Author: imp Date: Wed May 18 05:58:58 2016 New Revision: 300116 URL: https://svnweb.freebsd.org/changeset/base/300116 Log: Fix build breakage on arm64 by papering over the problem. We implement a slightly non-standard %S that's more useful in the UEFI environment, so ignore printf errors. There's no good cast to use. We'll need to revisit this in the future. Modified: head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed May 18 05:58:57 2016 (r300115) +++ head/sys/boot/efi/loader/Makefile Wed May 18 05:58:58 2016 (r300116) @@ -31,6 +31,13 @@ CWARNFLAGS.zfs.c+= -Wno-array-bounds CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif +# We implement a slightly non-stadard %S in that it always takes a +# CHAR16 that's common in UEFI-land instaed of a wchar_t. This only +# seems to matter on arm64 where wchar_t defaults to a int instead of +# a short. There's no good cast to use here, so just ignore the +# warnings for now. +CWARNFLAGS.main.c+= -Wno-format + .PATH: ${.CURDIR}/arch/${MACHINE} # For smbios.c .PATH: ${.CURDIR}/../../i386/libi386 From owner-svn-src-all@freebsd.org Wed May 18 05:59:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72E08B40656; Wed, 18 May 2016 05:59:08 +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 359BF1330; Wed, 18 May 2016 05:59:08 +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 u4I5x7jM049407; Wed, 18 May 2016 05:59:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I5x5Qc049388; Wed, 18 May 2016 05:59:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605180559.u4I5x5Qc049388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 05:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300117 - in head/sys/boot: common efi/libefi efi/loader fdt i386/libi386 pc98/libpc98 uboot/lib zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 05:59:08 -0000 Author: imp Date: Wed May 18 05:59:05 2016 New Revision: 300117 URL: https://svnweb.freebsd.org/changeset/base/300117 Log: Fix several instances where the boot loader ignored pager_output return value when it could return 1 (indicating we should stop). Fix a few instances of pager_open() / pager_close() not being called. Actually use these routines for the environment variable printing code I just committed. Modified: head/sys/boot/common/disk.c head/sys/boot/common/disk.h head/sys/boot/common/module.c head/sys/boot/common/part.c head/sys/boot/common/part.h head/sys/boot/common/pnp.c head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/bootinfo.c head/sys/boot/efi/loader/main.c head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/i386/libi386/bioscd.c head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/pc98/libpc98/bioscd.c head/sys/boot/pc98/libpc98/biosdisk.c head/sys/boot/uboot/lib/disk.c head/sys/boot/zfs/zfs.c Modified: head/sys/boot/common/disk.c ============================================================================== --- head/sys/boot/common/disk.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/common/disk.c Wed May 18 05:59:05 2016 (r300117) @@ -183,13 +183,14 @@ ptblread(void *d, void *buf, size_t bloc } #define PWIDTH 35 -static void +static int ptable_print(void *arg, const char *pname, const struct ptable_entry *part) { struct print_args *pa, bsd; struct open_disk *od; struct ptable *table; char line[80]; + int res; pa = (struct print_args *)arg; od = (struct open_disk *)pa->dev->d_opendata; @@ -200,25 +201,29 @@ ptable_print(void *arg, const char *pnam display_size(part->end - part->start + 1, od->sectorsize)); strcat(line, "\n"); - pager_output(line); + if (pager_output(line)) + return 1; + res = 0; if (part->type == PART_FREEBSD) { /* Open slice with BSD label */ pa->dev->d_offset = part->start; table = ptable_open(pa->dev, part->end - part->start + 1, od->sectorsize, ptblread); if (table == NULL) - return; + return 0; sprintf(line, " %s%s", pa->prefix, pname); bsd.dev = pa->dev; bsd.prefix = line; bsd.verbose = pa->verbose; - ptable_iterate(table, &bsd, ptable_print); + res = ptable_iterate(table, &bsd, ptable_print); ptable_close(table); } + + return (res); } #undef PWIDTH -void +int disk_print(struct disk_devdesc *dev, char *prefix, int verbose) { struct open_disk *od; @@ -229,7 +234,7 @@ disk_print(struct disk_devdesc *dev, cha pa.dev = dev; pa.prefix = prefix; pa.verbose = verbose; - ptable_iterate(od->table, &pa, ptable_print); + return (ptable_iterate(od->table, &pa, ptable_print)); } int Modified: head/sys/boot/common/disk.h ============================================================================== --- head/sys/boot/common/disk.h Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/common/disk.h Wed May 18 05:59:05 2016 (r300117) @@ -112,7 +112,7 @@ extern int ptblread(void *d, void *buf, /* * Print information about slices on a disk. */ -extern void disk_print(struct disk_devdesc *dev, char *prefix, int verbose); +extern int disk_print(struct disk_devdesc *dev, char *prefix, int verbose); extern char* disk_fmtdev(struct disk_devdesc *dev); extern int disk_parsedev(struct disk_devdesc *dev, const char *devspec, const char **path); Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/common/module.c Wed May 18 05:59:05 2016 (r300117) @@ -277,7 +277,8 @@ command_lsmod(int argc, char *argv[]) if (fp->f_args != NULL) { pager_output(" args: "); pager_output(fp->f_args); - pager_output("\n"); + if (pager_output("\n")) + break; } if (fp->f_modules) { pager_output(" modules: "); @@ -285,13 +286,15 @@ command_lsmod(int argc, char *argv[]) sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); pager_output(lbuf); } - pager_output("\n"); - } + if (pager_output("\n")) + break; + } if (verbose) { /* XXX could add some formatting smarts here to display some better */ for (md = fp->f_metadata; md != NULL; md = md->md_next) { sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, (long) md->md_size); - pager_output(lbuf); + if (pager_output(lbuf)) + break; } } } Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/common/part.c Wed May 18 05:59:05 2016 (r300117) @@ -829,7 +829,7 @@ ptable_getbestpart(const struct ptable * return (ENOENT); } -void +int ptable_iterate(const struct ptable *table, void *arg, ptable_iterate_t *iter) { struct pentry *entry; @@ -856,7 +856,9 @@ ptable_iterate(const struct ptable *tabl if (table->type == PTABLE_BSD) sprintf(name, "%c", (u_char) 'a' + entry->part.index); - iter(arg, name, &entry->part); + if (iter(arg, name, &entry->part)) + return 1; } + return 0; } Modified: head/sys/boot/common/part.h ============================================================================== --- head/sys/boot/common/part.h Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/common/part.h Wed May 18 05:59:05 2016 (r300117) @@ -63,7 +63,7 @@ struct ptable_entry { /* The offset and size are in sectors */ typedef int (diskread_t)(void *arg, void *buf, size_t blocks, off_t offset); -typedef void (ptable_iterate_t)(void *arg, const char *partname, +typedef int (ptable_iterate_t)(void *arg, const char *partname, const struct ptable_entry *part); struct ptable *ptable_open(void *dev, off_t sectors, uint16_t sectorsize, @@ -75,7 +75,7 @@ int ptable_getpart(const struct ptable * int index); int ptable_getbestpart(const struct ptable *table, struct ptable_entry *part); -void ptable_iterate(const struct ptable *table, void *arg, +int ptable_iterate(const struct ptable *table, void *arg, ptable_iterate_t *iter); const char *parttype2str(enum partition_type type); Modified: head/sys/boot/common/pnp.c ============================================================================== --- head/sys/boot/common/pnp.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/common/pnp.c Wed May 18 05:59:05 2016 (r300117) @@ -68,15 +68,18 @@ pnp_scan(int argc, char *argv[]) } if (verbose) { pager_open(); - pager_output("PNP scan summary:\n"); + if (pager_output("PNP scan summary:\n")) + goto out; STAILQ_FOREACH(pi, &pnp_devices, pi_link) { pager_output(STAILQ_FIRST(&pi->pi_ident)->id_ident); /* first ident should be canonical */ if (pi->pi_desc != NULL) { pager_output(" : "); pager_output(pi->pi_desc); } - pager_output("\n"); + if (pager_output("\n")) + break; } +out: pager_close(); } return(CMD_OK); Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/efi/libefi/efinet.c Wed May 18 05:59:05 2016 (r300117) @@ -329,9 +329,12 @@ efinet_dev_print(int verbose) EFI_HANDLE h; int unit; + pager_open(); for (unit = 0, h = efi_find_handle(&efinet_dev, 0); h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { sprintf(line, " %s%d:\n", efinet_dev.dv_name, unit); - pager_output(line); + if (pager_output(line)) + break; } + pager_close(); } Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/efi/libefi/efipart.c Wed May 18 05:59:05 2016 (r300117) @@ -180,21 +180,27 @@ efipart_print(int verbose) EFI_STATUS status; u_int unit; + pager_open(); for (unit = 0, h = efi_find_handle(&efipart_dev, 0); h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) { sprintf(line, " %s%d:", efipart_dev.dv_name, unit); - pager_output(line); + if (pager_output(line)) + break; status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio); if (!EFI_ERROR(status)) { sprintf(line, " %llu blocks", (unsigned long long)(blkio->Media->LastBlock + 1)); - pager_output(line); + if (pager_output(line)) + break; if (blkio->Media->RemovableMedia) - pager_output(" (removable)"); + if (pager_output(" (removable)")) + break; } - pager_output("\n"); + if (pager_output("\n")) + break; } + pager_close(); } static int Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/efi/loader/Makefile Wed May 18 05:59:05 2016 (r300117) @@ -30,6 +30,10 @@ CWARNFLAGS.zfs.c+= -Wno-sign-compare CWARNFLAGS.zfs.c+= -Wno-array-bounds CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif +# In the loader, %S is for CHAR16 strings, not wchar_t strings. This +# mismatch causes issues on some archs, so just ignore it for now. +# The printf in libstand implements CHAR16 strings always. +CWARNFLAGS.main.c+= -Wno-format # We implement a slightly non-stadard %S in that it always takes a # CHAR16 that's common in UEFI-land instaed of a wchar_t. This only Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/efi/loader/bootinfo.c Wed May 18 05:59:05 2016 (r300117) @@ -422,7 +422,7 @@ bi_load(char *args, vm_offset_t *modulep if (dtb_size) file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); else - pager_output("WARNING! Trying to fire up the kernel, but no " + printf("WARNING! Trying to fire up the kernel, but no " "device tree blob found!\n"); #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/efi/loader/main.c Wed May 18 05:59:05 2016 (r300117) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -649,6 +650,7 @@ command_nvram(int argc, char *argv[]) /* Initiate the search */ status = RS->GetNextVariableName(&varsz, NULL, NULL); + pager_open(); for (; status != EFI_NOT_FOUND; ) { status = RS->GetNextVariableName(&varsz, var, &varguid); //if (EFI_ERROR(status)) @@ -671,10 +673,11 @@ command_nvram(int argc, char *argv[]) printf("\\x%02x", data[i]); } } - /* XXX */ - pager_output("\n"); free(data); + if (pager_output("\n")) + break; } + pager_close(); return (CMD_OK); } @@ -761,9 +764,11 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU return (CMD_ERROR); } uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); - printf("%s %S=%S\n", str, varnamearg, data); + printf("%s %S=%S", str, varnamearg, data); free(str); free(data); + if (pager_output("\n")) + return (CMD_WARN); return (CMD_OK); } @@ -783,7 +788,7 @@ command_efi_printenv(int argc, char *arg */ /* XXX We assume EFI_GUID is the same as uuid_t */ int aflag = 0, gflag = 0, lflag = 0, vflag = 0; - int ch; + int ch, rv; unsigned i; EFI_STATUS status; EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; @@ -842,14 +847,19 @@ command_efi_printenv(int argc, char *arg argc -= optind; argv += optind; - if (vflag && gflag) - return efi_print_var(varnamearg, &matchguid, lflag); + pager_open(); + if (vflag && gflag) { + rv = efi_print_var(varnamearg, &matchguid, lflag); + pager_close(); + return (rv); + } if (argc == 2) { optarg = argv[0]; if (strlen(optarg) >= nitems(varnamearg)) { printf("Variable %s is longer than %zd characters\n", optarg, nitems(varnamearg)); + pager_close(); return (CMD_ERROR); } for (i = 0; i < strlen(optarg); i++) @@ -860,13 +870,17 @@ command_efi_printenv(int argc, char *arg &uuid_status); if (uuid_status != uuid_s_ok) { printf("uid %s could not be parsed\n", optarg); + pager_close(); return (CMD_ERROR); } - return efi_print_var(varnamearg, &matchguid, lflag); + rv = efi_print_var(varnamearg, &matchguid, lflag); + pager_close(); + return (rv); } if (argc != 0) { printf("Too many args\n"); + pager_close(); return (CMD_ERROR); } @@ -882,19 +896,23 @@ command_efi_printenv(int argc, char *arg status = RS->GetNextVariableName(&varsz, varname, &varguid); if (aflag) { - efi_print_var(varname, &varguid, lflag); + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) + break; continue; } if (vflag) { if (wcscmp(varnamearg, varname) == 0) - efi_print_var(varname, &varguid, lflag); + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) + break; } if (gflag) { if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) - efi_print_var(varname, &varguid, lflag); + if (efi_print_var(varname, &varguid, lflag) != CMD_OK) + break; } } - + pager_close(); + return (CMD_OK); } Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/fdt/fdt_loader_cmd.c Wed May 18 05:59:05 2016 (r300117) @@ -970,40 +970,52 @@ fdt_cmd_hdr(int argc __unused, char *arg ver = fdt_version(fdtp); pager_open(); sprintf(line, "\nFlattened device tree header (%p):\n", fdtp); - pager_output(line); + if (pager_output(line)) + goto out; sprintf(line, " magic = 0x%08x\n", fdt_magic(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; sprintf(line, " size = %d\n", fdt_totalsize(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; sprintf(line, " off_dt_struct = 0x%08x\n", fdt_off_dt_struct(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; sprintf(line, " off_dt_strings = 0x%08x\n", fdt_off_dt_strings(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; sprintf(line, " off_mem_rsvmap = 0x%08x\n", fdt_off_mem_rsvmap(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; sprintf(line, " version = %d\n", ver); - pager_output(line); + if (pager_output(line)) + goto out; sprintf(line, " last compatible version = %d\n", fdt_last_comp_version(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; if (ver >= 2) { sprintf(line, " boot_cpuid = %d\n", fdt_boot_cpuid_phys(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; } if (ver >= 3) { sprintf(line, " size_dt_strings = %d\n", fdt_size_dt_strings(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; } if (ver >= 17) { sprintf(line, " size_dt_struct = %d\n", fdt_size_dt_struct(fdtp)); - pager_output(line); + if (pager_output(line)) + goto out; } +out: pager_close(); return (CMD_OK); @@ -1678,15 +1690,18 @@ fdt_cmd_mres(int argc, char *argv[]) pager_open(); total = fdt_num_mem_rsv(fdtp); if (total > 0) { - pager_output("Reserved memory regions:\n"); + if (pager_output("Reserved memory regions:\n")) + goto out; for (i = 0; i < total; i++) { fdt_get_mem_rsv(fdtp, i, &start, &size); sprintf(line, "reg#%d: (start: 0x%jx, size: 0x%jx)\n", i, start, size); - pager_output(line); + if (pager_output(line)) + goto out; } } else pager_output("No reserved memory regions\n"); +out: pager_close(); return (CMD_OK); Modified: head/sys/boot/i386/libi386/bioscd.c ============================================================================== --- head/sys/boot/i386/libi386/bioscd.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/i386/libi386/bioscd.c Wed May 18 05:59:05 2016 (r300117) @@ -183,11 +183,14 @@ bc_print(int verbose) char line[80]; int i; + pager_open(); for (i = 0; i < nbcinfo; i++) { sprintf(line, " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); - pager_output(line); + if (pager_output(line)) + break; } + pager_close(); } /* Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/i386/libi386/biosdisk.c Wed May 18 05:59:05 2016 (r300117) @@ -313,11 +313,13 @@ bd_print(int verbose) struct disk_devdesc dev; int i; + pager_open(); for (i = 0; i < nbdinfo; i++) { sprintf(line, " disk%d: BIOS drive %c:\n", i, (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): ('C' + bdinfo[i].bd_unit - 0x80)); - pager_output(line); + if (pager_output(line)) + break; dev.d_dev = &biosdisk; dev.d_unit = i; dev.d_slice = -1; @@ -332,6 +334,7 @@ bd_print(int verbose) disk_close(&dev); } } + pager_close(); } /* Modified: head/sys/boot/pc98/libpc98/bioscd.c ============================================================================== --- head/sys/boot/pc98/libpc98/bioscd.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/pc98/libpc98/bioscd.c Wed May 18 05:59:05 2016 (r300117) @@ -179,11 +179,14 @@ bc_print(int verbose) char line[80]; int i; + pager_open(); for (i = 0; i < nbcinfo; i++) { sprintf(line, " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); - pager_output(line); + if (pager_output(line)) + break; } + pager_close(); } /* Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/pc98/libpc98/biosdisk.c Wed May 18 05:59:05 2016 (r300117) @@ -111,9 +111,9 @@ static int bd_write(struct open_disk *od static int bd_int13probe(struct bdinfo *bd); -static void bd_printslice(struct open_disk *od, struct pc98_partition *dp, +static int bd_printslice(struct open_disk *od, struct pc98_partition *dp, char *prefix, int verbose); -static void bd_printbsdslice(struct open_disk *od, daddr_t offset, +static int bd_printbsdslice(struct open_disk *od, daddr_t offset, char *prefix, int verbose); static int bd_init(void); @@ -252,15 +252,18 @@ bd_int13probe(struct bdinfo *bd) static void bd_print(int verbose) { - int i, j; + int i, j, done; char line[80]; struct i386_devdesc dev; struct open_disk *od; struct pc98_partition *dptr; - for (i = 0; i < nbdinfo; i++) { + pager_open(); + done = 0; + for (i = 0; i < nbdinfo && !done; i++) { sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); - pager_output(line); + if (pager_output(line)) + break; /* try to open the whole disk */ dev.d_unit = i; @@ -276,12 +279,16 @@ bd_print(int verbose) /* Check for a "dedicated" disk */ for (j = 0; j < od->od_nslices; j++) { sprintf(line, " disk%ds%d", i, j + 1); - bd_printslice(od, &dptr[j], line, verbose); + if (bd_printslice(od, &dptr[j], line, verbose)) { + done = 1; + break; + } } } bd_closedisk(od); } } + pager_close(); } /* Given a size in 512 byte sectors, convert it to a human-readable number. */ @@ -311,7 +318,7 @@ display_size(uint64_t size) * Print information about slices on a disk. For the size calculations we * assume a 512 byte sector. */ -static void +static int bd_printslice(struct open_disk *od, struct pc98_partition *dp, char *prefix, int verbose) { @@ -331,10 +338,9 @@ bd_printslice(struct open_disk *od, stru switch(dp->dp_mid & PC98_MID_MASK) { case PC98_MID_386BSD: - bd_printbsdslice(od, start, prefix, verbose); - return; + return (bd_printbsdslice(od, start, prefix, verbose)); case 0x00: /* unused partition */ - return; + return (0); case 0x01: sprintf(line, "%s: FAT-12%s\n", prefix, stats); break; @@ -350,14 +356,14 @@ bd_printslice(struct open_disk *od, stru sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_mid, stats); } - pager_output(line); + return (pager_output(line)); } /* * Print out each valid partition in the disklabel of a FreeBSD slice. * For size calculations, we assume a 512 byte sector size. */ -static void +static int bd_printbsdslice(struct open_disk *od, daddr_t offset, char *prefix, int verbose) { @@ -368,12 +374,11 @@ bd_printbsdslice(struct open_disk *od, d /* read disklabel */ if (bd_read(od, offset + LABELSECTOR, 1, buf)) - return; + return (0); lp =(struct disklabel *)(&buf[0]); if (lp->d_magic != DISKMAGIC) { sprintf(line, "%s: FFS bad disklabel\n", prefix); - pager_output(line); - return; + return (pager_output(line)); } /* Print partitions */ @@ -404,9 +409,11 @@ bd_printbsdslice(struct open_disk *od, d (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap" : (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" : "FFS"); - pager_output(line); + if (pager_output(line)) + return (1); } } + return (0); } Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/uboot/lib/disk.c Wed May 18 05:59:05 2016 (r300117) @@ -245,6 +245,7 @@ stor_print(int verbose) static char line[80]; int i; + pager_open(); for (i = 0; i < stor_info_no; i++) { dev.d_dev = &uboot_storage; dev.d_unit = i; @@ -252,13 +253,15 @@ stor_print(int verbose) dev.d_partition = -1; sprintf(line, "\tdisk%d (%s)\n", i, ub_stor_type(SI(&dev).type)); - pager_output(line); + if (pager_output(line)) + break; if (stor_opendev(&dev) == 0) { sprintf(line, "\tdisk%d", i); disk_print(&dev, line, verbose); disk_close(&dev); } } + pager_close(); } static int Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Wed May 18 05:58:58 2016 (r300116) +++ head/sys/boot/zfs/zfs.c Wed May 18 05:59:05 2016 (r300117) @@ -438,7 +438,7 @@ zfs_probe(int fd, uint64_t *pool_guid) return (ret); } -static void +static int zfs_probe_partition(void *arg, const char *partname, const struct ptable_entry *part) { @@ -450,7 +450,7 @@ zfs_probe_partition(void *arg, const cha /* Probe only freebsd-zfs and freebsd partitions */ if (part->type != PART_FREEBSD && part->type != PART_FREEBSD_ZFS) - return; + return 0; ppa = (struct zfs_probe_args *)arg; strncpy(devname, ppa->devname, strlen(ppa->devname) - 1); @@ -458,10 +458,10 @@ zfs_probe_partition(void *arg, const cha sprintf(devname, "%s%s:", devname, partname); pa.fd = open(devname, O_RDONLY); if (pa.fd == -1) - return; + return 0; ret = zfs_probe(pa.fd, ppa->pool_guid); if (ret == 0) - return; + return 0; /* Do we have BSD label here? */ if (part->type == PART_FREEBSD) { pa.devname = devname; @@ -470,11 +470,12 @@ zfs_probe_partition(void *arg, const cha table = ptable_open(&pa, part->end - part->start + 1, ppa->secsz, zfs_diskread); if (table != NULL) { - ptable_iterate(table, &pa, zfs_probe_partition); + ret = ptable_iterate(table, &pa, zfs_probe_partition); ptable_close(table); } } close(pa.fd); + return (ret); } int @@ -893,4 +894,4 @@ zfs_set_env(void) } return (rv); -} \ No newline at end of file +} From owner-svn-src-all@freebsd.org Wed May 18 06:00:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24FB8B4074B; Wed, 18 May 2016 06:00:34 +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 EAC6016CA; Wed, 18 May 2016 06:00:33 +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 u4I60Xvn049523; Wed, 18 May 2016 06:00:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I60X99049522; Wed, 18 May 2016 06:00:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605180600.u4I60X99049522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 18 May 2016 06:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300118 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 06:00:34 -0000 Author: gjb Date: Wed May 18 06:00:32 2016 New Revision: 300118 URL: https://svnweb.freebsd.org/changeset/base/300118 Log: Revert r300003, and use proper grammar. While here, bump .Dd, which should have been done with previous commit. Modified: head/share/man/man4/gdb.4 Modified: head/share/man/man4/gdb.4 ============================================================================== --- head/share/man/man4/gdb.4 Wed May 18 05:59:05 2016 (r300117) +++ head/share/man/man4/gdb.4 Wed May 18 06:00:32 2016 (r300118) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2005 +.Dd May 17, 2016 .Dt GDB 4 .Os .Sh NAME @@ -595,7 +595,7 @@ run the link at more than 9600 bps. Firewire connections do not have this problem. .Pp The debugging macros -.Dq "just growed" . +.Dq just grew. In general, the person who wrote them did so while looking for a specific problem, so they may not be general enough, and they may behave badly when used in ways for which they were not intended, even if those ways make sense. From owner-svn-src-all@freebsd.org Wed May 18 06:01:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18405B40867; Wed, 18 May 2016 06:01:21 +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 D856019D1; Wed, 18 May 2016 06:01:20 +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 u4I61KaA050249; Wed, 18 May 2016 06:01:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I61IaZ050231; Wed, 18 May 2016 06:01:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605180601.u4I61IaZ050231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 06:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300119 - in head: . gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/clang lib/libc lib/libc/arm lib/libc/arm/aeabi lib/libc/arm/gen lib/libcompiler_rt li... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 06:01:21 -0000 Author: imp Date: Wed May 18 06:01:18 2016 New Revision: 300119 URL: https://svnweb.freebsd.org/changeset/base/300119 Log: Make armv6 hard float abi by default. Kill armv6hf. Allow CPUTYPE=soft to build the current soft-float abi libraries. Add UPDATING entry to announce this. Approved by: re@ (gjb) Modified: head/Makefile head/Makefile.inc1 head/UPDATING head/gnu/usr.bin/binutils/Makefile.inc0 head/gnu/usr.bin/cc/Makefile.tgt head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/libgdb/Makefile head/lib/clang/clang.build.mk head/lib/libc/Makefile head/lib/libc/arm/Makefile.inc head/lib/libc/arm/aeabi/Makefile.inc head/lib/libc/arm/gen/Makefile.inc head/lib/libcompiler_rt/Makefile head/lib/msun/arm/Makefile.inc head/lib/msun/arm/fenv-vfp.c head/share/mk/bsd.cpu.mk head/share/mk/local.meta.sys.mk head/share/mk/sys.mk Modified: head/Makefile ============================================================================== --- head/Makefile Wed May 18 06:00:32 2016 (r300118) +++ head/Makefile Wed May 18 06:01:18 2016 (r300119) @@ -197,7 +197,7 @@ _MAKE+= MK_META_MODE=no _TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} -_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/} +_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/} .endif .if defined(TARGET) && !defined(_TARGET) _TARGET=${TARGET} @@ -374,7 +374,7 @@ worlds: .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) TARGETS?=amd64 arm arm64 i386 mips pc98 powerpc sparc64 _UNIVERSE_TARGETS= ${TARGETS} -TARGET_ARCHES_arm?= arm armeb armv6 armv6hf +TARGET_ARCHES_arm?= arm armeb armv6 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 TARGET_ARCHES_powerpc?= powerpc powerpc64 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 18 06:00:32 2016 (r300118) +++ head/Makefile.inc1 Wed May 18 06:01:18 2016 (r300119) @@ -219,7 +219,6 @@ KNOWN_ARCHES?= aarch64/arm64 \ arm \ armeb/arm \ armv6/arm \ - armv6hf/arm \ i386 \ i386/pc98 \ mips \ Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed May 18 06:00:32 2016 (r300118) +++ head/UPDATING Wed May 18 06:01:18 2016 (r300119) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160517: + The armv6 port now defaults to hard float ABI. Limited support + for running both hardfloat and soft float on the same system + is available using the libraries installed with -DWITH_LIBSOFT. + This has only been tested as an upgrade path for installworld + and packages may fail or need manual intervention to run. New + packages will be needed. + 20160510: Kernel modules compiled outside of a kernel build now default to installing to /boot/modules instead of /boot/kernel. Many kernel Modified: head/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- head/gnu/usr.bin/binutils/Makefile.inc0 Wed May 18 06:00:32 2016 (r300118) +++ head/gnu/usr.bin/binutils/Makefile.inc0 Wed May 18 06:01:18 2016 (r300119) @@ -7,7 +7,7 @@ VERSION= "2.17.50 [FreeBSD] 2007-07-03" .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- head/gnu/usr.bin/cc/Makefile.tgt Wed May 18 06:00:32 2016 (r300118) +++ head/gnu/usr.bin/cc/Makefile.tgt Wed May 18 06:01:18 2016 (r300119) @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Wed May 18 06:00:32 2016 (r300118) +++ head/gnu/usr.bin/gdb/Makefile.inc Wed May 18 06:01:18 2016 (r300119) @@ -23,7 +23,7 @@ OBJ_RL= ${OBJ_ROOT}/../lib/libreadline/r # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/gdb/libgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/libgdb/Makefile Wed May 18 06:00:32 2016 (r300118) +++ head/gnu/usr.bin/gdb/libgdb/Makefile Wed May 18 06:01:18 2016 (r300119) @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Wed May 18 06:00:32 2016 (r300118) +++ head/lib/clang/clang.build.mk Wed May 18 06:01:18 2016 (r300119) @@ -21,16 +21,19 @@ CFLAGS+= -fno-strict-aliasing TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH:Marm*hf*} != "" +# Armv6 uses hard float abi, unless the CPUTYPE has soft in it. +# arm (for armv4 and armv5 CPUs) always uses the soft float ABI. +# For all other targets, we stick with 'unknown'. +.if ${TARGET_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") TARGET_ABI= gnueabihf -.elif ${TARGET_ARCH:Marm*} != "" +.elif ${TARGET_ARCH:Marm*} TARGET_ABI= gnueabi .else TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-${TARGET_ABI}-freebsd11.0 -BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-unknown-freebsd11.0 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${TARGET_ABI}-freebsd11.0 +BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-unknown-freebsd11.0 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \ -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed May 18 06:00:32 2016 (r300118) +++ head/lib/libc/Makefile Wed May 18 06:01:18 2016 (r300119) @@ -105,7 +105,8 @@ NOASM= .include "${LIBC_SRCTOP}/rpc/Makefile.inc" .include "${LIBC_SRCTOP}/uuid/Makefile.inc" .include "${LIBC_SRCTOP}/xdr/Makefile.inc" -.if (${LIBC_ARCH} == "arm" && ${MACHINE_ARCH} != "armv6hf") ||\ +.if (${LIBC_ARCH} == "arm" && \ + (${MACHINE_ARCH:Marmv6*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \ ${LIBC_ARCH} == "mips" .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Wed May 18 06:00:32 2016 (r300118) +++ head/lib/libc/arm/Makefile.inc Wed May 18 06:01:18 2016 (r300119) @@ -11,7 +11,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" -.if ${MACHINE_ARCH:Marm*hf*} != "" +.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map .endif Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Wed May 18 06:00:32 2016 (r300118) +++ head/lib/libc/arm/aeabi/Makefile.inc Wed May 18 06:01:18 2016 (r300119) @@ -5,13 +5,14 @@ SRCS+= aeabi_atexit.c \ aeabi_unwind_cpp.c \ aeabi_unwind_exidx.c -.if ${MACHINE_ARCH:Marm*hf*} == "" +.if (${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "") || \ + ${MACHINE_ARCH:Marmv6*} == "" SRCS+= aeabi_asm_double.S \ aeabi_asm_float.S \ aeabi_double.c \ aeabi_float.c .endif -.if ${MACHINE_ARCH:Marmv6*} +.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SRCS+= aeabi_vfp_double.S \ aeabi_vfp_float.S .endif Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Wed May 18 06:00:32 2016 (r300118) +++ head/lib/libc/arm/gen/Makefile.inc Wed May 18 06:01:18 2016 (r300119) @@ -7,7 +7,7 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c arm_initfini.c \ trivial-getcontextx.c -.if ${MACHINE_ARCH} == "armv6hf" +.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \ fpsetround_vfp.c fpsetsticky_vfp.c .endif Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Wed May 18 06:00:32 2016 (r300118) +++ head/lib/libcompiler_rt/Makefile Wed May 18 06:01:18 2016 (r300119) @@ -199,9 +199,10 @@ SRCF+= stdatomic .endif .for file in ${SRCF} -. if ${MACHINE_ARCH:Marm*hf*} != "" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) +.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") && \ + exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) SRCS+= ${file}vfp.S -. elif !(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH:Marm*hf*} == "") && exists(${CRTSRC}/${CRTARCH}/${file}.S) +. elif exists(${CRTSRC}/${CRTARCH}/${file}.S) SRCS+= ${file}.S . else SRCS+= ${file}.c Modified: head/lib/msun/arm/Makefile.inc ============================================================================== --- head/lib/msun/arm/Makefile.inc Wed May 18 06:00:32 2016 (r300118) +++ head/lib/msun/arm/Makefile.inc Wed May 18 06:01:18 2016 (r300119) @@ -3,7 +3,7 @@ LDBL_PREC = 53 SYM_MAPS += ${.CURDIR}/arm/Symbol.map -.if ${TARGET_ARCH} == "armv6" +.if ${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" ARCH_SRCS = fenv-softfp.c fenv-vfp.c .endif Modified: head/lib/msun/arm/fenv-vfp.c ============================================================================== --- head/lib/msun/arm/fenv-vfp.c Wed May 18 06:00:32 2016 (r300118) +++ head/lib/msun/arm/fenv-vfp.c Wed May 18 06:01:18 2016 (r300119) @@ -28,6 +28,8 @@ #define FENV_MANGLE(x) __vfp_ ##x #include "fenv-mangle.h" -#define __ARM_PCS_VFP +#ifndef __ARM_PCS_VFP +#define __ARM_PCS_VFP 1 +#endif #include "fenv.c" Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed May 18 06:00:32 2016 (r300118) +++ head/share/mk/bsd.cpu.mk Wed May 18 06:01:18 2016 (r300119) @@ -309,14 +309,18 @@ MACHINE_CPU += arm . if ${MACHINE_ARCH:Marmv6*} != "" MACHINE_CPU += armv6 . endif -# armv6 is a hybrid. It uses the softfp ABI, but doesn't emulate +# armv6 is a hybrid. It can use the softfp ABI, but doesn't emulate # floating point in the general case, so don't define softfp for # it at this time. arm and armeb are pure softfp, so define it # for them. . if ${MACHINE_ARCH:Marmv6*} == "" MACHINE_CPU += softfp . endif -.if ${MACHINE_ARCH} == "armv6" +# Normally armv6 is hard float ABI from FreeBSD 11 onwards. However +# when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow +# building of soft-float ABI libraries. In this case, we have to +# add the -mfloat-abi=softfp to force that. +.if ${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" # Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI # not a nice optimization. CFLAGS += -mfloat-abi=softfp Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed May 18 06:00:32 2016 (r300118) +++ head/share/mk/local.meta.sys.mk Wed May 18 06:01:18 2016 (r300119) @@ -43,7 +43,7 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} .endif # from src/Makefile (for universe) -TARGET_ARCHES_arm?= arm armeb armv6 armv6hf +TARGET_ARCHES_arm?= arm armeb armv6 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el TARGET_ARCHES_powerpc?= powerpc powerpc64 Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Wed May 18 06:00:32 2016 (r300118) +++ head/share/mk/sys.mk Wed May 18 06:01:18 2016 (r300119) @@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX. # and/or endian. This is called MACHINE_CPU in NetBSD, but that's used # for something different in FreeBSD. # -MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/} +MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/} .endif From owner-svn-src-all@freebsd.org Wed May 18 06:19:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77728B40D91; Wed, 18 May 2016 06:19:23 +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 3C7031135; Wed, 18 May 2016 06:19:23 +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 u4I6JMSG055431; Wed, 18 May 2016 06:19:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I6JMBL055430; Wed, 18 May 2016 06:19:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180619.u4I6JMBL055430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 06:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300120 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 06:19:23 -0000 Author: sephe Date: Wed May 18 06:19:22 2016 New Revision: 300120 URL: https://svnweb.freebsd.org/changeset/base/300120 Log: hyperv/vmbus: Remove useless modevent handler MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6410 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:01:18 2016 (r300119) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:19:22 2016 (r300120) @@ -605,39 +605,6 @@ vmbus_detach(device_t dev) return (0); } -static void -vmbus_mod_load(void) -{ - if(bootverbose) - printf("VMBUS: load\n"); -} - -static void -vmbus_mod_unload(void) -{ - if(bootverbose) - printf("VMBUS: unload\n"); -} - -static int -vmbus_modevent(module_t mod, int what, void *arg) -{ - switch (what) { - - case MOD_LOAD: -#ifdef EARLY_AP_STARTUP - vmbus_init(); -#endif - vmbus_mod_load(); - break; - case MOD_UNLOAD: - vmbus_mod_unload(); - break; - } - - return (0); -} - static device_method_t vmbus_methods[] = { /** Device interface */ DEVMETHOD(device_probe, vmbus_probe), @@ -664,7 +631,7 @@ static driver_t vmbus_driver = { devclass_t vmbus_devclass; -DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, vmbus_modevent, 0); +DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, NULL, NULL); MODULE_DEPEND(vmbus, acpi, 1, 1, 1); MODULE_VERSION(vmbus, 1); From owner-svn-src-all@freebsd.org Wed May 18 06:29:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BBA0B40FEA; Wed, 18 May 2016 06:29: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 1D2A7175C; Wed, 18 May 2016 06:29: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 u4I6T3JB058388; Wed, 18 May 2016 06:29:03 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I6T3bt058387; Wed, 18 May 2016 06:29:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180629.u4I6T3bt058387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 06:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300121 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 06:29:04 -0000 Author: sephe Date: Wed May 18 06:29:03 2016 New Revision: 300121 URL: https://svnweb.freebsd.org/changeset/base/300121 Log: hyperv/vmbus: Nuke unnecessary function indirection MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6411 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:19:22 2016 (r300120) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:29:03 2016 (r300121) @@ -562,8 +562,8 @@ vmbus_init(void) vmbus_bus_init(); } -static void -vmbus_bus_exit(void) +static int +vmbus_detach(device_t dev) { int i; @@ -589,19 +589,6 @@ vmbus_bus_exit(void) lapic_ipi_free(hv_vmbus_g_context.hv_cb_vector); - return; -} - -static void -vmbus_exit(void) -{ - vmbus_bus_exit(); -} - -static int -vmbus_detach(device_t dev) -{ - vmbus_exit(); return (0); } From owner-svn-src-all@freebsd.org Wed May 18 06:36:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3D09B401F6; Wed, 18 May 2016 06:36: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 B501D1C84; Wed, 18 May 2016 06:36: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 u4I6aSOx061295; Wed, 18 May 2016 06:36:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I6aSWL061294; Wed, 18 May 2016 06:36:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180636.u4I6aSWL061294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 06:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300122 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 06:36:30 -0000 Author: sephe Date: Wed May 18 06:36:28 2016 New Revision: 300122 URL: https://svnweb.freebsd.org/changeset/base/300122 Log: hyperv: Set vm_guest to VM_GUEST_VM, if hypervisor is not Hyper-V Reviewed by: kib MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6412 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Wed May 18 06:29:03 2016 (r300121) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Wed May 18 06:36:28 2016 (r300122) @@ -501,8 +501,12 @@ hyperv_identify(void) static void hyperv_init(void *dummy __unused) { - if (!hyperv_identify()) + if (!hyperv_identify()) { + /* Not Hyper-V; reset guest id to the generic one. */ + if (vm_guest == VM_GUEST_HV) + vm_guest = VM_GUEST_VM; return; + } if (hyperv_features & HV_FEATURE_MSR_TIME_REFCNT) { /* Register virtual timecount */ From owner-svn-src-all@freebsd.org Wed May 18 06:43:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8DEDB403F6; Wed, 18 May 2016 06:43:16 +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 8AD771084; Wed, 18 May 2016 06:43: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 u4I6hFK5064153; Wed, 18 May 2016 06:43:15 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I6hFnI064152; Wed, 18 May 2016 06:43:15 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180643.u4I6hFnI064152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 06:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300123 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 06:43:16 -0000 Author: sephe Date: Wed May 18 06:43:15 2016 New Revision: 300123 URL: https://svnweb.freebsd.org/changeset/base/300123 Log: hyperv/vmbus: Staticize vmbus_devclass Reviewed by: Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6414 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:36:28 2016 (r300122) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:43:15 2016 (r300123) @@ -616,7 +616,7 @@ static driver_t vmbus_driver = { sizeof(struct vmbus_softc) }; -devclass_t vmbus_devclass; +static devclass_t vmbus_devclass; DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, NULL, NULL); MODULE_DEPEND(vmbus, acpi, 1, 1, 1); From owner-svn-src-all@freebsd.org Wed May 18 06:52:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF1DFB408EE; Wed, 18 May 2016 06:52: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 7303717CE; Wed, 18 May 2016 06:52: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 u4I6qK0O067082; Wed, 18 May 2016 06:52:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I6qKw4067081; Wed, 18 May 2016 06:52:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180652.u4I6qKw4067081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 06:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300124 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 06:52:21 -0000 Author: sephe Date: Wed May 18 06:52:20 2016 New Revision: 300124 URL: https://svnweb.freebsd.org/changeset/base/300124 Log: hyperv/vmbus: Reindent and cleanup devmethods. While I'm here, use DEVMETHOD_END. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6415 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:43:15 2016 (r300123) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 06:52:20 2016 (r300124) @@ -593,22 +593,23 @@ vmbus_detach(device_t dev) } static device_method_t vmbus_methods[] = { - /** Device interface */ - DEVMETHOD(device_probe, vmbus_probe), - DEVMETHOD(device_attach, vmbus_attach), - DEVMETHOD(device_detach, vmbus_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /** Bus interface */ - DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_read_ivar, vmbus_read_ivar), - DEVMETHOD(bus_write_ivar, vmbus_write_ivar), - DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), + /* Device interface */ + DEVMETHOD(device_probe, vmbus_probe), + DEVMETHOD(device_attach, vmbus_attach), + DEVMETHOD(device_detach, vmbus_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, vmbus_read_ivar), + DEVMETHOD(bus_write_ivar, vmbus_write_ivar), + DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), - { 0, 0 } }; + DEVMETHOD_END +}; static driver_t vmbus_driver = { "vmbus", From owner-svn-src-all@freebsd.org Wed May 18 07:01:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02B23B40AC1; Wed, 18 May 2016 07:01:24 +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 9B46B1B92; Wed, 18 May 2016 07:01:23 +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 u4I71MtR069532; Wed, 18 May 2016 07:01:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I71Md6069531; Wed, 18 May 2016 07:01:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605180701.u4I71Md6069531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 18 May 2016 07:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300125 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 07:01:24 -0000 Author: adrian Date: Wed May 18 07:01:22 2016 New Revision: 300125 URL: https://svnweb.freebsd.org/changeset/base/300125 Log: [siba] use the correct SPROM offsets. I transcribed the linux ssb offsets and .. didn't pick up that our SIBA SPROM code has an offset of 0x1000. This fixes a bunch of odd parsing values that showed up when I tried using a newer NIC. The NIC still doesn't yet work but now the SPROM values are right. Oops! Modified: head/sys/dev/siba/sibareg.h Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Wed May 18 06:52:20 2016 (r300124) +++ head/sys/dev/siba/sibareg.h Wed May 18 07:01:22 2016 (r300125) @@ -399,10 +399,10 @@ #define SIBA_SPROM4_GPIOB_P3 0xff00 /* The following four blocks share the same structure */ -#define SIBA_SPROM4_PWR_INFO_CORE0 0x0080 -#define SIBA_SPROM4_PWR_INFO_CORE1 0x00AE -#define SIBA_SPROM4_PWR_INFO_CORE2 0x00DC -#define SIBA_SPROM4_PWR_INFO_CORE3 0x010A +#define SIBA_SPROM4_PWR_INFO_CORE0 0x1080 +#define SIBA_SPROM4_PWR_INFO_CORE1 0x10AE +#define SIBA_SPROM4_PWR_INFO_CORE2 0x10DC +#define SIBA_SPROM4_PWR_INFO_CORE3 0x110A #define SIBA_SPROM4_2G_MAXP_ITSSI 0x00 /* 2 GHz ITSSI and 2 GHz Max Power */ #define SIBA_SPROM4_2G_MAXP 0x00FF @@ -486,8 +486,8 @@ #define SIBA_SPROM8_RXPO5G 0xff00 /* The FEM blocks share the same structure */ -#define SIBA_SPROM8_FEM2G 0x00AE -#define SIBA_SPROM8_FEM5G 0x00B0 +#define SIBA_SPROM8_FEM2G 0x10ae +#define SIBA_SPROM8_FEM5G 0x10b0 #define SSB_SROM8_FEM_TSSIPOS 0x0001 #define SSB_SROM8_FEM_EXTPA_GAIN 0x0006 #define SSB_SROM8_FEM_PDET_RANGE 0x00F8 @@ -526,10 +526,10 @@ #define SIBA_SPROM8_BWDUPPO 0x0198 /* There are 4 blocks with power info sharing the same layout */ -#define SIBA_SROM8_PWR_INFO_CORE0 0x00C0 -#define SIBA_SROM8_PWR_INFO_CORE1 0x00E0 -#define SIBA_SROM8_PWR_INFO_CORE2 0x0100 -#define SIBA_SROM8_PWR_INFO_CORE3 0x0120 +#define SIBA_SROM8_PWR_INFO_CORE0 0x10C0 +#define SIBA_SROM8_PWR_INFO_CORE1 0x10E0 +#define SIBA_SROM8_PWR_INFO_CORE2 0x1100 +#define SIBA_SROM8_PWR_INFO_CORE3 0x1120 #define SIBA_SROM8_2G_MAXP_ITSSI 0x00 #define SIBA_SPROM8_2G_MAXP 0x00FF From owner-svn-src-all@freebsd.org Wed May 18 07:01:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83DD7B40AE8; Wed, 18 May 2016 07:01: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 514131D38; Wed, 18 May 2016 07:01: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 u4I71W2G070209; Wed, 18 May 2016 07:01:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I71Wla070208; Wed, 18 May 2016 07:01:32 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180701.u4I71Wla070208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 07:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300126 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 07:01:33 -0000 Author: sephe Date: Wed May 18 07:01:32 2016 New Revision: 300126 URL: https://svnweb.freebsd.org/changeset/base/300126 Log: hyperv/vmbus: Fix SYSINIT function prototype and usage. Reviewed by: Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6416 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 07:01:22 2016 (r300125) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 07:01:32 2016 (r300126) @@ -545,7 +545,7 @@ vmbus_attach(device_t dev) } static void -vmbus_init(void) +vmbus_sysinit(void *arg __unused) { if (vm_guest != VM_GUEST_HV || vmbus_get_softc() == NULL) return; @@ -624,6 +624,10 @@ MODULE_DEPEND(vmbus, acpi, 1, 1, 1); MODULE_VERSION(vmbus, 1); #ifndef EARLY_AP_STARTUP -/* We want to be started after SMP is initialized */ -SYSINIT(vmb_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, vmbus_init, NULL); +/* + * NOTE: + * We have to start as the last step of SI_SUB_SMP, i.e. after SMP is + * initialized. + */ +SYSINIT(vmbus_initialize, SI_SUB_SMP, SI_ORDER_ANY, vmbus_sysinit, NULL); #endif From owner-svn-src-all@freebsd.org Wed May 18 07:09:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 678E9B40C38; Wed, 18 May 2016 07:09:46 +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 1257411FA; Wed, 18 May 2016 07:09:46 +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 u4I79jD8070502; Wed, 18 May 2016 07:09:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I79jf0070500; Wed, 18 May 2016 07:09:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180709.u4I79jf0070500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 07:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300127 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 07:09:46 -0000 Author: sephe Date: Wed May 18 07:09:44 2016 New Revision: 300127 URL: https://svnweb.freebsd.org/changeset/base/300127 Log: hyperv/vmbus: Minor function definition style fixup Reviewed by: Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6417 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 07:01:32 2016 (r300126) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed May 18 07:09:44 2016 (r300127) @@ -149,7 +149,8 @@ hv_vmbus_negotiate_version(hv_vmbus_chan * Send a connect request on the partition service connection */ int -hv_vmbus_connect(void) { +hv_vmbus_connect(void) +{ int ret = 0; uint32_t version; hv_vmbus_channel_msg_info* msg_info = NULL; @@ -271,7 +272,8 @@ hv_vmbus_connect(void) { * Send a disconnect request on the partition service connection */ int -hv_vmbus_disconnect(void) { +hv_vmbus_disconnect(void) +{ int ret = 0; hv_vmbus_channel_unload msg; @@ -395,7 +397,8 @@ int hv_vmbus_post_message(void *buffer, * Send an event notification to the parent */ int -hv_vmbus_set_event(hv_vmbus_channel *channel) { +hv_vmbus_set_event(hv_vmbus_channel *channel) +{ int ret = 0; uint32_t child_rel_id = channel->offer_msg.child_rel_id; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 07:01:32 2016 (r300126) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 07:09:44 2016 (r300127) @@ -346,7 +346,8 @@ hv_vmbus_child_device_unregister(struct } static int -vmbus_probe(device_t dev) { +vmbus_probe(device_t dev) +{ if (ACPI_ID_PROBE(device_get_parent(dev), dev, vmbus_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); From owner-svn-src-all@freebsd.org Wed May 18 07:17:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12388B40F85; Wed, 18 May 2016 07:17:32 +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 D79561839; Wed, 18 May 2016 07:17:31 +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 u4I7HVmD073598; Wed, 18 May 2016 07:17:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I7HVvK073597; Wed, 18 May 2016 07:17:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605180717.u4I7HVvK073597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 18 May 2016 07:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300128 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 07:17:32 -0000 Author: adrian Date: Wed May 18 07:17:30 2016 New Revision: 300128 URL: https://svnweb.freebsd.org/changeset/base/300128 Log: [siba] fix incorrect SPROM offsets. All my fault. Modified: head/sys/dev/siba/sibareg.h Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Wed May 18 07:09:44 2016 (r300127) +++ head/sys/dev/siba/sibareg.h Wed May 18 07:17:30 2016 (r300128) @@ -520,10 +520,10 @@ #define SIBA_SPROM8_OFDM5GPO 0x1146 #define SIBA_SPROM8_OFDM5GLPO 0x114a #define SIBA_SPROM8_OFDM5GHPO 0x114e -#define SIBA_SPROM8_CDDPO 0x0192 -#define SIBA_SPROM8_STBCPO 0x0194 -#define SIBA_SPROM8_BW40PO 0x0196 -#define SIBA_SPROM8_BWDUPPO 0x0198 +#define SIBA_SPROM8_CDDPO 0x1192 +#define SIBA_SPROM8_STBCPO 0x1194 +#define SIBA_SPROM8_BW40PO 0x1196 +#define SIBA_SPROM8_BWDUPPO 0x1198 /* There are 4 blocks with power info sharing the same layout */ #define SIBA_SROM8_PWR_INFO_CORE0 0x10C0 From owner-svn-src-all@freebsd.org Wed May 18 07:18:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3113BB40001; Wed, 18 May 2016 07:18:13 +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 F32F31A0C; Wed, 18 May 2016 07:18:12 +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 u4I7ICkJ073666; Wed, 18 May 2016 07:18:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I7ICcF073665; Wed, 18 May 2016 07:18:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605180718.u4I7ICcF073665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 18 May 2016 07:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300129 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 07:18:13 -0000 Author: sephe Date: Wed May 18 07:18:11 2016 New Revision: 300129 URL: https://svnweb.freebsd.org/changeset/base/300129 Log: hyperv/vmbus: Use consistent device description as other devices MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6418 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 07:17:30 2016 (r300128) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 18 07:18:11 2016 (r300129) @@ -352,7 +352,7 @@ vmbus_probe(device_t dev) device_get_unit(dev) != 0) return (ENXIO); - device_set_desc(dev, "Vmbus Devices"); + device_set_desc(dev, "Hyper-V Vmbus"); return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@freebsd.org Wed May 18 08:02:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E30EB40954; Wed, 18 May 2016 08:02:50 +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 41BFD1B1A; Wed, 18 May 2016 08:02:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I82nMt088840; Wed, 18 May 2016 08:02:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I82nT5088839; Wed, 18 May 2016 08:02:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605180802.u4I82nT5088839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 May 2016 08:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300130 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 08:02:50 -0000 Author: avg Date: Wed May 18 08:02:49 2016 New Revision: 300130 URL: https://svnweb.freebsd.org/changeset/base/300130 Log: zfsctl_freebsd_root_lookup: gfs_vop_lookup may return a doomed vnode gfs code is (almsot) completely agnostic of FreeBSD VFS locking, so it does not handle doomed but not yet dead vnodes and may return them. Check for those vnodes here and retry a lookup. Note that ZFS and gfs have additional protections that ensure that a parent vnode of the current vnode is never doomed. The fixed problem is an occasional failure to lookup a 'snapshot' or 'shares' directories under .zfs. Note that for the above reason all uses of zfsctl_root_lookup() are better be replaced with VOP_LOOKUP. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 07:18:11 2016 (r300129) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 08:02:49 2016 (r300130) @@ -603,19 +603,25 @@ zfsctl_freebsd_root_lookup(ap) ASSERT(ap->a_cnp->cn_namelen < sizeof(nm)); strlcpy(nm, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen + 1); +relookup: err = zfsctl_root_lookup(dvp, nm, vpp, NULL, 0, NULL, cr, NULL, NULL, NULL); if (err == 0 && (nm[0] != '.' || nm[1] != '\0')) { - if (flags & ISDOTDOT) + if (flags & ISDOTDOT) { VOP_UNLOCK(dvp, 0); - err = vn_lock(*vpp, lkflags); - if (err != 0) { - vrele(*vpp); - *vpp = NULL; - } - if (flags & ISDOTDOT) + err = vn_lock(*vpp, lkflags); + if (err != 0) { + vrele(*vpp); + *vpp = NULL; + } vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + } else { + err = vn_lock(*vpp, LK_EXCLUSIVE); + if (err != 0) { + VERIFY3S(err, ==, ENOENT); + goto relookup; + } + } } - return (err); } From owner-svn-src-all@freebsd.org Wed May 18 08:19:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF0EB40D2B; Wed, 18 May 2016 08:19:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511B11118; Wed, 18 May 2016 08:19:42 +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 u4I8JfRa092008; Wed, 18 May 2016 08:19:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I8Jfk0092007; Wed, 18 May 2016 08:19:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605180819.u4I8Jfk0092007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 May 2016 08:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300131 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 08:19:42 -0000 Author: avg Date: Wed May 18 08:19:41 2016 New Revision: 300131 URL: https://svnweb.freebsd.org/changeset/base/300131 Log: zfs_root: no need to set the root flag here That was both redundant as zfs_znode_sa_init() already does the job and insufficient as the root vnode can be reached via other means. MFC after: 1 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed May 18 08:02:49 2016 (r300130) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed May 18 08:19:41 2016 (r300131) @@ -1780,11 +1780,8 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t ZFS_EXIT(zfsvfs); - if (error == 0) { + if (error == 0) error = vn_lock(*vpp, flags); - if (error == 0) - (*vpp)->v_vflag |= VV_ROOT; - } if (error != 0) *vpp = NULL; From owner-svn-src-all@freebsd.org Wed May 18 08:23:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 646FFB40F51; Wed, 18 May 2016 08:23:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31A86172D; Wed, 18 May 2016 08:23:40 +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 u4I8NdUd094786; Wed, 18 May 2016 08:23:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I8Ndsx094784; Wed, 18 May 2016 08:23:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605180823.u4I8Ndsx094784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 May 2016 08:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300132 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 08:23:40 -0000 Author: avg Date: Wed May 18 08:23:39 2016 New Revision: 300132 URL: https://svnweb.freebsd.org/changeset/base/300132 Log: zfsctl: tighten an assertion and remove an unused definition There are only two entries under .zfs and 'shares' has an ID of a special persistent object in its filesystem. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h Wed May 18 08:19:41 2016 (r300131) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h Wed May 18 08:23:39 2016 (r300132) @@ -61,7 +61,6 @@ int zfsctl_lookup_objset(vfs_t *vfsp, ui #define ZFSCTL_INO_ROOT 0x1 #define ZFSCTL_INO_SNAPDIR 0x2 -#define ZFSCTL_INO_SHARES 0x3 #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 08:19:41 2016 (r300131) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 08:23:39 2016 (r300132) @@ -223,7 +223,7 @@ zfsctl_root_inode_cb(vnode_t *vp, int in { zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data; - ASSERT(index <= 2); + ASSERT(index < 2); if (index == 0) return (ZFSCTL_INO_SNAPDIR); From owner-svn-src-all@freebsd.org Wed May 18 08:26:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3FADB3F13E; Wed, 18 May 2016 08:26:10 +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 A4D981BAF; Wed, 18 May 2016 08:26:10 +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 u4I8Q9ET094914; Wed, 18 May 2016 08:26:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I8Q9OV094913; Wed, 18 May 2016 08:26:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605180826.u4I8Q9OV094913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 May 2016 08:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300133 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 08:26:10 -0000 Author: avg Date: Wed May 18 08:26:09 2016 New Revision: 300133 URL: https://svnweb.freebsd.org/changeset/base/300133 Log: zfsctl_common_fid: remove redundant assignment "Reinterpret cast" to zfid_short_t and assignment of zf_len do the job already. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 08:23:39 2016 (r300132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 08:26:09 2016 (r300133) @@ -404,8 +404,6 @@ zfsctl_common_fid(ap) ZFS_EXIT(zfsvfs); return (SET_ERROR(ENOSPC)); } -#else - fidp->fid_len = SHORT_FID_LEN; #endif zfid = (zfid_short_t *)fidp; From owner-svn-src-all@freebsd.org Wed May 18 08:29:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46D05B3F292; Wed, 18 May 2016 08:29:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22A2C1E2C; Wed, 18 May 2016 08:29:40 +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 u4I8Tdx5095064; Wed, 18 May 2016 08:29:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I8Td9H095063; Wed, 18 May 2016 08:29:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605180829.u4I8Td9H095063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 May 2016 08:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300134 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 08:29:40 -0000 Author: avg Date: Wed May 18 08:29:39 2016 New Revision: 300134 URL: https://svnweb.freebsd.org/changeset/base/300134 Log: move zfsctl_freebsd_root_lookup right next to zfsctl_root_lookup That makes it easier to reason about the code. MFC after: 5 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 08:26:09 2016 (r300133) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 08:29:39 2016 (r300134) @@ -540,46 +540,7 @@ zfsctl_root_lookup(vnode_t *dvp, char *n return (err); } -#ifdef illumos static int -zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr, - caller_context_t *ct) -{ - /* - * We only care about ACL_ENABLED so that libsec can - * display ACL correctly and not default to POSIX draft. - */ - if (cmd == _PC_ACL_ENABLED) { - *valp = _ACL_ACE_ENABLED; - return (0); - } - - return (fs_pathconf(vp, cmd, valp, cr, ct)); -} -#endif /* illumos */ - -#ifdef illumos -static const fs_operation_def_t zfsctl_tops_root[] = { - { VOPNAME_OPEN, { .vop_open = zfsctl_common_open } }, - { VOPNAME_CLOSE, { .vop_close = zfsctl_common_close } }, - { VOPNAME_IOCTL, { .error = fs_inval } }, - { VOPNAME_GETATTR, { .vop_getattr = zfsctl_root_getattr } }, - { VOPNAME_ACCESS, { .vop_access = zfsctl_common_access } }, - { VOPNAME_READDIR, { .vop_readdir = gfs_vop_readdir } }, - { VOPNAME_LOOKUP, { .vop_lookup = zfsctl_root_lookup } }, - { VOPNAME_SEEK, { .vop_seek = fs_seek } }, - { VOPNAME_INACTIVE, { .vop_inactive = gfs_vop_inactive } }, - { VOPNAME_PATHCONF, { .vop_pathconf = zfsctl_pathconf } }, - { VOPNAME_FID, { .vop_fid = zfsctl_common_fid } }, - { NULL } -}; -#endif /* illumos */ - -/* - * Special case the handling of "..". - */ -/* ARGSUSED */ -int zfsctl_freebsd_root_lookup(ap) struct vop_lookup_args /* { struct vnode *a_dvp; @@ -623,6 +584,41 @@ relookup: return (err); } +#ifdef illumos +static int +zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr, + caller_context_t *ct) +{ + /* + * We only care about ACL_ENABLED so that libsec can + * display ACL correctly and not default to POSIX draft. + */ + if (cmd == _PC_ACL_ENABLED) { + *valp = _ACL_ACE_ENABLED; + return (0); + } + + return (fs_pathconf(vp, cmd, valp, cr, ct)); +} +#endif /* illumos */ + +#ifdef illumos +static const fs_operation_def_t zfsctl_tops_root[] = { + { VOPNAME_OPEN, { .vop_open = zfsctl_common_open } }, + { VOPNAME_CLOSE, { .vop_close = zfsctl_common_close } }, + { VOPNAME_IOCTL, { .error = fs_inval } }, + { VOPNAME_GETATTR, { .vop_getattr = zfsctl_root_getattr } }, + { VOPNAME_ACCESS, { .vop_access = zfsctl_common_access } }, + { VOPNAME_READDIR, { .vop_readdir = gfs_vop_readdir } }, + { VOPNAME_LOOKUP, { .vop_lookup = zfsctl_root_lookup } }, + { VOPNAME_SEEK, { .vop_seek = fs_seek } }, + { VOPNAME_INACTIVE, { .vop_inactive = gfs_vop_inactive } }, + { VOPNAME_PATHCONF, { .vop_pathconf = zfsctl_pathconf } }, + { VOPNAME_FID, { .vop_fid = zfsctl_common_fid } }, + { NULL } +}; +#endif /* illumos */ + static struct vop_vector zfsctl_ops_root = { .vop_default = &default_vnodeops, .vop_open = zfsctl_common_open, From owner-svn-src-all@freebsd.org Wed May 18 09:56:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D2DB3E2C8; Wed, 18 May 2016 09:56:44 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::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 BDC251B71; Wed, 18 May 2016 09:56:43 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id r12so11444034wme.0; Wed, 18 May 2016 02:56:43 -0700 (PDT) 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=n+bKjHvNfBsAR52qQoWih8gdjH/dU31uGkcEwTS+HH0=; b=z19y/melY9OgTt7a5+QOkwkxAVdcHkFeH/j2Rp5M2pdSa0yFJm022ejx08Ii6xhq7N tTw4u8MInZkDHXBVtDu7j7v29Nx7thxnWDs4myhSEonJal77SN+leoxAxhgh7amANOA2 V2BZtC99WO4ytH07mE0i5vcL/Wa7qMYg6chM4x9uommruc76yQZ3kst1DP+FTbFxl+q6 rvrR8QusLQMUuX/TvzsYcfAMxDlbyEczoHDOgnq3OCQZR0IN8ehfnPuLGN+Tk5osTnzK vBQuOtwTR7mq1q28HMftEB9dKXTl9BiRnbQ+lTKduaOp+BvhMX3kfNRhzcRXVdV0N0uv 97wQ== 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=n+bKjHvNfBsAR52qQoWih8gdjH/dU31uGkcEwTS+HH0=; b=MkT//XTVZwG/1BLTicYyWNE/AdviYiIk4UTqYHM7H//xgtVVt2jdMEfKG694e76IHU NB6KPHudWfH3M51QVTRoEK43HJW9WqwA+q0XaqW4LrcHmr7cZ3+9HFyyUFRPrLnG4vo6 MAr+hfQOK9esYMxT3dystVLAWDYmNS3oLjLnmcClvl4Wv1xfSSghq704ieDkkWfcJT01 3UjaPETIFgAJB+0uSRcmW87fplCZLRF2t/ifVPiDQn7UUasdUv7iuuu/UBrxWdNEBqpx zw/RLLRgCpvWZRj0PT3cGpyRSsTbAvjYN4LaIrwU3s6yrrgZU3Od0nioCgTWB52m6kzC cZoA== X-Gm-Message-State: AOPr4FUleySN1xvqs/u0Pcmy9qx2KNsBYxVKtt4/F1xF+fZq6tDXLGGFqaNIrKPJwJ0Rzg== X-Received: by 10.194.23.162 with SMTP id n2mr6251595wjf.108.1463565401449; Wed, 18 May 2016 02:56:41 -0700 (PDT) Received: from brick (abpx124.neoplus.adsl.tpnet.pl. [83.8.65.124]) by smtp.gmail.com with ESMTPSA id i1sm7757485wjm.12.2016.05.18.02.56.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2016 02:56:40 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 18 May 2016 11:56:37 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Warner Losh Cc: Alan Somers , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Kenneth D. Merry" Subject: Re: svn commit: r299371 - in head: sbin/camcontrol sys/cam sys/cam/scsi Message-ID: <20160518095637.GA3536@brick> Mail-Followup-To: Warner Losh , Alan Somers , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Kenneth D. Merry" References: <201605101546.u4AFkX0w073701@repo.freebsd.org> <20160510173351.GA4176@brick> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 09:56:44 -0000 On 0517T1158, Warner Losh wrote: > On Tue, May 10, 2016 at 11:33 AM, Edward Tomasz Napierala > wrote: > > > On 0510T1020, Alan Somers wrote: > > > On Tue, May 10, 2016 at 9:46 AM, Edward Tomasz Napierala < > > trasz@freebsd.org> > > > wrote: > > > > > > > Author: trasz > > > > Date: Tue May 10 15:46:33 2016 > > > > New Revision: 299371 > > > > URL: https://svnweb.freebsd.org/changeset/base/299371 > > > > > > > > Log: > > > > Add "camcontrol reprobe" subcommand, and implement it for da(4). > > > > This makes it possible to manually force updating capacity data > > > > after the disk got resized. Without it it might be neccessary to > > > > reboot before FreeBSD notices updated disk size under eg VMWare. > > > > > > > > Discussed with: imp@ > > > > MFC after: 1 month > > > > Sponsored by: The FreeBSD Foundation > > > > Differential Revision: https://reviews.freebsd.org/D6108 > > > > > > > > Modified: > > > > head/sbin/camcontrol/camcontrol.8 > > > > head/sbin/camcontrol/camcontrol.c > > > > head/sys/cam/cam_ccb.h > > > > head/sys/cam/cam_xpt.c > > > > head/sys/cam/scsi/scsi_da.c > > > > > > > > > > > > > > I too have been annoyed that "camcontrol rescan" won't update capacity > > > data. But could we solve the problem by simply adding logic to > > "camcontrol > > > rescan" instead of adding an entirely new command? Would a user ever > > want > > > to rescan a device without reprobing it too? > > > > Two reasons. First, I want to be able to pass the device name (like > > 'da0') and not the CAM path (like 1:0:0) for usability reasons - it seems > > easy to figure out the latter from the former, using "camcontrol devlist", > > but it suddenly becomes complicated when you try to explain it in a man > > page. > > > You can look up one or the other. fwdownload uses the daX name. Indeed. But it would mean fixing "camcontrol rescan" first. > > Second - I don't understand the "camcontrol rescan" logic well > > enough, and "camcontrol rescan all" sometimes fails for me anyway, > > in a way I'm not sure how to debug. > > > > That's a cop-out. CAM is hard, but if you aren't willing to figure itout, > adding hacks that the other CAM maintainers have to cope with doesn't > help. That's true. However, this hack is pretty non-intrusive - it only adds a trivial amount of code, and the "reprobe" command could be replaced with a simple alias to "rescan" if someone steps up to reimplement it. > Also, to be honest I'm not sure those two are actually that related. > > Rescanning is about discovering new devices on the bus. "Reprobe" > > is about updating... well, mostly updating the capacity. The former > > requires enumerating the bus using a mechanism built into XPT; the > > latter is just notifying the periph driver (in this case da(4)) that > > it needs to query the capacity and call disk_resize(4). > > > > The two are very related. Now we have two stupid paths in CAM instead of > one. We have two clearly separated code paths, doing completely different things - one scanning the bus, and only notifying periph drivers if new device is discovered, and the other one to notify existing periph driver instances, without scanning anything. I just don't see how entangling them with each other would improve things. > and you didn't do ada like I asked. As I said in review, the ada(4) driver seems to lack resizing capability. It doesn't contain a call to disk_resize(9). It's been a few years since I've added resizing to da(4), but it took quite some time to make sure it interfaces with existing code in exactly the right way. I just don't have time for this kind of side quest right now. And I'm not even sure how to test it. With da(4) it was easy - I've just added LUN resizing to CTL. > Not happy with this at all, but not asking for a back out. Thanks. From owner-svn-src-all@freebsd.org Wed May 18 09:57:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B534EB3E31D; Wed, 18 May 2016 09:57:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8261A1D1D; Wed, 18 May 2016 09:57:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4I9vBT4022241; Wed, 18 May 2016 09:57:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I9vBHp022240; Wed, 18 May 2016 09:57:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605180957.u4I9vBHp022240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 18 May 2016 09:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300135 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 09:57:12 -0000 Author: arybchik Date: Wed May 18 09:57:11 2016 New Revision: 300135 URL: https://svnweb.freebsd.org/changeset/base/300135 Log: sfxge(4): cleanup: remove trailing whitespaces Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Wed May 18 08:29:39 2016 (r300134) +++ head/sys/dev/sfxge/sfxge_rx.c Wed May 18 09:57:11 2016 (r300135) @@ -833,7 +833,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq if (rx_desc->flags & EFX_PKT_PREFIX_LEN) { uint16_t tmp_size; int rc; - rc = efx_psuedo_hdr_pkt_length_get(sc->enp, + rc = efx_psuedo_hdr_pkt_length_get(sc->enp, mtod(m, uint8_t *), &tmp_size); KASSERT(rc == 0, ("cannot get packet length: %d", rc)); @@ -1100,7 +1100,7 @@ sfxge_rx_start(struct sfxge_softc *sc) EFSYS_ASSERT(ISP2(align)); sc->rx_buffer_size = P2ROUNDUP(sc->rx_buffer_size, align); - /* + /* * Standard mbuf zones only guarantee pointer-size alignment; * we need extra space to align to the cache line */ From owner-svn-src-all@freebsd.org Wed May 18 10:03:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58E84B3E78F for ; Wed, 18 May 2016 10:03:18 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lb0-x22d.google.com (mail-lb0-x22d.google.com [IPv6:2a00:1450:4010:c04::22d]) (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 AE9951238 for ; Wed, 18 May 2016 10:03:17 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lb0-x22d.google.com with SMTP id jj5so15539828lbc.0 for ; Wed, 18 May 2016 03:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/5edjcFC3QyOU2WIGx8t8JDGX2AnNQCpXS+Vi86ApsM=; b=fZ4mgkTzFjCPORYWJU5cyLFB4Y5VuK6ir5fH1lWeDcblqmSQE09IB91JRDQvfKeAFZ iZMbjbJT3orz8FGXgh+r4CZtwxCtlMnkIBF5D4F4opP/jXmDXCnuVDCPPczalnW74Wbx +I44BLb78d1nC+V1583XqT1QGa2Ebx9NgqrgwTMgBJ1nrsn9VJfFuXwwpN9lvgWYk8as k6oWXEdIiJ9yY8n31MtD0UWC1Yc6pKL5G0Ax7qZi55hGMstJlnCEAon6xlJJ5hbqjFcp TRci1n5S1LihJVKL+GNjUzkom/aKz00z3c4saYzyAEaRVW7Pz87wQUpBTduxmOXjd1tV qXsQ== 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=/5edjcFC3QyOU2WIGx8t8JDGX2AnNQCpXS+Vi86ApsM=; b=aCabLS1yNvKDM372muSTQnA/j4lx1fTLKG+rDCogk4qhbKxz3Xj3PYQ0WAbr5vS4tS F2u1chopfOPp5DdBdqozyGG7yPeDq9W+g5eCIC/XABuP4RmklLzqAq622zVjmx3QON1s aKCVR1yGHJnO88W/0QdLWONUGZsnIwJ0VNk8+ZQgmYtlPFlMBmE8DLKAJS37MC2AUsY2 zkG2IMax/WymKy9csqaWhfE82xNBL9+E9/OwhTS4jIrMF/kKRwbQhWhly1AeKZKe+++H nbLtOddPAkm4N3h1G6HPPDknBe/U81ZNNUZ5y+aTHW+77gqCUHYeSKvy2RFjKAMWP118 tiXg== X-Gm-Message-State: AOPr4FXonn8znWrfPeUBlVobvZY1PVisTZLVhpNwfYC0NVMymriDntuaO+98ZHW1dsQtjAbK3S/8CZDwWk1xTw== X-Received: by 10.112.58.232 with SMTP id u8mr1664474lbq.42.1463565795590; Wed, 18 May 2016 03:03:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.68 with HTTP; Wed, 18 May 2016 03:02:55 -0700 (PDT) In-Reply-To: <20160517131945.65cd9ccc@zapp> References: <201605161407.u4GE7h9n002600@repo.freebsd.org> <20160517131945.65cd9ccc@zapp> From: Zbigniew Bodek Date: Wed, 18 May 2016 12:02:55 +0200 Message-ID: Subject: Re: svn commit: r299944 - in head/sys: arm64/arm64 conf To: Andrew Turner Cc: Andrew Turner , 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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 10:03:18 -0000 Hello Andrew, Thanks for the comments. Please check in-line below. Kind regards zbb 2016-05-17 14:19 GMT+02:00 Andrew Turner : > On Mon, 16 May 2016 18:08:49 +0200 > Zbigniew Bodek wrote: > > > Hello Andrew, > > > > I think committing this code should be preceded by at least brief > > review. Few remarks to the code found on the first glance below. > > See below for comments. > > > > > Kind regards > > zbb > > > > 2016-05-16 16:07 GMT+02:00 Andrew Turner : > > > > > Author: andrew > > > Date: Mon May 16 14:07:43 2016 > > > New Revision: 299944 > > > URL: https://svnweb.freebsd.org/changeset/base/299944 > > > > > > Log: > > > Add intrng support to the GICv3 driver. It lacks ITS support so > > > won't handle > > > MSI or MSI-X interrupts, however this is enought to boot FreeBSD > > > under the > > > ARM Foundation Model with a GICv3 interrupt controller. > > > > > > Approved by: ABT Systems Ltd > > > Relnotes: yes > > > Sponsored by: The FreeBSD Foundation > ... > > > +#ifdef INTRNG > > > +int > > > +arm_gic_v3_intr(void *arg) > > > +{ > > > + struct gic_v3_softc *sc = arg; > > > + struct gic_v3_irqsrc *gi; > > > + uint64_t active_irq; > > > + struct trapframe *tf; > > > + bool first; > > > + > > > + first = true; > > > + > > > + while (1) { > > > + if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) { > > > + /* > > > + * Hardware: Cavium ThunderX > > > + * Chip revision: Pass 1.0 (early > > > version) > > > + * Pass 1.1 > > > (production) > > > + * ERRATUM: 22978, 23154 > > > + */ > > > + __asm __volatile( > > > + "nop;nop;nop;nop;nop;nop;nop;nop; \n" > > > + "mrs %0, ICC_IAR1_EL1 \n" > > > + "nop;nop;nop;nop; \n" > > > + "dsb sy \n" > > > + : "=&r" (active_irq)); > > > + } else { > > > + active_irq = gic_icc_read(IAR1); > > > + } > > > + > > > + if (__predict_false(active_irq >= sc->gic_nirqs)) > > > + return (FILTER_HANDLED); > > > > > > > IMHO this is not true. Active IRQ could be much bigger than number of > > supported IRQs. We are asking for debugging in the future when we > > enable ITS. > > It is correct, the ITS change to this file is missing so we are unable > to enable ITS interrupts. > > In general it is not correct in terms of GICv3 but in that particular case. So it would be good to have a "ARM64TODO" comment here. > ... > > > + > > > +#ifdef FDT > > > +static int > > > +gic_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int > > > *irqp, > > > + enum intr_polarity *polp, enum intr_trigger *trigp) > > > > > > > All other functions are called gic_v3 and this one is just gic_ > > Why can't we move as much FDT code to the dedicated file which is > > gic_v3_fdt.c? > > Unfortunately due to the current code in subr_intr.c this is needed for > simplicity. It it my understanding there is work to fix this, so for > now I would prefer to keep this. > OK. > > ... > > > + /* Set the trigger and polarity */ > > > + if (irq <= GIC_LAST_PPI) > > > + reg = gic_r_read(sc, 4, > > > + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq)); > > > + else > > > + reg = gic_d_read(sc, 4, GICD_ICFGR(irq)); > > > + if (trig == INTR_TRIGGER_LEVEL) > > > + reg &= ~(2 << ((irq % 16) * 2)); > > > + else > > > + reg |= 2 << ((irq % 16) * 2); > > > > > > > The rule of not using magic numbers does not apply here ;-) ? > > This is partially why this is still disabled by default, the code still > needs a little polish, however it will be needed to help with a future > review for changes to subr_intr.c. > So why do we integrate this WIP code now? Is there anyone else using INTRNG on ARM64 beside you who need to test it? I guess this is a matter of opinion but it would be much more convenient (at least for us) if we get INTRNG in a single patch, review it, test it and then change the existing code. > ... > > > +static void > > > +gic_v3_disable_intr(device_t dev, struct intr_irqsrc *isrc) > > > +{ > > > + struct gic_v3_softc *sc; > > > + struct gic_v3_irqsrc *gi; > > > + u_int irq; > > > + > > > + sc = device_get_softc(dev); > > > + gi = (struct gic_v3_irqsrc *)isrc; > > > + irq = gi->gi_irq; > > > + > > > + if (irq <= GIC_LAST_PPI) { > > > + /* SGIs and PPIs in corresponding Re-Distributor */ > BTW. Apart from the panic string changed the comments are moved a line below. > > > + gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + > > > GICD_ICENABLER(irq), > > > + GICD_I_MASK(irq)); > > > + gic_v3_wait_for_rwp(sc, REDIST); > > > + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { > > > + /* SPIs in distributor */ > > > + gic_d_write(sc, 4, GICD_ICENABLER(irq), > > > GICD_I_MASK(irq)); > > > + gic_v3_wait_for_rwp(sc, DIST); > > > > > > > In gic_v3_setup_intr() we need spin lock and here we don't ? > > The locking was based on the existing intrng gic driver, I think they > are both bogus. > I also think they are unnecessary so it would be good to remove them from here. > > ... > > > > +static void > > > +gic_v3_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t > > > cpus, > > > + u_int ipi) > > > > > > > What exactly is the functional difference between the current > > implementation and this one? > > Maybe we should exchange an old one to this or the opposite way > > instead of having two different implementations? > > This one only needs to loop through the list of cpus once. In the > common case I would expect this to be optimal as FreeBSD cpuids will > align with the hardware clusters so a contiguous groups of CPUs will be > on a single cluster. The only hardware I know where this isn't the case > is the ARM Juno where we boot on hardware CPU 2. > OK. So this could be used instead of the current implementation and when we have INTRNG ready the diff would be smaller to apply. > > > > > > > +{ > > > + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; > > > + uint64_t aff, val, irq; > > > + int i; > > > + > > > +#define GIC_AFF_MASK (CPU_AFF3_MASK | CPU_AFF2_MASK | > > > CPU_AFF1_MASK) > > > +#define GIC_AFFINITY(i) (CPU_AFFINITY(i) & GIC_AFF_MASK) > > > + aff = GIC_AFFINITY(0); > > > + irq = gi->gi_irq; > > > + val = 0; > > > + > > > + /* Iterate through all CPUs in set */ > > > + for (i = 0; i < mp_ncpus; i++) { > > > + /* Move to the next affinity group */ > > > + if (aff != GIC_AFFINITY(i)) { > > > + /* Send the IPI */ > > > + if (val != 0) { > > > + gic_icc_write(SGI1R, val); > > > + val = 0; > > > + } > > > + aff = GIC_AFFINITY(i); > > > + } > > > + > > > + /* Send the IPI to this cpu */ > > > + if (CPU_ISSET(i, &cpus)) { > > > +#define > > > ICC_SGI1R_AFFINITY(aff) \ > > > + (((uint64_t)CPU_AFF3(aff) << ICC_SGI1R_EL1_AFF3_SHIFT) | \ > > > + ((uint64_t)CPU_AFF2(aff) << ICC_SGI1R_EL1_AFF2_SHIFT) | \ > > > + ((uint64_t)CPU_AFF1(aff) << ICC_SGI1R_EL1_AFF1_SHIFT)) > > > + /* Set the affinity when the first at this > > > level */ > > > + if (val == 0) > > > + val = ICC_SGI1R_AFFINITY(aff) | > > > + irq << > > > ICC_SGI1R_EL1_SGIID_SHIFT; > > > + /* Set the bit to send the IPI to te CPU */ > > > + val |= 1 << CPU_AFF0(CPU_AFFINITY(i)); > > > + } > > > + } > > > + > > > + /* Send the IPI to the last cpu affinity group */ > > > + if (val != 0) > > > + gic_icc_write(SGI1R, val); > > > +#undef GIC_AFF_MASK > > > +#undef GIC_AFFINITY > > > > > > > Couldn't we just use variables instead of defining and undefinining > > those ugly macros here? > > It really looks like they are here just to look different than it was > > in the previous implementation. > > What's ugly about them? They never change so I'm unsure why a variable > is needed. > Again, this is matter of opinion but defining two macros, one of which is 4 lines in length just to use them the line below and undefine is less readable than just doing what that macro does on a variable. The only gain here is that it is different than what was already done. > > Andrew > From owner-svn-src-all@freebsd.org Wed May 18 10:09:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79BBCB3E8E5; Wed, 18 May 2016 10:09:08 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55D5714D2; Wed, 18 May 2016 10:09:08 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IA97HP025265; Wed, 18 May 2016 10:09:07 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IA97mO025263; Wed, 18 May 2016 10:09:07 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605181009.u4IA97mO025263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 18 May 2016 10:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300136 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 10:09:08 -0000 Author: zbb Date: Wed May 18 10:09:07 2016 New Revision: 300136 URL: https://svnweb.freebsd.org/changeset/base/300136 Log: Add support for MSI/MSIX deallocation on GICv3-ITS Allow to deallocate previously allocated ITS device along with its interrupts. Interrupt numbers are being freed when the last LPI number is no longer busy. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6351 Modified: head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_var.h Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Wed May 18 09:57:11 2016 (r300135) +++ head/sys/arm64/arm64/gic_v3_its.c Wed May 18 10:09:07 2016 (r300136) @@ -75,8 +75,10 @@ static device_method_t gic_v3_its_method */ /* MSI-X */ DEVMETHOD(pic_alloc_msix, gic_v3_its_alloc_msix), + DEVMETHOD(pic_release_msix, gic_v3_its_release_msix), /* MSI */ DEVMETHOD(pic_alloc_msi, gic_v3_its_alloc_msi), + DEVMETHOD(pic_release_msi, gic_v3_its_release_msi), DEVMETHOD(pic_map_msi, gic_v3_its_map_msi), /* End */ @@ -882,6 +884,7 @@ retry: bit_nset(bitmap, fclr, fclr + nvecs - 1); lpic->lpi_base = fclr + GIC_FIRST_LPI; lpic->lpi_num = nvecs; + lpic->lpi_busy = 0; lpic->lpi_free = lpic->lpi_num; lpic->lpi_col_ids = col_ids; for (i = 0; i < lpic->lpi_num; i++) { @@ -901,10 +904,9 @@ lpi_free_chunk(struct gic_v3_its_softc * { int start, end; - KASSERT((lpic->lpi_free == lpic->lpi_num), - ("Trying to free LPI chunk that is still in use.\n")); - mtx_lock_spin(&sc->its_dev_lock); + KASSERT((lpic->lpi_busy == 0), + ("Trying to free LPI chunk that is still in use.\n")); /* First bit of this chunk in a global bitmap */ start = lpic->lpi_base - GIC_FIRST_LPI; /* and last bit of this chunk... */ @@ -1493,6 +1495,7 @@ its_device_alloc(struct gic_v3_its_softc u_int nvecs) { struct its_dev *newdev; + vm_offset_t itt_addr; uint64_t typer; uint32_t devid; size_t esize; @@ -1528,16 +1531,18 @@ its_device_alloc(struct gic_v3_its_softc * Allocate ITT for this device. * PA has to be 256 B aligned. At least two entries for device. */ - newdev->itt = (vm_offset_t)contigmalloc( - roundup2(roundup2(nvecs, 2) * esize, 0x100), M_GIC_V3_ITS, - (M_NOWAIT | M_ZERO), 0, ~0UL, 0x100, 0); - if (newdev->itt == 0) { + newdev->itt_size = roundup2(roundup2(nvecs, 2) * esize, 0x100); + itt_addr = (vm_offset_t)contigmalloc( + newdev->itt_size, M_GIC_V3_ITS, (M_NOWAIT | M_ZERO), + 0, ~0UL, 0x100, 0); + if (itt_addr == 0) { lpi_free_chunk(sc, &newdev->lpis); free(newdev, M_GIC_V3_ITS); return (NULL); } mtx_lock_spin(&sc->its_dev_lock); + newdev->itt = itt_addr; TAILQ_INSERT_TAIL(&sc->its_dev_list, newdev, entry); mtx_unlock_spin(&sc->its_dev_lock); @@ -1547,6 +1552,50 @@ its_device_alloc(struct gic_v3_its_softc return (newdev); } +static void +its_device_free(struct gic_v3_its_softc *sc, device_t pci_dev, + u_int nvecs) +{ + struct its_dev *odev; + + mtx_lock_spin(&sc->its_dev_lock); + /* Find existing device if any */ + odev = its_device_find_locked(sc, pci_dev, 0); + if (odev == NULL) { + mtx_unlock_spin(&sc->its_dev_lock); + return; + } + + KASSERT((nvecs <= odev->lpis.lpi_num) && (nvecs <= odev->lpis.lpi_busy), + ("Invalid number of LPI vectors to free %d (total %d) (busy %d)", + nvecs, odev->lpis.lpi_num, odev->lpis.lpi_busy)); + /* Just decrement number of busy LPIs in chunk */ + odev->lpis.lpi_busy -= nvecs; + if (odev->lpis.lpi_busy != 0) { + mtx_unlock_spin(&sc->its_dev_lock); + return; + } + + /* + * At that point we know that there are no busy LPIs for this device. + * Entire ITS device can now be removed. + */ + mtx_unlock_spin(&sc->its_dev_lock); + /* Unmap device in ITS */ + its_cmd_mapd(sc, odev, 0); + /* Free ITT */ + KASSERT(odev->itt != 0, ("Invalid ITT in valid ITS device")); + contigfree((void *)odev->itt, odev->itt_size, M_GIC_V3_ITS); + /* Free chunk */ + lpi_free_chunk(sc, &odev->lpis); + /* Free device */ + mtx_lock_spin(&sc->its_dev_lock); + TAILQ_REMOVE(&sc->its_dev_list, odev, entry); + mtx_unlock_spin(&sc->its_dev_lock); + free((void *)odev, M_GIC_V3_ITS); + +} + static __inline void its_device_asign_lpi_locked(struct gic_v3_its_softc *sc, struct its_dev *its_dev, u_int *irq) @@ -1561,6 +1610,7 @@ its_device_asign_lpi_locked(struct gic_v *irq = its_dev->lpis.lpi_base + (its_dev->lpis.lpi_num - its_dev->lpis.lpi_free); its_dev->lpis.lpi_free--; + its_dev->lpis.lpi_busy++; } /* @@ -1678,6 +1728,18 @@ gic_v3_its_alloc_msix(device_t dev, devi } int +gic_v3_its_release_msix(device_t dev, device_t pci_dev, int irq __unused) +{ + + struct gic_v3_its_softc *sc; + + sc = device_get_softc(dev); + its_device_free(sc, pci_dev, 1); + + return (0); +} + +int gic_v3_its_alloc_msi(device_t dev, device_t pci_dev, int count, int *irqs) { struct gic_v3_its_softc *sc; @@ -1701,6 +1763,18 @@ gic_v3_its_alloc_msi(device_t dev, devic } int +gic_v3_its_release_msi(device_t dev, device_t pci_dev, int count, + int *irqs __unused) +{ + struct gic_v3_its_softc *sc; + + sc = device_get_softc(dev); + its_device_free(sc, pci_dev, count); + + return (0); +} + +int gic_v3_its_map_msi(device_t dev, device_t pci_dev, int irq, uint64_t *addr, uint32_t *data) { Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Wed May 18 09:57:11 2016 (r300135) +++ head/sys/arm64/arm64/gic_v3_var.h Wed May 18 10:09:07 2016 (r300136) @@ -112,9 +112,11 @@ DECLARE_CLASS(gic_v3_its_driver); /* LPI chunk owned by ITS device */ struct lpi_chunk { u_int lpi_base; - u_int lpi_num; u_int lpi_free; /* First free LPI in set */ u_int *lpi_col_ids; + + u_int lpi_num; /* Total number of LPIs in chunk */ + u_int lpi_busy; /* Number of busy LPIs in chink */ }; /* ITS device */ @@ -128,6 +130,7 @@ struct its_dev { struct lpi_chunk lpis; /* Virtual address of ITT */ vm_offset_t itt; + size_t itt_size; }; TAILQ_HEAD(its_dev_list, its_dev); @@ -277,7 +280,9 @@ extern devclass_t gic_v3_its_devclass; int gic_v3_its_detach(device_t); int gic_v3_its_alloc_msix(device_t, device_t, int *); +int gic_v3_its_release_msix(device_t, device_t, int); int gic_v3_its_alloc_msi(device_t, device_t, int, int *); +int gic_v3_its_release_msi(device_t, device_t, int, int *); int gic_v3_its_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); int its_init_cpu(struct gic_v3_its_softc *); From owner-svn-src-all@freebsd.org Wed May 18 10:43:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60CB0B403C0; Wed, 18 May 2016 10:43:14 +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 26C60197D; Wed, 18 May 2016 10:43:14 +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 u4IAhDrf037291; Wed, 18 May 2016 10:43:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IAhDmP037290; Wed, 18 May 2016 10:43:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605181043.u4IAhDmP037290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 18 May 2016 10:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300137 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 10:43:14 -0000 Author: avos Date: Wed May 18 10:43:13 2016 New Revision: 300137 URL: https://svnweb.freebsd.org/changeset/base/300137 Log: README: remove nonexistent 'games' directory. Games were moved to usr.bin in r288485. (todo: add/describe 'targets' directory) Modified: head/README Modified: head/README ============================================================================== --- head/README Wed May 18 10:09:07 2016 (r300136) +++ head/README Wed May 18 10:43:13 2016 (r300137) @@ -45,8 +45,6 @@ crypto Cryptography stuff (see crypto/R etc Template files for /etc. -games Amusements. - gnu Various commands and libraries under the GNU Public License. Please see gnu/COPYING* for more information. From owner-svn-src-all@freebsd.org Wed May 18 10:59:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FF44B407D4; Wed, 18 May 2016 10:59:17 +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 3191B1FB5; Wed, 18 May 2016 10:59:17 +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 u4IAxG0s040508; Wed, 18 May 2016 10:59:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IAxG3G040507; Wed, 18 May 2016 10:59:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605181059.u4IAxG3G040507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 18 May 2016 10:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300138 - head/targets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 10:59:17 -0000 Author: avos Date: Wed May 18 10:59:16 2016 New Revision: 300138 URL: https://svnweb.freebsd.org/changeset/base/300138 Log: targets/Makefile: fix a typo (derrived -> derived). Modified: head/targets/Makefile Modified: head/targets/Makefile ============================================================================== --- head/targets/Makefile Wed May 18 10:43:13 2016 (r300137) +++ head/targets/Makefile Wed May 18 10:59:16 2016 (r300138) @@ -1,6 +1,6 @@ # $FreeBSD$ -# This is the top-level makefile - derrived from the Junos version +# This is the top-level makefile - derived from the Junos version # # If a subdir that matches the requested target exists, we assume # a build target and initialize DIRDEPS, dirdeps.mk does the rest. From owner-svn-src-all@freebsd.org Wed May 18 11:01:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D711B409CE; Wed, 18 May 2016 11:01:52 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ECEDE1276; Wed, 18 May 2016 11:01:51 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3AE1525D386D; Wed, 18 May 2016 11:01:48 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 7C2CFD1F8BC; Wed, 18 May 2016 11:01:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id N_Ol9KC8jR-s; Wed, 18 May 2016 11:01:44 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:10a6:9e53:5e9c:c191] (unknown [IPv6:fde9:577b:c1a9:4410:10a6:9e53:5e9c:c191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 62975D1F8A6; Wed, 18 May 2016 11:01:44 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys From: "Bjoern A. Zeeb" In-Reply-To: <201605180435.u4I4ZwYh025096@repo.freebsd.org> Date: Wed, 18 May 2016 11:01:24 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> To: Scott Long X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 11:01:52 -0000 > On 18 May 2016, at 04:35 , Scott Long wrote: >=20 > Author: scottl > Date: Wed May 18 04:35:58 2016 > New Revision: 300113 > URL: https://svnweb.freebsd.org/changeset/base/300113 >=20 > Log: > Import the 'iflib' API library for network drivers. =46rom the = author: >=20 > "iflib is a library to eliminate the need for frequently duplicated = device > independent logic propagated (poorly) across many network drivers." >=20 > Participation is purely optional. The IFLIB kernel config option is > provided for drivers that want to transition between legacy and iflib > modes of operation. ixl and ixgbe driver conversions will be = committed > shortly. We hope to see participation from the Broadcom and maybe > Chelsio drivers in the near future. >=20 > Submitted by: mmacy@nextbsd.org > Reviewed by: gallatin > Differential Revision: D5211 >=20 > Added: > head/sys/net/ifdi_if.m (contents, props changed) > head/sys/net/iflib.c (contents, props changed) > head/sys/net/iflib.h (contents, props changed) > head/sys/net/mp_ring.c (contents, props changed) > head/sys/net/mp_ring.h (contents, props changed) > Modified: > head/sys/conf/files > head/sys/conf/options > head/sys/kern/device_if.m > head/sys/kern/kern_mbuf.c > head/sys/kern/subr_taskqueue.c > head/sys/net/if.c > head/sys/net/if_var.h > head/sys/sys/_task.h > head/sys/sys/mbuf.h > head/sys/sys/taskqueue.h Ignoring style for a moment, this broke builds; just as examples: mips XLP cc1: warnings being treated as errors /scratch/tmp/bz/head.svn/sys/net/mp_ring.c: In function = 'drain_ring_lockless': /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:204: warning: implicit = declaration of function 'atomic_cmpset_64' /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:204: warning: nested extern = declaration of 'atomic_cmpset_64' [-Wnested-externs] /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:231: warning: implicit = declaration of function 'atomic_cmpset_acq_64' /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:231: warning: nested extern = declaration of 'atomic_cmpset_acq_64' [-Wnested-externs] /scratch/tmp/bz/head.svn/sys/net/mp_ring.c: In function = 'ifmp_ring_enqueue': /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:456: warning: implicit = declaration of function 'atomic_cmpset_rel_64' /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:456: warning: nested extern = declaration of 'atomic_cmpset_rel_64' [-Wnested-externs] --- mp_ring.o --- *** [mp_ring.o] Error code 1 bmake[5]: stopped in = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/XLP powerpc LINT: cc1: warnings being treated as errors /scratch/tmp/bz/head.svn/sys/net/iflib.c: In function = '_iflib_fl_refill': /scratch/tmp/bz/head.svn/sys/net/iflib.c:1538: warning: comparison is = always true due to limited range of data type /scratch/tmp/bz/head.svn/sys/net/iflib.c: In function = 'iflib_fl_bufs_free': /scratch/tmp/bz/head.svn/sys/net/iflib.c:1667: warning: comparison is = always true due to limited range of data type --- iflib.o --- *** [iflib.o] Error code 1 bmake[5]: stopped in = /storage/head/obj/powerpc.powerpc/scratch/tmp/bz/head.svn/sys/LINT cc1: warnings being treated as errors /scratch/tmp/bz/head.svn/sys/net/mp_ring.c: In function = 'drain_ring_lockless': /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:204: warning: implicit = declaration of function 'atomic_cmpset_64' /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:204: warning: nested extern = declaration of 'atomic_cmpset_64' [-Wnested-externs] /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:231: warning: implicit = declaration of function 'atomic_cmpset_acq_64' /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:231: warning: nested extern = declaration of 'atomic_cmpset_acq_64' [-Wnested-externs] /scratch/tmp/bz/head.svn/sys/net/mp_ring.c: In function = 'ifmp_ring_enqueue': /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:456: warning: implicit = declaration of function 'atomic_cmpset_rel_64' /scratch/tmp/bz/head.svn/sys/net/mp_ring.c:456: warning: nested extern = declaration of 'atomic_cmpset_rel_64' [-Wnested-externs] --- mp_ring.o --- *** [mp_ring.o] Error code 1 =E2=80=A6 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-all@freebsd.org Wed May 18 11:51:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21311B405A9; Wed, 18 May 2016 11:51:19 +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 CEF331C82; Wed, 18 May 2016 11:51:18 +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 u4IBpILo058508; Wed, 18 May 2016 11:51:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IBpHbh058506; Wed, 18 May 2016 11:51:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605181151.u4IBpHbh058506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 May 2016 11:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300139 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 11:51:19 -0000 Author: kib Date: Wed May 18 11:51:17 2016 New Revision: 300139 URL: https://svnweb.freebsd.org/changeset/base/300139 Log: MFC r299408: Style: wrap long lines. Modified: stable/10/sys/kern/vfs_hash.c stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_hash.c ============================================================================== --- stable/10/sys/kern/vfs_hash.c Wed May 18 10:59:16 2016 (r300138) +++ stable/10/sys/kern/vfs_hash.c Wed May 18 11:51:17 2016 (r300139) @@ -69,7 +69,8 @@ vfs_hash_bucket(const struct mount *mp, } int -vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) { struct vnode *vp; int error; @@ -111,7 +112,8 @@ vfs_hash_remove(struct vnode *vp) } int -vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) { struct vnode *vp2; int error; Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Wed May 18 10:59:16 2016 (r300138) +++ stable/10/sys/sys/vnode.h Wed May 18 11:51:17 2016 (r300139) @@ -844,9 +844,11 @@ int fifo_printinfo(struct vnode *); typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg); void vfs_hash_changesize(int newhashsize); -int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +int vfs_hash_get(const struct mount *mp, u_int hash, int flags, + struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); u_int vfs_hash_index(struct vnode *vp); -int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); From owner-svn-src-all@freebsd.org Wed May 18 11:58:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45857B408CE; Wed, 18 May 2016 11:58:18 +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 F1DA4106B; Wed, 18 May 2016 11:58:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IBwHZp058916; Wed, 18 May 2016 11:58:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IBwH3R058914; Wed, 18 May 2016 11:58:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605181158.u4IBwH3R058914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 May 2016 11:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300140 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 11:58:18 -0000 Author: kib Date: Wed May 18 11:58:16 2016 New Revision: 300140 URL: https://svnweb.freebsd.org/changeset/base/300140 Log: MFC r299412: Add vfs_hash_ref(9) function, which finds a vnode by the hash value and returns it referenced. Modified: stable/10/sys/kern/vfs_hash.c stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_hash.c ============================================================================== --- stable/10/sys/kern/vfs_hash.c Wed May 18 11:51:17 2016 (r300139) +++ stable/10/sys/kern/vfs_hash.c Wed May 18 11:58:16 2016 (r300140) @@ -103,6 +103,36 @@ vfs_hash_get(const struct mount *mp, u_i } void +vfs_hash_ref(const struct mount *mp, u_int hash, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +{ + struct vnode *vp; + + while (1) { + mtx_lock(&vfs_hash_mtx); + LIST_FOREACH(vp, vfs_hash_bucket(mp, hash), v_hashlist) { + if (vp->v_hash != hash) + continue; + if (vp->v_mount != mp) + continue; + if (fn != NULL && fn(vp, arg)) + continue; + vhold(vp); + mtx_unlock(&vfs_hash_mtx); + vref(vp); + vdrop(vp); + *vpp = vp; + return; + } + if (vp == NULL) { + mtx_unlock(&vfs_hash_mtx); + *vpp = NULL; + return; + } + } +} + +void vfs_hash_remove(struct vnode *vp) { Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Wed May 18 11:51:17 2016 (r300139) +++ stable/10/sys/sys/vnode.h Wed May 18 11:58:16 2016 (r300140) @@ -849,6 +849,8 @@ int vfs_hash_get(const struct mount *mp, u_int vfs_hash_index(struct vnode *vp); int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +void vfs_hash_ref(const struct mount *mp, u_int hash, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); From owner-svn-src-all@freebsd.org Wed May 18 12:02:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E47FB3F2D9; Wed, 18 May 2016 12:02:07 +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 0A16E19E7; Wed, 18 May 2016 12:02:06 +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 u4IC26sW061837; Wed, 18 May 2016 12:02:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IC269g061835; Wed, 18 May 2016 12:02:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605181202.u4IC269g061835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 May 2016 12:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300141 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 12:02:07 -0000 Author: kib Date: Wed May 18 12:02:05 2016 New Revision: 300141 URL: https://svnweb.freebsd.org/changeset/base/300141 Log: MFC r299413: Use vfs_hash_ref(9) to eliminate LK_EXCLOTHER kludge. Modified: stable/10/sys/fs/nfsclient/nfs_clport.c stable/10/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clport.c Wed May 18 11:58:16 2016 (r300140) +++ stable/10/sys/fs/nfsclient/nfs_clport.c Wed May 18 12:02:05 2016 (r300141) @@ -279,7 +279,7 @@ nfscl_nget(struct mount *mntp, struct vn } /* - * Anothe variant of nfs_nget(). This one is only used by reopen. It + * Another variant of nfs_nget(). This one is only used by reopen. It * takes almost the same args as nfs_nget(), but only succeeds if an entry * exists in the cache. (Since files should already be "open" with a * vnode ref cnt on the node when reopen calls this, it should always @@ -318,21 +318,24 @@ nfscl_ngetreopen(struct mount *mntp, u_i NFSVOPUNLOCK(nvp, 0); } else if (error == EBUSY) { /* - * The LK_EXCLOTHER lock type tells nfs_lock1() to not try - * and lock the vnode, but just get a v_usecount on it. - * LK_NOWAIT is set so that when vget() returns ENOENT, - * vfs_hash_get() fails instead of looping. - * If this succeeds, it is safe so long as a vflush() with + * It is safe so long as a vflush() with * FORCECLOSE has not been done. Since the Renew thread is * stopped and the MNTK_UNMOUNTF flag is set before doing * a vflush() with FORCECLOSE, we should be ok here. */ if ((mntp->mnt_kern_flag & MNTK_UNMOUNTF)) error = EINTR; - else - error = vfs_hash_get(mntp, hash, - (LK_EXCLOTHER | LK_NOWAIT), td, &nvp, - newnfs_vncmpf, nfhp); + else { + vfs_hash_ref(mntp, hash, td, &nvp, newnfs_vncmpf, nfhp); + if (nvp == NULL) { + error = ENOENT; + } else if ((nvp->v_iflag & VI_DOOMED) != 0) { + error = ENOENT; + vrele(nvp); + } else { + error = 0; + } + } } FREE(nfhp, M_NFSFH); if (error) Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed May 18 11:58:16 2016 (r300140) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed May 18 12:02:05 2016 (r300141) @@ -139,7 +139,6 @@ static vop_rmdir_t nfs_rmdir; static vop_symlink_t nfs_symlink; static vop_readdir_t nfs_readdir; static vop_strategy_t nfs_strategy; -static vop_lock1_t nfs_lock1; static int nfs_lookitup(struct vnode *, char *, int, struct ucred *, struct thread *, struct nfsnode **); static int nfs_sillyrename(struct vnode *, struct vnode *, @@ -168,7 +167,6 @@ struct vop_vector newnfs_vnodeops = { .vop_putpages = ncl_putpages, .vop_inactive = ncl_inactive, .vop_link = nfs_link, - .vop_lock1 = nfs_lock1, .vop_lookup = nfs_lookup, .vop_mkdir = nfs_mkdir, .vop_mknod = nfs_mknod, @@ -3350,37 +3348,6 @@ struct buf_ops buf_ops_newnfs = { .bop_bdflush = bufbdflush, }; -/* - * Cloned from vop_stdlock(), and then the ugly hack added. - */ -static int -nfs_lock1(struct vop_lock1_args *ap) -{ - struct vnode *vp = ap->a_vp; - int error = 0; - - /* - * Since vfs_hash_get() calls vget() and it will no longer work - * for FreeBSD8 with flags == 0, I can only think of this horrible - * hack to work around it. I call vfs_hash_get() with LK_EXCLOTHER - * and then handle it here. All I want for this case is a v_usecount - * on the vnode to use for recovery, while another thread might - * hold a lock on the vnode. I have the other threads blocked, so - * there isn't any race problem. - */ - if ((ap->a_flags & LK_TYPE_MASK) == LK_EXCLOTHER) { - if ((ap->a_flags & LK_INTERLOCK) == 0) - panic("ncllock1"); - if ((vp->v_iflag & VI_DOOMED)) - error = ENOENT; - VI_UNLOCK(vp); - return (error); - } - return (_lockmgr_args(vp->v_vnlock, ap->a_flags, VI_MTX(vp), - LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, ap->a_file, - ap->a_line)); -} - static int nfs_getacl(struct vop_getacl_args *ap) { From owner-svn-src-all@freebsd.org Wed May 18 12:03:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 931F5B3F5B9; Wed, 18 May 2016 12:03:59 +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 480081C9D; Wed, 18 May 2016 12:03:59 +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 u4IC3wvh061940; Wed, 18 May 2016 12:03:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IC3wwF061937; Wed, 18 May 2016 12:03:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605181203.u4IC3wwF061937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 May 2016 12:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300142 - in head/sys: kern sys ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 12:03:59 -0000 Author: kib Date: Wed May 18 12:03:57 2016 New Revision: 300142 URL: https://svnweb.freebsd.org/changeset/base/300142 Log: Ensure that ftruncate(2) is performed synchronously when file is opened in O_SYNC mode, at least for UFS. This also handles truncation, done due to the O_SYNC | O_TRUNC flags combination to open(2), in synchronous way. Noted by: bde Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed May 18 12:02:05 2016 (r300141) +++ head/sys/kern/vfs_vnops.c Wed May 18 12:03:57 2016 (r300142) @@ -1314,6 +1314,8 @@ vn_truncate(struct file *fp, off_t lengt if (error == 0) { VATTR_NULL(&vattr); vattr.va_size = length; + if ((fp->f_flag & O_FSYNC) != 0) + vattr.va_vaflags |= VA_SYNC; error = VOP_SETATTR(vp, &vattr, fp->f_cred); } out: Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed May 18 12:02:05 2016 (r300141) +++ head/sys/sys/vnode.h Wed May 18 12:03:57 2016 (r300142) @@ -286,6 +286,7 @@ struct vattr { */ #define VA_UTIMES_NULL 0x01 /* utimes argument was NULL */ #define VA_EXCLUSIVE 0x02 /* exclusive create request */ +#define VA_SYNC 0x04 /* O_SYNC truncation */ /* * Flags for ioflag. (high 16 bits used to ask for read-ahead and Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed May 18 12:02:05 2016 (r300141) +++ head/sys/ufs/ufs/ufs_vnops.c Wed May 18 12:03:57 2016 (r300142) @@ -625,7 +625,8 @@ ufs_setattr(ap) */ return (0); } - if ((error = UFS_TRUNCATE(vp, vap->va_size, IO_NORMAL, + if ((error = UFS_TRUNCATE(vp, vap->va_size, IO_NORMAL | + ((vap->va_vaflags & VA_SYNC) != 0 ? IO_SYNC : 0), cred)) != 0) return (error); } From owner-svn-src-all@freebsd.org Wed May 18 12:53:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E58B41322; Wed, 18 May 2016 12:53:22 +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 C32F71705; Wed, 18 May 2016 12:53:22 +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 u4ICrMXo077046; Wed, 18 May 2016 12:53:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ICrMMR077045; Wed, 18 May 2016 12:53:22 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605181253.u4ICrMMR077045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 18 May 2016 12:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300143 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 12:53:23 -0000 Author: ae Date: Wed May 18 12:53:21 2016 New Revision: 300143 URL: https://svnweb.freebsd.org/changeset/base/300143 Log: Move protocol state handling code from lookup_dyn_rule_locked() function into dyn_update_proto_state(). This allows eliminate the second state lookup in the ipfw_install_state(). Also remove MATCH_* macros, they are defined in ip_fw_private.h as enum. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed May 18 12:03:57 2016 (r300142) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed May 18 12:53:21 2016 (r300143) @@ -319,77 +319,15 @@ print_dyn_rule_flags(struct ipfw_flow_id #define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) #define TIME_LE(a,b) ((int)((a)-(b)) < 0) -/* - * Lookup a dynamic rule, locked version. - */ -static ipfw_dyn_rule * -lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int i, int *match_direction, - struct tcphdr *tcp) +static void +dyn_update_proto_state(ipfw_dyn_rule *q, const struct ipfw_flow_id *id, + const struct tcphdr *tcp, int dir) { - /* - * Stateful ipfw extensions. - * Lookup into dynamic session queue. - */ -#define MATCH_REVERSE 0 -#define MATCH_FORWARD 1 -#define MATCH_NONE 2 -#define MATCH_UNKNOWN 3 - int dir = MATCH_NONE; - ipfw_dyn_rule *prev, *q = NULL; - - IPFW_BUCK_ASSERT(i); - - for (prev = NULL, q = V_ipfw_dyn_v[i].head; q; prev = q, q = q->next) { - if (q->dyn_type == O_LIMIT_PARENT && q->count) - continue; - - if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) - continue; - - if (IS_IP6_FLOW_ID(pkt)) { - if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.src_ip6) && - IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.dst_ip6) && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port) { - dir = MATCH_FORWARD; - break; - } - if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.dst_ip6) && - IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.src_ip6) && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port) { - dir = MATCH_REVERSE; - break; - } - } else { - if (pkt->src_ip == q->id.src_ip && - pkt->dst_ip == q->id.dst_ip && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port) { - dir = MATCH_FORWARD; - break; - } - if (pkt->src_ip == q->id.dst_ip && - pkt->dst_ip == q->id.src_ip && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port) { - dir = MATCH_REVERSE; - break; - } - } - } - if (q == NULL) - goto done; /* q = NULL, not found */ - - if (prev != NULL) { /* found and not in front */ - prev->next = q->next; - q->next = V_ipfw_dyn_v[i].head; - V_ipfw_dyn_v[i].head = q; - } - if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ - uint32_t ack; - u_char flags = pkt->_flags & (TH_FIN | TH_SYN | TH_RST); + uint32_t ack; + u_char flags; + if (id->proto == IPPROTO_TCP) { + flags = id->_flags & (TH_FIN | TH_SYN | TH_RST); #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) #define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) @@ -432,7 +370,8 @@ lookup_dyn_rule_locked(struct ipfw_flow_ case BOTH_SYN | BOTH_FIN: /* both sides closed */ if (V_dyn_fin_lifetime >= V_dyn_keepalive_period) - V_dyn_fin_lifetime = V_dyn_keepalive_period - 1; + V_dyn_fin_lifetime = + V_dyn_keepalive_period - 1; q->expire = time_uptime + V_dyn_fin_lifetime; break; @@ -446,16 +385,86 @@ lookup_dyn_rule_locked(struct ipfw_flow_ printf("invalid state: 0x%x\n", q->state); #endif if (V_dyn_rst_lifetime >= V_dyn_keepalive_period) - V_dyn_rst_lifetime = V_dyn_keepalive_period - 1; + V_dyn_rst_lifetime = + V_dyn_keepalive_period - 1; q->expire = time_uptime + V_dyn_rst_lifetime; break; } - } else if (pkt->proto == IPPROTO_UDP) { + } else if (id->proto == IPPROTO_UDP) { q->expire = time_uptime + V_dyn_udp_lifetime; } else { /* other protocols */ q->expire = time_uptime + V_dyn_short_lifetime; } +} + +/* + * Lookup a dynamic rule, locked version. + */ +static ipfw_dyn_rule * +lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int i, int *match_direction, + struct tcphdr *tcp) +{ + /* + * Stateful ipfw extensions. + * Lookup into dynamic session queue. + */ + ipfw_dyn_rule *prev, *q = NULL; + int dir; + + IPFW_BUCK_ASSERT(i); + + dir = MATCH_NONE; + for (prev = NULL, q = V_ipfw_dyn_v[i].head; q; prev = q, q = q->next) { + if (q->dyn_type == O_LIMIT_PARENT && q->count) + continue; + + if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) + continue; + + if (IS_IP6_FLOW_ID(pkt)) { + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.src_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.dst_ip6) && + pkt->src_port == q->id.src_port && + pkt->dst_port == q->id.dst_port) { + dir = MATCH_FORWARD; + break; + } + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.dst_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.src_ip6) && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; + } + } else { + if (pkt->src_ip == q->id.src_ip && + pkt->dst_ip == q->id.dst_ip && + pkt->src_port == q->id.src_port && + pkt->dst_port == q->id.dst_port) { + dir = MATCH_FORWARD; + break; + } + if (pkt->src_ip == q->id.dst_ip && + pkt->dst_ip == q->id.src_ip && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; + } + } + } + if (q == NULL) + goto done; /* q = NULL, not found */ + + if (prev != NULL) { /* found and not in front */ + prev->next = q->next; + q->next = V_ipfw_dyn_v[i].head; + V_ipfw_dyn_v[i].head = q; + } + + /* update state according to flags */ + dyn_update_proto_state(q, pkt, tcp, dir); done: if (match_direction != NULL) *match_direction = dir; @@ -678,7 +687,7 @@ ipfw_install_state(struct ip_fw_chain *c ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg) { ipfw_dyn_rule *q; - int i; + int i, dir; DEB(print_dyn_rule(&args->f_id, cmd->o.opcode, "install_state", "");) @@ -686,8 +695,7 @@ ipfw_install_state(struct ip_fw_chain *c IPFW_BUCK_LOCK(i); - q = lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL); - + q = lookup_dyn_rule_locked(&args->f_id, i, &dir, NULL); if (q != NULL) { /* should never occur */ DEB( if (last_log != time_uptime) { @@ -786,7 +794,8 @@ ipfw_install_state(struct ip_fw_chain *c IPFW_BUCK_UNLOCK(pindex); IPFW_BUCK_LOCK(i); - q = add_dyn_rule(&args->f_id, i, O_LIMIT, (struct ip_fw *)parent); + q = add_dyn_rule(&args->f_id, i, O_LIMIT, + (struct ip_fw *)parent); if (q == NULL) { /* Decrement index and notify caller */ IPFW_BUCK_UNLOCK(i); @@ -807,9 +816,7 @@ ipfw_install_state(struct ip_fw_chain *c return (1); /* Notify caller about failure */ } - /* XXX just set lifetime */ - lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL); - + dyn_update_proto_state(q, &args->f_id, NULL, dir); IPFW_BUCK_UNLOCK(i); return (0); } From owner-svn-src-all@freebsd.org Wed May 18 13:09:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75E52B41607; Wed, 18 May 2016 13:09: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 4343D1F29; Wed, 18 May 2016 13:09: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 u4ID9qgh080638; Wed, 18 May 2016 13:09:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ID9qmK080637; Wed, 18 May 2016 13:09:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605181309.u4ID9qmK080637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 18 May 2016 13:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300144 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 13:09:53 -0000 Author: andrew Date: Wed May 18 13:09:52 2016 New Revision: 300144 URL: https://svnweb.freebsd.org/changeset/base/300144 Log: Implement atomic_cmpset_acq_64 and atomic_cmpset_rel_64 on arm and armeb. This should allow r300113 to build there. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/include/atomic-v4.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Wed May 18 12:53:21 2016 (r300143) +++ head/sys/arm/include/atomic-v4.h Wed May 18 13:09:52 2016 (r300144) @@ -372,6 +372,8 @@ atomic_swap_32(volatile u_int32_t *p, u_ #define atomic_cmpset_rel_32 atomic_cmpset_32 #define atomic_cmpset_acq_32 atomic_cmpset_32 +#define atomic_cmpset_rel_64 atomic_cmpset_64 +#define atomic_cmpset_acq_64 atomic_cmpset_64 #define atomic_set_rel_32 atomic_set_32 #define atomic_set_acq_32 atomic_set_32 #define atomic_clear_rel_32 atomic_clear_32 From owner-svn-src-all@freebsd.org Wed May 18 13:17:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33C80B417B6; Wed, 18 May 2016 13:17:03 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x243.google.com (mail-oi0-x243.google.com [IPv6:2607:f8b0:4003: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 EA923139F; Wed, 18 May 2016 13:17:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x243.google.com with SMTP id i2so9718604oib.3; Wed, 18 May 2016 06:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=YXyeg73DjBDd8+PRYgctMEYJXDTcE0pmCHpti+dHQ7s=; b=fJT9Ou1jCEHp82XF0M6E0b/OY+ojVM1pW3CYrsq3WUO67YngSSZuBixZZuvB/6kbRR xX9DG1QNCZSoxuspm3ajl3bjHF8chRvGa036PIOsAJIEgn7CE+v7vtJMh+sFUOXMh8ah j7NJRW9JmFiwLMQPQCcjbAQTmwoVjjXZ2EQRcaryzVEAJ0cKoasAKlDx39bwUpKLSX2B mtkmMjz6/zkFTr+sDevIG392HzG1t38i8uN1Grq9MkqoLPMUNNDljz9Cu64yuEhrGyCb /iG+wXfvYnJ+YMtDcivAZjJUuoMcPyUXDey+2S8cNdALRRNyHolnhpp9Kr93PlRCKhfb 5TJw== 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:date :message-id:subject:from:to; bh=YXyeg73DjBDd8+PRYgctMEYJXDTcE0pmCHpti+dHQ7s=; b=gMyjcrmWlWF18J+LckpS2xRFu4dDzCWnNXhaDKW+6fCr6kY0PWWPjrju2xi/s1Vfq1 F71CVnvpH2Gr3WEhSVMmsFhwIyjbEArltRaBzYzJ+250g29wa6I4o+WMykOH+unudr7G q5LjaqYajx36CqXZkCERSx+rsjXqBv4Rg4wq7hLhmEHlfMbnntGgEDdH5W/Sl/ddgHJA KcMBxjRgjAdQ4bdasYOAvUmw/k0DDuNKRypeJV2ELw7tKlD5FBxvY8LLzCpJVad6Ei2G Avdl9jHbXdUrvgjapMM0/nFpnTpFttkfk+HEmLucX8vYfnKoJ24cy7HCZEic8RZX7GHJ IJEQ== X-Gm-Message-State: AOPr4FWb75YDyleqckmD3BYtybvgL7aMhEwE4XIVfscY6lulXpaI1WMNOmkDnRYQ1pjybOicLhno3AuwllaPxA== MIME-Version: 1.0 X-Received: by 10.202.232.193 with SMTP id f184mr3988268oih.182.1463577422126; Wed, 18 May 2016 06:17:02 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.6 with HTTP; Wed, 18 May 2016 06:17:02 -0700 (PDT) In-Reply-To: <20160518095637.GA3536@brick> References: <201605101546.u4AFkX0w073701@repo.freebsd.org> <20160510173351.GA4176@brick> <20160518095637.GA3536@brick> Date: Wed, 18 May 2016 07:17:02 -0600 X-Google-Sender-Auth: yilsI4sbmeCLKZpRk7-65s9_nRQ Message-ID: Subject: Re: svn commit: r299371 - in head: sbin/camcontrol sys/cam sys/cam/scsi From: Alan Somers To: Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Kenneth D. Merry" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 13:17:03 -0000 On Wed, May 18, 2016 at 3:56 AM, Edward Tomasz Napiera=C5=82a wrote: > On 0517T1158, Warner Losh wrote: > > On Tue, May 10, 2016 at 11:33 AM, Edward Tomasz Napierala < > trasz@freebsd.org > > > wrote: > > > > > On 0510T1020, Alan Somers wrote: > > > > On Tue, May 10, 2016 at 9:46 AM, Edward Tomasz Napierala < > > > trasz@freebsd.org> > > > > wrote: > > > > > > > > > Author: trasz > > > > > Date: Tue May 10 15:46:33 2016 > > > > > New Revision: 299371 > > > > > URL: https://svnweb.freebsd.org/changeset/base/299371 > > > > > > > > > > Log: > > > > > Add "camcontrol reprobe" subcommand, and implement it for da(4)= . > > > > > This makes it possible to manually force updating capacity data > > > > > after the disk got resized. Without it it might be neccessary t= o > > > > > reboot before FreeBSD notices updated disk size under eg VMWare= . > > > > > > > > > > Discussed with: imp@ > > > > > MFC after: 1 month > > > > > Sponsored by: The FreeBSD Foundation > > > > > Differential Revision: https://reviews.freebsd.org/D6108 > > > > > > > > > > Modified: > > > > > head/sbin/camcontrol/camcontrol.8 > > > > > head/sbin/camcontrol/camcontrol.c > > > > > head/sys/cam/cam_ccb.h > > > > > head/sys/cam/cam_xpt.c > > > > > head/sys/cam/scsi/scsi_da.c > > > > > > > > > > > > > > > > > > I too have been annoyed that "camcontrol rescan" won't update > capacity > > > > data. But could we solve the problem by simply adding logic to > > > "camcontrol > > > > rescan" instead of adding an entirely new command? Would a user ev= er > > > want > > > > to rescan a device without reprobing it too? > > > > > > Two reasons. First, I want to be able to pass the device name (like > > > 'da0') and not the CAM path (like 1:0:0) for usability reasons - it > seems > > > easy to figure out the latter from the former, using "camcontrol > devlist", > > > but it suddenly becomes complicated when you try to explain it in a m= an > > > page. > > > > > > You can look up one or the other. fwdownload uses the daX name. > > Indeed. But it would mean fixing "camcontrol rescan" first. > > > > Second - I don't understand the "camcontrol rescan" logic well > > > enough, and "camcontrol rescan all" sometimes fails for me anyway, > > > in a way I'm not sure how to debug. > > > > > > > That's a cop-out. CAM is hard, but if you aren't willing to figure itou= t, > > adding hacks that the other CAM maintainers have to cope with doesn't > > help. > > That's true. However, this hack is pretty non-intrusive - it only adds > a trivial amount of code, and the "reprobe" command could be replaced > with a simple alias to "rescan" if someone steps up to reimplement it. > > > Also, to be honest I'm not sure those two are actually that related. > > > Rescanning is about discovering new devices on the bus. "Reprobe" > > > is about updating... well, mostly updating the capacity. The former > > > requires enumerating the bus using a mechanism built into XPT; the > > > latter is just notifying the periph driver (in this case da(4)) that > > > it needs to query the capacity and call disk_resize(4). > > > > > > > The two are very related. Now we have two stupid paths in CAM instead o= f > > one. > > We have two clearly separated code paths, doing completely different > things - one scanning the bus, and only notifying periph drivers if > new device is discovered, and the other one to notify existing periph > driver instances, without scanning anything. I just don't see how > entangling them with each other would improve things. > > > and you didn't do ada like I asked. > > As I said in review, the ada(4) driver seems to lack resizing > capability. It doesn't contain a call to disk_resize(9). It's been > a few years since I've added resizing to da(4), but it took quite > some time to make sure it interfaces with existing code in exactly > the right way. I just don't have time for this kind of side quest > right now. And I'm not even sure how to test it. With da(4) it > was easy - I've just added LUN resizing to CTL. > You can test ada(4) resize by using "camcontrol hpa". Most SATA disks allow you to reduce the disk's capacity through the hpa command. > > > Not happy with this at all, but not asking for a back out. > > Thanks. > > From owner-svn-src-all@freebsd.org Wed May 18 13:21:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26ECCB41970; Wed, 18 May 2016 13:21:31 +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 EE6721DF7; Wed, 18 May 2016 13:21:30 +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 u4IDLUXl084875; Wed, 18 May 2016 13:21:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IDLUo4084874; Wed, 18 May 2016 13:21:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605181321.u4IDLUo4084874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 May 2016 13:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300145 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 13:21:31 -0000 Author: avg Date: Wed May 18 13:21:29 2016 New Revision: 300145 URL: https://svnweb.freebsd.org/changeset/base/300145 Log: add vop_print methods to vnode operatios of various zfsctl node types This should help with diagnostics of zfsctl problems. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 13:09:52 2016 (r300144) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed May 18 13:21:29 2016 (r300145) @@ -294,6 +294,22 @@ zfsctl_root(znode_t *zp) return (zp->z_zfsvfs->z_ctldir); } +static int +zfsctl_common_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + gfs_file_t *fp = vp->v_data; + + printf(" parent = %p\n", fp->gfs_parent); + printf(" type = %d\n", fp->gfs_type); + printf(" index = %d\n", fp->gfs_index); + printf(" ino = %ju\n", (uintmax_t)fp->gfs_ino); + return (0); +} + /* * Common open routine. Disallow any write access. */ @@ -584,6 +600,17 @@ relookup: return (err); } +static int +zfsctl_root_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + printf(" .zfs node\n"); + zfsctl_common_print(ap); + return (0); +} + #ifdef illumos static int zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr, @@ -634,6 +661,7 @@ static struct vop_vector zfsctl_ops_root .vop_pathconf = zfsctl_pathconf, #endif .vop_fid = zfsctl_common_fid, + .vop_print = zfsctl_root_print, }; /* @@ -1376,6 +1404,32 @@ zfsctl_snapdir_reclaim(ap) return (0); } +static int +zfsctl_shares_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + printf(" .zfs/shares node\n"); + zfsctl_common_print(ap); + return (0); +} + +static int +zfsctl_snapdir_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + zfsctl_snapdir_t *sdp = vp->v_data; + + printf(" .zfs/snapshot node\n"); + printf(" number of children = %lu\n", avl_numnodes(&sdp->sd_snaps)); + zfsctl_common_print(ap); + return (0); +} + #ifdef illumos static const fs_operation_def_t zfsctl_tops_snapdir[] = { { VOPNAME_OPEN, { .vop_open = zfsctl_common_open } }, @@ -1421,6 +1475,7 @@ static struct vop_vector zfsctl_ops_snap .vop_inactive = VOP_NULL, .vop_reclaim = zfsctl_snapdir_reclaim, .vop_fid = zfsctl_common_fid, + .vop_print = zfsctl_snapdir_print, }; static struct vop_vector zfsctl_ops_shares = { @@ -1435,6 +1490,7 @@ static struct vop_vector zfsctl_ops_shar .vop_inactive = VOP_NULL, .vop_reclaim = gfs_vop_reclaim, .vop_fid = zfsctl_shares_fid, + .vop_print = zfsctl_shares_print, }; #endif /* illumos */ @@ -1571,6 +1627,21 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc return (error); } +static int +zfsctl_snaphot_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + zfsctl_node_t *zcp = vp->v_data; + + printf(" .zfs/snapshot/ node\n"); + printf(" id = %ju\n", (uintmax_t)zcp->zc_id); + zfsctl_common_print(ap); + return (0); +} + /* * These VP's should never see the light of day. They should always * be covered. @@ -1580,6 +1651,7 @@ static struct vop_vector zfsctl_ops_snap .vop_inactive = zfsctl_snapshot_inactive, .vop_reclaim = zfsctl_snapshot_reclaim, .vop_vptocnp = zfsctl_snapshot_vptocnp, + .vop_print = zfsctl_snaphot_print, }; int From owner-svn-src-all@freebsd.org Wed May 18 14:09:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73BB3B3F618; Wed, 18 May 2016 14:09:57 +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 43EE219A5; Wed, 18 May 2016 14:09:57 +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 u4IE9umP000274; Wed, 18 May 2016 14:09:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IE9uYJ000273; Wed, 18 May 2016 14:09:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605181409.u4IE9uYJ000273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 14:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300146 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 14:09:57 -0000 Author: imp Date: Wed May 18 14:09:56 2016 New Revision: 300146 URL: https://svnweb.freebsd.org/changeset/base/300146 Log: Also add comment about the bug I comments in the forth. Modified: head/sys/boot/common/commands.c Modified: head/sys/boot/common/commands.c ============================================================================== --- head/sys/boot/common/commands.c Wed May 18 13:21:29 2016 (r300145) +++ head/sys/boot/common/commands.c Wed May 18 14:09:56 2016 (r300146) @@ -211,6 +211,14 @@ command_help(int argc, char *argv[]) COMMAND_SET(commandlist, "?", "list commands", command_commandlist); +/* + * Please note: although we use the pager for the list of commands, + * this routine is called from the ? FORTH function which then + * unconditionally prints some commands. This will lead to anomalous + * behavior. There's no 'pager_output' binding to FORTH to allow + * things to work right, so I'm documenting the bug rather than + * fixnig it. + */ static int command_commandlist(int argc, char *argv[]) { From owner-svn-src-all@freebsd.org Wed May 18 14:18:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98E7BB3F854; Wed, 18 May 2016 14:18:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59EC91F89; Wed, 18 May 2016 14:18:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IEI3i3003599; Wed, 18 May 2016 14:18:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IEI3rk003598; Wed, 18 May 2016 14:18:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605181418.u4IEI3rk003598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 18 May 2016 14:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300147 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 14:18:04 -0000 Author: bz Date: Wed May 18 14:18:03 2016 New Revision: 300147 URL: https://svnweb.freebsd.org/changeset/base/300147 Log: Make compile without INET or without IP support in the kernel by hiding variables and lro function calls behind approriate #ifdefs. Also move the #includes for "opt_*" to the place where they should be. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed May 18 14:09:56 2016 (r300146) +++ head/sys/net/iflib.c Wed May 18 14:18:03 2016 (r300147) @@ -28,6 +28,10 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_acpi.h" + #include #include #include @@ -77,11 +81,6 @@ __FBSDID("$FreeBSD$"); #include - -#include "opt_inet.h" -#include "opt_inet6.h" -#include "opt_acpi.h" - #include "ifdi_if.h" #if defined(__i386__) || defined(__amd64__) @@ -2158,8 +2157,10 @@ iflib_rxeof(iflib_rxq_t rxq, int budget) m->m_nextpkt = NULL; rx_bytes += m->m_pkthdr.len; rx_pkts++; +#if defined(INET6) || defined(INET) if (lro_enabled && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) continue; +#endif DBG_COUNTER_INC(rx_if_input); ifp->if_input(ifp, m); } @@ -2171,7 +2172,9 @@ iflib_rxeof(iflib_rxq_t rxq, int budget) */ while ((queued = LIST_FIRST(&rxq->ifr_lc.lro_active)) != NULL) { LIST_REMOVE(queued, next); +#if defined(INET6) || defined(INET) tcp_lro_flush(&rxq->ifr_lc, queued); +#endif } return (iflib_rxd_avail(ctx, rxq, *cidxp)); } @@ -2232,7 +2235,7 @@ static int iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp) { struct ether_vlan_header *eh; - struct mbuf *m, *n; + struct mbuf *m; m = *mp; /* @@ -2260,6 +2263,7 @@ iflib_parse_header(iflib_txq_t txq, if_p { struct ip *ip = NULL; struct tcphdr *th = NULL; + struct mbuf *n; int minthlen; minthlen = min(m->m_pkthdr.len, pi->ipi_ehdrlen + sizeof(*ip) + sizeof(*th)); @@ -4085,9 +4089,13 @@ static int iflib_rx_structures_setup(if_ctx_t ctx) { iflib_rxq_t rxq = ctx->ifc_rxqs; - int i, q, err; + int q; +#if defined(INET6) || defined(INET) + int i, err; +#endif for (q = 0; q < ctx->ifc_softc_ctx.isc_nrxqsets; q++, rxq++) { +#if defined(INET6) || defined(INET) tcp_lro_free(&rxq->ifr_lc); if ((err = tcp_lro_init(&rxq->ifr_lc)) != 0) { device_printf(ctx->ifc_dev, "LRO Initialization failed!\n"); @@ -4095,9 +4103,11 @@ iflib_rx_structures_setup(if_ctx_t ctx) } rxq->ifr_lro_enabled = TRUE; rxq->ifr_lc.ifp = ctx->ifc_ifp; +#endif IFDI_RXQ_SETUP(ctx, rxq->ifr_id); } return (0); +#if defined(INET6) || defined(INET) fail: /* * Free RX software descriptors allocated so far, we will only handle @@ -4110,6 +4120,7 @@ fail: rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; } return (err); +#endif } /********************************************************************* From owner-svn-src-all@freebsd.org Wed May 18 14:43:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08191B4129D; Wed, 18 May 2016 14:43:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D86A61186; Wed, 18 May 2016 14:43:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IEhI51012680; Wed, 18 May 2016 14:43:18 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IEhHEE012678; Wed, 18 May 2016 14:43:17 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605181443.u4IEhHEE012678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 18 May 2016 14:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300148 - in head: share/man/man4 sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 14:43:19 -0000 Author: bz Date: Wed May 18 14:43:17 2016 New Revision: 300148 URL: https://svnweb.freebsd.org/changeset/base/300148 Log: Split 'show vnets' into 'show vnet' and 'show all vnets'. While here adjust some db_printf format string. Document the two show commands in ddb.4. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/ddb.4 head/sys/net/vnet.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Wed May 18 14:18:03 2016 (r300147) +++ head/share/man/man4/ddb.4 Wed May 18 14:43:17 2016 (r300148) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2016 +.Dd May 18, 2016 .Dt DDB 4 .Os .Sh NAME @@ -542,6 +542,11 @@ Output is similar to but also includes the address of the TTY structure. .\" .Pp +.It Ic show Cm all vnets +Show the same output as "show vnet" does, but lists all +virtualized network stacks within the system. +.\" +.Pp .It Ic show Cm allchains Show the same information like "show lockchain" does, but for every thread in the system. @@ -1060,6 +1065,13 @@ Currently, it is not possible to use thi is compiled in the kernel. .\" .Pp +.It Ic show Cm vnet Ar addr +Prints virtualized network stack +.Vt struct vnet +structure present at the address +.Ar addr . +.\" +.Pp .It Ic show Cm vnode Op Ar addr Prints vnode .Vt struct vnode Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Wed May 18 14:18:03 2016 (r300147) +++ head/sys/net/vnet.c Wed May 18 14:43:17 2016 (r300148) @@ -690,27 +690,45 @@ vnet_log_recursion(struct vnet *old_vnet * DDB(4). */ #ifdef DDB -DB_SHOW_COMMAND(vnets, db_show_vnets) +static void +db_vnet_print(struct vnet *vnet) +{ + + db_printf("vnet = %p\n", vnet); + db_printf(" vnet_magic_n = %#08x (%s, orig %#08x)\n", + vnet->vnet_magic_n, + (vnet->vnet_magic_n == VNET_MAGIC_N) ? + "ok" : "mismatch", VNET_MAGIC_N); + db_printf(" vnet_ifcnt = %u\n", vnet->vnet_ifcnt); + db_printf(" vnet_sockcnt = %u\n", vnet->vnet_sockcnt); + db_printf(" vnet_data_mem = %p\n", vnet->vnet_data_mem); + db_printf(" vnet_data_base = %#jx\n", + (uintmax_t)vnet->vnet_data_base); + db_printf("\n"); +} + +DB_SHOW_ALL_COMMAND(vnets, db_show_all_vnets) { VNET_ITERATOR_DECL(vnet_iter); VNET_FOREACH(vnet_iter) { - db_printf("vnet = %p\n", vnet_iter); - db_printf(" vnet_magic_n = 0x%x (%s, orig 0x%x)\n", - vnet_iter->vnet_magic_n, - (vnet_iter->vnet_magic_n == VNET_MAGIC_N) ? - "ok" : "mismatch", VNET_MAGIC_N); - db_printf(" vnet_ifcnt = %u\n", vnet_iter->vnet_ifcnt); - db_printf(" vnet_sockcnt = %u\n", vnet_iter->vnet_sockcnt); - db_printf(" vnet_data_mem = %p\n", vnet_iter->vnet_data_mem); - db_printf(" vnet_data_base = 0x%jx\n", - (uintmax_t)vnet_iter->vnet_data_base); - db_printf("\n"); + db_vnet_print(vnet_iter); if (db_pager_quit) break; } } +DB_SHOW_COMMAND(vnet, db_show_vnet) +{ + + if (!have_addr) { + db_printf("usage: show vnet \n"); + return; + } + + db_vnet_print((struct vnet *)addr); +} + static void db_show_vnet_print_vs(struct vnet_sysinit *vs, int ddb) { @@ -734,7 +752,7 @@ db_show_vnet_print_vs(struct vnet_sysini sym = db_search_symbol((vm_offset_t)vs->func, DB_STGY_PROC, &offset); db_symbol_values(sym, &funcname, NULL); xprint("%s(%p)\n", (vsname != NULL) ? vsname : "", vs); - xprint(" 0x%08x 0x%08x\n", vs->subsystem, vs->order); + xprint(" %#08x %#08x\n", vs->subsystem, vs->order); xprint(" %p(%s)(%p)\n", vs->func, (funcname != NULL) ? funcname : "", vs->arg); #undef xprint From owner-svn-src-all@freebsd.org Wed May 18 15:05:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CABB6B416B0; Wed, 18 May 2016 15:05:47 +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 9844E1BB7; Wed, 18 May 2016 15:05:47 +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 u4IF5kXa018851; Wed, 18 May 2016 15:05:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IF5ixZ018827; Wed, 18 May 2016 15:05:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605181505.u4IF5ixZ018827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 18 May 2016 15:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300149 - in head/sys: arm/allwinner arm/allwinner/a10 arm/arm arm/broadcom/bcm2835 arm/mv arm/nvidia arm/ti arm/ti/omap4 arm64/arm64 kern mips/mediatek mips/mips sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:05:47 -0000 Author: andrew Date: Wed May 18 15:05:44 2016 New Revision: 300149 URL: https://svnweb.freebsd.org/changeset/base/300149 Log: Return the struct intr_pic pointer from intr_pic_register. This will be needed in later changes where we may not be able to lock the pic list lock to perform a lookup, e.g. from within interrupt context. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/allwinner/a10/a10_intc.c head/sys/arm/allwinner/aw_nmi.c head/sys/arm/arm/gic.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2836.c head/sys/arm/mv/mpic.c head/sys/arm/nvidia/tegra_gpio.c head/sys/arm/nvidia/tegra_lic.c head/sys/arm/ti/aintc.c head/sys/arm/ti/omap4/omap4_wugen.c head/sys/arm/ti/ti_gpio.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/kern/subr_intr.c head/sys/mips/mediatek/mtk_gpio_v1.c head/sys/mips/mediatek/mtk_gpio_v2.c head/sys/mips/mediatek/mtk_intr_gic.c head/sys/mips/mediatek/mtk_intr_v1.c head/sys/mips/mediatek/mtk_intr_v2.c head/sys/mips/mediatek/mtk_pcie.c head/sys/mips/mips/mips_pic.c head/sys/sys/intr.h Modified: head/sys/arm/allwinner/a10/a10_intc.c ============================================================================== --- head/sys/arm/allwinner/a10/a10_intc.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/allwinner/a10/a10_intc.c Wed May 18 15:05:44 2016 (r300149) @@ -250,6 +250,7 @@ a10_intr(void *arg) static int a10_intr_pic_attach(struct a10_aintc_softc *sc) { + struct intr_pic *pic; int error; uint32_t irq; const char *name; @@ -266,9 +267,9 @@ a10_intr_pic_attach(struct a10_aintc_sof } xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); - error = intr_pic_register(sc->sc_dev, xref); - if (error != 0) - return (error); + pic = intr_pic_register(sc->sc_dev, xref); + if (pic == NULL) + return (ENXIO); return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc, 0)); } Modified: head/sys/arm/allwinner/aw_nmi.c ============================================================================== --- head/sys/arm/allwinner/aw_nmi.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/allwinner/aw_nmi.c Wed May 18 15:05:44 2016 (r300149) @@ -362,7 +362,7 @@ aw_nmi_attach(device_t dev) device_get_nameunit(sc->dev), sc->intr.irq) != 0) goto error; - if (intr_pic_register(dev, (intptr_t)xref) != 0) { + if (intr_pic_register(dev, (intptr_t)xref) == NULL) { device_printf(dev, "could not register pic\n"); goto error; } Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/arm/gic.c Wed May 18 15:05:44 2016 (r300149) @@ -711,7 +711,7 @@ arm_gic_attach(device_t dev) * Now, when everything is initialized, it's right time to * register interrupt controller to interrupt framefork. */ - if (intr_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); goto cleanup; } Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 18 15:05:44 2016 (r300149) @@ -1045,8 +1045,11 @@ bcm_gpio_pic_attach(struct bcm_gpio_soft if (error != 0) return (error); /* XXX deregister ISRCs */ } - return (intr_pic_register(sc->sc_dev, - OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)))); + if (intr_pic_register(sc->sc_dev, + OF_xref_from_node(ofw_bus_get_node(sc->sc_dev))) == NULL) + return (ENXIO); + + return (0); } static int Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed May 18 15:05:44 2016 (r300149) @@ -341,7 +341,10 @@ bcm_intc_pic_register(struct bcm_intc_so if (error != 0) return (error); } - return (intr_pic_register(sc->sc_dev, xref)); + if (intr_pic_register(sc->sc_dev, xref) == NULL) + return (ENXIO); + + return (0); } #endif Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Wed May 18 15:05:44 2016 (r300149) @@ -598,6 +598,7 @@ static int bcm_lintc_pic_attach(struct bcm_lintc_softc *sc) { struct bcm_lintc_irqsrc *bisrcs; + struct intr_pic *pic; int error; u_int flags; uint32_t irq; @@ -653,9 +654,9 @@ bcm_lintc_pic_attach(struct bcm_lintc_so } xref = OF_xref_from_node(ofw_bus_get_node(sc->bls_dev)); - error = intr_pic_register(sc->bls_dev, xref); - if (error != 0) - return (error); + pic = intr_pic_register(sc->bls_dev, xref); + if (pic == NULL) + return (ENXIO); return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc, 0)); } Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/mv/mpic.c Wed May 18 15:05:44 2016 (r300149) @@ -274,7 +274,7 @@ mv_mpic_attach(device_t dev) bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); return (ENXIO); } - if (intr_pic_register(dev, OF_xref_from_device(dev)) != 0) { + if (intr_pic_register(dev, OF_xref_from_device(dev)) == NULL) { device_printf(dev, "could not register PIC\n"); bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); return (ENXIO); Modified: head/sys/arm/nvidia/tegra_gpio.c ============================================================================== --- head/sys/arm/nvidia/tegra_gpio.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/nvidia/tegra_gpio.c Wed May 18 15:05:44 2016 (r300149) @@ -452,8 +452,11 @@ tegra_gpio_pic_attach(struct tegra_gpio_ if (error != 0) return (error); /* XXX deregister ISRCs */ } - return (intr_pic_register(sc->dev, - OF_xref_from_node(ofw_bus_get_node(sc->dev)))); + if (intr_pic_register(sc->dev, + OF_xref_from_node(ofw_bus_get_node(sc->dev))) == NULL) + return (ENXIO); + + return (0); } static int Modified: head/sys/arm/nvidia/tegra_lic.c ============================================================================== --- head/sys/arm/nvidia/tegra_lic.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/nvidia/tegra_lic.c Wed May 18 15:05:44 2016 (r300149) @@ -233,7 +233,7 @@ tegra_lic_attach(device_t dev) } - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { device_printf(dev, "Cannot register PIC\n"); goto fail; } Modified: head/sys/arm/ti/aintc.c ============================================================================== --- head/sys/arm/ti/aintc.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/ti/aintc.c Wed May 18 15:05:44 2016 (r300149) @@ -220,6 +220,7 @@ ti_aintc_post_filter(device_t dev, struc static int ti_aintc_pic_attach(struct ti_aintc_softc *sc) { + struct intr_pic *pic; int error; uint32_t irq; const char *name; @@ -236,9 +237,9 @@ ti_aintc_pic_attach(struct ti_aintc_soft } xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); - error = intr_pic_register(sc->sc_dev, xref); - if (error != 0) - return (error); + pic = intr_pic_register(sc->sc_dev, xref); + if (pic == NULL) + return (ENXIO); return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, 0)); } Modified: head/sys/arm/ti/omap4/omap4_wugen.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_wugen.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/ti/omap4/omap4_wugen.c Wed May 18 15:05:44 2016 (r300149) @@ -210,7 +210,7 @@ omap4_wugen_attach(device_t dev) return (ENXIO); } - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { device_printf(dev, "can't register PIC\n"); goto fail; } Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm/ti/ti_gpio.c Wed May 18 15:05:44 2016 (r300149) @@ -904,8 +904,11 @@ ti_gpio_pic_attach(struct ti_gpio_softc if (error != 0) return (error); /* XXX deregister ISRCs */ } - return (intr_pic_register(sc->sc_dev, - OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)))); + if (intr_pic_register(sc->sc_dev, + OF_xref_from_node(ofw_bus_get_node(sc->sc_dev))) == NULL) + return (ENXIO); + + return (0); } static int Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/arm64/arm64/gic_v3_fdt.c Wed May 18 15:05:44 2016 (r300149) @@ -139,7 +139,7 @@ gic_v3_fdt_attach(device_t dev) #ifdef INTRNG xref = OF_xref_from_node(ofw_bus_get_node(dev)); - if (intr_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); goto error; } @@ -172,7 +172,7 @@ error: /* Failure so free resources */ gic_v3_detach(dev); - return (err); + return (ENXIO); } /* OFW bus interface */ Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/kern/subr_intr.c Wed May 18 15:05:44 2016 (r300149) @@ -911,22 +911,22 @@ pic_destroy(device_t dev, intptr_t xref) /* * Register interrupt controller. */ -int +struct intr_pic * intr_pic_register(device_t dev, intptr_t xref) { struct intr_pic *pic; if (dev == NULL) - return (EINVAL); + return (NULL); pic = pic_create(dev, xref); if (pic == NULL) - return (ENOMEM); + return (NULL); pic->pic_flags |= FLAG_PIC; debugf("PIC %p registered for %s \n", pic, device_get_nameunit(dev), dev, xref); - return (0); + return (pic); } /* Modified: head/sys/mips/mediatek/mtk_gpio_v1.c ============================================================================== --- head/sys/mips/mediatek/mtk_gpio_v1.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/mips/mediatek/mtk_gpio_v1.c Wed May 18 15:05:44 2016 (r300149) @@ -308,7 +308,7 @@ mtk_gpio_attach(device_t dev) goto fail; } - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { device_printf(dev, "could not register PIC\n"); goto fail; } Modified: head/sys/mips/mediatek/mtk_gpio_v2.c ============================================================================== --- head/sys/mips/mediatek/mtk_gpio_v2.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/mips/mediatek/mtk_gpio_v2.c Wed May 18 15:05:44 2016 (r300149) @@ -299,7 +299,7 @@ mtk_gpio_attach(device_t dev) goto fail; } - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { device_printf(dev, "could not register PIC\n"); goto fail; } Modified: head/sys/mips/mediatek/mtk_intr_gic.c ============================================================================== --- head/sys/mips/mediatek/mtk_intr_gic.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/mips/mediatek/mtk_intr_gic.c Wed May 18 15:05:44 2016 (r300149) @@ -213,7 +213,7 @@ mtk_gic_attach(device_t dev) * Now, when everything is initialized, it's right time to * register interrupt controller to interrupt framefork. */ - if (intr_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); goto cleanup; } Modified: head/sys/mips/mediatek/mtk_intr_v1.c ============================================================================== --- head/sys/mips/mediatek/mtk_intr_v1.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/mips/mediatek/mtk_intr_v1.c Wed May 18 15:05:44 2016 (r300149) @@ -201,7 +201,7 @@ mtk_pic_attach(device_t dev) * Now, when everything is initialized, it's right time to * register interrupt controller to interrupt framefork. */ - if (intr_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); goto cleanup; } Modified: head/sys/mips/mediatek/mtk_intr_v2.c ============================================================================== --- head/sys/mips/mediatek/mtk_intr_v2.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/mips/mediatek/mtk_intr_v2.c Wed May 18 15:05:44 2016 (r300149) @@ -196,7 +196,7 @@ mtk_pic_attach(device_t dev) * Now, when everything is initialized, it's right time to * register interrupt controller to interrupt framefork. */ - if (intr_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); goto cleanup; } Modified: head/sys/mips/mediatek/mtk_pcie.c ============================================================================== --- head/sys/mips/mediatek/mtk_pcie.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/mips/mediatek/mtk_pcie.c Wed May 18 15:05:44 2016 (r300149) @@ -319,7 +319,7 @@ mtk_pci_attach(device_t dev) } /* Register ourselves as an interrupt controller */ - if (intr_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); goto cleanup_rman; } Modified: head/sys/mips/mips/mips_pic.c ============================================================================== --- head/sys/mips/mips/mips_pic.c Wed May 18 14:43:17 2016 (r300148) +++ head/sys/mips/mips/mips_pic.c Wed May 18 15:05:44 2016 (r300149) @@ -223,7 +223,7 @@ mips_pic_attach(device_t dev) * Now, when everything is initialized, it's right time to * register interrupt controller to interrupt framefork. */ - if (intr_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); goto cleanup; } Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Wed May 18 14:43:17 2016 (r300148) +++ head/sys/sys/intr.h Wed May 18 15:05:44 2016 (r300149) @@ -110,7 +110,7 @@ bool intr_isrc_init_on_cpu(struct intr_i int intr_isrc_dispatch(struct intr_irqsrc *, struct trapframe *); u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); -int intr_pic_register(device_t, intptr_t); +struct intr_pic *intr_pic_register(device_t, intptr_t); int intr_pic_deregister(device_t, intptr_t); int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); From owner-svn-src-all@freebsd.org Wed May 18 15:11:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC37B418A2 for ; Wed, 18 May 2016 15:11:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm22-vm1.bullet.mail.bf1.yahoo.com (nm22-vm1.bullet.mail.bf1.yahoo.com [98.139.212.127]) (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 DB46110DB for ; Wed, 18 May 2016 15:11:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463584309; bh=r9OxHjBieOzUw5Iq/mqugiBB1mRokMn1TEI6K3zxlZw=; h=From:Subject:To:References:Cc:Date:In-Reply-To:From:Subject; b=DLhTi8yC50Ut1o5CV+yrahdJqVI7Bq969U2VW2rMtBIdsZ+jo4h/GO3xMDX0Avk8vCkn3yAkjHcTWWQTk5osviRddeoL3q4EV7z+fOdDza44NTXKGLuC2l7ZV9W2vnqAeP9Yt1c9pudT35erm+Zr2D6bASUYk7q3188AwJke1muYWgFjgUxDBtGZZ6ir9+tNx6S5y+v7yTBqsgX7j+/3y9fPV+kLntcD7d/cRhw+YrwfzZ2ZXJXlX0f1O7gbvwYb8SNhJZU8ciHMGypBub/r9lJZjcZrfJ8jgMc4vnhdj4OtSMS3qve6w8pVaOSDzM0JGPwx08Mg6rpH7jJ1i3+YNQ== Received: from [66.196.81.172] by nm22.bullet.mail.bf1.yahoo.com with NNFMP; 18 May 2016 15:11:49 -0000 Received: from [98.139.211.202] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 18 May 2016 15:11:49 -0000 Received: from [127.0.0.1] by smtp211.mail.bf1.yahoo.com with NNFMP; 18 May 2016 15:11:49 -0000 X-Yahoo-Newman-Id: 470578.99196.bm@smtp211.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: jRmZ7qIVM1mxBEVVB3Jt_m1GFuQJW99T0F4R0vsNAuKareI NgiQQxFRwRxJHRwnrnKF31EZJkQZTGVbtAxgSOJFgeLA2ikEz3Px15Ap2un1 qVjUhZm_ebC5m_Tc4MoCYn1sXi2o93JUf3QutUfoG1K9GCzd1kPWKv.TqxSE s8uF5cvRXE1YudLlUeq8bH8CNNH6317Gh8Jl_Xt1i6dcYyxA0XnFNybUSaJi D6zKu_5wwfzoUvjZj5n93KtbchrYYbYmHhgSfAeMlRPdgUFXrxmVRXXdpC8U rYoMEiUpq7wBIMiq8wxfjyT0iJb6T7Fy2zsLyvcB0xOn1_Mdn8.THeIFc9yB obE.IEt7JhiSCiR0GAUKiyj136wB59kisY.t8mBWB2tfXevv8GY7zVySb1._ 5UrNT12k1UbHiyqTuQlT9.Q5ItKbJKhfKRkXDnNyh4oEhrR4E5CGU_XcPgwt .oA8AS5BgiVbYTWQUiFNVL0ztOpI67GclOdOrZwfj6XciMzH23sujhu8pEhe oBBK8yC6qjve1EdKlZnPmtSosSEt7qply X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf From: Pedro Giffuni Subject: Re: svn commit: r300098 - head/usr.sbin/makefs To: Ed Maste References: <201605180022.u4I0MqSU048808@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <88775237-2a05-4c6f-5c15-0b7a19ce6d46@FreeBSD.org> Date: Wed, 18 May 2016 10:11:58 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:11:57 -0000 On 05/17/16 20:12, Ed Maste wrote: > On 18 May 2016 at 00:22, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Wed May 18 00:22:52 2016 >> New Revision: 300098 >> URL: https://svnweb.freebsd.org/changeset/base/300098 >> >> Log: >> makefs(8): Clarify the comment concerning seeding. >> >> Avoid giving the impression makefs currently supports reproduceable >> builds. > > Thanks! > > It might make sense to seed based on SOURCE_DATE_EPOCH > (https://reproducible-builds.org/specs/source-date-epoch/) if set, and > later on we ought to add an option to set the seed on the command > line. > Interesting. FWIW, NetBSD did some other changes but they basically removed the seeding which may be mildly dangerous in this case (makefs uses random() in other places without seeding). > But, there are a lot of other reproducible build tasks that are > probably more important to tackle before this. > Yes, I am not really very interested in reproducible builds but this is one of the cases where we cannot go blindly replacing random() with arc4random(). Pedro. From owner-svn-src-all@freebsd.org Wed May 18 15:15:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A68B4193E for ; Wed, 18 May 2016 15:15:32 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::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 229FC1337 for ; Wed, 18 May 2016 15:15:32 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x22b.google.com with SMTP id u64so21449288lff.3 for ; Wed, 18 May 2016 08:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ci4Ej8w214ssjPyONw9choK9q7J2Tc4dsm3oVVCn+A0=; b=AWy7cYtbwgGIeJ23dX2ignkRfYjGbGvxIET9zwsLH706yqu7F7roGgxNca4tuYh+PU oCiDDqsrW8Nfhr90y5ZXfuVdEUfylXMAbRogBDG4c4TuFAe+XuibpTxWPm3FmleWpKgg RVbpqOQHT521ip1yzL21+wT3P5Pdg1P0mWcHkcwD7g516ulqdU/632BZimEaV/NM5WDv 0Cy/Pgt8IBzFP56fM1YX/A29d6o5WX+XqdwjUHbeiCkA6XnHDLyzYaJsbO53bv3FgRXN j6EG+H5OCeMTnNWLxM7CuEAmriiuu63C2yHIJnaHDH9sjS28RA9SoJDGgmD2SkIVwG+h 5+Rg== 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=ci4Ej8w214ssjPyONw9choK9q7J2Tc4dsm3oVVCn+A0=; b=FG3/is8xLQcKYqK/oWW723J05KfZ6y/A3fbnGwPuKWsTVc3EIBiMioxG6bGqcm2pe+ OvzOJvZVsHT8I3kozh4pC003uC635PwPi/RHAIINMP3xurYWCPcSmvA9AQVyd2LU2BFi y0f8a+5c3AfnD0yWPVYELxGS27l6oGAQyqAm7VCxckOQI1VwRU1Y+dgEptEdeDCpYqVw YCZ4HYOOTIndZ/OaNUIz6Yh5IbvaH5rZ2HAHUXSiaXP7jodHq0EYkBEvv4ne3ZpjR5za bKHG98UYWedKAQn0VSW4oTfhZ4Jd3y7XgxNAln3cIn76vN4AQYEvVeH/FZryCsYp0SU6 D9qw== X-Gm-Message-State: AOPr4FWKgoTgW6sDN60jVcuu6FbPXJPaY1aI6srR8fxnyRD/d7wOpbFP6YkhVg2tHXvDYEgD0797C34kyMwfeg== X-Received: by 10.25.212.21 with SMTP id l21mr2823281lfg.144.1463584529990; Wed, 18 May 2016 08:15:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.68 with HTTP; Wed, 18 May 2016 08:15:10 -0700 (PDT) In-Reply-To: <201605181505.u4IF5ixZ018827@repo.freebsd.org> References: <201605181505.u4IF5ixZ018827@repo.freebsd.org> From: Zbigniew Bodek Date: Wed, 18 May 2016 17:15:10 +0200 Message-ID: Subject: Re: svn commit: r300149 - in head/sys: arm/allwinner arm/allwinner/a10 arm/arm arm/broadcom/bcm2835 arm/mv arm/nvidia arm/ti arm/ti/omap4 arm64/arm64 kern mips/mediatek mips/mips sys To: Andrew Turner 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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:15:32 -0000 2016-05-18 17:05 GMT+02:00 Andrew Turner : > Author: andrew > Date: Wed May 18 15:05:44 2016 > New Revision: 300149 > URL: https://svnweb.freebsd.org/changeset/base/300149 > > Log: > Return the struct intr_pic pointer from intr_pic_register. This will be > needed in later changes where we may not be able to lock the pic list > lock > to perform a lookup, e.g. from within interrupt context. > > Obtained from: ABT Systems Ltd > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/arm/allwinner/a10/a10_intc.c > head/sys/arm/allwinner/aw_nmi.c > head/sys/arm/arm/gic.c > head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c > head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > head/sys/arm/broadcom/bcm2835/bcm2836.c > head/sys/arm/mv/mpic.c > head/sys/arm/nvidia/tegra_gpio.c > head/sys/arm/nvidia/tegra_lic.c > head/sys/arm/ti/aintc.c > head/sys/arm/ti/omap4/omap4_wugen.c > head/sys/arm/ti/ti_gpio.c > head/sys/arm64/arm64/gic_v3_fdt.c > head/sys/kern/subr_intr.c > head/sys/mips/mediatek/mtk_gpio_v1.c > head/sys/mips/mediatek/mtk_gpio_v2.c > head/sys/mips/mediatek/mtk_intr_gic.c > head/sys/mips/mediatek/mtk_intr_v1.c > head/sys/mips/mediatek/mtk_intr_v2.c > head/sys/mips/mediatek/mtk_pcie.c > head/sys/mips/mips/mips_pic.c > head/sys/sys/intr.h > > Modified: head/sys/arm/allwinner/a10/a10_intc.c > > ============================================================================== > --- head/sys/arm/allwinner/a10/a10_intc.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/allwinner/a10/a10_intc.c Wed May 18 15:05:44 2016 > (r300149) > @@ -250,6 +250,7 @@ a10_intr(void *arg) > static int > a10_intr_pic_attach(struct a10_aintc_softc *sc) > { > + struct intr_pic *pic; > int error; > uint32_t irq; > const char *name; > @@ -266,9 +267,9 @@ a10_intr_pic_attach(struct a10_aintc_sof > } > > xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); > - error = intr_pic_register(sc->sc_dev, xref); > - if (error != 0) > - return (error); > + pic = intr_pic_register(sc->sc_dev, xref); > + if (pic == NULL) > + return (ENXIO); > > return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc, 0)); > } > > Modified: head/sys/arm/allwinner/aw_nmi.c > > ============================================================================== > --- head/sys/arm/allwinner/aw_nmi.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/allwinner/aw_nmi.c Wed May 18 15:05:44 2016 > (r300149) > @@ -362,7 +362,7 @@ aw_nmi_attach(device_t dev) > device_get_nameunit(sc->dev), sc->intr.irq) != 0) > goto error; > > - if (intr_pic_register(dev, (intptr_t)xref) != 0) { > + if (intr_pic_register(dev, (intptr_t)xref) == NULL) { > device_printf(dev, "could not register pic\n"); > goto error; > } > > Modified: head/sys/arm/arm/gic.c > > ============================================================================== > --- head/sys/arm/arm/gic.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/arm/gic.c Wed May 18 15:05:44 2016 (r300149) > @@ -711,7 +711,7 @@ arm_gic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c > > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 18 > 14:43:17 2016 (r300148) > +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 18 > 15:05:44 2016 (r300149) > @@ -1045,8 +1045,11 @@ bcm_gpio_pic_attach(struct bcm_gpio_soft > if (error != 0) > return (error); /* XXX deregister ISRCs */ > } > - return (intr_pic_register(sc->sc_dev, > - OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)))); > + if (intr_pic_register(sc->sc_dev, > + OF_xref_from_node(ofw_bus_get_node(sc->sc_dev))) == NULL) > + return (ENXIO); > + > + return (0); > } > > static int > > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed May 18 > 14:43:17 2016 (r300148) > +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed May 18 > 15:05:44 2016 (r300149) > @@ -341,7 +341,10 @@ bcm_intc_pic_register(struct bcm_intc_so > if (error != 0) > return (error); > } > - return (intr_pic_register(sc->sc_dev, xref)); > + if (intr_pic_register(sc->sc_dev, xref) == NULL) > + return (ENXIO); > + > + return (0); > } > #endif > > > Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c > > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/bcm2836.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Wed May 18 15:05:44 2016 > (r300149) > @@ -598,6 +598,7 @@ static int > bcm_lintc_pic_attach(struct bcm_lintc_softc *sc) > { > struct bcm_lintc_irqsrc *bisrcs; > + struct intr_pic *pic; > int error; > u_int flags; > uint32_t irq; > @@ -653,9 +654,9 @@ bcm_lintc_pic_attach(struct bcm_lintc_so > } > > xref = OF_xref_from_node(ofw_bus_get_node(sc->bls_dev)); > - error = intr_pic_register(sc->bls_dev, xref); > - if (error != 0) > - return (error); > + pic = intr_pic_register(sc->bls_dev, xref); > + if (pic == NULL) > + return (ENXIO); > > return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc, > 0)); > } > > Modified: head/sys/arm/mv/mpic.c > > ============================================================================== > --- head/sys/arm/mv/mpic.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/mv/mpic.c Wed May 18 15:05:44 2016 (r300149) > @@ -274,7 +274,7 @@ mv_mpic_attach(device_t dev) > bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); > return (ENXIO); > } > - if (intr_pic_register(dev, OF_xref_from_device(dev)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_device(dev)) == NULL) { > device_printf(dev, "could not register PIC\n"); > bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); > return (ENXIO); > > Modified: head/sys/arm/nvidia/tegra_gpio.c > > ============================================================================== > --- head/sys/arm/nvidia/tegra_gpio.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/nvidia/tegra_gpio.c Wed May 18 15:05:44 2016 > (r300149) > @@ -452,8 +452,11 @@ tegra_gpio_pic_attach(struct tegra_gpio_ > if (error != 0) > return (error); /* XXX deregister ISRCs */ > } > - return (intr_pic_register(sc->dev, > - OF_xref_from_node(ofw_bus_get_node(sc->dev)))); > + if (intr_pic_register(sc->dev, > + OF_xref_from_node(ofw_bus_get_node(sc->dev))) == NULL) > + return (ENXIO); > + > + return (0); > } > > static int > > Modified: head/sys/arm/nvidia/tegra_lic.c > > ============================================================================== > --- head/sys/arm/nvidia/tegra_lic.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/nvidia/tegra_lic.c Wed May 18 15:05:44 2016 > (r300149) > @@ -233,7 +233,7 @@ tegra_lic_attach(device_t dev) > } > > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "Cannot register PIC\n"); > goto fail; > } > > Modified: head/sys/arm/ti/aintc.c > > ============================================================================== > --- head/sys/arm/ti/aintc.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/ti/aintc.c Wed May 18 15:05:44 2016 (r300149) > @@ -220,6 +220,7 @@ ti_aintc_post_filter(device_t dev, struc > static int > ti_aintc_pic_attach(struct ti_aintc_softc *sc) > { > + struct intr_pic *pic; > int error; > uint32_t irq; > const char *name; > @@ -236,9 +237,9 @@ ti_aintc_pic_attach(struct ti_aintc_soft > } > > xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); > - error = intr_pic_register(sc->sc_dev, xref); > - if (error != 0) > - return (error); > + pic = intr_pic_register(sc->sc_dev, xref); > + if (pic == NULL) > + return (ENXIO); > > return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, > 0)); > } > > Modified: head/sys/arm/ti/omap4/omap4_wugen.c > > ============================================================================== > --- head/sys/arm/ti/omap4/omap4_wugen.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/ti/omap4/omap4_wugen.c Wed May 18 15:05:44 2016 > (r300149) > @@ -210,7 +210,7 @@ omap4_wugen_attach(device_t dev) > return (ENXIO); > } > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "can't register PIC\n"); > goto fail; > } > > Modified: head/sys/arm/ti/ti_gpio.c > > ============================================================================== > --- head/sys/arm/ti/ti_gpio.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/ti/ti_gpio.c Wed May 18 15:05:44 2016 (r300149) > @@ -904,8 +904,11 @@ ti_gpio_pic_attach(struct ti_gpio_softc > if (error != 0) > return (error); /* XXX deregister ISRCs */ > } > - return (intr_pic_register(sc->sc_dev, > - OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)))); > + if (intr_pic_register(sc->sc_dev, > + OF_xref_from_node(ofw_bus_get_node(sc->sc_dev))) == NULL) > + return (ENXIO); > + > + return (0); > } > > static int > > Modified: head/sys/arm64/arm64/gic_v3_fdt.c > > ============================================================================== > --- head/sys/arm64/arm64/gic_v3_fdt.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm64/arm64/gic_v3_fdt.c Wed May 18 15:05:44 2016 > (r300149) > @@ -139,7 +139,7 @@ gic_v3_fdt_attach(device_t dev) > > #ifdef INTRNG > xref = OF_xref_from_node(ofw_bus_get_node(dev)); > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto error; > } > @@ -172,7 +172,7 @@ error: > /* Failure so free resources */ > gic_v3_detach(dev); > > - return (err); > + return (ENXIO); > Few line above we have: err = gic_v3_attach(dev); if (err != 0) goto error; So now we would not return error code from gic_v3_attach() but always ENXIO... > } > > /* OFW bus interface */ > > Modified: head/sys/kern/subr_intr.c > > ============================================================================== > --- head/sys/kern/subr_intr.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/kern/subr_intr.c Wed May 18 15:05:44 2016 (r300149) > @@ -911,22 +911,22 @@ pic_destroy(device_t dev, intptr_t xref) > /* > * Register interrupt controller. > */ > -int > +struct intr_pic * > intr_pic_register(device_t dev, intptr_t xref) > { > struct intr_pic *pic; > > if (dev == NULL) > - return (EINVAL); > + return (NULL); > pic = pic_create(dev, xref); > if (pic == NULL) > - return (ENOMEM); > + return (NULL); > > pic->pic_flags |= FLAG_PIC; > > debugf("PIC %p registered for %s \n", pic, > device_get_nameunit(dev), dev, xref); > - return (0); > + return (pic); > } > > /* > > Modified: head/sys/mips/mediatek/mtk_gpio_v1.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_gpio_v1.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_gpio_v1.c Wed May 18 15:05:44 2016 > (r300149) > @@ -308,7 +308,7 @@ mtk_gpio_attach(device_t dev) > goto fail; > } > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto fail; > } > > Modified: head/sys/mips/mediatek/mtk_gpio_v2.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_gpio_v2.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_gpio_v2.c Wed May 18 15:05:44 2016 > (r300149) > @@ -299,7 +299,7 @@ mtk_gpio_attach(device_t dev) > goto fail; > } > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto fail; > } > > Modified: head/sys/mips/mediatek/mtk_intr_gic.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_intr_gic.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_intr_gic.c Wed May 18 15:05:44 2016 > (r300149) > @@ -213,7 +213,7 @@ mtk_gic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/mips/mediatek/mtk_intr_v1.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_intr_v1.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_intr_v1.c Wed May 18 15:05:44 2016 > (r300149) > @@ -201,7 +201,7 @@ mtk_pic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/mips/mediatek/mtk_intr_v2.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_intr_v2.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_intr_v2.c Wed May 18 15:05:44 2016 > (r300149) > @@ -196,7 +196,7 @@ mtk_pic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/mips/mediatek/mtk_pcie.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_pcie.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_pcie.c Wed May 18 15:05:44 2016 > (r300149) > @@ -319,7 +319,7 @@ mtk_pci_attach(device_t dev) > } > > /* Register ourselves as an interrupt controller */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup_rman; > } > > Modified: head/sys/mips/mips/mips_pic.c > > ============================================================================== > --- head/sys/mips/mips/mips_pic.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mips/mips_pic.c Wed May 18 15:05:44 2016 > (r300149) > @@ -223,7 +223,7 @@ mips_pic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/sys/intr.h > > ============================================================================== > --- head/sys/sys/intr.h Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/sys/intr.h Wed May 18 15:05:44 2016 (r300149) > @@ -110,7 +110,7 @@ bool intr_isrc_init_on_cpu(struct intr_i > int intr_isrc_dispatch(struct intr_irqsrc *, struct trapframe *); > u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); > > -int intr_pic_register(device_t, intptr_t); > +struct intr_pic *intr_pic_register(device_t, intptr_t); > int intr_pic_deregister(device_t, intptr_t); > int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, > u_int); > > _______________________________________________ > 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" > From owner-svn-src-all@freebsd.org Wed May 18 15:18:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87741B419A7; Wed, 18 May 2016 15:18:19 +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 47F87164C; Wed, 18 May 2016 15:18: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 u4IFIIux021909; Wed, 18 May 2016 15:18:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFII8l021908; Wed, 18 May 2016 15:18:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605181518.u4IFII8l021908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 May 2016 15:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300150 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:18:19 -0000 Author: pfg Date: Wed May 18 15:18:18 2016 New Revision: 300150 URL: https://svnweb.freebsd.org/changeset/base/300150 Log: Minor spelling fixes. Modified: head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed May 18 15:05:44 2016 (r300149) +++ head/sys/boot/efi/loader/Makefile Wed May 18 15:18:18 2016 (r300150) @@ -35,10 +35,10 @@ CWARNFLAGS.zfs.c+= -Wno-missing-prototyp # The printf in libstand implements CHAR16 strings always. CWARNFLAGS.main.c+= -Wno-format -# We implement a slightly non-stadard %S in that it always takes a -# CHAR16 that's common in UEFI-land instaed of a wchar_t. This only -# seems to matter on arm64 where wchar_t defaults to a int instead of -# a short. There's no good cast to use here, so just ignore the +# We implement a slightly non-standard %S in that it always takes a +# CHAR16 that's common in UEFI-land instead of a wchar_t. This only +# seems to matter on arm64 where wchar_t defaults to an int instead +# of a short. There's no good cast to use here so just ignore the # warnings for now. CWARNFLAGS.main.c+= -Wno-format From owner-svn-src-all@freebsd.org Wed May 18 15:24:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F44B41B44; Wed, 18 May 2016 15:24:12 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id CAA021BAC; Wed, 18 May 2016 15:24:11 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 9D59BD78FE; Wed, 18 May 2016 15:24:10 +0000 (UTC) Date: Wed, 18 May 2016 16:24:09 +0100 From: Andrew Turner To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300149 - in head/sys: arm/allwinner arm/allwinner/a10 arm/arm arm/broadcom/bcm2835 arm/mv arm/nvidia arm/ti arm/ti/omap4 arm64/arm64 kern mips/mediatek mips/mips sys Message-ID: <20160518162409.1074344e@zapp> In-Reply-To: References: <201605181505.u4IF5ixZ018827@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:24:12 -0000 On Wed, 18 May 2016 17:15:10 +0200 Zbigniew Bodek wrote: > 2016-05-18 17:05 GMT+02:00 Andrew Turner : ... > > #ifdef INTRNG > > xref = OF_xref_from_node(ofw_bus_get_node(dev)); > > - if (intr_pic_register(dev, xref) != 0) { > > + if (intr_pic_register(dev, xref) == NULL) { > > device_printf(dev, "could not register PIC\n"); > > goto error; > > } > > @@ -172,7 +172,7 @@ error: > > /* Failure so free resources */ > > gic_v3_detach(dev); > > > > - return (err); > > + return (ENXIO); > > > > > Few line above we have: > err = gic_v3_attach(dev); > if (err != 0) > goto error; > > So now we would not return error code from gic_v3_attach() but always > ENXIO... The error value doesn't matter, as long as it's non-zero. This also fixes the return value in the intrng case if either of intr_pic_register or intr_pic_claim_root fail. You might get a little information from the return value being printed, however it would be more useful to have verbose logging to print an error message. In all of these failure cases there isn't much we can do as there is no root interrupt controller, the boot will fail later on when we enable interrupts. Andrew From owner-svn-src-all@freebsd.org Wed May 18 15:25:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5B0EB41B99; Wed, 18 May 2016 15:25:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 971591D81; Wed, 18 May 2016 15:25:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IFPJ84024782; Wed, 18 May 2016 15:25:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFPJ78024781; Wed, 18 May 2016 15:25:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605181525.u4IFPJ78024781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 18 May 2016 15:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300151 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:25:20 -0000 Author: bz Date: Wed May 18 15:25:19 2016 New Revision: 300151 URL: https://svnweb.freebsd.org/changeset/base/300151 Log: Add a dummy VNET_SYSINIT that will make sure all VNETs started will always end on SI_SUB_VNET_DONE. Obtained from: projects/vnet Sponsored by: The FreeBSD Foundation Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Wed May 18 15:18:18 2016 (r300150) +++ head/sys/net/vnet.c Wed May 18 15:25:19 2016 (r300151) @@ -358,6 +358,16 @@ vnet_data_startup(void *dummy __unused) } SYSINIT(vnet_data, SI_SUB_KLD, SI_ORDER_FIRST, vnet_data_startup, 0); +/* Dummy VNET_SYSINIT to make sure we always reach the final end state. */ +static void +vnet_sysinit_done(void *unused __unused) +{ + + return; +} +VNET_SYSINIT(vnet_sysinit_done, SI_SUB_VNET_DONE, SI_ORDER_ANY, + vnet_sysinit_done, NULL); + /* * When a module is loaded and requires storage for a virtualized global * variable, allocate space from the modspace free list. This interface From owner-svn-src-all@freebsd.org Wed May 18 15:25:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D64B41BE6; Wed, 18 May 2016 15:25: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 5E1721EFA; Wed, 18 May 2016 15:25: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 u4IFPjXV024845; Wed, 18 May 2016 15:25:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFPjT8024841; Wed, 18 May 2016 15:25:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605181525.u4IFPjT8024841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 May 2016 15:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300152 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:25:46 -0000 Author: pfg Date: Wed May 18 15:25:45 2016 New Revision: 300152 URL: https://svnweb.freebsd.org/changeset/base/300152 Log: libutil: minor spelling fixes. Modified: head/lib/libutil/login_auth.c head/lib/libutil/login_cap.c head/lib/libutil/pidfile.3 head/lib/libutil/pidfile.c Modified: head/lib/libutil/login_auth.c ============================================================================== --- head/lib/libutil/login_auth.c Wed May 18 15:25:19 2016 (r300151) +++ head/lib/libutil/login_auth.c Wed May 18 15:25:45 2016 (r300152) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); /* * auth_checknologin() - * Checks for the existance of a nologin file in the login_cap + * Checks for the existence of a nologin file in the login_cap * capability . If there isn't one specified, then it checks * to see if this class should just ignore nologin files. Lastly, * it tries to print out the default nologin file, and, if such Modified: head/lib/libutil/login_cap.c ============================================================================== --- head/lib/libutil/login_cap.c Wed May 18 15:25:19 2016 (r300151) +++ head/lib/libutil/login_cap.c Wed May 18 15:25:45 2016 (r300152) @@ -742,7 +742,7 @@ login_getcapsize(login_cap_t *lc, const /* * login_getcapbool() - * From the login_cap_t , check for the existance of the capability + * From the login_cap_t , check for the existence of the capability * of . Return if ->lc_cap is NULL, otherwise return * the whether or not exists there. */ Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Wed May 18 15:25:19 2016 (r300151) +++ head/lib/libutil/pidfile.3 Wed May 18 15:25:45 2016 (r300152) @@ -151,7 +151,7 @@ if (pfh == NULL) { /* If we cannot create pidfile from other reasons, only warn. */ warn("Cannot open or create pidfile"); /* - * Eventhough pfh is NULL we can continue, as the other pidfile_* + * Even though pfh is NULL we can continue, as the other pidfile_* * function can handle such situation by doing nothing except setting * errno to EDOOFUS. */ Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Wed May 18 15:25:19 2016 (r300151) +++ head/lib/libutil/pidfile.c Wed May 18 15:25:45 2016 (r300152) @@ -119,7 +119,7 @@ pidfile_open(const char *path, mode_t mo /* * Open the PID file and obtain exclusive lock. - * We truncate PID file here only to remove old PID immediatelly, + * We truncate PID file here only to remove old PID immediately, * PID file will be truncated again in pidfile_write(), so * pidfile_write() can be called multiple times. */ From owner-svn-src-all@freebsd.org Wed May 18 15:44:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78548B41EF0; Wed, 18 May 2016 15:44:46 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49F261990; Wed, 18 May 2016 15:44:46 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IFij7I030688; Wed, 18 May 2016 15:44:45 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFijKq030687; Wed, 18 May 2016 15:44:45 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605181544.u4IFijKq030687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 18 May 2016 15:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300153 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:44:46 -0000 Author: scottl Date: Wed May 18 15:44:45 2016 New Revision: 300153 URL: https://svnweb.freebsd.org/changeset/base/300153 Log: Remove assertions that don't make sense for the data type. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed May 18 15:25:45 2016 (r300152) +++ head/sys/net/iflib.c Wed May 18 15:44:45 2016 (r300153) @@ -1534,7 +1534,6 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_ n = count; MPASS(n > 0); - MPASS(fl->ifl_credits >= 0); MPASS(fl->ifl_credits + n <= fl->ifl_size); if (pidx < fl->ifl_cidx) @@ -1663,7 +1662,6 @@ iflib_fl_bufs_free(iflib_fl_t fl) iflib_dma_info_t idi = fl->ifl_ifdi; uint32_t i; - MPASS(fl->ifl_credits >= 0); for (i = 0; i < fl->ifl_size; i++) { iflib_rxsd_t d = &fl->ifl_sds[i]; From owner-svn-src-all@freebsd.org Wed May 18 15:45:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A680B41F58; Wed, 18 May 2016 15:45:13 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B7841B0B; Wed, 18 May 2016 15:45:13 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IFjCam030752; Wed, 18 May 2016 15:45:12 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFjCKD030751; Wed, 18 May 2016 15:45:12 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605181545.u4IFjCKD030751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 18 May 2016 15:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300154 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:45:13 -0000 Author: scottl Date: Wed May 18 15:45:12 2016 New Revision: 300154 URL: https://svnweb.freebsd.org/changeset/base/300154 Log: Activate the NO_64BIT_ATOMICS code for mips and powerpc Modified: head/sys/net/mp_ring.c Modified: head/sys/net/mp_ring.c ============================================================================== --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); #include #include - - -#include +#if defined(__powerpc__) || defined(__mips__) +#define NO_64BIT_ATOMICS +#endif #if defined(__i386__) #define atomic_cmpset_acq_64 atomic_cmpset_64 #define atomic_cmpset_rel_64 atomic_cmpset_64 #endif +#include + union ring_state { struct { uint16_t pidx_head; From owner-svn-src-all@freebsd.org Wed May 18 15:50:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB17B410BC; Wed, 18 May 2016 15:50:52 +0000 (UTC) (envelope-from chmeeedalf@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 5AC0F1DC9; Wed, 18 May 2016 15:50:52 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id d62so70531030iof.2; Wed, 18 May 2016 08:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lvWmyqauENI7UXF8vTrUu5il1E/YyHvTWgJCPzE+gKc=; b=0oJ1tg5/W301EdKM9LMfUwyaND7BdAcUhXGPWLC1688hfvllqPPs2ssadF7BsNNjx1 XbBdv6VvuMjYyr2nYMr+C4evB0GOpdrlQGuFzLsh/zcX8wuS0uc57ed+U0+a9yWO0BMS fFAJp+WTZywocLzGrdJ/V5QDEjv16mErpjv/fIUUedRH77rYCtEj63CbtXEsDeGnnhld qZSmfmwVecS9irJbyyklYmUYp0APTLkOnSYuPChVZuytXzyoguO5N4hmiRs6HeMVA7hy LEqmjQSUsggdT+CcbE3bICNnpZaO0xalXqIjTN/IBLpYzT80J1IJokH3cca/ToMV5UzT dBSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lvWmyqauENI7UXF8vTrUu5il1E/YyHvTWgJCPzE+gKc=; b=BapitTVBzI+LpUQfwhUn8nFNW2LVGZJIExEtcT83cTByzfjuGIm11X6pZhX6S0fFfc JreTBeAPQ7HgdWrZh8baDL1o/H3XXizmUu82mDEzL3oUQIHdxlChTy8qYCJkXJR7/t3V MsKBswM0RJwVNDINfCB0w9gLeJjRU3JCOTXNK0sNTDVcQ9cEsznbYGsW2J3cdFGHaeZu cCGG/AjErQmOjcjby709hbWUmlptvGtFx5s7Z2WJPRGc3ntwhHyhIff/8CJn/WsEOxoy lXhLisOBFS6CISC/dXlTIJd8Yzwur76iN06QKqYXINwnL+/l9DEYYLn1oRhvG9do/+jY uTaA== X-Gm-Message-State: AOPr4FVxm8oYuLHHHpOyUvbosJU01yrrVNedBh0jXIP3nYLJFlxX01YtmCVN2Gx4VO2QJQ== X-Received: by 10.107.10.37 with SMTP id u37mr5657380ioi.92.1463586651643; Wed, 18 May 2016 08:50:51 -0700 (PDT) Received: from zhabar.knownspace (173-29-11-18.client.mchsi.com. [173.29.11.18]) by smtp.gmail.com with ESMTPSA id z6sm9009082igg.21.2016.05.18.08.50.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2016 08:50:51 -0700 (PDT) Date: Wed, 18 May 2016 10:50:33 -0500 From: Justin Hibbits To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300154 - head/sys/net Message-ID: <20160518105033.1eae7432@zhabar.knownspace> In-Reply-To: <201605181545.u4IFjCKD030751@repo.freebsd.org> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; powerpc64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:50:52 -0000 On Wed, 18 May 2016 15:45:12 +0000 (UTC) Scott Long wrote: > Author: scottl > Date: Wed May 18 15:45:12 2016 > New Revision: 300154 > URL: https://svnweb.freebsd.org/changeset/base/300154 > > Log: > Activate the NO_64BIT_ATOMICS code for mips and powerpc > > Modified: > head/sys/net/mp_ring.c > > Modified: head/sys/net/mp_ring.c > ============================================================================== > --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 > (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 > 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); > #include > #include > > - > - > -#include > +#if defined(__powerpc__) || defined(__mips__) > +#define NO_64BIT_ATOMICS > +#endif > > #if defined(__i386__) > #define atomic_cmpset_acq_64 atomic_cmpset_64 > #define atomic_cmpset_rel_64 atomic_cmpset_64 > #endif > > +#include > + > union ring_state { > struct { > uint16_t pidx_head; > powerpc64 defines both __powerpc__ and __powerpc64__, so you're killing atomics on powerpc64 with this. - Justin From owner-svn-src-all@freebsd.org Wed May 18 15:50:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 307A8B410C1; Wed, 18 May 2016 15:50:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB1F71DCC; Wed, 18 May 2016 15:50:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IForHu030985; Wed, 18 May 2016 15:50:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFoqRb030983; Wed, 18 May 2016 15:50:52 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605181550.u4IFoqRb030983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 18 May 2016 15:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300155 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:50:54 -0000 Author: bz Date: Wed May 18 15:50:52 2016 New Revision: 300155 URL: https://svnweb.freebsd.org/changeset/base/300155 Log: Add a "vnet_state" field to struct vnet. This is set to the SI_SUB_* value before executing any VNET_SYSINIT or VNET_SYSUNINT. While good for debugging especially VNET teardown problems having a chance to know at which level during teardown we are, it will also be used to identify to detcted a "stable state" (as in fully up and running) later on. Obtained from: projects/vnet Sponsored by: The FreeBSD Foundation Modified: head/sys/net/vnet.c head/sys/net/vnet.h Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Wed May 18 15:45:12 2016 (r300154) +++ head/sys/net/vnet.c Wed May 18 15:50:52 2016 (r300155) @@ -233,6 +233,7 @@ vnet_alloc(void) SDT_PROBE1(vnet, functions, vnet_alloc, entry, __LINE__); vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); vnet->vnet_magic_n = VNET_MAGIC_N; + vnet->vnet_state = 0; SDT_PROBE2(vnet, functions, vnet_alloc, alloc, __LINE__, vnet); /* @@ -581,6 +582,7 @@ vnet_sysinit(void) VNET_SYSINIT_RLOCK(); TAILQ_FOREACH(vs, &vnet_constructors, link) { + curvnet->vnet_state = vs->subsystem; vs->func(vs->arg); } VNET_SYSINIT_RUNLOCK(); @@ -599,6 +601,7 @@ vnet_sysuninit(void) VNET_SYSINIT_RLOCK(); TAILQ_FOREACH_REVERSE(vs, &vnet_destructors, vnet_sysuninit_head, link) { + curvnet->vnet_state = vs->subsystem; vs->func(vs->arg); } VNET_SYSINIT_RUNLOCK(); @@ -714,6 +717,7 @@ db_vnet_print(struct vnet *vnet) db_printf(" vnet_data_mem = %p\n", vnet->vnet_data_mem); db_printf(" vnet_data_base = %#jx\n", (uintmax_t)vnet->vnet_data_base); + db_printf(" vnet_state = %#08x\n", vnet->vnet_state); db_printf("\n"); } Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed May 18 15:45:12 2016 (r300154) +++ head/sys/net/vnet.h Wed May 18 15:50:52 2016 (r300155) @@ -70,6 +70,7 @@ struct vnet { u_int vnet_magic_n; u_int vnet_ifcnt; u_int vnet_sockcnt; + u_int vnet_state; /* SI_SUB_* */ void *vnet_data_mem; uintptr_t vnet_data_base; }; From owner-svn-src-all@freebsd.org Wed May 18 15:57:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 679A6B41395; Wed, 18 May 2016 15:57:14 +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 350B01485; Wed, 18 May 2016 15:57:14 +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 u4IFvD9l033837; Wed, 18 May 2016 15:57:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFvDl4033836; Wed, 18 May 2016 15:57:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605181557.u4IFvDl4033836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 15:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300156 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:57:14 -0000 Author: imp Date: Wed May 18 15:57:13 2016 New Revision: 300156 URL: https://svnweb.freebsd.org/changeset/base/300156 Log: Fix typo. Spotted by: Matteo Riondato Modified: head/sys/boot/common/commands.c Modified: head/sys/boot/common/commands.c ============================================================================== --- head/sys/boot/common/commands.c Wed May 18 15:50:52 2016 (r300155) +++ head/sys/boot/common/commands.c Wed May 18 15:57:13 2016 (r300156) @@ -217,7 +217,7 @@ COMMAND_SET(commandlist, "?", "list comm * unconditionally prints some commands. This will lead to anomalous * behavior. There's no 'pager_output' binding to FORTH to allow * things to work right, so I'm documenting the bug rather than - * fixnig it. + * fixing it. */ static int command_commandlist(int argc, char *argv[]) From owner-svn-src-all@freebsd.org Wed May 18 16:03:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE445B414EB for ; Wed, 18 May 2016 16:03:26 +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 76E6E1A08 for ; Wed, 18 May 2016 16:03:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id f89so71078143ioi.0 for ; Wed, 18 May 2016 09:03:26 -0700 (PDT) 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:date:message-id:subject :from:to:cc; bh=BbS798kSWRIZvFu2+JMYdjhZo0i+WNI52k06w3jQY5M=; b=RUsEucyhWQoE2IrP8P2LCCJU8KWoeTeiwqD1czQpmcPnt32gSQYtO5g1owo++jXi6X k0v6wLht6zozKsztHmzZlZxlMiQg1E29fxfrFecGUiTGv/z23koCgiSIT/N8M7UoKlbC wtWuojM+etX3AgK7d6zaomju4acSZgiS6Iwkqd02o5itzVeT8KJWOb+Sy6bFHbf+nvxm QexOVJaJhXklOyGnzHWcY+lf5hbOkoc9Cg/MSQhL6D9yBNczTO7+WUPXAdm72YurU8Xt jA5o7cD5sYMBTPyYwsWFMGA16UO/4VQY9eDCwWkS5ebjcgsvVKs5sZdqMbxb1EoXYxEw 6FdA== 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:date :message-id:subject:from:to:cc; bh=BbS798kSWRIZvFu2+JMYdjhZo0i+WNI52k06w3jQY5M=; b=HGTpla7WP+xRUCPb42XeTYyyGaCBkxdLnS2NtOHymckV/WIvFqvu+Lmnls4xkDXgS3 t4Sap8HU5qISYnb2ADHMolaInSsbMOPR3lV9LZKsYdv9w4FTxvGeIdf2vVuBMOhojGZ8 BE8WQmKzJtpGx9RSBj6XUQbpXNxZTB0ung8oNIakPrBe0482SxhnRM+57veHuIEgFcGU HU9aqnyP2vW8D5mgt+XCI3kN8KlPNjz+JB9DcbChmGJ1R9DfzuVxxLHeoenESllHhq8m lDMu6GlTGZPI50tAGDvkmO4hb9pdBLDHJjRlMdlMnq3CoVgmsUNBs5SwYiPHuUDWjw/d OY6g== X-Gm-Message-State: AOPr4FXzSADhorG3sPql2Z8zBFn4RrqlPp82LiZ2eWQsra4h7s2cCkFG23LK5JEc0q1RKV93oiG9jRk9epWd5Q== MIME-Version: 1.0 X-Received: by 10.107.143.3 with SMTP id r3mr5871223iod.16.1463587404935; Wed, 18 May 2016 09:03:24 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.75.68 with HTTP; Wed, 18 May 2016 09:03:24 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <20160518105033.1eae7432@zhabar.knownspace> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> Date: Wed, 18 May 2016 10:03:24 -0600 X-Google-Sender-Auth: HVkUMPUoo6v7ZPjqnKAadeISYzM Message-ID: Subject: Re: svn commit: r300154 - head/sys/net From: Warner Losh To: Justin Hibbits Cc: Scott Long , src-committers , "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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 16:03:26 -0000 Ditto with mips. On Wed, May 18, 2016 at 9:50 AM, Justin Hibbits wrote: > On Wed, 18 May 2016 15:45:12 +0000 (UTC) > Scott Long wrote: > > > Author: scottl > > Date: Wed May 18 15:45:12 2016 > > New Revision: 300154 > > URL: https://svnweb.freebsd.org/changeset/base/300154 > > > > Log: > > Activate the NO_64BIT_ATOMICS code for mips and powerpc > > > > Modified: > > head/sys/net/mp_ring.c > > > > Modified: head/sys/net/mp_ring.c > > > ============================================================================== > > --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 > > (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 > > 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > - > > - > > -#include > > +#if defined(__powerpc__) || defined(__mips__) > > +#define NO_64BIT_ATOMICS > > +#endif > > > > #if defined(__i386__) > > #define atomic_cmpset_acq_64 atomic_cmpset_64 > > #define atomic_cmpset_rel_64 atomic_cmpset_64 > > #endif > > > > +#include > > + > > union ring_state { > > struct { > > uint16_t pidx_head; > > > > powerpc64 defines both __powerpc__ and __powerpc64__, so you're killing > atomics on powerpc64 with this. > > - Justin > > From owner-svn-src-all@freebsd.org Wed May 18 16:15:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB7FAB41777; Wed, 18 May 2016 16:15:10 +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 970D21F3D; Wed, 18 May 2016 16:15:10 +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 u4IGF9WR039991; Wed, 18 May 2016 16:15:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IGF9d5039990; Wed, 18 May 2016 16:15:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605181615.u4IGF9d5039990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 18 May 2016 16:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300157 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 16:15:11 -0000 Author: mav Date: Wed May 18 16:15:09 2016 New Revision: 300157 URL: https://svnweb.freebsd.org/changeset/base/300157 Log: Unify Multi ID target code by reusing isp_find_chan_by_did(). Modified: head/sys/dev/isp/isp_target.c Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Wed May 18 15:57:13 2016 (r300156) +++ head/sys/dev/isp/isp_target.c Wed May 18 16:15:09 2016 (r300157) @@ -775,18 +775,17 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); notify.nt_lreserved = aep; sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | (aep->at_hdr.s_id[2]); - - /* Channel has to derived from D_ID */ did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; - for (chan = 0; chan < isp->isp_nchan; chan++) { - if (FCPARAM(isp, chan)->isp_portid == did) { - break; + if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { + /* Channel has to be derived from D_ID */ + isp_find_chan_by_did(isp, did, &chan); + if (chan == ISP_NOCHAN) { + isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); + /* just drop on the floor */ + return; } - } - if (chan == isp->isp_nchan) { - isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); - /* just drop on the floor */ - return; + } else { + chan = 0; } notify.nt_nphdl = NIL_HANDLE; /* unknown here */ notify.nt_sid = sid; From owner-svn-src-all@freebsd.org Wed May 18 16:25:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E841B4197B; Wed, 18 May 2016 16:25:35 +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 4016C179A; Wed, 18 May 2016 16:25:35 +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 u4IGPY9R043227; Wed, 18 May 2016 16:25:34 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IGPYcC043226; Wed, 18 May 2016 16:25:34 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201605181625.u4IGPYcC043226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 18 May 2016 16:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300158 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 16:25:35 -0000 Author: rpokala Date: Wed May 18 16:25:34 2016 New Revision: 300158 URL: https://svnweb.freebsd.org/changeset/base/300158 Log: Fix misleading comments in bus_if.m While looking at r300073, I noticed these incorrect comments in the context of the diff. Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D6431 Modified: head/sys/kern/bus_if.m Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Wed May 18 16:15:09 2016 (r300157) +++ head/sys/kern/bus_if.m Wed May 18 16:25:34 2016 (r300158) @@ -530,8 +530,8 @@ METHOD int child_present { /** * @brief Returns the pnp info for this device. * - * Return it as a string. If the string is insufficient for the - * storage, then return EOVERFLOW. + * Return it as a string. If the storage is insufficient for the + * string, then return EOVERFLOW. * * The string must be formatted as a space-separated list of * name=value pairs. Names may only contain alphanumeric characters, @@ -556,8 +556,8 @@ METHOD int child_pnpinfo_str { /** * @brief Returns the location for this device. * - * Return it as a string. If the string is insufficient for the - * storage, then return EOVERFLOW. + * Return it as a string. If the storage is insufficient for the + * string, then return EOVERFLOW. * * The string must be formatted as a space-separated list of * name=value pairs. Names may only contain alphanumeric characters, From owner-svn-src-all@freebsd.org Wed May 18 16:41:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC2EBB41C5C; Wed, 18 May 2016 16:41:53 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3FE71FD5; Wed, 18 May 2016 16:41:53 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id 190so72553445iow.1; Wed, 18 May 2016 09:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dSDj0jsrZA3aMJNNorC0vUtlAP6QTM1cuzVq71Jmys4=; b=yZDmmC2v8B0HLrDqrAYl3VkGKyOGu1//FxaSUd0yo/IBahbqVR87yoBrXNkclkU4xy LBgraT0aRAN84RNjRn+sQlL7id7tQ+PNSdeP3pDyuQUNjvo7LLoRoPG8ISAscFHbQbnM Le2eAcVYpDVIXVph2S9UfXAPdcXx5Az2PepmMQfKkH9QikRP/LNG1kqSpGg9qCTSn3rG 7cFMiJInku+4x5L0Xh90I2l4actXWV+86f9NUfIbvWpwC39ZWS15H8Jg//2v2dzV9alx csAk7pSG13BV4sA+RsbNmvjMjwLovsQxk1XQ31B2zmFQsjliqeV3vTRp8xes7v7+SHfO Y5gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dSDj0jsrZA3aMJNNorC0vUtlAP6QTM1cuzVq71Jmys4=; b=kLs1eIc9A75+mR3zIO1TiC7b7Ab6AJxAoq3JE4rsF4qQ9OY6BzZxPwFTkbX/fZQ3HX OxRXD+9NPkswjXBP3Ioo9Xban+YWPi+lGIDe8Ywt+EYwiFaoEwgvDN7s9CEHaZxBcxxb pAfJaloKK8OAgkiQfO5BtMdOK3nAU5Ox/8+NRabP1cXFJOrkatar6s+6ER6YXDq2HMlE SzAtLbl1fM8kilzuDL5ogzkltNlyCHoD3DPlolOcWqeK69RLVtXI4ExUppOf13khF/ge yH67OUP6LeOMUvwbeEuBmlpretCv2KLqCtxf7fN/P9F4gQd2l99+zOF6D/OsYTof4E/7 Pw/A== X-Gm-Message-State: AOPr4FWxo1zxXYC38cn7zzGO9BRtYytuqAr8FIxDl3rPd4A1UP43alsQ9AoiQJwhxlnMzQ== X-Received: by 10.107.11.71 with SMTP id v68mr6411787ioi.184.1463589713107; Wed, 18 May 2016 09:41:53 -0700 (PDT) Received: from zhabar.knownspace (173-29-11-18.client.mchsi.com. [173.29.11.18]) by smtp.gmail.com with ESMTPSA id e66sm2983860iof.18.2016.05.18.09.41.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2016 09:41:52 -0700 (PDT) Date: Wed, 18 May 2016 11:41:34 -0500 From: Justin Hibbits To: Scott Long Cc: Warner Losh , Scott Long , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300154 - head/sys/net Message-ID: <20160518114134.7a32e69e@zhabar.knownspace> In-Reply-To: <7EC6D845-E9EE-4D9E-988B-D433526BAAB1@yahoo.com> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <7EC6D845-E9EE-4D9E-988B-D433526BAAB1@yahoo.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; powerpc64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 16:41:54 -0000 #if (defined(__powerpc__) && !defined(__powerpc64__)) || (defined(__mips__) && !defined(__mips64__)) should work. - Justin On Wed, 18 May 2016 10:40:27 -0600 Scott Long wrote: > What should I use instead? > > Scott > > > On May 18, 2016, at 10:03 AM, Warner Losh wrote: > > > > Ditto with mips. > > > > On Wed, May 18, 2016 at 9:50 AM, Justin Hibbits > > wrote: On Wed, 18 May 2016 15:45:12 +0000 > > (UTC) Scott Long wrote: > > > > > Author: scottl > > > Date: Wed May 18 15:45:12 2016 > > > New Revision: 300154 > > > URL: https://svnweb.freebsd.org/changeset/base/300154 > > > > > > Log: > > > Activate the NO_64BIT_ATOMICS code for mips and powerpc > > > > > > Modified: > > > head/sys/net/mp_ring.c > > > > > > Modified: head/sys/net/mp_ring.c > > > ============================================================================== > > > --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 > > > (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 > > > 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > > > > - > > > - > > > -#include > > > +#if defined(__powerpc__) || defined(__mips__) > > > +#define NO_64BIT_ATOMICS > > > +#endif > > > > > > #if defined(__i386__) > > > #define atomic_cmpset_acq_64 atomic_cmpset_64 > > > #define atomic_cmpset_rel_64 atomic_cmpset_64 > > > #endif > > > > > > +#include > > > + > > > union ring_state { > > > struct { > > > uint16_t pidx_head; > > > > > > > powerpc64 defines both __powerpc__ and __powerpc64__, so you're > > killing atomics on powerpc64 with this. > > > > - Justin > > > > > From owner-svn-src-all@freebsd.org Wed May 18 16:54:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D698B41E67 for ; Wed, 18 May 2016 16:54:14 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm16-vm5.bullet.mail.gq1.yahoo.com (nm16-vm5.bullet.mail.gq1.yahoo.com [98.137.177.253]) (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 72A5A183F for ; Wed, 18 May 2016 16:54:14 +0000 (UTC) (envelope-from scott4long@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463589631; bh=+oo3loTaTst5qI4KckX409Wgfo2u4y15ulqFaZiy6n8=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=owiCy59/zUPk0H4xJ9qd0XUSMVJxnu7gpVDmb/jGSdrdgicDCm3vfc4PjVPgZu4Truphd2Z0iAwFx2oOM6I7fQ3rCtSjn8LFUEHmvBIplta0htM3KkRklsVj7+8+r0Kp99bMyCE6lfH/W80fZqYGg4FGX06U6XAbBYeaFpjlWzGRKesI+K3mvlpeP51he5DGcHCwblIalBtfa0TcVxjs3BRCq4wxp0NJ0a05ybQFKFMQd1JQXzkoQ7eqBfezDIiXzrirtf5JV9yDWEXTWEKdOUVYTOiORCD6VG9ga+l6x0mjF5BDoftYaI5T/My8QQHgJQFTz3wYrTbWOxdzikP/ww== Received: from [98.137.12.57] by nm16.bullet.mail.gq1.yahoo.com with NNFMP; 18 May 2016 16:40:31 -0000 Received: from [98.136.164.71] by tm2.bullet.mail.gq1.yahoo.com with NNFMP; 18 May 2016 16:40:31 -0000 Received: from [127.0.0.1] by smtp233.mail.gq1.yahoo.com with NNFMP; 18 May 2016 16:40:31 -0000 X-Yahoo-Newman-Id: 326418.57415.bm@smtp233.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6T8l3uEVM1k1P_F5ciJej.D2bPDEb6WRdpPAF_yEOJu5dpA tB4LYBFhePMcCq0hgd8uw._V3Jp9KomJzB5bI1mg8rLYl3WPZ9UpUfnNyH.l .OuXLfsItjNCC3f3geV1e2gQaVK_UwOQvElPo8RliQ7SKVUJtcx.bLoMUXoy XcKwicA11kehuMa13BP7tB_Tpy_f91NyWf0hXPSeGkbjRhqa2ElLx4GGhzuw z2KmlqXK40m7FzTVSDJmjhbHaqNUoL7YDgWDinI685ysRbi7goHTLhECvt2a UMQd0v_JIPld4Hw_0ZmFARqpdCld0zrK5.rwbiH04aaJnlDibNu2G6Zk0G_6 b3XDUrBIFdv4GPUC2.hGwX1ndOyK1KDqKPo_jNvs7PxXGDkOOtYZUPOBCtOq DcYhlvqMP5ShRjI.74JgX_MU0oaYI1FUR5SWl3rYL6uDpjQcEj8mQ1heZA2w v2lvoJlSKieNVSneDvjkOQspyYoJa3RQSAo4zarj3igj0dKCz50KTs7HxIml Qt.QFWFNFRyj5KD3HZNAucQGvDhXaAiqmJkGL.fw- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300154 - head/sys/net From: Scott Long In-Reply-To: Date: Wed, 18 May 2016 10:40:27 -0600 Cc: Justin Hibbits , Scott Long , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7EC6D845-E9EE-4D9E-988B-D433526BAAB1@yahoo.com> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 16:54:14 -0000 What should I use instead? Scott > On May 18, 2016, at 10:03 AM, Warner Losh wrote: >=20 > Ditto with mips. >=20 > On Wed, May 18, 2016 at 9:50 AM, Justin Hibbits = wrote: > On Wed, 18 May 2016 15:45:12 +0000 (UTC) > Scott Long wrote: >=20 > > Author: scottl > > Date: Wed May 18 15:45:12 2016 > > New Revision: 300154 > > URL: https://svnweb.freebsd.org/changeset/base/300154 > > > > Log: > > Activate the NO_64BIT_ATOMICS code for mips and powerpc > > > > Modified: > > head/sys/net/mp_ring.c > > > > Modified: head/sys/net/mp_ring.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/sys/net/mp_ring.c Wed May 18 15:44:45 2016 > > (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 > > 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > - > > - > > -#include > > +#if defined(__powerpc__) || defined(__mips__) > > +#define NO_64BIT_ATOMICS > > +#endif > > > > #if defined(__i386__) > > #define atomic_cmpset_acq_64 atomic_cmpset_64 > > #define atomic_cmpset_rel_64 atomic_cmpset_64 > > #endif > > > > +#include > > + > > union ring_state { > > struct { > > uint16_t pidx_head; > > >=20 > powerpc64 defines both __powerpc__ and __powerpc64__, so you're = killing > atomics on powerpc64 with this. >=20 > - Justin >=20 >=20 From owner-svn-src-all@freebsd.org Wed May 18 17:08:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09242B411BF; Wed, 18 May 2016 17:08:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C17B91F6B; Wed, 18 May 2016 17:08:30 +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 u4IH8Tkg055366; Wed, 18 May 2016 17:08:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IH8Tdr055365; Wed, 18 May 2016 17:08:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605181708.u4IH8Tdr055365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 18 May 2016 17:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300159 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:08:31 -0000 Author: bdrewery Date: Wed May 18 17:08:29 2016 New Revision: 300159 URL: https://svnweb.freebsd.org/changeset/base/300159 Log: Combine restage/reinstall in a safe way. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 18 16:25:34 2016 (r300158) +++ head/Makefile.inc1 Wed May 18 17:08:29 2016 (r300159) @@ -975,27 +975,19 @@ packageworld: .PHONY # and do a 'make reinstall' on the *client* to install new binaries from the # most recent server build. # -reinstall: .MAKE .PHONY +restage reinstall: .MAKE .PHONY @echo "--------------------------------------------------------------" @echo ">>> Making hierarchy" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy - @echo +.if make(restage) @echo "--------------------------------------------------------------" - @echo ">>> Installing everything" - @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install -.if defined(LIBCOMPAT) - ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat} -.endif - -restage: .MAKE .PHONY - @echo "--------------------------------------------------------------" - @echo ">>> Making hierarchy" + @echo ">>> Making distribution" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ - LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy distribution + LOCAL_MTREE=${LOCAL_MTREE:Q} distribution +.endif @echo @echo "--------------------------------------------------------------" @echo ">>> Installing everything" From owner-svn-src-all@freebsd.org Wed May 18 17:11:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862ADB4131D for ; Wed, 18 May 2016 17:11:21 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (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 5988811F9 for ; Wed, 18 May 2016 17:11:21 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: by mail-io0-x22d.google.com with SMTP id 190so73680633iow.1 for ; Wed, 18 May 2016 10:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clockworksquid.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=T7r2laSXJo0CCFj8+kTRXwHbh8KXZgS8bHEUAkf6igo=; b=ZiTC6mnktLrjoXAQlUbVoU9s1O9o7KQyAaSgFgb0zCh79o/PMTVoqyDXCNCtas39Rb IxNCIMy3YhX0UJkQsaie//WFpZxJ3frZQJL8IGJeLwTRgemRDDJ+KvoXT9MWf473C1SL T96LVXO+dMwJi0bK5I5Zzw05Snfvxt89IHQ8o= 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=T7r2laSXJo0CCFj8+kTRXwHbh8KXZgS8bHEUAkf6igo=; b=VgUlgZETHiIN2oTuf6UsdG/93VW4dKTxXz/AaPWp5Mxy+67MuyzhAljwpA3LKD80MS VL4k5jfbs0J3maOEvJUPc/xL85DzDOotbJ4x9CPFcM5vL3Sfs8ger0FdO3mj226RHjHt nEDue+7P6KYpNoLxXUpxeLjq3QJ9ODzBiQa/6dzwpibsoYrM40MG0CR0R5Z9HhIMPz72 sWbM72GGhkscqI9kv9RS858b1qjPsphuRIeJnF3l38ex050i+kYOMSexurbAWaRXrJXh BKWQ3j35/OhtHIsjselPwM72yZMfF/HO+fjA3XI9XZ0ioP6Qq4TX3p/mtL54p6TxAb16 /pWg== X-Gm-Message-State: AOPr4FUh/BNc/NFRlMEVeegLmiq/VXNGF9YT1j/YDZ/7vIgXBbUSCxJU/4U5WwS2Podi5qFK4Y99E+hSQMsqPw== X-Received: by 10.36.115.76 with SMTP id y73mr18950020itb.63.1463591480677; Wed, 18 May 2016 10:11:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.36.68 with HTTP; Wed, 18 May 2016 10:11:01 -0700 (PDT) In-Reply-To: <20160518114134.7a32e69e@zhabar.knownspace> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <7EC6D845-E9EE-4D9E-988B-D433526BAAB1@yahoo.com> <20160518114134.7a32e69e@zhabar.knownspace> From: Juli Mallett Date: Wed, 18 May 2016 10:11:01 -0700 Message-ID: Subject: Re: svn commit: r300154 - head/sys/net To: Justin Hibbits Cc: Scott Long , Warner Losh , Scott Long , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:11:21 -0000 On Wed, May 18, 2016 at 9:41 AM, Justin Hibbits wrote: > #if (defined(__powerpc__) && !defined(__powerpc64__)) || > (defined(__mips__) && !defined(__mips64__)) > > should work. Depending on what the point of this is on MIPS, it is probably also inadequate. I believe you want a MIPS ABI check, as we can support 64-bit atomics with n32 and n64 ABIs, so !defined(__mips_n32) && !defined(__mips_n64). From owner-svn-src-all@freebsd.org Wed May 18 17:24:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52264B415D7; Wed, 18 May 2016 17:24:01 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (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 1B3701BE0; Wed, 18 May 2016 17:24:01 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x231.google.com with SMTP id f89so74183342ioi.0; Wed, 18 May 2016 10:24:01 -0700 (PDT) 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=taHqcCAYt1x4F/RkO3iqa9OcixC/2k6vmIuLrvYwQf0=; b=jVuuFSU0OaQcFpsGKEI5DvHPuF6+iQcEW6EEWV0McEWTjXtQuRorEo6ZygpREVRGW2 UAci6SENzEczS12Q0HLEp6ws0Q5LfYUbBBqdepxDMon8qHwGtMhIxmKF1FVmIIFgXNd6 +L3A3b2TqGCp8Yurq0mB9T1XtNCTQQZB45yEuO2wDXx60Eh7HwI0mV2IANAqjTs50DSV 0TtwKdYB0c1kzEdAmUSXY0z6RFlt5P26FnyA8ArpExBtdThdunsopjH1AH6oq2UKLjtX 0W/+CmOG4czxcDOCi9rjSnLPBK4V0LNeY9VtVJYxn+7+INyZEoe1Soi0LgO1U/S0Z2eq b+pQ== 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=taHqcCAYt1x4F/RkO3iqa9OcixC/2k6vmIuLrvYwQf0=; b=JN/HVSJIzdMj4ZRiyFDgSz5P19wM/7bdhz7LMm89JqMnS6lK7Hv2EOhMZCAfN8K4X2 Sr3AthwlihsG7Vz9kp1Wz4rP7tIOwtlEr22ddE7MweAA68sdTtcnVW4iNOBaj0bC6p+B Z/3p+5tqn/Mhd4xKqyoV+gnUXq1VB/rweygW/IUxES8xy6Bs0vK/07py1rrlTH33oV8V X8BJLb2eR/xVg3qpW+ESgTtT6m88xXlGziO37lGI6ZX/m0XpT/EVF8TSeFYuYuj+lTIA I5kAV5US8shyxh/Mv73yprprjlwluLmgJLU0YdEbtwRgvlN7Is/wcsbJXEbet7Cm+Yjo rwuQ== X-Gm-Message-State: AOPr4FX22xZhG5I95e/EVdX3zfR8Kq0IqPAcyV27h70fqcCmn+pJIFGgZdZlsOPjqd+BKOZZKBPYI+ij2fHr0g== X-Received: by 10.107.31.146 with SMTP id f140mr6314159iof.180.1463592240469; Wed, 18 May 2016 10:24:00 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Wed, 18 May 2016 10:23:41 -0700 (PDT) In-Reply-To: References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <7EC6D845-E9EE-4D9E-988B-D433526BAAB1@yahoo.com> <20160518114134.7a32e69e@zhabar.knownspace> From: Ed Maste Date: Wed, 18 May 2016 13:23:41 -0400 X-Google-Sender-Auth: Bi_hRdsiYafDJBJNZhxzcor5kJI Message-ID: Subject: Re: svn commit: r300154 - head/sys/net To: Juli Mallett Cc: Justin Hibbits , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:24:01 -0000 On 18 May 2016 at 13:11, Juli Mallett wrote: > On Wed, May 18, 2016 at 9:41 AM, Justin Hibbits wrote: >> #if (defined(__powerpc__) && !defined(__powerpc64__)) || >> (defined(__mips__) && !defined(__mips64__)) >> >> should work. > > Depending on what the point of this is on MIPS, it is probably also > inadequate. I believe you want a MIPS ABI check, as we can support > 64-bit atomics with n32 and n64 ABIs, so !defined(__mips_n32) && > !defined(__mips_n64). I've started trying to collect these details on https://wiki.freebsd.org/EdMaste/ArchitectureSpecifics . (My plan is to move it to a better location when it's reasonably complete.) There's no information for the MIPS variants right now; I'd be happy for someone who knows those details to update the wiki page. From owner-svn-src-all@freebsd.org Wed May 18 17:26:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57FD4B4168C; Wed, 18 May 2016 17:26:23 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 465F01E05; Wed, 18 May 2016 17:26:23 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u4IHEWRG004404 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 18 May 2016 10:14:33 -0700 Subject: Re: svn commit: r300154 - head/sys/net To: Justin Hibbits , Scott Long References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> Date: Wed, 18 May 2016 10:14:32 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160518105033.1eae7432@zhabar.knownspace> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVaDgOEebUKGuxyhreapsXfpKppYZY1G34nxU2jnj52dwgPJDQ9M6DR+pghcyon4ArTJjfBXxCby3bshqfLZPUuFvuGSnUJPJIk= X-Sonic-ID: C;NED//Bsd5hGovrsdzAjavA== M;wjc9/Rsd5hGovrsdzAjavA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:26:23 -0000 On 05/18/16 08:50, Justin Hibbits wrote: > On Wed, 18 May 2016 15:45:12 +0000 (UTC) > Scott Long wrote: > >> Author: scottl >> Date: Wed May 18 15:45:12 2016 >> New Revision: 300154 >> URL: https://svnweb.freebsd.org/changeset/base/300154 >> >> Log: >> Activate the NO_64BIT_ATOMICS code for mips and powerpc >> >> Modified: >> head/sys/net/mp_ring.c >> >> Modified: head/sys/net/mp_ring.c >> ============================================================================== >> --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 >> (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 >> 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> - >> - >> -#include >> +#if defined(__powerpc__) || defined(__mips__) >> +#define NO_64BIT_ATOMICS >> +#endif >> >> #if defined(__i386__) >> #define atomic_cmpset_acq_64 atomic_cmpset_64 >> #define atomic_cmpset_rel_64 atomic_cmpset_64 >> #endif >> >> +#include >> + >> union ring_state { >> struct { >> uint16_t pidx_head; >> > powerpc64 defines both __powerpc__ and __powerpc64__, so you're killing > atomics on powerpc64 with this. > > - Justin > Don't all of our 64-bit platforms have 64-bit atomics? So you could just #if defined(__LP64__) || defined(__i386__) || defined(__whatever_the_thing_is_for_mips_n32__) -Nathan From owner-svn-src-all@freebsd.org Wed May 18 17:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC96FB4184E for ; Wed, 18 May 2016 17:32:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BADD31228 for ; Wed, 18 May 2016 17:32:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 5a858aa6-1d1e-11e6-896e-fd5016d7ee1b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 18 May 2016 17:31:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4IHWH3P053179; Wed, 18 May 2016 11:32:17 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463592737.1180.294.camel@freebsd.org> Subject: Re: svn commit: r300154 - head/sys/net From: Ian Lepore To: Nathan Whitehorn , Justin Hibbits , Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 18 May 2016 11:32:17 -0600 In-Reply-To: <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:32:26 -0000 On Wed, 2016-05-18 at 10:14 -0700, Nathan Whitehorn wrote: > > On 05/18/16 08:50, Justin Hibbits wrote: > > On Wed, 18 May 2016 15:45:12 +0000 (UTC) > > Scott Long wrote: > > > > > Author: scottl > > > Date: Wed May 18 15:45:12 2016 > > > New Revision: 300154 > > > URL: https://svnweb.freebsd.org/changeset/base/300154 > > > > > > Log: > > > Activate the NO_64BIT_ATOMICS code for mips and powerpc > > > > > > Modified: > > > head/sys/net/mp_ring.c > > > > > > Modified: head/sys/net/mp_ring.c > > > ================================================================= > > > ============= > > > --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 > > > (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 > > > 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > > > > - > > > - > > > -#include > > > +#if defined(__powerpc__) || defined(__mips__) > > > +#define NO_64BIT_ATOMICS > > > +#endif > > > > > > #if defined(__i386__) > > > #define atomic_cmpset_acq_64 atomic_cmpset_64 > > > #define atomic_cmpset_rel_64 atomic_cmpset_64 > > > #endif > > > > > > +#include > > > + > > > union ring_state { > > > struct { > > > uint16_t pidx_head; > > > > > powerpc64 defines both __powerpc__ and __powerpc64__, so you're > > killing > > atomics on powerpc64 with this. > > > > - Justin > > > > Don't all of our 64-bit platforms have 64-bit atomics? So you could > just > #if defined(__LP64__) || defined(__i386__) || > defined(__whatever_the_thing_is_for_mips_n32__) > -Nathan > It may be more complicated than that, though. armv6 can do 64-bit atomics even tho it's 32-bit. armv4, also 32-bit, can do 64-bit atomics in the kernel but not in userland. Maybe machine/atomic.h needs a #define that says whether 64-bit ops are available in the current compilation unit. (And likewise for other bit sizes if we have arches that have other limitations.) -- Ian From owner-svn-src-all@freebsd.org Wed May 18 17:35:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00061B41906; Wed, 18 May 2016 17:35:47 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8377D1471; Wed, 18 May 2016 17:35:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C955425D388E; Wed, 18 May 2016 17:35:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id EA8CED1F8BA; Wed, 18 May 2016 17:35:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id AGoFHXD2uH12; Wed, 18 May 2016 17:35:41 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:10a6:9e53:5e9c:c191] (unknown [IPv6:fde9:577b:c1a9:4410:10a6:9e53:5e9c:c191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B29E4D1F8A6; Wed, 18 May 2016 17:35:39 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300154 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <1463592737.1180.294.camel@freebsd.org> Date: Wed, 18 May 2016 17:35:06 +0000 Cc: Nathan Whitehorn , Justin Hibbits , Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1EED3540-DCCF-40D2-91BA-CE0AA54C5D08@lists.zabbadoz.net> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> <1463592737.1180.294.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:35:48 -0000 > On 18 May 2016, at 17:32 , Ian Lepore wrote: >=20 > On Wed, 2016-05-18 at 10:14 -0700, Nathan Whitehorn wrote: >>=20 >> On 05/18/16 08:50, Justin Hibbits wrote: >>> On Wed, 18 May 2016 15:45:12 +0000 (UTC) >>> Scott Long wrote: >>>=20 >>>> Author: scottl >>>> Date: Wed May 18 15:45:12 2016 >>>> New Revision: 300154 >>>> URL: https://svnweb.freebsd.org/changeset/base/300154 >>>>=20 >>>> Log: >>>> Activate the NO_64BIT_ATOMICS code for mips and powerpc >>>>=20 >>>> Modified: >>>> head/sys/net/mp_ring.c >>>>=20 >>>> Modified: head/sys/net/mp_ring.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/sys/net/mp_ring.c Wed May 18 15:44:45 2016 >>>> (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 >>>> 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); >>>> #include >>>> #include >>>>=20 >>>> - >>>> - >>>> -#include >>>> +#if defined(__powerpc__) || defined(__mips__) >>>> +#define NO_64BIT_ATOMICS >>>> +#endif >>>>=20 >>>> #if defined(__i386__) >>>> #define atomic_cmpset_acq_64 atomic_cmpset_64 >>>> #define atomic_cmpset_rel_64 atomic_cmpset_64 >>>> #endif >>>>=20 >>>> +#include >>>> + >>>> union ring_state { >>>> struct { >>>> uint16_t pidx_head; >>>>=20 >>> powerpc64 defines both __powerpc__ and __powerpc64__, so you're >>> killing >>> atomics on powerpc64 with this. >>>=20 >>> - Justin >>>=20 >>=20 >> Don't all of our 64-bit platforms have 64-bit atomics? So you could >> just=20 >> #if defined(__LP64__) || defined(__i386__) ||=20 >> defined(__whatever_the_thing_is_for_mips_n32__) >> -Nathan >>=20 >=20 > It may be more complicated than that, though. armv6 can do 64-bit > atomics even tho it's 32-bit. armv4, also 32-bit, can do 64-bit > atomics in the kernel but not in userland. >=20 > Maybe machine/atomic.h needs a #define that says whether 64-bit ops = are > available in the current compilation unit. (And likewise for other = bit > sizes if we have arches that have other limitations.) Question because I didn=E2=80=99t follow the details, but how was this = solved for the COUNTERS framework? /bz= From owner-svn-src-all@freebsd.org Wed May 18 17:40:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE0D7B4198F; Wed, 18 May 2016 17:40:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D44117A0; Wed, 18 May 2016 17:40:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IHerwj065616; Wed, 18 May 2016 17:40:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IHerhG065615; Wed, 18 May 2016 17:40:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605181740.u4IHerhG065615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 18 May 2016 17:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300160 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:40:55 -0000 Author: glebius Date: Wed May 18 17:40:53 2016 New Revision: 300160 URL: https://svnweb.freebsd.org/changeset/base/300160 Log: Comment fix: the getsockaddr() is actually meant here. Reviewed by: rmacklem Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Wed May 18 17:08:29 2016 (r300159) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Wed May 18 17:40:53 2016 (r300160) @@ -841,7 +841,7 @@ nfs_mount_parse_from(struct vfsoptlist * * mount system call * It seems a bit dumb to copyinstr() the host and path here and then * bcopy() them in mountnfs(), but I wanted to detect errors before - * doing the sockargs() call because sockargs() allocates an mbuf and + * doing the getsockaddr() call because getsockaddr() allocates an mbuf and * an error after that means that I have to release the mbuf. */ /* ARGSUSED */ @@ -1228,7 +1228,7 @@ nfs_mount(struct mount *mp) goto out; bzero(&hst[hstlen], MNAMELEN - hstlen); args.hostname = hst; - /* sockargs() call must be after above copyin() calls */ + /* getsockaddr() call must be after above copyin() calls */ error = getsockaddr(&nam, (caddr_t)args.addr, args.addrlen); if (error != 0) @@ -1332,7 +1332,7 @@ out: * mount system call * It seems a bit dumb to copyinstr() the host and path here and then * bcopy() them in mountnfs(), but I wanted to detect errors before - * doing the sockargs() call because sockargs() allocates an mbuf and + * doing the getsockaddr() call because getsockaddr() allocates an mbuf and * an error after that means that I have to release the mbuf. */ /* ARGSUSED */ From owner-svn-src-all@freebsd.org Wed May 18 17:57:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9524B41D26 for ; Wed, 18 May 2016 17:57:52 +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 A5196110A for ; Wed, 18 May 2016 17:57:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 16cd18be-1d22-11e6-a09e-4d61a6885157 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 18 May 2016 17:58:12 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4IHvh9t053233; Wed, 18 May 2016 11:57:43 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463594263.1180.298.camel@freebsd.org> Subject: Re: svn commit: r300154 - head/sys/net From: Ian Lepore To: "Bjoern A. Zeeb" Cc: Nathan Whitehorn , Justin Hibbits , Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 18 May 2016 11:57:43 -0600 In-Reply-To: <1EED3540-DCCF-40D2-91BA-CE0AA54C5D08@lists.zabbadoz.net> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> <1463592737.1180.294.camel@freebsd.org> <1EED3540-DCCF-40D2-91BA-CE0AA54C5D08@lists.zabbadoz.net> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 17:57:52 -0000 On Wed, 2016-05-18 at 17:35 +0000, Bjoern A. Zeeb wrote: > > On 18 May 2016, at 17:32 , Ian Lepore wrote: > > > > On Wed, 2016-05-18 at 10:14 -0700, Nathan Whitehorn wrote: > > > > > > On 05/18/16 08:50, Justin Hibbits wrote: > > > > On Wed, 18 May 2016 15:45:12 +0000 (UTC) > > > > Scott Long wrote: > > > > > > > > > Author: scottl > > > > > Date: Wed May 18 15:45:12 2016 > > > > > New Revision: 300154 > > > > > URL: https://svnweb.freebsd.org/changeset/base/300154 > > > > > > > > > > Log: > > > > > Activate the NO_64BIT_ATOMICS code for mips and powerpc > > > > > > > > > > Modified: > > > > > head/sys/net/mp_ring.c > > > > > > > > > > Modified: head/sys/net/mp_ring.c > > > > > ============================================================= > > > > > ==== > > > > > ============= > > > > > --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 > > > > > (r300153) +++ head/sys/net/mp_ring.c Wed May 18 > > > > > 15:45:12 > > > > > 2016 (r300154) @@ -37,15 +37,17 @@ > > > > > __FBSDID("$FreeBSD$"); > > > > > #include > > > > > #include > > > > > > > > > > - > > > > > - > > > > > -#include > > > > > +#if defined(__powerpc__) || defined(__mips__) > > > > > +#define NO_64BIT_ATOMICS > > > > > +#endif > > > > > > > > > > #if defined(__i386__) > > > > > #define atomic_cmpset_acq_64 atomic_cmpset_64 > > > > > #define atomic_cmpset_rel_64 atomic_cmpset_64 > > > > > #endif > > > > > > > > > > +#include > > > > > + > > > > > union ring_state { > > > > > struct { > > > > > uint16_t pidx_head; > > > > > > > > > powerpc64 defines both __powerpc__ and __powerpc64__, so you're > > > > killing > > > > atomics on powerpc64 with this. > > > > > > > > - Justin > > > > > > > > > > Don't all of our 64-bit platforms have 64-bit atomics? So you > > > could > > > just > > > #if defined(__LP64__) || defined(__i386__) || > > > defined(__whatever_the_thing_is_for_mips_n32__) > > > -Nathan > > > > > > > It may be more complicated than that, though. armv6 can do 64-bit > > atomics even tho it's 32-bit. armv4, also 32-bit, can do 64-bit > > atomics in the kernel but not in userland. > > > > Maybe machine/atomic.h needs a #define that says whether 64-bit ops > > are > > available in the current compilation unit. (And likewise for other > > bit > > sizes if we have arches that have other limitations.) > > > Question because I didn¢t follow the details, but how was this solved > for the COUNTERS framework? > > > /bz > iirc, each platform implements counters its own way, probably the wrong way on all of them except x86. For some crazy reason the docs for COUNTERS say that it does not use atomics. I have no idea why the docs for an API are dictating implementation, but I suspect it's because atomics are more expensive on x86 than other alternatives. So the arm code slavishly avoids using atomics in COUNTERS even though doing so would be more effecient than the current copied-from-x86 code. -- Ian From owner-svn-src-all@freebsd.org Wed May 18 18:14:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44091B401B5; Wed, 18 May 2016 18:14:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 353201D77; Wed, 18 May 2016 18:14:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 2E7A41A19; Wed, 18 May 2016 18:14:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CF5991F736; Wed, 18 May 2016 18:14:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id u5nsSe_Ku6de; Wed, 18 May 2016 18:13:58 +0000 (UTC) Subject: Re: svn commit: r300137 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 74A9D1F72F To: Andriy Voskoboinyk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605181043.u4IAhDmP037290@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <911ad948-e9ac-0c1a-c4f4-9aeb1a2d800b@FreeBSD.org> Date: Wed, 18 May 2016 11:13:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605181043.u4IAhDmP037290@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 18:14:01 -0000 On 5/18/16 3:43 AM, Andriy Voskoboinyk wrote: > Author: avos > Date: Wed May 18 10:43:13 2016 > New Revision: 300137 > URL: https://svnweb.freebsd.org/changeset/base/300137 > > Log: > README: remove nonexistent 'games' directory. > > Games were moved to usr.bin in r288485. > > (todo: add/describe 'targets' directory) targets/ is only used when using the WITH_DIRDEPS_BUILD flag, which invokes a totally different build system than buildworld. See src.conf(5) WITH_DIRDEPS_BUILD. > > Modified: > head/README > > Modif -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Wed May 18 18:20:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EFF4B40290; Wed, 18 May 2016 18:20:27 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::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 E4C801F76; Wed, 18 May 2016 18:20:26 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id b66so283800pfb.2; Wed, 18 May 2016 11:20:26 -0700 (PDT) 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=/SxHVwSzMUjTSsyLAYjsOdGXjzZbHxTaOH3oSLFVcZA=; b=lOLRPfd3dpdMOXC593JRbQ9fMN33yumK6/GLvKBK0Fizl+Lt9YnHMxP69s6B8nBcUG L6kXfq6tGiuaK+zSGsUZM0WuJTTtYdrTkXQJiDe+rY/Qt96pkhadHf23dQqUDNGY508w uZhDLY6dyFWmBbb9R1jMuDygYeqcBII63M5RAsiHCyNXjR4GFhegpjv0lJ4hm8bZfqQl zh7P6OPunE+pmguius/gq8/fGzDjy4MJBln7WDJ4gb+vSYSkirMUu7DfBXsVG5xc7mss UJIc8Rofq9xM34kVqVBJhl+4USxr5G9dL/wiz53+SWezSqW1psUyb6lYfuspiqIB8Rhg kbxw== 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=/SxHVwSzMUjTSsyLAYjsOdGXjzZbHxTaOH3oSLFVcZA=; b=ihaFO3bXiJfmaFPm2ptH260LVQVwLICVr1mnCCArfC7u8ohqOHJMEMXojG5/EzuoIY 16QnUpEMpnKeydC7a2aPvmWBBO61MYkKgPlgOqs5YavGkATRX0W8vVVDprpVv0lqM+4j sFpnY47nCOw3bpzD0DYHix4hCS0CHwhsFrZRWD6yYXSlqGs+iNaLHS73D5Q0fl9CVfgi DfZCBXAAMZvz+oLBMkgmFn360IAv4mUUdaJcGSHv0T4Bi3hHEbuCzNEYLPDml9oGs++D g4xMCJ+Tf9lggBg2Nx/vw/W5brr6HOF3BmIcfia/b54N3mpmw18/fD0ryUvgjWzye5K9 mJRg== X-Gm-Message-State: AOPr4FW74+/h8GpcDyTALD+6GYwD4Ni/xfiZDhRFrhFWjPGls6R4A/szw0ylYGW2woT9vA== X-Received: by 10.98.20.131 with SMTP id 125mr13109535pfu.166.1463595626428; Wed, 18 May 2016 11:20:26 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id 199sm13891287pfc.15.2016.05.18.11.20.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2016 11:20:25 -0700 (PDT) Sender: Mark Johnston Date: Wed, 18 May 2016 11:23:53 -0700 From: Mark Johnston To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300110 - head/sys/kern Message-ID: <20160518182353.GB26863@wkstn-mjohnston.west.isilon.com> References: <201605180355.u4I3tskK012821@repo.freebsd.org> <7D442C5C-E059-40A5-887C-55840BE94425@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7D442C5C-E059-40A5-887C-55840BE94425@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 18:20:27 -0000 On Tue, May 17, 2016 at 10:22:18PM -0700, NGie Cooper wrote: > > > On May 17, 2016, at 20:55, Mark Johnston wrote: > > > > Author: markj > > Date: Wed May 18 03:55:54 2016 > > New Revision: 300110 > > URL: https://svnweb.freebsd.org/changeset/base/300110 > > > > Log: > > Do not acquire the thread lock in hardclock_cnt() unless needed. > > > > This function only sets thread flags if a SIGPROF or SIGVTALRM timer > > has fired, which is almost never the case. > > > > MFC after: 2 weeks > > > > Modified: > > head/sys/kern/kern_clock.c > > > > Modified: head/sys/kern/kern_clock.c > > ============================================================================== > > --- head/sys/kern/kern_clock.c Wed May 18 03:50:21 2016 (r300109) > > +++ head/sys/kern/kern_clock.c Wed May 18 03:55:54 2016 (r300110) > > @@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode) > > flags |= TDF_PROFPEND | TDF_ASTPENDING; > > PROC_ITIMUNLOCK(p); > > } > > - thread_lock(td); > > - td->td_flags |= flags; > > - thread_unlock(td); > > + if (flags != 0) { > > + thread_lock(td); > > + td->td_flags |= flags; > > + thread_unlock(td); > > + } > > Use predict_false? I don't think that's really warranted here. A __predict_false could become incorrect after a future change elsewhere in this function, and this isn't enough of a hot path for such a change to make a measurable difference on its own. > > > > #ifdef HWPMC_HOOKS > > if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid))) > > From owner-svn-src-all@freebsd.org Wed May 18 18:21:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BEFEB402EC; Wed, 18 May 2016 18:21:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 278F8123F; Wed, 18 May 2016 18:21:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4IILZZq046012 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 18 May 2016 11:21:36 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4IILZ1a046011; Wed, 18 May 2016 11:21:35 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 May 2016 11:21:35 -0700 From: Gleb Smirnoff To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299830 - head/contrib/bsnmp/snmpd Message-ID: <20160518182135.GL1015@FreeBSD.org> References: <201605150336.u4F3aJxd062168@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605150336.u4F3aJxd062168@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 18:21:37 -0000 Garrett, On Sun, May 15, 2016 at 03:36:19AM +0000, Garrett Cooper wrote: G> Author: ngie G> Date: Sun May 15 03:36:19 2016 G> New Revision: 299830 G> URL: https://svnweb.freebsd.org/changeset/base/299830 G> G> Log: G> Fix -Wcast-align warnings G> G> Use memcpy instead of using direct assignment of void* pointers with G> CMSG_DATA(..), which changes alignment G> G> MFC after: 3 weeks G> Reported by: clang G> Sponsored by: EMC / Isilon Storage Division G> G> Modified: G> head/contrib/bsnmp/snmpd/main.c G> G> Modified: head/contrib/bsnmp/snmpd/main.c G> ============================================================================== G> --- head/contrib/bsnmp/snmpd/main.c Sun May 15 03:22:13 2016 (r299829) G> +++ head/contrib/bsnmp/snmpd/main.c Sun May 15 03:36:19 2016 (r299830) G> @@ -1169,7 +1169,7 @@ recv_dgram(struct port_input *pi, struct G> memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); G> if (cmsg->cmsg_level == SOL_SOCKET && G> cmsg->cmsg_type == SCM_CREDS) G> - cred = (struct sockcred *)CMSG_DATA(cmsg); G> + memcpy(cred, CMSG_DATA(cmsg), sizeof(struct sockcred)); And cred is always NULL at this point, isn't it? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed May 18 19:32:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA447B41460 for ; Wed, 18 May 2016 19:32:39 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7322A1BFD for ; Wed, 18 May 2016 19:32:39 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lb0-x22e.google.com with SMTP id h1so21121082lbj.3 for ; Wed, 18 May 2016 12:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jdgX9ZL3kJV0LNLL+F8yxDraFaTWEDIxOhzZ3RuTRbg=; b=KAjlvls399BRzbfo8Ziy2TGm5CS/H68EUVXBammaqGH0GRRxp5PDhkC0HezeZR7m+d N+RL8y8jWwpn7dCxc8HtPAUT20xAAbtB+KfBx9DH7WsrrW8UUwj3b4AnlwiIat168QHO IZwdZjyaUA+QwohRTUGPAbP4u8VfSBFfe44FJeru8xa81ywIS8/YGLQ9lsubEDpRwKC9 SQCIET61fH52F9OA+u05XUlNCosNcOMksoEkkE69jyqBxJc6BOcVWMHAN/m2r7Ofv14P 9s3yJ/slO1/TMI7FIkNtqfLtJOhweOcSwNw9xH5vwpBYkopddxhOlpdy9uV9OwAechXe vkrg== 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=jdgX9ZL3kJV0LNLL+F8yxDraFaTWEDIxOhzZ3RuTRbg=; b=Kiqnjj+uEV5lFdKnOe+7TNL71L9aWU0OtasBWEDFeq0jX0JCaxvPPtZeIHqpvXwxca TfFQJsV5/knNLcq0J4z96HM6NOPvDRoaxO3tyNcjGyjmUZLReCJd8mNVz34Dtug6qISP 2T2dry5HReMwVCi9iSyUYhQyBVLTalt8fcXo6X9QGifjxB2j5s7uqG7nkqQMt3a0ePuY l41jcZC3gyF55Q2nDj5udgcP/UvbuNAilrLEfkrVi2FbFgLow4pcW89k2YwRg4ehlIyC +TDCJLVwsw7s4jqAJNZ1rrdEpzj7eY7R+2qoy1eZVSV3BMWlYMUFBHwFiLiQ+nflI9x9 PJfg== X-Gm-Message-State: AOPr4FWWekjPUe2QBEX7oLMx4BJ0ih1WomU30DfKYcTcwNJIrCLUNlSnTQfvIwYeMzINbLZh1JvE9/SI2ukn/A== X-Received: by 10.112.73.40 with SMTP id i8mr3112014lbv.101.1463599957507; Wed, 18 May 2016 12:32:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.68 with HTTP; Wed, 18 May 2016 12:32:17 -0700 (PDT) In-Reply-To: <20160518162409.1074344e@zapp> References: <201605181505.u4IF5ixZ018827@repo.freebsd.org> <20160518162409.1074344e@zapp> From: Zbigniew Bodek Date: Wed, 18 May 2016 21:32:17 +0200 Message-ID: Subject: Re: svn commit: r300149 - in head/sys: arm/allwinner arm/allwinner/a10 arm/arm arm/broadcom/bcm2835 arm/mv arm/nvidia arm/ti arm/ti/omap4 arm64/arm64 kern mips/mediatek mips/mips sys To: Andrew Turner 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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 19:32:40 -0000 Hello Andrew, Thanks for your reply. Please see my comments in-line. Kind regards zbb 2016-05-18 17:24 GMT+02:00 Andrew Turner : > On Wed, 18 May 2016 17:15:10 +0200 > Zbigniew Bodek wrote: > > > 2016-05-18 17:05 GMT+02:00 Andrew Turner : > ... > > > #ifdef INTRNG > > > xref = OF_xref_from_node(ofw_bus_get_node(dev)); > > > - if (intr_pic_register(dev, xref) != 0) { > > > + if (intr_pic_register(dev, xref) == NULL) { > > > device_printf(dev, "could not register PIC\n"); > > > goto error; > > > } > > > @@ -172,7 +172,7 @@ error: > > > /* Failure so free resources */ > > > gic_v3_detach(dev); > > > > > > - return (err); > > > + return (ENXIO); > > > > > > > > > Few line above we have: > > err = gic_v3_attach(dev); > > if (err != 0) > > goto error; > > > > So now we would not return error code from gic_v3_attach() but always > > ENXIO... > > The error value doesn't matter, as long as it's non-zero. This also > fixes the return value in the intrng case if either of > intr_pic_register or intr_pic_claim_root fail. You might get a little > information from the return value being printed, however it would be > more useful to have verbose logging to print an error message. > > So if you wanted to fix INTRNG part why didn't you just set an error value in case of intr_pic_register() failure before "goto error"? Simply: + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); + err = ENXIO; goto error; } Because now we set an error value and in case of real error (not when gic_v3_attach() returns 0) we print ENXIO while doing nothing with the err variable... > In all of these failure cases there isn't much we can do as there is no > root interrupt controller, the boot will fail later on when we enable > interrupts. > I know but that is not the explanation for breaking the logic here. > > Andrew > From owner-svn-src-all@freebsd.org Wed May 18 19:36:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25E20B41516; Wed, 18 May 2016 19:36:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x241.google.com (mail-ig0-x241.google.com [IPv6:2607:f8b0:4001:c05::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 E427E1E0C; Wed, 18 May 2016 19:36:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x241.google.com with SMTP id rc4so5573070igc.0; Wed, 18 May 2016 12:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=VVNsqXooECiQw8HEt/xQ2fBJYWx2wp4eZIKEdUBZtts=; b=ZSyBjPhFOuEnFjutBitHRBzZgfF+V+Z7A7scCyAnW7Q64T5MMksheRDm2zcclo5ySq QV3SWE+NH/9eRXAKVQYs6+2k+PStLn7yxG33QykZXNYeRoHHvCncnKSPF3WL5FQGoEfN 7vAtmmJjvm8Ii6CaHelqvtgZbPyfXfSzY/RKdJDiDsf7UB5avmnTBw6c3/pvTRzok9ET 4PDMNNic3D3dbsO7XTa8H2jP8OsxYl98POCQDnm1DgSY4HngzHNPdwYRfhVOsh6D+Vfp aNdiJ47VbNjeLEz3Q0vMX+OFQuTVtBza+UV+Y9dIiPhl5zOSs/dlIvuJBdiPjzcuLEpX EoWA== 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:date :message-id:subject:from:to:cc; bh=VVNsqXooECiQw8HEt/xQ2fBJYWx2wp4eZIKEdUBZtts=; b=O/zZMVOigrl++3U67IT4AU5bTIDg/6XjNKzhhc4yJ1FMVYrsBYpsArdqTyy9dkRnf0 rFC78SoxPdfDHvBFwmJuosAb9pMHjCg/DKffmIdw8EKWIlsNTK4M1ik2LEXR/b9hUhJo UFE6WTOk9N4VWBMXrzEPxVLkbe5O1GvLWn2jhB8o66ohfQSyaEmSCnnz4le0aSru73Hg NlyB7IaYp51+5U2QDaV7Vc+0dmYcp36zlBiBNWkHKHO4isggQDQHUr9JYKC/0iNsPPWV T1wmGEqG/Ds48kZ0ASD0BMGtCxpFKj5G8HaGdqKxFI9ZIBaII+XVNrgt3rtK42grB9nM dkLw== X-Gm-Message-State: AOPr4FXQNjbSwIlGDr1nMO1PgZmZSKapTTZ7uo8wY1y1E6ZnbQ46qYXqQ/k1POUshmmgbuWINfnAxZcZyzMg2Q== MIME-Version: 1.0 X-Received: by 10.50.40.234 with SMTP id a10mr19755468igl.37.1463600197226; Wed, 18 May 2016 12:36:37 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Wed, 18 May 2016 12:36:37 -0700 (PDT) In-Reply-To: <1463592737.1180.294.camel@freebsd.org> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> <1463592737.1180.294.camel@freebsd.org> Date: Wed, 18 May 2016 12:36:37 -0700 Message-ID: Subject: Re: svn commit: r300154 - head/sys/net From: Adrian Chadd To: Ian Lepore Cc: Nathan Whitehorn , Justin Hibbits , Scott Long , "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 19:36:38 -0000 On 18 May 2016 at 10:32, Ian Lepore wrote: > On Wed, 2016-05-18 at 10:14 -0700, Nathan Whitehorn wrote: >> >> On 05/18/16 08:50, Justin Hibbits wrote: >> > On Wed, 18 May 2016 15:45:12 +0000 (UTC) >> > Scott Long wrote: >> > >> > > Author: scottl >> > > Date: Wed May 18 15:45:12 2016 >> > > New Revision: 300154 >> > > URL: https://svnweb.freebsd.org/changeset/base/300154 >> > > >> > > Log: >> > > Activate the NO_64BIT_ATOMICS code for mips and powerpc >> > > >> > > Modified: >> > > head/sys/net/mp_ring.c >> > > >> > > Modified: head/sys/net/mp_ring.c >> > > ================================================================= >> > > ============= >> > > --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 >> > > (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 >> > > 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); >> > > #include >> > > #include >> > > >> > > - >> > > - >> > > -#include >> > > +#if defined(__powerpc__) || defined(__mips__) >> > > +#define NO_64BIT_ATOMICS >> > > +#endif >> > > >> > > #if defined(__i386__) >> > > #define atomic_cmpset_acq_64 atomic_cmpset_64 >> > > #define atomic_cmpset_rel_64 atomic_cmpset_64 >> > > #endif >> > > >> > > +#include >> > > + >> > > union ring_state { >> > > struct { >> > > uint16_t pidx_head; >> > > >> > powerpc64 defines both __powerpc__ and __powerpc64__, so you're >> > killing >> > atomics on powerpc64 with this. >> > >> > - Justin >> > >> >> Don't all of our 64-bit platforms have 64-bit atomics? So you could >> just >> #if defined(__LP64__) || defined(__i386__) || >> defined(__whatever_the_thing_is_for_mips_n32__) >> -Nathan >> > > It may be more complicated than that, though. armv6 can do 64-bit > atomics even tho it's 32-bit. armv4, also 32-bit, can do 64-bit > atomics in the kernel but not in userland. > > Maybe machine/atomic.h needs a #define that says whether 64-bit ops are > available in the current compilation unit. (And likewise for other bit > sizes if we have arches that have other limitations.) Please, please do this. Don't do a list of platforms, do a list of features. Pretty please. -adrian From owner-svn-src-all@freebsd.org Wed May 18 19:38:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3DEB41573; Wed, 18 May 2016 19:38:01 +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 6C02A1FAA; Wed, 18 May 2016 19:38:01 +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 u4IJc0rv002761; Wed, 18 May 2016 19:38:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IJc0Jb002760; Wed, 18 May 2016 19:38:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605181938.u4IJc0Jb002760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 18 May 2016 19:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r300162 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 19:38:01 -0000 Author: adrian Date: Wed May 18 19:38:00 2016 New Revision: 300162 URL: https://svnweb.freebsd.org/changeset/base/300162 Log: Release sgalabov from mentorship. Approved by: core (implicit) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed May 18 18:35:45 2016 (r300161) +++ svnadmin/conf/mentors Wed May 18 19:38:00 2016 (r300162) @@ -28,7 +28,6 @@ miwi rwatson monthadar adrian peterj jhb Co-mentor: grog phil theraven Co-mentor: sjg -sgalabov adrian slm ken Co-mentor: scottl, ambrisko snb dwmalone lidl rpaulo Co-mentor: adrian From owner-svn-src-all@freebsd.org Wed May 18 19:59:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B4BB41A12; Wed, 18 May 2016 19:59:06 +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 84FF51B3C; Wed, 18 May 2016 19:59:06 +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 u4IJx5lr008872; Wed, 18 May 2016 19:59:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IJx5O5008871; Wed, 18 May 2016 19:59:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605181959.u4IJx5O5008871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 May 2016 19:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300163 - head/lib/libufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 19:59:06 -0000 Author: pfg Date: Wed May 18 19:59:05 2016 New Revision: 300163 URL: https://svnweb.freebsd.org/changeset/base/300163 Log: libufs: Simplify generation number calculation. UFS generation numbers have been unsigned since 2013 (r256435). Modified: head/lib/libufs/cgroup.c Modified: head/lib/libufs/cgroup.c ============================================================================== --- head/lib/libufs/cgroup.c Wed May 18 19:38:00 2016 (r300162) +++ head/lib/libufs/cgroup.c Wed May 18 19:59:05 2016 (r300163) @@ -157,7 +157,7 @@ gotit: bzero(block, (int)fs->fs_bsize); dp2 = (struct ufs2_dinode *)█ for (i = 0; i < INOPB(fs); i++) { - dp2->di_gen = arc4random() / 2 + 1; + dp2->di_gen = arc4random(); dp2++; } if (bwrite(disk, ino_to_fsba(fs, From owner-svn-src-all@freebsd.org Wed May 18 20:04:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB505B41B7E; Wed, 18 May 2016 20:04:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 5413D1F84; Wed, 18 May 2016 20:04:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 49AC7D6622E; Thu, 19 May 2016 06:03:59 +1000 (AEST) Date: Thu, 19 May 2016 06:03:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: "Bjoern A. Zeeb" , Nathan Whitehorn , Justin Hibbits , Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300154 - head/sys/net In-Reply-To: <1463594263.1180.298.camel@freebsd.org> Message-ID: <20160519043606.G1061@besplex.bde.org> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> <1463592737.1180.294.camel@freebsd.org> <1EED3540-DCCF-40D2-91BA-CE0AA54C5D08@lists.zabbadoz.net> <1463594263.1180.298.camel@freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=OUm4Lhyl49i_GLGZxNkA:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 20:04:08 -0000 On Wed, 18 May 2016, Ian Lepore wrote: > On Wed, 2016-05-18 at 17:35 +0000, Bjoern A. Zeeb wrote: >>> On 18 May 2016, at 17:32 , Ian Lepore wrote: >>> >>> On Wed, 2016-05-18 at 10:14 -0700, Nathan Whitehorn wrote: >>> ... >>> It may be more complicated than that, though. armv6 can do 64-bit >>> atomics even tho it's 32-bit. armv4, also 32-bit, can do 64-bit >>> atomics in the kernel but not in userland. >>> >>> Maybe machine/atomic.h needs a #define that says whether 64-bit ops >>> are >>> available in the current compilation unit. (And likewise for other >>> bit >>> sizes if we have arches that have other limitations.) >> >> Question because I didn=A2t follow the details, but how was this solved >> for the COUNTERS framework? Using special code that pessimizes old machines on 32-bit arches especially= =2E For example, incrementing a 32-bit network counter used to take 1 inlined counter++ statement (as little as 1 instruction on i386, but it is a read-modify-write instruction and thus no faster than separate instructions, and if the counter is shared this is almost as slow as a locked instruction in some cases). This now takes an if_inc_counter() function call which takes 33 instruction= s altogether on i386 with certain nonstandard not very optimal CFLAGS, and 9 instructions on amd64. (COUNTER64() code is inlined, and the function call is a separate pessimization. It costs about half of the 9 instructions on amd64 and its instructions are relatively heavyweight.) This is when i386 has cmpxchgb. The single cmpxchg8b instruction is heavier weight than a 32-bit memory increment and using it takes lots of control logic. > iirc, each platform implements counters its own way, probably the wrong > way on all of them except x86. I think other arches just use compatiblity code which uses critical sections. This is not so bad. It might be faster than using cmpxchg8b depending on how fast critical_enter() and critical_exit() are. Unfortunately, they are not very fast. They are functions too, and on i386 critical_enter() takes 20+ instructions. critical_exit() takes more, and debugging is broken and caused a panic when I tried to trace through critical_exit(). That is so slow that hard-disabling interrupts is probably faster. Network drivers were mostly written under the assumption that they are running on a UP system and incrementing a counter is inline and fast, so they increment counters without worrying about the overhead for this. 33 instructions for 2 if_inc_counter()s per packet is about a 1% pessimization for bge on my slow hardware. > For some crazy reason the docs for COUNTERS say that it does not use > atomics. I have no idea why the docs for an API are dictating > implementation, but I suspect it's because atomics are more expensive > on x86 than other alternatives. So the arm code slavishly avoids using > atomics in COUNTERS even though doing so would be more effecient than > the current copied-from-x86 code. Other places just hard-code use of PCPU although that is also more complicated and uglier than counter++. Counters in PCPU only exist because full atomics are probably slower on all arches and much slower on most arches. Most 64-bit PCPU accesses on 32-bit arches are broken since they are not atomic even for 1 CPU. COUNTER64() is more careful to a fault. arm PCPU_INC() seems to be broken even for 32-bit accesses. In the non-SMP case, it just does pcpu->pc_ ## member++ and in the SMP case it does the same with a register pointer instead of a global. I wrote some alternative x86 implementations that are at least 20% faster than the cmpxchg8b method, but the best method is clearly to use only 32-bit low-level counters and add up the counters in a daemon. The daemon shouldn't run very often. There aren't many counters except i/o byte counters that want to wrap in 32 bits more than once per hour. Even 100 Gbps ethernet can only do 150 Mpps so it takes at least 30 seconds to wrap. Bruce From owner-svn-src-all@freebsd.org Wed May 18 20:05:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61B1AB41BD9; Wed, 18 May 2016 20:05:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id EC29A111D; Wed, 18 May 2016 20:05:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id A01833C57DF; Thu, 19 May 2016 06:05:37 +1000 (AEST) Date: Thu, 19 May 2016 06:05:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: yBryan Drewery , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: Re: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd In-Reply-To: <20160518124147.V7042@besplex.bde.org> Message-ID: <20160519060448.B1270@besplex.bde.org> References: <201605172228.u4HMSbhj012124@repo.freebsd.org> <14a8d29d-bc14-3f96-57a4-81f1b6dfdd82@FreeBSD.org> <20160517230710.GB1015@FreeBSD.org> <38ca6091-5607-5796-9f6e-7f2d6c117707@FreeBSD.org> <20160518124147.V7042@besplex.bde.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.1 cv=TuMb/2jh c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=YdjKeqWGE6BAugsnKCQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 20:05:45 -0000 On Wed, 18 May 2016, Bruce Evans wrote: > On Tue, 17 May 2016, Bryan Drewery wrote: > >> On 5/17/16 4:07 PM, Gleb Smirnoff wrote: >>> On Tue, May 17, 2016 at 03:59:26PM -0700, Bryan Drewery wrote: >>> B> > Author: glebius >>> B> > Date: Tue May 17 22:28:36 2016 >>> B> > New Revision: 300088 >>> B> > URL: https://svnweb.freebsd.org/changeset/base/300088 >>> B> > >>> B> > Log: >>> B> > - Use unsigned version of min() when handling arguments of SETFKEY >>> ioctl. >>> B> > - Validate that user supplied control message length in sendmsg(2) >>> B> > is not negative. >>> B> >>> B> The sendmsg(2) change is not included here (9.3) nor in the advisory >>> but >>> B> is in the commit log. Was it intended to be changed in 9.3? >>> >>> That was my failure to mention SA-16:19 in commit message for 9.3. It >>> doesn't >>> apply to 9.x. >>> >>> B> Plus the only consumer I see is sendit() which seems to be protected >>> B> already from negative values when not using COMPAT_43: >>> B> >>> B> > if (mp->msg_controllen < sizeof(struct cmsghdr) >>> B> > #ifdef COMPAT_OLDSOCK >>> B> > && mp->msg_flags != MSG_COMPAT >>> B> > #endif >>> B> > ) { >>> B> > error = EINVAL; >>> B> > goto bad; >>> B> > } >>> B> > error = sockargs(&control, mp->msg_control, >>> B> > mp->msg_controllen, MT_CONTROL); >>> >>> No, it isn't protected. In the comparison (mp->msg_controllen < >>> sizeof(struct cmsghdr)) >>> both values are unsigned. Later in sockargs() it is treated as signed. > > But it is protected (except on exotic unsupported arches). The above is > a complete bounds check for mp->msg_controllen, written in an obfuscated > way using an unsigned type botch/hack. Negative values are normally > promoted to large unsigned values, so they fail this check and sockargs() > is never called with them. > > On exotic arches, the analysis is more complicated and the hack doesn't > work. ... Oops. I read this sort of backwards. The unsign botches are somewhat larger, and more like the one in kbd.c: - this only checks the lower bound, so if the operands were negative then they would pass instead of fail the check after bogus unsign extension - the operands are actually both unsigned, since msg_controllen already has unsigned poisoning. It was poisoned even in FreeBSD-1. It was u_int then. It is still u_int in 4.4BSD-Lite*. Now it is socklen_t, which is uint32_t. POSIX has messes for this. At least in the 2001 version, it doesn't seem to require the poisoning, but recommends that applications not use values above 2**31-1 [since these values require the poisoning to represent, and are not very useful except for opening security holes like here]. - so after passing the lower bound check, msg_controllen may have a large unsigned 32-bit value. Undefined behaviour occurs when we pass this to sockargs() which doesn't have unsign poisoning. Except on unsupported exotic arches, the behaviour is to overflow to a negative value. - sockargs() then checks the overflowed value. This is robust enough if the overflow gives any value at all, but still bogus. Correct code would do bounds checks before calling sockargs (of the form val >= min && val <= INT_MAX), but there are several callers and it is convenient to check only in sockargs(). For that, sockargs must take a parameter with the same type as msg_controllen, although old unsign botches force this to be unsigned (precisely socklen_t). It is too late to change socklen_t back to int. Bruce From owner-svn-src-all@freebsd.org Wed May 18 20:06:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A74BB41C2A; Wed, 18 May 2016 20:06:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 098041299; Wed, 18 May 2016 20:06:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IK6kTZ011779; Wed, 18 May 2016 20:06:46 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IK6jP8011776; Wed, 18 May 2016 20:06:45 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605182006.u4IK6jP8011776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 18 May 2016 20:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300164 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 20:06:47 -0000 Author: bz Date: Wed May 18 20:06:45 2016 New Revision: 300164 URL: https://svnweb.freebsd.org/changeset/base/300164 Log: Rather than having the if_vmove() code intermixed in the vnet_destroy() function in vnet.c move it to if.c where it logically belongs and put it under a VNET_SYSUNINIT() call. To not change the current behaviour make sure it runs first thing during teardown. In the future this will allow us more flexibility on changing the order on when we want to get rid of interfaces. Stop exporting if_vmove() and make it file static. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6438 Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/net/vnet.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed May 18 19:59:05 2016 (r300163) +++ head/sys/net/if.c Wed May 18 20:06:45 2016 (r300164) @@ -182,6 +182,9 @@ static int if_getgroupmembers(struct ifg static void if_delgroups(struct ifnet *); static void if_attach_internal(struct ifnet *, int, struct if_clone *); static int if_detach_internal(struct ifnet *, int, struct if_clone **); +#ifdef VIMAGE +static void if_vmove(struct ifnet *, struct vnet *); +#endif #ifdef INET6 /* @@ -392,6 +395,20 @@ vnet_if_uninit(const void *unused __unus } VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_uninit, NULL); + +static void +vnet_if_return(const void *unused __unused) +{ + struct ifnet *ifp, *nifp; + + /* Return all inherited interfaces to their parent vnets. */ + TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { + if (ifp->if_home_vnet != ifp->if_vnet) + if_vmove(ifp, ifp->if_home_vnet); + } +} +VNET_SYSUNINIT(vnet_if_return, SI_SUB_VNET_DONE, SI_ORDER_ANY, + vnet_if_return, NULL); #endif static void Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed May 18 19:59:05 2016 (r300163) +++ head/sys/net/if_var.h Wed May 18 20:06:45 2016 (r300164) @@ -535,7 +535,6 @@ void if_dead(struct ifnet *); int if_delmulti(struct ifnet *, struct sockaddr *); void if_delmulti_ifma(struct ifmultiaddr *); void if_detach(struct ifnet *); -void if_vmove(struct ifnet *, struct vnet *); void if_purgeaddrs(struct ifnet *); void if_delallmulti(struct ifnet *); void if_down(struct ifnet *); Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Wed May 18 19:59:05 2016 (r300163) +++ head/sys/net/vnet.c Wed May 18 20:06:45 2016 (r300164) @@ -269,7 +269,6 @@ vnet_alloc(void) void vnet_destroy(struct vnet *vnet) { - struct ifnet *ifp, *nifp; SDT_PROBE2(vnet, functions, vnet_destroy, entry, __LINE__, vnet); KASSERT(vnet->vnet_sockcnt == 0, @@ -280,13 +279,6 @@ vnet_destroy(struct vnet *vnet) VNET_LIST_WUNLOCK(); CURVNET_SET_QUIET(vnet); - - /* Return all inherited interfaces to their parent vnets. */ - TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { - if (ifp->if_home_vnet != ifp->if_vnet) - if_vmove(ifp, ifp->if_home_vnet); - } - vnet_sysuninit(); CURVNET_RESTORE(); From owner-svn-src-all@freebsd.org Wed May 18 20:14:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD69B41E44; Wed, 18 May 2016 20:14:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::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 0093D18F2; Wed, 18 May 2016 20:14:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id y7so5909405pfb.0; Wed, 18 May 2016 13:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=dmMa4ccm5azUZS0shvqNwI0iM1JFZhmnApAOdAb45m8=; b=lzmxjKDImaaHijEaY08tM8d4FXL5zje1ptgYMdQWboPXxKSRDwVGyq/KvlIw4vKh5l ekv+r0eXt+k8NZtAWY5lvuW7WRds4TnwUIUbL0z3bcbBhIHPX6ENmRj4W3O95Avc6U6R QJ2w8A59kVrAJYiTwFpJ+ynaLj3pRPjS9DhqGgAGwjYH8Fd4RDnyHwyB2mhCP9A+jXHx frlFVLsCo44eAXjMZz2UPJBiYF+tLoC5pRf6P51ZDZCyQTzNgzARUpV3kF6n8TZt8MrW WSo4QxiqokjR2I7e0VnABEjFoUhfSPDo9LIUZT5sdR+x8hUjzNZWsIg08aiJTFoVgl61 n47A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=dmMa4ccm5azUZS0shvqNwI0iM1JFZhmnApAOdAb45m8=; b=LJZeljW22ziiFCaonQo102GsEwIyUGd0LPHKHjuIaMoTELGDIrtVzsgwo8w7wmXJn7 uYyXyDyrj57uv4RUQ42A4YyrqJY1Ke5pvGyWMN0B8ndYBQ3ZMvYCSp+NumP7dO7/MQXB 1NTC6o/nwkJzv5GZ0CHvvcLlKAPIZWiEAoU/UGOCDO1P/Ix2GXMCPJW39F+ZFkINn0Dt +4ZqoYxhIqmaTYIACFdchz0zrxk8oCDPgbCHz3EbrIuSpUd4Qe/11IlEaUyj2FQKNFhg TTdI5hBVEOZlMV9s0xlY9wYkE3khe4DOKQdiIxfpaaeeXeBMxe/URmP+XnHkvwWskbGY ggKw== X-Gm-Message-State: AOPr4FXSJugNIemFEvphigQLeym9oDKpeQ01ClXoOMkl8pR3KtV6Fjs7HbK2RL3WQnSbKw== X-Received: by 10.98.20.197 with SMTP id 188mr13669883pfu.144.1463602452595; Wed, 18 May 2016 13:14:12 -0700 (PDT) Received: from [21.177.199.178] ([172.56.42.72]) by smtp.gmail.com with ESMTPSA id s14sm12994023pag.7.2016.05.18.13.14.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2016 13:14:11 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Ngie Cooper Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r299830 - head/contrib/bsnmp/snmpd Date: Wed, 18 May 2016 13:07:01 -0700 Message-Id: <7C423729-7685-41B8-9813-FF02A02B587A@gmail.com> References: <201605150336.u4F3aJxd062168@repo.freebsd.org> <20160518182135.GL1015@FreeBSD.org> Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20160518182135.GL1015@FreeBSD.org> To: Gleb Smirnoff X-Mailer: iPhone Mail (13F69) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 20:14:13 -0000 > On May 18, 2016, at 11:21, Gleb Smirnoff wrote: >=20 > Garrett, >=20 > On Sun, May 15, 2016 at 03:36:19AM +0000, Garrett Cooper wrote: > G> Author: ngie > G> Date: Sun May 15 03:36:19 2016 > G> New Revision: 299830 > G> URL: https://svnweb.freebsd.org/changeset/base/299830 > G>=20 > G> Log: > G> Fix -Wcast-align warnings > G> =20 > G> Use memcpy instead of using direct assignment of void* pointers with > G> CMSG_DATA(..), which changes alignment > G> =20 > G> MFC after: 3 weeks > G> Reported by: clang > G> Sponsored by: EMC / Isilon Storage Division > G>=20 > G> Modified: > G> head/contrib/bsnmp/snmpd/main.c > G>=20 > G> Modified: head/contrib/bsnmp/snmpd/main.c > G> =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 > G> --- head/contrib/bsnmp/snmpd/main.c Sun May 15 03:22:13 2016 (r29= 9829) > G> +++ head/contrib/bsnmp/snmpd/main.c Sun May 15 03:36:19 2016 (r29= 9830) > G> @@ -1169,7 +1169,7 @@ recv_dgram(struct port_input *pi, struct > G> memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); > G> if (cmsg->cmsg_level =3D=3D SOL_SOCKET && > G> cmsg->cmsg_type =3D=3D SCM_CREDS) > G> - cred =3D (struct sockcred *)CMSG_DATA(cmsg); > G> + memcpy(cred, CMSG_DATA(cmsg), sizeof(struct sockcred)); >=20 > And cred is always NULL at this point, isn't it? markj noted this as well. This is the one commit I should have had reviewed b= y other folks because I missed this point. I'll revert the commit, mute the warning, and move on... Every time I've tri= ed fixing CMSG I've ended up with headaches, so... I'm likely not the right p= erson to be fixing these issues. Thanks, -Ngie= From owner-svn-src-all@freebsd.org Wed May 18 20:49:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D377B3F701; Wed, 18 May 2016 20:49:11 +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 D25111A3B; Wed, 18 May 2016 20:49:10 +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 u4IKnA8W024045; Wed, 18 May 2016 20:49:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IKnAge024044; Wed, 18 May 2016 20:49:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605182049.u4IKnAge024044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 20:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300165 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 20:49:11 -0000 Author: imp Date: Wed May 18 20:49:09 2016 New Revision: 300165 URL: https://svnweb.freebsd.org/changeset/base/300165 Log: mipsn32el is not a thing, remove it from the list of valid architectures. There's no definition for it, nobody uses it and it is unlikely to ever work. We can put it back when someone demonstrates it running... The new default for armv6 is hard float, so extend that default to the external toolchain support. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 18 20:06:45 2016 (r300164) +++ head/Makefile.inc1 Wed May 18 20:49:09 2016 (r300165) @@ -225,7 +225,6 @@ KNOWN_ARCHES?= aarch64/arm64 \ mipsel/mips \ mips64el/mips \ mips64/mips \ - mipsn32el/mips \ mipsn32/mips \ powerpc \ powerpc64/powerpc \ @@ -460,7 +459,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} BFLAGS+= -B${WORLDTMP}/usr/bin .endif .if ${TARGET} == "arm" -.if ${TARGET_ARCH:M*hf*} != "" +.if ${TARGET_ARCH:Marmv6*} != "" && ${TARGET_CPUTYPE:M*soft*} != "" TARGET_ABI= gnueabihf .else TARGET_ABI= gnueabi From owner-svn-src-all@freebsd.org Wed May 18 20:55:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87ECCB3F86D; Wed, 18 May 2016 20:55:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 581261E72; Wed, 18 May 2016 20:55:05 +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 u4IKt46K026981; Wed, 18 May 2016 20:55:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IKt43Y026980; Wed, 18 May 2016 20:55:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605182055.u4IKt43Y026980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 18 May 2016 20:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300166 - stable/10/lib/libpam/modules X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 20:55:05 -0000 Author: bdrewery Date: Wed May 18 20:55:04 2016 New Revision: 300166 URL: https://svnweb.freebsd.org/changeset/base/300166 Log: MFC r297947: Build libpam modules in parallel. Modified: stable/10/lib/libpam/modules/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpam/modules/Makefile ============================================================================== --- stable/10/lib/libpam/modules/Makefile Wed May 18 20:49:09 2016 (r300165) +++ stable/10/lib/libpam/modules/Makefile Wed May 18 20:55:04 2016 (r300166) @@ -27,5 +27,6 @@ .include "modules.inc" SUBDIR= ${MODULES} +SUBDIR_PARALLEL= .include From owner-svn-src-all@freebsd.org Wed May 18 21:25:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B82B9B3FE5A; Wed, 18 May 2016 21:25:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A8B141AF3; Wed, 18 May 2016 21:25:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A17D31A8D; Wed, 18 May 2016 21:25:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 4F70A1FA2D; Wed, 18 May 2016 21:25:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id fDV3GkUzumLl; Wed, 18 May 2016 21:25:00 +0000 (UTC) Subject: Re: svn commit: r300165 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 640CF1FA23 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605182049.u4IKnAge024044@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <021240eb-8ba3-3af3-cb13-45dbaa8a76ac@FreeBSD.org> Date: Wed, 18 May 2016 14:24:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605182049.u4IKnAge024044@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 21:25:03 -0000 On 5/18/16 1:49 PM, Warner Losh wrote: > Author: imp > Date: Wed May 18 20:49:09 2016 > New Revision: 300165 > URL: https://svnweb.freebsd.org/changeset/base/300165 > > Log: > mipsn32el is not a thing, remove it from the list of valid > architectures. There's no definition for it, nobody uses it > and it is unlikely to ever work. We can put it back when someone > demonstrates it running... > > The new default for armv6 is hard float, so extend that default > to the external toolchain support. > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Wed May 18 20:06:45 2016 (r300164) > +++ head/Makefile.inc1 Wed May 18 20:49:09 2016 (r300165) > @@ -225,7 +225,6 @@ KNOWN_ARCHES?= aarch64/arm64 \ > mipsel/mips \ > mips64el/mips \ > mips64/mips \ > - mipsn32el/mips \ > mipsn32/mips \ > powerpc \ > powerpc64/powerpc \ > @@ -460,7 +459,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} > BFLAGS+= -B${WORLDTMP}/usr/bin > .endif > .if ${TARGET} == "arm" > -.if ${TARGET_ARCH:M*hf*} != "" > +.if ${TARGET_ARCH:Marmv6*} != "" && ${TARGET_CPUTYPE:M*soft*} != "" > TARGET_ABI= gnueabihf > .else > TARGET_ABI= gnueabi > It doesn't seem quite right... ~/git/freebsd # XCC=/usr/bin/cc TARGET=arm TARGET_ARCH=armv6 make -f Makefile.inc1 -V TARGET_ABI -V TARGET_CPUTYPE gnueabi (blank) Did you mean ${TARGET_CPUTYPE:M*soft*} == "" ? -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Wed May 18 22:02:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D464B4166B; Wed, 18 May 2016 22:02:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9FE91D5A; Wed, 18 May 2016 22:02:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IM2Kdk047309; Wed, 18 May 2016 22:02:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IM2JF7047307; Wed, 18 May 2016 22:02:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605182202.u4IM2JF7047307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 18 May 2016 22:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 22:02:21 -0000 Author: glebius Date: Wed May 18 22:02:19 2016 New Revision: 300167 URL: https://svnweb.freebsd.org/changeset/base/300167 Log: Revert r299830, it has couple of fatal errors. The CMSG_ family of macros take care of alignment, so we don't need r299830 at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile. Together with: peter Modified: head/contrib/bsnmp/snmpd/main.c head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Wed May 18 20:55:04 2016 (r300166) +++ head/contrib/bsnmp/snmpd/main.c Wed May 18 22:02:19 2016 (r300167) @@ -1169,7 +1169,7 @@ recv_dgram(struct port_input *pi, struct memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) - memcpy(cred, CMSG_DATA(cmsg), sizeof(struct sockcred)); + cred = (struct sockcred *)CMSG_DATA(cmsg); } if (pi->cred) @@ -1207,7 +1207,7 @@ snmpd_input(struct port_input *pi, struc ret = recv_stream(pi); } else { - struct in_addr laddr; + struct in_addr *laddr; memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); msg.msg_control = cbuf; @@ -1216,11 +1216,11 @@ snmpd_input(struct port_input *pi, struc cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); cmsgp->cmsg_level = IPPROTO_IP; cmsgp->cmsg_type = IP_SENDSRCADDR; - memcpy(&laddr, CMSG_DATA(cmsgp), sizeof(struct in_addr)); + laddr = (struct in_addr *)CMSG_DATA(cmsgp); - ret = recv_dgram(pi, &laddr); + ret = recv_dgram(pi, laddr); - if (laddr.s_addr == 0) { + if (laddr->s_addr == 0) { msg.msg_control = NULL; msg.msg_controllen = 0; } Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Wed May 18 20:55:04 2016 (r300166) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Wed May 18 22:02:19 2016 (r300167) @@ -47,6 +47,7 @@ MANFILTER= sed -e 's%@MODPATH@%${LIBDIR} -e 's%@DEFPATH@%${DEFSDIR}/%g' \ -e 's%@MIBSPATH@%${BMIBSDIR}/%g' +NO_WCAST_ALIGN= yes WARNS?= 6 .include From owner-svn-src-all@freebsd.org Wed May 18 22:05:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2576B416E7; Wed, 18 May 2016 22:05:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF631F2C; Wed, 18 May 2016 22:05:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IM5ong048115; Wed, 18 May 2016 22:05:50 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IM5okP048113; Wed, 18 May 2016 22:05:50 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605182205.u4IM5okP048113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 18 May 2016 22:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300168 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 22:05:52 -0000 Author: glebius Date: Wed May 18 22:05:50 2016 New Revision: 300168 URL: https://svnweb.freebsd.org/changeset/base/300168 Log: The SA-16:19 wouldn't have happened if the sockargs() had properly typed argument for length. While here make it static and convert to ANSI C. Reviewed by: C Turt Modified: head/sys/kern/uipc_syscalls.c head/sys/sys/socketvar.h Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Wed May 18 22:02:19 2016 (r300167) +++ head/sys/kern/uipc_syscalls.c Wed May 18 22:05:50 2016 (r300168) @@ -84,6 +84,7 @@ static int getsockname1(struct thread *t int compat); static int getpeername1(struct thread *td, struct getpeername_args *uap, int compat); +static int sockargs(struct mbuf **, char *, socklen_t, int); /* * Convert a user file descriptor to a kernel file entry and check if required @@ -1689,19 +1690,13 @@ ogetpeername(td, uap) } #endif /* COMPAT_OLDSOCK */ -int -sockargs(mp, buf, buflen, type) - struct mbuf **mp; - caddr_t buf; - int buflen, type; +static int +sockargs(struct mbuf **mp, char *buf, socklen_t buflen, int type) { struct sockaddr *sa; struct mbuf *m; int error; - if (buflen < 0) - return (EINVAL); - if (buflen > MLEN) { #ifdef COMPAT_OLDSOCK if (type == MT_SONAME && buflen <= 112) @@ -1713,7 +1708,7 @@ sockargs(mp, buf, buflen, type) } m = m_get2(buflen, M_WAITOK, type, 0); m->m_len = buflen; - error = copyin(buf, mtod(m, caddr_t), (u_int)buflen); + error = copyin(buf, mtod(m, void *), buflen); if (error != 0) (void) m_free(m); else { Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Wed May 18 22:02:19 2016 (r300167) +++ head/sys/sys/socketvar.h Wed May 18 22:05:50 2016 (r300168) @@ -335,7 +335,6 @@ struct uio; /* * From uipc_socket and friends */ -int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type); int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len); int getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp, u_int *fflagp); From owner-svn-src-all@freebsd.org Wed May 18 22:14:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB2BDB418BE for ; Wed, 18 May 2016 22:14:28 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FEB213B5 for ; Wed, 18 May 2016 22:14:28 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: f2c54992-1d45-11e6-a09e-4d61a6885157 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 18 May 2016 22:14:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4IMEP6n053621; Wed, 18 May 2016 16:14:25 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463609665.1180.301.camel@freebsd.org> Subject: Re: svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd From: Ian Lepore To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 18 May 2016 16:14:25 -0600 In-Reply-To: <201605182202.u4IM2JF7047307@repo.freebsd.org> References: <201605182202.u4IM2JF7047307@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 22:14:28 -0000 On Wed, 2016-05-18 at 22:02 +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed May 18 22:02:19 2016 > New Revision: 300167 > URL: https://svnweb.freebsd.org/changeset/base/300167 > > Log: > Revert r299830, it has couple of fatal errors. > > The CMSG_ family of macros take care of alignment, so we don't need > r299830 > at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile. > So all of this was about a "cast increases required alignment" kind of warning for a macro that takes care of alignment? Wouldn't the proper fix then be to change CMSG_DATA() so that its internal cast is void* instead of unsigned char* (he asked, knowing Bruce would come along soon and point out why that's a dumb question)? -- Ian From owner-svn-src-all@freebsd.org Wed May 18 22:23:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4193AB41AFE; Wed, 18 May 2016 22:23:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13CBE1AFD; Wed, 18 May 2016 22:23:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IMNKWm054084; Wed, 18 May 2016 22:23:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IMNKxX054083; Wed, 18 May 2016 22:23:20 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605182223.u4IMNKxX054083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 18 May 2016 22:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300169 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 22:23:21 -0000 Author: rmacklem Date: Wed May 18 22:23:20 2016 New Revision: 300169 URL: https://svnweb.freebsd.org/changeset/base/300169 Log: If a local (AF_LOCAL, AF_UNIX) socket creation (bind) is attempted on a fuse mounted file system, it will crash. Although it may be possible to make this work correctly, this patch avoids the crash in the meantime. I removed the MPASS(), since panicing for the FIFO case didn't make a lot of sense when it returns an error for the others. PR: 195000 Submitted by: henry.hu.sh@gmail.com (earlier version) MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed May 18 22:05:50 2016 (r300168) +++ head/sys/fs/fuse/fuse_vnops.c Wed May 18 22:23:20 2016 (r300169) @@ -335,8 +335,9 @@ fuse_vnop_create(struct vop_create_args /* XXX: Will we ever want devices ? */ if ((vap->va_type != VREG)) { - MPASS(vap->va_type != VFIFO); - goto bringup; + printf("fuse_vnop_create: unsupported va_type %d\n", + vap->va_type); + return (EINVAL); } debug_printf("parent nid = %ju, mode = %x\n", (uintmax_t)parentnid, mode); @@ -364,7 +365,7 @@ fuse_vnop_create(struct vop_create_args debug_printf("create: got err=%d from daemon\n", err); goto out; } -bringup: + feo = fdip->answ; if ((err = fuse_internal_checkentry(feo, VREG))) { From owner-svn-src-all@freebsd.org Wed May 18 22:24:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7292B41BEF; Wed, 18 May 2016 22:24:53 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97DF01D93; Wed, 18 May 2016 22:24:53 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IMOqCJ054195; Wed, 18 May 2016 22:24:52 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IMOqek054194; Wed, 18 May 2016 22:24:52 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201605182224.u4IMOqek054194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 18 May 2016 22:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300170 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 22:24:53 -0000 Author: sjg Date: Wed May 18 22:24:52 2016 New Revision: 300170 URL: https://svnweb.freebsd.org/changeset/base/300170 Log: Initialize date of rootNode. Reviewed by: jtl Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Wed May 18 22:23:20 2016 (r300169) +++ head/usr.sbin/makefs/cd9660.c Wed May 18 22:24:52 2016 (r300170) @@ -685,6 +685,9 @@ cd9660_finalize_PVD(void) cd9660_time_8426( (unsigned char *)diskStructure.primaryDescriptor.effective_date, tim); + /* make this sane */ + cd9660_time_915(diskStructure.rootNode->dot_record->isoDirRecord->date, + tim); } static void From owner-svn-src-all@freebsd.org Wed May 18 22:50:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 627D0B41087; Wed, 18 May 2016 22:50:26 +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 33B141CAA; Wed, 18 May 2016 22:50:26 +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 u4IMoPaf060700; Wed, 18 May 2016 22:50:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IMoP8R060699; Wed, 18 May 2016 22:50:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605182250.u4IMoP8R060699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 May 2016 22:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300171 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 22:50:26 -0000 Author: imp Date: Wed May 18 22:50:25 2016 New Revision: 300171 URL: https://svnweb.freebsd.org/changeset/base/300171 Log: Fix negative logic error. We want gnueabihf ABI when we're NOT requesting soft float ABI. Noticed by: bdrewery Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 18 22:24:52 2016 (r300170) +++ head/Makefile.inc1 Wed May 18 22:50:25 2016 (r300171) @@ -459,7 +459,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} BFLAGS+= -B${WORLDTMP}/usr/bin .endif .if ${TARGET} == "arm" -.if ${TARGET_ARCH:Marmv6*} != "" && ${TARGET_CPUTYPE:M*soft*} != "" +.if ${TARGET_ARCH:Marmv6*} != "" && ${TARGET_CPUTYPE:M*soft*} == "" TARGET_ABI= gnueabihf .else TARGET_ABI= gnueabi From owner-svn-src-all@freebsd.org Wed May 18 23:28:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9975B41820; Wed, 18 May 2016 23:28:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (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 AC2511F15; Wed, 18 May 2016 23:28:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id c189so23905874pfb.3; Wed, 18 May 2016 16:28:22 -0700 (PDT) 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=UycR1ugyfUALiJ3vWjFvcxKM2aVKu4SdvIQHkgRsJ98=; b=meMa0AV667TGPFj5ZcLYNMtYhUU/BGnvsaAWVQ+QeDutuhGd287uybEdZIRX6yRr8t yfRrCta6HvLjcGiq+QgIo4+7ztWKjiDCf5nyrNxBl02pfIw5BKj+nCK6FB/171H1ZmJk gmkKePoX+yoWGqhnfDf5ryd+NW93rSXHdoci1MKLmtyHq29xCRpRsl/Z6x/Wo+vL4hNu uvmU6G/Ofi5jEpp/VP8LShj8puFJeA88xW4cteOmhhnw8OoS2ZWieH50kJZbPECKVTTt z1DrayVyAvyJy4c8hQ9mZQRlSAoqY+A88QGNgBZGJdjDSFnAh8YqTE+iJfgxZygl5wjR fi8Q== 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=UycR1ugyfUALiJ3vWjFvcxKM2aVKu4SdvIQHkgRsJ98=; b=C3bd6SAa94sL/d55ouwLcBKg3gJFVFMgMz8KP0j6aQfyFRXoaKDYnWrt0JslvQUQGC 3uE/cX1jGTCEn+exDLi2Jw/HhrY7hKtDq+yM7J49DjrdB4O3X36CPqMdst+hdLpXNHVv zv6rh+GC2rUVDls17yndCagXepn9FmhC0RWMC1kaRPGs+wHkFoDrwMqPIeiT+4LcqrQ5 5zBQnA+L656tnViTr+wcSZCiRJnURCLIUeEF8KOmjkYWqdxliJi9KnKOxskV6xa5r9uH LAPMunRvZJriqGrVqlnIbaBu4AMgoJN0KWWJ6NUyIShchGlVR6pxyU3EXDmasOR/IYel e3gg== X-Gm-Message-State: AOPr4FX8JDpKht1XqemNmwvin0BhoaQER43GJmS9/R2+1yBJ/FrBUYA/JLhk9NxHXOz9gA== X-Received: by 10.98.93.129 with SMTP id n1mr14863277pfj.16.1463614102274; Wed, 18 May 2016 16:28:22 -0700 (PDT) Received: from [192.168.100.67] ([199.231.240.59]) by smtp.gmail.com with ESMTPSA id i75sm14728823pfj.51.2016.05.18.16.28.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2016 16:28:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605182202.u4IM2JF7047307@repo.freebsd.org> Date: Wed, 18 May 2016 16:28:29 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <654B653E-E8A3-4896-B5AC-83CBC93A0A0C@gmail.com> References: <201605182202.u4IM2JF7047307@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:28:23 -0000 > On May 18, 2016, at 15:02, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Wed May 18 22:02:19 2016 > New Revision: 300167 > URL: https://svnweb.freebsd.org/changeset/base/300167 >=20 > Log: > Revert r299830, it has couple of fatal errors. >=20 > The CMSG_ family of macros take care of alignment, so we don't need = r299830 > at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile. >=20 > Together with: peter Thank you :(..= From owner-svn-src-all@freebsd.org Wed May 18 23:35:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A87DB419B2; Wed, 18 May 2016 23:35: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 319FB1330; Wed, 18 May 2016 23:35:38 +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 u4INZbvR075516; Wed, 18 May 2016 23:35:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4INZbv8075515; Wed, 18 May 2016 23:35:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605182335.u4INZbv8075515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 18 May 2016 23:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300172 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:35:38 -0000 Author: cem Date: Wed May 18 23:35:37 2016 New Revision: 300172 URL: https://svnweb.freebsd.org/changeset/base/300172 Log: Revert r299512 It broke client identifiers because I misunderstood the intent of the code. There is still a minor issue detected by Coverity (at least, I can't find where the code proves it isn't an issue). I'll follow up with a better fix for the CIDs. Reported by: Ian FREISLICH Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed May 18 22:50:25 2016 (r300171) +++ head/sbin/dhclient/dhclient.c Wed May 18 23:35:37 2016 (r300172) @@ -56,8 +56,6 @@ #include __FBSDID("$FreeBSD$"); -#include - #include "dhcpd.h" #include "privsep.h" @@ -1572,18 +1570,16 @@ make_discover(struct interface_info *ip, } /* set unique client identifier */ - struct hardware client_ident; + char client_ident[sizeof(struct hardware)]; if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) { - size_t hwlen = MIN(ip->hw_address.hlen, - sizeof(client_ident.haddr)); - client_ident.htype = ip->hw_address.htype; - client_ident.hlen = hwlen; - memcpy(client_ident.haddr, ip->hw_address.haddr, hwlen); + int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? + ip->hw_address.hlen : sizeof(client_ident)-1; + client_ident[0] = ip->hw_address.htype; + memcpy(&client_ident[1], ip->hw_address.haddr, hwlen); options[DHO_DHCP_CLIENT_IDENTIFIER] = &option_elements[DHO_DHCP_CLIENT_IDENTIFIER]; - options[DHO_DHCP_CLIENT_IDENTIFIER]->value = (void *)&client_ident; - hwlen += offsetof(struct hardware, haddr); - options[DHO_DHCP_CLIENT_IDENTIFIER]->len = hwlen; - options[DHO_DHCP_CLIENT_IDENTIFIER]->buf_size = hwlen; + options[DHO_DHCP_CLIENT_IDENTIFIER]->value = client_ident; + options[DHO_DHCP_CLIENT_IDENTIFIER]->len = hwlen+1; + options[DHO_DHCP_CLIENT_IDENTIFIER]->buf_size = hwlen+1; options[DHO_DHCP_CLIENT_IDENTIFIER]->timeout = 0xFFFFFFFF; } @@ -1609,8 +1605,8 @@ make_discover(struct interface_info *ip, 0, sizeof(ip->client->packet.siaddr)); memset(&(ip->client->packet.giaddr), 0, sizeof(ip->client->packet.giaddr)); - memcpy(ip->client->packet.chaddr, ip->hw_address.haddr, - MIN(ip->hw_address.hlen, sizeof(ip->client->packet.chaddr))); + memcpy(ip->client->packet.chaddr, + ip->hw_address.haddr, ip->hw_address.hlen); } From owner-svn-src-all@freebsd.org Wed May 18 23:39:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE606B41AFD; Wed, 18 May 2016 23:39:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB0DA176B; Wed, 18 May 2016 23:39:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4INdWBj075692; Wed, 18 May 2016 23:39:32 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4INdVIi075681; Wed, 18 May 2016 23:39:31 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605182339.u4INdVIi075681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 18 May 2016 23:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300173 - in head/sys: dev/atkbdc dev/le sparc64/central sparc64/ebus sparc64/fhc sparc64/isa sparc64/pci sparc64/sbus sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:39:34 -0000 Author: gonzo Date: Wed May 18 23:39:31 2016 New Revision: 300173 URL: https://svnweb.freebsd.org/changeset/base/300173 Log: Use OF_prop_free instead of direct call to free(9) Reviewed by: marius Modified: head/sys/dev/atkbdc/atkbdc_ebus.c head/sys/dev/le/lebuffer_sbus.c head/sys/sparc64/central/central.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/fhc/fhc.c head/sys/sparc64/isa/isa.c head/sys/sparc64/pci/ofw_pci.c head/sys/sparc64/sbus/dma_sbus.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/upa.c Modified: head/sys/dev/atkbdc/atkbdc_ebus.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_ebus.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/dev/atkbdc/atkbdc_ebus.c Wed May 18 23:39:31 2016 (r300173) @@ -242,14 +242,14 @@ atkbdc_ebus_attach(device_t dev) device_printf(dev, "<%s>: only two children per 8042 supported\n", cname); - free(cname, M_OFWPROP); + OF_prop_free(cname); continue; } adi = malloc(sizeof(struct atkbdc_device), M_ATKBDDEV, M_NOWAIT | M_ZERO); if (adi == NULL) { device_printf(dev, "<%s>: malloc failed\n", cname); - free(cname, M_OFWPROP); + OF_prop_free(cname); continue; } if (strcmp(cname, "kb_ps2") == 0) { @@ -261,7 +261,7 @@ atkbdc_ebus_attach(device_t dev) } else { device_printf(dev, "<%s>: unknown device\n", cname); free(adi, M_ATKBDDEV); - free(cname, M_OFWPROP); + OF_prop_free(cname); continue; } intr = bus_get_resource_start(dev, SYS_RES_IRQ, adi->rid); @@ -270,7 +270,7 @@ atkbdc_ebus_attach(device_t dev) "<%s>: cannot determine interrupt resource\n", cname); free(adi, M_ATKBDDEV); - free(cname, M_OFWPROP); + OF_prop_free(cname); continue; } resource_list_init(&adi->resources); @@ -281,7 +281,7 @@ atkbdc_ebus_attach(device_t dev) cname); resource_list_free(&adi->resources); free(adi, M_ATKBDDEV); - free(cname, M_OFWPROP); + OF_prop_free(cname); continue; } device_set_ivars(cdev, adi); Modified: head/sys/dev/le/lebuffer_sbus.c ============================================================================== --- head/sys/dev/le/lebuffer_sbus.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/dev/le/lebuffer_sbus.c Wed May 18 23:39:31 2016 (r300173) @@ -197,7 +197,7 @@ lebuffer_setup_dinfo(device_t dev, phand if (slot != -1 && slot != rslot) { device_printf(dev, "<%s>: multiple slots\n", ldi->ldi_obdinfo.obd_name); - free(reg, M_OFWPROP); + OF_prop_free(reg); goto fail; } slot = rslot; @@ -205,7 +205,7 @@ lebuffer_setup_dinfo(device_t dev, phand resource_list_add(&ldi->ldi_rl, SYS_RES_MEMORY, i, base, base + reg[i].sbr_size, reg[i].sbr_size); } - free(reg, M_OFWPROP); + OF_prop_free(reg); if (slot != sbus_get_slot(dev)) { device_printf(dev, "<%s>: parent and child slot do not match\n", ldi->ldi_obdinfo.obd_name); @@ -231,7 +231,7 @@ lebuffer_setup_dinfo(device_t dev, phand resource_list_add(&ldi->ldi_rl, SYS_RES_IRQ, i, iv, iv, 1); } - free(intr, M_OFWPROP); + OF_prop_free(intr); } return (ldi); Modified: head/sys/sparc64/central/central.c ============================================================================== --- head/sys/sparc64/central/central.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/central/central.c Wed May 18 23:39:31 2016 (r300173) @@ -165,7 +165,7 @@ central_attach(device_t dev) resource_list_add(&cdi->cdi_rl, SYS_RES_MEMORY, i, reg[i].sbr_offset, reg[i].sbr_offset + reg[i].sbr_size, reg[i].sbr_size); - free(reg, M_OFWPROP); + OF_prop_free(reg); cdev = device_add_child(dev, NULL, -1); if (cdev == NULL) { device_printf(dev, "<%s>: device_add_child failed\n", Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/ebus/ebus.c Wed May 18 23:39:31 2016 (r300173) @@ -376,7 +376,7 @@ ebus_pci_attach(device_t dev) } } free(sc->sc_rinfo, M_DEVBUF); - free(sc->sc_range, M_OFWPROP); + OF_prop_free(sc->sc_range); return (ENXIO); } @@ -670,7 +670,7 @@ ebus_setup_dinfo(device_t dev, struct eb (void)resource_list_add(&edi->edi_rl, SYS_RES_MEMORY, i, start, start + regs[i].size - 1, regs[i].size); } - free(regs, M_OFWPROP); + OF_prop_free(regs); nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), (void **)&intrs); @@ -701,7 +701,7 @@ ebus_setup_dinfo(device_t dev, struct eb (void)resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, rintr, rintr, 1); } - free(intrs, M_OFWPROP); + OF_prop_free(intrs); return (edi); } Modified: head/sys/sparc64/fhc/fhc.c ============================================================================== --- head/sys/sparc64/fhc/fhc.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/fhc/fhc.c Wed May 18 23:39:31 2016 (r300173) @@ -205,7 +205,7 @@ fhc_attach(device_t dev) device_printf(dev, "board %d, ", board); if (OF_getprop_alloc(node, "board-model", 1, (void **)&name) != -1) { printf("model %s\n", name); - free(name, M_OFWPROP); + OF_prop_free(name); } else printf("model unknown\n"); @@ -297,7 +297,7 @@ fhc_attach(device_t dev) resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, j, reg[j].sbr_offset, reg[j].sbr_offset + reg[j].sbr_size, reg[j].sbr_size); - free(reg, M_OFWPROP); + OF_prop_free(reg); if (central == 1) { i = OF_getprop_alloc(child, "interrupts", sizeof(*intr), (void **)&intr); @@ -307,7 +307,7 @@ fhc_attach(device_t dev) resource_list_add(&fdi->fdi_rl, SYS_RES_IRQ, j, iv, iv, 1); } - free(intr, M_OFWPROP); + OF_prop_free(intr); } } cdev = device_add_child(dev, NULL, -1); Modified: head/sys/sparc64/isa/isa.c ============================================================================== --- head/sys/sparc64/isa/isa.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/isa/isa.c Wed May 18 23:39:31 2016 (r300173) @@ -169,7 +169,7 @@ isa_setup_children(device_t dev, phandle */ if (strcmp(name, "8042") == 0) { isa_setup_children(dev, node); - free(name, M_OFWPROP); + OF_prop_free(name); continue; } @@ -179,7 +179,7 @@ isa_setup_children(device_t dev, phandle if (ofw_isa_pnp_map[i].name == NULL) { device_printf(dev, "no PnP map entry for node " "0x%lx: %s\n", (unsigned long)node, name); - free(name, M_OFWPROP); + OF_prop_free(name); continue; } @@ -230,10 +230,10 @@ isa_setup_children(device_t dev, phandle } } if (regidx != NULL) - free(regidx, M_OFWPROP); + OF_prop_free(regidx); } if (regs != NULL) - free(regs, M_OFWPROP); + OF_prop_free(regs); nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), (void **)&intrs); @@ -251,14 +251,14 @@ isa_setup_children(device_t dev, phandle bus_set_resource(cdev, SYS_RES_IRQ, i, rintr, 1); } if (intrs != NULL) - free(intrs, M_OFWPROP); + OF_prop_free(intrs); ndrq = OF_getprop_alloc(node, "dma-channel", sizeof(*drqs), (void **)&drqs); for (i = 0; i < ndrq; i++) bus_set_resource(cdev, SYS_RES_DRQ, i, drqs[i], 1); if (drqs != NULL) - free(drqs, M_OFWPROP); + OF_prop_free(drqs); /* * Devices using DMA hang off of the `dma' node instead of @@ -267,7 +267,7 @@ isa_setup_children(device_t dev, phandle if (strcmp(name, "dma") == 0) isa_setup_children(dev, node); - free(name, M_OFWPROP); + OF_prop_free(name); } } Modified: head/sys/sparc64/pci/ofw_pci.c ============================================================================== --- head/sys/sparc64/pci/ofw_pci.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/pci/ofw_pci.c Wed May 18 23:39:31 2016 (r300173) @@ -100,12 +100,12 @@ ofw_pci_attach_common(device_t dev, bus_ if (sc->sc_pci_bh[j] != 0) { device_printf(dev, "duplicate range for space %d\n", j); - free(range, M_OFWPROP); + OF_prop_free(range); return (EINVAL); } sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } - free(range, M_OFWPROP); + OF_prop_free(range); /* * Make sure that the expected ranges are actually present. Modified: head/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- head/sys/sparc64/sbus/dma_sbus.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/sbus/dma_sbus.c Wed May 18 23:39:31 2016 (r300173) @@ -216,7 +216,7 @@ dma_attach(device_t dev) csr &= ~E_TP_AUI; else csr |= E_TP_AUI; - free(cabletype, M_OFWPROP); + OF_prop_free(cabletype); } L64854_SCSR(lsc, csr); DELAY(20000); /* manual says we need a 20ms delay */ @@ -309,7 +309,7 @@ dma_setup_dinfo(device_t dev, struct dma if (slot != -1 && slot != rslot) { device_printf(dev, "<%s>: multiple slots\n", ddi->ddi_obdinfo.obd_name); - free(reg, M_OFWPROP); + OF_prop_free(reg); goto fail; } slot = rslot; @@ -317,7 +317,7 @@ dma_setup_dinfo(device_t dev, struct dma resource_list_add(&ddi->ddi_rl, SYS_RES_MEMORY, i, base, base + reg[i].sbr_size, reg[i].sbr_size); } - free(reg, M_OFWPROP); + OF_prop_free(reg); if (slot != dsc->sc_slot) { device_printf(dev, "<%s>: parent and child slot do not match\n", ddi->ddi_obdinfo.obd_name); @@ -343,7 +343,7 @@ dma_setup_dinfo(device_t dev, struct dma resource_list_add(&ddi->ddi_rl, SYS_RES_IRQ, i, iv, iv, 1); } - free(intr, M_OFWPROP); + OF_prop_free(intr); } return (ddi); Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/sbus/sbus.c Wed May 18 23:39:31 2016 (r300173) @@ -331,7 +331,7 @@ sbus_attach(device_t dev) sc->sc_rd[i].rd_pend = phys + size; sc->sc_rd[i].rd_res = res; } - free(range, M_OFWPROP); + OF_prop_free(range); /* * Get the SBus burst transfer size if burst transfers are supported. @@ -495,7 +495,7 @@ sbus_setup_dinfo(device_t dev, struct sb if (slot != -1 && slot != rslot) { device_printf(dev, "<%s>: multiple slots\n", sdi->sdi_obdinfo.obd_name); - free(reg, M_OFWPROP); + OF_prop_free(reg); goto fail; } slot = rslot; @@ -503,7 +503,7 @@ sbus_setup_dinfo(device_t dev, struct sb resource_list_add(&sdi->sdi_rl, SYS_RES_MEMORY, i, base, base + reg[i].sbr_size, reg[i].sbr_size); } - free(reg, M_OFWPROP); + OF_prop_free(reg); } sdi->sdi_slot = slot; @@ -525,7 +525,7 @@ sbus_setup_dinfo(device_t dev, struct sb resource_list_add(&sdi->sdi_rl, SYS_RES_IRQ, i, iv, iv, 1); } - free(intr, M_OFWPROP); + OF_prop_free(intr); } if (OF_getprop(node, "burst-sizes", &sdi->sdi_burstsz, sizeof(sdi->sdi_burstsz)) == -1) Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/sparc64/nexus.c Wed May 18 23:39:31 2016 (r300173) @@ -559,7 +559,7 @@ nexus_setup_dinfo(device_t dev, phandle_ resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, phys, phys + size - 1, size); } - free(reg, M_OFWPROP); + OF_prop_free(reg); nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); @@ -568,7 +568,7 @@ nexus_setup_dinfo(device_t dev, phandle_ "upa-portid" : "portid", &ign, sizeof(ign)) <= 0) { device_printf(dev, "<%s>: could not determine portid\n", ndi->ndi_obdinfo.obd_name); - free(intr, M_OFWPROP); + OF_prop_free(intr); goto fail; } @@ -579,7 +579,7 @@ nexus_setup_dinfo(device_t dev, phandle_ resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], intr[i], 1); } - free(intr, M_OFWPROP); + OF_prop_free(intr); } return (ndi); Modified: head/sys/sparc64/sparc64/upa.c ============================================================================== --- head/sys/sparc64/sparc64/upa.c Wed May 18 23:35:37 2016 (r300172) +++ head/sys/sparc64/sparc64/upa.c Wed May 18 23:39:31 2016 (r300173) @@ -560,7 +560,7 @@ upa_setup_dinfo(device_t dev, struct upa for (i = 0; i < nreg; i++) resource_list_add(&udi->udi_rl, SYS_RES_MEMORY, i, reg[i].phys, reg[i].phys + reg[i].size - 1, reg[i].size); - free(reg, M_OFWPROP); + OF_prop_free(reg); intr = INTMAP_VEC(sc->sc_ign, (UPA_INO_BASE + portid)); resource_list_add(&udi->udi_rl, SYS_RES_IRQ, 0, intr, intr, 1); From owner-svn-src-all@freebsd.org Wed May 18 23:41:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C91B2B41C9F; Wed, 18 May 2016 23:41:56 +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 98C311A35; Wed, 18 May 2016 23:41:56 +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 u4INft0r078404; Wed, 18 May 2016 23:41:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4INftgv078403; Wed, 18 May 2016 23:41:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605182341.u4INftgv078403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 18 May 2016 23:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300174 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:41:56 -0000 Author: cem Date: Wed May 18 23:41:55 2016 New Revision: 300174 URL: https://svnweb.freebsd.org/changeset/base/300174 Log: dhclient: Fix the trivial buffer overruns correctly A DHCP client identifier is simply the hardware type (one byte) concatenated with the hardware address (some variable number of bytes, but at most 16). Limit the size of the temporary buffer to match and the rest of the calculations shake out correctly. This is a follow-up to the incorrect r299512, reverted in r300172. CIDs: 1008682, 1305550 Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed May 18 23:39:31 2016 (r300173) +++ head/sbin/dhclient/dhclient.c Wed May 18 23:41:55 2016 (r300174) @@ -1570,7 +1570,7 @@ make_discover(struct interface_info *ip, } /* set unique client identifier */ - char client_ident[sizeof(struct hardware)]; + char client_ident[sizeof(ip->hw_address.haddr) + 1]; if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) { int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? ip->hw_address.hlen : sizeof(client_ident)-1; From owner-svn-src-all@freebsd.org Wed May 18 23:42:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC532B41CC5; Wed, 18 May 2016 23:42:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75ED11A5A; Wed, 18 May 2016 23:42:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4INfxSd078457; Wed, 18 May 2016 23:41:59 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4INfxl1078451; Wed, 18 May 2016 23:41:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605182341.u4INfxl1078451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 18 May 2016 23:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300175 - head/sys/arm/amlogic/aml8726 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:42:00 -0000 Author: gonzo Date: Wed May 18 23:41:58 2016 New Revision: 300175 URL: https://svnweb.freebsd.org/changeset/base/300175 Log: Use OF_prop_free instead of direct call to free(9) Reviewed by: ganbold Modified: head/sys/arm/amlogic/aml8726/aml8726_ccm.c head/sys/arm/amlogic/aml8726/aml8726_mmc.c head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Modified: head/sys/arm/amlogic/aml8726/aml8726_ccm.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_ccm.c Wed May 18 23:41:55 2016 (r300174) +++ head/sys/arm/amlogic/aml8726/aml8726_ccm.c Wed May 18 23:41:58 2016 (r300175) @@ -141,7 +141,7 @@ aml8726_ccm_configure_gates(struct aml87 AML_CCM_UNLOCK(sc); } - free(functions, M_OFWPROP); + OF_prop_free(functions); return (0); } Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mmc.c Wed May 18 23:41:55 2016 (r300174) +++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c Wed May 18 23:41:58 2016 (r300175) @@ -605,11 +605,11 @@ aml8726_mmc_attach(device_t dev) else { device_printf(dev, "unknown function attribute %.*s in FDT\n", len, function_name); - free(function_name, M_OFWPROP); + OF_prop_free(function_name); return (ENXIO); } - free(function_name, M_OFWPROP); + OF_prop_free(function_name); sc->pwr_en.dev = NULL; @@ -661,7 +661,7 @@ aml8726_mmc_attach(device_t dev) device_printf(dev, "unknown voltage attribute %.*s in FDT\n", len, voltage); - free(voltages, M_OFWPROP); + OF_prop_free(voltages); return (ENXIO); } @@ -678,7 +678,7 @@ aml8726_mmc_attach(device_t dev) } } - free(voltages, M_OFWPROP); + OF_prop_free(voltages); sc->vselect.dev = NULL; Modified: head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c Wed May 18 23:41:55 2016 (r300174) +++ head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c Wed May 18 23:41:58 2016 (r300175) @@ -210,11 +210,11 @@ aml8726_pinctrl_configure_pins(device_t if (f->name == NULL) { device_printf(dev, "unknown function attribute %.*s in FDT\n", len, function_name); - free(function_name, M_OFWPROP); + OF_prop_free(function_name); return (ENXIO); } - free(function_name, M_OFWPROP); + OF_prop_free(function_name); len = OF_getprop_alloc(node, "amlogic,pull", sizeof(char), (void **)&pull); @@ -234,12 +234,12 @@ aml8726_pinctrl_configure_pins(device_t device_printf(dev, "unknown pull attribute %.*s in FDT\n", len, pull); - free(pull, M_OFWPROP); + OF_prop_free(pull); return (ENXIO); } } - free(pull, M_OFWPROP); + OF_prop_free(pull); /* * Setting the pull direction isn't supported on all SoC. @@ -403,7 +403,7 @@ aml8726_pinctrl_configure_pins(device_t AML_PINCTRL_UNLOCK(sc); } - free(pins, M_OFWPROP); + OF_prop_free(pins); return (0); } Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Wed May 18 23:41:55 2016 (r300174) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Wed May 18 23:41:58 2016 (r300175) @@ -821,7 +821,7 @@ aml8726_sdxc_attach(device_t dev) device_printf(dev, "unknown voltage attribute %.*s in FDT\n", len, voltage); - free(voltages, M_OFWPROP); + OF_prop_free(voltages); return (ENXIO); } @@ -838,7 +838,7 @@ aml8726_sdxc_attach(device_t dev) } } - free(voltages, M_OFWPROP); + OF_prop_free(voltages); sc->vselect.dev = NULL; Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c Wed May 18 23:41:55 2016 (r300174) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c Wed May 18 23:41:58 2016 (r300175) @@ -139,7 +139,7 @@ aml8726_usb_phy_mode(const char *dwcotg_ AML_USB_PHY_MISC_ID_OVERIDE_DEVICE; } - free(usb_mode, M_OFWPROP); + OF_prop_free(usb_mode); return (0); } @@ -214,7 +214,7 @@ aml8726_usb_phy_attach(device_t dev) } } - free(prop, M_OFWPROP); + OF_prop_free(prop); if (err) { device_printf(dev, "unable to parse gpio\n"); Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Wed May 18 23:41:55 2016 (r300174) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Wed May 18 23:41:58 2016 (r300175) @@ -164,7 +164,7 @@ aml8726_usb_phy_attach(device_t dev) sc->force_aca = TRUE; } - free(force_aca, M_OFWPROP); + OF_prop_free(force_aca); err = 0; @@ -187,7 +187,7 @@ aml8726_usb_phy_attach(device_t dev) } } - free(prop, M_OFWPROP); + OF_prop_free(prop); len = OF_getencprop_alloc(node, "usb-hub-rst", 3 * sizeof(pcell_t), (void **)&prop); @@ -200,7 +200,7 @@ aml8726_usb_phy_attach(device_t dev) err = 1; } - free(prop, M_OFWPROP); + OF_prop_free(prop); if (err) { device_printf(dev, "unable to parse gpio\n"); From owner-svn-src-all@freebsd.org Wed May 18 23:43:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A179AB41E08; Wed, 18 May 2016 23:43:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6505C1FA2; Wed, 18 May 2016 23:43:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 289B23C526F; Thu, 19 May 2016 09:43:55 +1000 (AEST) Date: Thu, 19 May 2016 09:43:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd In-Reply-To: <1463609665.1180.301.camel@freebsd.org> Message-ID: <20160519092734.U1798@besplex.bde.org> References: <201605182202.u4IM2JF7047307@repo.freebsd.org> <1463609665.1180.301.camel@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.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=j5YYvsyAr7R3ibaSyqUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:43:57 -0000 On Wed, 18 May 2016, Ian Lepore wrote: > On Wed, 2016-05-18 at 22:02 +0000, Gleb Smirnoff wrote: >> Log: >> Revert r299830, it has couple of fatal errors. >> >> The CMSG_ family of macros take care of alignment, so we don't need >> r299830 >> at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile. The breaks detection of cast-align bugs elsewhere in the program. > So all of this was about a "cast increases required alignment" kind of > warning for a macro that takes care of alignment? Wouldn't the proper > fix then be to change CMSG_DATA() so that its internal cast is void* > instead of unsigned char* (he asked, knowing Bruce would come along > soon and point out why that's a dumb question)? I don't know much about CMSG*, so I wouldn't have if you didn't ask :-). Changing its type might expose bugs. Kernel code mostly casts it so would get the same cast-align error if that were enabled in the kernel. netinet6 passes it to a function without an explicit cast. The function does an implicit conversion to a struct pointer and there should be a different warning for that. char * and u_char * are required to be binary compatible with void *, but it is bad style to depend on that. So void * works better in all cases in the kernel. LINUX_CMSG_DATA() already returns void *. Bruce From owner-svn-src-all@freebsd.org Wed May 18 23:58:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220B7B41265 for ; Wed, 18 May 2016 23:58:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0208170E for ; Wed, 18 May 2016 23:58:12 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 41e29c99-1d54-11e6-896e-fd5016d7ee1b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 18 May 2016 23:57:19 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4INwAo0053900; Wed, 18 May 2016 17:58:10 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463615890.1180.306.camel@freebsd.org> Subject: Re: svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd From: Ian Lepore To: Bruce Evans Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 18 May 2016 17:58:10 -0600 In-Reply-To: <20160519092734.U1798@besplex.bde.org> References: <201605182202.u4IM2JF7047307@repo.freebsd.org> <1463609665.1180.301.camel@freebsd.org> <20160519092734.U1798@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:58:13 -0000 On Thu, 2016-05-19 at 09:43 +1000, Bruce Evans wrote: > On Wed, 18 May 2016, Ian Lepore wrote: > > > On Wed, 2016-05-18 at 22:02 +0000, Gleb Smirnoff wrote: > >> Log: > >> Revert r299830, it has couple of fatal errors. > >> > >> The CMSG_ family of macros take care of alignment, so we don't > need > >> r299830 > >> at all, even if it was correct. Put NO_WCAST_ALIGN into > Makefile. > > The breaks detection of cast-align bugs elsewhere in the program. > > > So all of this was about a "cast increases required alignment" kind > of > > warning for a macro that takes care of alignment? Wouldn't the > proper > > fix then be to change CMSG_DATA() so that its internal cast is > void* > > instead of unsigned char* (he asked, knowing Bruce would come along > > soon and point out why that's a dumb question)? > > I don't know much about CMSG*, so I wouldn't have if you didn't ask : > -). > > Changing its type might expose bugs. Kernel code mostly casts it so > would get the same cast-align error if that were enabled in the > kernel. > netinet6 passes it to a function without an explicit cast. The > function > does an implicit conversion to a struct pointer and there should be a > different warning for that. char * and u_char * are required to be > binary compatible with void *, but it is bad style to depend on that. > > So void * works better in all cases in the kernel. > > LINUX_CMSG_DATA() already returns void *. > > Bruce > For some reason I had assumed a (void*) cast would wish away the warning about increasing alignment (without losing that warning at other places in that code). Now I can't say for sure why I thought that would be so, but it does seem to me I've fixed warnings like that by casting through void* as an intermediate type. But maybe that was a different situation/different warning. -- Ian From owner-svn-src-all@freebsd.org Wed May 18 23:58:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68116B412A7; Wed, 18 May 2016 23:58:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 526901895; Wed, 18 May 2016 23:58:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4INwUHT047683 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 18 May 2016 16:58:31 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4INwUWE047682; Wed, 18 May 2016 16:58:30 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 May 2016 16:58:30 -0700 From: Gleb Smirnoff To: Matthew Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys Message-ID: <20160518235830.GQ1015@FreeBSD.org> References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605180435.u4I4ZwYh025096@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:58:32 -0000 Hi! On Wed, May 18, 2016 at 04:35:58AM +0000, Scott Long wrote: S> ============================================================================== S> --- head/sys/net/if.c Wed May 18 04:04:14 2016 (r300112) S> +++ head/sys/net/if.c Wed May 18 04:35:58 2016 (r300113) S> @@ -3900,6 +3900,19 @@ if_multiaddr_count(if_t ifp, int max) S> return (count); S> } S> S> +int S> +if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg) S> +{ S> + struct ifmultiaddr *ifma; S> + int cnt = 0; S> + S> + if_maddr_rlock(ifp); S> + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) S> + cnt += filter(arg, ifma, cnt); S> + if_maddr_runlock(ifp); S> + return (cnt); S> +} S> + S> struct mbuf * S> if_dequeue(if_t ifp) S> { In my projects/ifnet a similar functions exist: /* * Traversing through interface address lists. */ typedef void ifaddr_cb_t(void *, struct sockaddr *, struct sockaddr *, struct sockaddr *); typedef void ifmaddr_cb_t(void *, struct sockaddr *); void if_foreach_addr(if_t, ifaddr_cb_t, void *); void if_foreach_maddr(if_t, ifmaddr_cb_t, void *); /* * Methods for drivers to access interface unicast and multicast * addresses. Driver do not know 'struct ifaddr' neither 'struct ifmultiaddr'. */ void if_foreach_addr(if_t ifp, ifaddr_cb_t cb, void *cb_arg) { struct ifaddr *ifa; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) (*cb)(cb_arg, ifa->ifa_addr, ifa->ifa_dstaddr, ifa->ifa_netmask); IF_ADDR_RUNLOCK(ifp); } void if_foreach_maddr(if_t ifp, ifmaddr_cb_t cb, void *cb_arg) { struct ifmultiaddr *ifma; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) (*cb)(cb_arg, ifma->ifma_addr); IF_ADDR_RUNLOCK(ifp); } Do you mind if I adopt head to them instead of if_multi_apply()? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu May 19 00:00:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8A55B41347; Thu, 19 May 2016 00:00:40 +0000 (UTC) (envelope-from torek@elf.torek.net) Received: from elf.torek.net (mail.torek.net [96.90.199.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD59F1A77; Thu, 19 May 2016 00:00:40 +0000 (UTC) (envelope-from torek@elf.torek.net) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.14.9/8.14.9) with ESMTP id u4INxZ4h022591; Wed, 18 May 2016 16:59:35 -0700 (PDT) (envelope-from torek@elf.torek.net) Received: (from torek@localhost) by elf.torek.net (8.14.9/8.14.9/Submit) id u4INxZUk022590; Wed, 18 May 2016 16:59:35 -0700 (PDT) (envelope-from torek) Date: Wed, 18 May 2016 16:59:35 -0700 (PDT) From: Chris Torek Message-Id: <201605182359.u4INxZUk022590@elf.torek.net> To: brde@optusnet.com.au, ian@freebsd.org Subject: Re: svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd Cc: glebius@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20160519092734.U1798@besplex.bde.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (elf.torek.net [127.0.0.1]); Wed, 18 May 2016 16:59:35 -0700 (PDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 00:00:41 -0000 >I don't know much about CMSG*, so I wouldn't have if you didn't ask :-). One thing to know about the CMSG (control message) stuff is that it is badly broken, at least on I32LP64 systems. Not the CMSG_* aligning macros themselves (the alignment is linked to stuff I did back in the early sparc-port days, around 1992 or so), but internally, when file descriptor rights are internalized before sending. This converts them from 32 bit "int"s to 64 bit pointers, which winds up breaking other code. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=181741 (I attached a revised set of patches that apply to current kernels, adding a rewrite of the transform code for sanity / readability.) >... So void * works better in all cases in the kernel. If someone wanted to change CMSG_DATA, CMSG_FIRSTHDR, and CMSG_NEXTHDR to produce "void *", I'd vote in favor of that. :-) Chris From owner-svn-src-all@freebsd.org Thu May 19 00:04:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 569C2B41541; Thu, 19 May 2016 00:04:59 +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 1C5891EA6; Thu, 19 May 2016 00:04:59 +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 u4J04wiu084561; Thu, 19 May 2016 00:04:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J04wMU084560; Thu, 19 May 2016 00:04:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201605190004.u4J04wMU084560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 19 May 2016 00:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300176 - head/sys/dev/tsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 00:04:59 -0000 Author: jhibbits Date: Thu May 19 00:04:58 2016 New Revision: 300176 URL: https://svnweb.freebsd.org/changeset/base/300176 Log: Add an alternate compatible string for eTSEC devices. Newer device trees now use fsl,etsec2 to denote eTSEC nodes. Same device, new name. Modified: head/sys/dev/tsec/if_tsec_fdt.c Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Wed May 18 23:41:58 2016 (r300175) +++ head/sys/dev/tsec/if_tsec_fdt.c Thu May 19 00:04:58 2016 (r300176) @@ -115,7 +115,8 @@ tsec_fdt_probe(device_t dev) strcmp(ofw_bus_get_type(dev), "network") != 0) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "gianfar")) + if (!ofw_bus_is_compatible(dev, "gianfar") && + !ofw_bus_is_compatible(dev, "fsl,etsec2")) return (ENXIO); sc = device_get_softc(dev); From owner-svn-src-all@freebsd.org Thu May 19 00:16:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C83F2B41729; Thu, 19 May 2016 00:16:22 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::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 8573113BE; Thu, 19 May 2016 00:16:22 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-io0-x241.google.com with SMTP id d62so12376860iof.1; Wed, 18 May 2016 17:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=YtNO4PdRWbXdBOQwwaAJlteZ1x/YsA8q+za7AllZptw=; b=v1D/Yp7T+nS9SK2qWdi9YUurvASF5DRDU6bq5IPz+D5c7sL4/PJoufPfJUiW2TDzv8 TPO03/7rGdUTenGuftzYwtoa5nXCOlKmjMgENMgJpfIG4t0EFS/TOeNo5wJrUW6lJ0ug rT+tEp3oisfvO4FdDIiTs+ZlC5HZ7VrrLgh38tooQnGPoB25hJZ+UAWpRmtYVa1PX0Ks sMiz15R/IspEMQLJrgp5sdGpSwB/68rDVn+1kmDmt5j5yWgg5D+wx5F2eY37gFwkcAKi Q3CcqCr87UQ8AuJ9AKgvzssspaDdwTLTTbTkx608bP5gaelPdxM5D46GGmCC1r6w7923 mr8g== 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:date :message-id:subject:from:to:cc; bh=YtNO4PdRWbXdBOQwwaAJlteZ1x/YsA8q+za7AllZptw=; b=hvt6hIgr2Q3LkZtPsjuoJMfVMeRrsFbQAxJlVNNcVaZP/Iw+DHABRhgeN8C33bs9n3 jd+wtrvHDJ/TTjTcfp1PkdLbv8qx9aQGEy81zwlKx/g55RnCtyog3zm26GgrLzF+22/9 iewBUybKtm46LOlfGhackZ05Ww1lytYijhdEqbJz1/zQkoUS6ySzY8FmgpKFwsAlSFec 6kf6C5is0oBE9JKifY89oQ71ViLPtEPRat4vrPnZIWOoXzQ/7w8w1YV5fkb0vmXbkPXi a4TLUycol7PWeePlvNKVCcaNU50Ty0V8r9z6shtPF4KuwvG3GCBg8CRlQO7OFLQutuBU ysKA== X-Gm-Message-State: AOPr4FVhdQoxgvUkrJq7q/0uMN7n/JytHbSIvxRBx5hTNOxpMWrt3cKXJr9YxoNDJgYyNDhzQgYK6dopAgR8qg== MIME-Version: 1.0 X-Received: by 10.107.37.16 with SMTP id l16mr6936220iol.138.1463616981715; Wed, 18 May 2016 17:16:21 -0700 (PDT) Sender: kmacybsd@gmail.com Received: by 10.107.140.8 with HTTP; Wed, 18 May 2016 17:16:21 -0700 (PDT) In-Reply-To: <20160518235830.GQ1015@FreeBSD.org> References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> <20160518235830.GQ1015@FreeBSD.org> Date: Wed, 18 May 2016 17:16:21 -0700 X-Google-Sender-Auth: w26K9zV8iVVaYKZCl85r_daWJg0 Message-ID: Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys From: "K. Macy" To: Gleb Smirnoff 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 00:16:22 -0000 Those are new. Please just patch iflib to use them and let's move on. -M On Wed, May 18, 2016 at 4:58 PM, Gleb Smirnoff wrote: > Hi! > > On Wed, May 18, 2016 at 04:35:58AM +0000, Scott Long wrote: > S> ============================================================================== > S> --- head/sys/net/if.c Wed May 18 04:04:14 2016 (r300112) > S> +++ head/sys/net/if.c Wed May 18 04:35:58 2016 (r300113) > S> @@ -3900,6 +3900,19 @@ if_multiaddr_count(if_t ifp, int max) > S> return (count); > S> } > S> > S> +int > S> +if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg) > S> +{ > S> + struct ifmultiaddr *ifma; > S> + int cnt = 0; > S> + > S> + if_maddr_rlock(ifp); > S> + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) > S> + cnt += filter(arg, ifma, cnt); > S> + if_maddr_runlock(ifp); > S> + return (cnt); > S> +} > S> + > S> struct mbuf * > S> if_dequeue(if_t ifp) > S> { > > In my projects/ifnet a similar functions exist: > > /* > * Traversing through interface address lists. > */ > typedef void ifaddr_cb_t(void *, struct sockaddr *, struct sockaddr *, > struct sockaddr *); > typedef void ifmaddr_cb_t(void *, struct sockaddr *); > void if_foreach_addr(if_t, ifaddr_cb_t, void *); > void if_foreach_maddr(if_t, ifmaddr_cb_t, void *); > > /* > * Methods for drivers to access interface unicast and multicast > * addresses. Driver do not know 'struct ifaddr' neither 'struct ifmultiaddr'. > */ > void > if_foreach_addr(if_t ifp, ifaddr_cb_t cb, void *cb_arg) > { > struct ifaddr *ifa; > > IF_ADDR_RLOCK(ifp); > TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) > (*cb)(cb_arg, ifa->ifa_addr, ifa->ifa_dstaddr, > ifa->ifa_netmask); > IF_ADDR_RUNLOCK(ifp); > } > > void > if_foreach_maddr(if_t ifp, ifmaddr_cb_t cb, void *cb_arg) > { > struct ifmultiaddr *ifma; > > IF_ADDR_RLOCK(ifp); > TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) > (*cb)(cb_arg, ifma->ifma_addr); > IF_ADDR_RUNLOCK(ifp); > } > > Do you mind if I adopt head to them instead of if_multi_apply()? > > -- > Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu May 19 00:26:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 832C9B41A02; Thu, 19 May 2016 00:26:22 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 63E4C1B9A; Thu, 19 May 2016 00:26:22 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4J0QCD2080759; Wed, 18 May 2016 17:26:16 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605190026.u4J0QCD2080759@gw.catspoiler.org> Date: Wed, 18 May 2016 17:26:12 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300174 - head/sbin/dhclient To: cem@FreeBSD.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605182341.u4INftgv078403@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 00:26:22 -0000 On 18 May, Conrad E. Meyer wrote: > Author: cem > Date: Wed May 18 23:41:55 2016 > New Revision: 300174 > URL: https://svnweb.freebsd.org/changeset/base/300174 > > Log: > dhclient: Fix the trivial buffer overruns correctly > > A DHCP client identifier is simply the hardware type (one byte) concatenated > with the hardware address (some variable number of bytes, but at most 16). > Limit the size of the temporary buffer to match and the rest of the > calculations shake out correctly. > > This is a follow-up to the incorrect r299512, reverted in r300172. > > CIDs: 1008682, 1305550 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sbin/dhclient/dhclient.c > > Modified: head/sbin/dhclient/dhclient.c > ============================================================================== > --- head/sbin/dhclient/dhclient.c Wed May 18 23:39:31 2016 (r300173) > +++ head/sbin/dhclient/dhclient.c Wed May 18 23:41:55 2016 (r300174) > @@ -1570,7 +1570,7 @@ make_discover(struct interface_info *ip, > } > > /* set unique client identifier */ > - char client_ident[sizeof(struct hardware)]; > + char client_ident[sizeof(ip->hw_address.haddr) + 1]; > if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) { > int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? > ip->hw_address.hlen : sizeof(client_ident)-1; > That might work as well. From owner-svn-src-all@freebsd.org Thu May 19 02:06:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0277B3FFB3; Thu, 19 May 2016 02:06:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A85613A3; Thu, 19 May 2016 02:06:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4J26med020756; Thu, 19 May 2016 02:06:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J26mux020755; Thu, 19 May 2016 02:06:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605190206.u4J26mux020755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 19 May 2016 02:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300177 - head/contrib/ipfilter/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 02:06:49 -0000 Author: cy Date: Thu May 19 02:06:48 2016 New Revision: 300177 URL: https://svnweb.freebsd.org/changeset/base/300177 Log: Fix typo. Reported by: Ruben Kerkhof MFC after: 6 days Modified: head/contrib/ipfilter/man/ipf.5 Modified: head/contrib/ipfilter/man/ipf.5 ============================================================================== --- head/contrib/ipfilter/man/ipf.5 Thu May 19 00:04:58 2016 (r300176) +++ head/contrib/ipfilter/man/ipf.5 Thu May 19 02:06:48 2016 (r300177) @@ -881,7 +881,7 @@ through without needing to explicitly al An example of how this is done is as follows: .PP .nf -pass in proto udp from any prot = 2049 to any with frags keep fags +pass in proto udp from any port = 2049 to any with frags keep fags .fi .SH Building a tree of rules .PP From owner-svn-src-all@freebsd.org Thu May 19 02:34:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87F7EB40537; Thu, 19 May 2016 02:34:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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 597541FED; Thu, 19 May 2016 02:34:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id 190so89965427iow.1; Wed, 18 May 2016 19:34:53 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=SKgMdQSJTsLeYU7HY5ZBML3/vsh1WdNCe1Gjl/OwxM0=; b=dDE7Un72pIFL68ULXVUnTAddJOq6LHzwINDu9RWuCWF/hE6n9N/lunY7N7uzdJSZO+ 92HJtRkSDxft9jjoM7Ef8GlDQCDT4CK+Ep4VeMe0nM3sI3lBML+l5lFlGBy6nGhUz1rt h1J3VqhVO4hZ+d1PpFsRZ/+lnRTO1joOn4uSCIwV2W2xcGbnuqbHqD/END77mSocqTp3 cIs+ezKTLvyTvJY8PsPkelWQ8+oR8z7gvZn+0RhOf5ePHLDvRqlslz8oLcW9vPs8AHIg gnPeu4kTXvlJSIfCKomW7gMl5OX7evmcjgqJ2RyrcWTzrfJT5UAHQI1iZk4cqDALTyY0 LUXQ== X-Gm-Message-State: AOPr4FUZMR+VEnd7EoPV1OuOo1rEEhlGFhcD5AXZ7xgh5eVai381jWG79DH6gokCMVQkUA== X-Received: by 10.107.8.19 with SMTP id 19mr8109094ioi.60.1463623826098; Wed, 18 May 2016 19:10:26 -0700 (PDT) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com. [209.85.223.180]) by smtp.gmail.com with ESMTPSA id l7sm3678550ita.13.2016.05.18.19.10.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2016 19:10:26 -0700 (PDT) Received: by mail-io0-f180.google.com with SMTP id f89so89478448ioi.0; Wed, 18 May 2016 19:10:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.36.81.209 with SMTP id s200mr839887ita.34.1463623825546; Wed, 18 May 2016 19:10:25 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Wed, 18 May 2016 19:10:25 -0700 (PDT) In-Reply-To: <201605190206.u4J26mux020755@repo.freebsd.org> References: <201605190206.u4J26mux020755@repo.freebsd.org> Date: Wed, 18 May 2016 19:10:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300177 - head/contrib/ipfilter/man From: Conrad Meyer To: Cy Schubert 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 02:34:53 -0000 On Wed, May 18, 2016 at 7:06 PM, Cy Schubert wrote: > Author: cy > Date: Thu May 19 02:06:48 2016 > New Revision: 300177 > URL: https://svnweb.freebsd.org/changeset/base/300177 > > Log: > Fix typo. > > Modified: head/contrib/ipfilter/man/ipf.5 > ============================================================================== > -pass in proto udp from any prot = 2049 to any with frags keep fags > +pass in proto udp from any port = 2049 to any with frags keep fags ^^^^ Is that not a typo? Conrad From owner-svn-src-all@freebsd.org Thu May 19 02:58:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 079AFB40A06; Thu, 19 May 2016 02:58:32 +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 CC6A21937; Thu, 19 May 2016 02:58:31 +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 u4J2wVqu036096; Thu, 19 May 2016 02:58:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J2wV91036095; Thu, 19 May 2016 02:58:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605190258.u4J2wV91036095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 19 May 2016 02:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300178 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 02:58:32 -0000 Author: imp Date: Thu May 19 02:58:30 2016 New Revision: 300178 URL: https://svnweb.freebsd.org/changeset/base/300178 Log: Turns out, mipsn32el worked at one point, so add it back in. Pointed out by: jmallet@ Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 19 02:06:48 2016 (r300177) +++ head/Makefile.inc1 Thu May 19 02:58:30 2016 (r300178) @@ -224,6 +224,7 @@ KNOWN_ARCHES?= aarch64/arm64 \ mips \ mipsel/mips \ mips64el/mips \ + mipsn32el/mips \ mips64/mips \ mipsn32/mips \ powerpc \ From owner-svn-src-all@freebsd.org Thu May 19 03:18:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A59F0B3F063; Thu, 19 May 2016 03:18:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FEC3186D; Thu, 19 May 2016 03:18:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4J3IsaF042548; Thu, 19 May 2016 03:18:54 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J3Is5G042547; Thu, 19 May 2016 03:18:54 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605190318.u4J3Is5G042547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 19 May 2016 03:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300179 - head/contrib/ipfilter/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 03:18:55 -0000 Author: cy Date: Thu May 19 03:18:54 2016 New Revision: 300179 URL: https://svnweb.freebsd.org/changeset/base/300179 Log: Fix another typo. Reported by: cem MFC after: 6 days Modified: head/contrib/ipfilter/man/ipf.5 Modified: head/contrib/ipfilter/man/ipf.5 ============================================================================== --- head/contrib/ipfilter/man/ipf.5 Thu May 19 02:58:30 2016 (r300178) +++ head/contrib/ipfilter/man/ipf.5 Thu May 19 03:18:54 2016 (r300179) @@ -881,7 +881,7 @@ through without needing to explicitly al An example of how this is done is as follows: .PP .nf -pass in proto udp from any port = 2049 to any with frags keep fags +pass in proto udp from any port = 2049 to any with frags keep frags .fi .SH Building a tree of rules .PP From owner-svn-src-all@freebsd.org Thu May 19 03:20:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79424B3F0CB; Thu, 19 May 2016 03:20:26 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 19B741A35; Thu, 19 May 2016 03:20:25 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 3EVUbHAAuUnqM3EVWb3ReC; Wed, 18 May 2016 21:20:19 -0600 X-Authority-Analysis: v=2.2 cv=bJxUG72Z c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=yrkiwgmsf1kA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=uFF2PuOINblVBYPNI40A:9 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id B529713751; Wed, 18 May 2016 20:20:16 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u4J3KGqE003749; Wed, 18 May 2016 20:20:16 -0700 (PDT) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201605190320.u4J3KGqE003749@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.komquats.com/ To: cem@FreeBSD.org cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300177 - head/contrib/ipfilter/man In-Reply-To: Message from Conrad Meyer of "Wed, 18 May 2016 19:10:25 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 May 2016 20:20:16 -0700 X-CMAE-Envelope: MS4wfM2jTnrexKWSt7CutbTLBxF5J4x7YuiT63Cpk7rSKsPsY6dVzqQUkEC7V5cC7jZ76L9YkSTs5eIsB01wEjNuxZVZMmGaReWPuEFgg60c9KAQYbBSngpi EKhaL2rDgvJhew2zlDUqLR5oa75hXEfMfNb9L5wt3dPLVZi6d3lOiDCEeudpBOIyYB6OLE9PNc/zpvTJOBiFLU3GDL1pS3L+0hOEvAfJ3gHB07d3/BSFVI7s Qfsr+ZX9hGDTPo6hwPtDmIdmOUTW/KPJGTjyAXTuZvmfCyL4h0bzFHk/jEJNDFRl2P+oAc0CmXbtYGYnrH+bQw== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 03:20:26 -0000 In message , Conrad Meyer writes: > On Wed, May 18, 2016 at 7:06 PM, Cy Schubert wrote: > > Author: cy > > Date: Thu May 19 02:06:48 2016 > > New Revision: 300177 > > URL: https://svnweb.freebsd.org/changeset/base/300177 > > > > Log: > > Fix typo. > > > > Modified: head/contrib/ipfilter/man/ipf.5 > > =========================================================================== > === > > -pass in proto udp from any prot = 2049 to any with frags keep fags > > +pass in proto udp from any port = 2049 to any with frags keep fags > ^^^^ > Is that not a typo? That too. Fixed. Thanks for noticing. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu May 19 03:56:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC7DB3FBA4; Thu, 19 May 2016 03:56:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2863F1EBA; Thu, 19 May 2016 03:56:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4J3u77h056716; Thu, 19 May 2016 03:56:07 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J3u7Tc056715; Thu, 19 May 2016 03:56:07 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605190356.u4J3u7Tc056715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 19 May 2016 03:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300180 - head/etc/ntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 03:56:08 -0000 Author: cy Date: Thu May 19 03:56:07 2016 New Revision: 300180 URL: https://svnweb.freebsd.org/changeset/base/300180 Log: Update leap-seconds to leap-seconds.3661459200. NO leap second will be introduced at the end of June 2016. This commit reapplies the r298887 minor spelling fix. Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/. See also: http://www.iers.org/SharedDocs/News/EN/BulletinC.html MFC after: 2 weeks Modified: head/etc/ntp/leap-seconds Modified: head/etc/ntp/leap-seconds ============================================================================== --- head/etc/ntp/leap-seconds Thu May 19 03:18:54 2016 (r300179) +++ head/etc/ntp/leap-seconds Thu May 19 03:56:07 2016 (r300180) @@ -130,7 +130,7 @@ # Washington, DC # jeffrey.prillaman@usno.navy.mil # -# Last Update of leap second values: 31 Dec 2015 +# Last Update of leap second values: 11 Jan 2016 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -138,7 +138,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3660508800 +#$ 3661459200 # # The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line @@ -170,10 +170,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 50 -# File expires on: 1 Jun 2016 +# Updated through IERS Bulletin C 51 +# File expires on: 1 Dec 2016 # -#@ 3673728000 +#@ 3689539200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -217,5 +217,5 @@ # the hash line is also ignored in the # computation. # -#h 44a44c49 35b22601 a9c7054c 8c56cf57 9b6f6ed5 +#h 63b4df04 0907d94f 2dadb7a1 684f7767 2a372421 # From owner-svn-src-all@freebsd.org Thu May 19 04:01:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3C0DB3FCAB; Thu, 19 May 2016 04:01: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 82D47120A; Thu, 19 May 2016 04:01: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 u4J41XtV056954; Thu, 19 May 2016 04:01:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J41Xeq056953; Thu, 19 May 2016 04:01:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190401.u4J41Xeq056953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300181 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:01:34 -0000 Author: adrian Date: Thu May 19 04:01:33 2016 New Revision: 300181 URL: https://svnweb.freebsd.org/changeset/base/300181 Log: [siba] add DMA debugging section, for changes later on to DMA addressing. Modified: head/sys/dev/siba/siba_core.c Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 19 03:56:07 2016 (r300180) +++ head/sys/dev/siba/siba_core.c Thu May 19 04:01:33 2016 (r300181) @@ -69,6 +69,7 @@ enum { SIBA_DEBUG_SWITCHCORE = 0x00000008, /* switching core */ SIBA_DEBUG_SPROM = 0x00000010, /* SPROM */ SIBA_DEBUG_CORE = 0x00000020, /* handling cores */ + SIBA_DEBUG_DMA = 0x00000040, /* DMA bits */ SIBA_DEBUG_ANY = 0xffffffff }; From owner-svn-src-all@freebsd.org Thu May 19 04:02:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A00EB3FE32; Thu, 19 May 2016 04:02:14 +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 379D513D6; Thu, 19 May 2016 04:02:14 +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 u4J42DRC057749; Thu, 19 May 2016 04:02:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J42DoH057748; Thu, 19 May 2016 04:02:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190402.u4J42DoH057748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300182 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:02:14 -0000 Author: adrian Date: Thu May 19 04:02:13 2016 New Revision: 300182 URL: https://svnweb.freebsd.org/changeset/base/300182 Log: [siba] fix up some comments and debug output. Modified: head/sys/dev/siba/siba_core.c Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 19 04:01:33 2016 (r300181) +++ head/sys/dev/siba/siba_core.c Thu May 19 04:02:13 2016 (r300182) @@ -335,7 +335,7 @@ siba_scan(struct siba_softc *siba) sd->sd_coreidx = i; DPRINTF(siba, SIBA_DEBUG_SCAN, - "core %d (%s) found (cc %#xrev %#x vendor %#x)\n", + "core %d (%s) found (cc %#x rev %#x vendor %#x)\n", i, siba_core_name(sd->sd_id.sd_device), sd->sd_id.sd_device, sd->sd_id.sd_rev, sd->sd_id.sd_vendor); @@ -430,6 +430,7 @@ siba_pci_switchcore_sub(struct siba_soft return (0); DELAY(10); } + DPRINTF(siba, SIBA_DEBUG_SWITCHCORE, "%s: idx %d, failed\n", __func__, idx); return (ENODEV); #undef RETRY_MAX } @@ -2184,6 +2185,8 @@ siba_dma_translation(device_t dev) KASSERT(siba->siba_type == SIBA_TYPE_PCI, ("unsupported bustype %d\n", siba->siba_type)); #endif + + /* Default */ return (SIBA_PCI_DMA); } From owner-svn-src-all@freebsd.org Thu May 19 04:03:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE3FB3FEEA; Thu, 19 May 2016 04:03: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 CE80F170F; Thu, 19 May 2016 04:03: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 u4J43fOm059798; Thu, 19 May 2016 04:03:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J43fP7059797; Thu, 19 May 2016 04:03:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190403.u4J43fP7059797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300183 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:03:43 -0000 Author: adrian Date: Thu May 19 04:03:41 2016 New Revision: 300183 URL: https://svnweb.freebsd.org/changeset/base/300183 Log: [siba] handle the PMU resource setup/init for 0x4322 series chips. Tested (with other changes): * BCM4322 11abgn device, chip id 0x4322. Modified: head/sys/dev/siba/siba_core.c Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 19 04:02:13 2016 (r300182) +++ head/sys/dev/siba/siba_core.c Thu May 19 04:03:41 2016 (r300183) @@ -945,6 +945,17 @@ siba_cc_pmu_init(struct siba_cc *scc) siba_cc_pmu1_pll0_init(scc, 0 /* use default */); /* use the default: min = 0xcbb max = 0x7ffff */ break; + case 0x4322: + if (scc->scc_pmu.rev == 2) { + DPRINTF(siba, SIBA_DEBUG_PMU, "%s: chipid 0x4322; PLLing\n", + __func__); + SIBA_CC_WRITE32(scc, SIBA_CC_PLLCTL_ADDR, 0x0000000a); + SIBA_CC_WRITE32(scc, SIBA_CC_PLLCTL_DATA, 0x380005c0); + } + /* use the default: min = 0xcbb max = 0x7ffff */ + break; + case 43222: + break; case 0x4325: siba_cc_pmu1_pll0_init(scc, 0 /* use default */); From owner-svn-src-all@freebsd.org Thu May 19 04:11:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD082B41107; Thu, 19 May 2016 04:11:01 +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 65B0419A9; Thu, 19 May 2016 04:11:01 +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 u4J4B08d062238; Thu, 19 May 2016 04:11:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4B08u062237; Thu, 19 May 2016 04:11:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190411.u4J4B08u062237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300184 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:11:01 -0000 Author: adrian Date: Thu May 19 04:11:00 2016 New Revision: 300184 URL: https://svnweb.freebsd.org/changeset/base/300184 Log: [siba] implement PMU behaviour for chips with a separate PMU module. * PMU controls the clock setup * Correctly set idle low power handling * Use a hard-coded powerup delay for some of the newer hardware (including the BCM4322, which I've tested with.) Tested: * BCM4322, 2G + 5G STA mode Obtained from: Linux b43 (PMU behaviour) Modified: head/sys/dev/siba/siba_core.c Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 19 04:03:41 2016 (r300183) +++ head/sys/dev/siba/siba_core.c Thu May 19 04:11:00 2016 (r300184) @@ -774,6 +774,13 @@ siba_cc_clock(struct siba_cc *scc, enum if (sd == NULL) return; siba = sd->sd_bus; + + /* + * PMU controls clockmode; separate function is needed + */ + if (scc->scc_caps & SIBA_CC_CAPS_PMU) + return; + /* * chipcommon < r6 (no dynamic clock control) * chipcommon >= r10 (unknown) @@ -930,6 +937,7 @@ siba_cc_pmu_init(struct siba_cc *scc) DPRINTF(siba, SIBA_DEBUG_PMU, "PMU(r%u) found (caps %#x)\n", scc->scc_pmu.rev, pmucap); +#if 0 if (scc->scc_pmu.rev >= 1) { if (siba->siba_chiprev < 2 && siba->siba_chipid == 0x4325) SIBA_CC_MASK32(scc, SIBA_CC_PMUCTL, @@ -938,6 +946,12 @@ siba_cc_pmu_init(struct siba_cc *scc) SIBA_CC_SET32(scc, SIBA_CC_PMUCTL, SIBA_CC_PMUCTL_NOILP); } +#endif + if (scc->scc_pmu.rev == 1) { + SIBA_CC_MASK32(scc, SIBA_CC_PMUCTL, ~SIBA_CC_PMUCTL_NOILP); + } else { + SIBA_CC_SET32(scc, SIBA_CC_PMUCTL, SIBA_CC_PMUCTL_NOILP); + } /* initialize PLL & PMU resources */ switch (siba->siba_chipid) { @@ -1070,8 +1084,22 @@ siba_cc_powerup_delay(struct siba_cc *sc struct siba_softc *siba = scc->scc_dev->sd_bus; int min; - if (siba->siba_type != SIBA_TYPE_PCI || - !(scc->scc_caps & SIBA_CC_CAPS_PWCTL)) + if (siba->siba_type != SIBA_TYPE_PCI) + return; + + if (scc->scc_caps & SIBA_CC_CAPS_PMU) { + if ((siba->siba_chipid == 0x4312) || + (siba->siba_chipid == 0x4322) || + (siba->siba_chipid == 0x4328)) { + scc->scc_powerup_delay = 7000; + } else { + /* 0x4325 is marked as TODO */ + scc->scc_powerup_delay = 15000; + } + return; + } + + if (!(scc->scc_caps & SIBA_CC_CAPS_PWCTL)) return; min = siba_cc_clockfreq(scc, 0); From owner-svn-src-all@freebsd.org Thu May 19 04:11:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41367B411EB; Thu, 19 May 2016 04:11:51 +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 F2A7E1CED; Thu, 19 May 2016 04:11:50 +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 u4J4Bo5o062930; Thu, 19 May 2016 04:11:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4BoDE062928; Thu, 19 May 2016 04:11:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190411.u4J4BoDE062928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300185 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:11:51 -0000 Author: adrian Date: Thu May 19 04:11:49 2016 New Revision: 300185 URL: https://svnweb.freebsd.org/changeset/base/300185 Log: [siba] use consistent naming. Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 19 04:11:00 2016 (r300184) +++ head/sys/dev/siba/siba_core.c Thu May 19 04:11:49 2016 (r300185) @@ -1827,26 +1827,26 @@ siba_sprom_r8(struct siba_sprom *out, co /* FEM */ SIBA_SHIFTOUT(fem.ghz2.tssipos, SIBA_SPROM8_FEM2G, - SSB_SROM8_FEM_TSSIPOS); + SIBA_SROM8_FEM_TSSIPOS); SIBA_SHIFTOUT(fem.ghz2.extpa_gain, SIBA_SPROM8_FEM2G, - SSB_SROM8_FEM_EXTPA_GAIN); + SIBA_SROM8_FEM_EXTPA_GAIN); SIBA_SHIFTOUT(fem.ghz2.pdet_range, SIBA_SPROM8_FEM2G, - SSB_SROM8_FEM_PDET_RANGE); + SIBA_SROM8_FEM_PDET_RANGE); SIBA_SHIFTOUT(fem.ghz2.tr_iso, SIBA_SPROM8_FEM2G, - SSB_SROM8_FEM_TR_ISO); + SIBA_SROM8_FEM_TR_ISO); SIBA_SHIFTOUT(fem.ghz2.antswlut, SIBA_SPROM8_FEM2G, - SSB_SROM8_FEM_ANTSWLUT); + SIBA_SROM8_FEM_ANTSWLUT); SIBA_SHIFTOUT(fem.ghz5.tssipos, SIBA_SPROM8_FEM5G, - SSB_SROM8_FEM_TSSIPOS); + SIBA_SROM8_FEM_TSSIPOS); SIBA_SHIFTOUT(fem.ghz5.extpa_gain, SIBA_SPROM8_FEM5G, - SSB_SROM8_FEM_EXTPA_GAIN); + SIBA_SROM8_FEM_EXTPA_GAIN); SIBA_SHIFTOUT(fem.ghz5.pdet_range, SIBA_SPROM8_FEM5G, - SSB_SROM8_FEM_PDET_RANGE); + SIBA_SROM8_FEM_PDET_RANGE); SIBA_SHIFTOUT(fem.ghz5.tr_iso, SIBA_SPROM8_FEM5G, - SSB_SROM8_FEM_TR_ISO); + SIBA_SROM8_FEM_TR_ISO); SIBA_SHIFTOUT(fem.ghz5.antswlut, SIBA_SPROM8_FEM5G, - SSB_SROM8_FEM_ANTSWLUT); + SIBA_SROM8_FEM_ANTSWLUT); /* Extract cores power info info */ for (i = 0; i < nitems(pwr_info_offset); i++) { Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Thu May 19 04:11:00 2016 (r300184) +++ head/sys/dev/siba/sibareg.h Thu May 19 04:11:49 2016 (r300185) @@ -488,11 +488,11 @@ /* The FEM blocks share the same structure */ #define SIBA_SPROM8_FEM2G 0x10ae #define SIBA_SPROM8_FEM5G 0x10b0 -#define SSB_SROM8_FEM_TSSIPOS 0x0001 -#define SSB_SROM8_FEM_EXTPA_GAIN 0x0006 -#define SSB_SROM8_FEM_PDET_RANGE 0x00F8 -#define SSB_SROM8_FEM_TR_ISO 0x0700 -#define SSB_SROM8_FEM_ANTSWLUT 0xF800 +#define SIBA_SROM8_FEM_TSSIPOS 0x0001 +#define SIBA_SROM8_FEM_EXTPA_GAIN 0x0006 +#define SIBA_SROM8_FEM_PDET_RANGE 0x00F8 +#define SIBA_SROM8_FEM_TR_ISO 0x0700 +#define SIBA_SROM8_FEM_ANTSWLUT 0xF800 #define SIBA_SPROM8_MAXP_BG 0x10c0 #define SIBA_SPROM8_MAXP_BG_MASK 0x00ff @@ -520,10 +520,10 @@ #define SIBA_SPROM8_OFDM5GPO 0x1146 #define SIBA_SPROM8_OFDM5GLPO 0x114a #define SIBA_SPROM8_OFDM5GHPO 0x114e -#define SIBA_SPROM8_CDDPO 0x1192 -#define SIBA_SPROM8_STBCPO 0x1194 -#define SIBA_SPROM8_BW40PO 0x1196 -#define SIBA_SPROM8_BWDUPPO 0x1198 +#define SIBA_SPROM8_CDDPO 0x0192 +#define SIBA_SPROM8_STBCPO 0x0194 +#define SIBA_SPROM8_BW40PO 0x0196 +#define SIBA_SPROM8_BWDUPPO 0x0198 /* There are 4 blocks with power info sharing the same layout */ #define SIBA_SROM8_PWR_INFO_CORE0 0x10C0 From owner-svn-src-all@freebsd.org Thu May 19 04:22:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D652B4150E; Thu, 19 May 2016 04:22:59 +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 42DC413AF; Thu, 19 May 2016 04:22:59 +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 u4J4Mwjl065912; Thu, 19 May 2016 04:22:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4MwRv065910; Thu, 19 May 2016 04:22:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190422.u4J4MwRv065910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300186 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:22:59 -0000 Author: adrian Date: Thu May 19 04:22:58 2016 New Revision: 300186 URL: https://svnweb.freebsd.org/changeset/base/300186 Log: [bwn] rename TGS low registers to be consistent with naming scheme. Modified: head/sys/dev/bwn/if_bwn_phy_common.c head/sys/dev/bwn/if_bwnreg.h Modified: head/sys/dev/bwn/if_bwn_phy_common.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_common.c Thu May 19 04:11:49 2016 (r300185) +++ head/sys/dev/bwn/if_bwn_phy_common.c Thu May 19 04:22:58 2016 (r300186) @@ -186,9 +186,9 @@ bwn_mac_phy_clock_set(struct bwn_mac *ma if (bwn_is_bus_siba(mac)) { val = siba_read_4(sc->sc_dev, SIBA_TGSLOW); if (enabled) - val |= BWN_TMSLOW_MACPHYCLKEN; + val |= BWN_TGSLOW_MACPHYCLKEN; else - val &= ~BWN_TMSLOW_MACPHYCLKEN; + val &= ~BWN_TGSLOW_MACPHYCLKEN; siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); } } Modified: head/sys/dev/bwn/if_bwnreg.h ============================================================================== --- head/sys/dev/bwn/if_bwnreg.h Thu May 19 04:11:49 2016 (r300185) +++ head/sys/dev/bwn/if_bwnreg.h Thu May 19 04:22:58 2016 (r300186) @@ -97,8 +97,8 @@ /* SIBA control registers */ #define BWN_TGSLOW_PHYCLOCK_ENABLE 0x00040000 #define BWN_TGSLOW_PHYRESET 0x00080000 -#define BWN_TMSLOW_MACPHYCLKEN 0x00100000 /* MAC PHY Clock Control Enable (rev >= 5) */ -#define BWN_TMSLOW_PLLREFSEL 0x00200000 /* PLL Frequency Reference Select (rev >= 5) */ +#define BWN_TGSLOW_MACPHYCLKEN 0x00100000 /* MAC PHY Clock Control Enable (rev >= 5) */ +#define BWN_TGSLOW_PLLREFSEL 0x00200000 /* PLL Frequency Reference Select (rev >= 5) */ /* PHY_BANDWIDTH: N-PHY only */ #define BWN_TGSLOW_PHY_BANDWIDTH 0x00C00000 #define BWN_TGSLOW_PHY_BANDWIDTH_10MHZ 0x00000000 From owner-svn-src-all@freebsd.org Thu May 19 04:23:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A97B41570; Thu, 19 May 2016 04:23:55 +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 44A0F1694; Thu, 19 May 2016 04:23:55 +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 u4J4Ns1N065984; Thu, 19 May 2016 04:23:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4NsSP065983; Thu, 19 May 2016 04:23:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190423.u4J4NsSP065983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300187 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:23:55 -0000 Author: adrian Date: Thu May 19 04:23:54 2016 New Revision: 300187 URL: https://svnweb.freebsd.org/changeset/base/300187 Log: [bwn] enable dual-phy on BCM4322MC. Tested (with later commits): * BCM4322MC, STA mode, 2G + 5G Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu May 19 04:22:58 2016 (r300186) +++ head/sys/dev/bwn/if_bwn.c Thu May 19 04:23:54 2016 (r300187) @@ -1202,7 +1202,8 @@ bwn_attach_core(struct bwn_mac *mac) if (siba_get_pci_device(sc->sc_dev) != 0x4312 && siba_get_pci_device(sc->sc_dev) != 0x4319 && siba_get_pci_device(sc->sc_dev) != 0x4324 && - siba_get_pci_device(sc->sc_dev) != 0x4328) { + siba_get_pci_device(sc->sc_dev) != 0x4328 && + siba_get_pci_device(sc->sc_dev) != 0x432b) { have_a = have_bg = 0; if (mac->mac_phy.type == BWN_PHYTYPE_A) have_a = 1; From owner-svn-src-all@freebsd.org Thu May 19 04:28:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0121B41630; Thu, 19 May 2016 04:28:50 +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 B0B911858; Thu, 19 May 2016 04:28:50 +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 u4J4SnT9066176; Thu, 19 May 2016 04:28:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4SntB066175; Thu, 19 May 2016 04:28:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190428.u4J4SntB066175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300188 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:28:51 -0000 Author: adrian Date: Thu May 19 04:28:49 2016 New Revision: 300188 URL: https://svnweb.freebsd.org/changeset/base/300188 Log: [bwn] toggle the PHY clock during chip reset. Tested: * BCM4311, STA mode * BCM4312, STA mode * BCM4321, STA mode * BCM4322, STA mde Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu May 19 04:23:54 2016 (r300187) +++ head/sys/dev/bwn/if_bwn.c Thu May 19 04:28:49 2016 (r300188) @@ -1359,13 +1359,15 @@ bwn_reset_core(struct bwn_mac *mac, int /* Take PHY out of reset */ low = (siba_read_4(sc->sc_dev, SIBA_TGSLOW) | SIBA_TGSLOW_FGC) & - ~BWN_TGSLOW_PHYRESET; + ~(BWN_TGSLOW_PHYRESET | BWN_TGSLOW_PHYCLOCK_ENABLE); siba_write_4(sc->sc_dev, SIBA_TGSLOW, low); siba_read_4(sc->sc_dev, SIBA_TGSLOW); - DELAY(1000); - siba_write_4(sc->sc_dev, SIBA_TGSLOW, low & ~SIBA_TGSLOW_FGC); + DELAY(2000); + low &= ~SIBA_TGSLOW_FGC; + low |= BWN_TGSLOW_PHYCLOCK_ENABLE; + siba_write_4(sc->sc_dev, SIBA_TGSLOW, low); siba_read_4(sc->sc_dev, SIBA_TGSLOW); - DELAY(1000); + DELAY(2000); if (mac->mac_phy.switch_analog != NULL) mac->mac_phy.switch_analog(mac, 1); From owner-svn-src-all@freebsd.org Thu May 19 04:29:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8DB8B4167C; Thu, 19 May 2016 04:29:26 +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 7B7561A07; Thu, 19 May 2016 04:29:26 +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 u4J4TPVu066243; Thu, 19 May 2016 04:29:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4TPSY066242; Thu, 19 May 2016 04:29:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190429.u4J4TPSY066242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300189 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:29:26 -0000 Author: adrian Date: Thu May 19 04:29:25 2016 New Revision: 300189 URL: https://svnweb.freebsd.org/changeset/base/300189 Log: [bwn] add extra debugging. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu May 19 04:28:49 2016 (r300188) +++ head/sys/dev/bwn/if_bwn.c Thu May 19 04:29:25 2016 (r300189) @@ -2008,6 +2008,8 @@ bwn_core_init(struct bwn_mac *mac) KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT, ("%s:%d: fail", __func__, __LINE__)); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: called\n", __func__); + siba_powerup(sc->sc_dev, 0); if (!siba_dev_isup(sc->sc_dev)) bwn_reset_core(mac, mac->mac_phy.gmode); @@ -2041,6 +2043,7 @@ bwn_core_init(struct bwn_mac *mac) if (error) goto fail0; } + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: chip_init\n", __func__); error = bwn_chip_init(mac); if (error) goto fail0; @@ -2088,6 +2091,7 @@ bwn_core_init(struct bwn_mac *mac) bwn_spu_setdelay(mac, 1); bwn_bt_enable(mac); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: powerup\n", __func__); siba_powerup(sc->sc_dev, !(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_CRYSTAL_NOSLOW)); bwn_set_macaddr(mac); @@ -2097,12 +2101,14 @@ bwn_core_init(struct bwn_mac *mac) mac->mac_status = BWN_MAC_STATUS_INITED; + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: done\n", __func__); return (error); fail0: siba_powerdown(sc->sc_dev); KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT, ("%s:%d: fail", __func__, __LINE__)); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: fail\n", __func__); return (error); } @@ -3716,6 +3722,9 @@ bwn_mac_suspend(struct bwn_mac *mac) KASSERT(mac->mac_suspended >= 0, ("%s:%d: fail", __func__, __LINE__)); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: suspended=%d\n", + __func__, mac->mac_suspended); + if (mac->mac_suspended == 0) { bwn_psctl(mac, BWN_PS_AWAKE); BWN_WRITE_4(mac, BWN_MACCTL, @@ -3746,6 +3755,9 @@ bwn_mac_enable(struct bwn_mac *mac) struct bwn_softc *sc = mac->mac_sc; uint16_t state; + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: suspended=%d\n", + __func__, mac->mac_suspended); + state = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_UCODESTAT); if (state != BWN_SHARED_UCODESTAT_SUSPEND && @@ -4783,12 +4795,15 @@ bwn_intr(void *arg) (sc->sc_flags & BWN_FLAG_INVALID)) return (FILTER_STRAY); + DPRINTF(sc, BWN_DEBUG_INTR, "%s: called\n", __func__); + reason = BWN_READ_4(mac, BWN_INTR_REASON); if (reason == 0xffffffff) /* shared IRQ */ return (FILTER_STRAY); reason &= mac->mac_intr_mask; if (reason == 0) return (FILTER_HANDLED); + DPRINTF(sc, BWN_DEBUG_INTR, "%s: reason=0x%08x\n", __func__, reason); mac->mac_reason[0] = BWN_READ_4(mac, BWN_DMA0_REASON) & 0x0001dc00; mac->mac_reason[1] = BWN_READ_4(mac, BWN_DMA1_REASON) & 0x0000dc00; From owner-svn-src-all@freebsd.org Thu May 19 04:45:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F92B41A78; Thu, 19 May 2016 04:45:52 +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 467731115; Thu, 19 May 2016 04:45:52 +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 u4J4jpec072022; Thu, 19 May 2016 04:45:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4joCU072016; Thu, 19 May 2016 04:45:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190445.u4J4joCU072016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300190 - head/sys/gnu/dev/bwn/phy_n X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:45:52 -0000 Author: adrian Date: Thu May 19 04:45:50 2016 New Revision: 300190 URL: https://svnweb.freebsd.org/changeset/base/300190 Log: [bwn] add opt_wlan.h and opt_bwn.h to each of the phy_n source files. Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2055.c head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2056.c head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:29:25 2016 (r300189) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:45:50 2016 (r300190) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); * The Broadcom Wireless LAN controller driver. */ +#include "opt_wlan.h" +#include "opt_bwn.h" + #include #include #include Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c Thu May 19 04:29:25 2016 (r300189) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c Thu May 19 04:45:50 2016 (r300190) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); /* * The Broadcom Wireless LAN controller driver. */ +#include "opt_wlan.h" +#include "opt_bwn.h" #include #include Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c Thu May 19 04:29:25 2016 (r300189) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c Thu May 19 04:45:50 2016 (r300190) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); * The Broadcom Wireless LAN controller driver. */ +#include "opt_wlan.h" +#include "opt_bwn.h" + #include #include #include Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2055.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2055.c Thu May 19 04:29:25 2016 (r300189) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2055.c Thu May 19 04:45:50 2016 (r300190) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); * The Broadcom Wireless LAN controller driver. */ +#include "opt_wlan.h" +#include "opt_bwn.h" + #include #include #include Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2056.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2056.c Thu May 19 04:29:25 2016 (r300189) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2056.c Thu May 19 04:45:50 2016 (r300190) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); * The Broadcom Wireless LAN controller driver. */ +#include "opt_wlan.h" +#include "opt_bwn.h" + #include #include #include Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c Thu May 19 04:29:25 2016 (r300189) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c Thu May 19 04:45:50 2016 (r300190) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); * The Broadcom Wireless LAN controller driver. */ +#include "opt_wlan.h" +#include "opt_bwn.h' + #include #include #include From owner-svn-src-all@freebsd.org Thu May 19 04:46:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B479B41AC4; Thu, 19 May 2016 04:46:23 +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 D6FDE1292; Thu, 19 May 2016 04:46:22 +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 u4J4kLa0072087; Thu, 19 May 2016 04:46:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4kLCu072086; Thu, 19 May 2016 04:46:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190446.u4J4kLCu072086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300191 - head/sys/gnu/dev/bwn/phy_n X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:46:23 -0000 Author: adrian Date: Thu May 19 04:46:21 2016 New Revision: 300191 URL: https://svnweb.freebsd.org/changeset/base/300191 Log: [bwn] improve N-PHY debuggability a little bit. Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:45:50 2016 (r300190) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:46:21 2016 (r300191) @@ -1406,6 +1406,7 @@ static uint8_t bwn_radio_2056_rcal(struc if (phy->rev != 3) return 0; + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); mast2 = BWN_RF_READ(mac, B2056_SYN_PLL_MAST2); BWN_RF_WRITE(mac, B2056_SYN_PLL_MAST2, mast2 | 0x7); @@ -1432,6 +1433,8 @@ static uint8_t bwn_radio_2056_rcal(struc static void bwn_radio_init2056_pre(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); + BWN_PHY_MASK(mac, BWN_NPHY_RFCTL_CMD, ~BWN_NPHY_RFCTL_CMD_CHIP0PU); /* Maybe wl meant to reset and set (order?) RFCTL_CMD_OEPORFORCE? */ @@ -1445,6 +1448,8 @@ static void bwn_radio_init2056_pre(struc static void bwn_radio_init2056_post(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); + BWN_RF_SET(mac, B2056_SYN_COM_CTRL, 0xB); BWN_RF_SET(mac, B2056_SYN_COM_PU, 0x2); BWN_RF_SET(mac, B2056_SYN_COM_RESET, 0x2); @@ -1462,6 +1467,8 @@ static void bwn_radio_init2056_post(stru */ static void bwn_radio_init2056(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); + bwn_radio_init2056_pre(mac); b2056_upload_inittabs(mac, 0, 0); bwn_radio_init2056_post(mac); @@ -6375,6 +6382,7 @@ static void bwn_nphy_pmu_spur_avoid(stru /* XXX bhnd */ if (bwn_is_bus_siba(mac)) { + DPRINTF(sc, BWN_DEBUG_RESET, "%s: spuravoid %d\n", __func__, avoid); siba_pmu_spuravoid_pllupdate(sc->sc_dev, avoid); } } @@ -6391,7 +6399,7 @@ static void bwn_nphy_channel_setup(struc uint16_t tmp16; if (bwn_channel_band(mac, new_channel) == BWN_BAND_5G) { - DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_2G\n", __func__); + DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_5G; chan=%d\n", __func__, ch); /* Switch to 2 GHz for a moment to access BWN_PHY_B_BBCFG */ BWN_PHY_MASK(mac, BWN_NPHY_BANDCTL, ~BWN_NPHY_BANDCTL_5GHZ); @@ -6403,7 +6411,7 @@ static void bwn_nphy_channel_setup(struc BWN_WRITE_2(mac, BWN_PSM_PHY_HDR, tmp16); BWN_PHY_SET(mac, BWN_NPHY_BANDCTL, BWN_NPHY_BANDCTL_5GHZ); } else if (bwn_channel_band(mac, new_channel) == BWN_BAND_2G) { - DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_2G\n", __func__); + DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_2G; chan=%d\n", __func__, ch); BWN_PHY_MASK(mac, BWN_NPHY_BANDCTL, ~BWN_NPHY_BANDCTL_5GHZ); tmp16 = BWN_READ_2(mac, BWN_PSM_PHY_HDR); BWN_WRITE_2(mac, BWN_PSM_PHY_HDR, tmp16 | 4); @@ -6731,10 +6739,11 @@ bwn_nphy_op_software_rfkill(struct bwn_m if (BWN_READ_4(mac, BWN_MACCTL) & BWN_MACCTL_ON) BWN_ERRPRINTF(mac->mac_sc, "MAC not suspended\n"); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET | BWN_DEBUG_PHY, + "%s: called; rev=%d, rf_on=%d, active=%d\n", __func__, + phy->rev, mac->mac_phy.rf_on, active); + if (active) { - DPRINTF(mac->mac_sc, BWN_DEBUG_RESET | BWN_DEBUG_PHY, - "%s: called; rev=%d, rf_on=%d\n", __func__, - phy->rev, mac->mac_phy.rf_on); if (phy->rev >= 19) { /* TODO */ } else if (phy->rev >= 7) { From owner-svn-src-all@freebsd.org Thu May 19 04:48:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73085B41B89; Thu, 19 May 2016 04:48:14 +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 443EF14C4; Thu, 19 May 2016 04:48:14 +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 u4J4mD61072206; Thu, 19 May 2016 04:48:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4mDqi072205; Thu, 19 May 2016 04:48:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190448.u4J4mDqi072205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300192 - head/sys/gnu/dev/bwn/phy_n X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:48:14 -0000 Author: adrian Date: Thu May 19 04:48:13 2016 New Revision: 300192 URL: https://svnweb.freebsd.org/changeset/base/300192 Log: [bwn] disable rfon checks so the 2056/2057 radios are programmed. This was the big missing piece for getting the BCM94322MC NIC to work at all. Tested: * BCM4322, STA mode (2g, 5g) Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:46:21 2016 (r300191) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:48:13 2016 (r300192) @@ -6743,15 +6743,21 @@ bwn_nphy_op_software_rfkill(struct bwn_m "%s: called; rev=%d, rf_on=%d, active=%d\n", __func__, phy->rev, mac->mac_phy.rf_on, active); + /* + * XXX TODO: don't bother doing RF programming if it's + * already done. But, bwn(4) currently sets rf_on in the + * PHY setup and leaves it on after startup, which causes + * the below to not init the 2056/2057 radios. + */ if (active) { if (phy->rev >= 19) { /* TODO */ } else if (phy->rev >= 7) { - if (!mac->mac_phy.rf_on) +// if (!mac->mac_phy.rf_on) bwn_radio_2057_init(mac); bwn_switch_channel(mac, bwn_get_chan(mac)); } else if (phy->rev >= 3) { - if (!mac->mac_phy.rf_on) +// if (!mac->mac_phy.rf_on) bwn_radio_init2056(mac); bwn_switch_channel(mac, bwn_get_chan(mac)); } else { From owner-svn-src-all@freebsd.org Thu May 19 05:06:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93E5B41E7E; Thu, 19 May 2016 05:06:13 +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 7824C1D2D; Thu, 19 May 2016 05:06:13 +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 u4J56CIq078122; Thu, 19 May 2016 05:06:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J56Cxk078121; Thu, 19 May 2016 05:06:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190506.u4J56Cxk078121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 05:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300193 - head/sys/gnu/dev/bwn/phy_n X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 05:06:13 -0000 Author: adrian Date: Thu May 19 05:06:12 2016 New Revision: 300193 URL: https://svnweb.freebsd.org/changeset/base/300193 Log: [bwn] typo. Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c Thu May 19 04:48:13 2016 (r300192) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c Thu May 19 05:06:12 2016 (r300193) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); */ #include "opt_wlan.h" -#include "opt_bwn.h' +#include "opt_bwn.h" #include #include From owner-svn-src-all@freebsd.org Thu May 19 05:06:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BDA3B41ED7; Thu, 19 May 2016 05:06:49 +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 4AEE21E98; Thu, 19 May 2016 05:06:49 +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 u4J56muI078184; Thu, 19 May 2016 05:06:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J56mfi078182; Thu, 19 May 2016 05:06:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190506.u4J56mfi078182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 05:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300194 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 05:06:49 -0000 Author: adrian Date: Thu May 19 05:06:48 2016 New Revision: 300194 URL: https://svnweb.freebsd.org/changeset/base/300194 Log: [bwn] program in the MAC capabilities somewhere where later microcode expects it. Obtained from: Linux b43 Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnreg.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu May 19 05:06:12 2016 (r300193) +++ head/sys/dev/bwn/if_bwn.c Thu May 19 05:06:48 2016 (r300194) @@ -2071,6 +2071,19 @@ bwn_core_init(struct bwn_mac *mac) hf &= ~BWN_HF_SKIP_CFP_UPDATE; bwn_hf_write(mac, hf); + /* Tell the firmware about the MAC capabilities */ + if (siba_get_revid(sc->sc_dev) >= 13) { + uint32_t cap; + cap = BWN_READ_4(mac, BWN_MAC_HW_CAP); + DPRINTF(sc, BWN_DEBUG_RESET, + "%s: hw capabilities: 0x%08x\n", + __func__, cap); + bwn_shm_write_2(mac, BWN_SHARED, BWN_SHARED_MACHW_L, + cap & 0xffff); + bwn_shm_write_2(mac, BWN_SHARED, BWN_SHARED_MACHW_H, + (cap >> 16) & 0xffff); + } + bwn_set_txretry(mac, BWN_RETRY_SHORT, BWN_RETRY_LONG); bwn_shm_write_2(mac, BWN_SHARED, BWN_SHARED_SHORT_RETRY_FALLBACK, 3); bwn_shm_write_2(mac, BWN_SHARED, BWN_SHARED_LONG_RETRY_FALLBACK, 2); Modified: head/sys/dev/bwn/if_bwnreg.h ============================================================================== --- head/sys/dev/bwn/if_bwnreg.h Thu May 19 05:06:12 2016 (r300193) +++ head/sys/dev/bwn/if_bwnreg.h Thu May 19 05:06:48 2016 (r300194) @@ -169,6 +169,7 @@ #define BWN_RAM_CONTROL 0x130 #define BWN_RAM_DATA 0x134 #define BWN_PS_STATUS 0x140 +#define BWN_MAC_HW_CAP 0x15c /* core rev >= 13 */ #define BWN_RF_HWENABLED_HI 0x158 #define BWN_RF_HWENABLED_HI_MASK (1 << 16) #define BWN_SHM_CONTROL 0x160 @@ -284,6 +285,8 @@ #define BWN_SHARED_SPU_WAKEUP 0x0094 #define BWN_SHARED_PRETBTT 0x0096 #define BWN_SHARED_CHAN 0x00a0 +#define BWN_SHARED_MACHW_L 0x00c0 +#define BWN_SHARED_MACHW_H 0x00c2 #define BWN_SHARED_AUTOINC 0x0100 #define BWN_SHARED_PROBE_RESP_PHYCTL 0x0188 #define BWN_SHARED_EDCFQ 0x0240 From owner-svn-src-all@freebsd.org Thu May 19 05:09:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86007B41F45; Thu, 19 May 2016 05:09:21 +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 570531053; Thu, 19 May 2016 05:09: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 u4J59Kwe078303; Thu, 19 May 2016 05:09:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J59KAX078302; Thu, 19 May 2016 05:09:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190509.u4J59KAX078302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 05:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300195 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 05:09:21 -0000 Author: adrian Date: Thu May 19 05:09:20 2016 New Revision: 300195 URL: https://svnweb.freebsd.org/changeset/base/300195 Log: [bwn] quieten the "invalid firmware state". That pops up in the rev 5xx / 6xx microcode on the later cores (4312, 4322.) I'm not sure why this is happening yet and I'll dig into it, but Linux b43 does the same thing. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu May 19 05:06:48 2016 (r300194) +++ head/sys/dev/bwn/if_bwn.c Thu May 19 05:09:20 2016 (r300195) @@ -3774,8 +3774,11 @@ bwn_mac_enable(struct bwn_mac *mac) state = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_UCODESTAT); if (state != BWN_SHARED_UCODESTAT_SUSPEND && - state != BWN_SHARED_UCODESTAT_SLEEP) - device_printf(sc->sc_dev, "warn: firmware state (%d)\n", state); + state != BWN_SHARED_UCODESTAT_SLEEP) { + DPRINTF(sc, BWN_DEBUG_FW, + "%s: warn: firmware state (%d)\n", + __func__, state); + } mac->mac_suspended--; KASSERT(mac->mac_suspended >= 0, From owner-svn-src-all@freebsd.org Thu May 19 06:29:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E5EB41FCE; Thu, 19 May 2016 06:29:44 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAC4F1349; Thu, 19 May 2016 06:29:44 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4J6ThdL002326; Thu, 19 May 2016 06:29:43 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J6Thvn002325; Thu, 19 May 2016 06:29:43 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605190629.u4J6Thvn002325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Thu, 19 May 2016 06:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300196 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 06:29:45 -0000 Author: sgalabov Date: Thu May 19 06:29:43 2016 New Revision: 300196 URL: https://svnweb.freebsd.org/changeset/base/300196 Log: Ralink: Add more SoC compatible strings Add more 'compatible' strings found in various LEDE DTS files. Reviewed by: adrian Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6432 Modified: head/sys/mips/mediatek/mtk_soc.c Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Thu May 19 05:09:20 2016 (r300195) +++ head/sys/mips/mediatek/mtk_soc.c Thu May 19 06:29:43 2016 (r300196) @@ -61,9 +61,12 @@ static const struct ofw_compat_data comp { "ralink,rt3883-soc", MTK_SOC_RT3883 }, { "ralink,rt5350-soc", MTK_SOC_RT5350 }, { "ralink,mtk7620a-soc", MTK_SOC_MT7620A }, + { "ralink,mt7620a-soc", MTK_SOC_MT7620A }, { "ralink,mtk7620n-soc", MTK_SOC_MT7620N }, + { "ralink,mt7620n-soc", MTK_SOC_MT7620N }, { "mediatek,mtk7621-soc", MTK_SOC_MT7621 }, { "mediatek,mt7621-soc", MTK_SOC_MT7621 }, + { "ralink,mt7621-soc", MTK_SOC_MT7621 }, { "ralink,mtk7621-soc", MTK_SOC_MT7621 }, { "ralink,mtk7628an-soc", MTK_SOC_MT7628 }, { "mediatek,mt7628an-soc", MTK_SOC_MT7628 }, From owner-svn-src-all@freebsd.org Thu May 19 10:37:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA5FB42E02; Thu, 19 May 2016 10:37:45 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 710921664; Thu, 19 May 2016 10:37:45 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JAbilW088358; Thu, 19 May 2016 10:37:44 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JAbi7Y088357; Thu, 19 May 2016 10:37:44 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201605191037.u4JAbi7Y088357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Thu, 19 May 2016 10:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300197 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 10:37:45 -0000 Author: maxim Date: Thu May 19 10:37:44 2016 New Revision: 300197 URL: https://svnweb.freebsd.org/changeset/base/300197 Log: o usage() updated for -h and -X flags. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Thu May 19 06:29:43 2016 (r300196) +++ head/tools/tools/nanobsd/defaults.sh Thu May 19 10:37:44 2016 (r300197) @@ -1018,10 +1018,11 @@ pprint ( ) ( usage ( ) { ( - echo "Usage: $0 [-bfiKknqvw] [-c config_file]" + echo "Usage: $0 [-bfhiKknqvwX] [-c config_file]" echo " -b suppress builds (both kernel and world)" echo " -c specify config file" echo " -f suppress code slice extraction" + echo " -h print this help summary page" echo " -i suppress disk image build" echo " -K suppress installkernel" echo " -k suppress buildkernel" @@ -1029,6 +1030,7 @@ usage ( ) { echo " -q make output more quiet" echo " -v make output more verbose" echo " -w suppress buildworld" + echo " -X make native-xtools" ) 1>&2 exit 2 } From owner-svn-src-all@freebsd.org Thu May 19 10:39:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4173B42E62; Thu, 19 May 2016 10:39:05 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 681BF17EA; Thu, 19 May 2016 10:39:05 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JAd4WV088453; Thu, 19 May 2016 10:39:04 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JAd4lR088451; Thu, 19 May 2016 10:39:04 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201605191039.u4JAd4lR088451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Thu, 19 May 2016 10:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300198 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 10:39:05 -0000 Author: maxim Date: Thu May 19 10:39:04 2016 New Revision: 300198 URL: https://svnweb.freebsd.org/changeset/base/300198 Log: o Remove EoL whitespaces. Modified: head/tools/tools/nanobsd/defaults.sh head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Thu May 19 10:37:44 2016 (r300197) +++ head/tools/tools/nanobsd/defaults.sh Thu May 19 10:39:04 2016 (r300198) @@ -195,7 +195,7 @@ NANO_DATADIR="" # in case they are stray in the build environment SRCCONF=/dev/null SRC_ENV_CONF=/dev/null - + ####################################################################### # # The functions which do the real work. @@ -319,7 +319,7 @@ make_conf_build ( ) ( # in addition to the user's global settings ( nano_global_make_env - echo "${CONF_WORLD}" + echo "${CONF_WORLD}" echo "${CONF_BUILD}" ) > ${NANO_MAKE_CONF_BUILD} ) @@ -429,7 +429,7 @@ install_kernel ( ) ( ( nano_make_install_env - nano_make_kernel_env + nano_make_kernel_env if [ "${NANO_MODULES}" != "default" ]; then MODULES_OVERRIDE="${NANO_MODULES}" @@ -465,7 +465,7 @@ run_early_customize() { pprint 2 "run early customize scripts" for c in $NANO_EARLY_CUSTOMIZE - do + do pprint 2 "early customize \"$c\"" pprint 3 "log: ${NANO_LOG}/_.early_cust.$c" pprint 4 "`type $c`" @@ -529,7 +529,7 @@ fixup_before_diskimage ( ) ( echo "/set uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" > ${NANO_METALOG} cat ${NANO_METALOG}.pre | ${NANO_TOOLS}/mtree-dedup.awk | \ sed -e 's/ size=[0-9][0-9]*//' | sort >> ${NANO_METALOG} - fi + fi ) setup_nanobsd ( ) ( @@ -603,11 +603,11 @@ setup_nanobsd_etc ( ) ( prune_usr ( ) ( - # Remove all empty directories in /usr + # Remove all empty directories in /usr find "${NANO_WORLDDIR}"/usr -type d -depth -print | while read d do - rmdir $d > /dev/null 2>&1 || true + rmdir $d > /dev/null 2>&1 || true done ) @@ -676,7 +676,7 @@ create_diskimage ( ) ( else print "g c" 1023 " h" $4 " s" $3 - if ($7 > 0) { + if ($7 > 0) { # size of data partition in full cylinders dsl = int (($7 + cs - 1) / cs) } else { @@ -697,7 +697,7 @@ create_diskimage ( ) ( print "p 1 165 " $3, isl * cs - $3 c = isl * cs; - # Second image partition (if any) also starts offset one + # Second image partition (if any) also starts offset one # track to keep them identical. if ($2 > 1) { print "p 2 165 " $3 + c, isl * cs - $3 @@ -780,7 +780,7 @@ create_diskimage ( ) ( tunefs -L ${NANO_LABEL}"${NANO_ALTROOT}" /dev/${MD}${NANO_ALTROOT} fi fi - + # Create Config slice populate_cfg_slice /dev/${MD}${NANO_SLICE_CFG} "${NANO_CFGDIR}" ${MNT} "${NANO_SLICE_CFG}" Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu May 19 10:37:44 2016 (r300197) +++ head/tools/tools/nanobsd/nanobsd.sh Thu May 19 10:39:04 2016 (r300198) @@ -55,7 +55,7 @@ set -e set -- $args for i do - case "$i" + case "$i" in -K) do_installkernel=false From owner-svn-src-all@freebsd.org Thu May 19 10:56:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F1CAB423E4; Thu, 19 May 2016 10:56:57 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2B47167B; Thu, 19 May 2016 10:56:56 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JAuuC1016194; Thu, 19 May 2016 10:56:56 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JAuuFX016193; Thu, 19 May 2016 10:56:56 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201605191056.u4JAuuFX016193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Thu, 19 May 2016 10:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300199 - head/share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 10:56:57 -0000 Author: maxim Date: Thu May 19 10:56:55 2016 New Revision: 300199 URL: https://svnweb.freebsd.org/changeset/base/300199 Log: o -f, -i, -K, -q, -v, -X flags documented. Modified: head/share/man/man8/nanobsd.8 Modified: head/share/man/man8/nanobsd.8 ============================================================================== --- head/share/man/man8/nanobsd.8 Thu May 19 10:39:04 2016 (r300198) +++ head/share/man/man8/nanobsd.8 Thu May 19 10:56:55 2016 (r300199) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2010 +.Dd May 19, 2016 .Dt NANOBSD 8 .Os .Sh NAME @@ -33,7 +33,7 @@ applications .Sh SYNOPSIS .Nm -.Op Fl bhknw +.Op Fl bfhiKknqvwX .Op Fl c Ar config-file .Sh DESCRIPTION The @@ -53,8 +53,16 @@ The following options are available: Skip the build stages (both for kernel and world). .It Fl c Ar config-file Specify the configuration file to use. +.It Fl f +Skip the code slice extraction. .It Fl h Display usage information. +.It Fl i +Skip the disk image build stage. +.It Fl K +Skip the +.Cm installkernel +stage of the build. .It Fl k Skip the .Cm buildkernel @@ -65,10 +73,17 @@ This suppresses the normal cleanup work .Cm buildworld stage and adds -DNO_CLEAN to the make command line used for each build stage (world and kernel). +.It Fl q +Make output more quiet. +.It Fl v +Make output more verbose. .It Fl w Skip the .Cm buildworld stage of the build. +.It Fl X +Make +.Cm native-xtools. .El .Pp The features of From owner-svn-src-all@freebsd.org Thu May 19 11:02:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9203CB4269D; Thu, 19 May 2016 11:02:40 +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 62E941BE1; Thu, 19 May 2016 11:02:40 +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 u4JB2dRu019832; Thu, 19 May 2016 11:02:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JB2dXq019831; Thu, 19 May 2016 11:02:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605191102.u4JB2dXq019831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 19 May 2016 11:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300200 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 11:02:40 -0000 Author: hselasky Date: Thu May 19 11:02:39 2016 New Revision: 300200 URL: https://svnweb.freebsd.org/changeset/base/300200 Log: Fix bad sizeof(). Submitted by: David Binderman PR: 209636 Modified: head/sys/dev/usb/controller/generic_ohci.c Modified: head/sys/dev/usb/controller/generic_ohci.c ============================================================================== --- head/sys/dev/usb/controller/generic_ohci.c Thu May 19 10:56:55 2016 (r300199) +++ head/sys/dev/usb/controller/generic_ohci.c Thu May 19 11:02:39 2016 (r300200) @@ -166,7 +166,7 @@ generic_ohci_attach(device_t dev) clk_get_name(clk)); goto error; } - clkp = malloc(sizeof(clkp), M_DEVBUF, M_WAITOK | M_ZERO); + clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO); clkp->clk = clk; TAILQ_INSERT_TAIL(&sc->clk_list, clkp, next); } From owner-svn-src-all@freebsd.org Thu May 19 11:19:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD3C8B42C36; Thu, 19 May 2016 11:19:38 +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 9F6671998; Thu, 19 May 2016 11:19:38 +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 u4JBJbSK027907; Thu, 19 May 2016 11:19:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JBJb9f027906; Thu, 19 May 2016 11:19:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605191119.u4JBJb9f027906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 May 2016 11:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300201 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 11:19:38 -0000 Author: mav Date: Thu May 19 11:19:37 2016 New Revision: 300201 URL: https://svnweb.freebsd.org/changeset/base/300201 Log: Add ta_flags initialization in old macros missed in 300113. Depending on uninitialized memory content it could cause loss of wakeup() call in taskqueue_run_locked(). Modified: head/sys/sys/taskqueue.h Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Thu May 19 11:02:39 2016 (r300200) +++ head/sys/sys/taskqueue.h Thu May 19 11:19:37 2016 (r300201) @@ -97,6 +97,7 @@ void taskqueue_set_callback(struct taskq #define TASK_INITIALIZER(priority, func, context) \ { .ta_pending = 0, \ + .ta_flags = 0, \ .ta_priority = (priority), \ .ta_func = (func), \ .ta_context = (context) } @@ -112,6 +113,7 @@ void taskqueue_thread_enqueue(void *cont */ #define TASK_INIT(task, priority, func, context) do { \ (task)->ta_pending = 0; \ + (task)->ta_flags = 0; \ (task)->ta_priority = (priority); \ (task)->ta_func = (func); \ (task)->ta_context = (context); \ From owner-svn-src-all@freebsd.org Thu May 19 11:37:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8FF1B4213A; Thu, 19 May 2016 11:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 852881269; Thu, 19 May 2016 11:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [192.168.228.1] (unknown [45.113.64.253]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 1BC7F9CBF; Thu, 19 May 2016 13:37:51 +0200 (CEST) From: "Kristof Provost" To: "Scott Long" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys Date: Thu, 19 May 2016 17:07:48 +0530 Message-ID: <0C9937A7-792B-4339-ACF9-F5D7D3C3A85A@FreeBSD.org> In-Reply-To: <201605180435.u4I4ZwYh025096@repo.freebsd.org> References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: MailMate Trial (1.9.4r5234) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 11:37:56 -0000 On 18 May 2016, at 10:05, Scott Long wrote: > Author: scottl > Date: Wed May 18 04:35:58 2016 > New Revision: 300113 > URL: https://svnweb.freebsd.org/changeset/base/300113 > > Log: > Import the 'iflib' API library for network drivers. From the > author: For reasons I don’t understand right now this appears to break boot on my T61. It’s got an em NIC (82566MM) and is running root-on-zfs, if that matters. It mounts the rootfs and then just freezes. I’m investigating, but would appreciate any hints or thoughts. > Modified: head/sys/kern/subr_taskqueue.c > ============================================================================== > --- head/sys/kern/subr_taskqueue.c Wed May 18 04:04:14 2016 (r300112) > +++ head/sys/kern/subr_taskqueue.c Wed May 18 04:35:58 2016 (r300113) > @@ -119,11 +123,17 @@ TQ_SLEEP(struct taskqueue *tq, void *p, > } > > static struct taskqueue * > -_taskqueue_create(const char *name __unused, int mflags, > +_taskqueue_create(const char *name, int mflags, > taskqueue_enqueue_fn enqueue, void *context, > - int mtxflags, const char *mtxname) > + int mtxflags, const char *mtxname __unused) > { > struct taskqueue *queue; > + char *tq_name = NULL; > + > + if (name != NULL) > + tq_name = strndup(name, 32, M_TASKQUEUE); > + if (tq_name == NULL) > + tq_name = "taskqueue"; This looks wrong. It’s later free()ed. > > @@ -194,6 +206,7 @@ taskqueue_free(struct taskqueue *queue) > KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); > mtx_destroy(&queue->tq_mutex); > free(queue->tq_threads, M_TASKQUEUE); > + free(queue->tq_name, M_TASKQUEUE); This potentially frees a constant pointer. Regards, Kristof From owner-svn-src-all@freebsd.org Thu May 19 12:07:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E35AB42D04; Thu, 19 May 2016 12:07:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0BAE51255; Thu, 19 May 2016 12:07:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA24495; Thu, 19 May 2016 15:07:34 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1b3Mjm-000MCx-7d; Thu, 19 May 2016 15:07:34 +0300 Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys To: Kristof Provost , Scott Long References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> <0C9937A7-792B-4339-ACF9-F5D7D3C3A85A@FreeBSD.org> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: <2013f2c5-94f0-6e1d-0a58-a4a33005e74d@FreeBSD.org> Date: Thu, 19 May 2016 15:06:13 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <0C9937A7-792B-4339-ACF9-F5D7D3C3A85A@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 12:07:38 -0000 On 19/05/2016 14:37, Kristof Provost wrote: > > > On 18 May 2016, at 10:05, Scott Long wrote: > >> Author: scottl >> Date: Wed May 18 04:35:58 2016 >> New Revision: 300113 >> URL: https://svnweb.freebsd.org/changeset/base/300113 >> >> Log: >> Import the 'iflib' API library for network drivers. From the author: > > For reasons I don’t understand right now this appears to break boot on my T61. > It’s got an em NIC (82566MM) and is running root-on-zfs, if that matters. > > It mounts the rootfs and then just freezes. I’m investigating, but would > appreciate any hints or thoughts. Alexander has just committed r300201. It should help. > >> Modified: head/sys/kern/subr_taskqueue.c >> ============================================================================== >> --- head/sys/kern/subr_taskqueue.c Wed May 18 04:04:14 2016 (r300112) >> +++ head/sys/kern/subr_taskqueue.c Wed May 18 04:35:58 2016 (r300113) >> @@ -119,11 +123,17 @@ TQ_SLEEP(struct taskqueue *tq, void *p, >> } >> >> static struct taskqueue * >> -_taskqueue_create(const char *name __unused, int mflags, >> +_taskqueue_create(const char *name, int mflags, >> taskqueue_enqueue_fn enqueue, void *context, >> - int mtxflags, const char *mtxname) >> + int mtxflags, const char *mtxname __unused) >> { >> struct taskqueue *queue; >> + char *tq_name = NULL; >> + >> + if (name != NULL) >> + tq_name = strndup(name, 32, M_TASKQUEUE); >> + if (tq_name == NULL) >> + tq_name = "taskqueue"; > > This looks wrong. It’s later free()ed. > >> >> @@ -194,6 +206,7 @@ taskqueue_free(struct taskqueue *queue) >> KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); >> mtx_destroy(&queue->tq_mutex); >> free(queue->tq_threads, M_TASKQUEUE); >> + free(queue->tq_name, M_TASKQUEUE); > > This potentially frees a constant pointer. > > Regards, > Kristof > -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu May 19 12:09:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FB4B42D74; Thu, 19 May 2016 12:09:20 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0A50813DA; Thu, 19 May 2016 12:09:20 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 0851D1C6C; Thu, 19 May 2016 12:09:20 +0000 (UTC) Date: Thu, 19 May 2016 12:09:19 +0000 From: Alexey Dokuchaev To: Rick Macklem Cc: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299753 - head/sys/fs/fuse Message-ID: <20160519120919.GA45827@FreeBSD.org> References: <201605142003.u4EK3MwV021470@repo.freebsd.org> <20160514203542.GA21013@FreeBSD.org> <1941668157.102490217.1463439395249.JavaMail.zimbra@uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1941668157.102490217.1463439395249.JavaMail.zimbra@uoguelph.ca> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 12:09:20 -0000 On Mon, May 16, 2016 at 06:56:35PM -0400, Rick Macklem wrote: > Alexey Dokuchaev wrote: > > On Sat, May 14, 2016 at 08:03:22PM +0000, Rick Macklem wrote: > > > New Revision: 299753 > > > URL: https://svnweb.freebsd.org/changeset/base/299753 > > > > > > Log: > > > Fix fuse to use DIRECT_IO when required. > > > > > > When a file is opened write-only and a partial block was written, > > > buffered I/O would try and read the whole block in. This would > > > result in a hung thread, since there was no open (fuse filehandle) > > > that allowed reading. This patch avoids the problem by forcing > > > DIRECT_IO for this case. > > > It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO > > > flag in its reply to the open. > > > > Since you're at fuse now, perhaps you could also have a look at PR 195000? > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195000 > > I was able to test the patch and it stops the crash. > I took out the MPASS() call because I didn't see why it should panic > for VFIFO instead of returning EINVAL like the rest. > > If you'd like to commit it, email soon. Otherwise I will commit it. Rick, if I could've committed it, I would've done it long time ago. ;-) I'm lucky to finaly drag competent src committer's attention to this PR. Please go ahead of course, no waiting required. ./danfe From owner-svn-src-all@freebsd.org Thu May 19 12:14:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21754B42F20; Thu, 19 May 2016 12:14:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF3111A98; Thu, 19 May 2016 12:14:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [192.168.228.1] (unknown [45.113.64.253]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 8C82E9D3E; Thu, 19 May 2016 14:14:52 +0200 (CEST) From: "Kristof Provost" To: "Andriy Gapon" Cc: "Scott Long" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys Date: Thu, 19 May 2016 17:44:50 +0530 Message-ID: In-Reply-To: <2013f2c5-94f0-6e1d-0a58-a4a33005e74d@FreeBSD.org> References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> <0C9937A7-792B-4339-ACF9-F5D7D3C3A85A@FreeBSD.org> <2013f2c5-94f0-6e1d-0a58-a4a33005e74d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: MailMate Trial (1.9.4r5234) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 12:14:56 -0000 On 19 May 2016, at 17:36, Andriy Gapon wrote: > On 19/05/2016 14:37, Kristof Provost wrote: >> >> >> On 18 May 2016, at 10:05, Scott Long wrote: >> >>> Author: scottl >>> Date: Wed May 18 04:35:58 2016 >>> New Revision: 300113 >>> URL: https://svnweb.freebsd.org/changeset/base/300113 >>> >>> Log: >>> Import the 'iflib' API library for network drivers. From the >>> author: >> >> For reasons I don’t understand right now this appears to break boot >> on my T61. >> It’s got an em NIC (82566MM) and is running root-on-zfs, if that >> matters. >> >> It mounts the rootfs and then just freezes. I’m investigating, but >> would >> appreciate any hints or thoughts. > > Alexander has just committed r300201. It should help. > Indeed, I’ve just updated to include that fix, and now the system boots. Regards, Kristof From owner-svn-src-all@freebsd.org Thu May 19 12:45:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A004EB40629; Thu, 19 May 2016 12:45:21 +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 53A621AB0; Thu, 19 May 2016 12:45:21 +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 u4JCjKKd055024; Thu, 19 May 2016 12:45:20 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JCjKBx055023; Thu, 19 May 2016 12:45:20 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605191245.u4JCjKBx055023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 19 May 2016 12:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300202 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 12:45:21 -0000 Author: ae Date: Thu May 19 12:45:20 2016 New Revision: 300202 URL: https://svnweb.freebsd.org/changeset/base/300202 Log: Since PFIL can change destination address, use its always actual value from mbuf when calculating path mtu. Remove now unused finaldst variable. Also constify dst argument in ip6_getpmtu() and ip6_getpmtu_ctl(). Reviewed by: melifaro Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu May 19 11:19:37 2016 (r300201) +++ head/sys/netinet6/ip6_output.c Thu May 19 12:45:20 2016 (r300202) @@ -149,10 +149,10 @@ static int ip6_insertfraghdr(struct mbuf static int ip6_insert_jumboopt(struct ip6_exthdrs *, u_int32_t); static int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *); static int ip6_getpmtu(struct route_in6 *, int, - struct ifnet *, struct in6_addr *, u_long *, int *, u_int); + struct ifnet *, const struct in6_addr *, u_long *, int *, u_int); static int ip6_calcmtu(struct ifnet *, const struct in6_addr *, u_long, u_long *, int *); -static int ip6_getpmtu_ctl(u_int, struct in6_addr *, u_long *); +static int ip6_getpmtu_ctl(u_int, const struct in6_addr *, u_long *); static int copypktopts(struct ip6_pktopts *, struct ip6_pktopts *, int); @@ -313,7 +313,7 @@ ip6_output(struct mbuf *m0, struct ip6_p int alwaysfrag, dontfrag; u_int32_t optlen = 0, plen = 0, unfragpartlen = 0; struct ip6_exthdrs exthdrs; - struct in6_addr finaldst, src0, dst0; + struct in6_addr src0, dst0; u_int32_t zone; struct route_in6 *ro_pmtu = NULL; int hdrsplit = 0; @@ -338,7 +338,6 @@ ip6_output(struct mbuf *m0, struct ip6_p } } - finaldst = ip6->ip6_dst; bzero(&exthdrs, sizeof(exthdrs)); if (opt) { /* Hop-by-Hop options header */ @@ -727,8 +726,8 @@ again: *ifpp = ifp; /* Determine path MTU. */ - if ((error = ip6_getpmtu(ro_pmtu, ro != ro_pmtu, ifp, &finaldst, &mtu, - &alwaysfrag, fibnum)) != 0) + if ((error = ip6_getpmtu(ro_pmtu, ro != ro_pmtu, ifp, &ip6->ip6_dst, + &mtu, &alwaysfrag, fibnum)) != 0) goto bad; /* @@ -1239,7 +1238,7 @@ ip6_insertfraghdr(struct mbuf *m0, struc * Returns 0 on success. */ static int -ip6_getpmtu_ctl(u_int fibnum, struct in6_addr *dst, u_long *mtup) +ip6_getpmtu_ctl(u_int fibnum, const struct in6_addr *dst, u_long *mtup) { struct nhop6_extended nh6; struct in6_addr kdst; @@ -1273,7 +1272,7 @@ ip6_getpmtu_ctl(u_int fibnum, struct in6 */ static int ip6_getpmtu(struct route_in6 *ro_pmtu, int do_lookup, - struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, + struct ifnet *ifp, const struct in6_addr *dst, u_long *mtup, int *alwaysfragp, u_int fibnum) { struct nhop6_basic nh6; From owner-svn-src-all@freebsd.org Thu May 19 13:33:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C929FB413A4; Thu, 19 May 2016 13:33:42 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BEC2713A4; Thu, 19 May 2016 13:33:42 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id BDD0B1014; Thu, 19 May 2016 13:33:42 +0000 (UTC) Date: Thu, 19 May 2016 13:33:42 +0000 From: Alexey Dokuchaev To: Pedro Giffuni Cc: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs Message-ID: <20160519133342.GA50840@FreeBSD.org> References: <201605171536.u4HFae3R084696@repo.freebsd.org> <7ba425bb-6dc8-f56f-1353-abd7291cdb5e@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ba425bb-6dc8-f56f-1353-abd7291cdb5e@FreeBSD.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 13:33:42 -0000 On Tue, May 17, 2016 at 11:29:01AM -0500, Pedro Giffuni wrote: > Hello; > > On 05/17/16 10:36, George V. Neville-Neil wrote: > > Author: gnn > > Date: Tue May 17 15:36:40 2016 > > New Revision: 300062 > > URL: https://svnweb.freebsd.org/changeset/base/300062 > > > > Log: > > Kill off ReiserFS as it is no longer supported, for obvious reasons. > > It's not so obvious since the fs worked and could've been useful for > people migrating from ancient linux. And not just that. Simply having ability to boot off Live CD and read some exotic filesystem is cool. What was wrong with ReiserFS, was it broken or something? (NTFS support is another great loss of ours.) ./danfe From owner-svn-src-all@freebsd.org Thu May 19 13:52:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C6DB41C28; Thu, 19 May 2016 13:52:13 +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 C23BF130C; Thu, 19 May 2016 13:52:13 +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 u4JDqCbV075952; Thu, 19 May 2016 13:52:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JDqC3u075951; Thu, 19 May 2016 13:52:12 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605191352.u4JDqC3u075951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 19 May 2016 13:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300205 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 13:52:14 -0000 Author: tuexen Date: Thu May 19 13:52:12 2016 New Revision: 300205 URL: https://svnweb.freebsd.org/changeset/base/300205 Log: Allow writing IP packets of length TUNMRU no matter if TUNSIFHEAD is set or not. Modified: head/sys/net/if_tun.c Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Thu May 19 13:32:44 2016 (r300204) +++ head/sys/net/if_tun.c Thu May 19 13:52:12 2016 (r300205) @@ -848,7 +848,7 @@ tunwrite(struct cdev *dev, struct uio *u struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); struct mbuf *m; - uint32_t family; + uint32_t family, mru; int isr; TUNDEBUG(ifp, "tunwrite\n"); @@ -860,7 +860,10 @@ tunwrite(struct cdev *dev, struct uio *u if (uio->uio_resid == 0) return (0); - if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) { + mru = TUNMRU; + if (tp->tun_flags & TUN_IFHEAD) + mru += sizeof(family); + if (uio->uio_resid < 0 || uio->uio_resid > mru) { TUNDEBUG(ifp, "len=%zd!\n", uio->uio_resid); return (EIO); } From owner-svn-src-all@freebsd.org Thu May 19 14:00:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 343B5B41D49; Thu, 19 May 2016 14:00: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 05E161708; Thu, 19 May 2016 14:00:18 +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 u4JE0IbV076420; Thu, 19 May 2016 14:00:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JE0IqT076419; Thu, 19 May 2016 14:00:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605191400.u4JE0IqT076419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 19 May 2016 14:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300206 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:00:19 -0000 Author: andrew Date: Thu May 19 14:00:18 2016 New Revision: 300206 URL: https://svnweb.freebsd.org/changeset/base/300206 Log: Define PCI_RES_BUS for NEW_PCIB Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/resource.h Modified: head/sys/arm64/include/resource.h ============================================================================== --- head/sys/arm64/include/resource.h Thu May 19 13:52:12 2016 (r300205) +++ head/sys/arm64/include/resource.h Thu May 19 14:00:18 2016 (r300206) @@ -42,5 +42,8 @@ #define SYS_RES_MEMORY 3 /* i/o memory */ #define SYS_RES_IOPORT 4 /* i/o ports */ #define SYS_RES_GPIO 5 /* general purpose i/o */ +#ifdef NEW_PCIB +#define PCI_RES_BUS 6 /* PCI bus numbers */ +#endif #endif /* !_MACHINE_RESOURCE_H_ */ From owner-svn-src-all@freebsd.org Thu May 19 14:08:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 018F5B41F76; Thu, 19 May 2016 14:08:37 +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 98BAD1B9B; Thu, 19 May 2016 14:08:37 +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 u4JE8a0H079396; Thu, 19 May 2016 14:08:36 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JE8aPL079390; Thu, 19 May 2016 14:08:36 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201605191408.u4JE8aPL079390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 19 May 2016 14:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:08:38 -0000 Author: ken Date: Thu May 19 14:08:36 2016 New Revision: 300207 URL: https://svnweb.freebsd.org/changeset/base/300207 Log: Add support for managing Shingled Magnetic Recording (SMR) drives. This change includes support for SCSI SMR drives (which conform to the Zoned Block Commands or ZBC spec) and ATA SMR drives (which conform to the Zoned ATA Command Set or ZAC spec) behind SAS expanders. This includes full management support through the GEOM BIO interface, and through a new userland utility, zonectl(8), and through camcontrol(8). This is now ready for filesystems to use to detect and manage zoned drives. (There is no work in progress that I know of to use this for ZFS or UFS, if anyone is interested, let me know and I may have some suggestions.) Also, improve ATA command passthrough and dispatch support, both via ATA and ATA passthrough over SCSI. Also, add support to camcontrol(8) for the ATA Extended Power Conditions feature set. You can now manage ATA device power states, and set various idle time thresholds for a drive to enter lower power states. Note that this change cannot be MFCed in full, because it depends on changes to the struct bio API that break compatilibity. In order to avoid breaking the stable API, only changes that don't touch or depend on the struct bio changes can be merged. For example, the camcontrol(8) changes don't depend on the new bio API, but zonectl(8) and the probe changes to the da(4) and ada(4) drivers do depend on it. Also note that the SMR changes have not yet been tested with an actual SCSI ZBC device, or a SCSI to ATA translation layer (SAT) that supports ZBC to ZAC translation. I have not yet gotten a suitable drive or SAT layer, so any testing help would be appreciated. These changes have been tested with Seagate Host Aware SATA drives attached to both SAS and SATA controllers. Also, I do not have any SATA Host Managed devices, and I suspect that it may take additional (hopefully minor) changes to support them. Thanks to Seagate for supplying the test hardware and answering questions. sbin/camcontrol/Makefile: Add epc.c and zone.c. sbin/camcontrol/camcontrol.8: Document the zone and epc subcommands. sbin/camcontrol/camcontrol.c: Add the zone and epc subcommands. Add auxiliary register support to build_ata_cmd(). Make sure to set the CAM_ATAIO_NEEDRESULT, CAM_ATAIO_DMA, and CAM_ATAIO_FPDMA flags as appropriate for ATA commands. Add a new get_ata_status() function to parse ATA result from SCSI sense descriptors (for ATA passthrough over SCSI) and ATA I/O requests. sbin/camcontrol/camcontrol.h: Update the build_ata_cmd() prototype Add get_ata_status(), zone(), and epc(). sbin/camcontrol/epc.c: Support for ATA Extended Power Conditions features. This includes support for all features documented in the ACS-4 Revision 12 specification from t13.org (dated February 18, 2016). The EPC feature set allows putting a drive into a power power mode immediately, or setting timeouts so that the drive will automatically enter progressively lower power states after various idle times. sbin/camcontrol/fwdownload.c: Update the firmware download code for the new build_ata_cmd() arguments. sbin/camcontrol/zone.c: Implement support for Shingled Magnetic Recording (SMR) drives via SCSI Zoned Block Commands (ZBC) and ATA Zoned Device ATA Command Set (ZAC). These specs were developed in concert, and are functionally identical. The primary differences are due to SCSI and ATA differences. (SCSI is big endian, ATA is little endian, for example.) This includes support for all commands defined in the ZBC and ZAC specs. sys/cam/ata/ata_all.c: Decode a number of additional ATA command names in ata_op_string(). Add a new CCB building function, ata_read_log(). Add ata_zac_mgmt_in() and ata_zac_mgmt_out() CCB building functions. These support both DMA and NCQ encapsulation. sys/cam/ata/ata_all.h: Add prototypes for ata_read_log(), ata_zac_mgmt_out(), and ata_zac_mgmt_in(). sys/cam/ata/ata_da.c: Revamp the ada(4) driver to support zoned devices. Add four new probe states to gather information needed for zone support. Add a new adasetflags() function to avoid duplication of large blocks of flag setting between the async handler and register functions. Add new sysctl variables that describe zone support and paramters. Add support for the new BIO_ZONE bio, and all of its subcommands: DISK_ZONE_OPEN, DISK_ZONE_CLOSE, DISK_ZONE_FINISH, DISK_ZONE_RWP, DISK_ZONE_REPORT_ZONES, and DISK_ZONE_GET_PARAMS. sys/cam/scsi/scsi_all.c: Add command descriptions for the ZBC IN/OUT commands. Add descriptions for ZBC Host Managed devices. Add a new function, scsi_ata_pass() to do ATA passthrough over SCSI. This will eventually replace scsi_ata_pass_16() -- it can create the 12, 16, and 32-byte variants of the ATA PASS-THROUGH command, and supports setting all of the registers defined as of SAT-4, Revision 5 (March 11, 2016). Change scsi_ata_identify() to use scsi_ata_pass() instead of scsi_ata_pass_16(). Add a new scsi_ata_read_log() function to facilitate reading ATA logs via SCSI. sys/cam/scsi/scsi_all.h: Add the new ATA PASS-THROUGH(32) command CDB. Add extended and variable CDB opcodes. Add Zoned Block Device Characteristics VPD page. Add ATA Return SCSI sense descriptor. Add prototypes for scsi_ata_read_log() and scsi_ata_pass(). sys/cam/scsi/scsi_da.c: Revamp the da(4) driver to support zoned devices. Add five new probe states, four of which are needed for ATA devices. Add five new sysctl variables that describe zone support and parameters. The da(4) driver supports SCSI ZBC devices, as well as ATA ZAC devices when they are attached via a SCSI to ATA Translation (SAT) layer. Since ZBC -> ZAC translation is a new feature in the T10 SAT-4 spec, most SATA drives will be supported via ATA commands sent via the SCSI ATA PASS-THROUGH command. The da(4) driver will prefer the ZBC interface, if it is available, for performance reasons, but will use the ATA PASS-THROUGH interface to the ZAC command set if the SAT layer doesn't support translation yet. As I mentioned above, ZBC command support is untested. Add support for the new BIO_ZONE bio, and all of its subcommands: DISK_ZONE_OPEN, DISK_ZONE_CLOSE, DISK_ZONE_FINISH, DISK_ZONE_RWP, DISK_ZONE_REPORT_ZONES, and DISK_ZONE_GET_PARAMS. Add scsi_zbc_in() and scsi_zbc_out() CCB building functions. Add scsi_ata_zac_mgmt_out() and scsi_ata_zac_mgmt_in() CCB/CDB building functions. Note that these have return values, unlike almost all other CCB building functions in CAM. The reason is that they can fail, depending upon the particular combination of input parameters. The primary failure case is if the user wants NCQ, but fails to specify additional CDB storage. NCQ requires using the 32-byte version of the SCSI ATA PASS-THROUGH command, and the current CAM CDB size is 16 bytes. sys/cam/scsi/scsi_da.h: Add ZBC IN and ZBC OUT CDBs and opcodes. Add SCSI Report Zones data structures. Add scsi_zbc_in(), scsi_zbc_out(), scsi_ata_zac_mgmt_out(), and scsi_ata_zac_mgmt_in() prototypes. sys/dev/ahci/ahci.c: Fix SEND / RECEIVE FPDMA QUEUED in the ahci(4) driver. ahci_setup_fis() previously set the top bits of the sector count register in the FIS to 0 for FPDMA commands. This is okay for read and write, because the PRIO field is in the only thing in those bits, and we don't implement that further up the stack. But, for SEND and RECEIVE FPDMA QUEUED, the subcommand is in that byte, so it needs to be transmitted to the drive. In ahci_setup_fis(), always set the the top 8 bits of the sector count register. We need it in both the standard and NCQ / FPDMA cases. sys/geom/eli/g_eli.c: Pass BIO_ZONE commands through the GELI class. sys/geom/geom.h: Add g_io_zonecmd() prototype. sys/geom/geom_dev.c: Add new DIOCZONECMD ioctl, which allows sending zone commands to disks. sys/geom/geom_disk.c: Add support for BIO_ZONE commands. sys/geom/geom_disk.h: Add a new flag, DISKFLAG_CANZONE, that indicates that a given GEOM disk client can handle BIO_ZONE commands. sys/geom/geom_io.c: Add a new function, g_io_zonecmd(), that handles execution of BIO_ZONE commands. Add permissions check for BIO_ZONE commands. Add command decoding for BIO_ZONE commands. sys/geom/geom_subr.c: Add DDB command decoding for BIO_ZONE commands. sys/kern/subr_devstat.c: Record statistics for REPORT ZONES commands. Note that the number of bytes transferred for REPORT ZONES won't quite match what is received from the harware. This is because we're necessarily counting bytes coming from the da(4) / ada(4) drivers, which are using the disk_zone.h interface to communicate up the stack. The structure sizes it uses are slightly different than the SCSI and ATA structure sizes. sys/sys/ata.h: Add many bit and structure definitions for ZAC, NCQ, and EPC command support. sys/sys/bio.h: Convert the bio_cmd field to a straight enumeration. This will yield more space for additional commands in the future. After change r297955 and other related changes, this is now possible. Converting to an enumeration will also prevent use as a bitmask in the future. sys/sys/disk.h: Define the DIOCZONECMD ioctl. sys/sys/disk_zone.h: Add a new API for managing zoned disks. This is very close to the SCSI ZBC and ATA ZAC standards, but uses integers in native byte order instead of big endian (SCSI) or little endian (ATA) byte arrays. This is intended to offer to the complete feature set of the ZBC and ZAC disk management without requiring the application developer to include SCSI or ATA headers. We also use one set of headers for ioctl consumers and kernel bio-level consumers. sys/sys/param.h: Bump __FreeBSD_version for sys/bio.h command changes, and inclusion of SMR support. usr.sbin/Makefile: Add the zonectl utility. usr.sbin/diskinfo/diskinfo.c Add disk zoning capability to the 'diskinfo -v' output. usr.sbin/zonectl/Makefile: Add zonectl makefile. usr.sbin/zonectl/zonectl.8 zonectl(8) man page. usr.sbin/zonectl/zonectl.c The zonectl(8) utility. This allows managing SCSI or ATA zoned disks via the disk_zone.h API. You can report zones, reset write pointers, get parameters, etc. Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D6147 Reviewed by: wblock (documentation) Added: head/sbin/camcontrol/epc.c (contents, props changed) head/sbin/camcontrol/zone.c (contents, props changed) head/sys/sys/disk_zone.h (contents, props changed) head/usr.sbin/zonectl/ head/usr.sbin/zonectl/Makefile (contents, props changed) head/usr.sbin/zonectl/zonectl.8 (contents, props changed) head/usr.sbin/zonectl/zonectl.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/sbin/camcontrol/fwdownload.c head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_da.h head/sys/dev/ahci/ahci.c head/sys/geom/eli/g_eli.c head/sys/geom/geom.h head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_io.c head/sys/geom/geom_subr.c head/sys/kern/subr_devstat.c head/sys/sys/ata.h head/sys/sys/bio.h head/sys/sys/disk.h head/sys/sys/param.h head/usr.sbin/Makefile head/usr.sbin/diskinfo/diskinfo.c Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Thu May 19 14:00:18 2016 (r300206) +++ head/sbin/camcontrol/Makefile Thu May 19 14:08:36 2016 (r300207) @@ -4,7 +4,7 @@ PACKAGE=runtime PROG= camcontrol SRCS= camcontrol.c util.c .if !defined(RELEASE_CRUNCH) -SRCS+= attrib.c fwdownload.c modeedit.c persist.c progress.c +SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c zone.c .else CFLAGS+= -DMINIMALISTIC .endif Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu May 19 14:00:18 2016 (r300206) +++ head/sbin/camcontrol/camcontrol.8 Thu May 19 14:08:36 2016 (r300207) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2016 +.Dd May 16, 2016 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -323,6 +323,26 @@ .Op Fl N .Op Fl T .Nm +.Ic zone +.Aq Fl c Ar cmd +.Op Fl a +.Op Fl l Ar lba +.Op Fl o Ar rep_opts +.Op Fl P Ar print_opts +.Nm +.Ic epc +.Aq Fl c Ar cmd +.Op Fl d +.Op Fl D +.Op Fl e +.Op Fl H +.Op Fl p Ar power_cond +.Op Fl P +.Op Fl r Ar restore_src +.Op Fl s +.Op Fl S Ar power_src +.Op Fl T Ar timer +.Nm .Ic help .Sh DESCRIPTION The @@ -2052,11 +2072,11 @@ Valid types are: .Dq portal , and .Dq drive . -.El .It Fl V Ar vol_num Specify the number of the logical volume to operate on. If the media has multiple logical volumes, this will allow displaying or writing attributes on the given logical volume. +.El .It Ic opcodes Issue the REPORT SUPPORTED OPCODES service action of the .Tn SCSI @@ -2103,6 +2123,300 @@ for the given command or commands. The timeout values are in seconds. The timeout descriptor also includes a command-specific .El +.It Ic zone +Manage +.Tn SCSI +and +.Tn ATA +Zoned Block devices. +This allows managing devices that conform to the +.Tn SCSI +Zoned Block Commands (ZBC) and +.Tn ATA +Zoned ATA Command Set (ZAC) +specifications. +Devices using these command sets are usually hard drives using Shingled +Magnetic Recording (SMR). +There are three types of SMR drives: +.Bl -tag -width 13n +.It Drive Managed +Drive Managed drives look and act just like a standard random access block +device, but underneath, the drive reads and writes the bulk of its capacity +using SMR zones. +Sequential writes will yield better performance, but writing sequentially +is not required. +.It Host Aware +Host Aware drives expose the underlying zone layout via +.Tn SCSI +or +.Tn ATA +commands and allow the host to manage the zone conditions. +The host is not required to manage the zones on the drive, though. +Sequential writes will yield better performance in Sequential Write +Preferred zones, but the host can write randomly in those zones. +.It Host Managed +Host Managed drives expose the underlying zone layout via +.Tn SCSI +or +.Tn ATA +commands. +The host is required to access the zones according to the rules described +by the zone layout. +Any commands that violate the rules will be returned with an error. +.El +.Pp +SMR drives are divided into zones (typically in the range of 256MB each) +that fall into three general categories: +.Bl -tag -width 20n +.It Conventional +These are also known as Non Write Pointer zones. +These zones can be randomly written without an unexpected performance penalty. +.It Sequential Preferred +These zones should be written sequentially starting at the write pointer +for the zone. +They may be written randomly. +Writes that do not conform to the zone layout may be significantly slower +than expected. +.It Sequential Required +These zones must be written sequentially. +If they are not written sequentially, starting at the write pointer, the +command will fail. +.El +.Pp +.Bl -tag -width 12n +.It Fl c Ar cmd +Specify the zone subcommand: +.Bl -tag -width 6n +.It rz +Issue the Report Zones command. +All zones are returned by default. +Specify report options with +.Fl o +and printing options with +.Fl P . +Specify the starting LBA with +.Fl l . +Note that +.Dq reportzones +is also accepted as a command argument. +.It open +Explicitly open the zone specified by the starting LBA. +.It close +Close the zone specified by starting LBA. +.It finish +Finish the zone specified by the starting LBA. +.It rwp +Reset the write pointer for the zone specified by the starting LBA. +.El +.It Fl a +For the Open, Close, Finish, and Reset Write Pointer operations, apply the +operation to all zones on the drive. +.It Fl l Ar lba +Specify the starting LBA. +For the Report Zones command, this tells the drive to report starting with +the zone that starts at the given LBA. +For the other commands, this allows the user to identify the zone requested +by its starting LBA. +The LBA may be specified in decimal, hexadecimal or octal notation. +.It Fl o Ar rep_opt +For the Report Zones command, specify a subset of zones to report. +.Bl -tag -width 8n +.It all +Report all zones. +This is the default. +.It emtpy +Report only empty zones. +.It imp_open +Report zones that are implicitly open. +This means that the host has sent a write to the zone without explicitly +opening the zone. +.It exp_open +Report zones that are explicitly open. +.It closed +Report zones that have been closed by the host. +.It full +Report zones that are full. +.It ro +Report zones that are in the read only state. +Note that +.Dq readonly +is also accepted as an argument. +.It offline +Report zones that are in the offline state. +.It reset +Report zones where the device recommends resetting write pointers. +.It nonseq +Report zones that have the Non Sequential Resources Active flag set. +These are zones that are Sequential Write Preferred, but have been written +non-sequentially. +.It nonwp +Report Non Write Pointer zones, also known as Conventional zones. +.El +.It Fl P Ar print_opt +Specify a printing option for Report Zones: +.Bl -tag -width 7n +.It normal +Normal Report Zones output. +This is the default. +The summary and column headings are printed, fields are separated by spaces +and the fields themselves may contain spaces. +.It summary +Just print the summary: the number of zones, the maximum LBA (LBA of the +last logical block on the drive), and the value of the +.Dq same +field. +The +.Dq same +field describes whether the zones on the drive are all identical, all +different, or whether they are the same except for the last zone, etc. +.It script +Print the zones in a script friendly format. +The summary and column headings are omitted, the fields are separated by +commas, and the fields do not contain spaces. +The fields contain underscores where spaces would normally be used. +.El +.El +.It Ic epc +Issue +.Tn ATA +Extended Power Conditions (EPC) feature set commands. +This only works on +.Tn ATA +protocol drives, and will not work on +.Tn SCSI +protocol drives. +It will work on +.Tn SATA +drives behind a +.Tn SCSI +to +.Tn ATA +translation layer (SAT). +It may be helpful to read the ATA Command Set - 4 (ACS-4) description of +the Extended Power Conditions feature set, available at t13.org, to +understand the details of this particular +.Nm +subcommand. +.Bl -tag -width 6n +.It Fl c Ar cmd +Specify the epc subcommand +.Bl -tag -width 7n +.It restore +Restore drive power condition settings. +.Bl -tag -width 6n +.It Fl r Ar src +Specify the source for the restored power settings, either +.Dq default +or +.Dq saved . +This argument is required. +.It Fl s +Save the settings. +This only makes sense to specify when restoring from defaults. +.El +.It goto +Go to the specified power condition. +.Bl -tag -width 7n +.It Fl p Ar cond +Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z. +This argument is required. +.It Fl D +Specify delayed entry to the power condition. +The drive, if it supports this, can enter the power condition after the +command completes. +.It Fl H +Hold the power condition. +If the drive supports this option, it will hold the power condition and +reject all commands that would normally cause it to exit that power +condition. +.El +.It timer +Set the timer value for a power condition and enable or disable the +condition. +See the +.Dq list +display described below to see what the current timer settings are for each +Idle and Standby mode supported by the drive. +.Bl -tag -width 8n +.It Fl e +Enable the power condition. +One of +.Fl e +or +.Fl d +is required. +.It Fl d +Disable the power condition. +One of +.Fl d +or +.Fl e +is required. +.It Fl T Ar timer +Specify the timer in seconds. +The user may specify a timer as a floating point number with a maximum +supported resolution of tenths of a second. +Drives may or may not support sub-second timer values. +.It Fl p Ar cond +Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z. +This argument is required. +.It Fl s +Save the timer and power condition enable/disable state. +By default, if this option is not specified, only the current values for +this power condition will be affected. +.El +.It state +Enable or disable a particular power condition. +.Bl -tag -width 7n +.It Fl p Ar cond +Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z. +This argument is required. +.It Fl s +Save the power condition enable/disable state. +By default, if this option is not specified, only the current values for +this power condition will be affected. +.El +.It enable +Enable the Extended Power Condition (EPC) feature set. +.It disable +Disable the Extended Power Condition (EPC) feature set. +.It source +Specify the EPC power source. +.Bl -tag -width 6n +.It Fl S Ar src +Specify the power source, either +.Dq battery +or +.Dq nonbattery . +.El +.It status +Get the current status of several parameters related to the Extended Power +Condition (EPC) feature set, including whether APM and EPC are supported +and enabled, whether Low Power Standby is supported, whether setting the +EPC power source is supported, whether Low Power Standby is supported and +the current power condition. +.Bl -tag -width 3n +.It Fl P +Only report the current power condition. +Some drives will exit their current power condition if a command other than +the +.Tn ATA +CHECK POWER MODE command is received. +If this flag is specified, +.Nm +will only issue the +.Tn ATA +CHECK POWER MODE command to the drive. +.El +.It list +Display the +.Tn ATA +Power Conditions log (Log Address 0x08). +This shows the list of Idle and Standby power conditions the drive +supports, and a number of parameters about each condition, including +whether it is enabled and what the timer value is. +.El +.El .It Ic help Print out verbose usage information. .El @@ -2336,6 +2650,86 @@ This will read and decode the attribute in tape drive sa0, and will display any .Tn SCSI errors that result. +.Pp +.Bd -literal -offset indent +camcontrol zone da0 -v -c rz -P summary +.Ed +.Pp +This will request the SMR zone list from disk da0, and print out a +summary of the zone parameters, and display any +.Tn SCSI +or +.Tn ATA +errors that result. +.Pp +.Bd -literal -offset indent +camcontrol zone da0 -v -c rz -o reset +.Ed +.Pp +This will request the list of SMR zones that should have their write +pointer reset from the disk da0, and display any +.Tn SCSI +or +.Tn ATA +errors that result. +.Pp +.Bd -literal -offset indent +camcontrol zone da0 -v -c rwp -l 0x2c80000 +.Ed +.Pp +This will issue the Reset Write Pointer command to disk da0 for the zone +that starts at LBA 0x2c80000 and display any +.Tn SCSI +or +.Tn ATA +errors that result. +.Pp +.Bd -literal -offset indent +camcontrol epc ada0 -c timer -T 60.1 -p Idle_a -e -s +.Ed +.Pp +Set the timer for the Idle_a power condition on drive +.Pa ada0 +to 60.1 seconds, enable that particular power condition, and save the timer +value and the enabled state of the power condition. +.Pp +.Bd -literal -offset indent +camcontrol epc da4 -c goto -p Standby_z -H +.Ed +.Pp +Tell drive +.Pa da4 +to go to the Standby_z power state (which is +the drive's lowest power state) and hold in that state until it is +explicitly released by another +.Cm goto +command. +.Pp +.Bd -literal -offset indent +camcontrol epc da2 -c status -P +.Ed +.Pp +Report only the power state of +drive +.Pa da2 . +Some drives will power up in response to the commands sent by the +.Pa status +subcommand, and the +.Fl P +option causes +.Nm +to only send the +.Tn ATA +CHECK POWER MODE command, which should not trigger a change in the drive's +power state. +.Pp +.Bd -literal -offset indent +camcontrol epc ada0 -c list +.Ed +.Pp +Display the ATA Power Conditions log (Log Address 0x08) for +drive +.Pa ada0 . .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu May 19 14:00:18 2016 (r300206) +++ head/sbin/camcontrol/camcontrol.c Thu May 19 14:08:36 2016 (r300207) @@ -101,7 +101,9 @@ typedef enum { CAM_CMD_AAM = 0x00000022, CAM_CMD_ATTRIB = 0x00000023, CAM_CMD_OPCODES = 0x00000024, - CAM_CMD_REPROBE = 0x00000025 + CAM_CMD_REPROBE = 0x00000025, + CAM_CMD_ZONE = 0x00000026, + CAM_CMD_EPC = 0x00000027 } cam_cmdmask; typedef enum { @@ -230,6 +232,8 @@ static struct camcontrol_opts option_tab {"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"}, {"attrib", CAM_CMD_ATTRIB, CAM_ARG_NONE, "a:ce:F:p:r:s:T:w:V:"}, {"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:"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -5071,13 +5075,16 @@ bailout: return (retval); } -void +int build_ata_cmd(union ccb *ccb, uint32_t retry_count, uint32_t flags, uint8_t tag_action, uint8_t protocol, uint8_t ata_flags, uint16_t features, - uint16_t sector_count, uint64_t lba, uint8_t command, uint8_t *data_ptr, - uint16_t dxfer_len, uint8_t sense_len, uint32_t timeout, + uint16_t sector_count, uint64_t lba, uint8_t command, uint32_t auxiliary, + uint8_t *data_ptr, uint32_t dxfer_len, uint8_t *cdb_storage, + size_t cdb_storage_len, uint8_t sense_len, uint32_t timeout, int is48bit, camcontrol_devtype devtype) { + int retval = 0; + if (devtype == CC_DT_ATA) { cam_fill_ataio(&ccb->ataio, /*retries*/ retry_count, @@ -5093,11 +5100,24 @@ build_ata_cmd(union ccb *ccb, uint32_t r else ata_28bit_cmd(&ccb->ataio, command, features, lba, sector_count); + + if (auxiliary != 0) { + ccb->ataio.ata_flags |= ATA_FLAG_AUX; + ccb->ataio.aux = auxiliary; + } + + if (ata_flags & AP_FLAG_CHK_COND) + ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; + + if ((protocol & AP_PROTO_MASK) == AP_PROTO_DMA) + ccb->ataio.cmd.flags |= CAM_ATAIO_DMA; + else if ((protocol & AP_PROTO_MASK) == AP_PROTO_FPDMA) + ccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA; } else { if (is48bit || lba > ATA_MAX_28BIT_LBA) protocol |= AP_EXTEND; - scsi_ata_pass_16(&ccb->csio, + retval = scsi_ata_pass(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, /*flags*/ flags, @@ -5108,14 +5128,158 @@ build_ata_cmd(union ccb *ccb, uint32_t r /*sector_count*/ sector_count, /*lba*/ lba, /*command*/ command, + /*device*/ 0, + /*icc*/ 0, + /*auxiliary*/ auxiliary, /*control*/ 0, /*data_ptr*/ data_ptr, /*dxfer_len*/ dxfer_len, + /*cdb_storage*/ cdb_storage, + /*cdb_storage_len*/ cdb_storage_len, + /*minimum_cmd_size*/ 0, /*sense_len*/ sense_len, /*timeout*/ timeout); } + + return (retval); } +int +get_ata_status(struct cam_device *dev, union ccb *ccb, uint8_t *error, + uint16_t *count, uint64_t *lba, uint8_t *device, uint8_t *status) +{ + int retval = 0; + + switch (ccb->ccb_h.func_code) { + case XPT_SCSI_IO: { + uint8_t opcode; + int error_code = 0, sense_key = 0, asc = 0, ascq = 0; + + /* + * In this case, we have SCSI ATA PASS-THROUGH command, 12 + * or 16 byte, and need to see what + */ + if (ccb->ccb_h.flags & CAM_CDB_POINTER) + opcode = ccb->csio.cdb_io.cdb_ptr[0]; + else + opcode = ccb->csio.cdb_io.cdb_bytes[0]; + if ((opcode != ATA_PASS_12) + && (opcode != ATA_PASS_16)) { + retval = 1; + warnx("%s: unsupported opcode %02x", __func__, opcode); + goto bailout; + } + + retval = scsi_extract_sense_ccb(ccb, &error_code, &sense_key, + &asc, &ascq); + /* Note: the _ccb() variant returns 0 for an error */ + if (retval == 0) { + retval = 1; + goto bailout; + } else + retval = 0; + + switch (error_code) { + case SSD_DESC_CURRENT_ERROR: + case SSD_DESC_DEFERRED_ERROR: { + struct scsi_sense_data_desc *sense; + struct scsi_sense_ata_ret_desc *desc; + uint8_t *desc_ptr; + + sense = (struct scsi_sense_data_desc *) + &ccb->csio.sense_data; + + desc_ptr = scsi_find_desc(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, SSD_DESC_ATA); + if (desc_ptr == NULL) { + cam_error_print(dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + retval = 1; + goto bailout; + } + desc = (struct scsi_sense_ata_ret_desc *)desc_ptr; + + *error = desc->error; + *count = (desc->count_15_8 << 8) | + desc->count_7_0; + *lba = ((uint64_t)desc->lba_47_40 << 40) | + ((uint64_t)desc->lba_39_32 << 32) | + (desc->lba_31_24 << 24) | + (desc->lba_23_16 << 16) | + (desc->lba_15_8 << 8) | + desc->lba_7_0; + *device = desc->device; + *status = desc->status; + + /* + * If the extend bit isn't set, the result is for a + * 12-byte ATA PASS-THROUGH command or a 16 or 32 byte + * command without the extend bit set. This means + * that the device is supposed to return 28-bit + * status. The count field is only 8 bits, and the + * LBA field is only 8 bits. + */ + if ((desc->flags & SSD_DESC_ATA_FLAG_EXTEND) == 0){ + *count &= 0xff; + *lba &= 0x0fffffff; + } + break; + } + case SSD_CURRENT_ERROR: + case SSD_DEFERRED_ERROR: { +#if 0 + struct scsi_sense_data_fixed *sense; +#endif + /* + * XXX KDM need to support fixed sense data. + */ + warnx("%s: Fixed sense data not supported yet", + __func__); + retval = 1; + goto bailout; + break; /*NOTREACHED*/ + } + default: + retval = 1; + goto bailout; + break; + } + + break; + } + case XPT_ATA_IO: { + struct ata_res *res; + + /* + * In this case, we have an ATA command, and we need to + * fill in the requested values from the result register + * set. + */ + res = &ccb->ataio.res; + *error = res->error; + *status = res->status; + *device = res->device; + *count = res->sector_count; + *lba = (res->lba_high << 16) | + (res->lba_mid << 8) | + (res->lba_low); + if (res->flags & CAM_ATAIO_48BIT) { + *count |= (res->sector_count_exp << 8); + *lba |= (res->lba_low_exp << 24) | + ((uint64_t)res->lba_mid_exp << 32) | + ((uint64_t)res->lba_high_exp << 40); + } else { + *lba |= (res->device & 0xf) << 24; + } + break; + } + default: + retval = 1; + break; + } +bailout: + return (retval); +} static void cpi_print(struct ccb_pathinq *cpi) @@ -8774,6 +8938,11 @@ usage(int printlong) " [-p part][-s start][-T type][-V vol]\n" " camcontrol opcodes [dev_id][generic args][-o opcode][-s SA]\n" " [-N][-T]\n" +" camcontrol zone [dev_id][generic args]<-c cmd> [-a] [-l LBA]\n" +" [-o rep_opts] [-P print_opts]\n" +" 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" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!printlong) @@ -8816,6 +8985,8 @@ usage(int printlong) "persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n" "attrib send the SCSI READ or WRITE ATTRIBUTE commands\n" "opcodes send the SCSI REPORT SUPPORTED OPCODES command\n" +"zone manage Zoned Block (Shingled) devices\n" +"epc send ATA Extended Power Conditions commands\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -8986,6 +9157,27 @@ usage(int printlong) "-s service_action specify the service action for the opcode\n" "-N do not return SCSI error for unsupported SA\n" "-T request nominal and recommended timeout values\n" +"zone arguments:\n" +"-c cmd required: rz, open, close, finish, or rwp\n" +"-a apply the action to all zones\n" +"-l LBA specify the zone starting LBA\n" +"-o rep_opts report zones options: all, empty, imp_open, exp_open,\n" +" closed, full, ro, offline, reset, nonseq, nonwp\n" +"-P print_opt report zones printing: normal, summary, script\n" +"epc arguments:\n" +"-c cmd required: restore, goto, timer, state, enable, disable,\n" +" source, status, list\n" +"-d disable power mode (timer, state)\n" +"-D delayed entry (goto)\n" +"-e enable power mode (timer, state)\n" +"-H hold power mode (goto)\n" +"-p power_cond Idle_a, Idle_b, Idle_c, Standby_y, Standby_z (timer,\n" +" state, goto)\n" +"-P only display power mode (status)\n" +"-r rst_src restore settings from: default, saved (restore)\n" +"-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" ); #endif /* MINIMALISTIC */ } @@ -9341,7 +9533,14 @@ main(int argc, char **argv) case CAM_CMD_REPROBE: error = scsireprobe(cam_dev); break; - + case CAM_CMD_ZONE: + error = zone(cam_dev, argc, argv, combinedopt, + retry_count, timeout, arglist & CAM_ARG_VERBOSE); + break; + case CAM_CMD_EPC: + error = epc(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 May 19 14:00:18 2016 (r300206) +++ head/sbin/camcontrol/camcontrol.h Thu May 19 14:08:36 2016 (r300207) @@ -63,16 +63,24 @@ int dev_has_vpd_page(struct cam_device * int timeout, int verbosemode); int get_device_type(struct cam_device *dev, int retry_count, int timeout, int verbosemode, camcontrol_devtype *devtype); -void build_ata_cmd(union ccb *ccb, uint32_t retry_count, uint32_t flags, - uint8_t tag_action, uint8_t protocol, uint8_t ata_flags, - uint16_t features, uint16_t sector_count, uint64_t lba, - uint8_t command, uint8_t *data_ptr, uint16_t dxfer_len, - uint8_t sense_len, uint32_t timeout, int is48bit, - camcontrol_devtype devtype); +int build_ata_cmd(union ccb *ccb, uint32_t retry_count, uint32_t flags, + uint8_t tag_action, uint8_t protocol, uint8_t ata_flags, + uint16_t features, uint16_t sector_count, uint64_t lba, + uint8_t command, uint32_t auxiliary, uint8_t *data_ptr, + uint32_t dxfer_len, uint8_t *cdb_storage, + size_t cdb_storage_len, uint8_t sense_len, uint32_t timeout, + int is48bit, camcontrol_devtype devtype); +int get_ata_status(struct cam_device *dev, union ccb *ccb, uint8_t *error, + uint16_t *count, uint64_t *lba, uint8_t *device, + uint8_t *status); int camxferrate(struct cam_device *device); int fwdownload(struct cam_device *device, int argc, char **argv, char *combinedopt, int printerrors, int retry_count, int timeout); +int zone(struct cam_device *device, int argc, char **argv, char *combinedopt, + 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); 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/epc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/camcontrol/epc.c Thu May 19 14:08:36 2016 (r300207) @@ -0,0 +1,857 @@ +/*- + * 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) + */ +/* + * ATA Extended Power Conditions (EPC) support + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "camcontrol.h" + +typedef enum { + EPC_ACTION_NONE = 0x00, + EPC_ACTION_LIST = 0x01, + EPC_ACTION_TIMER_SET = 0x02, + EPC_ACTION_IMMEDIATE = 0x03, + EPC_ACTION_GETMODE = 0x04 +} epc_action; + +static struct scsi_nv epc_flags[] = { + { "Supported", ATA_PCL_COND_SUPPORTED }, + { "Saveable", ATA_PCL_COND_SUPPORTED }, + { "Changeable", ATA_PCL_COND_CHANGEABLE }, + { "Default Timer Enabled", ATA_PCL_DEFAULT_TIMER_EN }, + { "Saved Timer Enabled", ATA_PCL_SAVED_TIMER_EN }, + { "Current Timer Enabled", ATA_PCL_CURRENT_TIMER_EN }, + { "Hold Power Condition Not Supported", ATA_PCL_HOLD_PC_NOT_SUP } +}; + +static struct scsi_nv epc_power_cond_map[] = { + { "Standby_z", ATA_EPC_STANDBY_Z }, + { "z", ATA_EPC_STANDBY_Z }, + { "Standby_y", ATA_EPC_STANDBY_Y }, + { "y", ATA_EPC_STANDBY_Y }, + { "Idle_a", ATA_EPC_IDLE_A }, + { "a", ATA_EPC_IDLE_A }, + { "Idle_b", ATA_EPC_IDLE_B }, + { "b", ATA_EPC_IDLE_B }, + { "Idle_c", ATA_EPC_IDLE_C }, + { "c", ATA_EPC_IDLE_C } +}; + +static struct scsi_nv epc_rst_val[] = { + { "default", ATA_SF_EPC_RST_DFLT }, + { "saved", 0} +}; + +static struct scsi_nv epc_ps_map[] = { + { "unknown", ATA_SF_EPC_SRC_UNKNOWN }, + { "battery", ATA_SF_EPC_SRC_BAT }, + { "notbattery", ATA_SF_EPC_SRC_NOT_BAT } +}; + +/* + * These aren't subcommands of the EPC SET FEATURES subcommand, but rather + * commands that determine the current capabilities and status of the drive. + * The EPC subcommands are limited to 4 bits, so we won't collide with any + * future values. + */ +#define CCTL_EPC_GET_STATUS 0x8001 +#define CCTL_EPC_LIST 0x8002 + +static struct scsi_nv epc_cmd_map[] = { + { "restore", ATA_SF_EPC_RESTORE }, + { "goto", ATA_SF_EPC_GOTO }, + { "timer", ATA_SF_EPC_SET_TIMER }, + { "state", ATA_SF_EPC_SET_STATE }, + { "enable", ATA_SF_EPC_ENABLE }, + { "disable", ATA_SF_EPC_DISABLE }, + { "source", ATA_SF_EPC_SET_SOURCE }, + { "status", CCTL_EPC_GET_STATUS }, + { "list", CCTL_EPC_LIST } +}; + +static int epc_list(struct cam_device *device, camcontrol_devtype devtype, + union ccb *ccb, int retry_count, int timeout); +static void epc_print_pcl_desc(struct ata_power_cond_log_desc *desc, + const char *prefix); +static int epc_getmode(struct cam_device *device, camcontrol_devtype devtype, + union ccb *ccb, int retry_count, int timeout, + int power_only); +static int epc_set_features(struct cam_device *device, + camcontrol_devtype devtype, union ccb *ccb, + int retry_count, int timeout, int action, + int power_cond, int timer, int enable, int save, + int delayed_entry, int hold, int power_src, + int restore_src); + +static void +epc_print_pcl_desc(struct ata_power_cond_log_desc *desc, const char *prefix) +{ + int first; + unsigned int i, num_printed, max_chars; + + first = 1; + max_chars = 75; + + num_printed = printf("%sFlags: ", prefix); + for (i = 0; i < (sizeof(epc_flags) / sizeof(epc_flags[0])); i++) { + if ((desc->flags & epc_flags[i].value) == 0) + continue; + if (first == 0) { + num_printed += printf(", "); + } + if ((num_printed + strlen(epc_flags[i].name)) > max_chars) { + printf("\n"); + num_printed = printf("%s ", prefix); + } + num_printed += printf("%s", epc_flags[i].name); + first = 0; + } + if (first != 0) + printf("None"); + printf("\n"); + + printf("%sDefault timer setting: %.1f sec\n", prefix, + (double)(le32dec(desc->default_timer) / 10)); + printf("%sSaved timer setting: %.1f sec\n", prefix, + (double)(le32dec(desc->saved_timer) / 10)); + printf("%sCurrent timer setting: %.1f sec\n", prefix, + (double)(le32dec(desc->current_timer) / 10)); + printf("%sNominal time to active: %.1f sec\n", prefix, + (double)(le32dec(desc->nom_time_to_active) / 10)); + printf("%sMinimum timer: %.1f sec\n", prefix, + (double)(le32dec(desc->min_timer) / 10)); + printf("%sMaximum timer: %.1f sec\n", prefix, + (double)(le32dec(desc->max_timer) / 10)); + printf("%sNumber of transitions to power condition: %u\n", prefix, + le32dec(desc->num_transitions_to_pc)); + printf("%sHours in power condition: %u\n", prefix, + le32dec(desc->hours_in_pc)); +} + +static int +epc_list(struct cam_device *device, camcontrol_devtype devtype, union ccb *ccb, + int retry_count, int timeout) +{ + struct ata_power_cond_log_idle *idle_log; + struct ata_power_cond_log_standby *standby_log; + uint8_t log_buf[sizeof(*idle_log) + sizeof(*standby_log)]; + uint16_t log_addr = ATA_POWER_COND_LOG; + uint16_t page_number = ATA_PCL_IDLE; + uint64_t lba; + int error = 0; + + lba = (((uint64_t)page_number & 0xff00) << 32) | + ((page_number & 0x00ff) << 8) | + (log_addr & 0xff); + + error = build_ata_cmd(ccb, + /*retry_count*/ retry_count, + /*flags*/ CAM_DIR_IN | CAM_DEV_QFRZDIS, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*protocol*/ AP_PROTO_DMA | AP_EXTEND, + /*ata_flags*/ AP_FLAG_BYT_BLOK_BLOCKS | + AP_FLAG_TLEN_SECT_CNT | + AP_FLAG_TDIR_FROM_DEV, + /*features*/ 0, + /*sector_count*/ 2, + /*lba*/ lba, + /*command*/ ATA_READ_LOG_DMA_EXT, + /*auxiliary*/ 0, + /*data_ptr*/ log_buf, + /*dxfer_len*/ sizeof(log_buf), + /*cdb_storage*/ NULL, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 19 14:14:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77A15B420BD; Thu, 19 May 2016 14:14:28 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 38FD11030; Thu, 19 May 2016 14:14:27 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D44A325D3892; Thu, 19 May 2016 14:14:24 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B6C68D1F8E4; Thu, 19 May 2016 14:14:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ICRSk2pkVZcf; Thu, 19 May 2016 14:14:22 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 90FDFD1F8E3; Thu, 19 May 2016 14:14:21 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys From: "Bjoern A. Zeeb" In-Reply-To: <201605180435.u4I4ZwYh025096@repo.freebsd.org> Date: Thu, 19 May 2016 14:14:19 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> To: Scott Long X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:14:28 -0000 > On 18 May 2016, at 04:35 , Scott Long wrote: > > Author: scottl > Date: Wed May 18 04:35:58 2016 > New Revision: 300113 > URL: https://svnweb.freebsd.org/changeset/base/300113 > > Log: > Import the 'iflib' API library for network drivers. From the author: > > "iflib is a library to eliminate the need for frequently duplicated device > independent logic propagated (poorly) across many network drivers." > > Participation is purely optional. The IFLIB kernel config option is > provided for drivers that want to transition between legacy and iflib > modes of operation. ixl and ixgbe driver conversions will be committed > shortly. We hope to see participation from the Broadcom and maybe > Chelsio drivers in the near future. > > Submitted by: mmacy@nextbsd.org > Reviewed by: gallatin > Differential Revision: D5211 Can someone explain to me why I am seeing this now and what it means? taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0 Thanks From owner-svn-src-all@freebsd.org Thu May 19 14:19:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC85AB4217D; Thu, 19 May 2016 14:19:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E14D14C7; Thu, 19 May 2016 14:19:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JEJ1Gr082689; Thu, 19 May 2016 14:19:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JEJ1N9082688; Thu, 19 May 2016 14:19:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605191419.u4JEJ1N9082688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 19 May 2016 14:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300208 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:19:02 -0000 Author: bz Date: Thu May 19 14:19:01 2016 New Revision: 300208 URL: https://svnweb.freebsd.org/changeset/base/300208 Log: Exclude BCM from universe build until it compiles again. Modified: head/sys/mips/conf/BCM Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Thu May 19 14:08:36 2016 (r300207) +++ head/sys/mips/conf/BCM Thu May 19 14:19:01 2016 (r300208) @@ -5,6 +5,8 @@ # used in COTS hardware including the ASUS RT-N12, RT-N16, RT-N53. # +#NO_UNIVERSE + ident BCM hints "BCM.hints" From owner-svn-src-all@freebsd.org Thu May 19 14:27:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923FBB42315; Thu, 19 May 2016 14:27:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 7418C1A8D; Thu, 19 May 2016 14:27:31 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 8363CB94C; Thu, 19 May 2016 10:27:30 -0400 (EDT) From: John Baldwin To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300206 - head/sys/arm64/include Date: Thu, 19 May 2016 07:22:51 -0700 Message-ID: <37577822.faQWTsG4jO@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605191400.u4JE0IqT076419@repo.freebsd.org> References: <201605191400.u4JE0IqT076419@repo.freebsd.org> 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.2.7 (bigwig.baldwin.cx); Thu, 19 May 2016 10:27:30 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:27:31 -0000 On Thursday, May 19, 2016 02:00:18 PM Andrew Turner wrote: > Author: andrew > Date: Thu May 19 14:00:18 2016 > New Revision: 300206 > URL: https://svnweb.freebsd.org/changeset/base/300206 > > Log: > Define PCI_RES_BUS for NEW_PCIB > > Obtained from: ABT Systems Ltd > Sponsored by: The FreeBSD Foundation Does it work? :) You'd need to handle it explicitly in non-ACPI Host-PCI bridge drivers. -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 19 14:30:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596D7B42459 for ; Thu, 19 May 2016 14:30:41 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F8101CBD for ; Thu, 19 May 2016 14:30:40 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C91922076C for ; Thu, 19 May 2016 10:30:39 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Thu, 19 May 2016 10:30:39 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=PZXIDoSUjWcOYfIM0eCJi6wka7Q=; b=k0MUw4 U5S6vMNcfFRN0A7eTnNS4lP9Tt2cciv/WJHBBceD8g5ByGfokti+D3iW0Dq1hXwZ tLSvTKJ2dPiMLSl293M4l8+leG1TjFO198I8I0G4OyYzyMcSMDSB6avxqT/T7vvh bzsnjIl9iFPv884KluMbkghw+n4H9NOf37rmc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=PZXIDoSUjWcOYfI M0eCJi6wka7Q=; b=An2LoRPuTJF8pj8SE9WNP17GY8QleyzMO0zROy4Fj2w6bkU uZaQ7dzHCFYm7XWxVQdsh797YJrxFiEV9WHEm8FARs6FweXxBB1vgo2rPIx1dBwk qkV9jwcCSOtoMgCWupFhlhvZ9zUcy6iq5MNBOS7tbcRjLBGdF951JoFt3IJc= X-Sasl-enc: WL2eq7k6cLSEzs+dJK0Q35aSEnQlhAS3Vq4wdQ2xgqEm 1463668239 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id A8AAC6801A6; Thu, 19 May 2016 10:30:38 -0400 (EDT) Subject: Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl To: "Kenneth D. Merry" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605191408.u4JE8aPL079390@repo.freebsd.org> From: Bruce Simpson Message-ID: <573DCE0D.70400@fastmail.net> Date: Thu, 19 May 2016 15:30:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201605191408.u4JE8aPL079390@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:30:41 -0000 Right On Commander! Now here is hoping the random-write issues with OpenZFS are solved... From owner-svn-src-all@freebsd.org Thu May 19 14:37:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20C2FB425E8; Thu, 19 May 2016 14:37:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E44AB12D5; Thu, 19 May 2016 14:37:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JEbPil088670; Thu, 19 May 2016 14:37:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JEbPf4088669; Thu, 19 May 2016 14:37:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605191437.u4JEbPf4088669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 19 May 2016 14:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300209 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:37:26 -0000 Author: trasz Date: Thu May 19 14:37:24 2016 New Revision: 300209 URL: https://svnweb.freebsd.org/changeset/base/300209 Log: Make it possible to interrupt proxy-mode iscsid receive. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu May 19 14:19:01 2016 (r300208) +++ head/sys/dev/iscsi/iscsi.c Thu May 19 14:37:24 2016 (r300209) @@ -1634,6 +1634,7 @@ iscsi_ioctl_daemon_receive(struct iscsi_ struct iscsi_session *is; struct icl_pdu *ip; void *data; + int error; sx_slock(&sc->sc_lock); TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { @@ -1652,8 +1653,13 @@ iscsi_ioctl_daemon_receive(struct iscsi_ ISCSI_SESSION_LOCK(is); while (is->is_login_pdu == NULL && is->is_terminating == false && - is->is_reconnecting == false) - cv_wait(&is->is_login_cv, &is->is_lock); + is->is_reconnecting == false) { + error = cv_wait_sig(&is->is_login_cv, &is->is_lock); + if (error != 0) { + ISCSI_SESSION_UNLOCK(is); + return (error); + } + } if (is->is_terminating || is->is_reconnecting) { ISCSI_SESSION_UNLOCK(is); return (EIO); From owner-svn-src-all@freebsd.org Thu May 19 14:43:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 361A7B42887; Thu, 19 May 2016 14:43:05 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 06FD318B8; Thu, 19 May 2016 14:43:04 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 4DA9FD78FE; Thu, 19 May 2016 14:43:03 +0000 (UTC) Date: Thu, 19 May 2016 15:43:01 +0100 From: Andrew Turner To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300206 - head/sys/arm64/include Message-ID: <20160519154301.294c761c@zapp> In-Reply-To: <37577822.faQWTsG4jO@ralph.baldwin.cx> References: <201605191400.u4JE0IqT076419@repo.freebsd.org> <37577822.faQWTsG4jO@ralph.baldwin.cx> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:43:05 -0000 On Thu, 19 May 2016 07:22:51 -0700 John Baldwin wrote: > On Thursday, May 19, 2016 02:00:18 PM Andrew Turner wrote: > > Author: andrew > > Date: Thu May 19 14:00:18 2016 > > New Revision: 300206 > > URL: https://svnweb.freebsd.org/changeset/base/300206 > > > > Log: > > Define PCI_RES_BUS for NEW_PCIB > > > > Obtained from: ABT Systems Ltd > > Sponsored by: The FreeBSD Foundation > > Does it work? :) You'd need to handle it explicitly in non-ACPI > Host-PCI bridge drivers. > See https://reviews.freebsd.org/D6453 for the review. Andrew From owner-svn-src-all@freebsd.org Thu May 19 14:45:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C894CB42913; Thu, 19 May 2016 14:45:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3191AC3; Thu, 19 May 2016 14:45:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JEjY73091891; Thu, 19 May 2016 14:45:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JEjYrx091890; Thu, 19 May 2016 14:45:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605191445.u4JEjYrx091890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 19 May 2016 14:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300210 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:45:35 -0000 Author: trasz Date: Thu May 19 14:45:34 2016 New Revision: 300210 URL: https://svnweb.freebsd.org/changeset/base/300210 Log: Fix error message. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/discovery.c Modified: head/usr.sbin/ctld/discovery.c ============================================================================== --- head/usr.sbin/ctld/discovery.c Thu May 19 14:37:24 2016 (r300209) +++ head/usr.sbin/ctld/discovery.c Thu May 19 14:45:34 2016 (r300210) @@ -69,7 +69,7 @@ text_receive(struct connection *conn) "was %u, is %u", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn)); } if (ntohl(bhstr->bhstr_expstatsn) != conn->conn_statsn) { - log_errx(1, "received Text PDU with wrong StatSN: " + log_errx(1, "received Text PDU with wrong ExpStatSN: " "is %u, should be %u", ntohl(bhstr->bhstr_expstatsn), conn->conn_statsn); } @@ -127,7 +127,7 @@ logout_receive(struct connection *conn) ntohl(bhslr->bhslr_cmdsn)); } if (ntohl(bhslr->bhslr_expstatsn) != conn->conn_statsn) { - log_errx(1, "received Logout PDU with wrong StatSN: " + log_errx(1, "received Logout PDU with wrong ExpStatSN: " "is %u, should be %u", ntohl(bhslr->bhslr_expstatsn), conn->conn_statsn); } From owner-svn-src-all@freebsd.org Thu May 19 14:52:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89B44B42B7A; Thu, 19 May 2016 14:52:46 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (mithlond.kdm.org [96.89.93.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "A1-33714", Issuer "A1-33714" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 53FD710B9; Thu, 19 May 2016 14:52:46 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.15.2/8.14.9) with ESMTPS id u4JEoXct069382 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 May 2016 10:50:33 -0400 (EDT) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.15.2/8.14.9/Submit) id u4JEoXGl069381; Thu, 19 May 2016 10:50:33 -0400 (EDT) (envelope-from ken) Date: Thu, 19 May 2016 10:50:33 -0400 From: "Kenneth D. Merry" To: Bruce Simpson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl Message-ID: <20160519145033.GA69089@mithlond.kdm.org> References: <201605191408.u4JE8aPL079390@repo.freebsd.org> <573DCE0D.70400@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <573DCE0D.70400@fastmail.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Thu, 19 May 2016 10:50:33 -0400 (EDT) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mithlond.kdm.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:52:46 -0000 On Thu, May 19, 2016 at 15:30:37 +0100, Bruce Simpson wrote: > Right On Commander! > > Now here is hoping the random-write issues with OpenZFS are solved... Well, this is of course only the underlying infrastructure for SMR drives. As for the random write issues with ZFS (or rather sequential I/O going out in random order), we (Spectra) are working on that in general. The original plan was to do full SMR support for ZFS, but it looks like we may get good enough write performance with Drive Managed drives by just making writes from ZFS to drives more sequential rather than going for full Host Aware and Host Managed support. If that turns out that performance isn't good enough after all, then we'll have to put in the effort to put Host Aware support at least into ZFS. That's why I said (in the commit message) that I don't know of anyone working on using the SMR infrastructure for UFS or ZFS. Now that the plumbing is in place in CAM and GEOM, it is possible at the filesystem level if someone wants to do the work. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@freebsd.org Thu May 19 14:57:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76878B42C9A; Thu, 19 May 2016 14:57:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47D6813D0; Thu, 19 May 2016 14:57:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JEvb4N095086; Thu, 19 May 2016 14:57:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JEvbXV095085; Thu, 19 May 2016 14:57:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605191457.u4JEvbXV095085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 19 May 2016 14:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300211 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:57:38 -0000 Author: trasz Date: Thu May 19 14:57:37 2016 New Revision: 300211 URL: https://svnweb.freebsd.org/changeset/base/300211 Log: Make ICL proxy use kernel code for handling iSCSI sequence numbers for PDUs to/from iscsid(8). This fixes StatSN for Logout PDUs sent by iscsi_session_logout(). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu May 19 14:45:34 2016 (r300210) +++ head/sys/dev/iscsi/iscsi.c Thu May 19 14:57:37 2016 (r300211) @@ -713,6 +713,8 @@ iscsi_receive_callback(struct icl_pdu *r ISCSI_SESSION_LOCK(is); + iscsi_pdu_update_statsn(response); + #ifdef ICL_KERNEL_PROXY if (is->is_login_phase) { if (is->is_login_pdu == NULL) @@ -725,8 +727,6 @@ iscsi_receive_callback(struct icl_pdu *r } #endif - iscsi_pdu_update_statsn(response); - /* * The handling routine is responsible for freeing the PDU * when it's no longer needed. @@ -1620,9 +1620,7 @@ iscsi_ioctl_daemon_send(struct iscsi_sof KASSERT(error == 0, ("icl_pdu_append_data(..., M_WAITOK) failed")); free(data, M_ISCSI); } - ISCSI_SESSION_LOCK(is); - icl_pdu_queue(ip); - ISCSI_SESSION_UNLOCK(is); + iscsi_pdu_queue(ip); return (0); } From owner-svn-src-all@freebsd.org Thu May 19 14:59:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26487B42D1F; Thu, 19 May 2016 14:59:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E489A16D1; Thu, 19 May 2016 14:59:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JExMX5095184; Thu, 19 May 2016 14:59:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JExM46095183; Thu, 19 May 2016 14:59:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605191459.u4JExM46095183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 19 May 2016 14:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300212 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:59:23 -0000 Author: trasz Date: Thu May 19 14:59:21 2016 New Revision: 300212 URL: https://svnweb.freebsd.org/changeset/base/300212 Log: When iscsid(8) is running in ICL proxy mode, don't try to send Logout PDUs. The kernel already does this for us when we ask it to terminate the session. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/discovery.c Modified: head/usr.sbin/iscsid/discovery.c ============================================================================== --- head/usr.sbin/iscsid/discovery.c Thu May 19 14:57:37 2016 (r300211) +++ head/usr.sbin/iscsid/discovery.c Thu May 19 14:59:21 2016 (r300212) @@ -206,6 +206,18 @@ discovery(struct connection *conn) log_debugx("removing temporary discovery session"); kernel_remove(conn); +#ifdef ICL_KERNEL_PROXY + if (conn->conn_conf.isc_iser == 1) { + /* + * If we're going through the proxy, the kernel already + * sent Logout PDU for us and destroyed the session, + * so we can't send anything anymore. + */ + log_debugx("discovery session done"); + return; + } +#endif + log_debugx("discovery done; logging out"); request = logout_new_request(conn); pdu_send(request); From owner-svn-src-all@freebsd.org Thu May 19 15:54:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E4FB41B9D; Thu, 19 May 2016 15:54:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::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 778741301; Thu, 19 May 2016 15:54:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x230.google.com with SMTP id t40so20413165ioi.0; Thu, 19 May 2016 08:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=y/VdJnm9rjTaw7YsxvBI9RjzLJDy6rhSL55X6Mo5R7I=; b=S3JF1H024lccqsPWtdOQkLjJRuNzg+jNHyRElBcMk7bnZ7vEHbw3e1gw94F4rQeVBz Ob4Jr3j6h/rSBMcHDcEcEesx0RpOu+24HeFel0Oqnz8BKnWmsSz0G/28Y1o7+eFV2+4K MGBFF0kXqR4Ecj09tM4y8Y+qM+qXtGj7+s+cM7jbH98gp4GtcKG0e93AXU5m5fKDQkww TNwjbYSg3M3DpFbataf1JZ43JJU3nPJ7GBs5sR3LWyLFP8Is0aJoKKiHsTDmA1YuIXNX ZK4EnYe6v4pT0q7moWD5RW1Gl1jYW6NYw/bzdvVdtoGWyx4iwrAVlgWcEI6O6a1k5vGq IXXw== 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:date :message-id:subject:from:to:cc; bh=y/VdJnm9rjTaw7YsxvBI9RjzLJDy6rhSL55X6Mo5R7I=; b=dFlvPorayJWuLG5RYduNLEmn0EHz+sb4UZvMFpDj7jXe+48GfCjiRxOiysnxGGlsXs m4WV3RYaknG/vScc38VoWY9mmu0YWvKSO69DZ8IuVbihAIr0Kt/a7Pk+3xxTwIFT0z2b EZPPG5fUBRh7oLTLiW4YhgW3/1j+miIbjpZq4VrIiKdWzXb/NQOtrbzWAiwJnSafUn3U EcqJxQUU6VOEAl3xgeOZzEgJrlB5NpMQYVoAG7qkSVtyGOWlPL1F9RMm6+0qLBixo6wW BfAeREC8hXLvlP6/LSoAztwtBvjiIC6Bydnk0GSBB2dkGqeych8/3gVSKBEBCrTzJFji W44A== X-Gm-Message-State: AOPr4FVRXJE7f2Cd15VF6iNErKQ4uu4vU7NznZhJoxhi5GVVAdWP3M5N1u/AzuH0RRnP3P+miLSr2a6YHwY5Eg== MIME-Version: 1.0 X-Received: by 10.36.83.65 with SMTP id n62mr3322709itb.71.1463673268726; Thu, 19 May 2016 08:54:28 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Thu, 19 May 2016 08:54:28 -0700 (PDT) In-Reply-To: <20160519145033.GA69089@mithlond.kdm.org> References: <201605191408.u4JE8aPL079390@repo.freebsd.org> <573DCE0D.70400@fastmail.net> <20160519145033.GA69089@mithlond.kdm.org> Date: Thu, 19 May 2016 08:54:28 -0700 Message-ID: Subject: Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl From: Adrian Chadd To: "Kenneth D. Merry" Cc: Bruce Simpson , "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 15:54:29 -0000 On 19 May 2016 at 07:50, Kenneth D. Merry wrote: > On Thu, May 19, 2016 at 15:30:37 +0100, Bruce Simpson wrote: >> Right On Commander! >> >> Now here is hoping the random-write issues with OpenZFS are solved... > > Well, this is of course only the underlying infrastructure for SMR drives. > > As for the random write issues with ZFS (or rather sequential I/O going out > in random order), we (Spectra) are working on that in general. > > The original plan was to do full SMR support for ZFS, but it looks like we > may get good enough write performance with Drive Managed drives by just > making writes from ZFS to drives more sequential rather than going for full > Host Aware and Host Managed support. If that turns out that performance > isn't good enough after all, then we'll have to put in the effort to put > Host Aware support at least into ZFS. > > That's why I said (in the commit message) that I don't know of anyone > working on using the SMR infrastructure for UFS or ZFS. Now that the > plumbing is in place in CAM and GEOM, it is possible at the filesystem > level if someone wants to do the work. Is it possible to use this from userland for now? Ie, probe whatever we need to in order to understand the transaction geometries (ie, the optimal sizes for reading/writing, etc) and then issue IOs that are in line with this? -adrian From owner-svn-src-all@freebsd.org Thu May 19 16:00:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53C2EB41CCE; Thu, 19 May 2016 16:00:14 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com [IPv6:2607:f8b0:4003:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 154F51705; Thu, 19 May 2016 16:00:14 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22e.google.com with SMTP id x19so135851365oix.2; Thu, 19 May 2016 09:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=ElUFEXoL85Uzzx4/ET7e9eWTQZCP/2Aofi4/K9ASNtg=; b=VPqIk2PpRRDzW3Evf+J8aF5ykPIxqiTtaki3EOL6OqkZUrOu1vxE95rjnhz2pIvoWt nccZDvZkYfsK2ZtqGGZd7EyZxYnmEMS9fLoWF2MYT7oUUh9JwFfcVgxF2uVvKU9g0A9r jyoyM47c+5l8G16m+bH6w0zSxc4nDlhKM0sa3uceWXkUxC/XEc/l3SGOkb/nGuNTdNbt x239jgPOc/8zmYpTKwE/pCYb0jOX30q09gFEEIEB/8U6W1ewfBTa25RYRYhSwMS8nx74 4YGS1WqovqqVcKTFIZJ4RUgErozYTd0mU7hYLSuyUehBpL+rfyWZm1kKlO55oPA4EdBm j/1A== 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:date :message-id:subject:from:to:cc; bh=ElUFEXoL85Uzzx4/ET7e9eWTQZCP/2Aofi4/K9ASNtg=; b=VhrTE8IYQ64a0leqLIPXJM+PGfaCU5TiY7uuYMGMWWMRT+m6qZxKEcgFqhPV3Z9gBa uAj6lUFONXg5zLVJN7PDJGfv9rEr+I5E6oi2RB85rlmjZNzUCmMsQEmiLVHpVu/E79O5 BVxjHqPqS3m0EaQDZ+fowzhDG6+oaATN4vgppltIxTeb4btmAP2a3xPVy0d9jcGJ+82F Y8TkYpM0GOmDesco3biKhHuGrBnwOz/NfxZ2UuH0BdDb8jUG8eX7BETLgngBS/w+y+ht L+5+OzVZ9hymindXF1TwfT6Wluk+BSbYE4S/4tPVkUALultLkpG2EAtSR84kqsdso/U0 OUiA== X-Gm-Message-State: AOPr4FVOP7VUT/ABRP+h9QMUOk3+/ofUZdeWGu7lzWJSfa2dhuDXlzIjxnJ4KjWcY3DP5hcJbfRkLvwSPhSEdw== MIME-Version: 1.0 X-Received: by 10.157.43.3 with SMTP id o3mr3025901otb.10.1463673613252; Thu, 19 May 2016 09:00:13 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Thu, 19 May 2016 09:00:13 -0700 (PDT) In-Reply-To: References: <201605191408.u4JE8aPL079390@repo.freebsd.org> <573DCE0D.70400@fastmail.net> <20160519145033.GA69089@mithlond.kdm.org> Date: Thu, 19 May 2016 10:00:13 -0600 X-Google-Sender-Auth: tGRJWeYCpnWuRiHvCPar9FdIU7Q Message-ID: Subject: Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl From: Alan Somers To: Adrian Chadd Cc: "Kenneth D. Merry" , Bruce Simpson , "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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 16:00:14 -0000 On Thu, May 19, 2016 at 9:54 AM, Adrian Chadd wrote: > On 19 May 2016 at 07:50, Kenneth D. Merry wrote: > > On Thu, May 19, 2016 at 15:30:37 +0100, Bruce Simpson wrote: > >> Right On Commander! > >> > >> Now here is hoping the random-write issues with OpenZFS are solved... > > > > Well, this is of course only the underlying infrastructure for SMR > drives. > > > > As for the random write issues with ZFS (or rather sequential I/O going > out > > in random order), we (Spectra) are working on that in general. > > > > The original plan was to do full SMR support for ZFS, but it looks like > we > > may get good enough write performance with Drive Managed drives by just > > making writes from ZFS to drives more sequential rather than going for > full > > Host Aware and Host Managed support. If that turns out that performance > > isn't good enough after all, then we'll have to put in the effort to put > > Host Aware support at least into ZFS. > > > > That's why I said (in the commit message) that I don't know of anyone > > working on using the SMR infrastructure for UFS or ZFS. Now that the > > plumbing is in place in CAM and GEOM, it is possible at the filesystem > > level if someone wants to do the work. > > Is it possible to use this from userland for now? Ie, probe whatever > we need to in order to understand the transaction geometries (ie, the > optimal sizes for reading/writing, etc) and then issue IOs that are in > line with this? > > > > -adrian > > Sure. You can do all that with zonectl or its ioctls, if you have a userland program that writes to raw block devices. Reset Write Pointer is supported, too. -Alan From owner-svn-src-all@freebsd.org Thu May 19 16:02:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDBE5B41E93; Thu, 19 May 2016 16:02:03 +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 989B31AF4; Thu, 19 May 2016 16:02:03 +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 u4JG22YT015616; Thu, 19 May 2016 16:02:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JG22Fi015615; Thu, 19 May 2016 16:02:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605191602.u4JG22Fi015615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 19 May 2016 16:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300213 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 16:02:03 -0000 Author: pfg Date: Thu May 19 16:02:02 2016 New Revision: 300213 URL: https://svnweb.freebsd.org/changeset/base/300213 Log: sys/vmmeter.h: "desperate" spelling fix. Modified: head/sys/sys/vmmeter.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Thu May 19 14:59:21 2016 (r300212) +++ head/sys/sys/vmmeter.h Thu May 19 16:02:02 2016 (r300213) @@ -141,7 +141,7 @@ vm_page_count_severe(void) * we can execute potentially very expensive code in terms of memory. It * is also used by the pageout daemon to calculate when to sleep, when * to wake waiters up, and when (after making a pass) to become more - * desparate. + * desperate. */ static __inline From owner-svn-src-all@freebsd.org Thu May 19 16:04:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1151B41F6F; Thu, 19 May 2016 16:04:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58A961D85; Thu, 19 May 2016 16:04:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JG4Kut016358; Thu, 19 May 2016 16:04:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JG4KpV016356; Thu, 19 May 2016 16:04:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605191604.u4JG4KpV016356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 19 May 2016 16:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300214 - in stable/10: sbin/devd sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 16:04:21 -0000 Author: asomers Date: Thu May 19 16:04:20 2016 New Revision: 300214 URL: https://svnweb.freebsd.org/changeset/base/300214 Log: MFC r298420, r298439, r298644 r298420 | asomers | 2016-04-21 10:43:15 -0600 (Thu, 21 Apr 2016) | 10 lines Notify userspace listeners when geom disk attributes have changed sys/geom/geom_disk.c: disk_attr_changed(): Generate a devctl event of type GEOM: for every call. r298439 | asomers | 2016-04-21 15:13:41 -0600 (Thu, 21 Apr 2016) | 10 lines DRY on buffer sizes. Update to r298420. sys/geom/geom_disk.c: In disk_attr_changed, don't repeat a buffer size. r298644 | asomers | 2016-04-26 08:48:58 -0600 (Tue, 26 Apr 2016) | 8 lines Add GEOM::physpath documentation to devd.conf(5) Modified: stable/10/sbin/devd/devd.conf.5 stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.conf.5 ============================================================================== --- stable/10/sbin/devd/devd.conf.5 Thu May 19 16:02:02 2016 (r300213) +++ stable/10/sbin/devd/devd.conf.5 Thu May 19 16:04:20 2016 (r300214) @@ -424,6 +424,8 @@ device node is created. A .Xr geom 4 device node is destroyed. +.It Li GEOM::physpath +The physical path of a device has changed. .It Li MEDIACHANGE Physical media has changed. .El Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Thu May 19 16:02:02 2016 (r300213) +++ stable/10/sys/geom/geom_disk.c Thu May 19 16:04:20 2016 (r300214) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -861,11 +862,15 @@ disk_attr_changed(struct disk *dp, const { struct g_geom *gp; struct g_provider *pp; + char devnamebuf[128]; gp = dp->d_geom; if (gp != NULL) LIST_FOREACH(pp, &gp->provider, provider) (void)g_attr_changed(pp, attr, flag); + snprintf(devnamebuf, sizeof(devnamebuf), "devname=%s%d", dp->d_name, + dp->d_unit); + devctl_notify("GEOM", "disk", attr, devnamebuf); } void From owner-svn-src-all@freebsd.org Thu May 19 16:28:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14B90B4249D; Thu, 19 May 2016 16:28:07 +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 DB3151A18; Thu, 19 May 2016 16:28:06 +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 u4JGS6vA022389; Thu, 19 May 2016 16:28:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JGS6RI022388; Thu, 19 May 2016 16:28:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605191628.u4JGS6RI022388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 19 May 2016 16:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300215 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 16:28:07 -0000 Author: pfg Date: Thu May 19 16:28:05 2016 New Revision: 300215 URL: https://svnweb.freebsd.org/changeset/base/300215 Log: sys/net: more spelling. Modified: head/sys/net/mp_ring.c Modified: head/sys/net/mp_ring.c ============================================================================== --- head/sys/net/mp_ring.c Thu May 19 16:04:20 2016 (r300214) +++ head/sys/net/mp_ring.c Thu May 19 16:28:05 2016 (r300215) @@ -358,7 +358,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, v /* * Wait for other producers who got in ahead of us to enqueue their * items, one producer at a time. It is our turn when the ring's - * pidx_tail reaches the begining of our reservation (pidx_start). + * pidx_tail reaches the beginning of our reservation (pidx_start). */ while (ns.pidx_tail != pidx_start) { cpu_spinwait(); @@ -432,7 +432,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, v /* * Wait for other producers who got in ahead of us to enqueue their * items, one producer at a time. It is our turn when the ring's - * pidx_tail reaches the begining of our reservation (pidx_start). + * pidx_tail reaches the beginning of our reservation (pidx_start). */ while (ns.pidx_tail != pidx_start) { cpu_spinwait(); From owner-svn-src-all@freebsd.org Thu May 19 16:36:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9C20B42981; Thu, 19 May 2016 16:36:07 +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 9730312EF; Thu, 19 May 2016 16:36:07 +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 u4JGa6AX025310; Thu, 19 May 2016 16:36:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JGa6xE025309; Thu, 19 May 2016 16:36:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605191636.u4JGa6xE025309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 19 May 2016 16:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300216 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 16:36:07 -0000 Author: imp Date: Thu May 19 16:36:06 2016 New Revision: 300216 URL: https://svnweb.freebsd.org/changeset/base/300216 Log: Fix logic error so UEFI variables are reported correctly without error at the end. Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Thu May 19 16:28:05 2016 (r300215) +++ head/sys/boot/efi/loader/main.c Thu May 19 16:36:06 2016 (r300216) @@ -891,24 +891,26 @@ command_efi_printenv(int argc, char *arg */ varsz = nitems(varname); varname[0] = 0; - status = RS->GetNextVariableName(&varsz, varname, &varguid); - while (status != EFI_NOT_FOUND) { - status = RS->GetNextVariableName(&varsz, varname, - &varguid); + while ((status = RS->GetNextVariableName(&varsz, varname, &varguid)) != + EFI_NOT_FOUND) { if (aflag) { if (efi_print_var(varname, &varguid, lflag) != CMD_OK) break; continue; } if (vflag) { - if (wcscmp(varnamearg, varname) == 0) + if (wcscmp(varnamearg, varname) == 0) { if (efi_print_var(varname, &varguid, lflag) != CMD_OK) break; + continue; + } } if (gflag) { - if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) + if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) { if (efi_print_var(varname, &varguid, lflag) != CMD_OK) break; + continue; + } } } pager_close(); From owner-svn-src-all@freebsd.org Thu May 19 16:36:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A53B42A3E for ; Thu, 19 May 2016 16:36:53 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm6-vm2.bullet.mail.gq1.yahoo.com (nm6-vm2.bullet.mail.gq1.yahoo.com [98.136.218.193]) (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 E43D816B4 for ; Thu, 19 May 2016 16:36:52 +0000 (UTC) (envelope-from scott4long@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463674995; bh=yYem7rVxpLjQcza5d4RzPmmk/yOsl7hUyOw8/8sdz0A=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=uS1SWAHx7THqZqB2jAtT7ogxcXNHhGRoMmHfN0wfP83h+r0iSfPie2d4MNPiqDLC4ZYLu2YWHsFO/mX+Wtu/f7dcwgJLWK5tpYFxL1nOhLePLfuDTNMBfYulh+1+Of8FzS2CuL9T0OGU/C9dSVRg2Wt9ZjZK7mN4o7/l1Nc2kFVcRfSIuj+b0vD9DVt5UsqZtmX0PlJ4OvEXxO8l31BYQ+OGij4/Je/5p4n6fBnxNJe9o6GTMdAlwjF2GoPsNROc4l8/sAIpVNtspnzcv1nlADwmegCU39280lvIz19N/C9T+fCvxz14Qn2J0ZJwbEefu5652m+oTszS3vOgAVPyZw== Received: from [98.137.12.61] by nm6.bullet.mail.gq1.yahoo.com with NNFMP; 19 May 2016 16:23:15 -0000 Received: from [98.136.164.75] by tm6.bullet.mail.gq1.yahoo.com with NNFMP; 19 May 2016 16:23:15 -0000 Received: from [127.0.0.1] by smtp237.mail.gq1.yahoo.com with NNFMP; 19 May 2016 16:23:15 -0000 X-Yahoo-Newman-Id: 566897.29876.bm@smtp237.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: pK6oMk8VM1ky1_YSGZNN2H4_RjMJeQZv8u27Rxz0nJMqATe fGhk3ua..z_QJFTgLRYiDxNOme3.qyEmbuoMwolU7LI_OGxhFupfNyxmNyGX mnOJpttoURGPoMs_.5wuKTy57LbtpWILfCrDcq7mt0KCgnH3AsOeZ39Vqkn4 LZuJ_ZAn_kNvD1z5I7dB2S6vOBvzH6I0.0T5GwRqxHTrghL0aITXl4OXYx.A pTJLEV6fD0ob5UjX2.rI7P6RQQhyAeiq9pGjZVX4AMrJpGfp7LnOGtETTK_x nWwquyc3F5gwfFfvfHImkMGNPNQ8q1hT0Bik6s0QJw580QbW9jfsj1lPgV37 8bThUloyKP4SkIM06WPHp3Xo2wwlz4x218PH9hQ0LEPw_see9Xd8f5m0HZcw ojvOyvjADXaB2MgEa9sKpL9NSOzphizsiOUAXvPDOroqdPFZCAV0c3lYVMY1 2KiO2CEvkSZBKeZwv5tugEyFFYzo2nkMtHvmthrhn1DbwhiBWVXeqPBrQSrZ BFJ_MmZzKQxblFthvZS7blf1qP6Iy8P2wxS1879M- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300201 - head/sys/sys From: Scott Long In-Reply-To: <201605191119.u4JBJb9f027906@repo.freebsd.org> Date: Thu, 19 May 2016 10:23:13 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201605191119.u4JBJb9f027906@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 16:36:53 -0000 Thanks! Scott > On May 19, 2016, at 5:19 AM, Alexander Motin wrote: >=20 > Author: mav > Date: Thu May 19 11:19:37 2016 > New Revision: 300201 > URL: https://svnweb.freebsd.org/changeset/base/300201 >=20 > Log: > Add ta_flags initialization in old macros missed in 300113. >=20 > Depending on uninitialized memory content it could cause loss of = wakeup() > call in taskqueue_run_locked(). >=20 > Modified: > head/sys/sys/taskqueue.h >=20 > Modified: head/sys/sys/taskqueue.h > = =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/sys/sys/taskqueue.h Thu May 19 11:02:39 2016 = (r300200) > +++ head/sys/sys/taskqueue.h Thu May 19 11:19:37 2016 = (r300201) > @@ -97,6 +97,7 @@ void taskqueue_set_callback(struct taskq >=20 > #define TASK_INITIALIZER(priority, func, context) \ > { .ta_pending =3D 0, \ > + .ta_flags =3D 0, \ > .ta_priority =3D (priority), \ > .ta_func =3D (func), \ > .ta_context =3D (context) } > @@ -112,6 +113,7 @@ void taskqueue_thread_enqueue(void *cont > */ > #define TASK_INIT(task, priority, func, context) do { \ > (task)->ta_pending =3D 0; \ > + (task)->ta_flags =3D 0; \ > (task)->ta_priority =3D (priority); \ > (task)->ta_func =3D (func); \ > (task)->ta_context =3D (context); \ >=20 From owner-svn-src-all@freebsd.org Thu May 19 16:53:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3203B42082; Thu, 19 May 2016 16:53:54 +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 7914B1359; Thu, 19 May 2016 16:53:54 +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 u4JGrr3h031361; Thu, 19 May 2016 16:53:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JGrrI0031360; Thu, 19 May 2016 16:53:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605191653.u4JGrrI0031360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 May 2016 16:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300217 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 16:53:54 -0000 Author: mav Date: Thu May 19 16:53:53 2016 New Revision: 300217 URL: https://svnweb.freebsd.org/changeset/base/300217 Log: Add IOCB debugging for ISPCTL_RESET_DEV and ISPCTL_ABORT_CMD. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu May 19 16:36:06 2016 (r300216) +++ head/sys/dev/isp/isp.c Thu May 19 16:53:53 2016 (r300217) @@ -4699,6 +4699,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); isp_put_24xx_tmf(isp, tmf, isp->isp_iocb); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "TMF IOCB request", QENTRY_LEN, isp->isp_iocb); MEMORYBARRIER(isp, SYNC_IFORDEV, 0, QENTRY_LEN, chan); fcp->sendmarker = 1; @@ -4715,6 +4717,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "TMF IOCB response", QENTRY_LEN, &((isp24xx_statusreq_t *)isp->isp_iocb)[1]); sp = (isp24xx_statusreq_t *) local; isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)isp->isp_iocb)[1], sp); if (sp->req_completion_status == 0) { @@ -4781,6 +4785,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct ab->abrt_tidhi = lp->portid >> 16; ab->abrt_vpidx = ISP_GET_VPIDX(isp, chan); isp_put_24xx_abrt(isp, ab, isp->isp_iocb); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "AB IOCB quest", QENTRY_LEN, isp->isp_iocb); MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, chan); ISP_MEMZERO(&mbs, sizeof (mbs)); @@ -4796,6 +4802,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "AB IOCB response", QENTRY_LEN, &((isp24xx_abrt_t *)isp->isp_iocb)[1]); isp_get_24xx_abrt(isp, &((isp24xx_abrt_t *)isp->isp_iocb)[1], ab); if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { return (0); From owner-svn-src-all@freebsd.org Thu May 19 17:02:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474C3B423A0; Thu, 19 May 2016 17:02:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BAD41BD8; Thu, 19 May 2016 17:02:34 +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 u4JH2YF5034312; Thu, 19 May 2016 17:02:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JH2YkE034309; Thu, 19 May 2016 17:02:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605191702.u4JH2YkE034309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 May 2016 17:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300218 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 17:02:35 -0000 Author: mav Date: Thu May 19 17:02:33 2016 New Revision: 300218 URL: https://svnweb.freebsd.org/changeset/base/300218 Log: Add proper reporting for early task management errors. This covers unknown requests and requests to unknown virtual ports. Previously it "worked" only because of timeout handling on initiator. Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_target.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Thu May 19 16:53:53 2016 (r300217) +++ head/sys/dev/isp/isp_freebsd.c Thu May 19 17:02:33 2016 (r300218) @@ -2103,7 +2103,7 @@ isp_handle_platform_atio7(ispsoftc_t *is "%s: [0x%x] no state pointer for lun %jx or wildcard", __func__, aep->at_rxid, (uintmax_t)lun); if (lun == 0) { - isp_endcmd(isp, aep, nphdl, SCSI_STATUS_BUSY, 0); + isp_endcmd(isp, aep, nphdl, chan, SCSI_STATUS_BUSY, 0); } else { isp_endcmd(isp, aep, nphdl, chan, SCSI_STATUS_CHECK_COND | ECMD_SVALID | (0x5 << 12) | (0x25 << 16), 0); } Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Thu May 19 16:53:53 2016 (r300217) +++ head/sys/dev/isp/isp_target.c Thu May 19 17:02:33 2016 (r300218) @@ -539,13 +539,22 @@ isp_endcmd(ispsoftc_t *isp, ...) } else if (code & ECMD_SVALID) { cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS; cto->ct_scsi_status |= (FCP_SNSLEN_VALID << 8); - cto->rsp.m1.ct_resplen = cto->ct_senselen = min(16, MAXRESPLEN_24XX); + cto->ct_senselen = min(16, MAXRESPLEN_24XX); ISP_MEMZERO(cto->rsp.m1.ct_resp, sizeof (cto->rsp.m1.ct_resp)); cto->rsp.m1.ct_resp[0] = 0xf0; cto->rsp.m1.ct_resp[2] = (code >> 12) & 0xf; cto->rsp.m1.ct_resp[7] = 8; cto->rsp.m1.ct_resp[12] = (code >> 16) & 0xff; cto->rsp.m1.ct_resp[13] = (code >> 24) & 0xff; + } else if (code & ECMD_RVALID) { + cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS; + cto->ct_scsi_status |= (FCP_RSPLEN_VALID << 8); + cto->rsp.m1.ct_resplen = 4; + ISP_MEMZERO(cto->rsp.m1.ct_resp, sizeof (cto->rsp.m1.ct_resp)); + cto->rsp.m1.ct_resp[0] = (code >> 12) & 0xf; + cto->rsp.m1.ct_resp[1] = (code >> 16) & 0xff; + cto->rsp.m1.ct_resp[2] = (code >> 24) & 0xff; + cto->rsp.m1.ct_resp[3] = 0; } else { cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS; } @@ -764,6 +773,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en isp_notify_t notify; static const char f1[] = "%s from PortID 0x%06x lun %x seq 0x%08x"; static const char f2[] = "unknown Task Flag 0x%x lun %x PortID 0x%x tag 0x%08x"; + fcportdb_t *lp; uint16_t chan; uint32_t sid, did; @@ -774,20 +784,23 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en notify.nt_tagval = aep->at_rxid; notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); notify.nt_lreserved = aep; - sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | (aep->at_hdr.s_id[2]); + sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { /* Channel has to be derived from D_ID */ isp_find_chan_by_did(isp, did, &chan); if (chan == ISP_NOCHAN) { isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); - /* just drop on the floor */ + isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); return; } } else { chan = 0; } - notify.nt_nphdl = NIL_HANDLE; /* unknown here */ + if (isp_find_pdb_by_portid(isp, chan, sid, &lp)) + notify.nt_nphdl = lp->handle; + else + notify.nt_nphdl = NIL_HANDLE; notify.nt_sid = sid; notify.nt_did = did; notify.nt_channel = chan; @@ -815,6 +828,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en } else { isp_prt(isp, ISP_LOGWARN, f2, aep->at_cmnd.fcp_cmnd_task_management, notify.nt_lun, sid, aep->at_rxid); notify.nt_ncode = NT_UNKNOWN; + isp_endcmd(isp, aep, notify.nt_nphdl, chan, ECMD_RVALID | (0x4 << 12), 0); return; } isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Thu May 19 16:53:53 2016 (r300217) +++ head/sys/dev/isp/ispvar.h Thu May 19 17:02:33 2016 (r300218) @@ -1143,7 +1143,8 @@ int isp_target_put_atio(ispsoftc_t *, vo */ int isp_endcmd(ispsoftc_t *, ...); #define ECMD_SVALID 0x100 -#define ECMD_TERMINATE 0x200 +#define ECMD_RVALID 0x200 +#define ECMD_TERMINATE 0x400 /* * Handle an asynchronous event From owner-svn-src-all@freebsd.org Thu May 19 17:03:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EA94B4241F for ; Thu, 19 May 2016 17:03:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm35-vm3.bullet.mail.bf1.yahoo.com (nm35-vm3.bullet.mail.bf1.yahoo.com [72.30.238.75]) (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 EB2C61DCA for ; Thu, 19 May 2016 17:03:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463676568; bh=rFMcPnBBqkRz6M+rD2NC56qnjXHuCw4Xa3+4AufqilU=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=bQSNg52RWhLgDfQWoXgSLKCW6+ueAtiYQ/gcoVWOoX69yIIabHEpk4VR1DDeuheqi0Cn7ZsW2AB/GN0FW/vudWC68wW7DhwVeHtnho5I80aH5np9LXS8H8Wiq3czGolh3iprXEmScTwbRdNJNuuIoCpbj1VQ5yoYyaPFPozxAv9TOyZjjq/00YAaQG7fSJXsBGtZQFO5ILbk8IioNKiLy+td1gsJc8rNTamTDrUTIM5seLQ/3wIF+v4fStqQWUhFLjxZZ6cZgJoInLeFzXYP2GtkXnV1s8YeueYA2qea7gUYzPi+LRMQNHptVA9jR0ZWz23S81KZdJNeB4KfSXVpNQ== Received: from [98.139.214.32] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 19 May 2016 16:49:28 -0000 Received: from [68.142.230.77] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 19 May 2016 16:49:28 -0000 Received: from [127.0.0.1] by smtp234.mail.bf1.yahoo.com with NNFMP; 19 May 2016 16:49:28 -0000 X-Yahoo-Newman-Id: 655163.1705.bm@smtp234.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: zhBzPEQVM1myc65n7LIvmjhtNui080RzYQawhh0esK77WzW B5dPBAw9P_D64t8sJX_fGERSX5Y_CWhPKO5IIEu8t8NtBiLSbMmhbhxg3LGd NKRLzbEkr92yFtl8b3Xik4zGxjidR1OtVlzJ6r2cP2NPz2VKihp.VlWwWIPf Pthl9Ym0Yx7E1YCM6Wy2UZDWWLdAmniyPTWuf3HqoGsWZuVhCAxh0kRGlRK6 HGuejl2RsCxbd0xHoMmvxQItwSyEMp4joN3gbNxzyESUwZi0MMhrb4yStbwg _UYfU6UZf67ukGRteRPYy1tC4pg9wAXQbkzy0xFwOoWa7C6A.3PovBzEMtQ_ O08a.fM2b9ja3ub2mVL6BUAoWJVyhG7PF_harf3oPOU3Qsh3z2z2sqRpsAoR rA_O0t1sxgwW3iVfT6EqHez1eiIsdiLgWrlEF8FJYc._wyrR2BqJFw32iJWR Y2mawgjYvA975tDYG72EZQ4Vk3OsCTzqi0ZqLy559aObePftSatJ2CFh_DRc KX1FKvGPnC.ts9hb_3GRbiCE8bwIdXvw5 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs To: Alexey Dokuchaev References: <201605171536.u4HFae3R084696@repo.freebsd.org> <7ba425bb-6dc8-f56f-1353-abd7291cdb5e@FreeBSD.org> <20160519133342.GA50840@FreeBSD.org> Cc: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <03aa6521-01e5-a0fb-c40f-1ef3b2a43b15@FreeBSD.org> Date: Thu, 19 May 2016 11:49:39 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160519133342.GA50840@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 17:03:02 -0000 On 05/19/16 08:33, Alexey Dokuchaev wrote: > On Tue, May 17, 2016 at 11:29:01AM -0500, Pedro Giffuni wrote: >> Hello; >> >> On 05/17/16 10:36, George V. Neville-Neil wrote: >>> Author: gnn >>> Date: Tue May 17 15:36:40 2016 >>> New Revision: 300062 >>> URL: https://svnweb.freebsd.org/changeset/base/300062 >>> >>> Log: >>> Kill off ReiserFS as it is no longer supported, for obvious reasons. >> >> It's not so obvious since the fs worked and could've been useful for >> people migrating from ancient linux. > > And not just that. Simply having ability to boot off Live CD and read > some exotic filesystem is cool. What was wrong with ReiserFS, was it > broken or something? (NTFS support is another great loss of ours.) > Well, I recall it was the only GPL'd filesystem that survived SMP but apart from that, the fs format is not really used anymore, it didn't have much sense to keep it. As pointed out by Conrad, sysutils/fusefs-lkl is the way to go. And then ... IANAL, but given the situation in other camps it seems sane to keep away from anything involving the words "GPL" and "filesystems" in the same sentence. Pedro. From owner-svn-src-all@freebsd.org Thu May 19 17:14:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C400B427C8; Thu, 19 May 2016 17:14:26 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D725A137F; Thu, 19 May 2016 17:14:25 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JHEPDc037350; Thu, 19 May 2016 17:14:25 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JHEOnn037348; Thu, 19 May 2016 17:14:24 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605191714.u4JHEOnn037348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 19 May 2016 17:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300219 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 17:14:26 -0000 Author: scottl Date: Thu May 19 17:14:24 2016 New Revision: 300219 URL: https://svnweb.freebsd.org/changeset/base/300219 Log: Adjust the creation of tq_name so it can be freed correctly Reviewed by: jhb, allanjude Differential Revision: D6454 Modified: head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Thu May 19 17:02:33 2016 (r300218) +++ head/sys/kern/subr_taskqueue.c Thu May 19 17:14:24 2016 (r300219) @@ -128,16 +128,17 @@ _taskqueue_create(const char *name, int int mtxflags, const char *mtxname __unused) { struct taskqueue *queue; - char *tq_name = NULL; + char *tq_name; - if (name != NULL) - tq_name = strndup(name, 32, M_TASKQUEUE); - if (tq_name == NULL) - tq_name = "taskqueue"; + tq_name = malloc(TASKQUEUE_NAMELEN, M_TASKQUEUE, mflags | M_ZERO); + if (!tq_name) + return (NULL); + + snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO); if (!queue) - return NULL; + return (NULL); STAILQ_INIT(&queue->tq_queue); TAILQ_INIT(&queue->tq_active); @@ -153,7 +154,7 @@ _taskqueue_create(const char *name, int queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE; mtx_init(&queue->tq_mutex, tq_name, NULL, mtxflags); - return queue; + return (queue); } struct taskqueue * Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Thu May 19 17:02:33 2016 (r300218) +++ head/sys/sys/taskqueue.h Thu May 19 17:14:24 2016 (r300219) @@ -56,6 +56,7 @@ enum taskqueue_callback_type { #define TASKQUEUE_CALLBACK_TYPE_MIN TASKQUEUE_CALLBACK_TYPE_INIT #define TASKQUEUE_CALLBACK_TYPE_MAX TASKQUEUE_CALLBACK_TYPE_SHUTDOWN #define TASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX + 1 +#define TASKQUEUE_NAMELEN 32 typedef void (*taskqueue_callback_fn)(void *context); From owner-svn-src-all@freebsd.org Thu May 19 17:21:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 573E9B42A67; Thu, 19 May 2016 17:21:25 +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 2873118AE; Thu, 19 May 2016 17:21:25 +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 u4JHLOg0040485; Thu, 19 May 2016 17:21:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JHLOOs040484; Thu, 19 May 2016 17:21:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605191721.u4JHLOOs040484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 19 May 2016 17:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300220 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 17:21:25 -0000 Author: cem Date: Thu May 19 17:21:24 2016 New Revision: 300220 URL: https://svnweb.freebsd.org/changeset/base/300220 Log: sys/vmmeter.h: Fix trivial '-Wsign-compare' warning in common header Frankly, it doesn't make sense for vm_pageout_wakeup_thresh to have a negative value (it is only ever set to a fraction of v_free_min, which is unsigned and also obviously non-negative). But I'm not going to try and convert every non-negative scalar in the VM to unsigned today, so just cast it for the comparison. Submitted by: Clang 3.3 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/sys/vmmeter.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Thu May 19 17:14:24 2016 (r300219) +++ head/sys/sys/vmmeter.h Thu May 19 17:21:24 2016 (r300220) @@ -186,7 +186,7 @@ int vm_paging_needed(void) { return (vm_cnt.v_free_count + vm_cnt.v_cache_count < - vm_pageout_wakeup_thresh); + (u_int)vm_pageout_wakeup_thresh); } #endif From owner-svn-src-all@freebsd.org Thu May 19 17:40:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB74FB42E77; Thu, 19 May 2016 17:40:01 +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 982BF14B1; Thu, 19 May 2016 17:40:01 +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 u4JHe02C044056; Thu, 19 May 2016 17:40:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JHe0kk044054; Thu, 19 May 2016 17:40:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605191740.u4JHe0kk044054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 May 2016 17:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300221 - in head/lib: libc/sys libthr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 17:40:01 -0000 Author: kib Date: Thu May 19 17:40:00 2016 New Revision: 300221 URL: https://svnweb.freebsd.org/changeset/base/300221 Log: Document _umtx_op(2) interface for the implementation of robust mutexes. In libthr(3), list added knobs. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D6427 Modified: head/lib/libc/sys/_umtx_op.2 head/lib/libthr/libthr.3 Modified: head/lib/libc/sys/_umtx_op.2 ============================================================================== --- head/lib/libc/sys/_umtx_op.2 Thu May 19 17:21:24 2016 (r300220) +++ head/lib/libc/sys/_umtx_op.2 Thu May 19 17:40:00 2016 (r300221) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd May 17, 2016 .Dt _UMTX_OP 2 .Os .Sh NAME @@ -85,6 +85,7 @@ struct umutex { volatile lwpid_t m_owner; uint32_t m_flags; uint32_t m_ceilings[2]; + uintptr_t m_rb_lnk; }; .Ed .Pp @@ -95,18 +96,24 @@ It contains either the thread identifier locked state, or zero when the lock is unowned. The highest bit set indicates that there is contention on the lock. The constants are defined for special values: -.Bl -tag -width "Dv UMUTEX_CONTESTED" +.Bl -tag -width "Dv UMUTEX_RB_OWNERDEAD" .It Dv UMUTEX_UNOWNED Zero, the value stored in the unowned lock. .It Dv UMUTEX_CONTESTED The contenion indicator. +.It Dv UMUTEX_RB_OWNERDEAD +A thread owning the robust mutex terminated. +The mutex is in unlocked state. +.It Dv UMUTEX_RB_NOTRECOV +The robust mutex is in a non-recoverable state. +It cannot be locked until reinitialized. .El .Pp The .Dv m_flags field may contain the following umutex-specific flags, in addition to the common flags: -.Bl -tag -width "Dv UMUTEX_PRIO_INHERIT" +.Bl -tag -width "Dv UMUTEX_NONCONSISTENT" .It Dv UMUTEX_PRIO_INHERIT Mutex implements .Em Priority Inheritance @@ -115,6 +122,13 @@ protocol. Mutex implements .Em Priority Protection protocol. +.It Dv UMUTEX_ROBUST +Mutex is robust, as described in the +.Sx ROBUST UMUTEXES +section below. +.It Dv UMUTEX_NONCONSISTENT +Robust mutex is in a transient non-consistent state. +Not used by kernel. .El .Pp In the manual page, mutexes not having @@ -417,6 +431,75 @@ primitives, even when the physical addre When waking up a limited number of threads from a given sleep queue, the highest priority threads that have been blocked for the longest on the queue are selected. +.Ss ROBUST UMUTEXES +The +.Em robust umutexes +are provided as a substrate for a userspace library to implement +POSIX robust mutexes. +A robust umutex must have the +.Dv UMUTEX_ROBUST +flag set. +.Pp +On thread termination, the kernel walks two lists of mutexes. +The two lists head addresses must be provided by a prior call to +.Dv UMTX_OP_ROBUST_LISTS +request. +The lists are singly-linked. +The link to next element is provided by the +.Dv m_rb_lnk +member of the +.Vt struct umutex . +.Pp +Robust list processing is aborted if the kernel finds a mutex +with any of the following conditions: +.Bl -dash -offset indent -compact +.It +the +.Dv UMUTEX_ROBUST +flag is not set +.It +not owned by the current thread, except when the mutex is pointed to +by the +.Dv robust_inactive +member of the +.Vt struct umtx_robust_lists_params , +registered for the current thread +.It +the combination of mutex flags is invalid +.It +read of the umutex memory faults +.It +the list length limit described in +.Xr libthr 3 + is reached. +.El +.Pp +Every mutex in both lists is unlocked as if the +.Dv UMTX_OP_MUTEX_UNLOCK +request is performed on it, but instead of the +.Dv UMUTEX_UNOWNED +value, the +.Dv m_owner +field is written with the +.Dv UMUTEX_RB_OWNERDEAD +value. +When a mutex in the +.Dv UMUTEX_RB_OWNERDEAD +state is locked by kernel due to the +.Dv UMTX_OP_MUTEX_TRYLOCK +and +.Dv UMTX_OP_MUTEX_LOCK +requests, the lock is granted and +.Er EOWNERDEAD +error is returned. +.Pp +Also, the kernel handles the +.Dv UMUTEX_RB_NOTRECOV +value of +.Dv the m_owner +field specially, always returning the +.Er ENOTRECOVERABLE +error for lock attempts, without granting the lock. .Ss OPERATIONS The following operations, requested by the .Fa op @@ -582,12 +665,12 @@ The arguments to the request are: Pointer to the umutex. .It Fa val New ceiling value. -.It Fa uaddr1 +.It Fa uaddr Address of a variable of type .Vt uint32_t . If not NULL, after the successful update the previous ceiling value is written to the location pointed to by -.Fa uaddr1 . +.Fa uaddr . .El .Pp The request locks the umutex pointed to by the @@ -614,7 +697,7 @@ Pointer to the .Vt struct ucond . .It Fa val Request flags, see below. -.It Fa uaddr1 +.It Fa uaddr Pointer to the umutex. .It Fa uaddr2 Optional pointer to a @@ -624,7 +707,7 @@ for timeout specification. .Pp The request must be issued by the thread owning the mutex pointed to by the -.Fa uaddr1 +.Fa uaddr argument. The .Dv c_hash_waiters @@ -633,7 +716,7 @@ member of the pointed to by the .Fa obj argument, is set to an arbitrary non-zero value, after which the -.Fa uaddr1 +.Fa uaddr mutex is unlocked (following the appropriate protocol), and the current thread is put to sleep on the sleep queue keyed by the @@ -651,7 +734,7 @@ the same sleep queue, the .Dv c_hash_waiters member is cleared. After wakeup, the -.Fa uaddr1 +.Fa uaddr umutex is not relocked. .Pp The following flags are defined: @@ -1084,6 +1167,58 @@ The argument specifies the virtual address, which backing physical memory byte identity is used as a key for the anonymous shared object creation or lookup. +.It Dv UMTX_OP_ROBUST_LISTS +Register the list heads for the current thread's robust mutex lists. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa val +Size of the structure passed in the +.Fa uaddr +argument. +.It Fa uaddr +Pointer to the structure of type +.Vt struct umtx_robust_lists_params . +.El +.Pp +The structure is defined as +.Bd -literal +struct umtx_robust_lists_params { + uintptr_t robust_list_offset; + uintptr_t robust_priv_list_offset; + uintptr_t robust_inact_offset; +}; +.Ed +.Pp +The +.Dv robust_list_offset +member contains address of the first element in the list of locked +robust shared mutexes. +The +.Dv robust_priv_list_offset +member contains address of the first element in the list of locked +robust private mutexes. +The private and shared robust locked lists are split to allow fast +termination of the shared list on fork, in the child. +.Pp +The +.Dv robust_inact_offset +contains a pointer to the mutex which might be locked in nearby future, +or might have been just unlocked. +It is typically set by the lock or unlock mutex implementation code +around the whole operation, since lists can be only changed race-free +when the thread owns the mutex. +The kernel inspects the +.Dv robust_inact_offset +in addition to walking the shared and private lists. +Also, the mutex pointed to by +.Dv robust_inact_offset +is handled more loosly at the thread termination time, +than other mutexes on the list. +That mutex is allowed to be not owned by the current thread, +in which case list processing is continued. +See +.Sx ROBUST UMUTEXES +subsection for details. .El .Sh RETURN VALUES If successful, @@ -1106,7 +1241,7 @@ variable is set to indicate the error. The .Fn _umtx_op operations will return the following errors: -.Bl -tag -width Er +.Bl -tag -width "Bq Er ENOTRECOVERABLE" .It Bq Er EFAULT One of the arguments point to invalid memory. .It Bq Er EINVAL @@ -1145,7 +1280,7 @@ The argument specifies invalid operation. .It Bq Er EINVAL The -.Fa uaddr1 +.Fa uaddr argument for the .Dv UMTX_OP_SHM request specifies invalid operation. @@ -1162,6 +1297,21 @@ array during lock or unlock operations, .Dv RTP_PRIO_MAX . .It Bq Er EPERM Unlock attempted on an object not owned by the current thread. +.It Bq Er EOWNERDEAD +The lock was requested on an umutex where the +.Dv m_owner +field was set to the +.Dv UMUTEX_RB_OWNERDEAD +value, indicating terminated robust mutex. +The lock was granted to the caller, so this error in fact +indicates success with additional conditions. +.It Bq Er ENOTRECOVERABLE +The lock was requested on an umutex which +.Dv m_owner +field is equal to the +.Dv UMUTEX_RB_NOTRECOV +value, indicating abandoned robust mutex after termination. +The lock was not granted to the caller. .It Bq Er ENOTTY The shared memory object, associated with the address passed to the .Dv UMTX_SHM_ALIVE @@ -1197,7 +1347,7 @@ for read. A try mutex lock operation was not able to obtain the lock. .It Bq Er ETIMEDOUT The request specified a timeout in the -.Fa uaddr1 +.Fa uaddr and .Fa uaddr2 arguments, and timed out before obtaining the lock or being woken up. @@ -1211,6 +1361,27 @@ Mutex lock requests without timeout spec The error is typically not returned to userspace code, restart is handled by usual adjustment of the instruction counter. .El +.Sh BUGS +A window between a unlocking robust mutex and resetting the pointer in the +.Dv robust_inact_offset +member of the registered +.Vt struct umtx_robust_lists_params +allows another thread to destroy the mutex, thus making the kernel inspect +freed or reused memory. +The +.Li libthr +implementation is only vulnerable to this race when operating on +a shared mutex. +A possible fix for the current implementation is to strengthen the checks +for shared mutexes before terminating them, in particular, verifying +that the mutex memory is mapped from the POSIX shared object, allocated +by the +.Dv UMTX_OP_SHM +request. +This is not done because it is believed that the race is adequately +covered by other consistency checks, while adding the check would +prevent alternative implementations of +.Li libpthread . .Sh SEE ALSO .Xr clock_gettime 2 , .Xr mmap 2 , Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Thu May 19 17:21:24 2016 (r300220) +++ head/lib/libthr/libthr.3 Thu May 19 17:40:00 2016 (r300221) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2015 +.Dd May 17, 2016 .Dt LIBTHR 3 .Os .Sh NAME @@ -167,7 +167,7 @@ for 32bit architectures. The following environment variables are recognized by .Nm and adjust the operation of the library at run-time: -.Bl -tag -width LIBPTHREAD_SPLITSTACK_MAIN +.Bl -tag -width "Ev LIBPTHREAD_SPLITSTACK_MAIN" .It Ev LIBPTHREAD_BIGSTACK_MAIN Disables the reduction of the initial thread stack enabled by .Ev LIBPTHREAD_SPLITSTACK_MAIN . @@ -198,7 +198,37 @@ The integer value of the variable specif threads are inserted at the head of the sleep queue, instead of its tail. Bigger values reduce the frequency of the FIFO discipline. The value must be between 0 and 255. +.Pp +.El +The following +.Dv sysctl +MIBs affect the operation of the library: +.Bl -tag -width "Dv debug.umtx.robust_faults_verbose" +.It Dv kern.ipc.umtx_vnode_persistent +By default, a shared lock backed by a mapped file in memory is +automatically destroyed on the last unmap of the corresponding file's page, +which is allowed by POSIX. +Setting the sysctl to 1 makes such a shared lock object persist until +the vnode is recycled by the Virtual File System. +Note that in case file is not opened and not mapped, the kernel might +recycle it at any moment, making this sysctl less useful than it sounds. +.It Dv kern.ipc.umtx_max_robust +The maximal number of robust mutexes allowed for one thread. +The kernel will not unlock more mutexes than specified, see +.Xr _umtx_op +for more details. +The default value is large enough for most useful applications. +.It Dv debug.umtx.robust_faults_verbose +A non zero value makes kernel emit some diagnostic when the robust +mutexes unlock was prematurely aborted after detecting some inconsistency, +as a measure to prevent memory corruption. .El +.Pp +The +.Dv RLIMIT_UMTXP +limit (see +.Xr getrlimit 2 ) +defines how many shared locks a given user may create simultaneously. .Sh INTERACTION WITH RUN-TIME LINKER On load, .Nm @@ -236,6 +266,12 @@ logs. .Xr ld-elf.so.1 1 , .Xr getrlimit 2 , .Xr errno 2 , +.Xr thr_exit 2 , +.Xr thr_kill 2 , +.Xr thr_kill2 2 , +.Xr thr_new 2 , +.Xr thr_self 2 , +.Xr thr_set_name 2 , .Xr _umtx_op 2 , .Xr dlclose 3 , .Xr dlopen 3 , From owner-svn-src-all@freebsd.org Thu May 19 17:48:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E943B42044; Thu, 19 May 2016 17:48:58 +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 C6BE31BB2; Thu, 19 May 2016 17:48:57 +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 u4JHmvCe047112; Thu, 19 May 2016 17:48:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JHmu7H047110; Thu, 19 May 2016 17:48:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605191748.u4JHmu7H047110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 May 2016 17:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300222 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 17:48:58 -0000 Author: mav Date: Thu May 19 17:48:56 2016 New Revision: 300222 URL: https://svnweb.freebsd.org/changeset/base/300222 Log: Fix delaying requests to unknown virtual ports 2s after init. This code was originally implemented 7 years ago, but never really worked due to trivial error. I think this functionality may be not required. Initiators supporting optional periodic command status checks detected those terminated commands and retried them 3 seconds later. But thinking about less featured initiators and the fact that it is our race makes virtual ports "unknown" it may be good to have this feature. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu May 19 17:40:00 2016 (r300221) +++ head/sys/dev/isp/isp.c Thu May 19 17:48:56 2016 (r300222) @@ -2431,6 +2431,7 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch __func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status); return (EIO); } + GET_NANOTIME(&isp->isp_init_time); return (0); } @@ -5865,6 +5866,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * These are broadcast events that have to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); int topo = fcp->isp_topo; @@ -5921,6 +5923,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5964,6 +5967,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -6162,6 +6166,7 @@ isp_handle_other_response(ispsoftc_t *is portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Thu May 19 17:40:00 2016 (r300221) +++ head/sys/dev/isp/isp_freebsd.c Thu May 19 17:48:56 2016 (r300222) @@ -2055,7 +2055,7 @@ isp_handle_platform_atio7(ispsoftc_t *is * It's a bit tricky here as we need to stash this command *somewhere*. */ GET_NANOTIME(&now); - if (NANOTIME_SUB(&isp->isp_init_time, &now) > 2000000000ULL) { + if (NANOTIME_SUB(&now, &isp->isp_init_time) > 2000000000ULL) { isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- dropping", __func__, aep->at_rxid, did); isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); return; From owner-svn-src-all@freebsd.org Thu May 19 17:54:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B564AB421CD; Thu, 19 May 2016 17:54:15 +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 87A0D1FF6; Thu, 19 May 2016 17:54:15 +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 u4JHsERj050121; Thu, 19 May 2016 17:54:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JHsEjV050119; Thu, 19 May 2016 17:54:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605191754.u4JHsEjV050119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 19 May 2016 17:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300223 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 17:54:15 -0000 Author: cem Date: Thu May 19 17:54:14 2016 New Revision: 300223 URL: https://svnweb.freebsd.org/changeset/base/300223 Log: vm/vm_page.h: Fix trivial '-Wpointer-sign' warning pq_vcnt, as a count of real things, has no business being negative. It is only ever initialized by a u_int counter. The warning came from the atomic_add_int() in vm_pagequeue_cnt_add(). Rectify the warning by changing the variable to u_int. No functional change. Suggested by: Clang 3.3 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu May 19 17:48:56 2016 (r300222) +++ head/sys/vm/vm_page.c Thu May 19 17:54:14 2016 (r300223) @@ -384,11 +384,11 @@ vm_page_domain_init(struct vm_domain *vm *__DECONST(char **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_name) = "vm inactive pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = &vm_cnt.v_inactive_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_name) = "vm active pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = &vm_cnt.v_active_count; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu May 19 17:48:56 2016 (r300222) +++ head/sys/vm/vm_page.h Thu May 19 17:54:14 2016 (r300223) @@ -215,7 +215,7 @@ struct vm_pagequeue { struct mtx pq_mutex; struct pglist pq_pl; int pq_cnt; - int * const pq_vcnt; + u_int * const pq_vcnt; const char * const pq_name; } __aligned(CACHE_LINE_SIZE); From owner-svn-src-all@freebsd.org Thu May 19 18:51:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7EA9B42F19 for ; Thu, 19 May 2016 18:51:49 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::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 8321112D7 for ; Thu, 19 May 2016 18:51:49 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22b.google.com with SMTP id a17so139782403wme.0 for ; Thu, 19 May 2016 11:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:mime-version:references:in-reply-to:date:message-id:subject:to :cc; bh=26putL70uUIGvnK3EBT/3fQY9lV45bRGuk7TADWzR4w=; b=vbHDz+idCy/YBpyFvFO6IzIvNnXcxmazrnnpF6Y4uROsA/UR/ItZort5YJUSg9cBnT Pi2scnogtIZRxtRNra9QnHdHcNBlSATUb+QA9xi7hpYkeEK5bc+sp6bEverf9vGl/sLe P+vz7iu36jrWX3IXTLnZf3vIZg7Ut2wedeWvQmtmLgptW9r9xvx7C4itpNgBmc3Y7hiQ T68k/KuEW7t4GfJHhAPl6GfNNWnRHXqbkt9ZleZHTUqwuM7RlkPESo8czjE0n4mHMqne 6bMHuFc7iinjY2mIh26uqvNkyImBm4rmOZ4096IumZB5hyjRi6HFNdWsNQF179HQAABS XkIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:references:in-reply-to:date :message-id:subject:to:cc; bh=26putL70uUIGvnK3EBT/3fQY9lV45bRGuk7TADWzR4w=; b=RJ7ACdmuAy1XOh0a5+xPq9Ol0SyqB6fz//RCQ1qx4rxY1eAaGqzweBo5xV86g9Qhsz M4ScbtdWtirm/yrS0eApkPTLpTtEfxzlvFeNeAHMfzl8CY0gVzLqwvGbcByIi/qNzhAc A5qgvh2YIVnQFQuVXm/xJT+OGGP9fUOJK/KuQySCma350MPmKTpB5/xp3Z1OKEAkAaKD vjv8HWOHzgOeMaAhBrEMhi6TlkstF83yxRTEdj4dtbl0F7gnf8M27Z9rCt7X3SlRWQLj 7CZPZbryJzHY9cNN+WOgZ23NbzpUhIahcRw/Kj4BR0zZKCrmGIjEmBkyyNtKG2siyCJ/ kElg== X-Gm-Message-State: AOPr4FWuqZuliGU15ic+2BV+yFpx4JpJaqo/LkUxpoHVpNM7x8gDxchC7cgZdHAgBuZG/X2swIgdZEv5ck7ObKrI X-Received: by 10.194.69.106 with SMTP id d10mr15225663wju.165.1463683907900; Thu, 19 May 2016 11:51:47 -0700 (PDT) From: Steven Hartland Mime-Version: 1.0 (1.0) References: <201605191714.u4JHEOnn037348@repo.freebsd.org> In-Reply-To: <201605191714.u4JHEOnn037348@repo.freebsd.org> Date: Thu, 19 May 2016 19:51:41 +0100 Message-ID: <4596681286066293430@unknownmsgid> Subject: Re: svn commit: r300219 - in head/sys: kern sys To: Scott Long 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 18:51:50 -0000 I thought it was considered better to use if (var == NULL) instead of if (!var) for pointers as they aren't bools? > On 19 May 2016, at 18:14, Scott Long wrote: > > Author: scottl > Date: Thu May 19 17:14:24 2016 > New Revision: 300219 > URL: https://svnweb.freebsd.org/changeset/base/300219 > > Log: > Adjust the creation of tq_name so it can be freed correctly > > Reviewed by: jhb, allanjude > Differential Revision: D6454 > > Modified: > head/sys/kern/subr_taskqueue.c > head/sys/sys/taskqueue.h > > Modified: head/sys/kern/subr_taskqueue.c > ============================================================================== > --- head/sys/kern/subr_taskqueue.c Thu May 19 17:02:33 2016 (r300218) > +++ head/sys/kern/subr_taskqueue.c Thu May 19 17:14:24 2016 (r300219) > @@ -128,16 +128,17 @@ _taskqueue_create(const char *name, int > int mtxflags, const char *mtxname __unused) > { > struct taskqueue *queue; > - char *tq_name = NULL; > + char *tq_name; > > - if (name != NULL) > - tq_name = strndup(name, 32, M_TASKQUEUE); > - if (tq_name == NULL) > - tq_name = "taskqueue"; > + tq_name = malloc(TASKQUEUE_NAMELEN, M_TASKQUEUE, mflags | M_ZERO); > + if (!tq_name) > + return (NULL); > + > + snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); > > queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO); > if (!queue) > - return NULL; > + return (NULL); > > STAILQ_INIT(&queue->tq_queue); > TAILQ_INIT(&queue->tq_active); > @@ -153,7 +154,7 @@ _taskqueue_create(const char *name, int > queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE; > mtx_init(&queue->tq_mutex, tq_name, NULL, mtxflags); > > - return queue; > + return (queue); > } > > struct taskqueue * > > Modified: head/sys/sys/taskqueue.h > ============================================================================== > --- head/sys/sys/taskqueue.h Thu May 19 17:02:33 2016 (r300218) > +++ head/sys/sys/taskqueue.h Thu May 19 17:14:24 2016 (r300219) > @@ -56,6 +56,7 @@ enum taskqueue_callback_type { > #define TASKQUEUE_CALLBACK_TYPE_MIN TASKQUEUE_CALLBACK_TYPE_INIT > #define TASKQUEUE_CALLBACK_TYPE_MAX TASKQUEUE_CALLBACK_TYPE_SHUTDOWN > #define TASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX + 1 > +#define TASKQUEUE_NAMELEN 32 > > typedef void (*taskqueue_callback_fn)(void *context); > > From owner-svn-src-all@freebsd.org Thu May 19 19:13:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEEE4B3F52E; Thu, 19 May 2016 19:13:44 +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 B050B126A; Thu, 19 May 2016 19:13:44 +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 u4JJDhE4075623; Thu, 19 May 2016 19:13:43 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JJDhOQ075622; Thu, 19 May 2016 19:13:43 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201605191913.u4JJDhOQ075622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 19 May 2016 19:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300224 - head/usr.sbin/camdd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 19:13:45 -0000 Author: ken Date: Thu May 19 19:13:43 2016 New Revision: 300224 URL: https://svnweb.freebsd.org/changeset/base/300224 Log: Adjust a couple of error cases in camdd(8). usr.sbin/camdd/camdd.c: In camdd_probe_file(), fix an error case after fstat where we were bailing out and leaving two lines of cleanup code unexecuted. Instead, just goto bailout_error. In camdd_probe_pass(), fail if the sector size is 0. Sponsored by: Spectra Logic MFC after: 3 days Modified: head/usr.sbin/camdd/camdd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Thu May 19 17:54:14 2016 (r300223) +++ head/usr.sbin/camdd/camdd.c Thu May 19 19:13:43 2016 (r300224) @@ -1079,9 +1079,7 @@ camdd_probe_file(int fd, struct camdd_io retval = fstat(fd, &file_dev->sb); if (retval != 0) { warn("Cannot stat %s", dev->device_name); - goto bailout; - camdd_free_dev(dev); - dev = NULL; + goto bailout_error; } if (S_ISREG(file_dev->sb.st_mode)) { file_dev->file_type = CAMDD_FILE_REG; @@ -1383,6 +1381,11 @@ camdd_probe_pass(struct cam_device *cam_ block_len = scsi_4btoul(rcaplong.length); rcap_done: + if (block_len == 0) { + warnx("Sector size for %s%u is 0, cannot continue", + cam_dev->device_name, cam_dev->dev_unit_num); + goto bailout_error; + } bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); From owner-svn-src-all@freebsd.org Thu May 19 19:27:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9785B3F875; Thu, 19 May 2016 19:27:34 +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 7ACA51A5F; Thu, 19 May 2016 19:27:34 +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 u4JJRX4Q078703; Thu, 19 May 2016 19:27:33 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JJRXi4078702; Thu, 19 May 2016 19:27:33 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201605191927.u4JJRXi4078702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 19 May 2016 19:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300225 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 19:27:34 -0000 Author: alc Date: Thu May 19 19:27:33 2016 New Revision: 300225 URL: https://svnweb.freebsd.org/changeset/base/300225 Log: Clean up the handling of errors from vm_pager_get_pages(). Mostly, this cleanup consists of fixes to comments. However, there is one change to code: Remove special-case handling of errors involving the kernel map. We do not perform I/O on the kernel map, so there is no need for this special case. Reviewed by: kib (an earlier version) Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu May 19 19:13:43 2016 (r300224) +++ head/sys/vm/vm_fault.c Thu May 19 19:27:33 2016 (r300225) @@ -657,48 +657,40 @@ vnode_locked: hardfault++; break; /* break to PAGE HAS BEEN FOUND */ } - /* - * Remove the bogus page (which does not exist at this - * object/offset); before doing so, we must get back - * our object lock to preserve our invariant. - * - * Also wake up any other process that may want to bring - * in this page. - * - * If this is the top-level object, we must leave the - * busy page to prevent another process from rushing - * past us, and inserting the page in that object at - * the same time that we are. - */ if (rv == VM_PAGER_ERROR) printf("vm_fault: pager read error, pid %d (%s)\n", curproc->p_pid, curproc->p_comm); + /* - * Data outside the range of the pager or an I/O error - */ - /* - * XXX - the check for kernel_map is a kludge to work - * around having the machine panic on a kernel space - * fault w/ I/O error. + * If an I/O error occurred or the requested page was + * outside the range of the pager, clean up and return + * an error. */ - if (((fs.map != kernel_map) && (rv == VM_PAGER_ERROR)) || - (rv == VM_PAGER_BAD)) { + if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { vm_page_lock(fs.m); vm_page_free(fs.m); vm_page_unlock(fs.m); fs.m = NULL; unlock_and_deallocate(&fs); - return ((rv == VM_PAGER_ERROR) ? KERN_FAILURE : KERN_PROTECTION_FAILURE); + return (rv == VM_PAGER_ERROR ? KERN_FAILURE : + KERN_PROTECTION_FAILURE); } + + /* + * The requested page does not exist at this object/ + * offset. Remove the invalid page from the object, + * waking up anyone waiting for it, and continue on to + * the next object. However, if this is the top-level + * object, we must leave the busy page in place to + * prevent another process from rushing past us, and + * inserting the page in that object at the same time + * that we are. + */ if (fs.object != fs.first_object) { vm_page_lock(fs.m); vm_page_free(fs.m); vm_page_unlock(fs.m); fs.m = NULL; - /* - * XXX - we cannot just fall out at this - * point, m has been freed and is invalid! - */ } } From owner-svn-src-all@freebsd.org Thu May 19 19:51:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA95DB3FD9D; Thu, 19 May 2016 19:51:40 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D90D13D7; Thu, 19 May 2016 19:51:40 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JJpdtS087524; Thu, 19 May 2016 19:51:39 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JJpdYQ087521; Thu, 19 May 2016 19:51:39 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201605191951.u4JJpdYQ087521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 19 May 2016 19:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300226 - in head: cddl/contrib/dtracetoolkit cddl/usr.sbin cddl/usr.sbin/dtruss share/dtrace share/dtrace/toolkit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 19:51:40 -0000 Author: gnn Date: Thu May 19 19:51:39 2016 New Revision: 300226 URL: https://svnweb.freebsd.org/changeset/base/300226 Log: Remove the old version of the DTraceToolkit from the source tree. The DTraceToolkit is part of the Open DTrace effort and is supported on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated to properly track toolkit development upstream. Sponsored by: DARPA, AFRL Deleted: head/cddl/contrib/dtracetoolkit/ head/cddl/usr.sbin/dtruss/ head/share/dtrace/toolkit/ Modified: head/cddl/usr.sbin/Makefile head/share/dtrace/Makefile head/share/dtrace/README Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Thu May 19 19:27:33 2016 (r300225) +++ head/cddl/usr.sbin/Makefile Thu May 19 19:51:39 2016 (r300226) @@ -3,7 +3,6 @@ .include SUBDIR= ${_dtrace} \ - ${_dtruss} \ ${_lockstat} \ ${_plockstat} \ ${_tests} \ @@ -23,14 +22,12 @@ _zhack= zhack .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _dtrace= dtrace -_dtruss= dtruss _lockstat= lockstat _plockstat= plockstat .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _dtrace= dtrace -_dtruss= dtruss _lockstat= lockstat .endif @@ -40,7 +37,6 @@ _dtrace= dtrace .if ${MACHINE_CPUARCH} == "powerpc" _dtrace= dtrace -_dtruss= dtruss _lockstat= lockstat .endif Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Thu May 19 19:27:33 2016 (r300225) +++ head/share/dtrace/Makefile Thu May 19 19:51:39 2016 (r300226) @@ -6,12 +6,6 @@ .include -SUBDIR= ${_toolkit} - -.if ${MK_CDDL} != "no" -_toolkit= toolkit -.endif - SCRIPTS= blocking \ disklatency \ disklatencycmd \ Modified: head/share/dtrace/README ============================================================================== --- head/share/dtrace/README Thu May 19 19:27:33 2016 (r300225) +++ head/share/dtrace/README Thu May 19 19:51:39 2016 (r300226) @@ -1,11 +1,5 @@ $FreeBSD$ -This directory contains scripts for use with the DTrace system. The -toolkit/ directory installs the latest vendor import of Brendan -Gregg's DTraceToolkit while the other files and directories -contain code generated by the FreeBSD Project for use with DTrace on -FreeBSD. - -NOTE: Do not add new scripts to the toolkit directory. New DTraceToolkit -scripts should be send to the maintainer of the toolkit and then brought -back into FreeBSD via future vendor imports. +This directory contains scripts for use with the DTrace system. +These files and directories contain code generated by the FreeBSD +Project for use with DTrace on FreeBSD. From owner-svn-src-all@freebsd.org Thu May 19 20:03:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8AD4B421A9; Thu, 19 May 2016 20:03:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A646E1E15; Thu, 19 May 2016 20:03:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JK314K090556; Thu, 19 May 2016 20:03:01 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JK31MN090555; Thu, 19 May 2016 20:03:01 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605192003.u4JK31MN090555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 19 May 2016 20:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300227 - head/usr.bin/ar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 20:03:03 -0000 Author: ed Date: Thu May 19 20:03:01 2016 New Revision: 300227 URL: https://svnweb.freebsd.org/changeset/base/300227 Log: Make code compile when basename() is POSIX compliant. If basename() uses "char *", we shouldn't do the intermediate assignment, as that field is of type "const char *". Simply call basename() on the command line argument directly. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D6463 Modified: head/usr.bin/ar/ar.c Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Thu May 19 19:51:39 2016 (r300226) +++ head/usr.bin/ar/ar.c Thu May 19 20:03:01 2016 (r300227) @@ -272,10 +272,10 @@ main(int argc, char **argv) "only one of -s and -S options allowed"); if (bsdar->options & (AR_A | AR_B)) { - if ((bsdar->posarg = *argv) == NULL) + if (*argv == NULL) bsdar_errc(bsdar, EX_USAGE, 0, "no position operand specified"); - if ((bsdar->posarg = basename(bsdar->posarg)) == NULL) + if ((bsdar->posarg = basename(*argv)) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, errno, "basename failed"); argc--; From owner-svn-src-all@freebsd.org Thu May 19 20:06:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89463B4221D; Thu, 19 May 2016 20:06:58 +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 25AC71FCE; Thu, 19 May 2016 20:06:58 +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 u4JK6vTR090735; Thu, 19 May 2016 20:06:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JK6uUN090722; Thu, 19 May 2016 20:06:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605192006.u4JK6uUN090722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 May 2016 20:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r300228 - in vendor/elftoolchain/dist: addr2line brandelf common cxxfilt elfcopy elfdump findtextrel ld libdwarf libelf libelftc libpe nm readelf size strings test/cxxfilt test/cxxfilt/... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 20:06:58 -0000 Author: emaste Date: Thu May 19 20:06:56 2016 New Revision: 300228 URL: https://svnweb.freebsd.org/changeset/base/300228 Log: Import ELF Tool Chain snapshot at revision 3475 From http://svn.code.sf.net/p/elftoolchain/code/ Added: vendor/elftoolchain/dist/ld/ld.1 (contents, props changed) vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.3 (contents, props changed) vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c (contents, props changed) vendor/elftoolchain/dist/test/cxxfilt/ vendor/elftoolchain/dist/test/cxxfilt/Makefile (contents, props changed) vendor/elftoolchain/dist/test/cxxfilt/tet_scen vendor/elftoolchain/dist/test/cxxfilt/tetexec.cfg vendor/elftoolchain/dist/test/cxxfilt/ts/ vendor/elftoolchain/dist/test/cxxfilt/ts/Makefile (contents, props changed) vendor/elftoolchain/dist/test/cxxfilt/ts/common/ vendor/elftoolchain/dist/test/cxxfilt/ts/common/func.sh (contents, props changed) vendor/elftoolchain/dist/test/cxxfilt/ts/common/gen.awk (contents, props changed) vendor/elftoolchain/dist/test/cxxfilt/ts/common/ts.mk (contents, props changed) vendor/elftoolchain/dist/test/cxxfilt/ts/misc/ vendor/elftoolchain/dist/test/cxxfilt/ts/misc/Makefile (contents, props changed) vendor/elftoolchain/dist/test/cxxfilt/ts/misc/tclist Modified: vendor/elftoolchain/dist/addr2line/addr2line.c vendor/elftoolchain/dist/brandelf/brandelf.c vendor/elftoolchain/dist/common/_elftc.h vendor/elftoolchain/dist/common/elfdefinitions.h vendor/elftoolchain/dist/cxxfilt/cxxfilt.c vendor/elftoolchain/dist/elfcopy/ascii.c vendor/elftoolchain/dist/elfcopy/binary.c vendor/elftoolchain/dist/elfcopy/elfcopy.1 vendor/elftoolchain/dist/elfcopy/elfcopy.h vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfcopy/sections.c vendor/elftoolchain/dist/elfcopy/segments.c vendor/elftoolchain/dist/elfcopy/symbols.c vendor/elftoolchain/dist/elfdump/elfdump.c vendor/elftoolchain/dist/findtextrel/findtextrel.c vendor/elftoolchain/dist/ld/Makefile vendor/elftoolchain/dist/ld/amd64.c vendor/elftoolchain/dist/ld/i386.c vendor/elftoolchain/dist/ld/ld_options.c vendor/elftoolchain/dist/ld/ld_options.h vendor/elftoolchain/dist/libdwarf/libdwarf_abbrev.c vendor/elftoolchain/dist/libdwarf/libdwarf_elf_init.c vendor/elftoolchain/dist/libelf/_libelf_config.h vendor/elftoolchain/dist/libelf/elf_data.c vendor/elftoolchain/dist/libelf/libelf_ar.c vendor/elftoolchain/dist/libelf/libelf_convert.m4 vendor/elftoolchain/dist/libelftc/Makefile vendor/elftoolchain/dist/libelftc/libelftc.h vendor/elftoolchain/dist/libelftc/libelftc_dem_arm.c vendor/elftoolchain/dist/libelftc/libelftc_dem_gnu2.c vendor/elftoolchain/dist/libelftc/libelftc_dem_gnu3.c vendor/elftoolchain/dist/libelftc/make-toolchain-version vendor/elftoolchain/dist/libpe/libpe_section.c vendor/elftoolchain/dist/libpe/pe.h vendor/elftoolchain/dist/nm/nm.c vendor/elftoolchain/dist/readelf/readelf.c vendor/elftoolchain/dist/size/size.c vendor/elftoolchain/dist/strings/strings.c vendor/elftoolchain/dist/test/elfdump/ts/dso1/@S@p%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@c@p@n%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@e@p@c%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@p%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso1/@p@s%libelf.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@S@p%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@c@p@n%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e@p@c%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@p%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/dso2/@p@s%test.so.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@e@p%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@c@p@n%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@e@p%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@e@p@c@d%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@p@e%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@p@n%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec1/@p@s%ls.out vendor/elftoolchain/dist/test/elfdump/ts/exec2/@S@n%cp.out Modified: vendor/elftoolchain/dist/addr2line/addr2line.c ============================================================================== --- vendor/elftoolchain/dist/addr2line/addr2line.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/addr2line/addr2line.c Thu May 19 20:06:56 2016 (r300228) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3273 2015-12-11 21:38:57Z kaiwang27 $"); +ELFTC_VCSID("$Id: addr2line.c 3446 2016-05-03 01:31:17Z emaste $"); struct Func { char *name; @@ -284,7 +284,7 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die &de) == DW_DLV_OK) goto add_func; - /* Skip if no name assoicated with this DIE. */ + /* Skip if no name associated with this DIE. */ goto cont_search; add_func: Modified: vendor/elftoolchain/dist/brandelf/brandelf.c ============================================================================== --- vendor/elftoolchain/dist/brandelf/brandelf.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/brandelf/brandelf.c Thu May 19 20:06:56 2016 (r300228) @@ -44,7 +44,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: brandelf.c 3354 2016-01-18 21:50:15Z jkoshy $"); +ELFTC_VCSID("$Id: brandelf.c 3440 2016-04-07 14:51:47Z emaste $"); static int elftype(const char *); static const char *iselftype(int); @@ -62,6 +62,7 @@ static struct ELFtypes elftypes[] = { { "AIX", ELFOSABI_AIX }, { "ARM", ELFOSABI_ARM }, { "AROS", ELFOSABI_AROS }, + { "CloudABI", ELFOSABI_CLOUDABI }, { "FreeBSD", ELFOSABI_FREEBSD }, { "GNU", ELFOSABI_GNU }, { "HP/UX", ELFOSABI_HPUX}, Modified: vendor/elftoolchain/dist/common/_elftc.h ============================================================================== --- vendor/elftoolchain/dist/common/_elftc.h Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/common/_elftc.h Thu May 19 20:06:56 2016 (r300228) @@ -23,11 +23,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _elftc.h 3244 2015-08-31 19:53:08Z emaste $ + * $Id: _elftc.h 3446 2016-05-03 01:31:17Z emaste $ */ /** - ** Miscellanous definitions needed by multiple components. + ** Miscellaneous definitions needed by multiple components. **/ #ifndef _ELFTC_H Modified: vendor/elftoolchain/dist/common/elfdefinitions.h ============================================================================== --- vendor/elftoolchain/dist/common/elfdefinitions.h Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/common/elfdefinitions.h Thu May 19 20:06:56 2016 (r300228) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3392 2016-02-05 19:51:22Z emaste $ + * $Id: elfdefinitions.h 3455 2016-05-09 13:47:29Z emaste $ */ /* @@ -184,6 +184,10 @@ _ELF_DEFINE_DT(DT_ADDRRNGLO, 0x6F "start of range using the d_ptr field") \ _ELF_DEFINE_DT(DT_GNU_HASH, 0x6FFFFEF5UL, \ "GNU style hash tables") \ +_ELF_DEFINE_DT(DT_TLSDESC_PLT, 0x6FFFFEF6UL, \ + "location of PLT entry for TLS descriptor resolver calls") \ +_ELF_DEFINE_DT(DT_TLSDESC_GOT, 0x6FFFFEF7UL, \ + "location of GOT entry used by TLS descriptor resolver PLT entry") \ _ELF_DEFINE_DT(DT_GNU_CONFLICT, 0x6FFFFEF8UL, \ "address of conflict section") \ _ELF_DEFINE_DT(DT_GNU_LIBLIST, 0x6FFFFEF9UL, \ @@ -269,7 +273,7 @@ _ELF_DEFINE_DT(DT_MIPS_DELTA_RELOC, 0x70 _ELF_DEFINE_DT(DT_MIPS_DELTA_RELOC_NO, 0x7000001CUL, \ "number of entries in DT_MIPS_DELTA_RELOC") \ _ELF_DEFINE_DT(DT_MIPS_DELTA_SYM, 0x7000001DUL, \ - "Delta symbols refered by Delta relocations") \ + "Delta symbols referred by Delta relocations") \ _ELF_DEFINE_DT(DT_MIPS_DELTA_SYM_NO, 0x7000001EUL, \ "number of entries in DT_MIPS_DELTA_SYM") \ _ELF_DEFINE_DT(DT_MIPS_DELTA_CLASSSYM, 0x70000020UL, \ @@ -540,6 +544,7 @@ _ELF_DEFINE_EABI(ELFOSABI_NSK, 14 _ELF_DEFINE_EABI(ELFOSABI_AROS, 15, "Amiga Research OS") \ _ELF_DEFINE_EABI(ELFOSABI_FENIXOS, 16, \ "The FenixOS highly scalable multi-core OS") \ +_ELF_DEFINE_EABI(ELFOSABI_CLOUDABI, 17, "Nuxi CloudABI") \ _ELF_DEFINE_EABI(ELFOSABI_ARM_AEABI, 64, \ "ARM specific symbol versioning extensions") \ _ELF_DEFINE_EABI(ELFOSABI_ARM, 97, "ARM ABI") \ @@ -1193,7 +1198,7 @@ _ELF_DEFINE_SHT(SHT_MIPS_ABIFLAGS, 0x7 "ABI flags") \ _ELF_DEFINE_SHT(SHT_SPARC_GOTDATA, 0x70000000UL, \ "SPARC-specific data") \ -_ELF_DEFINE_SHT(SHT_AMD64_UNWIND, 0x70000001UL, \ +_ELF_DEFINE_SHT(SHT_X86_64_UNWIND, 0x70000001UL, \ "unwind tables for the AMD64") \ _ELF_DEFINE_SHT(SHT_ORDERED, 0x7FFFFFFFUL, \ "sort entries in the section") \ @@ -1212,6 +1217,7 @@ enum { }; /* Aliases for section types. */ +#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND #define SHT_GNU_verdef SHT_SUNW_verdef #define SHT_GNU_verneed SHT_SUNW_verneed #define SHT_GNU_versym SHT_SUNW_versym @@ -1255,6 +1261,7 @@ _ELF_DEFINE_STT(STT_FILE, 4, _ELF_DEFINE_STT(STT_COMMON, 5, "uninitialized common block") \ _ELF_DEFINE_STT(STT_TLS, 6, "thread local storage") \ _ELF_DEFINE_STT(STT_LOOS, 10, "start of OS-specific types") \ +_ELF_DEFINE_STT(STT_GNU_IFUNC, 10, "indirect function") \ _ELF_DEFINE_STT(STT_HIOS, 12, "end of OS-specific types") \ _ELF_DEFINE_STT(STT_LOPROC, 13, \ "start of processor-specific types") \ @@ -1402,10 +1409,37 @@ _ELF_DEFINE_RELOC(R_386_RELATIVE, 8) \ _ELF_DEFINE_RELOC(R_386_GOTOFF, 9) \ _ELF_DEFINE_RELOC(R_386_GOTPC, 10) \ _ELF_DEFINE_RELOC(R_386_32PLT, 11) \ +_ELF_DEFINE_RELOC(R_386_TLS_TPOFF, 14) \ +_ELF_DEFINE_RELOC(R_386_TLS_IE, 15) \ +_ELF_DEFINE_RELOC(R_386_TLS_GOTIE, 16) \ +_ELF_DEFINE_RELOC(R_386_TLS_LE, 17) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD, 18) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM, 19) \ _ELF_DEFINE_RELOC(R_386_16, 20) \ _ELF_DEFINE_RELOC(R_386_PC16, 21) \ _ELF_DEFINE_RELOC(R_386_8, 22) \ -_ELF_DEFINE_RELOC(R_386_PC8, 23) +_ELF_DEFINE_RELOC(R_386_PC8, 23) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_32, 24) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_PUSH, 25) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_CALL, 26) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_POP, 27) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_32, 28) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_PUSH, 29) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_CALL, 30) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_POP, 31) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDO_32, 32) \ +_ELF_DEFINE_RELOC(R_386_TLS_IE_32, 33) \ +_ELF_DEFINE_RELOC(R_386_TLS_LE_32, 34) \ +_ELF_DEFINE_RELOC(R_386_TLS_DTPMOD32, 35) \ +_ELF_DEFINE_RELOC(R_386_TLS_DTPOFF32, 36) \ +_ELF_DEFINE_RELOC(R_386_TLS_TPOFF32, 37) \ +_ELF_DEFINE_RELOC(R_386_SIZE32, 38) \ +_ELF_DEFINE_RELOC(R_386_TLS_GOTDESC, 39) \ +_ELF_DEFINE_RELOC(R_386_TLS_DESC_CALL, 40) \ +_ELF_DEFINE_RELOC(R_386_TLS_DESC, 41) \ +_ELF_DEFINE_RELOC(R_386_IRELATIVE, 42) \ +_ELF_DEFINE_RELOC(R_386_GOT32X, 43) + /* */ @@ -1795,11 +1829,18 @@ _ELF_DEFINE_RELOC(R_MIPS_GOT16, 9) \ _ELF_DEFINE_RELOC(R_MIPS_PC16, 10) \ _ELF_DEFINE_RELOC(R_MIPS_CALL16, 11) \ _ELF_DEFINE_RELOC(R_MIPS_GPREL32, 12) \ +_ELF_DEFINE_RELOC(R_MIPS_SHIFT5, 16) \ +_ELF_DEFINE_RELOC(R_MIPS_SHIFT6, 17) \ _ELF_DEFINE_RELOC(R_MIPS_64, 18) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTHI16, 21) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTLO16, 22) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_DISP, 19) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_PAGE, 20) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_OFST, 21) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_HI16, 22) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_LO16, 23) \ +_ELF_DEFINE_RELOC(R_MIPS_SUB, 24) \ _ELF_DEFINE_RELOC(R_MIPS_CALLHI16, 30) \ _ELF_DEFINE_RELOC(R_MIPS_CALLLO16, 31) \ +_ELF_DEFINE_RELOC(R_MIPS_JALR, 37) \ _ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD32, 38) \ _ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL32, 39) \ _ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD64, 40) \ @@ -2095,6 +2136,7 @@ _ELF_DEFINE_RELOC(R_SPARC_PC_HM10, 38) \ _ELF_DEFINE_RELOC(R_SPARC_PC_LM22, 39) \ _ELF_DEFINE_RELOC(R_SPARC_WDISP16, 40) \ _ELF_DEFINE_RELOC(R_SPARC_WDISP19, 41) \ +_ELF_DEFINE_RELOC(R_SPARC_GLOB_JMP, 42) \ _ELF_DEFINE_RELOC(R_SPARC_7, 43) \ _ELF_DEFINE_RELOC(R_SPARC_5, 44) \ _ELF_DEFINE_RELOC(R_SPARC_6, 45) \ @@ -2108,6 +2150,30 @@ _ELF_DEFINE_RELOC(R_SPARC_L44, 52) \ _ELF_DEFINE_RELOC(R_SPARC_REGISTER, 53) \ _ELF_DEFINE_RELOC(R_SPARC_UA64, 54) \ _ELF_DEFINE_RELOC(R_SPARC_UA16, 55) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_HI22, 56) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_LO10, 57) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_ADD, 58) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_CALL, 59) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_HI22, 60) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_LO10, 61) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_ADD, 62) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_CALL, 63) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDO_HIX22, 64) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDO_LOX10, 65) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDO_ADD, 66) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_HI22, 67) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_LO10, 68) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_LD, 69) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_LDX, 70) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_ADD, 71) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LE_HIX22, 72) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LE_LOX10, 73) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPMOD32, 74) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPMOD64, 75) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPOFF32, 76) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPOFF64, 77) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_TPOFF32, 78) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_TPOFF64, 79) \ _ELF_DEFINE_RELOC(R_SPARC_GOTDATA_HIX22, 80) \ _ELF_DEFINE_RELOC(R_SPARC_GOTDATA_LOX10, 81) \ _ELF_DEFINE_RELOC(R_SPARC_GOTDATA_OP_HIX22, 82) \ @@ -2153,7 +2219,10 @@ _ELF_DEFINE_RELOC(R_X86_64_SIZE64, 33) \ _ELF_DEFINE_RELOC(R_X86_64_GOTPC32_TLSDESC, 34) \ _ELF_DEFINE_RELOC(R_X86_64_TLSDESC_CALL, 35) \ _ELF_DEFINE_RELOC(R_X86_64_TLSDESC, 36) \ -_ELF_DEFINE_RELOC(R_X86_64_IRELATIVE, 37) +_ELF_DEFINE_RELOC(R_X86_64_IRELATIVE, 37) \ +_ELF_DEFINE_RELOC(R_X86_64_RELATIVE64, 38) \ +_ELF_DEFINE_RELOC(R_X86_64_GOTPCRELX, 41) \ +_ELF_DEFINE_RELOC(R_X86_64_REX_GOTPCRELX, 42) #define _ELF_DEFINE_RELOCATIONS() \ _ELF_DEFINE_386_RELOCATIONS() \ @@ -2424,7 +2493,7 @@ _ELF_DEFINE_ODK(ODK_HWOR, 8, _ELF_DEFINE_ODK(ODK_GP_GROUP, 9, \ "GP group to use for text/data sections") \ _ELF_DEFINE_ODK(ODK_IDENT, 10, "ID information") \ -_ELF_DEFINE_ODK(ODK_PAGESIZE, 11, "page size infomation") +_ELF_DEFINE_ODK(ODK_PAGESIZE, 11, "page size information") #undef _ELF_DEFINE_ODK #define _ELF_DEFINE_ODK(N, V, DESCR) N = V , Modified: vendor/elftoolchain/dist/cxxfilt/cxxfilt.c ============================================================================== --- vendor/elftoolchain/dist/cxxfilt/cxxfilt.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/cxxfilt/cxxfilt.c Thu May 19 20:06:56 2016 (r300228) @@ -35,7 +35,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: cxxfilt.c 3356 2016-01-22 22:31:38Z jkoshy $"); +ELFTC_VCSID("$Id: cxxfilt.c 3454 2016-05-07 17:11:05Z kaiwang27 $"); #define STRBUFSZ 8192 @@ -112,35 +112,18 @@ find_format(const char *fstr) } static char * -demangle(char *name, int strict, size_t *pos) +demangle(char *name) { static char dem[STRBUFSZ]; - char nb[STRBUFSZ]; - size_t p, t; - if (stripus && *name == '_') { - strncpy(nb, name + 1, sizeof(nb) - 1); - t = 1; - } else { - strncpy(nb, name, sizeof(nb) - 1); - t = 0; - } - nb[sizeof(nb) - 1] = '\0'; + if (stripus && *name == '_') + name++; - p = strlen(nb); - if (p == 0) - return NULL; - - while (elftc_demangle(nb, dem, sizeof(dem), (unsigned) format) < 0) { - if (!strict && p > 1) { - nb[--p] = '\0'; - continue; - } else - return (NULL); - } + if (strlen(name) == 0) + return (NULL); - if (pos != NULL) - *pos = t ? p + 1 : p; + if (elftc_demangle(name, dem, sizeof(dem), (unsigned) format) < 0) + return (NULL); return (dem); } @@ -149,7 +132,7 @@ int main(int argc, char **argv) { char *dem, buf[STRBUFSZ]; - size_t i, p, s; + size_t p; int c, n, opt; while ((opt = getopt_long(argc, argv, "_nps:V", longopts, NULL)) != @@ -184,8 +167,8 @@ main(int argc, char **argv) if (*argv != NULL) { for (n = 0; n < argc; n++) { - if ((dem = demangle(argv[n], 1, NULL)) == NULL) - fprintf(stderr, "Failed: %s\n", argv[n]); + if ((dem = demangle(argv[n])) == NULL) + printf("%s\n", argv[n]); else printf("%s\n", dem); } @@ -193,23 +176,18 @@ main(int argc, char **argv) p = 0; for (;;) { c = fgetc(stdin); - if (c == EOF || !isprint(c) || strchr(" \t\n", c)) { + if (c == EOF || !(isalnum(c) || strchr(".$_", c))) { if (p > 0) { buf[p] = '\0'; - if ((dem = demangle(buf, 0, &s)) == - NULL) + if ((dem = demangle(buf)) == NULL) printf("%s", buf); - else { + else printf("%s", dem); - for (i = s; i < p; i++) - putchar(buf[i]); - } p = 0; } if (c == EOF) break; - if (isprint(c) || strchr(" \t\n", c)) - putchar(c); + putchar(c); } else { if ((size_t) p >= sizeof(buf) - 1) warnx("buffer overflowed"); Modified: vendor/elftoolchain/dist/elfcopy/ascii.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/ascii.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/elfcopy/ascii.c Thu May 19 20:06:56 2016 (r300228) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: ascii.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: ascii.c 3446 2016-05-03 01:31:17Z emaste $"); static void append_data(struct section *s, const void *buf, size_t sz); static char hex_digit(uint8_t n); @@ -187,7 +187,7 @@ create_srec(struct elfcopy *ecp, int ifd if (elferr != 0) warnx("elf_nextscn failed: %s", elf_errmsg(elferr)); - /* Generate S{7,8,9} end of block recrod. */ + /* Generate S{7,8,9} end of block record. */ if (gelf_getehdr(e, &eh) == NULL) errx(EXIT_FAILURE, "gelf_getehdr() failed: %s", elf_errmsg(-1)); Modified: vendor/elftoolchain/dist/elfcopy/binary.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/binary.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/elfcopy/binary.c Thu May 19 20:06:56 2016 (r300228) @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -35,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: binary.c 3270 2015-12-11 18:48:56Z emaste $"); +ELFTC_VCSID("$Id: binary.c 3445 2016-04-20 19:08:30Z emaste $"); /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set @@ -213,9 +214,9 @@ create_elf_from_binary(struct elfcopy *e if ((sym_basename = strdup(ifn)) == NULL) err(1, "strdup"); - p = sym_basename; - while ((p = strchr(p, '.')) != NULL) - *p++ = '_'; + for (p = sym_basename; *p != '\0'; p++) + if (!isalnum(*p)) + *p = '_'; #define _GEN_SYMNAME(S) do { \ snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \ } while (0) Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.1 ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.1 Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.1 Thu May 19 20:06:56 2016 (r300228) @@ -21,9 +21,9 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3381 2016-01-30 19:39:47Z jkoshy $ +.\" $Id: elfcopy.1 3426 2016-03-05 13:32:28Z emaste $ .\" -.Dd January 29, 2016 +.Dd March 5, 2016 .Os .Dt ELFCOPY 1 .Sh NAME @@ -67,7 +67,10 @@ .Op Fl -change-section-vma Ar section Ns {+|-|=} Ns Ar val .Op Fl -extract-dwo .Op Fl -gap-fill Ns = Ns Ar val +.Op Fl -globalize-symbol Ns = Ns ar symbolname +.Op Fl -globalize-symbols Ns = Ns Ar filename .Op Fl -localize-hidden +.Op Fl -localize-symbols Ns = Ns Ar filename .Op Fl -no-adjust-warnings | Fl -no-change-warnings .Op Fl -only-keep-debug .Op Fl -pad-to Ns = Ns Ar address @@ -239,9 +242,21 @@ Copy only .dwo debug sections to the out Fill the gaps between sections with the byte value specified by the argument .Ar val . +.It Fl -globalize-symbol Ns = Ns Ar symbolname +Make the symbol named by argument +.Ar symbolname +global, so that it is visible outside of the file in which it is defined. +.It Fl -globalize-symbols Ns = Ns Ar filename +Make each symbol listed in the file specified by +.Ar filename +global. .It Fl -localize-hidden Make all hidden symbols local to the output file. This includes symbols with internal visiblity. +.It Fl -localize-symbols Ns = Ns Ar filename +Make each symbol listed in the file specified by +.Ar filename +local to the output file. .It Fl -no-adjust-warnings | Fl -no-change-warnings Do not issue a warning if the section specified by the options .Fl -change-section-address , Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.h ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.h Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.h Thu May 19 20:06:56 2016 (r300228) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfcopy.h 3310 2016-01-10 09:10:54Z kaiwang27 $ + * $Id: elfcopy.h 3446 2016-05-03 01:31:17Z emaste $ */ #include @@ -139,7 +139,8 @@ struct section { /* Internal data structure for segments. */ struct segment { - uint64_t addr; /* load addr */ + uint64_t vaddr; /* virtual addr (VMA) */ + uint64_t paddr; /* physical addr (LMA) */ uint64_t off; /* file offset */ uint64_t fsz; /* file size */ uint64_t msz; /* memory size */ @@ -177,7 +178,7 @@ struct elfcopy { Elftc_Bfd_Target_Flavor otf; /* flavour of output object */ const char *otgt; /* output target name */ int oec; /* elfclass of output object */ - unsigned char oed; /* endianess of output object */ + unsigned char oed; /* endianness of output object */ int oem; /* EM_XXX of output object */ int abi; /* OSABI of output object */ Elf *ein; /* ELF descriptor of input object */ @@ -237,7 +238,7 @@ struct elfcopy { uint64_t *secndx; /* section index map. */ uint64_t *symndx; /* symbol index map. */ unsigned char *v_rel; /* symbols needed by relocation. */ - unsigned char *v_grp; /* symbols refered by section group. */ + unsigned char *v_grp; /* symbols referred by section group. */ unsigned char *v_secsym; /* sections with section symbol. */ STAILQ_HEAD(, segment) v_seg; /* list of segments. */ STAILQ_HEAD(, sec_action) v_sac;/* list of section operations. */ Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/elfcopy/main.c Thu May 19 20:06:56 2016 (r300228) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3399 2016-02-12 18:07:56Z emaste $"); +ELFTC_VCSID("$Id: main.c 3446 2016-05-03 01:31:17Z emaste $"); enum options { @@ -209,6 +209,7 @@ static struct { {"openbsd", ELFOSABI_OPENBSD}, {"openvms", ELFOSABI_OPENVMS}, {"nsk", ELFOSABI_NSK}, + {"cloudabi", ELFOSABI_CLOUDABI}, {"arm", ELFOSABI_ARM}, {"standalone", ELFOSABI_STANDALONE}, {NULL, 0} @@ -235,7 +236,7 @@ static void strip_main(struct elfcopy *e static void strip_usage(void); /* - * An ELF object usually has a sturcture described by the + * An ELF object usually has a structure described by the * diagram below. * _____________ * | | @@ -641,6 +642,18 @@ create_file(struct elfcopy *ecp, const c * ELF object before processing. */ if (ecp->itf != ETF_ELF) { + /* + * If the output object is not an ELF file, choose an arbitrary + * ELF format for the intermediate file. srec, ihex and binary + * formats are independent of class, endianness and machine + * type so these choices do not affect the output. + */ + if (ecp->otf != ETF_ELF) { + if (ecp->oec == ELFCLASSNONE) + ecp->oec = ELFCLASS64; + if (ecp->oed == ELFDATANONE) + ecp->oed = ELFDATA2LSB; + } create_tempfile(&elftemp, &efd); if ((ecp->eout = elf_begin(efd, ELF_C_WRITE, NULL)) == NULL) errx(EXIT_FAILURE, "elf_begin() failed: %s", @@ -1434,7 +1447,7 @@ Usage: %s [options] infile [outfile]\n\ sections.\n\ --only-keep-debug Copy only debugging information.\n\ --output-target=FORMAT Use the specified format for the output.\n\ - --pad-to=ADDRESS Pad the output object upto the given address.\n\ + --pad-to=ADDRESS Pad the output object up to the given address.\n\ --prefix-alloc-sections=STRING\n\ Prefix the section names of all the allocated\n\ sections with STRING.\n\ Modified: vendor/elftoolchain/dist/elfcopy/sections.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/sections.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/elfcopy/sections.c Thu May 19 20:06:56 2016 (r300228) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3346 2016-01-17 20:09:15Z kaiwang27 $"); +ELFTC_VCSID("$Id: sections.c 3443 2016-04-15 18:57:54Z kaiwang27 $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); @@ -343,7 +343,7 @@ create_scn(struct elfcopy *ecp) GElf_Shdr ish; size_t indx; uint64_t oldndx, newndx; - int elferr, sec_flags; + int elferr, sec_flags, reorder; /* * Insert a pseudo section that contains the ELF header @@ -367,6 +367,7 @@ create_scn(struct elfcopy *ecp) errx(EXIT_FAILURE, "elf_getshstrndx failed: %s", elf_errmsg(-1)); + reorder = 0; is = NULL; while ((is = elf_nextscn(ecp->ein, is)) != NULL) { if (gelf_getshdr(is, &ish) == NULL) @@ -482,8 +483,20 @@ create_scn(struct elfcopy *ecp) /* create section header based on input object. */ if (strcmp(name, ".symtab") != 0 && strcmp(name, ".strtab") != 0 && - strcmp(name, ".shstrtab") != 0) + strcmp(name, ".shstrtab") != 0) { copy_shdr(ecp, s, NULL, 0, sec_flags); + /* + * elfcopy puts .symtab, .strtab and .shstrtab + * sections in the end of the output object. + * If the input objects have more sections + * after any of these 3 sections, the section + * table will be reordered. section symbols + * should be regenerated for relocations. + */ + if (reorder) + ecp->flags &= ~SYMTAB_INTACT; + } else + reorder = 1; if (strcmp(name, ".symtab") == 0) { ecp->flags |= SYMTAB_EXIST; @@ -1519,6 +1532,9 @@ add_gnu_debuglink(struct elfcopy *ecp) err(EXIT_FAILURE, "strdup failed"); if (stat(ecp->debuglink, &sb) == -1) err(EXIT_FAILURE, "stat failed"); + if (sb.st_size == 0) + errx(EXIT_FAILURE, "empty debug link target %s", + ecp->debuglink); if ((buf = malloc(sb.st_size)) == NULL) err(EXIT_FAILURE, "malloc failed"); if ((fp = fopen(ecp->debuglink, "r")) == NULL) Modified: vendor/elftoolchain/dist/elfcopy/segments.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/segments.c Thu May 19 20:03:01 2016 (r300227) +++ vendor/elftoolchain/dist/elfcopy/segments.c Thu May 19 20:06:56 2016 (r300228) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3397 2016-02-12 14:35:19Z emaste $"); +ELFTC_VCSID("$Id: segments.c 3449 2016-05-03 13:59:29Z emaste $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -72,12 +72,12 @@ add_to_inseg_list(struct elfcopy *ecp, s */ loadable = 0; STAILQ_FOREACH(seg, &ecp->v_seg, seg_list) { - if (s->off < seg->off || (s->vma < seg->addr && !s->pseudo)) + if (s->off < seg->off || (s->vma < seg->vaddr && !s->pseudo)) continue; if (s->off + s->sz > seg->off + seg->fsz && s->type != SHT_NOBITS) continue; - if (s->vma + s->sz > seg->addr + seg->msz) + if (s->vma + s->sz > seg->vaddr + seg->msz) continue; insert_to_inseg_list(seg, s); @@ -85,7 +85,12 @@ add_to_inseg_list(struct elfcopy *ecp, s s->seg = seg; else if (seg->type == PT_TLS) s->seg_tls = seg; - s->lma = seg->addr + (s->off - seg->off); + if (s->pseudo) + s->vma = seg->vaddr + (s->off - seg->off); + if (seg->paddr > 0) + s->lma = seg->paddr + (s->off - seg->off); + else + s->lma = 0; loadable = 1; } @@ -98,7 +103,7 @@ adjust_addr(struct elfcopy *ecp) struct section *s, *s0; struct segment *seg; struct sec_action *sac; - uint64_t dl, lma, start, end; + uint64_t dl, vma, lma, start, end; int found, i; /* @@ -110,59 +115,52 @@ adjust_addr(struct elfcopy *ecp) if (!s->loadable) continue; + /* Apply global VMA adjustment. */ + if (ecp->change_addr != 0) + s->vma += ecp->change_addr; + /* Apply global LMA adjustment. */ - if (ecp->change_addr != 0 && s->seg != NULL) + if (ecp->change_addr != 0 && s->seg != NULL && + s->seg->paddr > 0) s->lma += ecp->change_addr; - - if (!s->pseudo) { - /* Apply global VMA adjustment. */ - if (ecp->change_addr != 0) - s->vma += ecp->change_addr; - - /* Apply section VMA adjustment. */ - sac = lookup_sec_act(ecp, s->name, 0); - if (sac == NULL) - continue; - if (sac->setvma) - s->vma = sac->vma; - if (sac->vma_adjust != 0) - s->vma += sac->vma_adjust; - } } /* - * Apply sections LMA change in the second iteration. + * Apply sections VMA change in the second iteration. */ TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { - /* - * Only loadable section that's inside a segment can have - * LMA adjusted. - */ - if (!s->loadable || s->seg == NULL) + if (!s->loadable) continue; /* - * Check if there is a LMA change request for this + * Check if there is a VMA change request for this * section. */ sac = lookup_sec_act(ecp, s->name, 0); if (sac == NULL) continue; - if (!sac->setlma && sac->lma_adjust == 0) + vma = s->vma; + if (sac->setvma) + vma = sac->vma; + if (sac->vma_adjust != 0) + vma += sac->vma_adjust; + if (vma == s->vma) continue; - lma = s->lma; - if (sac->setlma) - lma = sac->lma; - if (sac->lma_adjust != 0) - lma += sac->lma_adjust; - if (lma == s->lma) + + /* + * No need to make segment adjustment if the section doesn't + * belong to any segment. + */ + if (s->seg == NULL) { + s->vma = vma; continue; + } /* - * Check if the LMA change is viable. + * Check if the VMA change is viable. * - * 1. Check if the new LMA is properly aligned accroding to + * 1. Check if the new VMA is properly aligned accroding to * section alignment. * * 2. Compute the new extent of segment that contains this @@ -170,37 +168,36 @@ adjust_addr(struct elfcopy *ecp) * segments. */ #ifdef DEBUG - printf("LMA for section %s: %#jx\n", s->name, lma); + printf("VMA for section %s: %#jx\n", s->name, vma); #endif - if (lma % s->align != 0) - errx(EXIT_FAILURE, "The load address %#jx for " + if (vma % s->align != 0) + errx(EXIT_FAILURE, "The VMA %#jx for " "section %s is not aligned to %ju", - (uintmax_t) lma, s->name, (uintmax_t) s->align); + (uintmax_t) vma, s->name, (uintmax_t) s->align); - if (lma < s->lma) { + if (vma < s->vma) { /* Move section to lower address. */ - if (lma < s->lma - s->seg->addr) + if (vma < s->vma - s->seg->vaddr) errx(EXIT_FAILURE, "Not enough space to move " - "section %s load address to %#jx", s->name, - (uintmax_t) lma); - start = lma - (s->lma - s->seg->addr); + "section %s VMA to %#jx", s->name, + (uintmax_t) vma); + start = vma - (s->vma - s->seg->vaddr); if (s == s->seg->v_sec[s->seg->nsec - 1]) end = start + s->seg->msz; else - end = s->seg->addr + s->seg->msz; - + end = s->seg->vaddr + s->seg->msz; } else { /* Move section to upper address. */ if (s == s->seg->v_sec[0]) - start = lma; + start = vma; else - start = s->seg->addr; - end = lma + (s->seg->addr + s->seg->msz - s->lma); + start = s->seg->vaddr; + end = vma + (s->seg->vaddr + s->seg->msz - s->vma); if (end < start) errx(EXIT_FAILURE, "Not enough space to move " - "section %s load address to %#jx", s->name, - (uintmax_t) lma); + "section %s VMA to %#jx", s->name, + (uintmax_t) vma); } #ifdef DEBUG @@ -211,34 +208,34 @@ adjust_addr(struct elfcopy *ecp) STAILQ_FOREACH(seg, &ecp->v_seg, seg_list) { if (seg == s->seg || seg->type != PT_LOAD) continue; - if (start > seg->addr + seg->msz) + if (start > seg->vaddr + seg->msz) continue; - if (end < seg->addr) + if (end < seg->vaddr) continue; errx(EXIT_FAILURE, "The extent of segment containing " "section %s overlaps with segment(%#jx,%#jx)", - s->name, (uintmax_t) seg->addr, - (uintmax_t) (seg->addr + seg->msz)); + s->name, (uintmax_t) seg->vaddr, + (uintmax_t) (seg->vaddr + seg->msz)); } /* - * Update section LMA and file offset. + * Update section VMA and file offset. */ - if (lma < s->lma) { + if (vma < s->vma) { /* - * To move a section to lower load address, we decrease - * the load addresses of the section and all the - * sections that are before it, and we increase the - * file offsets of all the sections that are after it. + * To move a section to lower VMA, we decrease + * the VMA of the section and all the sections that + * are before it, and we increase the file offsets + * of all the sections that are after it. */ - dl = s->lma - lma; + dl = s->vma - vma; for (i = 0; i < s->seg->nsec; i++) { s0 = s->seg->v_sec[i]; - s0->lma -= dl; + s0->vma -= dl; #ifdef DEBUG - printf("section %s LMA set to %#jx\n", - s0->name, (uintmax_t) s0->lma); + printf("section %s VMA set to %#jx\n", + s0->name, (uintmax_t) s0->vma); #endif if (s0 == s) break; @@ -253,13 +250,13 @@ adjust_addr(struct elfcopy *ecp) } } else { /* - * To move a section to upper load address, we increase - * the load addresses of the section and all the - * sections that are after it, and we increase the - * their file offsets too unless the section in question + * To move a section to upper VMA, we increase + * the VMA of the section and all the sections that + * are after it, and we increase the their file + * offsets too unless the section in question * is the first in its containing segment. */ - dl = lma - s->lma; + dl = vma - s->vma; for (i = 0; i < s->seg->nsec; i++) if (s->seg->v_sec[i] == s) break; @@ -269,9 +266,9 @@ adjust_addr(struct elfcopy *ecp) s->name); for (; i < s->seg->nsec; i++) { s0 = s->seg->v_sec[i]; - s0->lma += dl; + s0->vma += dl; #ifdef DEBUG - printf("section %s LMA set to %#jx\n", + printf("section %s VMA set to %#jx\n", s0->name, (uintmax_t) s0->lma); #endif if (s != s->seg->v_sec[0]) { @@ -292,9 +289,8 @@ adjust_addr(struct elfcopy *ecp) if (ecp->pad_to != 0) { /* - * Find the section with highest load address. + * Find the section with highest VMA. */ - s = NULL; STAILQ_FOREACH(seg, &ecp->v_seg, seg_list) { if (seg->type != PT_LOAD) @@ -308,26 +304,113 @@ adjust_addr(struct elfcopy *ecp) s = seg->v_sec[i]; else { s0 = seg->v_sec[i]; - if (s0->lma > s->lma) + if (s0->vma > s->vma) s = s0; } } if (s == NULL) - goto issue_warn; + goto adjust_lma; /* No need to pad if the pad_to address is lower. */ - if (ecp->pad_to <= s->lma + s->sz) - goto issue_warn; + if (ecp->pad_to <= s->vma + s->sz) + goto adjust_lma; - s->pad_sz = ecp->pad_to - (s->lma + s->sz); + s->pad_sz = ecp->pad_to - (s->vma + s->sz); #ifdef DEBUG - printf("pad section %s load to address %#jx by %#jx\n", s->name, + printf("pad section %s VMA to address %#jx by %#jx\n", s->name, (uintmax_t) ecp->pad_to, (uintmax_t) s->pad_sz); #endif } -issue_warn: + +adjust_lma: + + /* + * Apply sections LMA change in the third iteration. + */ + TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { + + /* + * Only loadable section that's inside a segment can have + * LMA adjusted. Also, if LMA of the containing segment is + * set to 0, it probably means we should ignore the LMA. + */ + if (!s->loadable || s->seg == NULL || s->seg->paddr == 0) + continue; + + /* + * Check if there is a LMA change request for this + * section. + */ + sac = lookup_sec_act(ecp, s->name, 0); + if (sac == NULL) + continue; + if (!sac->setlma && sac->lma_adjust == 0) + continue; + lma = s->lma; + if (sac->setlma) + lma = sac->lma; + if (sac->lma_adjust != 0) + lma += sac->lma_adjust; + if (lma == s->lma) + continue; + +#ifdef DEBUG + printf("LMA for section %s: %#jx\n", s->name, lma); +#endif + + /* Check alignment. */ + if (lma % s->align != 0) + errx(EXIT_FAILURE, "The LMA %#jx for " + "section %s is not aligned to %ju", + (uintmax_t) lma, s->name, (uintmax_t) s->align); + + /* + * Update section LMA. + */ + + if (lma < s->lma) { + /* + * To move a section to lower LMA, we decrease + * the LMA of the section and all the sections that + * are before it. + */ + dl = s->lma - lma; + for (i = 0; i < s->seg->nsec; i++) { + s0 = s->seg->v_sec[i]; + s0->lma -= dl; +#ifdef DEBUG + printf("section %s LMA set to %#jx\n", + s0->name, (uintmax_t) s0->lma); +#endif + if (s0 == s) + break; + } + } else { + /* + * To move a section to upper LMA, we increase + * the LMA of the section and all the sections that + * are after it. + */ + dl = lma - s->lma; + for (i = 0; i < s->seg->nsec; i++) + if (s->seg->v_sec[i] == s) + break; + if (i >= s->seg->nsec) + errx(EXIT_FAILURE, "Internal: section `%s' not" + " found in its containing segement", + s->name); + for (; i < s->seg->nsec; i++) { + s0 = s->seg->v_sec[i]; + s0->lma += dl; +#ifdef DEBUG + printf("section %s LMA set to %#jx\n", + s0->name, (uintmax_t) s0->lma); +#endif + } + } + } /* * Issue a warning if there are VMA/LMA adjust requests for @@ -385,8 +468,7 @@ setup_phdr(struct elfcopy *ecp) { struct segment *seg; GElf_Phdr iphdr; - size_t iphnum; - int i; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 19 20:08:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E791B42305; Thu, 19 May 2016 20:08:17 +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 15E0411E4; Thu, 19 May 2016 20:08:17 +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 u4JK8Gqi090819; Thu, 19 May 2016 20:08:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JK8GEV090818; Thu, 19 May 2016 20:08:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605192008.u4JK8GEV090818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 May 2016 20:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r300229 - vendor/elftoolchain/elftoolchain-r3475 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 20:08:17 -0000 Author: emaste Date: Thu May 19 20:08:16 2016 New Revision: 300229 URL: https://svnweb.freebsd.org/changeset/base/300229 Log: Tag ELF Tool Chain r3475 Added: vendor/elftoolchain/elftoolchain-r3475/ - copied from r300228, vendor/elftoolchain/dist/ From owner-svn-src-all@freebsd.org Thu May 19 20:51:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B6D8B42F3B; Thu, 19 May 2016 20:51:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F09FE18EE; Thu, 19 May 2016 20:51:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JKpmfG005589; Thu, 19 May 2016 20:51:48 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JKpmRU005588; Thu, 19 May 2016 20:51:48 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605192051.u4JKpmRU005588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 19 May 2016 20:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300230 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 20:51:49 -0000 Author: gonzo Date: Thu May 19 20:51:47 2016 New Revision: 300230 URL: https://svnweb.freebsd.org/changeset/base/300230 Log: Fixed memory leak in FDT overlay handling code Free both overlay and new fdt before returning after fdt_open_into error PR: 209634 Submitted by: David Binderman Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Thu May 19 20:08:16 2016 (r300229) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu May 19 20:51:47 2016 (r300230) @@ -383,6 +383,8 @@ fdt_apply_overlays() rv = fdt_open_into(fdtp, new_fdtp, new_fdtp_size); if (rv != 0) { printf("failed to open DTB blob for applying overlays\n"); + free(new_fdtp); + free(overlay); return; } From owner-svn-src-all@freebsd.org Thu May 19 21:05:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAFAB41398; Thu, 19 May 2016 21:05:00 +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 6753B127C; Thu, 19 May 2016 21:05:00 +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 u4JL4xOI008810; Thu, 19 May 2016 21:04:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JL4xkO008809; Thu, 19 May 2016 21:04:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605192104.u4JL4xkO008809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 May 2016 21:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300231 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 21:05:00 -0000 Author: emaste Date: Thu May 19 21:04:59 2016 New Revision: 300231 URL: https://svnweb.freebsd.org/changeset/base/300231 Log: elf_common.h: add section header flag and dynamic types SHF_COMPRESSED section contains compressed data DT_TLSDESC_PLT Location of PLT entry for TLS descriptor resolver calls DT_TLSDESC_GOT Location of GOT entry used by resolver PLT entry MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu May 19 20:51:47 2016 (r300230) +++ head/sys/sys/elf_common.h Thu May 19 21:04:59 2016 (r300231) @@ -473,6 +473,7 @@ typedef struct { #define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */ #define SHF_GROUP 0x200 /* Member of section group. */ #define SHF_TLS 0x400 /* Section contains TLS data. */ +#define SHF_COMPRESSED 0x800 /* Section contains compressed data. */ #define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ #define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ @@ -608,6 +609,8 @@ typedef struct { */ #define DT_ADDRRNGLO 0x6ffffe00 #define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table */ +#define DT_TLSDESC_PLT 0x6ffffef6 /* loc. of PLT for tlsdesc resolver */ +#define DT_TLSDESC_GOT 0x6ffffef7 /* loc. of GOT for tlsdesc resolver */ #define DT_GNU_CONFLICT 0x6ffffef8 /* address of conflict section */ #define DT_GNU_LIBLIST 0x6ffffef9 /* address of library list */ #define DT_CONFIG 0x6ffffefa /* configuration information */ From owner-svn-src-all@freebsd.org Thu May 19 21:08:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B2A7B4155B; Thu, 19 May 2016 21:08:35 +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 4D223169E; Thu, 19 May 2016 21:08:35 +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 u4JL8YNM008979; Thu, 19 May 2016 21:08:34 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JL8XhL008967; Thu, 19 May 2016 21:08:33 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192108.u4JL8XhL008967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 21:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300232 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 21:08:35 -0000 Author: avos Date: Thu May 19 21:08:33 2016 New Revision: 300232 URL: https://svnweb.freebsd.org/changeset/base/300232 Log: net80211: fix more compiler warnings. ieee80211.c: add_chanlist(): 'error' variable will be uninitialized if no channels were passed; return '0' instead. ieee80211_action.c: ieee80211_send_action_register(): drop 'break' after 'return'. ieee80211_crypto_none.c: none_encap(): 'keyid' is not used in non-debug builds; hide it behind IEEE80211_DEBUG ifdef. ieee80211_freebsd.c: Staticize global 'ieee80211_debug' variable (used only in this file). ieee80211_hostap.c: Fix a comment (associatio -> association). ieee80211_ht.c: ieee80211_setup_htrates(): initialize 'maxunequalmcs' to 0 to mute compiler warning. ieee80211_hwmp.c: hwmp_recv_preq(): copy 'prep' between conditional blocks to fix -Wshadow warning. ieee80211_mesh.c: mesh_newstate(): remove duplicate 'ni' definition. mesh_recv_group_data(): fix -Wempty-body warning in non-debug builds. ieee80211_phy.c: ieee80211_compute_duration(): remove 'break' after panic() call. ieee80211_scan_sta.c: Hide some TDMA-specific macros under IEEE80211_SUPPORT_TDMA ifdef adhoc_pick_bss(): remove 'ic' pointer redefinition. ieee80211_sta.c: sta_beacon_miss(): remove 'ic' pointer redefinition. ieee80211_superg.c: superg_ioctl_set80211(): drop unreachable return. Tested with clang 3.8.0, gcc 4.6.4 and gcc 5.3.0. Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_action.c head/sys/net80211/ieee80211_crypto_none.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_phy.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_superg.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211.c Thu May 19 21:08:33 2016 (r300232) @@ -1207,7 +1207,7 @@ add_chanlist(struct ieee80211_channel ch } } - return (error); + return (0); } int Modified: head/sys/net80211/ieee80211_action.c ============================================================================== --- head/sys/net80211/ieee80211_action.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_action.c Thu May 19 21:08:33 2016 (r300232) @@ -103,7 +103,6 @@ ieee80211_send_action_register(int cat, break; meshaction_send_action[act] = f; return 0; - break; case IEEE80211_ACTION_CAT_VENDOR: if (act >= nitems(vendor_send_action)) break; Modified: head/sys/net80211/ieee80211_crypto_none.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_none.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_crypto_none.c Thu May 19 21:08:33 2016 (r300232) @@ -101,7 +101,6 @@ none_encap(struct ieee80211_key *k, stru struct ieee80211vap *vap = k->wk_private; #ifdef IEEE80211_DEBUG struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); -#endif uint8_t keyid; keyid = ieee80211_crypto_get_keyid(vap, k); @@ -112,6 +111,7 @@ none_encap(struct ieee80211_key *k, stru */ IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr1, "key id %u is not set (encap)", keyid); +#endif vap->iv_stats.is_tx_badcipher++; return 0; } Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_freebsd.c Thu May 19 21:08:33 2016 (r300232) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD, 0, "IEEE 80211 parameters"); #ifdef IEEE80211_DEBUG -int ieee80211_debug = 0; +static int ieee80211_debug = 0; SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug, 0, "debugging printfs"); #endif Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_hostap.c Thu May 19 21:08:33 2016 (r300232) @@ -1067,7 +1067,7 @@ hostap_auth_shared(struct ieee80211_node */ ni->ni_flags |= IEEE80211_NODE_AREF; /* - * Mark the node as requiring a valid associatio id + * Mark the node as requiring a valid association id * before outbound traffic is permitted. */ ni->ni_flags |= IEEE80211_NODE_ASSOCID; Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_ht.c Thu May 19 21:08:33 2016 (r300232) @@ -1643,6 +1643,7 @@ ieee80211_setup_htrates(struct ieee80211 int i, maxequalmcs, maxunequalmcs; maxequalmcs = ic->ic_txstream * 8 - 1; + maxunequalmcs = 0; if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) { if (ic->ic_txstream >= 2) maxunequalmcs = 38; @@ -1650,8 +1651,7 @@ ieee80211_setup_htrates(struct ieee80211 maxunequalmcs = 52; if (ic->ic_txstream >= 4) maxunequalmcs = 76; - } else - maxunequalmcs = 0; + } rs = &ni->ni_htrates; memset(rs, 0, sizeof(*rs)); Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_hwmp.c Thu May 19 21:08:33 2016 (r300232) @@ -944,7 +944,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_hwmp_route *hrorig = NULL; struct ieee80211_hwmp_route *hrtarg = NULL; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_meshprep_ie prep; ieee80211_hwmp_seq preqid; /* last seen preqid for orig */ uint32_t metric = 0; @@ -1057,6 +1056,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, IEEE80211_ADDR_EQ(vap->iv_myaddr, rttarg->rt_mesh_gate) && rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY && rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { + struct ieee80211_meshprep_ie prep; + /* * When we are the target we shall update our own HWMP seq * number with max of (current and preq->seq) + 1 @@ -1139,6 +1140,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ if ((rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 || (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_PP)) { + struct ieee80211_meshprep_ie prep; + prep.prep_flags = 0; prep.prep_hopcount = 0; prep.prep_ttl = ms->ms_ttl; Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_mesh.c Thu May 19 21:08:33 2016 (r300232) @@ -803,16 +803,15 @@ mesh_newstate(struct ieee80211vap *vap, * Update bss node channel to reflect where * we landed after CSA. */ - ieee80211_node_set_chan(vap->iv_bss, + ieee80211_node_set_chan(ni, ieee80211_ht_adjust_channel(ic, ic->ic_curchan, - ieee80211_htchanflags(vap->iv_bss->ni_chan))); + ieee80211_htchanflags(ni->ni_chan))); /* XXX bypass debug msgs */ break; case IEEE80211_S_SCAN: case IEEE80211_S_RUN: #ifdef IEEE80211_DEBUG if (ieee80211_msg_debug(vap)) { - struct ieee80211_node *ni = vap->iv_bss; ieee80211_note(vap, "synchronized with %s meshid ", ether_sprintf(ni->ni_meshid)); @@ -827,7 +826,7 @@ mesh_newstate(struct ieee80211vap *vap, default: break; } - ieee80211_node_authorize(vap->iv_bss); + ieee80211_node_authorize(ni); callout_reset(&ms->ms_cleantimer, ms->ms_ppath->mpp_inact, mesh_rt_cleanup_cb, vap); mesh_gatemode_setup(vap); @@ -1510,10 +1509,11 @@ mesh_recv_group_data(struct ieee80211vap * will sent it on another port member. */ if (ms->ms_flags & IEEE80211_MESHFLAGS_GATE && - ms->ms_flags & IEEE80211_MESHFLAGS_FWD) + ms->ms_flags & IEEE80211_MESHFLAGS_FWD) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, MC01(mc)->mc_addr4, "%s", "forward from MBSS to the DS"); + } } } return (0); /* process locally */ Modified: head/sys/net80211/ieee80211_phy.c ============================================================================== --- head/sys/net80211/ieee80211_phy.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_phy.c Thu May 19 21:08:33 2016 (r300232) @@ -563,7 +563,6 @@ ieee80211_compute_duration(const struct default: panic("%s: unknown phy %u (rate %u)\n", __func__, rt->info[rix].phy, rate); - break; } return txTime; } Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_scan_sta.c Thu May 19 21:08:33 2016 (r300232) @@ -129,11 +129,13 @@ static void sta_flush_table(struct sta_t #define MATCH_NOTSEEN 0x00080 /* not seen in recent scans */ #define MATCH_RSSI 0x00100 /* rssi deemed too low to use */ #define MATCH_CC 0x00200 /* country code mismatch */ +#ifdef IEEE80211_SUPPORT_TDMA #define MATCH_TDMA_NOIE 0x00400 /* no TDMA ie */ #define MATCH_TDMA_NOTMASTER 0x00800 /* not TDMA master */ #define MATCH_TDMA_NOSLOT 0x01000 /* all TDMA slots occupied */ #define MATCH_TDMA_LOCAL 0x02000 /* local address */ #define MATCH_TDMA_VERSION 0x04000 /* protocol version mismatch */ +#endif #define MATCH_MESH_NOID 0x10000 /* no MESHID ie */ #define MATCH_MESHID 0x20000 /* meshid mismatch */ static int match_bss(struct ieee80211vap *, @@ -1615,7 +1617,6 @@ notfound: } else chan = vap->iv_des_chan; if (chan != NULL) { - struct ieee80211com *ic = vap->iv_ic; /* * Create a HT capable IBSS; the per-node * probe request/response will result in Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_sta.c Thu May 19 21:08:33 2016 (r300232) @@ -154,7 +154,6 @@ sta_beacon_miss(struct ieee80211vap *vap vap->iv_stats.is_beacon_miss++; if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) { #ifdef IEEE80211_SUPPORT_SUPERG - struct ieee80211com *ic = vap->iv_ic; /* * If we receive a beacon miss interrupt when using Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Thu May 19 21:04:59 2016 (r300231) +++ head/sys/net80211/ieee80211_superg.c Thu May 19 21:08:33 2016 (r300232) @@ -1044,7 +1044,6 @@ superg_ioctl_set80211(struct ieee80211va default: return ENOSYS; } - return 0; } IEEE80211_IOCTL_SET(superg, superg_ioctl_set80211); From owner-svn-src-all@freebsd.org Thu May 19 21:41:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77C55B421C1; Thu, 19 May 2016 21:41: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 2B0231E35; Thu, 19 May 2016 21:41: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 u4JLfZ1j020506; Thu, 19 May 2016 21:41:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JLfZEM020505; Thu, 19 May 2016 21:41:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192141.u4JLfZEM020505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 21:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300233 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 21:41:36 -0000 Author: bdrewery Date: Thu May 19 21:41:35 2016 New Revision: 300233 URL: https://svnweb.freebsd.org/changeset/base/300233 Log: Allow MK_ overrides. This is a direct commit to stable. This was done in head in r264661 and is needed to force certain options off for ports. PR: D6271 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/bsd.own.mk Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Thu May 19 21:08:33 2016 (r300232) +++ stable/10/share/mk/bsd.own.mk Thu May 19 21:41:35 2016 (r300233) @@ -483,9 +483,6 @@ __DEFAULT_NO_OPTIONS+=HYPERV .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if defined(WITHOUT_${var}) MK_${var}:= no .else @@ -501,9 +498,6 @@ MK_${var}:= yes .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if defined(WITH_${var}) MK_${var}:= yes .else @@ -621,9 +615,6 @@ MK_TESTS:= no .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. .endif -.if defined(MK_${var}_SUPPORT) -.error MK_${var}_SUPPORT can't be set by a user. -.endif .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" MK_${var}_SUPPORT:= no .else @@ -640,9 +631,6 @@ MK_${var}_SUPPORT:= yes .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. .endif -.if defined(MK_${vv:H}) -.error MK_${vv:H} can't be set by a user. -.endif .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) @@ -661,9 +649,6 @@ MK_${vv:H}:= ${MK_${vv:T}} .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if ${COMPILER_FEATURES:Mc++11} .if defined(WITHOUT_${var}) MK_${var}:= no From owner-svn-src-all@freebsd.org Thu May 19 21:44:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF702B42317; Thu, 19 May 2016 21:44:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97F68118F; Thu, 19 May 2016 21:44:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JLiX3K021301; Thu, 19 May 2016 21:44:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JLiXEK021300; Thu, 19 May 2016 21:44:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192144.u4JLiXEK021300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 21:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300234 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 21:44:35 -0000 Author: bdrewery Date: Thu May 19 21:44:33 2016 New Revision: 300234 URL: https://svnweb.freebsd.org/changeset/base/300234 Log: MFS r300233: Allow MK_ overrides PR: D6271 Modified: stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Thu May 19 21:41:35 2016 (r300233) +++ stable/9/share/mk/bsd.own.mk Thu May 19 21:44:33 2016 (r300234) @@ -507,9 +507,6 @@ __DEFAULT_NO_OPTIONS+=FDT .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if defined(WITHOUT_${var}) MK_${var}:= no .else @@ -525,9 +522,6 @@ MK_${var}:= yes .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if defined(WITH_${var}) MK_${var}:= yes .else @@ -645,9 +639,6 @@ MK_CLANG_IS_CC:= no .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. .endif -.if defined(MK_${var}_SUPPORT) -.error MK_${var}_SUPPORT can't be set by a user. -.endif .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" MK_${var}_SUPPORT:= no .else @@ -664,9 +655,6 @@ MK_${var}_SUPPORT:= yes .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. .endif -.if defined(MK_${vv:H}) -.error MK_${vv:H} can't be set by a user. -.endif .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) @@ -685,9 +673,6 @@ MK_${vv:H}:= ${MK_${vv:T}} .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if ${COMPILER_FEATURES:Mc++11} .if defined(WITHOUT_${var}) MK_${var}:= no From owner-svn-src-all@freebsd.org Thu May 19 21:47:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D08EB423D7; Thu, 19 May 2016 21:47: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 1A305138D; Thu, 19 May 2016 21:47:33 +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 u4JLlW43021453; Thu, 19 May 2016 21:47:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JLlWWU021452; Thu, 19 May 2016 21:47:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192147.u4JLlWWU021452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 21:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300235 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 21:47:33 -0000 Author: bdrewery Date: Thu May 19 21:47:32 2016 New Revision: 300235 URL: https://svnweb.freebsd.org/changeset/base/300235 Log: Bump version for r300233 Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Thu May 19 21:44:33 2016 (r300234) +++ stable/10/sys/sys/param.h Thu May 19 21:47:32 2016 (r300235) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu May 19 21:47:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EE19B42436; Thu, 19 May 2016 21:47: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 EFF0A1662; Thu, 19 May 2016 21:47:58 +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 u4JLlwxT021511; Thu, 19 May 2016 21:47:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JLlwlv021510; Thu, 19 May 2016 21:47:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192147.u4JLlwlv021510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 21:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300236 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 21:47:59 -0000 Author: bdrewery Date: Thu May 19 21:47:57 2016 New Revision: 300236 URL: https://svnweb.freebsd.org/changeset/base/300236 Log: Bump version for r300234 Modified: stable/9/sys/sys/param.h Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Thu May 19 21:47:32 2016 (r300235) +++ stable/9/sys/sys/param.h Thu May 19 21:47:57 2016 (r300236) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 903509 /* Master, propagated to newvers */ +#define __FreeBSD_version 903510 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu May 19 22:02:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67293B42886; Thu, 19 May 2016 22:02: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 349221D93; Thu, 19 May 2016 22:02: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 u4JM23qE027246; Thu, 19 May 2016 22:02:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JM23sW027245; Thu, 19 May 2016 22:02:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192202.u4JM23sW027245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 22:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300237 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:02:04 -0000 Author: avos Date: Thu May 19 22:02:03 2016 New Revision: 300237 URL: https://svnweb.freebsd.org/changeset/base/300237 Log: net80211: restore interface state check for IEEE80211_IOC_SCAN_REQ ioctl. Do not try to start a scan when interface is not running. How-to-reproduce: 1) ifconfig wlan0 create wlandev urtwn0 2) wlandebug -i wlan0 state 3) ifconfig wlan0 scan Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu May 19 21:47:57 2016 (r300236) +++ head/sys/net80211/ieee80211_ioctl.c Thu May 19 22:02:03 2016 (r300237) @@ -2486,6 +2486,11 @@ ieee80211_scanreq(struct ieee80211vap *v * Otherwise just invoke the scan machinery directly. */ IEEE80211_LOCK(ic); + if (ic->ic_nrunning == 0) { + IEEE80211_UNLOCK(ic); + return ENXIO; + } + if (vap->iv_state == IEEE80211_S_INIT) { /* NB: clobbers previous settings */ vap->iv_scanreq_flags = sr->sr_flags; From owner-svn-src-all@freebsd.org Thu May 19 22:14:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71AD6B42C72; Thu, 19 May 2016 22:14: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 4935E178C; Thu, 19 May 2016 22:14: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 u4JMEZpb030573; Thu, 19 May 2016 22:14:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMEZ4E030571; Thu, 19 May 2016 22:14:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192214.u4JMEZ4E030571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 22:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300238 - head/sys/dev/wi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:14:36 -0000 Author: avos Date: Thu May 19 22:14:35 2016 New Revision: 300238 URL: https://svnweb.freebsd.org/changeset/base/300238 Log: wi: switch to ieee80211_add_channel() - Convert to ieee80211_add_channel(). - Add ic_getradiocaps() method. Differential Revision: https://reviews.freebsd.org/D6235 Modified: head/sys/dev/wi/if_wi.c head/sys/dev/wi/if_wivar.h Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Thu May 19 22:02:03 2016 (r300237) +++ head/sys/dev/wi/if_wi.c Thu May 19 22:14:35 2016 (r300238) @@ -155,9 +155,12 @@ static int wi_mwrite_bap(struct wi_soft static int wi_read_rid(struct wi_softc *, int, void *, int *); static int wi_write_rid(struct wi_softc *, int, const void *, int); static int wi_write_appie(struct wi_softc *, int, const struct ieee80211_appie *); +static u_int16_t wi_read_chanmask(struct wi_softc *); static void wi_scan_start(struct ieee80211com *); static void wi_scan_end(struct ieee80211com *); +static void wi_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void wi_set_channel(struct ieee80211com *); static __inline int @@ -335,23 +338,9 @@ wi_attach(device_t dev) * Query the card for available channels and setup the * channel table. We assume these are all 11b channels. */ - buflen = sizeof(val); - if (wi_read_rid(sc, WI_RID_CHANNEL_LIST, &val, &buflen) != 0) - val = htole16(0x1fff); /* assume 1-13 */ - KASSERT(val != 0, ("wi_attach: no available channels listed!")); - - val <<= 1; /* shift for base 1 indices */ - for (i = 1; i < 16; i++) { - struct ieee80211_channel *c; - - if (!isset((u_int8_t*)&val, i)) - continue; - c = &ic->ic_channels[ic->ic_nchans++]; - c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_B); - c->ic_flags = IEEE80211_CHAN_B; - c->ic_ieee = i; - /* XXX txpowers? */ - } + sc->sc_chanmask = wi_read_chanmask(sc); + wi_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); /* * Set flags based on firmware version. @@ -439,6 +428,7 @@ wi_attach(device_t dev) ic->ic_raw_xmit = wi_raw_xmit; ic->ic_scan_start = wi_scan_start; ic->ic_scan_end = wi_scan_end; + ic->ic_getradiocaps = wi_getradiocaps; ic->ic_set_channel = wi_set_channel; ic->ic_vap_create = wi_vap_create; ic->ic_vap_delete = wi_vap_delete; @@ -697,6 +687,26 @@ wi_stop(struct wi_softc *sc, int disable } static void +wi_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct wi_softc *sc = ic->ic_softc; + u_int8_t bands[IEEE80211_MODE_MAX]; + int i; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + + for (i = 1; i < 16; i++) { + if (sc->sc_chanmask & (1 << i)) { + /* XXX txpowers? */ + ieee80211_add_channel(chans, maxchans, nchans, + i, 0, 0, 0, bands); + } + } +} + +static void wi_set_channel(struct ieee80211com *ic) { struct wi_softc *sc = ic->ic_softc; @@ -1988,6 +1998,22 @@ wi_write_appie(struct wi_softc *sc, int return wi_write_rid(sc, rid, buf, ie->ie_len + sizeof(uint16_t)); } +static u_int16_t +wi_read_chanmask(struct wi_softc *sc) +{ + u_int16_t val; + int buflen; + + buflen = sizeof(val); + if (wi_read_rid(sc, WI_RID_CHANNEL_LIST, &val, &buflen) != 0) + val = htole16(0x1fff); /* assume 1-13 */ + KASSERT(val != 0, ("%s: no available channels listed!", __func__)); + + val <<= 1; /* shift for base 1 indices */ + + return (val); +} + int wi_alloc(device_t dev, int rid) { Modified: head/sys/dev/wi/if_wivar.h ============================================================================== --- head/sys/dev/wi/if_wivar.h Thu May 19 22:02:03 2016 (r300237) +++ head/sys/dev/wi/if_wivar.h Thu May 19 22:14:35 2016 (r300238) @@ -114,6 +114,7 @@ struct wi_softc { u_int16_t sc_portnum; u_int16_t sc_encryption; u_int16_t sc_monitor_port; + u_int16_t sc_chanmask; /* RSSI interpretation */ u_int16_t sc_min_rssi; /* clamp sc_min_rssi < RSSI */ From owner-svn-src-all@freebsd.org Thu May 19 22:19:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0155B42D1F; Thu, 19 May 2016 22:19: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 AAE581A1A; Thu, 19 May 2016 22:19: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 u4JMJZ03030775; Thu, 19 May 2016 22:19:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMJZFq030773; Thu, 19 May 2016 22:19:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192219.u4JMJZFq030773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 22:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300239 - head/sys/dev/ipw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:19:36 -0000 Author: avos Date: Thu May 19 22:19:35 2016 New Revision: 300239 URL: https://svnweb.freebsd.org/changeset/base/300239 Log: ipw: switch to ieee80211_add_channel() - Convert to ieee80211_add_channel(). - Add ic_getradiocaps() method. Differential Revision: https://reviews.freebsd.org/D6236 Modified: head/sys/dev/ipw/if_ipw.c head/sys/dev/ipw/if_ipwvar.h Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Thu May 19 22:14:35 2016 (r300238) +++ head/sys/dev/ipw/if_ipw.c Thu May 19 22:19:35 2016 (r300239) @@ -116,6 +116,7 @@ static void ipw_release(struct ipw_softc static void ipw_media_status(struct ifnet *, struct ifmediareq *); static int ipw_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t ipw_read_prom_word(struct ipw_softc *, uint8_t); +static uint16_t ipw_read_chanmask(struct ipw_softc *); static void ipw_rx_cmd_intr(struct ipw_softc *, struct ipw_soft_buf *); static void ipw_rx_newstate_intr(struct ipw_softc *, struct ipw_soft_buf *); static void ipw_rx_data_intr(struct ipw_softc *, struct ipw_status *, @@ -164,6 +165,8 @@ static void ipw_write_mem_1(struct ipw_s static int ipw_scan(struct ipw_softc *); static void ipw_scan_start(struct ieee80211com *); static void ipw_scan_end(struct ieee80211com *); +static void ipw_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void ipw_set_channel(struct ieee80211com *); static void ipw_scan_curchan(struct ieee80211_scan_state *, unsigned long maxdwell); @@ -221,7 +224,6 @@ ipw_attach(device_t dev) { struct ipw_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_channel *c; uint16_t val; int error, i; @@ -292,18 +294,9 @@ ipw_attach(device_t dev) ic->ic_macaddr[4] = val >> 8; ic->ic_macaddr[5] = val & 0xff; - /* set supported .11b channels (read from EEPROM) */ - if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0) - val = 0x7ff; /* default to channels 1-11 */ - val <<= 1; - for (i = 1; i < 16; i++) { - if (val & (1 << i)) { - c = &ic->ic_channels[ic->ic_nchans++]; - c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ); - c->ic_flags = IEEE80211_CHAN_B; - c->ic_ieee = i; - } - } + sc->chanmask = ipw_read_chanmask(sc); + ipw_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); /* check support for radio transmitter switch in EEPROM */ if (!(ipw_read_prom_word(sc, IPW_EEPROM_RADIO) & 8)) @@ -312,6 +305,7 @@ ipw_attach(device_t dev) ieee80211_ifattach(ic); ic->ic_scan_start = ipw_scan_start; ic->ic_scan_end = ipw_scan_end; + ic->ic_getradiocaps = ipw_getradiocaps; ic->ic_set_channel = ipw_set_channel; ic->ic_scan_curchan = ipw_scan_curchan; ic->ic_scan_mindwell = ipw_scan_mindwell; @@ -966,6 +960,19 @@ ipw_read_prom_word(struct ipw_softc *sc, return le16toh(val); } +static uint16_t +ipw_read_chanmask(struct ipw_softc *sc) +{ + uint16_t val; + + /* set supported .11b channels (read from EEPROM) */ + if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0) + val = 0x7ff; /* default to channels 1-11 */ + val <<= 1; + + return (val); +} + static void ipw_rx_cmd_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf) { @@ -2616,6 +2623,26 @@ ipw_scan_start(struct ieee80211com *ic) } static void +ipw_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct ipw_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + int i; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + + for (i = 1; i < 16; i++) { + if (sc->chanmask & (1 << i)) { + ieee80211_add_channel(chans, maxchans, nchans, + i, 0, 0, 0, bands); + } + } + +} + +static void ipw_set_channel(struct ieee80211com *ic) { struct ipw_softc *sc = ic->ic_softc; Modified: head/sys/dev/ipw/if_ipwvar.h ============================================================================== --- head/sys/dev/ipw/if_ipwvar.h Thu May 19 22:14:35 2016 (r300238) +++ head/sys/dev/ipw/if_ipwvar.h Thu May 19 22:19:35 2016 (r300239) @@ -157,6 +157,8 @@ struct ipw_softc { uint32_t rxcur; int txfree; + uint16_t chanmask; + struct ipw_rx_radiotap_header sc_rxtap; struct ipw_tx_radiotap_header sc_txtap; }; From owner-svn-src-all@freebsd.org Thu May 19 22:20:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACF43B42D8B; Thu, 19 May 2016 22:20:36 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6465C1BF3; Thu, 19 May 2016 22:20:36 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JMKZO1030865; Thu, 19 May 2016 22:20:35 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMKZBN030863; Thu, 19 May 2016 22:20:35 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605192220.u4JMKZBN030863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 19 May 2016 22:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300240 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:20:36 -0000 Author: truckman Date: Thu May 19 22:20:35 2016 New Revision: 300240 URL: https://svnweb.freebsd.org/changeset/base/300240 Log: Change net.inet.tcp.ecn.enable sysctl mib from a binary off/on control to a three way setting. 0 - Totally disable ECN. (no change) 1 - Enable ECN if incoming connections request it. Outgoing connections will request ECN. (no change from present != 0 setting) 2 - Enable ECN if incoming connections request it. Outgoing conections will not request ECN. Change the default value of net.inet.tcp.ecn.enable from 0 to 2. Linux version 2.4.20 and newer, Solaris, and Mac OS X 10.5 and newer have similar capabilities. The actual values above match Linux, and the default matches the current Linux default. Reviewed by: eadler MFC after: 1 month MFH: yes Sponsored by: https://reviews.freebsd.org/D6386 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 19 22:19:35 2016 (r300239) +++ head/sys/netinet/tcp_input.c Thu May 19 22:20:35 2016 (r300240) @@ -185,7 +185,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, abc_ static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); -VNET_DEFINE(int, tcp_do_ecn) = 0; +VNET_DEFINE(int, tcp_do_ecn) = 2; SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_ecn), 0, "TCP ECN support"); Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu May 19 22:19:35 2016 (r300239) +++ head/sys/netinet/tcp_output.c Thu May 19 22:20:35 2016 (r300240) @@ -1117,7 +1117,7 @@ send: * resend those bits a number of times as per * RFC 3168. */ - if (tp->t_state == TCPS_SYN_SENT && V_tcp_do_ecn) { + if (tp->t_state == TCPS_SYN_SENT && V_tcp_do_ecn == 1) { if (tp->t_rxtshift >= 1) { if (tp->t_rxtshift <= V_tcp_ecn_maxretries) flags |= TH_ECE|TH_CWR; From owner-svn-src-all@freebsd.org Thu May 19 22:28:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC61AB42054; Thu, 19 May 2016 22:28:47 +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 9F63012AD; Thu, 19 May 2016 22:28:47 +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 u4JMSkCX033985; Thu, 19 May 2016 22:28:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMSkeV033984; Thu, 19 May 2016 22:28:46 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192228.u4JMSkeV033984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 22:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300241 - head/sys/dev/mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:28:48 -0000 Author: avos Date: Thu May 19 22:28:46 2016 New Revision: 300241 URL: https://svnweb.freebsd.org/changeset/base/300241 Log: mwl: switch to ieee80211_add_channel*(). Modified: head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Thu May 19 22:20:35 2016 (r300240) +++ head/sys/dev/mwl/if_mwl.c Thu May 19 22:28:46 2016 (r300241) @@ -4384,113 +4384,33 @@ mwl_setregdomain(struct ieee80211com *ic #define IEEE80211_CHAN_HTA (IEEE80211_CHAN_HT|IEEE80211_CHAN_A) static void -addchan(struct ieee80211_channel *c, int freq, int flags, int ieee, int txpow) -{ - c->ic_freq = freq; - c->ic_flags = flags; - c->ic_ieee = ieee; - c->ic_minpower = 0; - c->ic_maxpower = 2*txpow; - c->ic_maxregpower = txpow; -} - -static const struct ieee80211_channel * -findchannel(const struct ieee80211_channel chans[], int nchans, - int freq, int flags) -{ - const struct ieee80211_channel *c; - int i; - - for (i = 0; i < nchans; i++) { - c = &chans[i]; - if (c->ic_freq == freq && c->ic_flags == flags) - return c; - } - return NULL; -} - -static void addht40channels(struct ieee80211_channel chans[], int maxchans, int *nchans, const MWL_HAL_CHANNELINFO *ci, int flags) { - struct ieee80211_channel *c; - const struct ieee80211_channel *extc; - const struct mwl_hal_channel *hc; - int i; + int i, error; - c = &chans[*nchans]; - - flags &= ~IEEE80211_CHAN_HT; for (i = 0; i < ci->nchannels; i++) { - /* - * Each entry defines an HT40 channel pair; find the - * extension channel above and the insert the pair. - */ - hc = &ci->channels[i]; - extc = findchannel(chans, *nchans, hc->freq+20, - flags | IEEE80211_CHAN_HT20); - if (extc != NULL) { - if (*nchans >= maxchans) - break; - addchan(c, hc->freq, flags | IEEE80211_CHAN_HT40U, - hc->ieee, hc->maxTxPow); - c->ic_extieee = extc->ic_ieee; - c++, (*nchans)++; - if (*nchans >= maxchans) - break; - addchan(c, extc->ic_freq, flags | IEEE80211_CHAN_HT40D, - extc->ic_ieee, hc->maxTxPow); - c->ic_extieee = hc->ieee; - c++, (*nchans)++; - } + const struct mwl_hal_channel *hc = &ci->channels[i]; + + error = ieee80211_add_channel_ht40(chans, maxchans, nchans, + hc->ieee, hc->maxTxPow, flags); + if (error != 0 && error != ENOENT) + break; } } static void addchannels(struct ieee80211_channel chans[], int maxchans, int *nchans, - const MWL_HAL_CHANNELINFO *ci, int flags) + const MWL_HAL_CHANNELINFO *ci, const uint8_t bands[]) { - struct ieee80211_channel *c; - int i; - - c = &chans[*nchans]; + int i, error; - for (i = 0; i < ci->nchannels; i++) { - const struct mwl_hal_channel *hc; + error = 0; + for (i = 0; i < ci->nchannels && error == 0; i++) { + const struct mwl_hal_channel *hc = &ci->channels[i]; - hc = &ci->channels[i]; - if (*nchans >= maxchans) - break; - addchan(c, hc->freq, flags, hc->ieee, hc->maxTxPow); - c++, (*nchans)++; - if (flags == IEEE80211_CHAN_G || flags == IEEE80211_CHAN_HTG) { - /* g channel have a separate b-only entry */ - if (*nchans >= maxchans) - break; - c[0] = c[-1]; - c[-1].ic_flags = IEEE80211_CHAN_B; - c++, (*nchans)++; - } - if (flags == IEEE80211_CHAN_HTG) { - /* HT g channel have a separate g-only entry */ - if (*nchans >= maxchans) - break; - c[-1].ic_flags = IEEE80211_CHAN_G; - c[0] = c[-1]; - c[0].ic_flags &= ~IEEE80211_CHAN_HT; - c[0].ic_flags |= IEEE80211_CHAN_HT20; /* HT20 */ - c++, (*nchans)++; - } - if (flags == IEEE80211_CHAN_HTA) { - /* HT a channel have a separate a-only entry */ - if (*nchans >= maxchans) - break; - c[-1].ic_flags = IEEE80211_CHAN_A; - c[0] = c[-1]; - c[0].ic_flags &= ~IEEE80211_CHAN_HT; - c[0].ic_flags |= IEEE80211_CHAN_HT20; /* HT20 */ - c++, (*nchans)++; - } + error = ieee80211_add_channel(chans, maxchans, nchans, + hc->ieee, hc->freq, hc->maxTxPow, 0, bands); } } @@ -4499,6 +4419,7 @@ getchannels(struct mwl_softc *sc, int ma struct ieee80211_channel chans[]) { const MWL_HAL_CHANNELINFO *ci; + uint8_t bands[IEEE80211_MODE_BYTES]; /* * Use the channel info from the hal to craft the @@ -4508,11 +4429,20 @@ getchannels(struct mwl_softc *sc, int ma */ *nchans = 0; if (mwl_hal_getchannelinfo(sc->sc_mh, - MWL_FREQ_BAND_2DOT4GHZ, MWL_CH_20_MHz_WIDTH, &ci) == 0) - addchannels(chans, maxchans, nchans, ci, IEEE80211_CHAN_HTG); + MWL_FREQ_BAND_2DOT4GHZ, MWL_CH_20_MHz_WIDTH, &ci) == 0) { + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + setbit(bands, IEEE80211_MODE_11NG); + addchannels(chans, maxchans, nchans, ci, bands); + } if (mwl_hal_getchannelinfo(sc->sc_mh, - MWL_FREQ_BAND_5GHZ, MWL_CH_20_MHz_WIDTH, &ci) == 0) - addchannels(chans, maxchans, nchans, ci, IEEE80211_CHAN_HTA); + MWL_FREQ_BAND_5GHZ, MWL_CH_20_MHz_WIDTH, &ci) == 0) { + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11A); + setbit(bands, IEEE80211_MODE_11NA); + addchannels(chans, maxchans, nchans, ci, bands); + } if (mwl_hal_getchannelinfo(sc->sc_mh, MWL_FREQ_BAND_2DOT4GHZ, MWL_CH_40_MHz_WIDTH, &ci) == 0) addht40channels(chans, maxchans, nchans, ci, IEEE80211_CHAN_HTG); From owner-svn-src-all@freebsd.org Thu May 19 22:43:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E905B42376; Thu, 19 May 2016 22:43:22 +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 0CB5F1D29; Thu, 19 May 2016 22:43:21 +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 u4JMhLnD039671; Thu, 19 May 2016 22:43:21 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMhLnS039670; Thu, 19 May 2016 22:43:21 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192243.u4JMhLnS039670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 22:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300242 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:43:22 -0000 Author: avos Date: Thu May 19 22:43:21 2016 New Revision: 300242 URL: https://svnweb.freebsd.org/changeset/base/300242 Log: iwm: restart device after watchdog timeouts. Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu May 19 22:28:46 2016 (r300241) +++ head/sys/dev/iwm/if_iwm.c Thu May 19 22:43:21 2016 (r300242) @@ -3836,6 +3836,7 @@ static void iwm_watchdog(void *arg) { struct iwm_softc *sc = arg; + struct ieee80211com *ic = &sc->sc_ic; if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { @@ -3843,8 +3844,8 @@ iwm_watchdog(void *arg) #ifdef IWM_DEBUG iwm_nic_error(sc); #endif - iwm_stop(sc); - counter_u64_add(sc->sc_ic.ic_oerrors, 1); + ieee80211_restart_all(ic); + counter_u64_add(ic->ic_oerrors, 1); return; } } From owner-svn-src-all@freebsd.org Thu May 19 22:53:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F3FB42681; Thu, 19 May 2016 22:53:45 +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 3EAC5122B; Thu, 19 May 2016 22:53:45 +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 u4JMripE042643; Thu, 19 May 2016 22:53:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMriro042642; Thu, 19 May 2016 22:53:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192253.u4JMriro042642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 22:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300243 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:53:45 -0000 Author: bdrewery Date: Thu May 19 22:53:44 2016 New Revision: 300243 URL: https://svnweb.freebsd.org/changeset/base/300243 Log: Follow-up r300233: Don't override MK_* from env as head does. PR: D6271 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/bsd.own.mk Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Thu May 19 22:43:21 2016 (r300242) +++ stable/10/share/mk/bsd.own.mk Thu May 19 22:53:44 2016 (r300243) @@ -480,6 +480,7 @@ __DEFAULT_NO_OPTIONS+=HYPERV # MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} +.if !defined(MK_${var}) .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif @@ -488,6 +489,7 @@ MK_${var}:= no .else MK_${var}:= yes .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_YES_OPTIONS @@ -495,6 +497,7 @@ MK_${var}:= yes # MK_* options which default to "no". # .for var in ${__DEFAULT_NO_OPTIONS} +.if !defined(MK_${var}) .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif @@ -503,6 +506,7 @@ MK_${var}:= yes .else MK_${var}:= no .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_NO_OPTIONS From owner-svn-src-all@freebsd.org Thu May 19 22:54:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E3CB426FF; Thu, 19 May 2016 22:54:26 +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 CC9BD138A; Thu, 19 May 2016 22:54:25 +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 u4JMsPMT042726; Thu, 19 May 2016 22:54:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMsPV6042725; Thu, 19 May 2016 22:54:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192254.u4JMsPV6042725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 22:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300244 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:54:26 -0000 Author: bdrewery Date: Thu May 19 22:54:24 2016 New Revision: 300244 URL: https://svnweb.freebsd.org/changeset/base/300244 Log: MFS r300243: Follow-up r300233: Don't override MK_* from env as head does. PR: D6271 Modified: stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Thu May 19 22:53:44 2016 (r300243) +++ stable/9/share/mk/bsd.own.mk Thu May 19 22:54:24 2016 (r300244) @@ -504,6 +504,7 @@ __DEFAULT_NO_OPTIONS+=FDT # MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} +.if !defined(MK_${var}) .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif @@ -512,6 +513,7 @@ MK_${var}:= no .else MK_${var}:= yes .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_YES_OPTIONS @@ -519,6 +521,7 @@ MK_${var}:= yes # MK_* options which default to "no". # .for var in ${__DEFAULT_NO_OPTIONS} +.if !defined(MK_${var}) .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif @@ -527,6 +530,7 @@ MK_${var}:= yes .else MK_${var}:= no .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_NO_OPTIONS From owner-svn-src-all@freebsd.org Thu May 19 22:56:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D858B42880; Thu, 19 May 2016 22:56:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com [IPv6:2607:f8b0:400d:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFF9E1865; Thu, 19 May 2016 22:56:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qg0-x22e.google.com with SMTP id f92so52008749qgf.0; Thu, 19 May 2016 15:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=EX7lYOC0rGX9/7jsUs+KA8PGopL+zcGIvaklXYuShcg=; b=upCPQq3qh1YIheXgeFeymgZ0ZJ0iQ5xyRlQzOgu1d1RIAiSQa2rO7nw5WkmURKyNSk QcTY9WOneaNBSOoMTpctmPdwV8Xdjx14p2+/AesTbcs5IBtm7W2mIg0KNFLD2VYV4i0G G+hYb4WXEcnqMKfUayNUx8vxTKZlzIiangiLp1D6kZ+QkCcPcZf8qD9+LjbOtkjT0BQ/ ySlomzPTEe9lXFxJ7g+AKLS2wqxsSgUHAHn3/b8j4P2hjLjNS0rXGzyCGZKIl9efgFS8 gvJCsjNC02IV7KVTtcnWrj4rEKmTa28TPxB0nciNWU5zJDMOxh188phpRod0k56VS2zW bHnA== 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:date :message-id:subject:from:to:cc; bh=EX7lYOC0rGX9/7jsUs+KA8PGopL+zcGIvaklXYuShcg=; b=k0nqtpzfGRgO01Wfce5TdgmnBohhEDTf70bEc8T9YPuUPtY2J8OVRCb1pEovSU2xjE cAO0RVXPbnTrM/5igHeKarfQbhSjYdccdV+eEZK0uz7bkLiYHdbqSMHPxpx2LXrDPH8i hFWJzftMqrf7q8Z1eYrorIgK8d4R/7KxEvVDe2GFaU3grT7kpw7YtqO5Ukq8Q+sWCxPf 267DDqfMKG9pC9dWlWKcE01t8LBrWyBWb3DUF/YPsHmTTYqhplJiumVN6VWjX8xJHs7J U8kxY8X1CTBfDIStJzW0bIekxFWRKC1cl3jkr6q23mes0gabtKsBypfdvpJszapjVDkE J1oA== X-Gm-Message-State: AOPr4FVqEB21wplQ9B8M3eLShTD7s59CQwEG/JegCN3Ba+w+sDbddLjx+qoIiMPzB4G1oxby7FOqDHj5m1swuQ== MIME-Version: 1.0 X-Received: by 10.141.44.135 with SMTP id v129mr17515208qhe.46.1463698579005; Thu, 19 May 2016 15:56:19 -0700 (PDT) Received: by 10.55.170.201 with HTTP; Thu, 19 May 2016 15:56:18 -0700 (PDT) In-Reply-To: <201605191951.u4JJpdYQ087521@repo.freebsd.org> References: <201605191951.u4JJpdYQ087521@repo.freebsd.org> Date: Thu, 19 May 2016 15:56:18 -0700 Message-ID: Subject: Re: svn commit: r300226 - in head: cddl/contrib/dtracetoolkit cddl/usr.sbin cddl/usr.sbin/dtruss share/dtrace share/dtrace/toolkit From: Ngie Cooper To: "George V. Neville-Neil" 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 22:56:20 -0000 On Thu, May 19, 2016 at 12:51 PM, George V. Neville-Neil wrote: > Author: gnn > Date: Thu May 19 19:51:39 2016 > New Revision: 300226 > URL: https://svnweb.freebsd.org/changeset/base/300226 > > Log: > Remove the old version of the DTraceToolkit from the source tree. > The DTraceToolkit is part of the Open DTrace effort and is supported > on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated > to properly track toolkit development upstream. > > Sponsored by: DARPA, AFRL Add the files to ObsoleteFiles.inc? From owner-svn-src-all@freebsd.org Thu May 19 23:00:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE541B42984; Thu, 19 May 2016 23:00:31 +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 80DAE1C13; Thu, 19 May 2016 23:00:31 +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 u4JN0USP043152; Thu, 19 May 2016 23:00:30 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JN0UR4043150; Thu, 19 May 2016 23:00:30 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192300.u4JN0UR4043150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 23:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300246 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 23:00:31 -0000 Author: avos Date: Thu May 19 23:00:30 2016 New Revision: 300246 URL: https://svnweb.freebsd.org/changeset/base/300246 Log: ath: refactor/split getchannels() method. Split getchannels() method in ath_hal/ah_regdomain.c into a subset of functions for better readability. Note: due to different internal structure, it cannot use ieee80211_add_channel*() (however, some parts are done in a similar manner). Differential Revision: https://reviews.freebsd.org/D6139 Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/ath_hal/ah_regdomain.h Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Thu May 19 22:56:00 2016 (r300245) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Thu May 19 23:00:30 2016 (r300246) @@ -35,7 +35,7 @@ */ /* used throughout this file... */ -#define N(a) (sizeof (a) / sizeof (a[0])) +#define N(a) nitems(a) #define HAL_MODE_11A_TURBO HAL_MODE_108A #define HAL_MODE_11G_TURBO HAL_MODE_108G @@ -99,30 +99,32 @@ #include "ah_regdomain/ah_rd_domains.h" static const struct cmode modes[] = { - { HAL_MODE_TURBO, IEEE80211_CHAN_ST }, - { HAL_MODE_11A, IEEE80211_CHAN_A }, - { HAL_MODE_11B, IEEE80211_CHAN_B }, - { HAL_MODE_11G, IEEE80211_CHAN_G }, - { HAL_MODE_11G_TURBO, IEEE80211_CHAN_108G }, - { HAL_MODE_11A_TURBO, IEEE80211_CHAN_108A }, + { HAL_MODE_TURBO, IEEE80211_CHAN_ST, ®Dmn5GhzTurboFreq[0] }, + { HAL_MODE_11A, IEEE80211_CHAN_A, ®Dmn5GhzFreq[0] }, + { HAL_MODE_11B, IEEE80211_CHAN_B, ®Dmn2GhzFreq[0] }, + { HAL_MODE_11G, IEEE80211_CHAN_G, ®Dmn2Ghz11gFreq[0] }, + { HAL_MODE_11G_TURBO, IEEE80211_CHAN_108G, ®Dmn2Ghz11gTurboFreq[0] }, + { HAL_MODE_11A_TURBO, IEEE80211_CHAN_108A, ®Dmn5GhzTurboFreq[0] }, { HAL_MODE_11A_QUARTER_RATE, - IEEE80211_CHAN_A | IEEE80211_CHAN_QUARTER }, + IEEE80211_CHAN_A | IEEE80211_CHAN_QUARTER, ®Dmn5GhzFreq[0] }, { HAL_MODE_11A_HALF_RATE, - IEEE80211_CHAN_A | IEEE80211_CHAN_HALF }, + IEEE80211_CHAN_A | IEEE80211_CHAN_HALF, ®Dmn5GhzFreq[0] }, { HAL_MODE_11G_QUARTER_RATE, - IEEE80211_CHAN_G | IEEE80211_CHAN_QUARTER }, + IEEE80211_CHAN_G | IEEE80211_CHAN_QUARTER, ®Dmn2Ghz11gFreq[0] }, { HAL_MODE_11G_HALF_RATE, - IEEE80211_CHAN_G | IEEE80211_CHAN_HALF }, - { HAL_MODE_11NG_HT20, IEEE80211_CHAN_G | IEEE80211_CHAN_HT20 }, + IEEE80211_CHAN_G | IEEE80211_CHAN_HALF, ®Dmn2Ghz11gFreq[0] }, + { HAL_MODE_11NG_HT20, + IEEE80211_CHAN_G | IEEE80211_CHAN_HT20, ®Dmn2Ghz11gFreq[0] }, { HAL_MODE_11NG_HT40PLUS, - IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U }, + IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U, ®Dmn2Ghz11gFreq[0] }, { HAL_MODE_11NG_HT40MINUS, - IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D }, - { HAL_MODE_11NA_HT20, IEEE80211_CHAN_A | IEEE80211_CHAN_HT20 }, + IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D, ®Dmn2Ghz11gFreq[0] }, + { HAL_MODE_11NA_HT20, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT20, ®Dmn5GhzFreq[0] }, { HAL_MODE_11NA_HT40PLUS, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U }, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U, ®Dmn5GhzFreq[0] }, { HAL_MODE_11NA_HT40MINUS, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D }, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D, ®Dmn5GhzFreq[0] }, }; static void ath_hal_update_dfsdomain(struct ath_hal *ah); @@ -358,6 +360,234 @@ getregstate(struct ath_hal *ah, HAL_CTRY return HAL_OK; } +static uint64_t * +getchannelBM(u_int mode, REG_DOMAIN *rd) +{ + switch (mode) { + case HAL_MODE_11B: + return (rd->chan11b); + case HAL_MODE_11G_QUARTER_RATE: + return (rd->chan11g_quarter); + case HAL_MODE_11G_HALF_RATE: + return (rd->chan11g_half); + case HAL_MODE_11G: + case HAL_MODE_11NG_HT20: + case HAL_MODE_11NG_HT40PLUS: + case HAL_MODE_11NG_HT40MINUS: + return (rd->chan11g); + case HAL_MODE_11G_TURBO: + return (rd->chan11g_turbo); + case HAL_MODE_11A_QUARTER_RATE: + return (rd->chan11a_quarter); + case HAL_MODE_11A_HALF_RATE: + return (rd->chan11a_half); + case HAL_MODE_11A: + case HAL_MODE_11NA_HT20: + case HAL_MODE_11NA_HT40PLUS: + case HAL_MODE_11NA_HT40MINUS: + return (rd->chan11a); + case HAL_MODE_TURBO: + return (rd->chan11a_turbo); + case HAL_MODE_11A_TURBO: + return (rd->chan11a_dyn_turbo); + default: + return (AH_NULL); + } +} + +static void +setchannelflags(struct ieee80211_channel *c, REG_DMN_FREQ_BAND *fband, + REG_DOMAIN *rd) +{ + if (fband->usePassScan & rd->pscan) + c->ic_flags |= IEEE80211_CHAN_PASSIVE; + if (fband->useDfs & rd->dfsMask) + c->ic_flags |= IEEE80211_CHAN_DFS; + if (IEEE80211_IS_CHAN_5GHZ(c) && (rd->flags & DISALLOW_ADHOC_11A)) + c->ic_flags |= IEEE80211_CHAN_NOADHOC; + if (IEEE80211_IS_CHAN_TURBO(c) && + (rd->flags & DISALLOW_ADHOC_11A_TURB)) + c->ic_flags |= IEEE80211_CHAN_NOADHOC; + if (rd->flags & NO_HOSTAP) + c->ic_flags |= IEEE80211_CHAN_NOHOSTAP; + if (rd->flags & LIMIT_FRAME_4MS) + c->ic_flags |= IEEE80211_CHAN_4MSXMIT; + if (rd->flags & NEED_NFC) + c->ic_flags |= CHANNEL_NFCREQUIRED; +} + +static int +addchan(struct ath_hal *ah, struct ieee80211_channel chans[], + u_int maxchans, int *nchans, uint16_t freq, uint32_t flags, + REG_DMN_FREQ_BAND *fband, REG_DOMAIN *rd) +{ + struct ieee80211_channel *c; + + if (*nchans >= maxchans) + return (ENOBUFS); + + c = &chans[(*nchans)++]; + c->ic_freq = freq; + c->ic_flags = flags; + setchannelflags(c, fband, rd); + c->ic_maxregpower = fband->powerDfs; + ath_hal_getpowerlimits(ah, c); + c->ic_maxantgain = fband->antennaMax; + + return (0); +} + +static int +copychan_prev(struct ath_hal *ah, struct ieee80211_channel chans[], + u_int maxchans, int *nchans, uint16_t freq) +{ + struct ieee80211_channel *c; + + KASSERT(*nchans > 0, ("channel list is empty\n")); + + if (*nchans >= maxchans) + return (ENOBUFS); + + c = &chans[(*nchans)++]; + c[0] = c[-1]; + c->ic_freq = freq; + /* XXX is it needed here? */ + ath_hal_getpowerlimits(ah, c); + + return (0); +} + +static int +add_chanlist_band(struct ath_hal *ah, struct ieee80211_channel chans[], + int maxchans, int *nchans, uint16_t freq_lo, uint16_t freq_hi, int step, + uint32_t flags, REG_DMN_FREQ_BAND *fband, REG_DOMAIN *rd) +{ + uint16_t freq = freq_lo; + int error; + + if (freq_hi < freq_lo) + return (0); + + error = addchan(ah, chans, maxchans, nchans, freq, flags, fband, rd); + for (freq += step; freq <= freq_hi && error == 0; freq += step) + error = copychan_prev(ah, chans, maxchans, nchans, freq); + + return (error); +} + +static void +adj_freq_ht40(u_int mode, int *low_adj, int *hi_adj, int *channelSep) +{ + + *low_adj = *hi_adj = *channelSep = 0; + switch (mode) { + case HAL_MODE_11NA_HT40PLUS: + *channelSep = 40; + /* FALLTHROUGH */ + case HAL_MODE_11NG_HT40PLUS: + *hi_adj = -20; + break; + case HAL_MODE_11NA_HT40MINUS: + *channelSep = 40; + /* FALLTHROUGH */ + case HAL_MODE_11NG_HT40MINUS: + *low_adj = 20; + break; + } +} + +static void +add_chanlist_mode(struct ath_hal *ah, struct ieee80211_channel chans[], + u_int maxchans, int *nchans, const struct cmode *cm, REG_DOMAIN *rd, + HAL_BOOL enableExtendedChannels) +{ + uint64_t *channelBM; + uint16_t freq_lo, freq_hi; + int b, error, low_adj, hi_adj, channelSep; + + if (!ath_hal_getChannelEdges(ah, cm->flags, &freq_lo, &freq_hi)) { + /* channel not supported by hardware, skip it */ + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: channels 0x%x not supported by hardware\n", + __func__, cm->flags); + return; + } + + channelBM = getchannelBM(cm->mode, rd); + if (isChanBitMaskZero(channelBM)) + return; + + /* + * Setup special handling for HT40 channels; e.g. + * 5G HT40 channels require 40Mhz channel separation. + */ + adj_freq_ht40(cm->mode, &low_adj, &hi_adj, &channelSep); + + for (b = 0; b < 64*BMLEN; b++) { + REG_DMN_FREQ_BAND *fband; + uint16_t bfreq_lo, bfreq_hi; + int step; + + if (!IS_BIT_SET(b, channelBM)) + continue; + fband = &cm->freqs[b]; + + if ((fband->usePassScan & IS_ECM_CHAN) && + !enableExtendedChannels) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "skip ecm channels\n"); + continue; + } +#if 0 + if ((fband->useDfs & rd->dfsMask) && + (cm->flags & IEEE80211_CHAN_HT40)) { + /* NB: DFS and HT40 don't mix */ + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "skip HT40 chan, DFS required\n"); + continue; + } +#endif + bfreq_lo = MAX(fband->lowChannel + low_adj, freq_lo); + bfreq_hi = MIN(fband->highChannel + hi_adj, freq_hi); + if (fband->channelSep >= channelSep) + step = fband->channelSep; + else + step = roundup(channelSep, fband->channelSep); + + error = add_chanlist_band(ah, chans, maxchans, nchans, + bfreq_lo, bfreq_hi, step, cm->flags, fband, rd); + if (error != 0) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: too many channels for channel table\n", + __func__); + return; + } + } +} + +static u_int +getmodesmask(struct ath_hal *ah, REG_DOMAIN *rd5GHz, u_int modeSelect) +{ +#define HAL_MODE_11A_ALL \ + (HAL_MODE_11A | HAL_MODE_11A_TURBO | HAL_MODE_TURBO | \ + HAL_MODE_11A_QUARTER_RATE | HAL_MODE_11A_HALF_RATE) + u_int modesMask; + + /* get modes that HW is capable of */ + modesMask = ath_hal_getWirelessModes(ah); + modesMask &= modeSelect; + /* optimize work below if no 11a channels */ + if (isChanBitMaskZero(rd5GHz->chan11a) && + (modesMask & HAL_MODE_11A_ALL)) { + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + "%s: disallow all 11a\n", __func__); + modesMask &= ~HAL_MODE_11A_ALL; + } + + return (modesMask); +#undef HAL_MODE_11A_ALL +} + /* * Construct the channel list for the specified regulatory config. */ @@ -369,16 +599,9 @@ getchannels(struct ath_hal *ah, COUNTRY_CODE_TO_ENUM_RD **pcountry, REG_DOMAIN **prd2GHz, REG_DOMAIN **prd5GHz) { -#define CHANNEL_HALF_BW 10 -#define CHANNEL_QUARTER_BW 5 -#define HAL_MODE_11A_ALL \ - (HAL_MODE_11A | HAL_MODE_11A_TURBO | HAL_MODE_TURBO | \ - HAL_MODE_11A_QUARTER_RATE | HAL_MODE_11A_HALF_RATE) REG_DOMAIN *rd5GHz, *rd2GHz; - u_int modesAvail; + u_int modesMask; const struct cmode *cm; - struct ieee80211_channel *ic; - int next, b; HAL_STATUS status; HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: cc %u regDmn 0x%x mode 0x%x%s\n", @@ -389,206 +612,43 @@ getchannels(struct ath_hal *ah, if (status != HAL_OK) return status; - /* get modes that HW is capable of */ - modesAvail = ath_hal_getWirelessModes(ah); - /* optimize work below if no 11a channels */ - if (isChanBitMaskZero(rd5GHz->chan11a) && - (modesAvail & HAL_MODE_11A_ALL)) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: disallow all 11a\n", __func__); - modesAvail &= ~HAL_MODE_11A_ALL; - } + modesMask = getmodesmask(ah, rd5GHz, modeSelect); + /* XXX error? */ + if (modesMask == 0) + goto done; - next = 0; - ic = &chans[0]; for (cm = modes; cm < &modes[N(modes)]; cm++) { - uint16_t c, c_hi, c_lo; - uint64_t *channelBM = AH_NULL; - REG_DMN_FREQ_BAND *fband = AH_NULL,*freqs; - int low_adj, hi_adj, channelSep, lastc; - uint32_t rdflags; - uint64_t dfsMask; - uint64_t pscan; + REG_DOMAIN *rd; - if ((cm->mode & modeSelect) == 0) { + if ((cm->mode & modesMask) == 0) { HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: skip mode 0x%x flags 0x%x\n", __func__, cm->mode, cm->flags); continue; } - if ((cm->mode & modesAvail) == 0) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: !avail mode 0x%x (0x%x) flags 0x%x\n", - __func__, modesAvail, cm->mode, cm->flags); - continue; - } - if (!ath_hal_getChannelEdges(ah, cm->flags, &c_lo, &c_hi)) { - /* channel not supported by hardware, skip it */ - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: channels 0x%x not supported by hardware\n", - __func__,cm->flags); - continue; - } - switch (cm->mode) { - case HAL_MODE_TURBO: - case HAL_MODE_11A_TURBO: - rdflags = rd5GHz->flags; - dfsMask = rd5GHz->dfsMask; - pscan = rd5GHz->pscan; - if (cm->mode == HAL_MODE_TURBO) - channelBM = rd5GHz->chan11a_turbo; - else - channelBM = rd5GHz->chan11a_dyn_turbo; - freqs = ®Dmn5GhzTurboFreq[0]; - break; - case HAL_MODE_11G_TURBO: - rdflags = rd2GHz->flags; - dfsMask = rd2GHz->dfsMask; - pscan = rd2GHz->pscan; - channelBM = rd2GHz->chan11g_turbo; - freqs = ®Dmn2Ghz11gTurboFreq[0]; - break; - case HAL_MODE_11A: - case HAL_MODE_11A_HALF_RATE: - case HAL_MODE_11A_QUARTER_RATE: - case HAL_MODE_11NA_HT20: - case HAL_MODE_11NA_HT40PLUS: - case HAL_MODE_11NA_HT40MINUS: - rdflags = rd5GHz->flags; - dfsMask = rd5GHz->dfsMask; - pscan = rd5GHz->pscan; - if (cm->mode == HAL_MODE_11A_HALF_RATE) - channelBM = rd5GHz->chan11a_half; - else if (cm->mode == HAL_MODE_11A_QUARTER_RATE) - channelBM = rd5GHz->chan11a_quarter; - else - channelBM = rd5GHz->chan11a; - freqs = ®Dmn5GhzFreq[0]; - break; - case HAL_MODE_11B: - case HAL_MODE_11G: - case HAL_MODE_11G_HALF_RATE: - case HAL_MODE_11G_QUARTER_RATE: - case HAL_MODE_11NG_HT20: - case HAL_MODE_11NG_HT40PLUS: - case HAL_MODE_11NG_HT40MINUS: - rdflags = rd2GHz->flags; - dfsMask = rd2GHz->dfsMask; - pscan = rd2GHz->pscan; - if (cm->mode == HAL_MODE_11G_HALF_RATE) - channelBM = rd2GHz->chan11g_half; - else if (cm->mode == HAL_MODE_11G_QUARTER_RATE) - channelBM = rd2GHz->chan11g_quarter; - else if (cm->mode == HAL_MODE_11B) - channelBM = rd2GHz->chan11b; - else - channelBM = rd2GHz->chan11g; - if (cm->mode == HAL_MODE_11B) - freqs = ®Dmn2GhzFreq[0]; - else - freqs = ®Dmn2Ghz11gFreq[0]; - break; - default: - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: Unknown HAL mode 0x%x\n", __func__, cm->mode); - continue; - } - if (isChanBitMaskZero(channelBM)) - continue; - /* - * Setup special handling for HT40 channels; e.g. - * 5G HT40 channels require 40Mhz channel separation. - */ - hi_adj = (cm->mode == HAL_MODE_11NA_HT40PLUS || - cm->mode == HAL_MODE_11NG_HT40PLUS) ? -20 : 0; - low_adj = (cm->mode == HAL_MODE_11NA_HT40MINUS || - cm->mode == HAL_MODE_11NG_HT40MINUS) ? 20 : 0; - channelSep = (cm->mode == HAL_MODE_11NA_HT40PLUS || - cm->mode == HAL_MODE_11NA_HT40MINUS) ? 40 : 0; - - for (b = 0; b < 64*BMLEN; b++) { - if (!IS_BIT_SET(b, channelBM)) - continue; - fband = &freqs[b]; - lastc = 0; - - for (c = fband->lowChannel + low_adj; - c <= fband->highChannel + hi_adj; - c += fband->channelSep) { - if (!(c_lo <= c && c <= c_hi)) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: c %u out of range [%u..%u]\n", - __func__, c, c_lo, c_hi); - continue; - } - if (next >= maxchans){ - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: too many channels for channel table\n", - __func__); - goto done; - } - if ((fband->usePassScan & IS_ECM_CHAN) && - !enableExtendedChannels) { - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "skip ecm channel\n"); - continue; - } -#if 0 - if ((fband->useDfs & dfsMask) && - (cm->flags & IEEE80211_CHAN_HT40)) { - /* NB: DFS and HT40 don't mix */ - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "skip HT40 chan, DFS required\n"); - continue; - } -#endif - /* - * Make sure that channel separation - * meets the requirement. - */ - if (lastc && channelSep && - (c-lastc) < channelSep) - continue; - lastc = c; - - OS_MEMZERO(ic, sizeof(*ic)); - ic->ic_freq = c; - ic->ic_flags = cm->flags; - ic->ic_maxregpower = fband->powerDfs; - ath_hal_getpowerlimits(ah, ic); - ic->ic_maxantgain = fband->antennaMax; - if (fband->usePassScan & pscan) - ic->ic_flags |= IEEE80211_CHAN_PASSIVE; - if (fband->useDfs & dfsMask) - ic->ic_flags |= IEEE80211_CHAN_DFS; - if (IEEE80211_IS_CHAN_5GHZ(ic) && - (rdflags & DISALLOW_ADHOC_11A)) - ic->ic_flags |= IEEE80211_CHAN_NOADHOC; - if (IEEE80211_IS_CHAN_TURBO(ic) && - (rdflags & DISALLOW_ADHOC_11A_TURB)) - ic->ic_flags |= IEEE80211_CHAN_NOADHOC; - if (rdflags & NO_HOSTAP) - ic->ic_flags |= IEEE80211_CHAN_NOHOSTAP; - if (rdflags & LIMIT_FRAME_4MS) - ic->ic_flags |= IEEE80211_CHAN_4MSXMIT; - if (rdflags & NEED_NFC) - ic->ic_flags |= CHANNEL_NFCREQUIRED; - ic++, next++; - } + if (cm->flags & IEEE80211_CHAN_5GHZ) + rd = rd5GHz; + else if (cm->flags & IEEE80211_CHAN_2GHZ) + rd = rd2GHz; + else { + KASSERT(0, ("%s: Unkonwn HAL flags 0x%x\n", + __func__, cm->flags)); + return HAL_EINVAL; } + + add_chanlist_mode(ah, chans, maxchans, nchans, cm, + rd, enableExtendedChannels); + if (*nchans >= maxchans) + goto done; } done: - *nchans = next; /* NB: pcountry set above by getregstate */ if (prd2GHz != AH_NULL) *prd2GHz = rd2GHz; if (prd5GHz != AH_NULL) *prd5GHz = rd5GHz; return HAL_OK; -#undef HAL_MODE_11A_ALL -#undef CHANNEL_HALF_BW -#undef CHANNEL_QUARTER_BW } /* Modified: head/sys/dev/ath/ath_hal/ah_regdomain.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.h Thu May 19 22:56:00 2016 (r300245) +++ head/sys/dev/ath/ath_hal/ah_regdomain.h Thu May 19 23:00:30 2016 (r300246) @@ -157,7 +157,8 @@ typedef struct regDomain { } REG_DOMAIN; struct cmode { - u_int mode; - u_int flags; + u_int mode; + u_int flags; + REG_DMN_FREQ_BAND *freqs; }; #endif From owner-svn-src-all@freebsd.org Thu May 19 23:03:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3031B42AEC; Thu, 19 May 2016 23:03:08 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A565E1F4A; Thu, 19 May 2016 23:03:08 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JN37Zg045868; Thu, 19 May 2016 23:03:07 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JN37DC045867; Thu, 19 May 2016 23:03:07 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605192303.u4JN37DC045867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 19 May 2016 23:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300247 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 23:03:08 -0000 Author: truckman Date: Thu May 19 23:03:07 2016 New Revision: 300247 URL: https://svnweb.freebsd.org/changeset/base/300247 Log: Document new net.inet.tcp.ecn.enable sysctl settings. MFC after: 1 month (with r300240) Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Thu May 19 23:00:30 2016 (r300246) +++ head/share/man/man4/tcp.4 Thu May 19 23:03:07 2016 (r300247) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 21, 2016 +.Dd May 19, 2016 .Dt TCP 4 .Os .Sh NAME @@ -530,6 +530,17 @@ Defaults to 60 seconds. Enable support for TCP Explicit Congestion Notification (ECN). ECN allows a TCP sender to reduce the transmission rate in order to avoid packet drops. +Settings: +.Bl -tag -compact +.It 0 +Disable ECN. +.It 1 +Allow incoming connections to request ECN. +Outgoing connections will request ECN. +.It 2 +Allow incoming connections to request ECN. +Outgoing connections will not request ECN. +.El .It Va ecn.maxretries Number of retries (SYN or SYN/ACK retransmits) before disabling ECN on a specific connection. From owner-svn-src-all@freebsd.org Thu May 19 23:03:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD2CFB42B5C; Thu, 19 May 2016 23:03:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com [IPv6:2607:f8b0:400d:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AD6010D1; Thu, 19 May 2016 23:03:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qg0-x22e.google.com with SMTP id w36so52071670qge.3; Thu, 19 May 2016 16:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=5igZfqZYdYMTbFOXTQF3Keg5D+ORZ3zleL28Y52YJ3g=; b=EQM2jn45oZVhIlCgbWmUMOplORIPaHdG+XADT/T2n7K+lmpdWk3P1PRs8v6tByHN8G 9cid4accCv18Ceuv030JZmSNna46Xu8vkrmfwW3mDW+1zjTGED7e27FXR0Xz8LWHSCyM CDmj91J30AKDcpbDWdllJ5Uu/X5aNsG9aMN4fteJuf57f2xWM9O65KNtMDfsXoxTy+ji NhGrYtjRK43YWW68S9L8W/GSxwKw52RhUDBYztXW1zA0byoYOrNUPCe53EfZG2hFTFy9 JJ/oM5M7WeOolkBGb+Fd+VFILKHb/0Z0GmdPxqq3ki+Us1uXJMqGkvKw0Lq3G71nsRfu P/3g== 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:date :message-id:subject:from:to:cc; bh=5igZfqZYdYMTbFOXTQF3Keg5D+ORZ3zleL28Y52YJ3g=; b=mVK3q1JuqAGfL/ugALs0UUYjKKlS9ws2dPHhj9mnyivT8TZfgQGpEJjQMk8aSlQSms iAVxAZJ3DkWW0m5oYTp9Nvk7xze1wxe3UZxst910AFE0RUiY35f2UzsrjIpc32smAf9j CHN4ijixKrLEnaP7o8cgZnv4m75MFEgckYWvfMymar8W5JIedrdd3eNMC2N4faSFznYr FDr0naWqVhlCxYk+AJ8bD565AhmIEtZkgG050qiIB3G4OYH/wWbRqYzR6Dw38c76j8rP S6Jg6A8L2sHo96OasMPm1y5dtLrUUo6+2qFTCAfUV79+Wo4PytvvCyEP5peSBKyy9rJe k3hQ== X-Gm-Message-State: AOPr4FVWyFnViLh7YwuzNYeX+YFetQ3nxkyIXs4ylnxcbtNlztTfbXFk3fZyi21zuIsJr+aP9w7mEOoJ9SxQ0A== MIME-Version: 1.0 X-Received: by 10.140.109.132 with SMTP id l4mr17019453qgf.9.1463699022826; Thu, 19 May 2016 16:03:42 -0700 (PDT) Received: by 10.55.170.201 with HTTP; Thu, 19 May 2016 16:03:42 -0700 (PDT) In-Reply-To: <201605192220.u4JMKZBN030863@repo.freebsd.org> References: <201605192220.u4JMKZBN030863@repo.freebsd.org> Date: Thu, 19 May 2016 16:03:42 -0700 Message-ID: Subject: Re: svn commit: r300240 - head/sys/netinet From: Ngie Cooper To: Don Lewis 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 23:03:43 -0000 On Thu, May 19, 2016 at 3:20 PM, Don Lewis wrote: > Author: truckman > Date: Thu May 19 22:20:35 2016 > New Revision: 300240 > URL: https://svnweb.freebsd.org/changeset/base/300240 > > Log: > Change net.inet.tcp.ecn.enable sysctl mib from a binary off/on > control to a three way setting. > 0 - Totally disable ECN. (no change) > 1 - Enable ECN if incoming connections request it. Outgoing > connections will request ECN. (no change from present != 0 setting) > 2 - Enable ECN if incoming connections request it. Outgoing > conections will not request ECN. > > Change the default value of net.inet.tcp.ecn.enable from 0 to 2. > > Linux version 2.4.20 and newer, Solaris, and Mac OS X 10.5 and newer have > similar capabilities. The actual values above match Linux, and the default > matches the current Linux default. > > Reviewed by: eadler > MFC after: 1 month > MFH: yes > Sponsored by: https://reviews.freebsd.org/D6386 RelNotes: yes Also, does it make sense to merge this to head if it fundamentally changes behavior from what it was previously on the stable branch(es)? Thanks, -Ngie From owner-svn-src-all@freebsd.org Thu May 19 23:31:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2625B424E8; Thu, 19 May 2016 23:31:02 +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 B420B1E33; Thu, 19 May 2016 23:31:02 +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 u4JNV1H6054247; Thu, 19 May 2016 23:31:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JNV0CZ054236; Thu, 19 May 2016 23:31:00 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605192331.u4JNV0CZ054236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 19 May 2016 23:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300248 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 23:31:03 -0000 Author: avos Date: Thu May 19 23:31:00 2016 New Revision: 300248 URL: https://svnweb.freebsd.org/changeset/base/300248 Log: iwm: add 'opt_wlan.h' include into source files. Include net80211 options file, so IEEE80211_DEBUG_REFCNT option will be handled correctly. Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_binding.c head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwm_phy_ctxt.c head/sys/dev/iwm/if_iwm_phy_db.c head/sys/dev/iwm/if_iwm_power.c head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_util.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- head/sys/dev/iwm/if_iwm_binding.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_binding.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_phy_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_ctxt.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_phy_ctxt.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_db.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_phy_db.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_power.c ============================================================================== --- head/sys/dev/iwm/if_iwm_power.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_power.c Thu May 19 23:31:00 2016 (r300248) @@ -89,6 +89,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_scan.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_time_event.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/iwm/if_iwm_util.c ============================================================================== --- head/sys/dev/iwm/if_iwm_util.c Thu May 19 23:03:07 2016 (r300247) +++ head/sys/dev/iwm/if_iwm_util.c Thu May 19 23:31:00 2016 (r300248) @@ -105,6 +105,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #include #include #include From owner-svn-src-all@freebsd.org Thu May 19 23:45:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21F28B42880; Thu, 19 May 2016 23:45:21 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F41E01456; Thu, 19 May 2016 23:45:20 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4JNj9GE084896; Thu, 19 May 2016 16:45:13 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605192345.u4JNj9GE084896@gw.catspoiler.org> Date: Thu, 19 May 2016 16:45:09 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300240 - head/sys/netinet To: yaneurabeya@gmail.com cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 23:45:21 -0000 On 19 May, Ngie Cooper wrote: > On Thu, May 19, 2016 at 3:20 PM, Don Lewis wrote: >> Author: truckman >> Date: Thu May 19 22:20:35 2016 >> New Revision: 300240 >> URL: https://svnweb.freebsd.org/changeset/base/300240 >> >> Log: >> Change net.inet.tcp.ecn.enable sysctl mib from a binary off/on >> control to a three way setting. >> 0 - Totally disable ECN. (no change) >> 1 - Enable ECN if incoming connections request it. Outgoing >> connections will request ECN. (no change from present != 0 setting) >> 2 - Enable ECN if incoming connections request it. Outgoing >> conections will not request ECN. >> >> Change the default value of net.inet.tcp.ecn.enable from 0 to 2. >> >> Linux version 2.4.20 and newer, Solaris, and Mac OS X 10.5 and newer have >> similar capabilities. The actual values above match Linux, and the default >> matches the current Linux default. >> >> Reviewed by: eadler >> MFC after: 1 month >> MFH: yes >> Sponsored by: https://reviews.freebsd.org/D6386 > > RelNotes: yes > > Also, does it make sense to merge this to head if it fundamentally > changes behavior from what it was previously on the stable branch(es)? grrh ... that was supposed to be "Relnotes: yes", not "MFH: yes". I do think it makes sense to merge this to stable/10. Linux has had ECN enabled by default for quite some time, and OS X enabled ECN by default last September. The default setting of 2 is fairly safe. If you receive an incoming connection request that wants ECN, then that indicates that you are not behind a broken middlebox that blocks ECN. Requesting ECN by default on outgoing connections is more problematic. If you are behind a broken middlebox, the you could have problems making outgoing connections, though if you don't get a response after sending net.inet.tcp.ecn.enable SYN packets, ECN will get disabled for that connection request. From owner-svn-src-all@freebsd.org Fri May 20 00:03:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94ED9B42E54; Fri, 20 May 2016 00:03:23 +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 6376E1CE0; Fri, 20 May 2016 00:03:23 +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 u4K03MWQ063872; Fri, 20 May 2016 00:03:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K03MCt063868; Fri, 20 May 2016 00:03:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605200003.u4K03MCt063868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 00:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300249 - in head/sys/dev: acpica pccbb pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 00:03:23 -0000 Author: jhb Date: Fri May 20 00:03:22 2016 New Revision: 300249 URL: https://svnweb.freebsd.org/changeset/base/300249 Log: Implement a proper detach method for the PCI-PCI bridge driver. - Add a pcib_detach() function for the PCI-PCI bridge driver. It tears down the NEW_PCIB and hotplug state including destroying resource managers, deleting child devices, and disabling hotplug events. - Add a detach method to the ACPI PCI-PCI bridge driver which calls pcib_detach() and then frees the copy of the _PRT interrupt routing table. - Add a detach method to the PCI-Cardbus bridge driver which frees the PCI bus resources in addition to calling cbb_detach(). - Explicitly clear any pending hotplug events during attach to ensure future events will generate an interrupt. - If a the Command Completed bit is set in the slot status register when the command completion timeout fires, treat it as if the command completed and the completion interrupt was just lost rather than forcing a detach. - Don't wait for a Command Completed notification if Command Completion interrupts are disabled. The spec explicitly says no interrupt is enabled when clearing CCIE, and on my T400 no interrupt is generated when CCIE is changed from cleared to set, either. In addition, the T400 doesn't appear to set the Command Completed bit in the cases where it doesn't generate an interrupt, so don't schedule the timer either. (If the CC bit were always set, one could always set the timer and rely on the logic of treating CC set as a missed interrupt.) Reviewed by: imp (older version) Differential Revision: https://reviews.freebsd.org/D6424 Modified: head/sys/dev/acpica/acpi_pcib_pci.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_private.h Modified: head/sys/dev/acpica/acpi_pcib_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_pci.c Thu May 19 23:31:00 2016 (r300248) +++ head/sys/dev/acpica/acpi_pcib_pci.c Fri May 20 00:03:22 2016 (r300249) @@ -66,6 +66,7 @@ struct acpi_pcib_lookup_info { static int acpi_pcib_pci_probe(device_t bus); static int acpi_pcib_pci_attach(device_t bus); +static int acpi_pcib_pci_detach(device_t bus); static int acpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); static int acpi_pcib_pci_route_interrupt(device_t pcib, @@ -75,6 +76,7 @@ static device_method_t acpi_pcib_pci_met /* Device interface */ DEVMETHOD(device_probe, acpi_pcib_pci_probe), DEVMETHOD(device_attach, acpi_pcib_pci_attach), + DEVMETHOD(device_detach, acpi_pcib_pci_detach), /* Bus interface */ DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), @@ -127,6 +129,21 @@ acpi_pcib_pci_attach(device_t dev) } static int +acpi_pcib_pci_detach(device_t dev) +{ + struct acpi_pcib_softc *sc; + int error; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + sc = device_get_softc(dev); + error = pcib_detach(dev); + if (error == 0) + AcpiOsFree(sc->ap_prt.Pointer); + return (error); +} + +static int acpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct acpi_pcib_softc *sc = device_get_softc(dev); Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Thu May 19 23:31:00 2016 (r300248) +++ head/sys/dev/pccbb/pccbb_pci.c Fri May 20 00:03:22 2016 (r300249) @@ -435,6 +435,22 @@ err: return (ENOMEM); } +static int +cbb_pci_detach(device_t brdev) +{ +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct cbb_softc *sc = device_get_softc(brdev); +#endif + int error; + + error = cbb_detach(brdev); +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + if (error == 0) + pcib_free_secbus(brdev, &sc->bus); +#endif + return (error); +} + static void cbb_chipinit(struct cbb_softc *sc) { @@ -917,7 +933,7 @@ static device_method_t cbb_methods[] = { /* Device interface */ DEVMETHOD(device_probe, cbb_pci_probe), DEVMETHOD(device_attach, cbb_pci_attach), - DEVMETHOD(device_detach, cbb_detach), + DEVMETHOD(device_detach, cbb_pci_detach), DEVMETHOD(device_shutdown, cbb_pci_shutdown), DEVMETHOD(device_suspend, cbb_pci_suspend), DEVMETHOD(device_resume, cbb_pci_resume), Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Thu May 19 23:31:00 2016 (r300248) +++ head/sys/dev/pci/pci_pci.c Fri May 20 00:03:22 2016 (r300249) @@ -81,7 +81,7 @@ static device_method_t pcib_methods[] = /* Device interface */ DEVMETHOD(device_probe, pcib_probe), DEVMETHOD(device_attach, pcib_attach), - DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_detach, pcib_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, pcib_suspend), DEVMETHOD(device_resume, pcib_resume), @@ -544,6 +544,42 @@ pcib_probe_windows(struct pcib_softc *sc } } +static void +pcib_release_window(struct pcib_softc *sc, struct pcib_window *w, int type) +{ + device_t dev; + int error, i; + + if (!w->valid) + return; + + dev = sc->dev; + error = rman_fini(&w->rman); + if (error) { + device_printf(dev, "failed to release %s rman\n", w->name); + return; + } + free(__DECONST(char *, w->rman.rm_descr), M_DEVBUF); + + for (i = 0; i < w->count; i++) { + error = bus_free_resource(dev, type, w->res[i]); + if (error) + device_printf(dev, + "failed to release %s resource: %d\n", w->name, + error); + } + free(w->res, M_DEVBUF); +} + +static void +pcib_free_windows(struct pcib_softc *sc) +{ + + pcib_release_window(sc, &sc->pmem, SYS_RES_MEMORY); + pcib_release_window(sc, &sc->mem, SYS_RES_MEMORY); + pcib_release_window(sc, &sc->io, SYS_RES_IOPORT); +} + #ifdef PCI_RES_BUS /* * Allocate a suitable secondary bus for this bridge if needed and @@ -618,6 +654,24 @@ pcib_setup_secbus(device_t dev, struct p } } +void +pcib_free_secbus(device_t dev, struct pcib_secbus *bus) +{ + int error; + + error = rman_fini(&bus->rman); + if (error) { + device_printf(dev, "failed to release bus number rman\n"); + return; + } + free(__DECONST(char *, bus->rman.rm_descr), M_DEVBUF); + + error = bus_free_resource(dev, PCI_RES_BUS, bus->res); + if (error) + device_printf(dev, + "failed to release bus numbers resource: %d\n", error); +} + static struct resource * pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -896,7 +950,8 @@ pcib_pcie_hotplug_command(struct pcib_so if (new == ctl) return; pcie_write_config(dev, PCIER_SLOT_CTL, new, 2); - if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS)) { + if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) && + (ctl & new) & PCIEM_SLOT_CTL_CCIE) { sc->flags |= PCIB_HOTPLUG_CMD_PENDING; if (!cold) callout_reset(&sc->pcie_cc_timer, hz, @@ -917,6 +972,7 @@ pcib_pcie_hotplug_command_completed(stru return; callout_stop(&sc->pcie_cc_timer); sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; + wakeup(sc); } /* @@ -1153,16 +1209,22 @@ pcib_pcie_cc_timeout(void *arg) { struct pcib_softc *sc; device_t dev; + uint16_t sta; sc = arg; dev = sc->dev; mtx_assert(&Giant, MA_OWNED); - if (sc->flags & PCIB_HOTPLUG_CMD_PENDING) { + sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); + if (!(sta & PCIEM_SLOT_STA_CC)) { device_printf(dev, "Hotplug Command Timed Out - forcing detach\n"); sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); sc->flags |= PCIB_DETACHING; pcib_pcie_hotplug_update(sc, 0, 0, true); + } else { + device_printf(dev, + "Missed HotPlug interrupt waiting for Command Completion\n"); + pcib_pcie_intr(sc); } } @@ -1242,6 +1304,22 @@ pcib_alloc_pcie_irq(struct pcib_softc *s return (0); } +static int +pcib_release_pcie_irq(struct pcib_softc *sc) +{ + device_t dev; + int error; + + dev = sc->dev; + error = bus_teardown_intr(dev, sc->pcie_irq, sc->pcie_ihand); + if (error) + return (error); + error = bus_free_resource(dev, SYS_RES_IRQ, sc->pcie_irq); + if (error) + return (error); + return (pci_release_msi(dev)); +} + static void pcib_setup_hotplug(struct pcib_softc *sc) { @@ -1261,6 +1339,9 @@ pcib_setup_hotplug(struct pcib_softc *sc sc->pcie_link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2); sc->pcie_slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); + /* Clear any events previously pending. */ + pcie_write_config(dev, PCIER_SLOT_STA, sc->pcie_slot_sta, 2); + /* Enable HotPlug events. */ mask = PCIEM_SLOT_CTL_DLLSCE | PCIEM_SLOT_CTL_HPIE | PCIEM_SLOT_CTL_CCIE | PCIEM_SLOT_CTL_PDCE | PCIEM_SLOT_CTL_MRLSCE | @@ -1285,6 +1366,49 @@ pcib_setup_hotplug(struct pcib_softc *sc pcib_pcie_hotplug_update(sc, val, mask, false); } + +static int +pcib_detach_hotplug(struct pcib_softc *sc) +{ + uint16_t mask, val; + int error; + + /* Disable the card in the slot and force it to detach. */ + if (sc->flags & PCIB_DETACH_PENDING) { + sc->flags &= ~PCIB_DETACH_PENDING; + callout_stop(&sc->pcie_ab_timer); + } + sc->flags |= PCIB_DETACHING; + + if (sc->flags & PCIB_HOTPLUG_CMD_PENDING) { + callout_stop(&sc->pcie_cc_timer); + tsleep(sc, 0, "hpcmd", hz); + sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; + } + + /* Disable HotPlug events. */ + mask = PCIEM_SLOT_CTL_DLLSCE | PCIEM_SLOT_CTL_HPIE | + PCIEM_SLOT_CTL_CCIE | PCIEM_SLOT_CTL_PDCE | PCIEM_SLOT_CTL_MRLSCE | + PCIEM_SLOT_CTL_PFDE | PCIEM_SLOT_CTL_ABPE; + val = 0; + + /* Turn the attention indicator off. */ + if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_AIP) { + mask |= PCIEM_SLOT_CTL_AIC; + val |= PCIEM_SLOT_CTL_AI_OFF; + } + + pcib_pcie_hotplug_update(sc, val, mask, false); + + error = pcib_release_pcie_irq(sc); + if (error) + return (error); + taskqueue_drain(taskqueue_thread, &sc->pcie_hp_task); + callout_drain(&sc->pcie_ab_timer); + callout_drain(&sc->pcie_cc_timer); + callout_drain(&sc->pcie_dll_timer); + return (0); +} #endif /* @@ -1571,6 +1695,39 @@ pcib_attach(device_t dev) } int +pcib_detach(device_t dev) +{ +#if defined(PCI_HP) || defined(NEW_PCIB) + struct pcib_softc *sc; +#endif + int error; + +#if defined(PCI_HP) || defined(NEW_PCIB) + sc = device_get_softc(dev); +#endif + error = bus_generic_detach(dev); + if (error) + return (error); +#ifdef PCI_HP + if (sc->flags & PCIB_HOTPLUG) { + error = pcib_detach_hotplug(sc); + if (error) + return (error); + } +#endif + error = device_delete_children(dev); + if (error) + return (error); +#ifdef NEW_PCIB + pcib_free_windows(sc); +#ifdef PCI_RES_BUS + pcib_free_secbus(dev, &sc->bus); +#endif +#endif + return (0); +} + +int pcib_suspend(device_t dev) { Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Thu May 19 23:31:00 2016 (r300248) +++ head/sys/dev/pci/pcib_private.h Fri May 20 00:03:22 2016 (r300249) @@ -158,6 +158,7 @@ int pci_domain_release_bus(int domain, struct resource *pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); +void pcib_free_secbus(device_t dev, struct pcib_secbus *bus); void pcib_setup_secbus(device_t dev, struct pcib_secbus *bus, int min_count); #endif @@ -169,6 +170,7 @@ void pcib_bridge_init(device_t dev); const char *pcib_child_name(device_t child); #endif int pcib_child_present(device_t dev, device_t child); +int pcib_detach(device_t dev); int pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); int pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); struct resource *pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, From owner-svn-src-all@freebsd.org Fri May 20 00:45:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96293B41940; Fri, 20 May 2016 00:45:18 +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 59A6E1E4F; Fri, 20 May 2016 00:45:18 +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 u4K0jH1x076009; Fri, 20 May 2016 00:45:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K0jHi1076003; Fri, 20 May 2016 00:45:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605200045.u4K0jHi1076003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 20 May 2016 00:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300250 - in head/sys/dev/bhnd: . bhndb nvram tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 00:45:18 -0000 Author: adrian Date: Fri May 20 00:45:16 2016 New Revision: 300250 URL: https://svnweb.freebsd.org/changeset/base/300250 Log: [bhnd] Add remaining bus_(read|write|set)_(1|2|4) APIs This adds bhnd-compatible implementations of bus_(read|write|set)_(1|2|4) APIs, and upgrades the SPROM parsing code to use bhnd_bus_read_region_stream_2(). This a precursor to bridge support for resource adjustment and the new ChipCommon bus support. Tested: * Tested against BCM4331 * Kernel build verified via tinderbox. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6469 Modified: head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/nvram/bhnd_sprom.c head/sys/dev/bhnd/tools/bus_macro.sh Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Fri May 20 00:03:22 2016 (r300249) +++ head/sys/dev/bhnd/bhnd.c Fri May 20 00:45:16 2016 (r300250) @@ -529,36 +529,36 @@ bhnd_generic_resume_child(device_t dev, /* * Delegate all indirect I/O to the parent device. When inherited by * non-bridged bus implementations, resources will never be marked as - * indirect, and these methods should never be called. + * indirect, and these methods will never be called. */ -#define BHND_IO_READ(_type, _name, _method) \ -static _type \ -bhnd_read_ ## _name (device_t dev, device_t child, \ - struct bhnd_resource *r, bus_size_t offset) \ -{ \ - return (BHND_BUS_READ_ ## _method( \ - device_get_parent(dev), child, r, offset)); \ +#define BHND_IO_READ(_type, _name, _method) \ +static _type \ +bhnd_read_ ## _name (device_t dev, device_t child, \ + struct bhnd_resource *r, bus_size_t offset) \ +{ \ + return (BHND_BUS_READ_ ## _method( \ + device_get_parent(dev), child, r, offset)); \ } -#define BHND_IO_WRITE(_type, _name, _method) \ -static void \ -bhnd_write_ ## _name (device_t dev, device_t child, \ - struct bhnd_resource *r, bus_size_t offset, _type value) \ -{ \ - return (BHND_BUS_WRITE_ ## _method( \ - device_get_parent(dev), child, r, offset, \ +#define BHND_IO_WRITE(_type, _name, _method) \ +static void \ +bhnd_write_ ## _name (device_t dev, device_t child, \ + struct bhnd_resource *r, bus_size_t offset, _type value) \ +{ \ + return (BHND_BUS_WRITE_ ## _method( \ + device_get_parent(dev), child, r, offset, \ value)); \ } -#define BHND_IO_MULTI(_type, _rw, _name, _method) \ +#define BHND_IO_MISC(_type, _op, _method) \ static void \ -bhnd_ ## _rw ## _multi_ ## _name (device_t dev, device_t child, \ - struct bhnd_resource *r, bus_size_t offset, _type *datap, \ +bhnd_ ## _op (device_t dev, device_t child, \ + struct bhnd_resource *r, bus_size_t offset, _type datap, \ bus_size_t count) \ { \ BHND_BUS_ ## _method(device_get_parent(dev), child, r, \ offset, datap, count); \ -} +} #define BHND_IO_METHODS(_type, _size) \ BHND_IO_READ(_type, _size, _size) \ @@ -567,13 +567,28 @@ bhnd_ ## _rw ## _multi_ ## _name (device BHND_IO_READ(_type, stream_ ## _size, STREAM_ ## _size) \ BHND_IO_WRITE(_type, stream_ ## _size, STREAM_ ## _size) \ \ - BHND_IO_MULTI(_type, read, _size, READ_MULTI_ ## _size) \ - BHND_IO_MULTI(_type, write, _size, WRITE_MULTI_ ## _size) \ + BHND_IO_MISC(_type*, read_multi_ ## _size, \ + READ_MULTI_ ## _size) \ + BHND_IO_MISC(_type*, write_multi_ ## _size, \ + WRITE_MULTI_ ## _size) \ \ - BHND_IO_MULTI(_type, read, stream_ ## _size, \ + BHND_IO_MISC(_type*, read_multi_stream_ ## _size, \ READ_MULTI_STREAM_ ## _size) \ - BHND_IO_MULTI(_type, write, stream_ ## _size, \ + BHND_IO_MISC(_type*, write_multi_stream_ ## _size, \ WRITE_MULTI_STREAM_ ## _size) \ + \ + BHND_IO_MISC(_type, set_multi_ ## _size, SET_MULTI_ ## _size) \ + BHND_IO_MISC(_type, set_region_ ## _size, SET_REGION_ ## _size) \ + \ + BHND_IO_MISC(_type*, read_region_ ## _size, \ + READ_REGION_ ## _size) \ + BHND_IO_MISC(_type*, write_region_ ## _size, \ + WRITE_REGION_ ## _size) \ + \ + BHND_IO_MISC(_type*, read_region_stream_ ## _size, \ + READ_REGION_STREAM_ ## _size) \ + BHND_IO_MISC(_type*, write_region_stream_ ## _size, \ + WRITE_REGION_STREAM_ ## _size) \ BHND_IO_METHODS(uint8_t, 1); BHND_IO_METHODS(uint16_t, 2); @@ -627,12 +642,15 @@ static device_method_t bhnd_methods[] = DEVMETHOD(bhnd_bus_is_region_valid, bhnd_generic_is_region_valid), DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_bus_generic_is_hw_disabled), DEVMETHOD(bhnd_bus_get_nvram_var, bhnd_bus_generic_get_nvram_var), + + /* BHND interface (bus I/O) */ DEVMETHOD(bhnd_bus_read_1, bhnd_read_1), DEVMETHOD(bhnd_bus_read_2, bhnd_read_2), DEVMETHOD(bhnd_bus_read_4, bhnd_read_4), DEVMETHOD(bhnd_bus_write_1, bhnd_write_1), DEVMETHOD(bhnd_bus_write_2, bhnd_write_2), DEVMETHOD(bhnd_bus_write_4, bhnd_write_4), + DEVMETHOD(bhnd_bus_read_stream_1, bhnd_read_stream_1), DEVMETHOD(bhnd_bus_read_stream_2, bhnd_read_stream_2), DEVMETHOD(bhnd_bus_read_stream_4, bhnd_read_stream_4), @@ -654,7 +672,29 @@ static device_method_t bhnd_methods[] = DEVMETHOD(bhnd_bus_write_multi_stream_2,bhnd_write_multi_stream_2), DEVMETHOD(bhnd_bus_write_multi_stream_4,bhnd_write_multi_stream_4), - DEVMETHOD(bhnd_bus_barrier, bhnd_barrier), + DEVMETHOD(bhnd_bus_set_multi_1, bhnd_set_multi_1), + DEVMETHOD(bhnd_bus_set_multi_2, bhnd_set_multi_2), + DEVMETHOD(bhnd_bus_set_multi_4, bhnd_set_multi_4), + + DEVMETHOD(bhnd_bus_set_region_1, bhnd_set_region_1), + DEVMETHOD(bhnd_bus_set_region_2, bhnd_set_region_2), + DEVMETHOD(bhnd_bus_set_region_4, bhnd_set_region_4), + + DEVMETHOD(bhnd_bus_read_region_1, bhnd_read_region_1), + DEVMETHOD(bhnd_bus_read_region_2, bhnd_read_region_2), + DEVMETHOD(bhnd_bus_read_region_4, bhnd_read_region_4), + DEVMETHOD(bhnd_bus_write_region_1, bhnd_write_region_1), + DEVMETHOD(bhnd_bus_write_region_2, bhnd_write_region_2), + DEVMETHOD(bhnd_bus_write_region_4, bhnd_write_region_4), + + DEVMETHOD(bhnd_bus_read_region_stream_1,bhnd_read_region_stream_1), + DEVMETHOD(bhnd_bus_read_region_stream_2,bhnd_read_region_stream_2), + DEVMETHOD(bhnd_bus_read_region_stream_4,bhnd_read_region_stream_4), + DEVMETHOD(bhnd_bus_write_region_stream_1, bhnd_write_region_stream_1), + DEVMETHOD(bhnd_bus_write_region_stream_2, bhnd_write_region_stream_2), + DEVMETHOD(bhnd_bus_write_region_stream_4, bhnd_write_region_stream_4), + + DEVMETHOD(bhnd_bus_barrier, bhnd_barrier), DEVMETHOD_END }; Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Fri May 20 00:03:22 2016 (r300249) +++ head/sys/dev/bhnd/bhnd.h Fri May 20 00:45:16 2016 (r300250) @@ -869,6 +869,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_READ_MULTI_1( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_region_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_region_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_REGION_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_1(r, o, v) \ ((r)->direct) ? \ bus_write_1((r)->res, (o), (v)) : \ @@ -881,6 +887,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_WRITE_MULTI_1( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_region_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_region_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_REGION_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_read_stream_1(r, o) \ ((r)->direct) ? \ bus_read_stream_1((r)->res, (o)) : \ @@ -893,6 +905,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_READ_MULTI_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_region_stream_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_region_stream_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_REGION_STREAM_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_stream_1(r, o, v) \ ((r)->direct) ? \ bus_write_stream_1((r)->res, (o), (v)) : \ @@ -905,6 +923,24 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_WRITE_MULTI_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_region_stream_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_region_stream_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_REGION_STREAM_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_set_multi_1(r, o, v, c) \ + ((r)->direct) ? \ + bus_set_multi_1((r)->res, (o), (v), (c)) : \ + BHND_BUS_SET_MULTI_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v), (c)) +#define bhnd_bus_set_region_1(r, o, v, c) \ + ((r)->direct) ? \ + bus_set_region_1((r)->res, (o), (v), (c)) : \ + BHND_BUS_SET_REGION_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v), (c)) #define bhnd_bus_read_2(r, o) \ ((r)->direct) ? \ bus_read_2((r)->res, (o)) : \ @@ -917,6 +953,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_READ_MULTI_2( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_region_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_region_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_REGION_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_2(r, o, v) \ ((r)->direct) ? \ bus_write_2((r)->res, (o), (v)) : \ @@ -929,6 +971,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_WRITE_MULTI_2( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_region_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_region_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_REGION_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_read_stream_2(r, o) \ ((r)->direct) ? \ bus_read_stream_2((r)->res, (o)) : \ @@ -941,6 +989,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_READ_MULTI_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_region_stream_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_region_stream_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_REGION_STREAM_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_stream_2(r, o, v) \ ((r)->direct) ? \ bus_write_stream_2((r)->res, (o), (v)) : \ @@ -953,6 +1007,24 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_WRITE_MULTI_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_region_stream_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_region_stream_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_REGION_STREAM_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_set_multi_2(r, o, v, c) \ + ((r)->direct) ? \ + bus_set_multi_2((r)->res, (o), (v), (c)) : \ + BHND_BUS_SET_MULTI_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v), (c)) +#define bhnd_bus_set_region_2(r, o, v, c) \ + ((r)->direct) ? \ + bus_set_region_2((r)->res, (o), (v), (c)) : \ + BHND_BUS_SET_REGION_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v), (c)) #define bhnd_bus_read_4(r, o) \ ((r)->direct) ? \ bus_read_4((r)->res, (o)) : \ @@ -965,6 +1037,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_READ_MULTI_4( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_region_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_region_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_REGION_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_4(r, o, v) \ ((r)->direct) ? \ bus_write_4((r)->res, (o), (v)) : \ @@ -977,6 +1055,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_WRITE_MULTI_4( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_region_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_region_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_REGION_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_read_stream_4(r, o) \ ((r)->direct) ? \ bus_read_stream_4((r)->res, (o)) : \ @@ -989,6 +1073,12 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_READ_MULTI_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_region_stream_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_region_stream_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_REGION_STREAM_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_stream_4(r, o, v) \ ((r)->direct) ? \ bus_write_stream_4((r)->res, (o), (v)) : \ @@ -1001,5 +1091,23 @@ bhnd_get_region_addr(device_t dev, bhnd_ BHND_BUS_WRITE_MULTI_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_region_stream_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_region_stream_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_REGION_STREAM_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_set_multi_4(r, o, v, c) \ + ((r)->direct) ? \ + bus_set_multi_4((r)->res, (o), (v), (c)) : \ + BHND_BUS_SET_MULTI_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v), (c)) +#define bhnd_bus_set_region_4(r, o, v, c) \ + ((r)->direct) ? \ + bus_set_region_4((r)->res, (o), (v), (c)) : \ + BHND_BUS_SET_REGION_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v), (c)) #endif /* _BHND_BHND_H_ */ Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Fri May 20 00:03:22 2016 (r300249) +++ head/sys/dev/bhnd/bhnd_bus_if.m Fri May 20 00:45:16 2016 (r300250) @@ -670,6 +670,192 @@ METHOD void write_multi_stream_4 { bus_size_t count; } +/** An implementation of bus_set_multi_1() compatible with bhnd_resource */ +METHOD void set_multi_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t value; + bus_size_t count; +} + +/** An implementation of bus_set_multi_2() compatible with bhnd_resource */ +METHOD void set_multi_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t value; + bus_size_t count; +} + +/** An implementation of bus_set_multi_4() compatible with bhnd_resource */ +METHOD void set_multi_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t value; + bus_size_t count; +} + +/** An implementation of bus_set_region_1() compatible with bhnd_resource */ +METHOD void set_region_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t value; + bus_size_t count; +} + +/** An implementation of bus_set_region_2() compatible with bhnd_resource */ +METHOD void set_region_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t value; + bus_size_t count; +} + +/** An implementation of bus_set_region_4() compatible with bhnd_resource */ +METHOD void set_region_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t value; + bus_size_t count; +} + +/** An implementation of bus_read_region_1() compatible with bhnd_resource */ +METHOD void read_region_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_region_2() compatible with bhnd_resource */ +METHOD void read_region_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_region_4() compatible with bhnd_resource */ +METHOD void read_region_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_region_stream_1() compatible with + * bhnd_resource */ +METHOD void read_region_stream_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_region_stream_2() compatible with + * bhnd_resource */ +METHOD void read_region_stream_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_region_stream_4() compatible with + * bhnd_resource */ +METHOD void read_region_stream_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_region_1() compatible with bhnd_resource */ +METHOD void write_region_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_region_2() compatible with bhnd_resource */ +METHOD void write_region_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_region_4() compatible with bhnd_resource */ +METHOD void write_region_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_region_stream_1() compatible with + * bhnd_resource */ +METHOD void write_region_stream_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_region_stream_2() compatible with + * bhnd_resource */ +METHOD void write_region_stream_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_region_stream_4() compatible with + * bhnd_resource */ +METHOD void write_region_stream_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + /** An implementation of bus_barrier() compatible with bhnd_resource */ METHOD void barrier { device_t dev; Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Fri May 20 00:03:22 2016 (r300249) +++ head/sys/dev/bhnd/bhndb/bhndb.c Fri May 20 00:45:16 2016 (r300250) @@ -1766,15 +1766,15 @@ bhndb_bus_write_ ## _name (device_t dev, BHNDB_IO_COMMON_TEARDOWN(); \ } -/* Defines a bhndb_bus_(read|write)_multi_* method implementation */ -#define BHNDB_IO_MULTI(_type, _rw, _name) \ +/* Defines a bhndb_bus_(read|write|set)_(multi|region)_* method */ +#define BHNDB_IO_MISC(_type, _ptr, _op, _size) \ static void \ -bhndb_bus_ ## _rw ## _multi_ ## _name (device_t dev, \ +bhndb_bus_ ## _op ## _ ## _size (device_t dev, \ device_t child, struct bhnd_resource *r, bus_size_t offset, \ - _type *datap, bus_size_t count) \ + _type _ptr datap, bus_size_t count) \ { \ BHNDB_IO_COMMON_SETUP(sizeof(_type) * count); \ - bus_ ## _rw ## _multi_ ## _name (io_res, io_offset, \ + bus_ ## _op ## _ ## _size (io_res, io_offset, \ datap, count); \ BHNDB_IO_COMMON_TEARDOWN(); \ } @@ -1787,11 +1787,19 @@ bhndb_bus_ ## _rw ## _multi_ ## _name (d BHNDB_IO_READ(_type, stream_ ## _size) \ BHNDB_IO_WRITE(_type, stream_ ## _size) \ \ - BHNDB_IO_MULTI(_type, read, _size) \ - BHNDB_IO_MULTI(_type, write, _size) \ + BHNDB_IO_MISC(_type, *, read_multi, _size) \ + BHNDB_IO_MISC(_type, *, write_multi, _size) \ \ - BHNDB_IO_MULTI(_type, read, stream_ ## _size) \ - BHNDB_IO_MULTI(_type, write, stream_ ## _size) + BHNDB_IO_MISC(_type, *, read_multi_stream, _size) \ + BHNDB_IO_MISC(_type, *, write_multi_stream, _size) \ + \ + BHNDB_IO_MISC(_type, , set_multi, _size) \ + BHNDB_IO_MISC(_type, , set_region, _size) \ + BHNDB_IO_MISC(_type, *, read_region, _size) \ + BHNDB_IO_MISC(_type, *, write_region, _size) \ + \ + BHNDB_IO_MISC(_type, *, read_region_stream, _size) \ + BHNDB_IO_MISC(_type, *, write_region_stream, _size) BHNDB_IO_METHODS(uint8_t, 1); BHNDB_IO_METHODS(uint16_t, 2); @@ -1804,24 +1812,9 @@ static void bhndb_bus_barrier(device_t dev, device_t child, struct bhnd_resource *r, bus_size_t offset, bus_size_t length, int flags) { - bus_size_t remain; - BHNDB_IO_COMMON_SETUP(length); - /* TODO: It's unclear whether we need a barrier implementation, - * and if we do, what it needs to actually do. This may need - * revisiting once we have a better idea of requirements after - * porting the core drivers. */ - panic("implementation incorrect"); - - /* Use 4-byte reads where possible */ - remain = length % sizeof(uint32_t); - for (bus_size_t i = 0; i < (length - remain); i += 4) - bus_read_4(io_res, io_offset + offset + i); - - /* Use 1 byte reads for the remainder */ - for (bus_size_t i = 0; i < remain; i++) - bus_read_1(io_res, io_offset + offset + length + i); + bus_barrier(io_res, io_offset + offset, length, flags); BHNDB_IO_COMMON_TEARDOWN(); } @@ -1970,6 +1963,27 @@ static device_method_t bhndb_methods[] = DEVMETHOD(bhnd_bus_write_multi_stream_2,bhndb_bus_write_multi_stream_2), DEVMETHOD(bhnd_bus_write_multi_stream_4,bhndb_bus_write_multi_stream_4), + DEVMETHOD(bhnd_bus_set_multi_1, bhndb_bus_set_multi_1), + DEVMETHOD(bhnd_bus_set_multi_2, bhndb_bus_set_multi_2), + DEVMETHOD(bhnd_bus_set_multi_4, bhndb_bus_set_multi_4), + DEVMETHOD(bhnd_bus_set_region_1, bhndb_bus_set_region_1), + DEVMETHOD(bhnd_bus_set_region_2, bhndb_bus_set_region_2), + DEVMETHOD(bhnd_bus_set_region_4, bhndb_bus_set_region_4), + + DEVMETHOD(bhnd_bus_read_region_1, bhndb_bus_read_region_1), + DEVMETHOD(bhnd_bus_read_region_2, bhndb_bus_read_region_2), + DEVMETHOD(bhnd_bus_read_region_4, bhndb_bus_read_region_4), + DEVMETHOD(bhnd_bus_write_region_1, bhndb_bus_write_region_1), + DEVMETHOD(bhnd_bus_write_region_2, bhndb_bus_write_region_2), + DEVMETHOD(bhnd_bus_write_region_4, bhndb_bus_write_region_4), + + DEVMETHOD(bhnd_bus_read_region_stream_1,bhndb_bus_read_region_stream_1), + DEVMETHOD(bhnd_bus_read_region_stream_2,bhndb_bus_read_region_stream_2), + DEVMETHOD(bhnd_bus_read_region_stream_4,bhndb_bus_read_region_stream_4), + DEVMETHOD(bhnd_bus_write_region_stream_1,bhndb_bus_write_region_stream_1), + DEVMETHOD(bhnd_bus_write_region_stream_2,bhndb_bus_write_region_stream_2), + DEVMETHOD(bhnd_bus_write_region_stream_4,bhndb_bus_write_region_stream_4), + DEVMETHOD(bhnd_bus_barrier, bhndb_bus_barrier), DEVMETHOD_END Modified: head/sys/dev/bhnd/nvram/bhnd_sprom.c ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_sprom.c Fri May 20 00:03:22 2016 (r300249) +++ head/sys/dev/bhnd/nvram/bhnd_sprom.c Fri May 20 00:45:16 2016 (r300250) @@ -508,7 +508,6 @@ sprom_direct_read(struct bhnd_sprom *sc, size_t nbytes, uint8_t *crc) { bus_size_t res_offset; - size_t nread; uint16_t *p; KASSERT(nbytes % sizeof(uint16_t) == 0, ("unaligned sprom size")); @@ -520,15 +519,12 @@ sprom_direct_read(struct bhnd_sprom *sc, return (EINVAL); } + /* Perform read and update CRC */ p = (uint16_t *)buf; res_offset = sc->sp_res_off + offset; - /* Perform read */ - for (nread = 0; nread < nbytes; nread += 2) { - *p = bhnd_bus_read_stream_2(sc->sp_res, res_offset+nread); - *crc = bhnd_nvram_crc8(p, sizeof(*p), *crc); - p++; - }; + bhnd_bus_read_region_stream_2(sc->sp_res, res_offset, p, nbytes); + *crc = bhnd_nvram_crc8(p, nbytes, *crc); return (0); } @@ -569,4 +565,4 @@ sprom_var_defn(struct bhnd_sprom *sc, co /* Not supported by this SPROM revision */ return (ENOENT); -} \ No newline at end of file +} Modified: head/sys/dev/bhnd/tools/bus_macro.sh ============================================================================== --- head/sys/dev/bhnd/tools/bus_macro.sh Fri May 20 00:03:22 2016 (r300249) +++ head/sys/dev/bhnd/tools/bus_macro.sh Fri May 20 00:45:16 2016 (r300250) @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2015 Landon Fuller +# Copyright (c) 2015-2016 Landon Fuller # Copyright (c) 2004-2005 Poul-Henning Kamp. # All rights reserved. # @@ -63,8 +63,6 @@ macro () { macro barrier o l f -# We only support a subset of the bus I/O methods; this may -# be expanded when/if additional functions are required. for w in 1 2 4 #8 do # macro copy_region_$w so dh do c @@ -74,11 +72,20 @@ do do macro read_$s$w o macro read_multi_$s$w o d c -# macro read_region_$s$w o d c -# macro set_multi_$s$w o v c -# macro set_region_$s$w o v c + macro read_region_$s$w o d c macro write_$s$w o v macro write_multi_$s$w o d c -# macro write_region_$s$w o d c + macro write_region_$s$w o d c + done + + # set_(multi_)?_stream is not supported on ARM/ARM64, and so for + # simplicity, we don't support their use with bhnd resources. + # + # if that changes, these can be merged back into the stream-eanbled + # loop above. + for s in "" + do + macro set_multi_$s$w o v c + macro set_region_$s$w o v c done done From owner-svn-src-all@freebsd.org Fri May 20 00:49:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E5FDB419F8; Fri, 20 May 2016 00:49:12 +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 CFF9B2000; Fri, 20 May 2016 00:49:11 +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 u4K0nA3Z076181; Fri, 20 May 2016 00:49:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K0nAeu076178; Fri, 20 May 2016 00:49:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605200049.u4K0nAeu076178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 20 May 2016 00:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300251 - head/sys/dev/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 00:49:12 -0000 Author: adrian Date: Fri May 20 00:49:10 2016 New Revision: 300251 URL: https://svnweb.freebsd.org/changeset/base/300251 Log: [bhnd] Add bhnd bridge support for bus_adjust_resource(). Adds support for adjusting active bus resource allocations, limiting the range to the constraints of the register window within which the resource is mapped. This is the final set of bhnd changes required to support delegating ChipCommon's register space to child devices. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6470 Modified: head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_private.h head/sys/dev/bhnd/bhndb/bhndb_subr.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Fri May 20 00:45:16 2016 (r300250) +++ head/sys/dev/bhnd/bhndb/bhndb.c Fri May 20 00:49:10 2016 (r300251) @@ -1144,11 +1144,16 @@ bhndb_adjust_resource(device_t dev, devi { struct bhndb_softc *sc; struct rman *rm; + rman_res_t mstart, mend; int error; sc = device_get_softc(dev); error = 0; + /* Verify basic constraints */ + if (end <= start) + return (EINVAL); + /* Fetch resource manager */ rm = bhndb_get_rman(sc, child, type); if (rm == NULL) @@ -1157,16 +1162,29 @@ bhndb_adjust_resource(device_t dev, devi if (!rman_is_region_manager(r, rm)) return (ENXIO); - /* If active, adjustment is limited by the assigned window. */ BHNDB_LOCK(sc); - // TODO: Currently unsupported - error = ENODEV; + /* If not active, allow any range permitted by the resource manager */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + goto done; + + /* Otherwise, the range is limited to the existing register window + * mapping */ + error = bhndb_find_resource_limits(sc->bus_res, r, &mstart, &mend); + if (error) + goto done; - BHNDB_UNLOCK(sc); + if (start < mstart || end > mend) { + error = EINVAL; + goto done; + } + + /* Fall through */ +done: if (!error) error = rman_adjust_resource(r, start, end); + BHNDB_UNLOCK(sc); return (error); } @@ -1536,7 +1554,8 @@ bhndb_activate_bhnd_resource(device_t de if (bhndb_get_addrspace(sc, child) == BHNDB_ADDRSPACE_BRIDGED) { bhndb_priority_t r_prio; - region = bhndb_find_resource_region(sc->bus_res, r_start, r_size); + region = bhndb_find_resource_region(sc->bus_res, r_start, + r_size); if (region != NULL) r_prio = region->priority; else Modified: head/sys/dev/bhnd/bhndb/bhndb_private.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_private.h Fri May 20 00:45:16 2016 (r300250) +++ head/sys/dev/bhnd/bhndb/bhndb_private.h Fri May 20 00:49:10 2016 (r300251) @@ -71,6 +71,11 @@ int bhndb_add_resource_region( bhndb_priority_t priority, const struct bhndb_regwin *static_regwin); +int bhndb_find_resource_limits( + struct bhndb_resources *br, + struct resource *r, rman_res_t *start, + rman_res_t *end); + struct bhndb_region *bhndb_find_resource_region( struct bhndb_resources *br, bhnd_addr_t addr, bhnd_size_t size); @@ -133,7 +138,7 @@ const struct bhndb_hw_priority *bhndb_hw * Dynamic register window allocation reference. */ struct bhndb_dw_rentry { - struct resource *dw_res; /**< child resource */ + struct resource *dw_res; /**< child resource */ LIST_ENTRY(bhndb_dw_rentry) dw_link; }; Modified: head/sys/dev/bhnd/bhndb/bhndb_subr.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_subr.c Fri May 20 00:45:16 2016 (r300250) +++ head/sys/dev/bhnd/bhndb/bhndb_subr.c Fri May 20 00:49:10 2016 (r300251) @@ -563,8 +563,52 @@ bhndb_add_resource_region(struct bhndb_r return (0); } + +/** + * Find the maximum start and end limits of the register window mapping + * resource @p r. + * + * If the memory range is not mapped by an existing dynamic or static register + * window, ENOENT will be returned. + * + * @param br The resource state to search. + * @param r The resource to search for in @p br. + * @param addr The requested starting address. + * @param size The requested size. + * + * @retval bhndb_region A region that fully contains the requested range. + * @retval NULL If no mapping region can be found. + */ +int +bhndb_find_resource_limits(struct bhndb_resources *br, struct resource *r, + rman_res_t *start, rman_res_t *end) +{ + struct bhndb_dw_alloc *dynamic; + struct bhndb_region *sregion; + + /* Check for an enclosing dynamic register window */ + if ((dynamic = bhndb_dw_find_resource(br, r))) { + *start = dynamic->target; + *end = dynamic->target + dynamic->win->win_size - 1; + return (0); + } + + /* Check for a static region */ + sregion = bhndb_find_resource_region(br, rman_get_start(r), + rman_get_size(r)); + if (sregion != NULL && sregion->static_regwin != NULL) { + *start = sregion->addr; + *end = sregion->addr + sregion->size - 1; + + return (0); + } + + /* Not found */ + return (ENOENT); +} + /** - * Find a bus region that maps @p size bytes at @p addr. + * Find the bus region that maps @p size bytes at @p addr. * * @param br The resource state to search. * @param addr The requested starting address. From owner-svn-src-all@freebsd.org Fri May 20 01:03:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 231DBB41D64; Fri, 20 May 2016 01:03:00 +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 E6EFC17C1; Fri, 20 May 2016 01:02:59 +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 u4K12xG9081875; Fri, 20 May 2016 01:02:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K12xIm081872; Fri, 20 May 2016 01:02:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605200102.u4K12xIm081872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 20 May 2016 01:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300252 - in head/sys/dev/bhnd: bcma soc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 01:03:00 -0000 Author: adrian Date: Fri May 20 01:02:58 2016 New Revision: 300252 URL: https://svnweb.freebsd.org/changeset/base/300252 Log: [bhnd] Add BHND SoC support (only BCMA case) This patch introduces support of BHND on SoC: nexus-to-bhnd drivers. bhnd_soc is attached under nexus and responsible for all BHND-style calls from bhnd(4) bus to parents. bcma_nexus is bhnd(4) bus, attached to bhnd_soc and implement all nexus-style behaviour of BHND. Submitted by: Michael Zhilin Reviewed by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6248 Added: head/sys/dev/bhnd/bcma/bcma_nexus.c (contents, props changed) head/sys/dev/bhnd/soc/ head/sys/dev/bhnd/soc/bhnd_soc.c (contents, props changed) head/sys/dev/bhnd/soc/bhnd_soc.h (contents, props changed) Added: head/sys/dev/bhnd/bcma/bcma_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bcma/bcma_nexus.c Fri May 20 01:02:58 2016 (r300252) @@ -0,0 +1,111 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "bhnd_bus_if.h" +#include "bcmavar.h" +#include "bcma_eromreg.h" + +#define BCMA_NEXUS_EROM_RID 10 + +static int +bcma_nexus_probe(device_t dev) +{ + const struct bhnd_chipid *cid = BHND_BUS_GET_CHIPID(device_get_parent(dev), dev); + + /* Check bus type */ + if (cid->chip_type != BHND_CHIPTYPE_BCMA) + return (ENXIO); + + /* Delegate to default probe implementation */ + return (bcma_probe(dev)); +} + +static int +bcma_nexus_attach(device_t dev) +{ + int erom_rid; + int error; + struct resource *erom_res; + const struct bhnd_chipid *cid = BHND_BUS_GET_CHIPID(device_get_parent(dev), dev); + + erom_rid = BCMA_NEXUS_EROM_RID; + error = bus_set_resource(dev, SYS_RES_MEMORY, erom_rid, cid->enum_addr, BCMA_EROM_TABLE_SIZE); + if (error != 0) { + BHND_ERROR_DEV(dev, "failed to set EROM resource"); + return (error); + } + + /* Map the EROM resource and enumerate our children. */ + BHND_DEBUG_DEV(dev, "erom enum address: %jx", cid->enum_addr); + erom_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &erom_rid, RF_ACTIVE); + if (erom_res == NULL) { + BHND_ERROR_DEV(dev, "failed to allocate EROM resource"); + return (ENXIO); + } + + BHND_DEBUG_DEV(dev, "erom scanning start address: %p", rman_get_virtual(erom_res)); + error = bcma_add_children(dev, erom_res, BCMA_EROM_TABLE_START); + + /* Clean up */ + bus_release_resource(dev, SYS_RES_MEMORY, erom_rid, erom_res); + if (error) + return (error); + + /* Call our superclass' implementation */ + return (bcma_attach(dev)); +} + +static device_method_t bcma_nexus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcma_nexus_probe), + DEVMETHOD(device_attach, bcma_nexus_attach), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(bhnd, bcma_nexus_driver, bcma_nexus_methods, sizeof(struct bcma_softc), bcma_driver); +EARLY_DRIVER_MODULE(bcma_nexus, bhnd_soc, bcma_nexus_driver, bhnd_devclass, + NULL, NULL, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + +MODULE_VERSION(bcma_nexus, 1); +MODULE_DEPEND(bcma_nexus, bcma, 1, 1, 1); +MODULE_DEPEND(bcma_nexus, bhnd_soc, 1, 1, 1); Added: head/sys/dev/bhnd/soc/bhnd_soc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/soc/bhnd_soc.c Fri May 20 01:02:58 2016 (r300252) @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "bhndb_if.h" + +/* + * **************************** VARIABLES ************************************* + */ + +struct resource_spec bhnd_soc_default_rspec = {SYS_RES_MEMORY, 0, RF_ACTIVE}; + +/* + * **************************** PROTOTYPES ************************************ + */ + +static int bhnd_soc_attach_bus(device_t dev, struct bhnd_soc_softc* sc); +static int bhnd_soc_probe(device_t dev); +static int bhnd_soc_attach(device_t dev); +int bhnd_soc_attach_by_class(device_t parent, device_t *child, + int unit, devclass_t child_devclass); + +/* + * **************************** IMPLEMENTATION ******************************** + */ + +int +bhnd_soc_attach_by_class(device_t parent, device_t *child, int unit, + devclass_t child_devclass) +{ + int error; + struct bhnd_soc_devinfo* devinfo; + + *child = device_add_child(parent, devclass_get_name(child_devclass), + unit); + if (*child == NULL) + return (ENXIO); + + devinfo = malloc(sizeof(struct bhnd_soc_devinfo*), M_BHND, M_NOWAIT); + resource_list_init(&devinfo->resources); + + for (int i = 0; i < BHND_SOC_MAXNUM_CORES; i++) + resource_list_add(&devinfo->resources, SYS_RES_MEMORY, i, + BHND_SOC_RAM_OFFSET, BHND_SOC_RAM_SIZE, 1); + + device_set_ivars(*child, devinfo); + + error = device_probe_and_attach(*child); + if (error && device_delete_child(parent, *child)) + BHND_ERROR_DEV(parent, "failed to detach bhndb child"); + + return (error); +} + +static int +bhnd_soc_attach_bus(device_t dev, struct bhnd_soc_softc* sc) +{ + int error; + + error = bhnd_read_chipid(dev, &bhnd_soc_default_rspec, + BHND_DEFAULT_CHIPC_ADDR, &sc->chipid); + + if (error) { + return (error); + } + + return (bhnd_soc_attach_by_class(dev, &(sc->bus), -1, bhnd_devclass)); +} + +static int +bhnd_soc_probe(device_t dev) +{ + return (BUS_PROBE_GENERIC); +} + +static int +bhnd_soc_attach(device_t dev) +{ + struct bhnd_soc_softc* sc; + sc = device_get_softc(dev); + sc->dev = dev; + return (bhnd_soc_attach_bus(dev,sc)); +} + +static const struct bhnd_chipid * +bhnd_soc_get_chipid (device_t dev, device_t child) +{ + struct bhnd_soc_softc* sc; + sc = device_get_softc(dev); + return (&sc->chipid); +} + +static struct resource_list * +bhnd_soc_get_rl(device_t dev, device_t child) +{ + struct bhnd_soc_devinfo *dinfo; + dinfo = device_get_ivars(child); + return (&dinfo->resources); +} + +static struct bhnd_resource * +bhnd_soc_alloc_resource(device_t dev, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct bhnd_soc_softc *sc; + struct bhnd_resource *br; + int error; + + sc = device_get_softc(dev); + + /* Allocate resource wrapper */ + br = malloc(sizeof(struct bhnd_resource), M_BHND, M_NOWAIT|M_ZERO); + if (br == NULL) + return (NULL); + + BHND_TRACE_DEV(child,"trying to allocate resource %d: %jx-%jx (%ju)", + *rid, start, end, count); + + /* Configure */ + br->direct = true; + br->res = bus_alloc_resource(child, type, rid, start, end, count, + flags & ~RF_ACTIVE); + if (br->res == NULL) { + BHND_ERROR_DEV(child, "can't allocate resource %d: %jx-%jx (%ju)", + *rid, start, end, count); + goto failed; + } + + if (flags & RF_ACTIVE) { + BHND_TRACE_DEV(child, "trying to activate resource: %d", *rid); + error = bhnd_activate_resource(child, type, *rid, br); + if (error) { + BHND_ERROR_DEV(child, "can't activate BHND resource %d:" + "%jx-%jx (%ju) with error: %d", + *rid, start, end, count, error); + goto failed; + } + } + + return (br); + +failed: + if (br->res != NULL) + bus_release_resource(child, type, *rid, br->res); + + free(br, M_BHND); + return (NULL); +} + +static int +bhnd_soc_activate_resource(device_t dev, device_t child, int type, int rid, + struct bhnd_resource *r) +{ + int error; + + /* + * Fallback to direct + */ + error = bus_activate_resource(child, type, rid, r->res); + if (error) { + BHND_ERROR_DEV(child, "can't activate resource %d, error: %d", + rman_get_rid(r->res), error); + return (error); + } + r->direct = true; + return (0); +} + +static bool +bhnd_soc_is_hw_disabled(device_t dev, device_t child) +{ + return false; +} + +/* + * **************************** DRIVER METADATA **************************** + */ + +static device_method_t bhnd_soc_methods[] = { + //device interface + DEVMETHOD(device_probe, bhnd_soc_probe), + DEVMETHOD(device_attach, bhnd_soc_attach), + //resources + DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), + DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), + //intr + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_config_intr, bus_generic_config_intr), + DEVMETHOD(bus_bind_intr, bus_generic_bind_intr), + DEVMETHOD(bus_describe_intr, bus_generic_describe_intr), + + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + //resource list + DEVMETHOD(bus_get_resource_list, bhnd_soc_get_rl), + + //bhnd - BCMA allocates agent resources + DEVMETHOD(bhnd_bus_alloc_resource, bhnd_soc_alloc_resource), + DEVMETHOD(bhnd_bus_activate_resource, bhnd_soc_activate_resource), + DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_soc_is_hw_disabled), + DEVMETHOD(bhnd_bus_get_chipid, bhnd_soc_get_chipid), + + DEVMETHOD_END +}; + +devclass_t bhnd_soc_devclass; + +DEFINE_CLASS_0(bhnd_soc, bhnd_soc_driver, bhnd_soc_methods, + sizeof(struct bhnd_soc_softc)); +EARLY_DRIVER_MODULE(bhnd_soc, nexus, bhnd_soc_driver, bhnd_soc_devclass, NULL, + NULL, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Added: head/sys/dev/bhnd/soc/bhnd_soc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/soc/bhnd_soc.h Fri May 20 01:02:58 2016 (r300252) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +/* + * $FreeBSD$ + */ +#ifndef _BHND_SOC_BHND_SOC_H_ +#define _BHND_SOC_BHND_SOC_H_ + +#define BHND_SOC_MAXNUM_CORES 0x20 +#define BHND_SOC_RAM_OFFSET 0x0 +#define BHND_SOC_RAM_SIZE 0x20000000 + +struct bhnd_soc_softc { + device_t dev; + device_t bridge; + device_t bus; + struct bhnd_chipid chipid; /* chip identification */ +}; + +struct bhnd_soc_devinfo { + struct resource_list resources; +}; + +#endif /* _BHND_SOC_BHND_SOC_H_ */ From owner-svn-src-all@freebsd.org Fri May 20 01:17:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3448B430C9; Fri, 20 May 2016 01:17:39 +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 CE47D1F57; Fri, 20 May 2016 01:17:39 +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 u4K1Hdkp085613; Fri, 20 May 2016 01:17:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K1HckY085609; Fri, 20 May 2016 01:17:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605200117.u4K1HckY085609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 01:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300253 - in head: . share/man/man9 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 01:17:40 -0000 Author: jhb Date: Fri May 20 01:17:38 2016 New Revision: 300253 URL: https://svnweb.freebsd.org/changeset/base/300253 Log: Remove dangling references to rman_await_resource(). This function was removed when RF_TIMESHARE was removed a couple of years ago. MFC after: 3 days Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/rman.9 head/sys/sys/rman.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 20 01:02:58 2016 (r300252) +++ head/ObsoleteFiles.inc Fri May 20 01:17:38 2016 (r300253) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160519: stale MLINK removed +OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20160517: ReiserFS removed OLD_FILES+=usr/share/man/man5/reiserfs.5.gz # 20160430: kvm_getfiles(3) removed from kvm(3) Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri May 20 01:02:58 2016 (r300252) +++ head/share/man/man9/Makefile Fri May 20 01:17:38 2016 (r300253) @@ -1373,7 +1373,6 @@ MLINKS+=resource_int_value.9 resource_lo resource_int_value.9 resource_string_value.9 MLINKS+=rman.9 rman_activate_resource.9 \ rman.9 rman_adjust_resource.9 \ - rman.9 rman_await_resource.9 \ rman.9 rman_deactivate_resource.9 \ rman.9 rman_fini.9 \ rman.9 rman_first_free_region.9 \ Modified: head/share/man/man9/rman.9 ============================================================================== --- head/share/man/man9/rman.9 Fri May 20 01:02:58 2016 (r300252) +++ head/share/man/man9/rman.9 Fri May 20 01:17:38 2016 (r300253) @@ -25,14 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd May 19, 2016 .Dt RMAN 9 .Os .Sh NAME .Nm rman , .Nm rman_activate_resource , .Nm rman_adjust_resource , -.Nm rman_await_resource , .Nm rman_deactivate_resource , .Nm rman_fini , .Nm rman_init , @@ -67,8 +66,6 @@ .Ft int .Fn rman_adjust_resource "struct resource *r" "rman_res_t start" "rman_res_t end" .Ft int -.Fn rman_await_resource "struct resource *r" "int pri2" "int timo" -.Ft int .Fn rman_deactivate_resource "struct resource *r" .Ft int .Fn rman_fini "struct rman *rm" @@ -387,23 +384,6 @@ flag. If other consumers are waiting for this range, it will wakeup their threads. .Pp The -.Fn rman_await_resource -function performs an asynchronous wait for a resource -.Fa r -to become inactive, that is, for the -.Dv RF_ACTIVE -flag to be cleared. -It is used to enable cooperative sharing of a resource -which can only be safely used by one thread at a time. -The arguments -.Fa pri -and -.Fa timo -are passed to the -.Fn rman_await_resource -function. -.Pp -The .Fn rman_get_start , .Fn rman_get_end , .Fn rman_get_size , Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Fri May 20 01:02:58 2016 (r300252) +++ head/sys/sys/rman.h Fri May 20 01:17:38 2016 (r300253) @@ -121,7 +121,6 @@ TAILQ_HEAD(rman_head, rman); int rman_activate_resource(struct resource *r); int rman_adjust_resource(struct resource *r, rman_res_t start, rman_res_t end); -int rman_await_resource(struct resource *r, int pri, int timo); int rman_first_free_region(struct rman *rm, rman_res_t *start, rman_res_t *end); bus_space_handle_t rman_get_bushandle(struct resource *); bus_space_tag_t rman_get_bustag(struct resource *); From owner-svn-src-all@freebsd.org Fri May 20 01:19:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE3E1B43122; Fri, 20 May 2016 01:19:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A120410E6; Fri, 20 May 2016 01:19:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K1JU26085716; Fri, 20 May 2016 01:19:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K1JUHJ085715; Fri, 20 May 2016 01:19:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605200119.u4K1JUHJ085715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 May 2016 01:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300254 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 01:19:32 -0000 Author: rmacklem Date: Fri May 20 01:19:30 2016 New Revision: 300254 URL: https://svnweb.freebsd.org/changeset/base/300254 Log: MFC: r299201 Give mountd -S priority over outstanding RPC requests when suspending the nfsd. It was reported via email that under certain heavy RPC loads long delays before the exports would be updated was observed when using "mountd -S". This patch reverses the priority between the exclusive lock request to suspend the nfsd threads and the shared lock request for performing RPCs. As such, when mountd attempts to suspend the nfsd threads, it gets priority over outstanding RPC requests to do this. I suspect that the case reported was an artificial test load, but this patch did fix the problem for the reporter. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 20 01:17:38 2016 (r300253) +++ stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 20 01:19:30 2016 (r300254) @@ -234,10 +234,16 @@ nfssvc_program(struct svc_req *rqst, SVC * Get a refcnt (shared lock) on nfsd_suspend_lock. * NFSSVC_SUSPENDNFSD will take an exclusive lock on * nfsd_suspend_lock to suspend these threads. + * The call to nfsv4_lock() that preceeds nfsv4_getref() + * ensures that the acquisition of the exclusive lock + * takes priority over acquisition of the shared lock by + * waiting for any exclusive lock request to complete. * This must be done here, before the check of * nfsv4root exports by nfsvno_v4rootexport(). */ NFSLOCKV4ROOTMUTEX(); + nfsv4_lock(&nfsd_suspend_lock, 0, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); nfsv4_getref(&nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); NFSUNLOCKV4ROOTMUTEX(); From owner-svn-src-all@freebsd.org Fri May 20 01:25:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84B1FB432FE; Fri, 20 May 2016 01:25:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA6717D4; Fri, 20 May 2016 01:25:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K1PEad088921; Fri, 20 May 2016 01:25:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K1PEn2088920; Fri, 20 May 2016 01:25:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605200125.u4K1PEn2088920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 May 2016 01:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300255 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 01:25:15 -0000 Author: rmacklem Date: Fri May 20 01:25:14 2016 New Revision: 300255 URL: https://svnweb.freebsd.org/changeset/base/300255 Log: MFC: r299201 Give mountd -S priority over outstanding RPC requests when suspending the nfsd. It was reported via email that under certain heavy RPC loads long delays before the exports would be updated was observed when using "mountd -S". This patch reverses the priority between the exclusive lock request to suspend the nfsd threads and the shared lock request for performing RPCs. As such, when mountd attempts to suspend the nfsd threads, it gets priority over outstanding RPC requests to do this. I suspect that the case reported was an artificial test load, but this patch did fix the problem for the reporter. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 20 01:19:30 2016 (r300254) +++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 20 01:25:14 2016 (r300255) @@ -234,10 +234,16 @@ nfssvc_program(struct svc_req *rqst, SVC * Get a refcnt (shared lock) on nfsd_suspend_lock. * NFSSVC_SUSPENDNFSD will take an exclusive lock on * nfsd_suspend_lock to suspend these threads. + * The call to nfsv4_lock() that preceeds nfsv4_getref() + * ensures that the acquisition of the exclusive lock + * takes priority over acquisition of the shared lock by + * waiting for any exclusive lock request to complete. * This must be done here, before the check of * nfsv4root exports by nfsvno_v4rootexport(). */ NFSLOCKV4ROOTMUTEX(); + nfsv4_lock(&nfsd_suspend_lock, 0, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); nfsv4_getref(&nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); NFSUNLOCKV4ROOTMUTEX(); From owner-svn-src-all@freebsd.org Fri May 20 01:38:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C784B436EA; Fri, 20 May 2016 01:38:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A2801DCD; Fri, 20 May 2016 01:38:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K1cVWE092060; Fri, 20 May 2016 01:38:31 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K1cVXl092057; Fri, 20 May 2016 01:38:31 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201605200138.u4K1cVXl092057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 20 May 2016 01:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300256 - in head: . etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 01:38:32 -0000 Author: gnn Date: Fri May 20 01:38:31 2016 New Revision: 300256 URL: https://svnweb.freebsd.org/changeset/base/300256 Log: Remove DTrace tooklkit from the mtree and add the files to remove to the ObsoleteFiles list. Sponsored by: DARPA, AFRL Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 20 01:25:14 2016 (r300255) +++ head/ObsoleteFiles.inc Fri May 20 01:38:31 2016 (r300256) @@ -38,6 +38,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20160519: remove DTrace Toolkit from base +OLD_FILES+=usr/share/dtrace/toolkit/execsnoop* +OLD_FILES+=usr/share/dtrace/toolkit/hotkernel* +OLD_FILES+=usr/share/dtrace/toolkit/hotuser* +OLD_FILES+=usr/share/dtrace/toolkit/opensnoop* +OLD_FILES+=usr/share/dtrace/toolkit/procsystime* +OLD_DIRS+=usr/share/dtrace/toolkit # 20160519: stale MLINK removed OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20160517: ReiserFS removed Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Fri May 20 01:25:14 2016 (r300255) +++ head/etc/mtree/BSD.usr.dist Fri May 20 01:38:31 2016 (r300256) @@ -309,8 +309,6 @@ .. .. dtrace - toolkit - .. .. examples BSD_daemon From owner-svn-src-all@freebsd.org Fri May 20 01:41:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E19DB437AE; Fri, 20 May 2016 01:41:48 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65C8B1203; Fri, 20 May 2016 01:41:48 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K1fllF094960; Fri, 20 May 2016 01:41:47 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K1flpV094958; Fri, 20 May 2016 01:41:47 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605200141.u4K1flpV094958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 20 May 2016 01:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 01:41:48 -0000 Author: allanjude Date: Fri May 20 01:41:47 2016 New Revision: 300257 URL: https://svnweb.freebsd.org/changeset/base/300257 Log: Fixup the geliboot sector rounding code Replace all rounding with the round{up,down}2 macros a missing set of braces caused the previous code to be incorrect replace alloca() with malloc() because alloca() can return an allocation that is actually invalid, causing boot to fail Reviewed by: emaste, ed Thanks To: peter Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D6213 Modified: head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Fri May 20 01:38:31 2016 (r300256) +++ head/sys/boot/i386/libi386/biosdisk.c Fri May 20 01:41:47 2016 (r300257) @@ -749,21 +749,29 @@ bd_read(struct disk_devdesc *dev, daddr_ * sectors cannot be decrypted. Round the requested LBA down to * nearest multiple of DEV_GELIBOOT_BSIZE bytes. */ - alignlba = dblk & - ~(daddr_t)((DEV_GELIBOOT_BSIZE / BIOSDISK_SECSIZE) - 1); + alignlba = rounddown2(dblk * BD(dev).bd_sectorsize, + DEV_GELIBOOT_BSIZE) / BD(dev).bd_sectorsize; /* * Round number of blocks to read up to nearest multiple of * DEV_GELIBOOT_BSIZE */ - alignblks = blks + (dblk - alignlba) + - ((DEV_GELIBOOT_BSIZE / BIOSDISK_SECSIZE) - 1) & - ~(int)((DEV_GELIBOOT_BSIZE / BIOSDISK_SECSIZE) - 1); - diff = (dblk - alignlba) * BIOSDISK_SECSIZE; + diff = (dblk - alignlba) * BD(dev).bd_sectorsize; + alignblks = roundup2(blks * BD(dev).bd_sectorsize + diff, + DEV_GELIBOOT_BSIZE) / BD(dev).bd_sectorsize; + /* - * Use a temporary buffer here because the buffer provided by - * the caller may be too small. + * If the read is rounded up to a larger size, use a temporary + * buffer here because the buffer provided by the caller may be + * too small. */ - tmpbuf = alloca(alignblks * BIOSDISK_SECSIZE); + if (diff == 0) { + tmpbuf = dest; + } else { + tmpbuf = malloc(alignblks * BD(dev).bd_sectorsize); + if (tmpbuf == NULL) { + return (-1); + } + } err = bd_io(dev, alignlba, alignblks, tmpbuf, 0); if (err) @@ -779,12 +787,15 @@ bd_read(struct disk_devdesc *dev, daddr_ /* GELI needs the offset relative to the partition start */ p_off = alignlba - dskp.start; - err = geli_read(&dskp, p_off * BIOSDISK_SECSIZE, tmpbuf, - alignblks * BIOSDISK_SECSIZE); + err = geli_read(&dskp, p_off * BD(dev).bd_sectorsize, tmpbuf, + alignblks * BD(dev).bd_sectorsize); if (err) return (err); - bcopy(tmpbuf + diff, dest, blks * BIOSDISK_SECSIZE); + if (tmpbuf != dest) { + bcopy(tmpbuf + diff, dest, blks * BD(dev).bd_sectorsize); + free(tmpbuf); + } return (0); } #endif /* LOADER_GELI_SUPPORT */ @@ -898,10 +909,10 @@ bios_read(void *vdev __unused, struct ds dev.d_partition = priv->part; dev.d_offset = priv->start; - off = off / BIOSDISK_SECSIZE; + off = off / BD(&dev).bd_sectorsize; /* GELI gives us the offset relative to the partition start */ off += dev.d_offset; - bytes = bytes / BIOSDISK_SECSIZE; + bytes = bytes / BD(&dev).bd_sectorsize; return (bd_io(&dev, off, bytes, buf, 0)); } Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Fri May 20 01:38:31 2016 (r300256) +++ head/sys/boot/i386/zfsboot/zfsboot.c Fri May 20 01:41:47 2016 (r300257) @@ -200,7 +200,7 @@ vdev_read(vdev_t *vdev, void *priv, off_ { char *p; daddr_t lba, alignlba; - off_t alignoff, diff; + off_t diff; unsigned int nb, alignnb; struct dsk *dsk = (struct dsk *) priv; @@ -210,10 +210,11 @@ vdev_read(vdev_t *vdev, void *priv, off_ p = buf; lba = off / DEV_BSIZE; lba += dsk->start; - /* Align reads to 4k else 4k sector GELIs will not decrypt. */ - alignoff = off & ~ (off_t)(DEV_GELIBOOT_BSIZE - 1); - /* Round LBA down to nearest multiple of DEV_GELIBOOT_BSIZE bytes. */ - alignlba = alignoff / DEV_BSIZE; + /* + * Align reads to 4k else 4k sector GELIs will not decrypt. + * Round LBA down to nearest multiple of DEV_GELIBOOT_BSIZE bytes. + */ + alignlba = rounddown2(off, DEV_GELIBOOT_BSIZE) / DEV_BSIZE; /* * The read must be aligned to DEV_GELIBOOT_BSIZE bytes relative to the * start of the GELI partition, not the start of the actual disk. From owner-svn-src-all@freebsd.org Fri May 20 03:03:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852D5B43592; Fri, 20 May 2016 03:03:05 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF081478; Fri, 20 May 2016 03:03:05 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K334uK019634; Fri, 20 May 2016 03:03:04 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K334pG019632; Fri, 20 May 2016 03:03:04 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201605200303.u4K334pG019632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Fri, 20 May 2016 03:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300258 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 03:03:05 -0000 Author: jah Date: Fri May 20 03:03:04 2016 New Revision: 300258 URL: https://svnweb.freebsd.org/changeset/base/300258 Log: iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages to prevent memory exhaustion and short allocations on 32-bit systems. Since iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same limit of 42 that Linux uses. Also check the return value of copyin(9) to prevent unnecessary allocation in the failure case. Submitted by: ngie Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5155 Modified: head/sys/dev/iicbus/iic.c head/sys/dev/iicbus/iic.h Modified: head/sys/dev/iicbus/iic.c ============================================================================== --- head/sys/dev/iicbus/iic.c Fri May 20 01:41:47 2016 (r300257) +++ head/sys/dev/iicbus/iic.c Fri May 20 03:03:04 2016 (r300258) @@ -300,9 +300,16 @@ iicrdwr(struct iic_cdevpriv *priv, struc parent = device_get_parent(iicdev); error = 0; + if (d->nmsgs > IIC_RDRW_MAX_MSGS) + return (EINVAL); + buf = malloc(sizeof(*d->msgs) * d->nmsgs, M_IIC, M_WAITOK); error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs); + if (error != 0) { + free(buf, M_IIC); + return (error); + } /* Alloc kernel buffers for userland data, copyin write data */ usrbufs = malloc(sizeof(void *) * d->nmsgs, M_IIC, M_WAITOK | M_ZERO); @@ -318,6 +325,8 @@ iicrdwr(struct iic_cdevpriv *priv, struc m->buf = NULL; if (error != 0) continue; + + /* m->len is uint16_t, so allocation size is capped at 64K. */ m->buf = malloc(m->len, M_IIC, M_WAITOK); if (!(m->flags & IIC_M_RD)) error = copyin(usrbufs[i], m->buf, m->len); Modified: head/sys/dev/iicbus/iic.h ============================================================================== --- head/sys/dev/iicbus/iic.h Fri May 20 01:41:47 2016 (r300257) +++ head/sys/dev/iicbus/iic.h Fri May 20 03:03:04 2016 (r300258) @@ -56,6 +56,8 @@ struct iic_rdwr_data { uint32_t nmsgs; }; +#define IIC_RDRW_MAX_MSGS 42 + #define I2CSTART _IOW('i', 1, struct iiccmd) /* start condition */ #define I2CSTOP _IO('i', 2) /* stop condition */ #define I2CRSTCARD _IOW('i', 3, struct iiccmd) /* reset the card */ From owner-svn-src-all@freebsd.org Fri May 20 03:04:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F8B5B435EE; Fri, 20 May 2016 03:04:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 147D8173B; Fri, 20 May 2016 03:04:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K34N1q019722; Fri, 20 May 2016 03:04:23 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K34NTL019720; Fri, 20 May 2016 03:04:23 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605200304.u4K34NTL019720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 20 May 2016 03:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300259 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 03:04:24 -0000 Author: cy Date: Fri May 20 03:04:22 2016 New Revision: 300259 URL: https://svnweb.freebsd.org/changeset/base/300259 Log: Enable the two ip_frag tuneables. The code is there but the two ip_frag tuneables aren't registered in the ipf_tuners linked list. This commmit enables the two existing ip_frag tuneables by registering them. MFC after: 1 month Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c head/sys/contrib/ipfilter/netinet/ip_frag.h Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:03:04 2016 (r300258) +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:04:22 2016 (r300259) @@ -112,7 +112,7 @@ static void ipf_frag_free __P((ipf_frag_ static frentry_t ipfr_block; -const ipftuneable_t ipf_tuneables[] = { +static ipftuneable_t ipf_frag_tuneables[] = { { { (void *)offsetof(ipf_frag_softc_t, ipfr_size) }, "frag_size", 1, 0x7fffffff, stsizeof(ipf_frag_softc_t, ipfr_size), @@ -189,6 +189,18 @@ ipf_frag_soft_create(softc) RWLOCK_INIT(&softf->ipfr_frag, "ipf fragment rwlock"); RWLOCK_INIT(&softf->ipfr_natfrag, "ipf NAT fragment rwlock"); + softf->ipf_frag_tune = ipf_tune_array_copy(softf, + sizeof(ipf_frag_tuneables), + ipf_frag_tuneables); + if (softf->ipf_frag_tune == NULL) { + ipf_frag_soft_destroy(softc, softf); + return NULL; + } + if (ipf_tune_array_link(softc, softf->ipf_frag_tune) == -1) { + ipf_frag_soft_destroy(softc, softf); + return NULL; + } + softf->ipfr_size = IPFT_SIZE; softf->ipfr_ttl = IPF_TTLVAL(60); softf->ipfr_lock = 1; @@ -219,6 +231,13 @@ ipf_frag_soft_destroy(softc, arg) RW_DESTROY(&softf->ipfr_frag); RW_DESTROY(&softf->ipfr_natfrag); + if (softf->ipf_frag_tune != NULL) { + ipf_tune_array_unlink(softc, softf->ipf_frag_tune); + KFREES(softf->ipf_frag_tune, sizeof(ipf_frag_tuneables)); + softf->ipf_frag_tune = NULL; + } + + KFREE(softf); } Modified: head/sys/contrib/ipfilter/netinet/ip_frag.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.h Fri May 20 03:03:04 2016 (r300258) +++ head/sys/contrib/ipfilter/netinet/ip_frag.h Fri May 20 03:04:22 2016 (r300259) @@ -78,6 +78,7 @@ typedef struct ipf_frag_softc_s { int ipfr_ttl; int ipfr_lock; int ipfr_inited; + ipftuneable_t *ipf_frag_tune; ipfr_t *ipfr_list; ipfr_t **ipfr_tail; ipfr_t *ipfr_natlist; From owner-svn-src-all@freebsd.org Fri May 20 03:11:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6BAEB43689; Fri, 20 May 2016 03:11:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::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 AFC021A0C; Fri, 20 May 2016 03:11:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x230.google.com with SMTP id b78so14898573ioj.3; Thu, 19 May 2016 20:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=fJT2O2pUpPqmfOH+Ed/bF/ux6R7jTS5kcYITgo2Mg2U=; b=UQ41CMK0H6muSOwdqhcsNLyH/au/m4xwUASfx4hWBRvBDmnHREgMjy3NJUbMguJ5Sj GZ7rBxhNeBupm7Uhns1l4fC4iDxvbWxefQ50DeaLc2IAOtTq2HOvR0hpeNR299ayS06+ 7DOQWjtR8iMvwq7mOsbcyi3zQWv/dc8ozJacMH7s8ZYKlr3fvAbH9tugRn0Um6lAI3Du adNCzn5nxbdR00Z0NB8Po+ICTGAn3G4yK/ELUleP57zAHITZKNVk19IoqlBNTrKiRS8z uSKHnmpa8GsmreyVFBoRfOh7KWiEEHQE9+kH1h9++oZBKsFInGujGiMfII+1WQWXu8kX P7QQ== 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:date :message-id:subject:from:to:cc; bh=fJT2O2pUpPqmfOH+Ed/bF/ux6R7jTS5kcYITgo2Mg2U=; b=KfJrzgcYa2AGsGdo0KozaQuexmVrtuWMe+Ybt/7HvxuTZPKEv7MGw/WNL2TF/OxDj4 FqftDPI3NzoH4Ch/dOlJpHD8zIcpplDsBi2RCtRQYZLvwBvE04lZb1fmjzNSiFJhPDS4 RG/1OkrzgrJSC48VKsfDeBSqn6745Twu0E2RAx0qQSfZ2aEuD6Kq1xLsIOrYU/rEAxv5 mQqFaWcmLSqxJ3/x0giuWzSLrqs851RgSV6v29oonSU1fjdC9wrrUOi63PatmPFJoRGT bNGsVr+WWvN2YiA3abmeXn7qayEFiqNCpYh4NEuwJ9VThnLumgA9Lo0uFxrg8x51Hum/ JJKw== X-Gm-Message-State: AOPr4FWDIK6h88bXLzm/jPAPJaYM5OEa1Y3uOPdXye3+1Hz7Qd3HLqXl6ZiusKZHFIr+ywUUGd68Qt4lgtalZA== MIME-Version: 1.0 X-Received: by 10.107.144.135 with SMTP id s129mr960868iod.165.1463713869130; Thu, 19 May 2016 20:11:09 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Thu, 19 May 2016 20:11:09 -0700 (PDT) In-Reply-To: <201605200117.u4K1HckY085609@repo.freebsd.org> References: <201605200117.u4K1HckY085609@repo.freebsd.org> Date: Thu, 19 May 2016 20:11:09 -0700 Message-ID: Subject: Re: svn commit: r300253 - in head: . share/man/man9 sys/sys From: Adrian Chadd To: John Baldwin 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 03:11:10 -0000 Know what's funny? The broadcom siba/bhnd resources almost kinda want this ... :P -adrian On 19 May 2016 at 18:17, John Baldwin wrote: > Author: jhb > Date: Fri May 20 01:17:38 2016 > New Revision: 300253 > URL: https://svnweb.freebsd.org/changeset/base/300253 > > Log: > Remove dangling references to rman_await_resource(). > > This function was removed when RF_TIMESHARE was removed a couple of years > ago. > > MFC after: 3 days > > Modified: > head/ObsoleteFiles.inc > head/share/man/man9/Makefile > head/share/man/man9/rman.9 > head/sys/sys/rman.h > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Fri May 20 01:02:58 2016 (r300252) > +++ head/ObsoleteFiles.inc Fri May 20 01:17:38 2016 (r300253) > @@ -38,6 +38,8 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20160519: stale MLINK removed > +OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz > # 20160517: ReiserFS removed > OLD_FILES+=usr/share/man/man5/reiserfs.5.gz > # 20160430: kvm_getfiles(3) removed from kvm(3) > > Modified: head/share/man/man9/Makefile > ============================================================================== > --- head/share/man/man9/Makefile Fri May 20 01:02:58 2016 (r300252) > +++ head/share/man/man9/Makefile Fri May 20 01:17:38 2016 (r300253) > @@ -1373,7 +1373,6 @@ MLINKS+=resource_int_value.9 resource_lo > resource_int_value.9 resource_string_value.9 > MLINKS+=rman.9 rman_activate_resource.9 \ > rman.9 rman_adjust_resource.9 \ > - rman.9 rman_await_resource.9 \ > rman.9 rman_deactivate_resource.9 \ > rman.9 rman_fini.9 \ > rman.9 rman_first_free_region.9 \ > > Modified: head/share/man/man9/rman.9 > ============================================================================== > --- head/share/man/man9/rman.9 Fri May 20 01:02:58 2016 (r300252) > +++ head/share/man/man9/rman.9 Fri May 20 01:17:38 2016 (r300253) > @@ -25,14 +25,13 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 15, 2014 > +.Dd May 19, 2016 > .Dt RMAN 9 > .Os > .Sh NAME > .Nm rman , > .Nm rman_activate_resource , > .Nm rman_adjust_resource , > -.Nm rman_await_resource , > .Nm rman_deactivate_resource , > .Nm rman_fini , > .Nm rman_init , > @@ -67,8 +66,6 @@ > .Ft int > .Fn rman_adjust_resource "struct resource *r" "rman_res_t start" "rman_res_t end" > .Ft int > -.Fn rman_await_resource "struct resource *r" "int pri2" "int timo" > -.Ft int > .Fn rman_deactivate_resource "struct resource *r" > .Ft int > .Fn rman_fini "struct rman *rm" > @@ -387,23 +384,6 @@ flag. > If other consumers are waiting for this range, it will wakeup their threads. > .Pp > The > -.Fn rman_await_resource > -function performs an asynchronous wait for a resource > -.Fa r > -to become inactive, that is, for the > -.Dv RF_ACTIVE > -flag to be cleared. > -It is used to enable cooperative sharing of a resource > -which can only be safely used by one thread at a time. > -The arguments > -.Fa pri > -and > -.Fa timo > -are passed to the > -.Fn rman_await_resource > -function. > -.Pp > -The > .Fn rman_get_start , > .Fn rman_get_end , > .Fn rman_get_size , > > Modified: head/sys/sys/rman.h > ============================================================================== > --- head/sys/sys/rman.h Fri May 20 01:02:58 2016 (r300252) > +++ head/sys/sys/rman.h Fri May 20 01:17:38 2016 (r300253) > @@ -121,7 +121,6 @@ TAILQ_HEAD(rman_head, rman); > > int rman_activate_resource(struct resource *r); > int rman_adjust_resource(struct resource *r, rman_res_t start, rman_res_t end); > -int rman_await_resource(struct resource *r, int pri, int timo); > int rman_first_free_region(struct rman *rm, rman_res_t *start, rman_res_t *end); > bus_space_handle_t rman_get_bushandle(struct resource *); > bus_space_tag_t rman_get_bustag(struct resource *); > From owner-svn-src-all@freebsd.org Fri May 20 03:22:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9C97B43A37; Fri, 20 May 2016 03:22:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76A7C113D; Fri, 20 May 2016 03:22:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K3Mf3w025656; Fri, 20 May 2016 03:22:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K3Mf8w025655; Fri, 20 May 2016 03:22:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605200322.u4K3Mf8w025655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 20 May 2016 03:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300260 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 03:22:42 -0000 Author: cy Date: Fri May 20 03:22:41 2016 New Revision: 300260 URL: https://svnweb.freebsd.org/changeset/base/300260 Log: Remove extraneous blank line. MFC after: 1 month X-MFC with: r300259 Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:04:22 2016 (r300259) +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:22:41 2016 (r300260) @@ -237,7 +237,6 @@ ipf_frag_soft_destroy(softc, arg) softf->ipf_frag_tune = NULL; } - KFREE(softf); } From owner-svn-src-all@freebsd.org Fri May 20 03:27:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCC81B43AC8; Fri, 20 May 2016 03:27:26 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 74147130E; Fri, 20 May 2016 03:27:26 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 3b5wbpnJJEWlr3b5xb4Bei; Thu, 19 May 2016 21:27:25 -0600 X-Authority-Analysis: v=2.2 cv=P7p4vWIu c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=yrkiwgmsf1kA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=Y8eC-1JYAjAzCA26YYAA:9 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id DAD5D13751; Thu, 19 May 2016 20:27:23 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u4K3RNPw046568; Thu, 19 May 2016 20:27:23 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201605200327.u4K3RNPw046568@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: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300259 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Cy Schubert of "Fri, 20 May 2016 03:04:23 -0000." <201605200304.u4K34NTL019720@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 19 May 2016 20:27:23 -0700 X-CMAE-Envelope: MS4wfFRDIkc0KHzvFPMDaNqrk2kC1ZIvCvio7fQpqsHntbyXZj475o5N0g8m8GOBq0kW83H1RCqF1tXR9Td9KWJ6RrQImgtgi7FYDvLjYXbkRgfcsdepm+JS Vti5bJy3jXXs9vEGzRHi+0A/lgPOEZZ8yAjM3KWxOfDVOcrujTlkps2QLzEiPeN93JZPros2Oj8M3jh5muh74ORYosGshFD4JTZlJQD4pjmbsPXhHjd4Euz8 2ya7mpt7mJ0WApqZvXR17i3gE3Z5/xwnxNUxb7CC4hGOOTbfJnyhi3aV/w3vS7B/ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 03:27:26 -0000 In message <201605200304.u4K34NTL019720@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Fri May 20 03:04:22 2016 > New Revision: 300259 > URL: https://svnweb.freebsd.org/changeset/base/300259 > > Log: > Enable the two ip_frag tuneables. The code is there but the two > ip_frag tuneables aren't registered in the ipf_tuners linked list. > This commmit enables the two existing ip_frag tuneables by registering > them. > > MFC after: 1 month > > Modified: > head/sys/contrib/ipfilter/netinet/ip_frag.c > head/sys/contrib/ipfilter/netinet/ip_frag.h > > Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c > ============================================================================= > = > --- head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:03:04 201 > 6 (r300258) > +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:04:22 201 > 6 (r300259) > @@ -112,7 +112,7 @@ static void ipf_frag_free __P((ipf_frag_ > > static frentry_t ipfr_block; > > -const ipftuneable_t ipf_tuneables[] = { > +static ipftuneable_t ipf_frag_tuneables[] = { > { { (void *)offsetof(ipf_frag_softc_t, ipfr_size) }, > "frag_size", 1, 0x7fffffff, > stsizeof(ipf_frag_softc_t, ipfr_size), > @@ -189,6 +189,18 @@ ipf_frag_soft_create(softc) > RWLOCK_INIT(&softf->ipfr_frag, "ipf fragment rwlock"); > RWLOCK_INIT(&softf->ipfr_natfrag, "ipf NAT fragment rwlock"); > > + softf->ipf_frag_tune = ipf_tune_array_copy(softf, > + sizeof(ipf_frag_tuneables), > + ipf_frag_tuneables); > + if (softf->ipf_frag_tune == NULL) { > + ipf_frag_soft_destroy(softc, softf); > + return NULL; > + } > + if (ipf_tune_array_link(softc, softf->ipf_frag_tune) == -1) { > + ipf_frag_soft_destroy(softc, softf); > + return NULL; > + } > + > softf->ipfr_size = IPFT_SIZE; > softf->ipfr_ttl = IPF_TTLVAL(60); > softf->ipfr_lock = 1; > @@ -219,6 +231,13 @@ ipf_frag_soft_destroy(softc, arg) > RW_DESTROY(&softf->ipfr_frag); > RW_DESTROY(&softf->ipfr_natfrag); > > + if (softf->ipf_frag_tune != NULL) { > + ipf_tune_array_unlink(softc, softf->ipf_frag_tune); > + KFREES(softf->ipf_frag_tune, sizeof(ipf_frag_tuneables)); > + softf->ipf_frag_tune = NULL; > + } > + > + > KFREE(softf); > } > > > Modified: head/sys/contrib/ipfilter/netinet/ip_frag.h > ============================================================================= > = > --- head/sys/contrib/ipfilter/netinet/ip_frag.h Fri May 20 03:03:04 201 > 6 (r300258) > +++ head/sys/contrib/ipfilter/netinet/ip_frag.h Fri May 20 03:04:22 201 > 6 (r300259) > @@ -78,6 +78,7 @@ typedef struct ipf_frag_softc_s { > int ipfr_ttl; > int ipfr_lock; > int ipfr_inited; > + ipftuneable_t *ipf_frag_tune; > ipfr_t *ipfr_list; > ipfr_t **ipfr_tail; > ipfr_t *ipfr_natlist; > Darren Reed has been notified so that this patch can be included in the upline ipfilter repo. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri May 20 03:50:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA6FDB43E66; Fri, 20 May 2016 03:50:25 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0F1E1D71; Fri, 20 May 2016 03:50:25 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O7G00K00HTDFX00@mr11p00im-asmtp003.me.com>; Fri, 20 May 2016 03:50:19 +0000 (GMT) Received: from [192.168.1.4] (c-67-169-142-6.hsd1.ca.comcast.net [67.169.142.6]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7G00D1RINUMR00@mr11p00im-asmtp003.me.com>; Fri, 20 May 2016 03:50:19 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-19_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605200047 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Thu, 19 May 2016 20:50:21 -0700 Subject: Re: svn commit: r300258 - head/sys/dev/iicbus From: Ravi Pokala Sender: "Pokala, Ravi" To: "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <371B94E2-E906-4F9C-9A9B-A9D35CD93D21@panasas.com> Thread-topic: svn commit: r300258 - head/sys/dev/iicbus References: <201605200303.u4K334pG019632@repo.freebsd.org> In-reply-to: <201605200303.u4K334pG019632@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1463716219; bh=5VCitGwoavPq0U7YqVUF628wCNRtn/Ez1+UAuRE9PlM=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=FACStwcd6r/LMWlmY9c3a/jjIkORd4yDdMeEG9cxwY65rdMCmM/KQRziYQY3IMILh +TeTZxqKaIsZJWYYk1GXzoKBPBj9ylvRRX2/Zi3jLU7q/Wg9tj4lQSHsHWL4r/O6wH dxxu6vzt3Ear/ci39q814HkN12IG/r0d9+zISnCpZWpIgRo5XjnmC6s9vO6bbTp9Oe diAVIxWYhCnsKCz2bF2gIzHL/ohUsyYgSxNdSKd94KYr57p8iwn30v5VVpE/X+nflQ VWP0IS2qoyX7HThBVwN/EHao6MAE+RrqMwfiIAe6As/BZ3kOK3yeUb4Hlczcyi+NM5 SGIw540hVYlaA== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 03:50:25 -0000 -----Original Message----- From: on behalf of "Jason A. Harmening" = Date: 2016-05-19, Thursday at 20:03 To: , , Subject: svn commit: r300258 - head/sys/dev/iicbus >Author: jah >Date: Fri May 20 03:03:04 2016 >New Revision: 300258 >URL: https://svnweb.freebsd.org/changeset/base/300258 > >Log: > iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messa= ges to prevent memory exhaustion and short allocations on 32-bit systems. Si= nce iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the s= ame limit of 42 that Linux uses. > =20 > Also check the return value of copyin(9) to prevent unnecessary allocati= on in the failure case. > =20 > ... > =20 > error =3D copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs); >+ if (error !=3D 0) { >+ free(buf, M_IIC); >+ return (error); >+ } >=20 Hi Jason, If I=E2=80=99m reading that right, it=E2=80=99s not preventing any allocations, but it = is preventing a leak. Is that correct? Thanks, Ravi (rpokala@) From owner-svn-src-all@freebsd.org Fri May 20 04:00:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1A93B43FCD; Fri, 20 May 2016 04:00:22 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::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 AA475121D; Fri, 20 May 2016 04:00:22 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-pa0-x244.google.com with SMTP id xm6so9634678pab.3; Thu, 19 May 2016 21:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=dVie6/xHq4JSKkHUtEKgbFqfAmo0zE5lU/rMOJRW+dA=; b=eay9uX4pZj0kBjagk6+U8K9kq8wKRtiLb+oHYwpuTYGZYB9FMGovhi05C5j9ZuUmbr OpI0vHA1XoHf0VqeOM9I/cpXteaOpQ3nntnaaOaynU8oc/pAEgrGIVTsLczYMbFZptZW K3HIumEbEna+6wCDdDyEEsSSHTZyaPLbVZkXxexBsJe8SGIsAyxwqD4J3DNUmNm3FbCE 82m9s5MewCm3Siw0Vo7pkulwYfhaZDe4wb2TiM/B0+PzJa7DkqWidDjx6NAJrVVpAbbN PjHGFB+WwEKBM4T9KDJPekCjqzLKWN1nE79yzQH6cRoUFVrXjlXetwhMwNcmpQ+akSyX E8Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=dVie6/xHq4JSKkHUtEKgbFqfAmo0zE5lU/rMOJRW+dA=; b=R3GJtxonQqH2F0yTCfbvAwialKXdMCddU2Wu0xiX4fuwWX6LFaq9TfJ0OfrO1kPGLt 7Pg3GodDO2FBOPBvRVJoREagjfMPvMYVWP2NpKiki94ZS0pjGTMI62b+G9vcpmrQrP0Y UUU/BtR7FqTghNdhRO3VeojIZhAsy36SeykMBr/0wXOF1wHaTqTrXhW6sKiijjRD5bH4 KIFmP17odx9vbkfMzfDmS1DZ+7KNdfgaFpj22Ps5J429y/NT/lHDzDCtfo/Sw9MuPDo3 xhs7sGUZqLe9b79iXyV0A6fAZYae8iKMZ9qnX7XI9zIoK7QBTqD1ZdToonzKWj/wp7pI lgJA== X-Gm-Message-State: AOPr4FVeseLkxyRSsTI6JSf+yCm1l9ojfpvd7rs5PuEBHYV5y66ay82L+EDNPzxS1YTuxg== X-Received: by 10.66.166.6 with SMTP id zc6mr1372788pab.21.1463716822152; Thu, 19 May 2016 21:00:22 -0700 (PDT) Received: from corona.austin.rr.com (c-67-188-30-11.hsd1.ca.comcast.net. [67.188.30.11]) by smtp.googlemail.com with ESMTPSA id br5sm5980761pab.39.2016.05.19.21.00.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 May 2016 21:00:21 -0700 (PDT) Subject: Re: svn commit: r300258 - head/sys/dev/iicbus To: Ravi Pokala , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605200303.u4K334pG019632@repo.freebsd.org> <371B94E2-E906-4F9C-9A9B-A9D35CD93D21@panasas.com> From: Jason Harmening Message-ID: <573E8CFB.8090007@gmail.com> Date: Thu, 19 May 2016 21:05:15 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <371B94E2-E906-4F9C-9A9B-A9D35CD93D21@panasas.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wdfkXCrMBbsV3tTt1XrLIdUCnou6BPrgo" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 04:00:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wdfkXCrMBbsV3tTt1XrLIdUCnou6BPrgo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/19/16 20:50, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of "Jason A. Harmeni= ng" > Date: 2016-05-19, Thursday at 20:03 > To: , , > Subject: svn commit: r300258 - head/sys/dev/iicbus >=20 >> Author: jah >> Date: Fri May 20 03:03:04 2016 >> New Revision: 300258 >> URL: https://svnweb.freebsd.org/changeset/base/300258 >> >> Log: >> iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of me= ssages to prevent memory exhaustion and short allocations on 32-bit syste= ms. Since iicrdwr is intended to be a workalike of a Linux i2c-dev call, = use the same limit of 42 that Linux uses. >> =20 >> Also check the return value of copyin(9) to prevent unnecessary alloc= ation in the failure case. >> =20 >> ... >> =20 >> error =3D copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs); >> + if (error !=3D 0) { >> + free(buf, M_IIC); >> + return (error); >> + } >> >=20 > Hi Jason, >=20 > If I=E2=80=99m reading that right, it=E2=80=99s not preventing any allo= cations, but it is preventing a leak. Is that correct? >=20 > Thanks, >=20 > Ravi (rpokala@) >=20 >=20 Hi Ravi, There shouldn't be a leak in here, but checking the result prevents falling through the rest of the function, including the unnecessary malloc of usrbufs right after this. It also makes the error handling clearer. Thanks, Jason --wdfkXCrMBbsV3tTt1XrLIdUCnou6BPrgo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJXPoz8XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRENkY3MTQyREU0MTU4MTgyRkZDNUU2ODVC QjlGOEJGOTkyODQxRDFCAAoJELufi/mShB0b47oIAI/bEO3FBfBJzir97Td4AZ2W veG1JMN+yLlnUX0FG8Ij+VOzqu2+vRhONPgp68zEIMyaPwLQS5eyTfWmowibRJbX FM+DrulKhI/mNUZ9r2QluilB7PIrJtXwcpGZbVeu84dOfYWgDDbqfIwSlF8kyxLh YDvkFeu86vZabocP9ovzt8Kjw1epJ0jcpVm/uK3BI6gsYvV7iQ7jJQDOXZCvYhlu QbCkppO42SfzexgCLcyD+uXrVFiXddaCQp9g3E0OeSf408to4gBdwstpnN/EQMYT Q4GWvd3P23RpBeAHOGxEIq1h5admLd+F7+c0/LYm0s0bxvtL6beqexFnmZuMKhE= =xVDU -----END PGP SIGNATURE----- --wdfkXCrMBbsV3tTt1XrLIdUCnou6BPrgo-- From owner-svn-src-all@freebsd.org Fri May 20 04:31:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37F85B43639; Fri, 20 May 2016 04:31:46 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DAEC1059; Fri, 20 May 2016 04:31:46 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O7G00F00KJ51900@mr11p00im-asmtp003.me.com>; Fri, 20 May 2016 04:31:45 +0000 (GMT) Received: from [192.168.1.4] (c-67-169-142-6.hsd1.ca.comcast.net [67.169.142.6]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7G00G9LKKWX100@mr11p00im-asmtp003.me.com>; Fri, 20 May 2016 04:31:45 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-19_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605200057 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Thu, 19 May 2016 21:31:47 -0700 Subject: Re: svn commit: r300258 - head/sys/dev/iicbus From: Ravi Pokala Sender: "Pokala, Ravi" To: Jason Harmening , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r300258 - head/sys/dev/iicbus References: <201605200303.u4K334pG019632@repo.freebsd.org> <371B94E2-E906-4F9C-9A9B-A9D35CD93D21@panasas.com> <573E8CFB.8090007@gmail.com> In-reply-to: <573E8CFB.8090007@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1463718705; bh=gk9Eu3n3NI0gft6/vw8PzNrlfd23ZGMIspNpUrCRckU=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=oKmChSB7+c7td3VOXud91zslkTakwwBNksDyzDlyOUDfCLF7oiEh6wZkdXEvwHhcS BbGR8dqCmH7zn1mmHNWYLdI5eMrKE6p2anU45Krd1R5/57tV8bi28sgNRp+p5ybu2U pE4FroC2dXSrHli6OxGBFkUrmV9QIBxPDYY8gMVETWgvPd0npWTVuukWTNxhJWSB3P by3LYTbtUxURtUiTNdqBOWEMSNtjq7aSsT/SqOszSTSW8ObZ1/dmRKyAmD6WH3RQJd XU+PPRemMR8tBzOdntmz2n8S/Cw03d+Q0+DB4xlprSII9IXVENkpvm0voFMN9JBgnR iJWxSpfq2iP9A== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 04:31:46 -0000 -----Original Message----- From: Jason Harmening Date: 2016-05-19, Thursday at 21:05 To: Ravi Pokala , "Jason A. Harmening" , = , , Subject: Re: svn commit: r300258 - head/sys/dev/iicbus >On 05/19/16 20:50, Ravi Pokala wrote: >> -----Original Message----- >> From: on behalf of "Jason A. Harmenin= g" >> Date: 2016-05-19, Thursday at 20:03 >> To: , , >> Subject: svn commit: r300258 - head/sys/dev/iicbus >>=20 >> Hi Jason, >>=20 >> If I=E2=80=99m reading that right, it=E2=80=99s not preventing any allocations, but = it is preventing a leak. Is that correct? >>=20 >> Thanks, >>=20 >> Ravi (rpokala@) > >Hi Ravi, > >There shouldn't be a leak in here, but checking the result prevents >falling through the rest of the function, including the unnecessary >malloc of usrbufs right after this. How did I miss that earlier? Time for new glasses! :-P >It also makes the error handling clearer. Yeah. >Thanks, >Jason Thank *you*, Ravi (rpokala@) From owner-svn-src-all@freebsd.org Fri May 20 04:43:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3581DB437A0; Fri, 20 May 2016 04:43:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC6991708; Fri, 20 May 2016 04:43:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K4hutj049824; Fri, 20 May 2016 04:43:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K4huFO049823; Fri, 20 May 2016 04:43:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605200443.u4K4huFO049823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 May 2016 04:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300261 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 04:43:58 -0000 Author: markj Date: Fri May 20 04:43:56 2016 New Revision: 300261 URL: https://svnweb.freebsd.org/changeset/base/300261 Log: Fix the style of the paging target predicates. Discussed with: alc, kib MFC after: 1 week Modified: head/sys/sys/vmmeter.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Fri May 20 03:22:41 2016 (r300260) +++ head/sys/sys/vmmeter.h Fri May 20 04:43:56 2016 (r300261) @@ -125,13 +125,12 @@ extern int vm_pageout_wakeup_thresh; * This routine is typically used at the user<->system interface to determine * whether we need to block in order to avoid a low memory deadlock. */ - -static __inline -int +static inline int vm_page_count_severe(void) { - return (vm_cnt.v_free_severe > (vm_cnt.v_free_count + - vm_cnt.v_cache_count)); + + return (vm_cnt.v_free_severe > vm_cnt.v_free_count + + vm_cnt.v_cache_count); } /* @@ -143,50 +142,46 @@ vm_page_count_severe(void) * to wake waiters up, and when (after making a pass) to become more * desperate. */ - -static __inline -int +static inline int vm_page_count_min(void) { - return (vm_cnt.v_free_min > (vm_cnt.v_free_count + vm_cnt.v_cache_count)); + + return (vm_cnt.v_free_min > vm_cnt.v_free_count + vm_cnt.v_cache_count); } /* * Return TRUE if we have not reached our free page target during * free page recovery operations. */ - -static __inline -int +static inline int vm_page_count_target(void) { - return (vm_cnt.v_free_target > (vm_cnt.v_free_count + - vm_cnt.v_cache_count)); + + return (vm_cnt.v_free_target > vm_cnt.v_free_count + + vm_cnt.v_cache_count); } /* * Return the number of pages we need to free-up or cache * A positive number indicates that we do not have enough free pages. */ - -static __inline -int +static inline int vm_paging_target(void) { - return (vm_cnt.v_free_target - (vm_cnt.v_free_count + - vm_cnt.v_cache_count)); + + return (vm_cnt.v_free_target - (vm_cnt.v_free_count + + vm_cnt.v_cache_count)); } /* * Returns TRUE if the pagedaemon needs to be woken up. */ - -static __inline -int +static inline int vm_paging_needed(void) { - return (vm_cnt.v_free_count + vm_cnt.v_cache_count < - (u_int)vm_pageout_wakeup_thresh); + + return (vm_cnt.v_free_count + vm_cnt.v_cache_count < + (u_int)vm_pageout_wakeup_thresh); } #endif From owner-svn-src-all@freebsd.org Fri May 20 04:45:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D96DB4380A; Fri, 20 May 2016 04:45:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E49DF18A3; Fri, 20 May 2016 04:45:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K4j92p049930; Fri, 20 May 2016 04:45:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K4j82x049925; Fri, 20 May 2016 04:45:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605200445.u4K4j82x049925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 May 2016 04:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300262 - in head/sys: kern netinet6 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 04:45:10 -0000 Author: markj Date: Fri May 20 04:45:08 2016 New Revision: 300262 URL: https://svnweb.freebsd.org/changeset/base/300262 Log: Move IPv6 malloc tag definitions into the IPv6 code. Modified: head/sys/kern/kern_malloc.c head/sys/netinet6/ip6_output.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/sys/malloc.h Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri May 20 04:43:56 2016 (r300261) +++ head/sys/kern/kern_malloc.c Fri May 20 04:45:08 2016 (r300262) @@ -110,9 +110,6 @@ MALLOC_DEFINE(M_CACHE, "cache", "Various MALLOC_DEFINE(M_DEVBUF, "devbuf", "device driver memory"); MALLOC_DEFINE(M_TEMP, "temp", "misc temporary data buffers"); -MALLOC_DEFINE(M_IP6OPT, "ip6opt", "IPv6 options"); -MALLOC_DEFINE(M_IP6NDP, "ip6ndp", "IPv6 Neighbor Discovery"); - static struct malloc_type *kmemstatistics; static int kmemcount; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 20 04:43:56 2016 (r300261) +++ head/sys/netinet6/ip6_output.c Fri May 20 04:45:08 2016 (r300262) @@ -135,6 +135,8 @@ struct ip6_exthdrs { struct mbuf *ip6e_dest2; }; +static MALLOC_DEFINE(M_IP6OPT, "ip6opt", "IPv6 options"); + static int ip6_pcbopt(int, u_char *, int, struct ip6_pktopts **, struct ucred *, int); static int ip6_pcbopts(struct ip6_pktopts **, struct mbuf *, Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri May 20 04:43:56 2016 (r300261) +++ head/sys/netinet6/nd6.c Fri May 20 04:45:08 2016 (r300262) @@ -85,6 +85,8 @@ __FBSDID("$FreeBSD$"); #define SIN6(s) ((const struct sockaddr_in6 *)(s)) +MALLOC_DEFINE(M_IP6NDP, "ip6ndp", "IPv6 Neighbor Discovery"); + /* timer values */ VNET_DEFINE(int, nd6_prune) = 1; /* walk list every 1 seconds */ VNET_DEFINE(int, nd6_delay) = 5; /* delay first probe time 5 second */ Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Fri May 20 04:43:56 2016 (r300261) +++ head/sys/netinet6/nd6.h Fri May 20 04:45:08 2016 (r300262) @@ -316,6 +316,10 @@ struct nd_pfxrouter { LIST_HEAD(nd_prhead, nd_prefix); +#ifdef MALLOC_DECLARE +MALLOC_DECLARE(M_IP6NDP); +#endif + /* nd6.c */ VNET_DECLARE(int, nd6_prune); VNET_DECLARE(int, nd6_delay); Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Fri May 20 04:43:56 2016 (r300261) +++ head/sys/sys/malloc.h Fri May 20 04:45:08 2016 (r300262) @@ -146,9 +146,6 @@ MALLOC_DECLARE(M_CACHE); MALLOC_DECLARE(M_DEVBUF); MALLOC_DECLARE(M_TEMP); -MALLOC_DECLARE(M_IP6OPT); /* for INET6 */ -MALLOC_DECLARE(M_IP6NDP); /* for INET6 */ - /* * Deprecated macro versions of not-quite-malloc() and free(). */ From owner-svn-src-all@freebsd.org Fri May 20 05:33:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21844B410A7; Fri, 20 May 2016 05:33: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 E6C4F1DEA; Fri, 20 May 2016 05:33:27 +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 u4K5XR4W064870; Fri, 20 May 2016 05:33:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K5XRsf064869; Fri, 20 May 2016 05:33:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605200533.u4K5XRsf064869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 20 May 2016 05:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300264 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 05:33:28 -0000 Author: imp Date: Fri May 20 05:33:26 2016 New Revision: 300264 URL: https://svnweb.freebsd.org/changeset/base/300264 Log: Fix a bug in the parsing code: always use the len and not 8. Modified: head/lib/libstand/uuid_from_string.c Modified: head/lib/libstand/uuid_from_string.c ============================================================================== --- head/lib/libstand/uuid_from_string.c Fri May 20 05:00:05 2016 (r300263) +++ head/lib/libstand/uuid_from_string.c Fri May 20 05:33:26 2016 (r300264) @@ -57,7 +57,7 @@ fromhex(const char *s, int len, int *ok) if (!*ok) return 0; v = 0; - for (i = 0; i < 8; i++) { + for (i = 0; i < len; i++) { h = hex2int(s[i]); if (h == 16) { *ok = 0; From owner-svn-src-all@freebsd.org Fri May 20 06:02:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FA4EB41640; Fri, 20 May 2016 06:02:45 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6006C1967; Fri, 20 May 2016 06:02:45 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K62iOI074668; Fri, 20 May 2016 06:02:44 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K62ibt074667; Fri, 20 May 2016 06:02:44 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200602.u4K62ibt074667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300265 - stable/10/usr.bin/mklocale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:02:45 -0000 Author: truckman Date: Fri May 20 06:02:44 2016 New Revision: 300265 URL: https://svnweb.freebsd.org/changeset/base/300265 Log: MFC r299524 Use strlcpy() instead of strncpy() when copying the encoding value to ensure that the destination is NUL terminated. Length truncation of one more character should not be an issue since encoding values that long are not supported by libc. The destination string is treated as a NUL terminated string, but it is only passed to strcmp() for comparison to a set of shorter, fixed length strings, so this is not a serious problem. Reported by: Coverity CID: 974769 Modified: stable/10/usr.bin/mklocale/yacc.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mklocale/yacc.y ============================================================================== --- stable/10/usr.bin/mklocale/yacc.y Fri May 20 05:33:26 2016 (r300264) +++ stable/10/usr.bin/mklocale/yacc.y Fri May 20 06:02:44 2016 (r300265) @@ -123,7 +123,7 @@ entry : ENCODING STRING strcmp($2, "BIG5") && strcmp($2, "MSKanji")) warnx("ENCODING %s is not supported by libc", $2); - strncpy(new_locale.encoding, $2, + strlcpy(new_locale.encoding, $2, sizeof(new_locale.encoding)); } | VARIABLE { new_locale.variable_len = strlen($1) + 1; From owner-svn-src-all@freebsd.org Fri May 20 06:05:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9556B416E3; Fri, 20 May 2016 06:05:21 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4BA1BE4; Fri, 20 May 2016 06:05:21 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K65KFU075066; Fri, 20 May 2016 06:05:20 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K65KVa075065; Fri, 20 May 2016 06:05:20 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200605.u4K65KVa075065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300266 - stable/10/usr.bin/msgs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:05:21 -0000 Author: truckman Date: Fri May 20 06:05:20 2016 New Revision: 300266 URL: https://svnweb.freebsd.org/changeset/base/300266 Log: MFC r299525 Use strlcpy() instead of strncpy() when copying date and subj to ensure that these are properly NUL terminated since they are passed to printf(). Reported by: Coverity CID: 974770 Modified: stable/10/usr.bin/msgs/msgs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/msgs/msgs.c ============================================================================== --- stable/10/usr.bin/msgs/msgs.c Fri May 20 06:02:44 2016 (r300265) +++ stable/10/usr.bin/msgs/msgs.c Fri May 20 06:05:20 2016 (r300266) @@ -855,7 +855,7 @@ gfrsub(FILE *infile) } *ptr = '\0'; if (*(in = nxtfld(in))) - strncpy(date, in, sizeof date); + strlcpy(date, in, sizeof date); else { date[0] = '\n'; date[1] = '\0'; @@ -886,7 +886,7 @@ gfrsub(FILE *infile) if (!seensubj && strncmp(inbuf, "Subj", 4)==0) { seensubj = YES; frompos = ftello(infile); - strncpy(subj, nxtfld(inbuf), sizeof subj); + strlcpy(subj, nxtfld(inbuf), sizeof subj); } } if (!blankline) @@ -899,7 +899,7 @@ gfrsub(FILE *infile) /* * for possible use with Mail */ - strncpy(subj, "(No Subject)\n", sizeof subj); + strlcpy(subj, "(No Subject)\n", sizeof subj); } static char * From owner-svn-src-all@freebsd.org Fri May 20 06:06:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD037B4175D; Fri, 20 May 2016 06:06: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 9E9FD1D7D; Fri, 20 May 2016 06:06:22 +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 u4K66LXh075198; Fri, 20 May 2016 06:06:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K66L6K075197; Fri, 20 May 2016 06:06:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605200606.u4K66L6K075197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 20 May 2016 06:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300267 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:06:22 -0000 Author: adrian Date: Fri May 20 06:06:21 2016 New Revision: 300267 URL: https://svnweb.freebsd.org/changeset/base/300267 Log: [ath] convert recent changes over to HAL format. This is needed to compile the ath tools, that includes this code to run in userland. Tested: * Carambola 2, AR9331, STA mode Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Fri May 20 06:05:20 2016 (r300266) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Fri May 20 06:06:21 2016 (r300267) @@ -424,7 +424,7 @@ addchan(struct ath_hal *ah, struct ieee8 struct ieee80211_channel *c; if (*nchans >= maxchans) - return (ENOBUFS); + return (HAL_ENOMEM); c = &chans[(*nchans)++]; c->ic_freq = freq; @@ -443,10 +443,11 @@ copychan_prev(struct ath_hal *ah, struct { struct ieee80211_channel *c; - KASSERT(*nchans > 0, ("channel list is empty\n")); + if (*nchans == 0) + return (HAL_EINVAL); if (*nchans >= maxchans) - return (ENOBUFS); + return (HAL_ENOMEM); c = &chans[(*nchans)++]; c[0] = c[-1]; @@ -632,8 +633,8 @@ getchannels(struct ath_hal *ah, else if (cm->flags & IEEE80211_CHAN_2GHZ) rd = rd2GHz; else { - KASSERT(0, ("%s: Unkonwn HAL flags 0x%x\n", - __func__, cm->flags)); + ath_hal_printf(ah, "%s: Unkonwn HAL flags 0x%x\n", + __func__, cm->flags); return HAL_EINVAL; } From owner-svn-src-all@freebsd.org Fri May 20 06:19:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4E5CB41A72; Fri, 20 May 2016 06:19:01 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F346127F; Fri, 20 May 2016 06:19:01 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6J0HM078588; Fri, 20 May 2016 06:19:00 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6J0lW078587; Fri, 20 May 2016 06:19:00 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200619.u4K6J0lW078587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300268 - stable/10/usr.sbin/ypbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:19:01 -0000 Author: truckman Date: Fri May 20 06:19:00 2016 New Revision: 300268 URL: https://svnweb.freebsd.org/changeset/base/300268 Log: MFC r290903, r299573 r290903 is needed to prevent a conflict whem merging r299573 r290903 | araujo | 2015-11-15 19:18:40 -0800 (Sun, 15 Nov 2015) | 5 lines Don't need cast malloc. r299573 | truckman | 2016-05-12 14:35:40 -0700 (Thu, 12 May 2016) | 10 lines Use strlcpy() instead of strncpy() when copying to dom_domain to ensure that the latter is NUL terminated since it is passed as an argument to *printf(). Warn about NIS domains that are too long. Reported by: Coverity CID: 1009620, 1009621 Modified: stable/10/usr.sbin/ypbind/ypbind.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ypbind/ypbind.c ============================================================================== --- stable/10/usr.sbin/ypbind/ypbind.c Fri May 20 06:06:21 2016 (r300267) +++ stable/10/usr.sbin/ypbind/ypbind.c Fri May 20 06:19:00 2016 (r300268) @@ -199,14 +199,19 @@ rejecting.", *argp); res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; return (&res); } - ypdb = (struct _dom_binding *)malloc(sizeof *ypdb); + if (strlen(*argp) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", *argp); + res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; + return (&res); + } + ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; return (&res); } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); ypdb->dom_vers = YPVERS; ypdb->dom_alive = 0; ypdb->dom_default = 0; @@ -412,6 +417,9 @@ main(int argc, char *argv[]) errx(1, "unknown option: %s", argv[i]); } + if (strlen(domain_name) > YPMAXDOMAIN) + warnx("truncating domain name %s", domain_name); + /* blow away everything in BINDINGDIR (if it exists) */ if ((dird = opendir(BINDINGDIR)) != NULL) { @@ -448,11 +456,11 @@ main(int argc, char *argv[]) errx(1, "unable to register (YPBINDPROG, YPBINDVERS, tcp)"); /* build initial domain binding, make it "unsuccessful" */ - ypbindlist = (struct _dom_binding *)malloc(sizeof *ypbindlist); + ypbindlist = malloc(sizeof *ypbindlist); if (ypbindlist == NULL) errx(1, "malloc"); bzero(ypbindlist, sizeof *ypbindlist); - strncpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); + strlcpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); ypbindlist->dom_vers = YPVERS; ypbindlist->dom_alive = 0; ypbindlist->dom_lockfd = -1; @@ -883,13 +891,17 @@ rpc_received(char *dom, struct sockaddr_ if (ypdb == NULL) { if (force == 0) return; - ypdb = (struct _dom_binding *)malloc(sizeof *ypdb); + if (strlen(dom) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", dom); + return; + } + ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); return; } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); ypdb->dom_lockfd = -1; ypdb->dom_default = 0; ypdb->dom_pnext = ypbindlist; From owner-svn-src-all@freebsd.org Fri May 20 06:24:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB818B41C5A; Fri, 20 May 2016 06:24:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7191797; Fri, 20 May 2016 06:24:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6OGAa081582; Fri, 20 May 2016 06:24:16 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6OGQN081581; Fri, 20 May 2016 06:24:16 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200624.u4K6OGQN081581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300269 - stable/10/usr.bin/catman X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:24:17 -0000 Author: truckman Date: Fri May 20 06:24:16 2016 New Revision: 300269 URL: https://svnweb.freebsd.org/changeset/base/300269 Log: MFC r299577, r299578, r299589 r299577 | truckman | 2016-05-12 16:14:31 -0700 (Thu, 12 May 2016) | 15 lines Avoid Coverity NUL termination warning about strncpy() by using memcpy() instead. It's probably a bit more optimal in this case anyway. [1] The program logic leading up to the creation of the strncpy/memcpy destination buffer is a bit hairy. Add a call to assert() to make it clear what is happening here and detect any potential buffer overruns in the future. Check a couple syscall error returns. Ignore the EEXIST error from link() to preserve existing behavior. [2] [3] r299578 | truckman | 2016-05-12 16:37:58 -0700 (Thu, 12 May 2016) | 2 lines If fchdir() fails, call err() instead of warn(). r299589 | truckman | 2016-05-12 22:49:02 -0700 (Thu, 12 May 2016) | 4 lines Instead of ignoring the EEXIST from link(), unconditionally unlink the terget before calling link(). This should prevent links to an old copy of the file from being retained. Reported by: Coverity CID: 1009659 [1], 1009349 [2], 1009350 [3] Modified: stable/10/usr.bin/catman/catman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/catman/catman.c ============================================================================== --- stable/10/usr.bin/catman/catman.c Fri May 20 06:19:00 2016 (r300268) +++ stable/10/usr.bin/catman/catman.c Fri May 20 06:24:16 2016 (r300269) @@ -34,9 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include #include @@ -267,7 +269,8 @@ get_cat_section(char *section) char *cat_section; cat_section = strdup(section); - strncpy(cat_section, "cat", 3); + assert(strlen(section) > 3 && strncmp(section, "man", 3) == 0); + memcpy(cat_section, "cat", 3); return cat_section; } @@ -419,8 +422,11 @@ process_page(char *mandir, char *src, ch fprintf(stderr, "%slink %s -> %s\n", verbose ? "\t" : "", cat, link_name); } - if (!pretend) - link(link_name, cat); + if (!pretend) { + (void) unlink(cat); + if (link(link_name, cat) < 0) + warn("%s %s: link", link_name, cat); + } return; } insert_hashtable(links, src_ino, src_dev, strdup(cat)); @@ -608,7 +614,8 @@ select_sections(const struct dirent *ent static void process_mandir(char *dir_name, char *section) { - fchdir(starting_dir); + if (fchdir(starting_dir) < 0) + err(1, "fchdir"); if (already_visited(NULL, dir_name, section == NULL)) return; check_writable(dir_name); From owner-svn-src-all@freebsd.org Fri May 20 06:28:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08BFBB41D7C; Fri, 20 May 2016 06:28:00 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDB381A1F; Fri, 20 May 2016 06:27:59 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6Rx7C081783; Fri, 20 May 2016 06:27:59 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6Rxkh081782; Fri, 20 May 2016 06:27:59 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200627.u4K6Rxkh081782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300270 - stable/10/usr.sbin/edquota X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:28:00 -0000 Author: truckman Date: Fri May 20 06:27:58 2016 New Revision: 300270 URL: https://svnweb.freebsd.org/changeset/base/300270 Log: MFC r299579 Use strlcpy() instead of strncpy() to ensure that qup->fsname is NUL terminated. Don't bother checking for truncation since the subsequent quota_read() should detect that and fail. Reported by: Coverity CID: 1009980 Modified: stable/10/usr.sbin/edquota/edquota.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/edquota/edquota.c ============================================================================== --- stable/10/usr.sbin/edquota/edquota.c Fri May 20 06:24:16 2016 (r300269) +++ stable/10/usr.sbin/edquota/edquota.c Fri May 20 06:27:58 2016 (r300270) @@ -390,7 +390,7 @@ getprivs(long id, int quotatype, char *f if ((qup = (struct quotause *)calloc(1, sizeof(*qup))) == NULL) errx(2, "out of memory"); qup->qf = qf; - strncpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); + strlcpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); if (quota_read(qf, &qup->dqblk, id) == -1) { warn("cannot read quotas on %s", fs->fs_file); freeprivs(qup); From owner-svn-src-all@freebsd.org Fri May 20 06:33:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6367CB381DA; Fri, 20 May 2016 06:33:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 304C810A5; Fri, 20 May 2016 06:33:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6X23t084711; Fri, 20 May 2016 06:33:02 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6X2bG084710; Fri, 20 May 2016 06:33:02 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200633.u4K6X2bG084710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300271 - stable/10/usr.sbin/timed/timed X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:33:03 -0000 Author: truckman Date: Fri May 20 06:33:02 2016 New Revision: 300271 URL: https://svnweb.freebsd.org/changeset/base/300271 Log: MFC r299580 Use strlcpy() instead of strncpy() to ensure that ret->name is NUL terminated. The source and destination buffers are the same size and the source *should* be NUL terminated, but be paranoid. Reported by: Coverity CID: 1011274 Modified: stable/10/usr.sbin/timed/timed/master.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/timed/timed/master.c ============================================================================== --- stable/10/usr.sbin/timed/timed/master.c Fri May 20 06:27:58 2016 (r300270) +++ stable/10/usr.sbin/timed/timed/master.c Fri May 20 06:33:02 2016 (r300271) @@ -623,7 +623,7 @@ addmach(char *name, struct sockaddr_in * } ret->addr = *addr; ret->ntp = ntp; - (void)strncpy(ret->name, name, sizeof(ret->name)); + (void)strlcpy(ret->name, name, sizeof(ret->name)); ret->good = good_host_name(name); ret->l_fwd = &self; ret->l_bak = self.l_bak; From owner-svn-src-all@freebsd.org Fri May 20 06:35:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA11B3829D; Fri, 20 May 2016 06:35:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B688122D; Fri, 20 May 2016 06:35:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6ZEvx084844; Fri, 20 May 2016 06:35:14 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6ZEs3084843; Fri, 20 May 2016 06:35:14 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200635.u4K6ZEs3084843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300272 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:35:15 -0000 Author: truckman Date: Fri May 20 06:35:14 2016 New Revision: 300272 URL: https://svnweb.freebsd.org/changeset/base/300272 Log: MFC r299581 Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL terminated. Don't bother checking for truncation since the subsequent stat() call should detect that and fail. Reported by: Coverity CID: 1018189 Modified: stable/10/lib/libutil/quotafile.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/quotafile.c ============================================================================== --- stable/10/lib/libutil/quotafile.c Fri May 20 06:33:02 2016 (r300271) +++ stable/10/lib/libutil/quotafile.c Fri May 20 06:35:14 2016 (r300272) @@ -124,7 +124,7 @@ quota_open(struct fstab *fs, int quotaty return (NULL); qf->fd = -1; qf->quotatype = quotatype; - strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); + strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); if (stat(qf->fsname, &st) != 0) goto error; qf->dev = st.st_dev; From owner-svn-src-all@freebsd.org Fri May 20 06:38:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE083B38454; Fri, 20 May 2016 06:38:47 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8D614BB; Fri, 20 May 2016 06:38:47 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6ckcK085004; Fri, 20 May 2016 06:38:46 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6ckT7085003; Fri, 20 May 2016 06:38:46 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200638.u4K6ckT7085003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300273 - stable/10/libexec/ftpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:38:47 -0000 Author: truckman Date: Fri May 20 06:38:46 2016 New Revision: 300273 URL: https://svnweb.freebsd.org/changeset/base/300273 Log: MFC r299585 Declare line[] in the outermost scope of retrieve() instead of declaring it in an inner scope and then using it via a pointer in the outer scope. Reported by: Coverity CID: 605895 Modified: stable/10/libexec/ftpd/ftpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/ftpd/ftpd.c ============================================================================== --- stable/10/libexec/ftpd/ftpd.c Fri May 20 06:35:14 2016 (r300272) +++ stable/10/libexec/ftpd/ftpd.c Fri May 20 06:38:46 2016 (r300273) @@ -1671,14 +1671,14 @@ retrieve(char *cmd, char *name) struct stat st; int (*closefunc)(FILE *); time_t start; + char line[BUFSIZ]; if (cmd == 0) { fin = fopen(name, "r"), closefunc = fclose; st.st_size = 0; } else { - char line[BUFSIZ]; - - (void) snprintf(line, sizeof(line), cmd, name), name = line; + (void) snprintf(line, sizeof(line), cmd, name); + name = line; fin = ftpd_popen(line, "r"), closefunc = ftpd_pclose; st.st_size = -1; st.st_blksize = BUFSIZ; From owner-svn-src-all@freebsd.org Fri May 20 06:41:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33DF2B384EA; Fri, 20 May 2016 06:41:28 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDAFA18EF; Fri, 20 May 2016 06:41:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6fRBI087756; Fri, 20 May 2016 06:41:27 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6fRbu087755; Fri, 20 May 2016 06:41:27 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200641.u4K6fRbu087755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300274 - stable/10/usr.bin/mail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:41:28 -0000 Author: truckman Date: Fri May 20 06:41:26 2016 New Revision: 300274 URL: https://svnweb.freebsd.org/changeset/base/300274 Log: MFC r299591 Always return either a dynamically allocated string or NULL from expand(). Never return the name parameter, which could be a the buf[] buffer which is allocated on the stack by getdeadletter() and which would then be used after getdeadletter() has returned. Reported by: Coverity CID: 1199383 Modified: stable/10/usr.bin/mail/fio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mail/fio.c ============================================================================== --- stable/10/usr.bin/mail/fio.c Fri May 20 06:38:46 2016 (r300273) +++ stable/10/usr.bin/mail/fio.c Fri May 20 06:41:26 2016 (r300274) @@ -367,10 +367,10 @@ expand(char *name) name = savestr(xname); } if (!strpbrk(name, "~{[*?$`'\"\\")) - return (name); + return (savestr(name)); if (pipe(pivec) < 0) { warn("pipe"); - return (name); + return (NULL); } (void)snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name); if ((sh = value("SHELL")) == NULL) From owner-svn-src-all@freebsd.org Fri May 20 06:43:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62D0EB38670; Fri, 20 May 2016 06:43:56 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FF641B84; Fri, 20 May 2016 06:43:56 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6htUD087888; Fri, 20 May 2016 06:43:55 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6htf2087887; Fri, 20 May 2016 06:43:55 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200643.u4K6htf2087887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300275 - stable/10/usr.sbin/mptutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:43:56 -0000 Author: truckman Date: Fri May 20 06:43:55 2016 New Revision: 300275 URL: https://svnweb.freebsd.org/changeset/base/300275 Log: MFC r299592 Move a call to cam_freeccb() to avoid a use after free error and a later double free. Reported by: Coverity CID: 1018507 Modified: stable/10/usr.sbin/mptutil/mpt_cam.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- stable/10/usr.sbin/mptutil/mpt_cam.c Fri May 20 06:41:26 2016 (r300274) +++ stable/10/usr.sbin/mptutil/mpt_cam.c Fri May 20 06:43:55 2016 (r300275) @@ -260,7 +260,6 @@ fetch_scsi_capacity(struct cam_device *d cam_freeccb(ccb); return (EIO); } - cam_freeccb(ccb); /* * A last block of 2^32-1 means that the true capacity is over 2TB, @@ -269,6 +268,7 @@ fetch_scsi_capacity(struct cam_device *d */ if (scsi_4btoul(rcap.addr) != 0xffffffff) { disk->maxlba = scsi_4btoul(rcap.addr); + cam_freeccb(ccb); return (0); } From owner-svn-src-all@freebsd.org Fri May 20 06:47:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32626B387A6; Fri, 20 May 2016 06:47:43 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03F831DC6; Fri, 20 May 2016 06:47:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6lgC3088104; Fri, 20 May 2016 06:47:42 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6lgee088103; Fri, 20 May 2016 06:47:42 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200647.u4K6lgee088103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300276 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:47:43 -0000 Author: truckman Date: Fri May 20 06:47:42 2016 New Revision: 300276 URL: https://svnweb.freebsd.org/changeset/base/300276 Log: MFC r299593 Properly compute the size argument to pass to malloc(). Reported by: Coverity CID: 1198856 Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 20 06:43:55 2016 (r300275) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 20 06:47:42 2016 (r300276) @@ -798,7 +798,7 @@ parse_server(char *opt_arg) return (-1); if (snmp_client.trans > SNMP_TRANS_UDP && snmp_client.chost == NULL) { - if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL + 1))) + if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL) + 1)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); From owner-svn-src-all@freebsd.org Fri May 20 06:55:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02755B38955; Fri, 20 May 2016 06:55:00 +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 D024011B7; Fri, 20 May 2016 06:54:59 +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 u4K6sx1R090994; Fri, 20 May 2016 06:54:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6swd0090981; Fri, 20 May 2016 06:54:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605200654.u4K6swd0090981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 May 2016 06:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300277 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:55:00 -0000 Author: hselasky Date: Fri May 20 06:54:58 2016 New Revision: 300277 URL: https://svnweb.freebsd.org/changeset/base/300277 Log: Implement TX completion event interleaving. This patch implements a sysctl which allows setting a factor, N, for how many work queue elements can be generated before requiring a completion event. When a completion event happens the code simulates N completion events instead of only one. When draining a transmit queue, N-1 NOPs are transmitted at most, to force generation of the final completion event. Further a timer is running every HZ ticks to flush any remaining data off the transmit queue when the tx_completion_fact > 1. The goal of this feature is to reduce the PCI bandwidth needed when transmitting data. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri May 20 06:47:42 2016 (r300276) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri May 20 06:54:58 2016 (r300277) @@ -391,6 +391,8 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ + m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") @@ -496,6 +498,13 @@ struct mlx5e_sq { /* dirtied @xmit */ u16 pc __aligned(MLX5E_CACHELINE_SIZE); u16 bf_offset; + u16 cev_counter; /* completion event counter */ + u16 cev_factor; /* completion event factor */ + u32 cev_next_state; /* next completion event state */ +#define MLX5E_CEV_STATE_INITIAL 0 /* timer not started */ +#define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ +#define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + struct callout cev_callout; struct mlx5e_sq_stats stats; struct mlx5e_cq cq; @@ -787,6 +796,7 @@ void mlx5e_create_stats(struct sysctl_ct struct sysctl_oid_list *, const char *, const char **, unsigned, u64 *); void mlx5e_send_nop(struct mlx5e_sq *, u32, bool); +void mlx5e_sq_cev_timeout(void *); int mlx5e_refresh_channel_params(struct mlx5e_priv *); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri May 20 06:47:42 2016 (r300276) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri May 20 06:54:58 2016 (r300277) @@ -48,6 +48,42 @@ mlx5e_create_stats(struct sysctl_ctx_lis } } +static void +mlx5e_ethtool_sync_tx_completion_fact(struct mlx5e_priv *priv) +{ + /* + * Limit the maximum distance between completion events to + * half of the currently set TX queue size. + * + * The maximum number of queue entries a single IP packet can + * consume is given by MLX5_SEND_WQE_MAX_WQEBBS. + * + * The worst case max value is then given as below: + */ + uint64_t max = priv->params_ethtool.tx_queue_size / + (2 * MLX5_SEND_WQE_MAX_WQEBBS); + + /* + * Update the maximum completion factor value in case the + * tx_queue_size field changed. Ensure we don't overflow + * 16-bits. + */ + if (max < 1) + max = 1; + else if (max > 65535) + max = 65535; + priv->params_ethtool.tx_completion_fact_max = max; + + /* + * Verify that the current TX completion factor is within the + * given limits: + */ + if (priv->params_ethtool.tx_completion_fact < 1) + priv->params_ethtool.tx_completion_fact = 1; + else if (priv->params_ethtool.tx_completion_fact > max) + priv->params_ethtool.tx_completion_fact = max; +} + static int mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) { @@ -206,6 +242,14 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.cqe_zipping = 0; } } + + if (&priv->params_ethtool.arg[arg2] == + &priv->params_ethtool.tx_completion_fact || + &priv->params_ethtool.arg[arg2] == + &priv->params_ethtool.tx_queue_size) { + /* verify parameter */ + mlx5e_ethtool_sync_tx_completion_fact(priv); + } if (was_opened) mlx5e_open_locked(priv->ifp); done: @@ -475,6 +519,7 @@ mlx5e_create_ethtool(struct mlx5e_priv * priv->params_ethtool.tx_coalesce_pkts = priv->params.tx_cq_moderation_pkts; priv->params_ethtool.hw_lro = priv->params.hw_lro_en; priv->params_ethtool.cqe_zipping = priv->params.cqe_zipping_en; + mlx5e_ethtool_sync_tx_completion_fact(priv); /* create root node */ node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri May 20 06:47:42 2016 (r300276) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri May 20 06:54:58 2016 (r300277) @@ -1185,24 +1185,82 @@ err_destroy_sq: } static void -mlx5e_close_sq(struct mlx5e_sq *sq) +mlx5e_sq_send_nops_locked(struct mlx5e_sq *sq, int can_sleep) { - - /* ensure hw is notified of all pending wqes */ - if (mlx5e_sq_has_room_for(sq, 1)) + /* fill up remainder with NOPs */ + while (sq->cev_counter != 0) { + while (!mlx5e_sq_has_room_for(sq, 1)) { + if (can_sleep != 0) { + mtx_unlock(&sq->lock); + msleep(4); + mtx_lock(&sq->lock); + } else { + goto done; + } + } mlx5e_send_nop(sq, 1, true); + } +done: + return; +} - mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); +void +mlx5e_sq_cev_timeout(void *arg) +{ + struct mlx5e_sq *sq = arg; + + mtx_assert(&sq->lock, MA_OWNED); + + /* check next state */ + switch (sq->cev_next_state) { + case MLX5E_CEV_STATE_SEND_NOPS: + /* fill TX ring with NOPs, if any */ + mlx5e_sq_send_nops_locked(sq, 0); + + /* check if completed */ + if (sq->cev_counter == 0) { + sq->cev_next_state = MLX5E_CEV_STATE_INITIAL; + return; + } + break; + default: + /* send NOPs on next timeout */ + sq->cev_next_state = MLX5E_CEV_STATE_SEND_NOPS; + break; + } + + /* restart timer */ + callout_reset_curcpu(&sq->cev_callout, hz, mlx5e_sq_cev_timeout, sq); } static void mlx5e_close_sq_wait(struct mlx5e_sq *sq) { + + mtx_lock(&sq->lock); + /* teardown event factor timer, if any */ + sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; + callout_stop(&sq->cev_callout); + + /* send dummy NOPs in order to flush the transmit ring */ + mlx5e_sq_send_nops_locked(sq, 1); + mtx_unlock(&sq->lock); + + /* make sure it is safe to free the callout */ + callout_drain(&sq->cev_callout); + + /* error out remaining requests */ + mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + /* wait till SQ is empty */ + mtx_lock(&sq->lock); while (sq->cc != sq->pc) { + mtx_unlock(&sq->lock); msleep(4); sq->cq.mcq.comp(&sq->cq.mcq); + mtx_lock(&sq->lock); } + mtx_unlock(&sq->lock); mlx5e_disable_sq(sq); mlx5e_destroy_sq(sq); @@ -1412,24 +1470,13 @@ mlx5e_open_sqs(struct mlx5e_channel *c, return (0); err_close_sqs: - for (tc--; tc >= 0; tc--) { - mlx5e_close_sq(&c->sq[tc]); + for (tc--; tc >= 0; tc--) mlx5e_close_sq_wait(&c->sq[tc]); - } return (err); } static void -mlx5e_close_sqs(struct mlx5e_channel *c) -{ - int tc; - - for (tc = 0; tc < c->num_tc; tc++) - mlx5e_close_sq(&c->sq[tc]); -} - -static void mlx5e_close_sqs_wait(struct mlx5e_channel *c) { int tc; @@ -1446,9 +1493,19 @@ mlx5e_chan_mtx_init(struct mlx5e_channel mtx_init(&c->rq.mtx, "mlx5rx", MTX_NETWORK_LOCK, MTX_DEF); for (tc = 0; tc < c->num_tc; tc++) { - mtx_init(&c->sq[tc].lock, "mlx5tx", MTX_NETWORK_LOCK, MTX_DEF); - mtx_init(&c->sq[tc].comp_lock, "mlx5comp", MTX_NETWORK_LOCK, + struct mlx5e_sq *sq = c->sq + tc; + + mtx_init(&sq->lock, "mlx5tx", MTX_NETWORK_LOCK, MTX_DEF); + mtx_init(&sq->comp_lock, "mlx5comp", MTX_NETWORK_LOCK, MTX_DEF); + + callout_init_mtx(&sq->cev_callout, &sq->lock, 0); + + sq->cev_factor = c->priv->params_ethtool.tx_completion_fact; + + /* ensure the TX completion event factor is not zero */ + if (sq->cev_factor == 0) + sq->cev_factor = 1; } } @@ -1529,7 +1586,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr return (0); err_close_sqs: - mlx5e_close_sqs(c); mlx5e_close_sqs_wait(c); err_close_rx_cq: @@ -1554,7 +1610,6 @@ mlx5e_close_channel(struct mlx5e_channel if (c == NULL) return; mlx5e_close_rq(&c->rq); - mlx5e_close_sqs(c); } static void Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri May 20 06:47:42 2016 (r300276) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri May 20 06:54:58 2016 (r300277) @@ -28,6 +28,18 @@ #include "en.h" #include +static inline bool +mlx5e_do_send_cqe(struct mlx5e_sq *sq) +{ + sq->cev_counter++; + /* interleave the CQEs */ + if (sq->cev_counter >= sq->cev_factor) { + sq->cev_counter = 0; + return (1); + } + return (0); +} + void mlx5e_send_nop(struct mlx5e_sq *sq, u32 ds_cnt, bool notify_hw) { @@ -38,7 +50,10 @@ mlx5e_send_nop(struct mlx5e_sq *sq, u32 wqe->ctrl.opmod_idx_opcode = cpu_to_be32((sq->pc << 8) | MLX5_OPCODE_NOP); wqe->ctrl.qpn_ds = cpu_to_be32((sq->sqn << 8) | ds_cnt); - wqe->ctrl.fm_ce_se = MLX5_WQE_CTRL_CQ_UPDATE; + if (mlx5e_do_send_cqe(sq)) + wqe->ctrl.fm_ce_se = MLX5_WQE_CTRL_CQ_UPDATE; + else + wqe->ctrl.fm_ce_se = 0; sq->mbuf[pi].mbuf = NULL; sq->mbuf[pi].num_bytes = 0; @@ -340,7 +355,10 @@ skip_dma: wqe->ctrl.opmod_idx_opcode = cpu_to_be32((sq->pc << 8) | opcode); wqe->ctrl.qpn_ds = cpu_to_be32((sq->sqn << 8) | ds_cnt); - wqe->ctrl.fm_ce_se = MLX5_WQE_CTRL_CQ_UPDATE; + if (mlx5e_do_send_cqe(sq)) + wqe->ctrl.fm_ce_se = MLX5_WQE_CTRL_CQ_UPDATE; + else + wqe->ctrl.fm_ce_se = 0; /* Store pointer to mbuf */ sq->mbuf[pi].mbuf = mb; @@ -374,9 +392,10 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, in */ sqcc = sq->cc; - while (budget--) { + while (budget > 0) { struct mlx5_cqe64 *cqe; struct mbuf *mb; + u16 x; u16 ci; cqe = mlx5e_get_cqe(&sq->cq); @@ -385,24 +404,29 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, in mlx5_cqwq_pop(&sq->cq.wq); - ci = sqcc & sq->wq.sz_m1; - mb = sq->mbuf[ci].mbuf; - sq->mbuf[ci].mbuf = NULL; /* Safety clear */ + /* update budget according to the event factor */ + budget -= sq->cev_factor; - if (mb == NULL) { - if (sq->mbuf[ci].num_bytes == 0) { - /* NOP */ - sq->stats.nop++; - } - } else { - bus_dmamap_sync(sq->dma_tag, sq->mbuf[ci].dma_map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sq->dma_tag, sq->mbuf[ci].dma_map); + for (x = 0; x != sq->cev_factor; x++) { + ci = sqcc & sq->wq.sz_m1; + mb = sq->mbuf[ci].mbuf; + sq->mbuf[ci].mbuf = NULL; /* Safety clear */ + + if (mb == NULL) { + if (sq->mbuf[ci].num_bytes == 0) { + /* NOP */ + sq->stats.nop++; + } + } else { + bus_dmamap_sync(sq->dma_tag, sq->mbuf[ci].dma_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sq->dma_tag, sq->mbuf[ci].dma_map); - /* Free transmitted mbuf */ - m_freem(mb); + /* Free transmitted mbuf */ + m_freem(mb); + } + sqcc += sq->mbuf[ci].num_wqebbs; } - sqcc += sq->mbuf[ci].num_wqebbs; } mlx5_cqwq_update_db_record(&sq->cq.wq); @@ -450,6 +474,18 @@ mlx5e_xmit_locked(struct ifnet *ifp, str if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; } + /* + * Check if we need to start the event timer which flushes the + * transmit ring on timeout: + */ + if (unlikely(sq->cev_next_state == MLX5E_CEV_STATE_INITIAL && + sq->cev_factor != 1)) { + /* start the timer */ + mlx5e_sq_cev_timeout(sq); + } else { + /* don't send NOPs yet */ + sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; + } return (err); } From owner-svn-src-all@freebsd.org Fri May 20 06:55:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD55B38959; Fri, 20 May 2016 06:55:00 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BAB011B8; Fri, 20 May 2016 06:55:00 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6sx7m091027; Fri, 20 May 2016 06:54:59 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6sx6N091026; Fri, 20 May 2016 06:54:59 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200654.u4K6sx6N091026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300278 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:55:00 -0000 Author: truckman Date: Fri May 20 06:54:59 2016 New Revision: 300278 URL: https://svnweb.freebsd.org/changeset/base/300278 Log: MFC r299865 When handling SIOCSIFNAME ensure that the new interface name is NUL terminated. Reject the rename attempt if the name is too long. Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Fri May 20 06:54:58 2016 (r300277) +++ stable/10/sys/net/if.c Fri May 20 06:54:59 2016 (r300278) @@ -2434,6 +2434,11 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); if (new_name[0] == '\0') return (EINVAL); + if (new_name[IFNAMSIZ-1] != '\0') { + new_name[IFNAMSIZ-1] = '\0'; + if (strlen(new_name) == IFNAMSIZ-1) + return (EINVAL); + } if (ifunit(new_name) != NULL) return (EEXIST); From owner-svn-src-all@freebsd.org Fri May 20 06:56:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C957CB38ACE; Fri, 20 May 2016 06:56:44 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7F5165F; Fri, 20 May 2016 06:56:44 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6uhFb091159; Fri, 20 May 2016 06:56:43 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6uhZs091158; Fri, 20 May 2016 06:56:43 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200656.u4K6uhZs091158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300279 - stable/10/usr.sbin/lmcconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:56:44 -0000 Author: truckman Date: Fri May 20 06:56:43 2016 New Revision: 300279 URL: https://svnweb.freebsd.org/changeset/base/300279 Log: MFC 299866 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 974852 Modified: stable/10/usr.sbin/lmcconfig/lmcconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- stable/10/usr.sbin/lmcconfig/lmcconfig.c Fri May 20 06:54:59 2016 (r300278) +++ stable/10/usr.sbin/lmcconfig/lmcconfig.c Fri May 20 06:56:43 2016 (r300279) @@ -222,7 +222,7 @@ call_driver(unsigned long cmd, struct io { int error = 0; - strncpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); + strlcpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); iohdr->cookie = NGM_LMC_COOKIE; iohdr->iohdr = iohdr; From owner-svn-src-all@freebsd.org Fri May 20 06:59:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A62B38D69; Fri, 20 May 2016 06:59:40 +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 E9EFD19B9; Fri, 20 May 2016 06:59:39 +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 u4K6xd7E091318; Fri, 20 May 2016 06:59:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6xcq9091315; Fri, 20 May 2016 06:59:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605200659.u4K6xcq9091315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 May 2016 06:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300280 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:59:40 -0000 Author: hselasky Date: Fri May 20 06:59:38 2016 New Revision: 300280 URL: https://svnweb.freebsd.org/changeset/base/300280 Log: Optimise use of doorbell and remove redundant NOPs Store the last doorbell write in the mlx5e_sq structure and write the doorbell to the hardware when the transmit routine finishes transmitting all queued mbufs. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri May 20 06:56:43 2016 (r300279) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri May 20 06:59:38 2016 (r300280) @@ -505,6 +505,10 @@ struct mlx5e_sq { #define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ #define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ struct callout cev_callout; + union { + u32 d32[2]; + u64 d64; + } doorbell; struct mlx5e_sq_stats stats; struct mlx5e_cq cq; @@ -752,8 +756,7 @@ int mlx5e_add_all_vlan_rules(struct mlx5 void mlx5e_del_all_vlan_rules(struct mlx5e_priv *priv); static inline void -mlx5e_tx_notify_hw(struct mlx5e_sq *sq, - struct mlx5e_tx_wqe *wqe, int bf_sz) +mlx5e_tx_notify_hw(struct mlx5e_sq *sq, u32 *wqe, int bf_sz) { u16 ofst = MLX5_BF_OFFSET + sq->bf_offset; @@ -769,13 +772,13 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, wmb(); if (bf_sz) { - __iowrite64_copy(sq->uar_bf_map + ofst, &wqe->ctrl, bf_sz); + __iowrite64_copy(sq->uar_bf_map + ofst, wqe, bf_sz); /* flush the write-combining mapped buffer */ wmb(); } else { - mlx5_write64((__be32 *)&wqe->ctrl, sq->uar_map + ofst, NULL); + mlx5_write64(wqe, sq->uar_map + ofst, NULL); } sq->bf_offset ^= sq->bf_buf_size; @@ -795,7 +798,7 @@ void mlx5e_create_ethtool(struct mlx5e_p void mlx5e_create_stats(struct sysctl_ctx_list *, struct sysctl_oid_list *, const char *, const char **, unsigned, u64 *); -void mlx5e_send_nop(struct mlx5e_sq *, u32, bool); +void mlx5e_send_nop(struct mlx5e_sq *, u32); void mlx5e_sq_cev_timeout(void *); int mlx5e_refresh_channel_params(struct mlx5e_priv *); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri May 20 06:56:43 2016 (r300279) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri May 20 06:59:38 2016 (r300280) @@ -850,7 +850,6 @@ mlx5e_open_rq(struct mlx5e_channel *c, struct mlx5e_rq *rq) { int err; - int i; err = mlx5e_create_rq(c, param, rq); if (err) @@ -866,12 +865,6 @@ mlx5e_open_rq(struct mlx5e_channel *c, c->rq.enabled = 1; - /* - * Test send queues, which will trigger - * "mlx5e_post_rx_wqes()": - */ - for (i = 0; i != c->num_tc; i++) - mlx5e_send_nop(&c->sq[i], 1, true); return (0); err_disable_rq: @@ -1198,9 +1191,16 @@ mlx5e_sq_send_nops_locked(struct mlx5e_s goto done; } } - mlx5e_send_nop(sq, 1, true); + /* send a single NOP */ + mlx5e_send_nop(sq, 1); + wmb(); } done: + /* Check if we need to write the doorbell */ + if (likely(sq->doorbell.d64 != 0)) { + mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); + sq->doorbell.d64 = 0; + } return; } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri May 20 06:56:43 2016 (r300279) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri May 20 06:59:38 2016 (r300280) @@ -41,7 +41,7 @@ mlx5e_do_send_cqe(struct mlx5e_sq *sq) } void -mlx5e_send_nop(struct mlx5e_sq *sq, u32 ds_cnt, bool notify_hw) +mlx5e_send_nop(struct mlx5e_sq *sq, u32 ds_cnt) { u16 pi = sq->pc & sq->wq.sz_m1; struct mlx5e_tx_wqe *wqe = mlx5_wq_cyc_get_wqe(&sq->wq, pi); @@ -55,12 +55,13 @@ mlx5e_send_nop(struct mlx5e_sq *sq, u32 else wqe->ctrl.fm_ce_se = 0; + /* Copy data for doorbell */ + memcpy(sq->doorbell.d32, &wqe->ctrl, sizeof(sq->doorbell.d32)); + sq->mbuf[pi].mbuf = NULL; sq->mbuf[pi].num_bytes = 0; sq->mbuf[pi].num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS); sq->pc += sq->mbuf[pi].num_wqebbs; - if (notify_hw) - mlx5e_tx_notify_hw(sq, wqe, 0); } #if (__FreeBSD_version >= 1100000) @@ -221,7 +222,7 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc pi = ((~sq->pc) & sq->wq.sz_m1); if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) { /* Send one multi NOP message instead of many */ - mlx5e_send_nop(sq, (pi + 1) * MLX5_SEND_WQEBB_NUM_DS, false); + mlx5e_send_nop(sq, (pi + 1) * MLX5_SEND_WQEBB_NUM_DS); pi = ((~sq->pc) & sq->wq.sz_m1); if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) { m_freem(mb); @@ -360,6 +361,9 @@ skip_dma: else wqe->ctrl.fm_ce_se = 0; + /* Copy data for doorbell */ + memcpy(sq->doorbell.d32, &wqe->ctrl, sizeof(sq->doorbell.d32)); + /* Store pointer to mbuf */ sq->mbuf[pi].mbuf = mb; sq->mbuf[pi].num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS); @@ -369,8 +373,6 @@ skip_dma: if (mb != NULL) bus_dmamap_sync(sq->dma_tag, sq->mbuf[pi].dma_map, BUS_DMASYNC_PREWRITE); - mlx5e_tx_notify_hw(sq, wqe, 0); - sq->stats.packets++; return (0); @@ -474,6 +476,11 @@ mlx5e_xmit_locked(struct ifnet *ifp, str if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; } + /* Check if we need to write the doorbell */ + if (likely(sq->doorbell.d64 != 0)) { + mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); + sq->doorbell.d64 = 0; + } /* * Check if we need to start the event timer which flushes the * transmit ring on timeout: From owner-svn-src-all@freebsd.org Fri May 20 07:00:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0989AB38E14; Fri, 20 May 2016 07:00:13 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B54AF1BA4; Fri, 20 May 2016 07:00:12 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K70BYT091416; Fri, 20 May 2016 07:00:11 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K70BGZ091414; Fri, 20 May 2016 07:00:11 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200700.u4K70BGZ091414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300281 - stable/10/usr.sbin/rtadvd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 07:00:13 -0000 Author: truckman Date: Fri May 20 07:00:11 2016 New Revision: 300281 URL: https://svnweb.freebsd.org/changeset/base/300281 Log: MFC r299867 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 974860, 1009972, 1009973 Modified: stable/10/usr.sbin/rtadvd/config.c stable/10/usr.sbin/rtadvd/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/config.c ============================================================================== --- stable/10/usr.sbin/rtadvd/config.c Fri May 20 06:59:38 2016 (r300280) +++ stable/10/usr.sbin/rtadvd/config.c Fri May 20 07:00:11 2016 (r300281) @@ -634,7 +634,7 @@ getconfig_free_pfx: exit(1); } memset(&ndi, 0, sizeof(ndi)); - strncpy(ndi.ifname, ifi->ifi_ifname, sizeof(ndi.ifname)); + strlcpy(ndi.ifname, ifi->ifi_ifname, sizeof(ndi.ifname)); if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0) syslog(LOG_INFO, "<%s> ioctl:SIOCGIFINFO_IN6 at %s: %s", __func__, ifi->ifi_ifname, strerror(errno)); Modified: stable/10/usr.sbin/rtadvd/if.c ============================================================================== --- stable/10/usr.sbin/rtadvd/if.c Fri May 20 06:59:38 2016 (r300280) +++ stable/10/usr.sbin/rtadvd/if.c Fri May 20 07:00:11 2016 (r300281) @@ -388,7 +388,7 @@ update_ifinfo_nd_flags(struct ifinfo *if } /* ND flags */ memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifi->ifi_ifname, + strlcpy(nd.ifname, ifi->ifi_ifname, sizeof(nd.ifname)); error = ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd); if (error) { @@ -517,7 +517,7 @@ update_ifinfo(struct ifilist_head_t *ifi if (ifi->ifi_phymtu == 0) { memset(&ifr, 0, sizeof(ifr)); ifr.ifr_addr.sa_family = AF_INET6; - strncpy(ifr.ifr_name, ifi->ifi_ifname, + strlcpy(ifr.ifr_name, ifi->ifi_ifname, sizeof(ifr.ifr_name)); error = ioctl(s, SIOCGIFMTU, (caddr_t)&ifr); if (error) { From owner-svn-src-all@freebsd.org Fri May 20 07:07:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28CB4B4211E; Fri, 20 May 2016 07:07:29 +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 EB0FB109D; Fri, 20 May 2016 07:07:28 +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 u4K77SvG094290; Fri, 20 May 2016 07:07:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K77SC1094289; Fri, 20 May 2016 07:07:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605200707.u4K77SC1094289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 May 2016 07:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300282 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 07:07:29 -0000 Author: hselasky Date: Fri May 20 07:07:27 2016 New Revision: 300282 URL: https://svnweb.freebsd.org/changeset/base/300282 Log: Verify one sysctl parameter at a time. When a mlx5en sysctl parameter is updated only verify the changed one instead of all. No functional change. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri May 20 07:00:11 2016 (r300281) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri May 20 07:07:27 2016 (r300282) @@ -84,6 +84,9 @@ mlx5e_ethtool_sync_tx_completion_fact(st priv->params_ethtool.tx_completion_fact = max; } +#define MLX5_PARAM_OFFSET(n) \ + __offsetof(struct mlx5e_priv, params_ethtool.n) + static int mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) { @@ -110,129 +113,222 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG error = ENXIO; goto done; } - /* import RX coal time */ - if (priv->params_ethtool.rx_coalesce_usecs < 1) - priv->params_ethtool.rx_coalesce_usecs = 0; - else if (priv->params_ethtool.rx_coalesce_usecs > - MLX5E_FLD_MAX(cqc, cq_period)) { - priv->params_ethtool.rx_coalesce_usecs = - MLX5E_FLD_MAX(cqc, cq_period); - } - priv->params.rx_cq_moderation_usec = priv->params_ethtool.rx_coalesce_usecs; - - /* import RX coal pkts */ - if (priv->params_ethtool.rx_coalesce_pkts < 1) - priv->params_ethtool.rx_coalesce_pkts = 0; - else if (priv->params_ethtool.rx_coalesce_pkts > - MLX5E_FLD_MAX(cqc, cq_max_count)) { - priv->params_ethtool.rx_coalesce_pkts = - MLX5E_FLD_MAX(cqc, cq_max_count); - } - priv->params.rx_cq_moderation_pkts = priv->params_ethtool.rx_coalesce_pkts; - - /* import TX coal time */ - if (priv->params_ethtool.tx_coalesce_usecs < 1) - priv->params_ethtool.tx_coalesce_usecs = 0; - else if (priv->params_ethtool.tx_coalesce_usecs > - MLX5E_FLD_MAX(cqc, cq_period)) { - priv->params_ethtool.tx_coalesce_usecs = - MLX5E_FLD_MAX(cqc, cq_period); - } - priv->params.tx_cq_moderation_usec = priv->params_ethtool.tx_coalesce_usecs; - - /* import TX coal pkts */ - if (priv->params_ethtool.tx_coalesce_pkts < 1) - priv->params_ethtool.tx_coalesce_pkts = 0; - else if (priv->params_ethtool.tx_coalesce_pkts > - MLX5E_FLD_MAX(cqc, cq_max_count)) { - priv->params_ethtool.tx_coalesce_pkts = MLX5E_FLD_MAX(cqc, cq_max_count); - } - priv->params.tx_cq_moderation_pkts = priv->params_ethtool.tx_coalesce_pkts; - was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); - if (was_opened) { - u64 *xarg = priv->params_ethtool.arg + arg2; - if (xarg == &priv->params_ethtool.tx_coalesce_pkts || - xarg == &priv->params_ethtool.rx_coalesce_pkts || - xarg == &priv->params_ethtool.tx_coalesce_usecs || - xarg == &priv->params_ethtool.rx_coalesce_usecs) { - /* avoid downing and upping the network interface */ + switch (MLX5_PARAM_OFFSET(arg[arg2])) { + case MLX5_PARAM_OFFSET(rx_coalesce_usecs): + /* import RX coal time */ + if (priv->params_ethtool.rx_coalesce_usecs < 1) + priv->params_ethtool.rx_coalesce_usecs = 0; + else if (priv->params_ethtool.rx_coalesce_usecs > + MLX5E_FLD_MAX(cqc, cq_period)) { + priv->params_ethtool.rx_coalesce_usecs = + MLX5E_FLD_MAX(cqc, cq_period); + } + priv->params.rx_cq_moderation_usec = + priv->params_ethtool.rx_coalesce_usecs; + + /* check to avoid down and up the network interface */ + if (was_opened) error = mlx5e_refresh_channel_params(priv); - goto done; + break; + + case MLX5_PARAM_OFFSET(rx_coalesce_pkts): + /* import RX coal pkts */ + if (priv->params_ethtool.rx_coalesce_pkts < 1) + priv->params_ethtool.rx_coalesce_pkts = 0; + else if (priv->params_ethtool.rx_coalesce_pkts > + MLX5E_FLD_MAX(cqc, cq_max_count)) { + priv->params_ethtool.rx_coalesce_pkts = + MLX5E_FLD_MAX(cqc, cq_max_count); } - mlx5e_close_locked(priv->ifp); - } - /* import TX queue size */ - if (priv->params_ethtool.tx_queue_size < - (1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)) { - priv->params_ethtool.tx_queue_size = - (1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE); - } else if (priv->params_ethtool.tx_queue_size > - priv->params_ethtool.tx_queue_size_max) { + priv->params.rx_cq_moderation_pkts = + priv->params_ethtool.rx_coalesce_pkts; + + /* check to avoid down and up the network interface */ + if (was_opened) + error = mlx5e_refresh_channel_params(priv); + break; + + case MLX5_PARAM_OFFSET(tx_coalesce_usecs): + /* import TX coal time */ + if (priv->params_ethtool.tx_coalesce_usecs < 1) + priv->params_ethtool.tx_coalesce_usecs = 0; + else if (priv->params_ethtool.tx_coalesce_usecs > + MLX5E_FLD_MAX(cqc, cq_period)) { + priv->params_ethtool.tx_coalesce_usecs = + MLX5E_FLD_MAX(cqc, cq_period); + } + priv->params.tx_cq_moderation_usec = + priv->params_ethtool.tx_coalesce_usecs; + + /* check to avoid down and up the network interface */ + if (was_opened) + error = mlx5e_refresh_channel_params(priv); + break; + + case MLX5_PARAM_OFFSET(tx_coalesce_pkts): + /* import TX coal pkts */ + if (priv->params_ethtool.tx_coalesce_pkts < 1) + priv->params_ethtool.tx_coalesce_pkts = 0; + else if (priv->params_ethtool.tx_coalesce_pkts > + MLX5E_FLD_MAX(cqc, cq_max_count)) { + priv->params_ethtool.tx_coalesce_pkts = + MLX5E_FLD_MAX(cqc, cq_max_count); + } + priv->params.tx_cq_moderation_pkts = + priv->params_ethtool.tx_coalesce_pkts; + + /* check to avoid down and up the network interface */ + if (was_opened) + error = mlx5e_refresh_channel_params(priv); + break; + + case MLX5_PARAM_OFFSET(tx_queue_size): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import TX queue size */ + if (priv->params_ethtool.tx_queue_size < + (1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)) { + priv->params_ethtool.tx_queue_size = + (1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE); + } else if (priv->params_ethtool.tx_queue_size > + priv->params_ethtool.tx_queue_size_max) { + priv->params_ethtool.tx_queue_size = + priv->params_ethtool.tx_queue_size_max; + } + /* store actual TX queue size */ + priv->params.log_sq_size = + order_base_2(priv->params_ethtool.tx_queue_size); priv->params_ethtool.tx_queue_size = - priv->params_ethtool.tx_queue_size_max; - } - priv->params.log_sq_size = - order_base_2(priv->params_ethtool.tx_queue_size); + 1 << priv->params.log_sq_size; - /* import RX queue size */ - if (priv->params_ethtool.rx_queue_size < - (1 << MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE)) { - priv->params_ethtool.rx_queue_size = - (1 << MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE); - } else if (priv->params_ethtool.rx_queue_size > - priv->params_ethtool.rx_queue_size_max) { + /* verify TX completion factor */ + mlx5e_ethtool_sync_tx_completion_fact(priv); + + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; + + case MLX5_PARAM_OFFSET(rx_queue_size): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import RX queue size */ + if (priv->params_ethtool.rx_queue_size < + (1 << MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE)) { + priv->params_ethtool.rx_queue_size = + (1 << MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE); + } else if (priv->params_ethtool.rx_queue_size > + priv->params_ethtool.rx_queue_size_max) { + priv->params_ethtool.rx_queue_size = + priv->params_ethtool.rx_queue_size_max; + } + /* store actual RX queue size */ + priv->params.log_rq_size = + order_base_2(priv->params_ethtool.rx_queue_size); priv->params_ethtool.rx_queue_size = - priv->params_ethtool.rx_queue_size_max; - } - priv->params.log_rq_size = - order_base_2(priv->params_ethtool.rx_queue_size); + 1 << priv->params.log_rq_size; + + /* update least number of RX WQEs */ + priv->params.min_rx_wqes = min( + priv->params_ethtool.rx_queue_size - 1, + MLX5E_PARAMS_DEFAULT_MIN_RX_WQES); + + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; + + case MLX5_PARAM_OFFSET(channels): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import number of channels */ + if (priv->params_ethtool.channels < 1) + priv->params_ethtool.channels = 1; + else if (priv->params_ethtool.channels > + (u64) priv->mdev->priv.eq_table.num_comp_vectors) { + priv->params_ethtool.channels = + (u64) priv->mdev->priv.eq_table.num_comp_vectors; + } + priv->params.num_channels = priv->params_ethtool.channels; + + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; + + case MLX5_PARAM_OFFSET(rx_coalesce_mode): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import RX coalesce mode */ + if (priv->params_ethtool.rx_coalesce_mode != 0) + priv->params_ethtool.rx_coalesce_mode = 1; + priv->params.rx_cq_moderation_mode = + priv->params_ethtool.rx_coalesce_mode; + + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; - priv->params.min_rx_wqes = min_t (u16, - priv->params_ethtool.rx_queue_size - 1, - MLX5E_PARAMS_DEFAULT_MIN_RX_WQES); - - /* import number of channels */ - if (priv->params_ethtool.channels < 1) - priv->params_ethtool.channels = 1; - else if (priv->params_ethtool.channels > - (u64) priv->mdev->priv.eq_table.num_comp_vectors) { - priv->params_ethtool.channels = - (u64) priv->mdev->priv.eq_table.num_comp_vectors; - } - priv->params.num_channels = priv->params_ethtool.channels; - - /* import RX mode */ - if (priv->params_ethtool.rx_coalesce_mode != 0) - priv->params_ethtool.rx_coalesce_mode = 1; - priv->params.rx_cq_moderation_mode = priv->params_ethtool.rx_coalesce_mode; - - /* import TX mode */ - if (priv->params_ethtool.tx_coalesce_mode != 0) - priv->params_ethtool.tx_coalesce_mode = 1; - priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; - - /* we always agree to turn off HW LRO - but not always to turn on */ - if (priv->params_ethtool.hw_lro != 0) { - if ((priv->ifp->if_capenable & IFCAP_LRO) && - MLX5_CAP_ETH(priv->mdev, lro_cap)) { - priv->params.hw_lro_en = 1; - priv->params_ethtool.hw_lro = 1; + case MLX5_PARAM_OFFSET(tx_coalesce_mode): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import TX coalesce mode */ + if (priv->params_ethtool.tx_coalesce_mode != 0) + priv->params_ethtool.tx_coalesce_mode = 1; + priv->params.tx_cq_moderation_mode = + priv->params_ethtool.tx_coalesce_mode; + + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; + + case MLX5_PARAM_OFFSET(hw_lro): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import HW LRO mode */ + if (priv->params_ethtool.hw_lro != 0) { + if ((priv->ifp->if_capenable & IFCAP_LRO) && + MLX5_CAP_ETH(priv->mdev, lro_cap)) { + priv->params.hw_lro_en = 1; + priv->params_ethtool.hw_lro = 1; + } else { + priv->params.hw_lro_en = 0; + priv->params_ethtool.hw_lro = 0; + error = EINVAL; + + if_printf(priv->ifp, "Can't enable HW LRO: " + "The HW or SW LRO feature is disabled\n"); + } } else { priv->params.hw_lro_en = 0; - priv->params_ethtool.hw_lro = 0; - error = EINVAL; - - if_printf(priv->ifp, "Can't enable HW LRO: " - "The HW or SW LRO feature is disabled"); } - } else { - priv->params.hw_lro_en = 0; - } + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; - if (&priv->params_ethtool.arg[arg2] == - &priv->params_ethtool.cqe_zipping) { + case MLX5_PARAM_OFFSET(cqe_zipping): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import CQE zipping mode */ if (priv->params_ethtool.cqe_zipping && MLX5_CAP_GEN(priv->mdev, cqe_compression)) { priv->params.cqe_zipping_en = true; @@ -241,17 +337,27 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params.cqe_zipping_en = false; priv->params_ethtool.cqe_zipping = 0; } - } + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; + + case MLX5_PARAM_OFFSET(tx_completion_fact): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); - if (&priv->params_ethtool.arg[arg2] == - &priv->params_ethtool.tx_completion_fact || - &priv->params_ethtool.arg[arg2] == - &priv->params_ethtool.tx_queue_size) { /* verify parameter */ mlx5e_ethtool_sync_tx_completion_fact(priv); + + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; + + default: + break; } - if (was_opened) - mlx5e_open_locked(priv->ifp); done: PRIV_UNLOCK(priv); return (error); From owner-svn-src-all@freebsd.org Fri May 20 07:08:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C529B42179; Fri, 20 May 2016 07:08:20 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 115351214; Fri, 20 May 2016 07:08:19 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K78JRr094362; Fri, 20 May 2016 07:08:19 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K78JaY094361; Fri, 20 May 2016 07:08:19 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200708.u4K78JaY094361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300283 - stable/10/usr.sbin/rtsold X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 07:08:20 -0000 Author: truckman Date: Fri May 20 07:08:19 2016 New Revision: 300283 URL: https://svnweb.freebsd.org/changeset/base/300283 Log: MFC r299868 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 991863, 991864, 991865 Modified: stable/10/usr.sbin/rtsold/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtsold/if.c ============================================================================== --- stable/10/usr.sbin/rtsold/if.c Fri May 20 07:07:27 2016 (r300282) +++ stable/10/usr.sbin/rtsold/if.c Fri May 20 07:08:19 2016 (r300283) @@ -83,7 +83,7 @@ interface_up(char *name) int s; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, name, sizeof(nd.ifname)); @@ -181,7 +181,7 @@ interface_status(struct ifinfo *ifinfo) /* get interface flags */ memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, &ifr) < 0) { warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFFLAGS) on %s: %s", ifname, strerror(errno)); @@ -197,7 +197,7 @@ interface_status(struct ifinfo *ifinfo) if (!ifinfo->mediareqok) goto active; memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name)); + strlcpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name)); if (ioctl(ifsock, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { if (errno != EINVAL) { @@ -401,7 +401,7 @@ get_llflag(const char *name) continue; memset(&ifr6, 0, sizeof(ifr6)); - strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); + strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { warnmsg(LOG_ERR, __func__, From owner-svn-src-all@freebsd.org Fri May 20 07:11:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F703B42227; Fri, 20 May 2016 07:11:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F1081532; Fri, 20 May 2016 07:11:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K7B41n096495; Fri, 20 May 2016 07:11:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K7B4qD096494; Fri, 20 May 2016 07:11:04 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200711.u4K7B4qD096494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300284 - stable/10/usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 07:11:05 -0000 Author: truckman Date: Fri May 20 07:11:04 2016 New Revision: 300284 URL: https://svnweb.freebsd.org/changeset/base/300284 Log: MFC r299869 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 1009974 Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Fri May 20 07:08:19 2016 (r300283) +++ stable/10/usr.sbin/route6d/route6d.c Fri May 20 07:11:04 2016 (r300284) @@ -1593,7 +1593,7 @@ ifconfig1(const char *name, if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && !lflag) return (-1); ifr.ifr_addr = *sin6; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFNETMASK_IN6, (char *)&ifr) < 0) { syslog(LOG_INFO, "ioctl: SIOCGIFNETMASK_IN6"); return (-1); From owner-svn-src-all@freebsd.org Fri May 20 07:14:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD6E9B423FA; Fri, 20 May 2016 07:14:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A617018EC; Fri, 20 May 2016 07:14:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K7E45i097380; Fri, 20 May 2016 07:14:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K7E3YW097369; Fri, 20 May 2016 07:14:03 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200714.u4K7E3YW097369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300285 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 07:14:06 -0000 Author: truckman Date: Fri May 20 07:14:03 2016 New Revision: 300285 URL: https://svnweb.freebsd.org/changeset/base/300285 Log: MFC r299873 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Use sizeof(destination) in a few places instead of IFNAMSIZ. Cast afp->af_ridreq and afp->af_addreq to make the intent of the code more obvious. Reported by: Coverity CID: 1009628, 1009630, 1009631, 1009632, 1009633, 1009635, 1009638 CID: 1009639, 1009640, 1009641, 1009642, 1009643, 1009644, 1009645 CID: 1009646, 1009647, 1010049, 1010050, 1010051, 1010052, 1010053 CID: 1010054, 1011293, 1011294, 1011295, 1011296, 1011297, 1011298 CID: 1011299, 1305821, 1351720, 1351721 Modified: stable/10/sbin/ifconfig/af_inet.c stable/10/sbin/ifconfig/af_inet6.c stable/10/sbin/ifconfig/af_nd6.c stable/10/sbin/ifconfig/ifclone.c stable/10/sbin/ifconfig/ifconfig.c stable/10/sbin/ifconfig/iffib.c stable/10/sbin/ifconfig/ifgre.c stable/10/sbin/ifconfig/ifieee80211.c stable/10/sbin/ifconfig/ifmac.c stable/10/sbin/ifconfig/ifmedia.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/af_inet.c ============================================================================== --- stable/10/sbin/ifconfig/af_inet.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/af_inet.c Fri May 20 07:14:03 2016 (r300285) @@ -152,7 +152,7 @@ in_status_tunnel(int s) const struct sockaddr *sa = (const struct sockaddr *) &ifr.ifr_addr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, IFNAMSIZ); + strlcpy(ifr.ifr_name, name, IFNAMSIZ); if (ioctl(s, SIOCGIFPSRCADDR, (caddr_t)&ifr) < 0) return; @@ -177,7 +177,7 @@ in_set_tunnel(int s, struct addrinfo *sr struct in_aliasreq addreq; memset(&addreq, 0, sizeof(addreq)); - strncpy(addreq.ifra_name, name, IFNAMSIZ); + strlcpy(addreq.ifra_name, name, IFNAMSIZ); memcpy(&addreq.ifra_addr, srcres->ai_addr, srcres->ai_addr->sa_len); memcpy(&addreq.ifra_dstaddr, dstres->ai_addr, dstres->ai_addr->sa_len); Modified: stable/10/sbin/ifconfig/af_inet6.c ============================================================================== --- stable/10/sbin/ifconfig/af_inet6.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/af_inet6.c Fri May 20 07:14:03 2016 (r300285) @@ -185,7 +185,7 @@ in6_status(int s __unused, const struct if (sin == NULL) return; - strncpy(ifr6.ifr_name, ifr.ifr_name, sizeof(ifr.ifr_name)); + strlcpy(ifr6.ifr_name, ifr.ifr_name, sizeof(ifr.ifr_name)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { warn("socket(AF_INET6,SOCK_DGRAM)"); return; @@ -422,7 +422,7 @@ in6_status_tunnel(int s) const struct sockaddr *sa = (const struct sockaddr *) &in6_ifr.ifr_addr; memset(&in6_ifr, 0, sizeof(in6_ifr)); - strncpy(in6_ifr.ifr_name, name, IFNAMSIZ); + strlcpy(in6_ifr.ifr_name, name, sizeof(in6_ifr.ifr_name)); if (ioctl(s, SIOCGIFPSRCADDR_IN6, (caddr_t)&in6_ifr) < 0) return; @@ -449,7 +449,7 @@ in6_set_tunnel(int s, struct addrinfo *s struct in6_aliasreq in6_addreq; memset(&in6_addreq, 0, sizeof(in6_addreq)); - strncpy(in6_addreq.ifra_name, name, IFNAMSIZ); + strlcpy(in6_addreq.ifra_name, name, sizeof(in6_addreq.ifra_name)); memcpy(&in6_addreq.ifra_addr, srcres->ai_addr, srcres->ai_addr->sa_len); memcpy(&in6_addreq.ifra_dstaddr, dstres->ai_addr, dstres->ai_addr->sa_len); Modified: stable/10/sbin/ifconfig/af_nd6.c ============================================================================== --- stable/10/sbin/ifconfig/af_nd6.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/af_nd6.c Fri May 20 07:14:03 2016 (r300285) @@ -75,7 +75,7 @@ setnd6flags(const char *dummyaddr __unus int error; memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); + strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); error = ioctl(s, SIOCGIFINFO_IN6, &nd); if (error) { warn("ioctl(SIOCGIFINFO_IN6)"); @@ -100,7 +100,7 @@ setnd6defif(const char *dummyaddr __unus int error; memset(&ndifreq, 0, sizeof(ndifreq)); - strncpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); + strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); if (d < 0) { if (isnd6defif(s)) { @@ -127,7 +127,7 @@ isnd6defif(int s) int error; memset(&ndifreq, 0, sizeof(ndifreq)); - strncpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); + strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); ifindex = if_nametoindex(ndifreq.ifname); error = ioctl(s, SIOCGDEFIFACE_IN6, (caddr_t)&ndifreq); @@ -147,7 +147,7 @@ nd6_status(int s) int isdefif; memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); + strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT) warn("socket(AF_INET6, SOCK_DGRAM)"); Modified: stable/10/sbin/ifconfig/ifclone.c ============================================================================== --- stable/10/sbin/ifconfig/ifclone.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifclone.c Fri May 20 07:14:03 2016 (r300285) @@ -162,7 +162,7 @@ DECL_CMD_FUNC(clone_create, arg, d) static DECL_CMD_FUNC(clone_destroy, arg, d) { - (void) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + (void) strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) err(1, "SIOCIFDESTROY"); } Modified: stable/10/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifconfig.c Fri May 20 07:14:03 2016 (r300285) @@ -304,7 +304,7 @@ main(int argc, char *argv[]) ifindex = 0; for (ifa = ifap; ifa; ifa = ifa->ifa_next) { memset(&paifr, 0, sizeof(paifr)); - strncpy(paifr.ifr_name, ifa->ifa_name, sizeof(paifr.ifr_name)); + strlcpy(paifr.ifr_name, ifa->ifa_name, sizeof(paifr.ifr_name)); if (sizeof(paifr.ifr_addr) >= ifa->ifa_addr->sa_len) { memcpy(&paifr.ifr_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len); @@ -502,7 +502,7 @@ ifconfig(int argc, char *const *argv, in struct callback *cb; int s; - strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name); + strlcpy(ifr.ifr_name, name, sizeof ifr.ifr_name); afp = NULL; if (uafp != NULL) afp = uafp; @@ -623,7 +623,8 @@ top: } if (clearaddr) { int ret; - strncpy(afp->af_ridreq, name, sizeof ifr.ifr_name); + strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, + sizeof ifr.ifr_name); ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); if (ret < 0) { if (errno == EADDRNOTAVAIL && (doalias >= 0)) { @@ -640,7 +641,8 @@ top: } } if (newaddr && (setaddr || setmask)) { - strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); + strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, + sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); } @@ -850,7 +852,7 @@ static void setifmetric(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_metric = atoi(val); if (ioctl(s, SIOCSIFMETRIC, (caddr_t)&ifr) < 0) err(1, "ioctl SIOCSIFMETRIC (set metric)"); @@ -860,7 +862,7 @@ static void setifmtu(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_mtu = atoi(val); if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) < 0) err(1, "ioctl SIOCSIFMTU (set mtu)"); @@ -872,7 +874,7 @@ setifname(const char *val, int dummy __u { char *newname; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); newname = strdup(val); if (newname == NULL) @@ -894,7 +896,7 @@ setifdescr(const char *val, int dummy __ { char *newdescr; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_buffer.length = strlen(val) + 1; if (ifr.ifr_buffer.length == 1) { @@ -954,7 +956,7 @@ status(const struct afswtch *afp, const ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af; } - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0); if (s < 0) @@ -1036,7 +1038,7 @@ status(const struct afswtch *afp, const else if (afp->af_other_status != NULL) afp->af_other_status(s); - strncpy(ifs.ifs_name, name, sizeof ifs.ifs_name); + strlcpy(ifs.ifs_name, name, sizeof ifs.ifs_name); if (ioctl(s, SIOCGIFSTATUS, &ifs) == 0) printf("%s", ifs.ascii); Modified: stable/10/sbin/ifconfig/iffib.c ============================================================================== --- stable/10/sbin/ifconfig/iffib.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/iffib.c Fri May 20 07:14:03 2016 (r300285) @@ -49,13 +49,13 @@ fib_status(int s) struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) == 0 && ifr.ifr_fib != RT_DEFAULT_FIB) printf("\tfib: %u\n", ifr.ifr_fib); memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGTUNFIB, (caddr_t)&ifr) == 0 && ifr.ifr_fib != RT_DEFAULT_FIB) printf("\ttunnelfib: %u\n", ifr.ifr_fib); @@ -74,7 +74,7 @@ setiffib(const char *val, int dummy __un return; } - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_fib = fib; if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) warn("ioctl (SIOCSIFFIB)"); @@ -93,7 +93,7 @@ settunfib(const char *val, int dummy __u return; } - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_fib = fib; if (ioctl(s, SIOCSTUNFIB, (caddr_t)&ifr) < 0) warn("ioctl (SIOCSTUNFIB)"); Modified: stable/10/sbin/ifconfig/ifgre.c ============================================================================== --- stable/10/sbin/ifconfig/ifgre.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifgre.c Fri May 20 07:14:03 2016 (r300285) @@ -68,7 +68,7 @@ setifgrekey(const char *val, int dummy _ { uint32_t grekey = strtol(val, NULL, 0); - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_data = (caddr_t)&grekey; if (ioctl(s, GRESKEY, (caddr_t)&ifr) < 0) warn("ioctl (set grekey)"); Modified: stable/10/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/10/sbin/ifconfig/ifieee80211.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifieee80211.c Fri May 20 07:14:03 2016 (r300285) @@ -3239,7 +3239,7 @@ scan_and_wait(int s) return; } (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = IEEE80211_IOC_SCAN_REQ; memset(&sr, 0, sizeof(sr)); @@ -3705,7 +3705,7 @@ get80211wme(int s, int param, int ac, in struct ieee80211req ireq; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = param; ireq.i_len = ac; if (ioctl(s, SIOCG80211, &ireq) < 0) { @@ -3886,7 +3886,7 @@ list_mac(int s) char c; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); /* XXX ?? */ + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); /* XXX ?? */ ireq.i_type = IEEE80211_IOC_MACCMD; ireq.i_val = IEEE80211_MACCMD_POLICY; if (ioctl(s, SIOCG80211, &ireq) < 0) { @@ -3992,7 +3992,7 @@ list_mesh(int s) struct ieee80211req_mesh_route *rt; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = IEEE80211_IOC_MESH_RTCMD; ireq.i_val = IEEE80211_MESH_RTCMD_LIST; ireq.i_data = &routes; @@ -4074,7 +4074,7 @@ get80211opmode(int s) struct ifmediareq ifmr; (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) { if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) { @@ -4218,7 +4218,7 @@ getid(int s, int ix, void *data, size_t struct ieee80211req ireq; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = (!mesh) ? IEEE80211_IOC_SSID : IEEE80211_IOC_MESH_ID; ireq.i_val = ix; ireq.i_data = data; Modified: stable/10/sbin/ifconfig/ifmac.c ============================================================================== --- stable/10/sbin/ifconfig/ifmac.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifmac.c Fri May 20 07:14:03 2016 (r300285) @@ -57,7 +57,7 @@ maclabel_status(int s) char *label_text; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (mac_prepare_ifnet_label(&label) == -1) return; @@ -90,7 +90,7 @@ setifmaclabel(const char *val, int d, in } memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_ifru.ifru_data = (void *)label; error = ioctl(s, SIOCSIFMAC, &ifr); Modified: stable/10/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/10/sbin/ifconfig/ifmedia.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifmedia.c Fri May 20 07:14:03 2016 (r300285) @@ -112,7 +112,7 @@ media_status(int s) int xmedia = 1; (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); /* * Check if interface supports extended media types. @@ -213,7 +213,7 @@ ifmedia_getstate(int s) err(1, "malloc"); (void) memset(ifmr, 0, sizeof(struct ifmediareq)); - (void) strncpy(ifmr->ifm_name, name, + (void) strlcpy(ifmr->ifm_name, name, sizeof(ifmr->ifm_name)); ifmr->ifm_count = 0; @@ -287,7 +287,7 @@ setmedia(const char *val, int d, int s, */ subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; @@ -319,7 +319,7 @@ domediaopt(const char *val, int clear, i options = get_media_options(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = ifmr->ifm_current; if (clear) ifr.ifr_media &= ~options; @@ -346,7 +346,7 @@ setmediainst(const char *val, int d, int if (inst < 0 || inst > (int)IFM_INST_MAX) errx(1, "invalid media instance: %s", val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & ~IFM_IMASK) | inst << IFM_ISHIFT; ifmr->ifm_current = ifr.ifr_media; @@ -363,7 +363,7 @@ setmediamode(const char *val, int d, int mode = get_media_mode(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & ~IFM_MMASK) | mode; ifmr->ifm_current = ifr.ifr_media; From owner-svn-src-all@freebsd.org Fri May 20 07:18:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50116B4255D; Fri, 20 May 2016 07:18:34 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D23F1B02; Fri, 20 May 2016 07:18:34 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K7IXrH097588; Fri, 20 May 2016 07:18:33 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K7IXdM097587; Fri, 20 May 2016 07:18:33 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200718.u4K7IXdM097587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300286 - stable/10/lib/libc/resolv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 07:18:34 -0000 Author: truckman Date: Fri May 20 07:18:33 2016 New Revision: 300286 URL: https://svnweb.freebsd.org/changeset/base/300286 Log: MFC r299879, r299880 r299879 | truckman | 2016-05-15 18:30:32 -0700 (Sun, 15 May 2016) | 7 lines Likely a false positive ... but make sure that -1 can't be used as an array index by splitting up a test. r299880 | truckman | 2016-05-15 18:38:24 -0700 (Sun, 15 May 2016) | 8 lines Since rdata is only used as an argument to the immediately following call to res_nopt_rdata(), revert r299879 and fix CID 603941 by moving rdata = &buf[n]; inside the if block. Reported by: Coverity CID: 603941 Modified: stable/10/lib/libc/resolv/res_query.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_query.c ============================================================================== --- stable/10/lib/libc/resolv/res_query.c Fri May 20 07:14:03 2016 (r300285) +++ stable/10/lib/libc/resolv/res_query.c Fri May 20 07:18:33 2016 (r300286) @@ -136,8 +136,8 @@ again: if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) { n = res_nopt(statp, n, buf, sizeof(buf), anslen); - rdata = &buf[n]; if (n > 0 && (statp->options & RES_NSID) != 0U) { + rdata = &buf[n]; n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata, NS_OPT_NSID, 0, NULL); } From owner-svn-src-all@freebsd.org Fri May 20 08:22:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FDEAB42DE0; Fri, 20 May 2016 08:22:22 +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 129DE139F; Fri, 20 May 2016 08:22:22 +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 u4K8MLFd018557; Fri, 20 May 2016 08:22:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K8MLHp018554; Fri, 20 May 2016 08:22:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605200822.u4K8MLHp018554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 May 2016 08:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300287 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 08:22:22 -0000 Author: kib Date: Fri May 20 08:22:20 2016 New Revision: 300287 URL: https://svnweb.freebsd.org/changeset/base/300287 Log: Remove asserts that Giant is not held on entrance into geom KPI, which outlived their usefulness. This allows to remove drop/pickup Giant wrappers around GEOM calls. Discussed with: alfred, imp, phk Sponsored by: The FreeBSD Foundation Modified: head/sys/geom/geom.h head/sys/geom/geom_event.c head/sys/geom/geom_kern.c Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Fri May 20 07:18:33 2016 (r300286) +++ head/sys/geom/geom.h Fri May 20 08:22:20 2016 (r300287) @@ -371,7 +371,6 @@ g_free(void *ptr) #define g_topology_lock() \ do { \ - mtx_assert(&Giant, MA_NOTOWNED); \ sx_xlock(&topology_lock); \ } while (0) Modified: head/sys/geom/geom_event.c ============================================================================== --- head/sys/geom/geom_event.c Fri May 20 07:18:33 2016 (r300286) +++ head/sys/geom/geom_event.c Fri May 20 08:22:20 2016 (r300287) @@ -83,7 +83,6 @@ g_waitidle(void) { g_topology_assert_not(); - mtx_assert(&Giant, MA_NOTOWNED); mtx_lock(&g_eventlock); while (!TAILQ_EMPTY(&g_events)) Modified: head/sys/geom/geom_kern.c ============================================================================== --- head/sys/geom/geom_kern.c Fri May 20 07:18:33 2016 (r300286) +++ head/sys/geom/geom_kern.c Fri May 20 08:22:20 2016 (r300287) @@ -90,7 +90,6 @@ static void g_up_procbody(void *arg) { - mtx_assert(&Giant, MA_NOTOWNED); thread_lock(g_up_td); sched_prio(g_up_td, PRIBIO); thread_unlock(g_up_td); @@ -103,7 +102,6 @@ static void g_down_procbody(void *arg) { - mtx_assert(&Giant, MA_NOTOWNED); thread_lock(g_down_td); sched_prio(g_down_td, PRIBIO); thread_unlock(g_down_td); @@ -116,7 +114,6 @@ static void g_event_procbody(void *arg) { - mtx_assert(&Giant, MA_NOTOWNED); thread_lock(g_event_td); sched_prio(g_event_td, PRIBIO); thread_unlock(g_event_td); From owner-svn-src-all@freebsd.org Fri May 20 08:25:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E05B430B6; Fri, 20 May 2016 08:25:40 +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 DAC621A67; Fri, 20 May 2016 08:25:39 +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 u4K8Pd2M018719; Fri, 20 May 2016 08:25:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K8PcNo018710; Fri, 20 May 2016 08:25:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605200825.u4K8PcNo018710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 May 2016 08:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300288 - in head/sys/geom: . eli journal mirror mountver raid raid3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 08:25:40 -0000 Author: kib Date: Fri May 20 08:25:37 2016 New Revision: 300288 URL: https://svnweb.freebsd.org/changeset/base/300288 Log: Removal of Giant droping wrappers for GEOM classes. Sponsored by: The FreeBSD Foundation Modified: head/sys/geom/eli/g_eli.c head/sys/geom/geom_mbr.c head/sys/geom/geom_pc98.c head/sys/geom/geom_subr.c head/sys/geom/journal/g_journal.c head/sys/geom/mirror/g_mirror.c head/sys/geom/mountver/g_mountver.c head/sys/geom/raid/g_raid.c head/sys/geom/raid3/g_raid3.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/eli/g_eli.c Fri May 20 08:25:37 2016 (r300288) @@ -1231,7 +1231,6 @@ g_eli_shutdown_pre_sync(void *arg, int h int error; mp = arg; - DROP_GIANT(); g_topology_lock(); LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { sc = gp->softc; @@ -1247,7 +1246,6 @@ g_eli_shutdown_pre_sync(void *arg, int h } } g_topology_unlock(); - PICKUP_GIANT(); } static void Modified: head/sys/geom/geom_mbr.c ============================================================================== --- head/sys/geom/geom_mbr.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/geom_mbr.c Fri May 20 08:25:37 2016 (r300288) @@ -190,7 +190,6 @@ g_mbr_ioctl(struct g_provider *pp, u_lon case DIOCSMBR: { if (!(fflag & FWRITE)) return (EPERM); - DROP_GIANT(); g_topology_lock(); cp = LIST_FIRST(&gp->consumer); if (cp->acw == 0) { @@ -205,7 +204,6 @@ g_mbr_ioctl(struct g_provider *pp, u_lon if (opened) g_access(cp, 0, -1 , 0); g_topology_unlock(); - PICKUP_GIANT(); return(error); } default: Modified: head/sys/geom/geom_pc98.c ============================================================================== --- head/sys/geom/geom_pc98.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/geom_pc98.c Fri May 20 08:25:37 2016 (r300288) @@ -176,7 +176,6 @@ g_pc98_ioctl(struct g_provider *pp, u_lo case DIOCSPC98: { if (!(fflag & FWRITE)) return (EPERM); - DROP_GIANT(); g_topology_lock(); cp = LIST_FIRST(&gp->consumer); if (cp->acw == 0) { @@ -191,7 +190,6 @@ g_pc98_ioctl(struct g_provider *pp, u_lo if (opened) g_access(cp, 0, -1 , 0); g_topology_unlock(); - PICKUP_GIANT(); return(error); } default: Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/geom_subr.c Fri May 20 08:25:37 2016 (r300288) @@ -247,9 +247,7 @@ g_modevent(module_t mod, int type, void break; case MOD_UNLOAD: g_trace(G_T_TOPOLOGY, "g_modevent(%s, UNLOAD)", mp->name); - DROP_GIANT(); error = g_unload_class(mp); - PICKUP_GIANT(); if (error == 0) { KASSERT(LIST_EMPTY(&mp->geom), ("Unloaded class (%s) still has geom", mp->name)); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/journal/g_journal.c Fri May 20 08:25:37 2016 (r300288) @@ -2697,7 +2697,6 @@ g_journal_shutdown(void *arg, int howto if (panicstr != NULL) return; mp = arg; - DROP_GIANT(); g_topology_lock(); LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if (gp->softc == NULL) @@ -2706,7 +2705,6 @@ g_journal_shutdown(void *arg, int howto g_journal_destroy(gp->softc); } g_topology_unlock(); - PICKUP_GIANT(); } /* @@ -2725,7 +2723,6 @@ g_journal_lowmem(void *arg, int howto __ g_journal_stats_low_mem++; mp = arg; - DROP_GIANT(); g_topology_lock(); LIST_FOREACH(gp, &mp->geom, geom) { sc = gp->softc; @@ -2756,7 +2753,6 @@ g_journal_lowmem(void *arg, int howto __ break; } g_topology_unlock(); - PICKUP_GIANT(); } static void g_journal_switcher(void *arg); @@ -2871,7 +2867,6 @@ g_journal_do_switch(struct g_class *clas char *mountpoint; int error, save; - DROP_GIANT(); g_topology_lock(); LIST_FOREACH(gp, &classp->geom, geom) { sc = gp->softc; @@ -2886,7 +2881,6 @@ g_journal_do_switch(struct g_class *clas mtx_unlock(&sc->sc_mtx); } g_topology_unlock(); - PICKUP_GIANT(); mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { @@ -2901,11 +2895,9 @@ g_journal_do_switch(struct g_class *clas continue; /* mtx_unlock(&mountlist_mtx) was done inside vfs_busy() */ - DROP_GIANT(); g_topology_lock(); sc = g_journal_find_device(classp, mp->mnt_gjprovider); g_topology_unlock(); - PICKUP_GIANT(); if (sc == NULL) { GJ_DEBUG(0, "Cannot find journal geom for %s.", @@ -2984,7 +2976,6 @@ next: sc = NULL; for (;;) { - DROP_GIANT(); g_topology_lock(); LIST_FOREACH(gp, &g_journal_class.geom, geom) { sc = gp->softc; @@ -3000,7 +2991,6 @@ next: sc = NULL; } g_topology_unlock(); - PICKUP_GIANT(); if (sc == NULL) break; mtx_assert(&sc->sc_mtx, MA_OWNED); Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/mirror/g_mirror.c Fri May 20 08:25:37 2016 (r300288) @@ -3310,7 +3310,6 @@ g_mirror_shutdown_post_sync(void *arg, i int error; mp = arg; - DROP_GIANT(); g_topology_lock(); g_mirror_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { @@ -3329,7 +3328,6 @@ g_mirror_shutdown_post_sync(void *arg, i g_topology_lock(); } g_topology_unlock(); - PICKUP_GIANT(); } static void Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/mountver/g_mountver.c Fri May 20 08:25:37 2016 (r300288) @@ -611,12 +611,10 @@ g_mountver_shutdown_pre_sync(void *arg, struct g_geom *gp, *gp2; mp = arg; - DROP_GIANT(); g_topology_lock(); LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) g_mountver_destroy(gp, 1); g_topology_unlock(); - PICKUP_GIANT(); } static void Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/raid/g_raid.c Fri May 20 08:25:37 2016 (r300288) @@ -2462,7 +2462,6 @@ g_raid_shutdown_post_sync(void *arg, int struct g_raid_volume *vol; mp = arg; - DROP_GIANT(); g_topology_lock(); g_raid_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { @@ -2477,7 +2476,6 @@ g_raid_shutdown_post_sync(void *arg, int g_topology_lock(); } g_topology_unlock(); - PICKUP_GIANT(); } static void Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Fri May 20 08:22:20 2016 (r300287) +++ head/sys/geom/raid3/g_raid3.c Fri May 20 08:25:37 2016 (r300288) @@ -3543,7 +3543,6 @@ g_raid3_shutdown_post_sync(void *arg, in int error; mp = arg; - DROP_GIANT(); g_topology_lock(); g_raid3_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { @@ -3562,7 +3561,6 @@ g_raid3_shutdown_post_sync(void *arg, in g_topology_lock(); } g_topology_unlock(); - PICKUP_GIANT(); } static void From owner-svn-src-all@freebsd.org Fri May 20 08:28:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BE22B431F8; Fri, 20 May 2016 08:28:13 +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 D24CB1D69; Fri, 20 May 2016 08:28:12 +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 u4K8SCBK018841; Fri, 20 May 2016 08:28:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K8SCgk018840; Fri, 20 May 2016 08:28:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605200828.u4K8SCgk018840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 May 2016 08:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300289 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 08:28:13 -0000 Author: kib Date: Fri May 20 08:28:11 2016 New Revision: 300289 URL: https://svnweb.freebsd.org/changeset/base/300289 Log: Remove unneeded Giant locking around kthreads creation. Sponsored by: The FreeBSD Foundation Modified: head/sys/geom/geom_kern.c Modified: head/sys/geom/geom_kern.c ============================================================================== --- head/sys/geom/geom_kern.c Fri May 20 08:25:37 2016 (r300288) +++ head/sys/geom/geom_kern.c Fri May 20 08:28:11 2016 (r300289) @@ -144,14 +144,12 @@ g_init(void) g_io_init(); g_event_init(); g_ctl_init(); - mtx_lock(&Giant); kproc_kthread_add(g_event_procbody, NULL, &g_proc, &g_event_td, RFHIGHPID, 0, "geom", "g_event"); kproc_kthread_add(g_up_procbody, NULL, &g_proc, &g_up_td, RFHIGHPID, 0, "geom", "g_up"); kproc_kthread_add(g_down_procbody, NULL, &g_proc, &g_down_td, RFHIGHPID, 0, "geom", "g_down"); - mtx_unlock(&Giant); EVENTHANDLER_REGISTER(shutdown_pre_sync, geom_shutdown, NULL, SHUTDOWN_PRI_FIRST); } From owner-svn-src-all@freebsd.org Fri May 20 08:29:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A998B43275; Fri, 20 May 2016 08:29:01 +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 4745F1ED3; Fri, 20 May 2016 08:29:01 +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 u4K8T0OK018912; Fri, 20 May 2016 08:29:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K8T0cA018910; Fri, 20 May 2016 08:29:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605200829.u4K8T0cA018910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 20 May 2016 08:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300290 - in head/sys: arm64/cavium 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 08:29:01 -0000 Author: andrew Date: Fri May 20 08:29:00 2016 New Revision: 300290 URL: https://svnweb.freebsd.org/changeset/base/300290 Log: Handle PCI_RES_BUS on the generic and ThunderX PCIe drivers. This has been tested on the Pass 1.1 and 2.0 ThunderX machines in the Netperf cluster. Reviewed by: jhb Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6453 Modified: head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/dev/pci/pci_host_generic.c Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Fri May 20 08:28:11 2016 (r300289) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Fri May 20 08:29:00 2016 (r300290) @@ -313,6 +313,10 @@ thunder_pem_adjust_resource(device_t dev struct rman *rm; sc = device_get_softc(dev); +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + if (type == PCI_RES_BUS) + return (pci_domain_adjust_bus(sc->id, child, res, start, end)); +#endif rm = thunder_pem_rman(sc, type); if (rm == NULL) @@ -619,6 +623,11 @@ thunder_pem_alloc_resource(device_t dev, struct resource *res; device_t parent_dev; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + if (type == PCI_RES_BUS) + return (pci_domain_alloc_bus(sc->id, child, rid, start, end, + count, flags)); +#endif rm = thunder_pem_rman(sc, type); if (rm == NULL) { /* Find parent device. On ThunderX we know an exact path. */ @@ -675,7 +684,12 @@ thunder_pem_release_resource(device_t de struct resource *res) { device_t parent_dev; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct thunder_pem_softc *sc = device_get_softc(dev); + if (type == PCI_RES_BUS) + return (pci_domain_release_bus(sc->id, child, rid, res)); +#endif /* Find parent device. On ThunderX we know an exact path. */ parent_dev = device_get_parent(device_get_parent(dev)); Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri May 20 08:28:11 2016 (r300289) +++ head/sys/dev/pci/pci_host_generic.c Fri May 20 08:29:00 2016 (r300290) @@ -501,7 +501,14 @@ static int generic_pcie_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct generic_pcie_softc *sc; + if (type == PCI_RES_BUS) { + sc = device_get_softc(dev); + return (pci_domain_release_bus(sc->ecam, child, rid, res)); + } +#endif /* For PCIe devices that do not have FDT nodes, use PCIB method */ if ((int)ofw_bus_get_node(child) <= 0) { return (generic_pcie_release_resource_pcie(dev, @@ -517,7 +524,15 @@ struct resource * pci_host_generic_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct generic_pcie_softc *sc; + if (type == PCI_RES_BUS) { + sc = device_get_softc(dev); + return (pci_domain_alloc_bus(sc->ecam, child, 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 (generic_pcie_alloc_resource_pcie(dev, child, type, rid, @@ -579,6 +594,11 @@ generic_pcie_adjust_resource(device_t de struct rman *rm; sc = device_get_softc(dev); +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + if (type == PCI_RES_BUS) + return (pci_domain_adjust_bus(sc->ecam, child, res, start, + end)); +#endif rm = generic_pcie_rman(sc, type); if (rm != NULL) From owner-svn-src-all@freebsd.org Fri May 20 08:43:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DC3DB43764; Fri, 20 May 2016 08:43:20 +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 F270019B7; Fri, 20 May 2016 08:43: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 u4K8hJ2e024607; Fri, 20 May 2016 08:43:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K8hJvL024606; Fri, 20 May 2016 08:43:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605200843.u4K8hJvL024606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 20 May 2016 08:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300291 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 08:43:20 -0000 Author: andrew Date: Fri May 20 08:43:18 2016 New Revision: 300291 URL: https://svnweb.freebsd.org/changeset/base/300291 Log: Enable NEW_PCIB on arm64. Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/conf/DEFAULTS Modified: head/sys/arm64/conf/DEFAULTS ============================================================================== --- head/sys/arm64/conf/DEFAULTS Fri May 20 08:29:00 2016 (r300290) +++ head/sys/arm64/conf/DEFAULTS Fri May 20 08:43:18 2016 (r300291) @@ -12,3 +12,4 @@ device mem # Memory and kernel memory options GEOM_PART_BSD options GEOM_PART_MBR +options NEW_PCIB From owner-svn-src-all@freebsd.org Fri May 20 08:58:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86C2AB43B77; Fri, 20 May 2016 08:58:07 +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 542141096; Fri, 20 May 2016 08:58:07 +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 u4K8w6Wr027948; Fri, 20 May 2016 08:58:06 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K8w6Fh027946; Fri, 20 May 2016 08:58:06 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605200858.u4K8w6Fh027946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 20 May 2016 08:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300292 - in head/sys/dev: bwn wi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 08:58:07 -0000 Author: avos Date: Fri May 20 08:58:06 2016 New Revision: 300292 URL: https://svnweb.freebsd.org/changeset/base/300292 Log: wi: fix a typo. The max size of bitmask is IEEE80211_MODE_BYTES, not IEEE80211_MODE_MAX. Reuse it in bwn(4) while I'm here. Noticed by: kevlo Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/wi/if_wi.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Fri May 20 08:43:18 2016 (r300291) +++ head/sys/dev/bwn/if_bwn.c Fri May 20 08:58:06 2016 (r300292) @@ -1498,7 +1498,7 @@ bwn_setup_channels(struct bwn_mac *mac, { struct bwn_softc *sc = mac->mac_sc; struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; memset(ic->ic_channels, 0, sizeof(ic->ic_channels)); ic->ic_nchans = 0; Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Fri May 20 08:43:18 2016 (r300291) +++ head/sys/dev/wi/if_wi.c Fri May 20 08:58:06 2016 (r300292) @@ -691,7 +691,7 @@ wi_getradiocaps(struct ieee80211com *ic, int maxchans, int *nchans, struct ieee80211_channel chans[]) { struct wi_softc *sc = ic->ic_softc; - u_int8_t bands[IEEE80211_MODE_MAX]; + u_int8_t bands[IEEE80211_MODE_BYTES]; int i; memset(bands, 0, sizeof(bands)); From owner-svn-src-all@freebsd.org Fri May 20 09:45:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79E58B42EA4 for ; Fri, 20 May 2016 09:45:04 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::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 4439C1028 for ; Fri, 20 May 2016 09:45:04 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-ig0-x234.google.com with SMTP id bi2so133464113igb.0 for ; Fri, 20 May 2016 02:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yRiIUMk06Paiw1Nqj0PQVtmBeXBSLAKjw2ulO2g5ofM=; b=W6gsG0oUCD5890Q8xy5O0+YVbzMKhQ0K0d7Y1XH2PN0LsKgIGS9WSFexdQB8oa3ddq HU011PJwRIRAINOtLezuktV4VboC9J/qIel8hvoEpNNTBu6xns6mMMhwl5kHXuLFydMT APtwUjXhZj07y3PUwuDuAKtwhIRF8RJWLHc9PvP26Xd7VhaJ+aLhSwMtdLnzIUH5p8tP ilWK/DZ5MQ7ndJ8UNI/GrLbtabJgmX6y7o5JR1XQal0o46xiHGaZC/NJvZEhp0nLTR+Y ziFcL5krSqalCeu8sQhu1xIfCFpEAyO+kelDJsvKjMeuir7EEZSInlJ7LTEHMXqBuaqP kdMA== 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=yRiIUMk06Paiw1Nqj0PQVtmBeXBSLAKjw2ulO2g5ofM=; b=UWdq8IJCHwMeCkck1un0f7cKvAQxJD+Rt5XQFtlzlFXrZ0VwyeHkHcwE7s5zTUnOPU wuqozArbbikxYYrQnPHUYi7DQsVQS8TwY0vZQQvjxYnyuvbsQklxwjHIpPhh03Gbvq9o B3sxaOCxM4PKAPL7FY7eBxmBJIHF7xZDWJt9BIFKREbfwQ78FVsfsj0C4tFX6xqNbwUt kW2XJ+FUBlnCfzKpcHWr47lQO268ISa+FOleDp2zao0vn3F9BcNbDGVHnFAdP1mYkq0U GNUWZU1KgSb8uO8GwMsV4gbKNoIYLM6oZ/BdSg38IwSD+/zMadQJeD2VDlA4P+i6TEcG FOjg== X-Gm-Message-State: AOPr4FXm0X4p1lvL66Tiby3HXTnKfI51fF9njVERg1QDUD8LZBy/rlPQWnza9wh/J0hZzj4bIx5qV5kPm23EBQ== X-Received: by 10.50.122.68 with SMTP id lq4mr2070646igb.77.1463737503519; Fri, 20 May 2016 02:45:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.133.194 with HTTP; Fri, 20 May 2016 02:44:44 -0700 (PDT) In-Reply-To: <201605131603.u4DG3oTl005654@repo.freebsd.org> References: <201605131603.u4DG3oTl005654@repo.freebsd.org> From: Wojciech Macek Date: Fri, 20 May 2016 11:44:44 +0200 Message-ID: Subject: Re: svn commit: r299683 - in head/sys/arm64: arm64 include To: Andrew Turner Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste , arm64-dev Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 09:45:04 -0000 Where can I find any details about how was this change tested or reviewed? Apparently it breaks AHCI on armv8. Log below. Wojtek mountroot> ufs:/dev/ada0s2 > Trying to mount root from ufs:/dev/ada0s2 []... > warning: no time-of-day clock registered, system time will not be set > accurately > Setting hostuuid: 701a2acc-d0a0-11e5-8550-001517169365. > Setting hostid: 0x2abffeca. > No suitable dump device was found. > Starting file system checks: > /dev/ada0s2: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/ada0s2: clean, 16575173 free (25325 frags, 2068731 blocks, 0.1% > fragmentation) > panic: unsupported combination of sync operations: 0x00000008 cpuid = 0 > KDB: stack backtrace: > db_trace_self() at db_trace_self_wrapper+0x28 > pc = 0xffff00000050e4a0 lr = 0xffff00000005a378 > sp = 0xffff000b4236e380 fp = 0xffff000b4236e590 > > db_trace_self_wrapper() at vpanic+0x170 > pc = 0xffff00000005a378 lr = 0xffff000000276664 > sp = 0xffff000b4236e5a0 fp = 0xffff000b4236e620 > > vpanic() at panic+0x4c > pc = 0xffff000000276664 lr = 0xffff0000002766f4 > sp = 0xffff000b4236e630 fp = 0xffff000b4236e6b0 > > panic() at bounce_bus_dmamap_sync+0x2d4 > pc = 0xffff0000002766f4 lr = 0xffff00000050d208 > sp = 0xffff000b4236e6c0 fp = 0xffff000b4236e720 > > bounce_bus_dmamap_sync() at ahci_end_transaction+0x214 > pc = 0xffff00000050d208 lr = 0xffff000000061d14 > sp = 0xffff000b4236e730 fp = 0xffff000b4236e780 > > ahci_end_transaction() at ahci_ch_intr_main+0x3d4 > pc = 0xffff000000061d14 lr = 0xffff0000000616fc > sp = 0xffff000b4236e790 fp = 0xffff000b4236e800 > > ahci_ch_intr_main() at ahci_ch_intr_direct+0x70 > pc = 0xffff0000000616fc lr = 0xffff000000060a24 > sp = 0xffff000b4236e810 fp = 0xffff000b4236e840 > > ahci_ch_intr_direct() at ahci_intr_one+0x30 > pc = 0xffff000000060a24 lr = 0xffff00000005f8f0 > sp = 0xffff000b4236e850 fp = 0xffff000b4236e860 > > ahci_intr_one() at intr_event_execute_handlers+0xac > pc = 0xffff00000005f8f0 lr = 0xffff00000023ee1c > sp = 0xffff000b4236e870 fp = 0xffff000b4236e8c0 > > intr_event_execute_handlers() at ithread_loop+0xb0 > pc = 0xffff00000023ee1c lr = 0xffff00000023f4b4 > sp = 0xffff000b4236e8d0 fp = 0xffff000b4236e930 > > ithread_loop() at fork_exit+0x7c > pc = 0xffff00000023f4b4 lr = 0xffff00000023c374 > sp = 0xffff000b4236e940 fp = 0xffff000b4236e970 > > fork_exit() at fork_trampoline+0x10 > pc = 0xffff00000023c374 lr = 0xffff000000523a84 > sp = 0xffff000b4236e980 fp = 0x0000000000000000 > > KDB: enter: panic > [ thread pid 12 tid 100135 ] > Stopped at kdb_enter+0x40: undefined d4200000 > db> 2016-05-13 18:03 GMT+02:00 Andrew Turner : > Author: andrew > Date: Fri May 13 16:03:50 2016 > New Revision: 299683 > URL: https://svnweb.freebsd.org/changeset/base/299683 > > Log: > Add support to the arm64 busdma to handle the cache. For now this is > disabled, however when we enable it it will default to assume memory is > not cache-coherent, unless either the tag was created or the parent was > marked as cache-coherent. > > Obtained from: ABT Systems Ltd > Relnotes: yes > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/arm64/arm64/busdma_bounce.c > head/sys/arm64/include/cpufunc.h > > Modified: head/sys/arm64/arm64/busdma_bounce.c > > ============================================================================== > --- head/sys/arm64/arm64/busdma_bounce.c Fri May 13 15:57:55 2016 > (r299682) > +++ head/sys/arm64/arm64/busdma_bounce.c Fri May 13 16:03:50 2016 > (r299683) > @@ -1,8 +1,11 @@ > /*- > * Copyright (c) 1997, 1998 Justin T. Gibbs. > - * Copyright (c) 2015 The FreeBSD Foundation > + * Copyright (c) 2015-2016 The FreeBSD Foundation > * All rights reserved. > * > + * Portions of this software were developed by Andrew Turner > + * under sponsorship of the FreeBSD Foundation. > + * > * Portions of this software were developed by Semihalf > * under sponsorship of the FreeBSD Foundation. > * > @@ -62,6 +65,7 @@ enum { > BF_COULD_BOUNCE = 0x01, > BF_MIN_ALLOC_COMP = 0x02, > BF_KMEM_ALLOC = 0x04, > + BF_COHERENT = 0x10, > }; > > struct bounce_zone; > @@ -113,6 +117,13 @@ static SYSCTL_NODE(_hw, OID_AUTO, busdma > SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, > 0, > "Total bounce pages"); > > +struct sync_list { > + vm_offset_t vaddr; /* kva of client data */ > + bus_addr_t paddr; /* physical address */ > + vm_page_t pages; /* starting page of client data */ > + bus_size_t datacount; /* client data count */ > +}; > + > struct bus_dmamap { > struct bp_list bpages; > int pagesneeded; > @@ -125,6 +136,8 @@ struct bus_dmamap { > u_int flags; > #define DMAMAP_COULD_BOUNCE (1 << 0) > #define DMAMAP_FROM_DMAMEM (1 << 1) > + int sync_count; > + struct sync_list slist[]; > }; > > static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; > @@ -171,9 +184,19 @@ bounce_bus_dma_tag_create(bus_dma_tag_t > newtag->map_count = 0; > newtag->segments = NULL; > > - if (parent != NULL && ((newtag->common.filter != NULL) || > - ((parent->bounce_flags & BF_COULD_BOUNCE) != 0))) > - newtag->bounce_flags |= BF_COULD_BOUNCE; > +#ifdef notyet > + if ((flags & BUS_DMA_COHERENT) != 0) > + newtag->bounce_flags |= BF_COHERENT; > +#endif > + > + if (parent != NULL) { > + if ((newtag->common.filter != NULL || > + (parent->bounce_flags & BF_COULD_BOUNCE) != 0)) > + newtag->bounce_flags |= BF_COULD_BOUNCE; > + > + /* Copy some flags from the parent */ > + newtag->bounce_flags |= parent->bounce_flags & BF_COHERENT; > + } > > if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || > newtag->common.alignment > 1) > @@ -251,11 +274,14 @@ out: > } > > static bus_dmamap_t > -alloc_dmamap(int flags) > +alloc_dmamap(bus_dma_tag_t dmat, int flags) > { > + u_long mapsize; > bus_dmamap_t map; > > - map = malloc(sizeof(*map), M_DEVBUF, flags | M_ZERO); > + mapsize = sizeof(*map); > + mapsize += sizeof(struct sync_list) * dmat->common.nsegments; > + map = malloc(mapsize, M_DEVBUF, flags | M_ZERO); > if (map == NULL) > return (NULL); > > @@ -288,7 +314,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t d > } > } > > - *mapp = alloc_dmamap(M_NOWAIT); > + *mapp = alloc_dmamap(dmat, M_NOWAIT); > if (*mapp == NULL) { > CTR3(KTR_BUSDMA, "%s: tag %p error %d", > __func__, dmat, ENOMEM); > @@ -360,7 +386,7 @@ bounce_bus_dmamap_destroy(bus_dma_tag_t > if ((map->flags & DMAMAP_FROM_DMAMEM) != 0) > panic("bounce_bus_dmamap_destroy: Invalid map freed\n"); > > - if (STAILQ_FIRST(&map->bpages) != NULL) { > + if (STAILQ_FIRST(&map->bpages) != NULL || map->sync_count != 0) { > CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, > EBUSY); > return (EBUSY); > } > @@ -421,7 +447,7 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm > * Create the map, but don't set the could bounce flag as > * this allocation should never bounce; > */ > - *mapp = alloc_dmamap(mflags); > + *mapp = alloc_dmamap(dmat, mflags); > if (*mapp == NULL) { > CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", > __func__, dmat, dmat->common.flags, ENOMEM); > @@ -644,8 +670,9 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ > vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, > int *segp) > { > + struct sync_list *sl; > bus_size_t sgsize; > - bus_addr_t curaddr; > + bus_addr_t curaddr, sl_end; > int error; > > if (segs == NULL) > @@ -660,6 +687,9 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ > } > } > > + sl = map->slist + map->sync_count - 1; > + sl_end = 0; > + > while (buflen > 0) { > curaddr = buf; > sgsize = MIN(buflen, dmat->common.maxsegsz); > @@ -669,6 +699,23 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ > sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & > PAGE_MASK)); > curaddr = add_bounce_page(dmat, map, 0, curaddr, > sgsize); > + } else if ((dmat->bounce_flags & BF_COHERENT) == 0) { > + if (map->sync_count > 0) > + sl_end = sl->paddr + sl->datacount; > + > + if (map->sync_count == 0 || curaddr != sl_end) { > + if (++map->sync_count > > dmat->common.nsegments) > + break; > + sl++; > + sl->vaddr = 0; > + sl->paddr = curaddr; > + sl->datacount = sgsize; > + sl->pages = PHYS_TO_VM_PAGE(curaddr); > + KASSERT(sl->pages != NULL, > + ("%s: page at PA:0x%08lx is not in " > + "vm_page_array", __func__, curaddr)); > + } else > + sl->datacount += sgsize; > } > sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, > segs, > segp); > @@ -693,9 +740,10 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta > bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, > int *segp) > { > + struct sync_list *sl; > bus_size_t sgsize, max_sgsize; > - bus_addr_t curaddr; > - vm_offset_t kvaddr, vaddr; > + bus_addr_t curaddr, sl_pend; > + vm_offset_t kvaddr, vaddr, sl_vend; > int error; > > if (segs == NULL) > @@ -710,7 +758,11 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta > } > } > > + sl = map->slist + map->sync_count - 1; > vaddr = (vm_offset_t)buf; > + sl_pend = 0; > + sl_vend = 0; > + > while (buflen > 0) { > /* > * Get the physical address for this segment. > @@ -735,6 +787,34 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta > sgsize = MIN(sgsize, max_sgsize); > curaddr = add_bounce_page(dmat, map, kvaddr, > curaddr, > sgsize); > + } else if ((dmat->bounce_flags & BF_COHERENT) == 0) { > + sgsize = MIN(sgsize, max_sgsize); > + if (map->sync_count > 0) { > + sl_pend = sl->paddr + sl->datacount; > + sl_vend = sl->vaddr + sl->datacount; > + } > + > + if (map->sync_count == 0 || > + (kvaddr != 0 && kvaddr != sl_vend) || > + (curaddr != sl_pend)) { > + > + if (++map->sync_count > > dmat->common.nsegments) > + goto cleanup; > + sl++; > + sl->vaddr = kvaddr; > + sl->paddr = curaddr; > + if (kvaddr != 0) { > + sl->pages = NULL; > + } else { > + sl->pages = > PHYS_TO_VM_PAGE(curaddr); > + KASSERT(sl->pages != NULL, > + ("%s: page at PA:0x%08lx is > not " > + "in vm_page_array", __func__, > + curaddr)); > + } > + sl->datacount = sgsize; > + } else > + sl->datacount += sgsize; > } else { > sgsize = MIN(sgsize, max_sgsize); > } > @@ -746,6 +826,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta > buflen -= sgsize; > } > > +cleanup: > /* > * Did we fit? > */ > @@ -783,13 +864,87 @@ bounce_bus_dmamap_unload(bus_dma_tag_t d > { > struct bounce_page *bpage; > > - if ((map->flags & DMAMAP_COULD_BOUNCE) == 0) > - return; > - > while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { > STAILQ_REMOVE_HEAD(&map->bpages, links); > free_bounce_page(dmat, bpage); > } > + > + map->sync_count = 0; > +} > + > +static void > +dma_preread_safe(vm_offset_t va, vm_size_t size) > +{ > + /* > + * Write back any partial cachelines immediately before and > + * after the DMA region. > + */ > + if (va & (dcache_line_size - 1)) > + cpu_dcache_wb_range(va, 1); > + if ((va + size) & (dcache_line_size - 1)) > + cpu_dcache_wb_range(va + size, 1); > + > + cpu_dcache_inv_range(va, size); > +} > + > +static void > +dma_dcache_sync(struct sync_list *sl, bus_dmasync_op_t op) > +{ > + uint32_t len, offset; > + vm_page_t m; > + vm_paddr_t pa; > + vm_offset_t va, tempva; > + bus_size_t size; > + > + offset = sl->paddr & PAGE_MASK; > + m = sl->pages; > + size = sl->datacount; > + pa = sl->paddr; > + > + for ( ; size != 0; size -= len, pa += len, offset = 0, ++m) { > + tempva = 0; > + if (sl->vaddr == 0) { > + len = min(PAGE_SIZE - offset, size); > + tempva = pmap_quick_enter_page(m); > + va = tempva | offset; > + KASSERT(pa == (VM_PAGE_TO_PHYS(m) | offset), > + ("unexpected vm_page_t phys: 0x%16lx != > 0x%16lx", > + VM_PAGE_TO_PHYS(m) | offset, pa)); > + } else { > + len = sl->datacount; > + va = sl->vaddr; > + } > + > + switch (op) { > + case BUS_DMASYNC_PREWRITE: > + case BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD: > + cpu_dcache_wb_range(va, len); > + break; > + case BUS_DMASYNC_PREREAD: > + /* > + * An mbuf may start in the middle of a cacheline. > There > + * will be no cpu writes to the beginning of that > line > + * (which contains the mbuf header) while dma is in > + * progress. Handle that case by doing a > writeback of > + * just the first cacheline before invalidating the > + * overall buffer. Any mbuf in a chain may have > this > + * misalignment. Buffers which are not mbufs > bounce if > + * they are not aligned to a cacheline. > + */ > + dma_preread_safe(va, len); > + break; > + case BUS_DMASYNC_POSTREAD: > + case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: > + cpu_dcache_inv_range(va, len); > + break; > + default: > + panic("unsupported combination of sync operations: > " > + "0x%08x\n", op); > + } > + > + if (tempva != 0) > + pmap_quick_remove_page(tempva); > + } > } > > static void > @@ -797,15 +952,9 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma > bus_dmasync_op_t op) > { > struct bounce_page *bpage; > + struct sync_list *sl, *end; > vm_offset_t datavaddr, tempvaddr; > > - /* > - * XXX ARM64TODO: > - * This bus_dma implementation requires IO-Coherent architecutre. > - * If IO-Coherency is not guaranteed, cache operations have to be > - * added to this function. > - */ > - > if ((op & BUS_DMASYNC_POSTREAD) != 0) { > /* > * Wait for any DMA operations to complete before the > bcopy. > @@ -832,13 +981,26 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma > (void *)bpage->vaddr, > bpage->datacount); > if (tempvaddr != 0) > pmap_quick_remove_page(tempvaddr); > + if ((dmat->bounce_flags & BF_COHERENT) == > 0) > + cpu_dcache_wb_range(bpage->vaddr, > + bpage->datacount); > bpage = STAILQ_NEXT(bpage, links); > } > dmat->bounce_zone->total_bounced++; > + } else if ((op & BUS_DMASYNC_PREREAD) != 0) { > + while (bpage != NULL) { > + if ((dmat->bounce_flags & BF_COHERENT) == > 0) > + > cpu_dcache_wbinv_range(bpage->vaddr, > + bpage->datacount); > + bpage = STAILQ_NEXT(bpage, links); > + } > } > > if ((op & BUS_DMASYNC_POSTREAD) != 0) { > while (bpage != NULL) { > + if ((dmat->bounce_flags & BF_COHERENT) == > 0) > + cpu_dcache_inv_range(bpage->vaddr, > + bpage->datacount); > tempvaddr = 0; > datavaddr = bpage->datavaddr; > if (datavaddr == 0) { > @@ -858,7 +1020,20 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma > } > } > > - if ((op & BUS_DMASYNC_PREWRITE) != 0) { > + /* > + * Cache maintenance for normal (non-COHERENT non-bounce) buffers. > + */ > + if (map->sync_count != 0) { > + sl = &map->slist[0]; > + end = &map->slist[map->sync_count]; > + CTR3(KTR_BUSDMA, "%s: tag %p op 0x%x " > + "performing sync", __func__, dmat, op); > + > + for ( ; sl != end; ++sl) > + dma_dcache_sync(sl, op); > + } > + > + if ((op & (BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE)) != 0) { > /* > * Wait for the bcopy to complete before any DMA > operations. > */ > > Modified: head/sys/arm64/include/cpufunc.h > > ============================================================================== > --- head/sys/arm64/include/cpufunc.h Fri May 13 15:57:55 2016 > (r299682) > +++ head/sys/arm64/include/cpufunc.h Fri May 13 16:03:50 2016 > (r299683) > @@ -119,6 +119,11 @@ clrex(void) > __asm __volatile("clrex" : : : "memory"); > } > > +extern int64_t dcache_line_size; > +extern int64_t icache_line_size; > +extern int64_t idcache_line_size; > +extern int64_t dczva_line_size; > + > #define cpu_nullop() arm64_nullop() > #define cpufunc_nullop() arm64_nullop() > #define cpu_setttb(a) arm64_setttb(a) > > From owner-svn-src-all@freebsd.org Fri May 20 10:26:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF3EB4371E; Fri, 20 May 2016 10:26:13 +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 99ECA1148; Fri, 20 May 2016 10:26:13 +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 u4KAQCw4055842; Fri, 20 May 2016 10:26:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KAQCYg055839; Fri, 20 May 2016 10:26:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605201026.u4KAQCYg055839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 May 2016 10:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300293 - in head/sys: cam cam/ctl dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 10:26:14 -0000 Author: mav Date: Fri May 20 10:26:12 2016 New Revision: 300293 URL: https://svnweb.freebsd.org/changeset/base/300293 Log: Pass task management response information from CTL through CAM to isp(4), utilizing previously unused arg field of struct ccb_notify_acknowledge. This makes new QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT requests really functional for CAM target mode drivers. Modified: head/sys/cam/cam_ccb.h head/sys/cam/ctl/scsi_ctl.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri May 20 08:58:06 2016 (r300292) +++ head/sys/cam/cam_ccb.h Fri May 20 10:26:12 2016 (r300293) @@ -1087,7 +1087,17 @@ struct ccb_notify_acknowledge { u_int tag_id; /* Tag for immediate notify */ u_int seq_id; /* Tar for target of notify */ u_int initiator_id; /* Initiator Identifier */ - u_int arg; /* Function specific */ + u_int arg; /* Response information */ + /* + * Lower byte of arg is one of RESPONSE CODE values defined below + * (subset of response codes from SPL-4 and FCP-4 specifications), + * upper 3 bytes is code-specific ADDITIONAL RESPONSE INFORMATION. + */ +#define CAM_RSP_TMF_COMPLETE 0x00 +#define CAM_RSP_TMF_REJECTED 0x04 +#define CAM_RSP_TMF_FAILED 0x05 +#define CAM_RSP_TMF_SUCCEEDED 0x08 +#define CAM_RSP_TMF_INCORRECT_LUN 0x09 }; /* HBA engine structures. */ Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Fri May 20 08:58:06 2016 (r300292) +++ head/sys/cam/ctl/scsi_ctl.c Fri May 20 10:26:12 2016 (r300293) @@ -1552,6 +1552,7 @@ ctlfedone(struct cam_periph *periph, uni /* * Queue this back down to the SIM as an immediate notify. */ + done_ccb->ccb_h.status = CAM_REQ_INPROG; done_ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; xpt_action(done_ccb); break; @@ -2041,6 +2042,28 @@ ctlfe_done(union ctl_io *io) */ ccb->ccb_h.status = CAM_REQ_INPROG; ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; + switch (io->taskio.task_status) { + case CTL_TASK_FUNCTION_COMPLETE: + ccb->cna2.arg = CAM_RSP_TMF_COMPLETE; + break; + case CTL_TASK_FUNCTION_SUCCEEDED: + ccb->cna2.arg = CAM_RSP_TMF_SUCCEEDED; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + case CTL_TASK_FUNCTION_REJECTED: + ccb->cna2.arg = CAM_RSP_TMF_REJECTED; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + case CTL_TASK_LUN_DOES_NOT_EXIST: + ccb->cna2.arg = CAM_RSP_TMF_INCORRECT_LUN; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + case CTL_TASK_FUNCTION_NOT_SUPPORTED: + ccb->cna2.arg = CAM_RSP_TMF_FAILED; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + } + ccb->cna2.arg |= scsi_3btoul(io->taskio.task_resp) << 8; xpt_action(ccb); } else if (io->io_hdr.flags & CTL_FLAG_STATUS_SENT) { if (softc->flags & CTLFE_LUN_WILDCARD) { Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Fri May 20 08:58:06 2016 (r300292) +++ head/sys/dev/isp/isp_freebsd.c Fri May 20 10:26:12 2016 (r300293) @@ -856,7 +856,7 @@ static void isp_handle_platform_atio7(is static void isp_handle_platform_ctio(ispsoftc_t *, void *); static void isp_handle_platform_notify_fc(ispsoftc_t *, in_fcentry_t *); static void isp_handle_platform_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); -static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *); +static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *, uint32_t rsp); static void isp_handle_platform_target_tmf(ispsoftc_t *, isp_notify_t *); static void isp_target_mark_aborted(ispsoftc_t *, union ccb *); static void isp_target_mark_aborted_early(ispsoftc_t *, tstate_t *, uint32_t); @@ -2761,7 +2761,7 @@ isp_handle_platform_notify_24xx(ispsoftc } static int -isp_handle_platform_target_notify_ack(ispsoftc_t *isp, isp_notify_t *mp) +isp_handle_platform_target_notify_ack(ispsoftc_t *isp, isp_notify_t *mp, uint32_t rsp) { if (isp->isp_state != ISP_RUNSTATE) { @@ -2796,6 +2796,15 @@ isp_handle_platform_target_notify_ack(is cto->ct_oxid = aep->at_hdr.ox_id; cto->ct_flags = CT7_SENDSTATUS|CT7_NOACK|CT7_NO_DATA|CT7_FLAG_MODE1; cto->ct_flags |= (aep->at_ta_len >> 12) << CT7_TASK_ATTR_SHIFT; + if (rsp != 0) { + cto->ct_scsi_status |= (FCP_RSPLEN_VALID << 8); + cto->rsp.m1.ct_resplen = 4; + ISP_MEMZERO(cto->rsp.m1.ct_resp, sizeof (cto->rsp.m1.ct_resp)); + cto->rsp.m1.ct_resp[0] = rsp & 0xff; + cto->rsp.m1.ct_resp[1] = (rsp >> 8) & 0xff; + cto->rsp.m1.ct_resp[2] = (rsp >> 16) & 0xff; + cto->rsp.m1.ct_resp[3] = (rsp >> 24) & 0xff; + } return (isp_target_put_entry(isp, &local)); } @@ -3642,7 +3651,8 @@ isp_action(struct cam_sim *sim, union cc xpt_done(ccb); break; } - if (isp_handle_platform_target_notify_ack(isp, &ntp->rd.nt)) { + if (isp_handle_platform_target_notify_ack(isp, &ntp->rd.nt, + (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0)) { rls_lun_statep(isp, tptr); cam_freeze_devq(ccb->ccb_h.path); cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 1000, 0); @@ -4408,11 +4418,11 @@ changed: /* * This is device arrival/departure notification */ - isp_handle_platform_target_notify_ack(isp, notify); + isp_handle_platform_target_notify_ack(isp, notify, 0); break; default: isp_prt(isp, ISP_LOGALL, "target notify code 0x%x", notify->nt_ncode); - isp_handle_platform_target_notify_ack(isp, notify); + isp_handle_platform_target_notify_ack(isp, notify, 0); break; } break; From owner-svn-src-all@freebsd.org Fri May 20 11:00:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF14B43E49; Fri, 20 May 2016 11:00:09 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5B91FFE; Fri, 20 May 2016 11:00:08 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KB08Nu065067; Fri, 20 May 2016 11:00:08 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KB07fx065055; Fri, 20 May 2016 11:00:07 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201605201100.u4KB07fx065055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 20 May 2016 11:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300294 - in head/sys: conf dev/vnic modules/vnic modules/vnic/mrmlbus modules/vnic/thunder_bgx modules/vnic/thunder_mdio modules/vnic/vnicpf modules/vnic/vnicvf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 11:00:09 -0000 Author: wma Date: Fri May 20 11:00:06 2016 New Revision: 300294 URL: https://svnweb.freebsd.org/changeset/base/300294 Log: Allow building VNIC as a module Add directory structure and fix dependencies to be able to build and use Cavium VNIC driver as a module. Reviewed by: zbb Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6345 Added: head/sys/modules/vnic/ head/sys/modules/vnic/Makefile (contents, props changed) head/sys/modules/vnic/mrmlbus/ head/sys/modules/vnic/mrmlbus/Makefile (contents, props changed) head/sys/modules/vnic/thunder_bgx/ head/sys/modules/vnic/thunder_bgx/Makefile (contents, props changed) head/sys/modules/vnic/thunder_mdio/ head/sys/modules/vnic/thunder_mdio/Makefile (contents, props changed) head/sys/modules/vnic/vnicpf/ head/sys/modules/vnic/vnicpf/Makefile (contents, props changed) head/sys/modules/vnic/vnicvf/ head/sys/modules/vnic/vnicvf/Makefile (contents, props changed) Modified: head/sys/conf/files.arm64 head/sys/dev/vnic/mrml_bridge.c head/sys/dev/vnic/nic_main.c head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/thunder_bgx.c head/sys/dev/vnic/thunder_mdio.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri May 20 10:26:12 2016 (r300293) +++ head/sys/conf/files.arm64 Fri May 20 11:00:06 2016 (r300294) @@ -82,7 +82,7 @@ dev/vnic/thunder_bgx_fdt.c optional vnic dev/vnic/thunder_bgx.c optional vnic pci dev/vnic/thunder_mdio_fdt.c optional vnic fdt dev/vnic/thunder_mdio.c optional vnic -dev/vnic/lmac_if.m optional vnic +dev/vnic/lmac_if.m optional inet | inet6 | vnic kern/kern_clocksource.c standard kern/msi_if.m optional intrng kern/pic_if.m optional intrng Modified: head/sys/dev/vnic/mrml_bridge.c ============================================================================== --- head/sys/dev/vnic/mrml_bridge.c Fri May 20 10:26:12 2016 (r300293) +++ head/sys/dev/vnic/mrml_bridge.c Fri May 20 11:00:06 2016 (r300294) @@ -85,6 +85,7 @@ static devclass_t mrmlbus_fdt_devclass; EARLY_DRIVER_MODULE(mrmlbus, pcib, mrmlbus_fdt_driver, mrmlbus_fdt_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(mrmlbus, 1); static int mrmlb_ofw_fill_ranges(phandle_t, struct simplebus_softc *); static int mrmlb_ofw_bus_attach(device_t); Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Fri May 20 10:26:12 2016 (r300293) +++ head/sys/dev/vnic/nic_main.c Fri May 20 11:00:06 2016 (r300294) @@ -137,18 +137,19 @@ static device_method_t nicpf_methods[] = DEVMETHOD_END, }; -static driver_t nicpf_driver = { +static driver_t vnicpf_driver = { "vnicpf", nicpf_methods, sizeof(struct nicpf), }; -static devclass_t nicpf_devclass; +static devclass_t vnicpf_devclass; -DRIVER_MODULE(nicpf, pci, nicpf_driver, nicpf_devclass, 0, 0); -MODULE_DEPEND(nicpf, pci, 1, 1, 1); -MODULE_DEPEND(nicpf, ether, 1, 1, 1); -MODULE_DEPEND(nicpf, thunder_bgx, 1, 1, 1); +DRIVER_MODULE(vnicpf, pci, vnicpf_driver, vnicpf_devclass, 0, 0); +MODULE_VERSION(vnicpf, 1); +MODULE_DEPEND(vnicpf, pci, 1, 1, 1); +MODULE_DEPEND(vnicpf, ether, 1, 1, 1); +MODULE_DEPEND(vnicpf, thunder_bgx, 1, 1, 1); static int nicpf_alloc_res(struct nicpf *); static void nicpf_free_res(struct nicpf *); Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Fri May 20 10:26:12 2016 (r300293) +++ head/sys/dev/vnic/nicvf_main.c Fri May 20 11:00:06 2016 (r300294) @@ -129,10 +129,11 @@ static driver_t nicvf_driver = { static devclass_t nicvf_devclass; -DRIVER_MODULE(nicvf, pci, nicvf_driver, nicvf_devclass, 0, 0); -MODULE_DEPEND(nicvf, pci, 1, 1, 1); -MODULE_DEPEND(nicvf, ether, 1, 1, 1); -MODULE_DEPEND(nicvf, vnic_pf, 1, 1, 1); +DRIVER_MODULE(vnicvf, pci, nicvf_driver, nicvf_devclass, 0, 0); +MODULE_VERSION(vnicvf, 1); +MODULE_DEPEND(vnicvf, pci, 1, 1, 1); +MODULE_DEPEND(vnicvf, ether, 1, 1, 1); +MODULE_DEPEND(vnicvf, vnicpf, 1, 1, 1); static int nicvf_allocate_misc_interrupt(struct nicvf *); static int nicvf_enable_misc_interrupt(struct nicvf *); Modified: head/sys/dev/vnic/thunder_bgx.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx.c Fri May 20 10:26:12 2016 (r300293) +++ head/sys/dev/vnic/thunder_bgx.c Fri May 20 11:00:06 2016 (r300294) @@ -109,9 +109,10 @@ static driver_t thunder_bgx_driver = { static devclass_t thunder_bgx_devclass; DRIVER_MODULE(thunder_bgx, pci, thunder_bgx_driver, thunder_bgx_devclass, 0, 0); +MODULE_VERSION(thunder_bgx, 1); MODULE_DEPEND(thunder_bgx, pci, 1, 1, 1); MODULE_DEPEND(thunder_bgx, ether, 1, 1, 1); -MODULE_DEPEND(thunder_bgx, octeon_mdio, 1, 1, 1); +MODULE_DEPEND(thunder_bgx, thunder_mdio, 1, 1, 1); static int thunder_bgx_probe(device_t dev) Modified: head/sys/dev/vnic/thunder_mdio.c ============================================================================== --- head/sys/dev/vnic/thunder_mdio.c Fri May 20 10:26:12 2016 (r300293) +++ head/sys/dev/vnic/thunder_mdio.c Fri May 20 11:00:06 2016 (r300294) @@ -122,8 +122,10 @@ DEFINE_CLASS_0(thunder_mdio, thunder_mdi sizeof(struct thunder_mdio_softc)); DRIVER_MODULE(miibus, thunder_mdio, miibus_driver, miibus_devclass, 0, 0); +MODULE_VERSION(thunder_mdio, 1); MODULE_DEPEND(thunder_mdio, ether, 1, 1, 1); MODULE_DEPEND(thunder_mdio, miibus, 1, 1, 1); +MODULE_DEPEND(thunder_mdio, mrmlbus, 1, 1, 1); MALLOC_DEFINE(M_THUNDER_MDIO, "ThunderX MDIO", "Cavium ThunderX MDIO dynamic memory"); Added: head/sys/modules/vnic/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/vnic/Makefile Fri May 20 11:00:06 2016 (r300294) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" + +CFLAGS+= -DFDT + +SUBDIR = mrmlbus thunder_mdio thunder_bgx vnicpf vnicvf + +.include Added: head/sys/modules/vnic/mrmlbus/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/vnic/mrmlbus/Makefile Fri May 20 11:00:06 2016 (r300294) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/vnic + +KMOD= mrmlbus +SRCS= device_if.h bus_if.h opt_platform.h pci_if.h ofw_bus_if.h miibus_if.h lmac_if.h +SRCS+= mrml_bridge.c + +CFLAGS+= -DFDT + +.include Added: head/sys/modules/vnic/thunder_bgx/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/vnic/thunder_bgx/Makefile Fri May 20 11:00:06 2016 (r300294) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/vnic + +KMOD= thunder_bgx +SRCS= thunder_bgx.c thunder_bgx_fdt.c +SRCS+= opt_platform.h device_if.h bus_if.h pci_if.h lmac_if.h ofw_bus_if.h + +CFLAGS+= -DFDT + +.include Added: head/sys/modules/vnic/thunder_mdio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/vnic/thunder_mdio/Makefile Fri May 20 11:00:06 2016 (r300294) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/vnic + +KMOD= thunder_mdio +SRCS= opt_platform.h device_if.h bus_if.h pci_if.h ofw_bus_if.h miibus_if.h lmac_if.h +SRCS+= thunder_mdio.c thunder_mdio_fdt.c + +CFLAGS+= -DFDT + +.include Added: head/sys/modules/vnic/vnicpf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/vnic/vnicpf/Makefile Fri May 20 11:00:06 2016 (r300294) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/vnic + +KMOD= vnicpf +SRCS= pci_iov_if.h opt_platform.h device_if.h bus_if.h pci_if.h ofw_bus_if.h miibus_if.h lmac_if.h +SRCS+= nic_main.c + +CFLAGS+= -DFDT -DPCI_IOV + +.include Added: head/sys/modules/vnic/vnicvf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/vnic/vnicvf/Makefile Fri May 20 11:00:06 2016 (r300294) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/vnic + +KMOD= vnicvf +SRCS= nicvf_main.c nicvf_queues.c +SRCS+= opt_platform.h ofw_bus_if.h lmac_if.h miibus_if.h pci_if.h bus_if.h device_if.h opt_inet.h opt_inet6.h + +CFLAGS+= -DFDT -DPCI_IOV + +.include From owner-svn-src-all@freebsd.org Fri May 20 11:02:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A70DCB43EA2; Fri, 20 May 2016 11:02:05 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B3561338; Fri, 20 May 2016 11:02:05 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KB24bf067761; Fri, 20 May 2016 11:02:04 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KB245w067759; Fri, 20 May 2016 11:02:04 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201605201102.u4KB245w067759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 20 May 2016 11:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300295 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 11:02:05 -0000 Author: wma Date: Fri May 20 11:02:04 2016 New Revision: 300295 URL: https://svnweb.freebsd.org/changeset/base/300295 Log: Fix VNIC module unloading Fix panics which were present when BGX and PF module were unloaded. Reviewed by: zbb Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6346 Modified: head/sys/dev/vnic/nic_main.c head/sys/dev/vnic/thunder_bgx.c Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Fri May 20 11:00:06 2016 (r300294) +++ head/sys/dev/vnic/nic_main.c Fri May 20 11:02:04 2016 (r300295) @@ -247,7 +247,9 @@ static int nicpf_detach(device_t dev) { struct nicpf *nic; + int err; + err = 0; nic = device_get_softc(dev); callout_drain(&nic->check_link); @@ -257,7 +259,12 @@ nicpf_detach(device_t dev) nicpf_free_res(nic); pci_disable_busmaster(dev); - return (0); +#ifdef PCI_IOV + err = pci_iov_detach(dev); + if (err != 0) + device_printf(dev, "SR-IOV in use. Detach first.\n"); +#endif + return (err); } /* @@ -1055,6 +1062,9 @@ nic_disable_msix(struct nicpf *nic) nic->msix_enabled = 0; nic->num_vec = 0; } + + bus_release_resource(nic->dev, SYS_RES_MEMORY, + rman_get_rid(nic->msix_table_res), nic->msix_table_res); } static void @@ -1071,7 +1081,7 @@ nic_free_all_interrupts(struct nicpf *ni nic->msix_entries[irq].handle); } - bus_release_resource(nic->dev, SYS_RES_IRQ, irq, + bus_release_resource(nic->dev, SYS_RES_IRQ, irq + 1, nic->msix_entries[irq].irq_res); } } Modified: head/sys/dev/vnic/thunder_bgx.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx.c Fri May 20 11:00:06 2016 (r300294) +++ head/sys/dev/vnic/thunder_bgx.c Fri May 20 11:02:04 2016 (r300295) @@ -136,12 +136,16 @@ static int thunder_bgx_attach(device_t dev) { struct bgx *bgx; - uint8_t lmac; + uint8_t lmacid; int err; int rid; + struct lmac *lmac; bgx = malloc(sizeof(*bgx), M_BGX, (M_WAITOK | M_ZERO)); bgx->dev = dev; + + lmac = device_get_softc(dev); + lmac->bgx = bgx; /* Enable bus mastering */ pci_enable_busmaster(dev); /* Allocate resources - configuration registers */ @@ -168,11 +172,11 @@ thunder_bgx_attach(device_t dev) bgx_init_hw(bgx); /* Enable all LMACs */ - for (lmac = 0; lmac < bgx->lmac_count; lmac++) { - err = bgx_lmac_enable(bgx, lmac); + for (lmacid = 0; lmacid < bgx->lmac_count; lmacid++) { + err = bgx_lmac_enable(bgx, lmacid); if (err) { device_printf(dev, "BGX%d failed to enable lmac%d\n", - bgx->bgx_id, lmac); + bgx->bgx_id, lmacid); goto err_free_res; } } @@ -203,6 +207,12 @@ thunder_bgx_detach(device_t dev) for (lmacid = 0; lmacid < bgx->lmac_count; lmacid++) bgx_lmac_disable(bgx, lmacid); + bgx_vnic[bgx->bgx_id] = NULL; + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(bgx->reg_base), bgx->reg_base); + free(bgx, M_BGX); + pci_disable_busmaster(dev); + return (0); } From owner-svn-src-all@freebsd.org Fri May 20 11:56:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 257F0B43370; Fri, 20 May 2016 11:56:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB6FA11CB; Fri, 20 May 2016 11:56:17 +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 u4KBuHas082903; Fri, 20 May 2016 11:56:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KBuHbG082902; Fri, 20 May 2016 11:56:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605201156.u4KBuHbG082902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 May 2016 11:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300296 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 11:56:18 -0000 Author: mav Date: Fri May 20 11:56:16 2016 New Revision: 300296 URL: https://svnweb.freebsd.org/changeset/base/300296 Log: Pass proper for 23xx arguments to isp_endcmd(). Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Fri May 20 11:02:04 2016 (r300295) +++ head/sys/dev/isp/isp_freebsd.c Fri May 20 11:56:16 2016 (r300296) @@ -2003,7 +2003,7 @@ noresrc: ntp = isp_get_ntpd(isp, tptr); if (ntp == NULL) { rls_lun_statep(isp, tptr); - isp_endcmd(isp, aep, nphdl, 0, SCSI_STATUS_BUSY, 0); + isp_endcmd(isp, aep, SCSI_STATUS_BUSY, 0); return; } memcpy(ntp->rd.data, aep, QENTRY_LEN); From owner-svn-src-all@freebsd.org Fri May 20 12:09:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13200B4202B; Fri, 20 May 2016 12:09:12 +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 D8F39112D; Fri, 20 May 2016 12:09:11 +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 u4KC9B4k085935; Fri, 20 May 2016 12:09:11 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KC9BN0085934; Fri, 20 May 2016 12:09:11 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605201209.u4KC9BN0085934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 20 May 2016 12:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300297 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 12:09:12 -0000 Author: ae Date: Fri May 20 12:09:10 2016 New Revision: 300297 URL: https://svnweb.freebsd.org/changeset/base/300297 Log: Remove ip6 pointer initialization and strange check from the beginning of ip6_output(). It isn't used until the first time adjusted. Remove the comment about adjusting where it is actually initialized. Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 20 11:56:16 2016 (r300296) +++ head/sys/netinet6/ip6_output.c Fri May 20 12:09:10 2016 (r300297) @@ -325,12 +325,6 @@ ip6_output(struct mbuf *m0, struct ip6_p struct m_tag *fwd_tag = NULL; uint32_t id; - ip6 = mtod(m, struct ip6_hdr *); - if (ip6 == NULL) { - printf ("ip6 is NULL"); - goto bad; - } - if (inp != NULL) { M_SETFIB(m, inp->inp_inc.inc_fibnum); if ((flags & IP_NODEFAULTFLOWID) == 0) { @@ -412,7 +406,6 @@ ip6_output(struct mbuf *m0, struct ip6_p hdrsplit++; } - /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); /* adjust mbuf packet header length */ From owner-svn-src-all@freebsd.org Fri May 20 12:17:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA03B422B2; Fri, 20 May 2016 12:17:41 +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 181DF1718; Fri, 20 May 2016 12:17:41 +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 u4KCHeqa088853; Fri, 20 May 2016 12:17:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KCHeeq088852; Fri, 20 May 2016 12:17:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605201217.u4KCHeeq088852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 20 May 2016 12:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300298 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 12:17:41 -0000 Author: ae Date: Fri May 20 12:17:40 2016 New Revision: 300298 URL: https://svnweb.freebsd.org/changeset/base/300298 Log: Remove ip6 adjusting from the place where pointer couldn't be changed. And add comment after calling PFIL hooks, where it could be changed. Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 20 12:09:10 2016 (r300297) +++ head/sys/netinet6/ip6_output.c Fri May 20 12:17:40 2016 (r300298) @@ -536,10 +536,6 @@ again: else ip6->ip6_hlim = V_ip6_defmcasthlim; } - - /* adjust pointer */ - ip6 = mtod(m, struct ip6_hdr *); - /* * Validate route against routing table additions; * a better/more specific route might have been added. @@ -798,6 +794,7 @@ again: error = pfil_run_hooks(&V_inet6_pfil_hook, &m, ifp, PFIL_OUT, inp); if (error != 0 || m == NULL) goto done; + /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); needfiblookup = 0; From owner-svn-src-all@freebsd.org Fri May 20 12:29:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46FF2B42714; Fri, 20 May 2016 12:29:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 171E21D64; Fri, 20 May 2016 12:29:08 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 9095FD7A17; Fri, 20 May 2016 12:29:08 +0000 (UTC) Date: Fri, 20 May 2016 13:29:07 +0100 From: Andrew Turner To: Wojciech Macek Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste , arm64-dev Subject: Re: svn commit: r299683 - in head/sys/arm64: arm64 include Message-ID: <20160520132907.187046d6@zapp> In-Reply-To: References: <201605131603.u4DG3oTl005654@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 12:29:09 -0000 On Fri, 20 May 2016 11:44:44 +0200 Wojciech Macek wrote: > Where can I find any details about how was this change tested or > reviewed? Apparently it breaks AHCI on armv8. Log below. > > Wojtek > > > mountroot> ufs:/dev/ada0s2 > > Trying to mount root from ufs:/dev/ada0s2 []... > > warning: no time-of-day clock registered, system time will not be > > set accurately > > Setting hostuuid: 701a2acc-d0a0-11e5-8550-001517169365. > > Setting hostid: 0x2abffeca. > > No suitable dump device was found. > > Starting file system checks: > > /dev/ada0s2: FILE SYSTEM CLEAN; SKIPPING CHECKS > > /dev/ada0s2: clean, 16575173 free (25325 frags, 2068731 blocks, 0.1% > > fragmentation) > > panic: unsupported combination of sync operations: 0x00000008 How were you getting into dma_dcache_sync? That should only happen when map->sync_count != 0, this should only be possible when the BF_COHERENT flag is set. This flag should never get set. Andrew From owner-svn-src-all@freebsd.org Fri May 20 12:38:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A23A1B42985; Fri, 20 May 2016 12:38:49 +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 7451E11A7; Fri, 20 May 2016 12:38:49 +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 u4KCcmkr094786; Fri, 20 May 2016 12:38:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KCcmC8094785; Fri, 20 May 2016 12:38:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605201238.u4KCcmC8094785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 20 May 2016 12:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300299 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 12:38:49 -0000 Author: andrew Date: Fri May 20 12:38:48 2016 New Revision: 300299 URL: https://svnweb.freebsd.org/changeset/base/300299 Log: Filter out BUS_DMASYNC_POSTWRITE sync operations, there is nothing for us to do on these. Reported by: wma Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Fri May 20 12:17:40 2016 (r300298) +++ head/sys/arm64/arm64/busdma_bounce.c Fri May 20 12:38:48 2016 (r300299) @@ -955,6 +955,9 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma struct sync_list *sl, *end; vm_offset_t datavaddr, tempvaddr; + if (op == BUS_DMASYNC_POSTWRITE) + return; + if ((op & BUS_DMASYNC_POSTREAD) != 0) { /* * Wait for any DMA operations to complete before the bcopy. From owner-svn-src-all@freebsd.org Fri May 20 13:11:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F4C2B430AC; Fri, 20 May 2016 13:11: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 170471395; Fri, 20 May 2016 13:11: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 u4KDB7OK006169; Fri, 20 May 2016 13:11:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KDB77w006168; Fri, 20 May 2016 13:11:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605201311.u4KDB77w006168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 20 May 2016 13:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300300 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 13:11:08 -0000 Author: andrew Date: Fri May 20 13:11:07 2016 New Revision: 300300 URL: https://svnweb.freebsd.org/changeset/base/300300 Log: Add more useful GICv3 register definitions. While here fix GITS_CBASER_CACHE_MASK to use the correct shift macro. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3_reg.h Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Fri May 20 12:38:48 2016 (r300299) +++ head/sys/arm64/arm64/gic_v3_reg.h Fri May 20 13:11:07 2016 (r300300) @@ -142,6 +142,8 @@ #define GICR_PROPBASER_CACHE_NIWAWB 0x5UL #define GICR_PROPBASER_CACHE_NIRAWAWT 0x6UL #define GICR_PROPBASER_CACHE_NIRAWAWB 0x7UL +#define GICR_PROPBASER_CACHE_MASK \ + (0x7UL << GICR_PROPBASER_CACHE_SHIFT) /* * Shareability @@ -179,6 +181,8 @@ #define GICR_PENDBASER_CACHE_NIWAWB 0x5UL #define GICR_PENDBASER_CACHE_NIRAWAWT 0x6UL #define GICR_PENDBASER_CACHE_NIRAWAWB 0x7UL +#define GICR_PENDBASER_CACHE_MASK \ + (0x7UL << GICR_PENDBASER_CACHE_SHIFT) /* * Shareability @@ -217,6 +221,26 @@ #define GITS_CTLR (0x0000) #define GITS_CTLR_EN (1 << 0) +#define GITS_IIDR (0x0004) +#define GITS_IIDR_PRODUCT_SHIFT 24 +#define GITS_IIDR_PRODUCT_MASK (0xff << GITS_IIDR_PRODUCT_SHIFT) +#define GITS_IIDR_VARIANT_SHIFT 16 +#define GITS_IIDR_VARIANT_MASK (0xf << GITS_IIDR_VARIANT_SHIFT) +#define GITS_IIDR_REVISION_SHIFT 12 +#define GITS_IIDR_REVISION_MASK (0xf << GITS_IIDR_REVISION_SHIFT) +#define GITS_IIDR_IMPLEMENTOR_SHIFT 0 +#define GITS_IIDR_IMPLEMENTOR_MASK (0xfff << GITS_IIDR_IMPLEMENTOR_SHIFT) + +#define GITS_IIDR_RAW(impl, prod, var, rev) \ + ((prod) << GITS_IIDR_PRODUCT_SHIFT | \ + (var) << GITS_IIDR_VARIANT_SHIFT | \ + (rev) << GITS_IIDR_REVISION_SHIFT | \ + (impl) << GITS_IIDR_IMPLEMENTOR_SHIFT) + +#define GITS_IIDR_IMPL_CAVIUM (0x34c) +#define GITS_IIDR_PROD_THUNDER (0xa1) +#define GITS_IIDR_VAR_THUNDER_1 (0x0) + #define GITS_CBASER (0x0080) #define GITS_CBASER_VALID (1UL << 63) /* @@ -239,7 +263,7 @@ #define GITS_CBASER_CACHE_NIWAWB 0x5UL #define GITS_CBASER_CACHE_NIRAWAWT 0x6UL #define GITS_CBASER_CACHE_NIRAWAWB 0x7UL -#define GITS_CBASER_CACHE_MASK (0x7UL << GITS_CBASER_TYPE_SHIFT) +#define GITS_CBASER_CACHE_MASK (0x7UL << GITS_CBASER_CACHE_SHIFT) /* * Shareability * 0x0 - Non-shareable From owner-svn-src-all@freebsd.org Fri May 20 14:36:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0758B4298C; Fri, 20 May 2016 14:36:50 +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 B2D0E1481; Fri, 20 May 2016 14:36:50 +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 u4KEanH7031013; Fri, 20 May 2016 14:36:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KEanoi031012; Fri, 20 May 2016 14:36:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605201436.u4KEanoi031012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 May 2016 14:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300301 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 14:36:51 -0000 Author: pfg Date: Fri May 20 14:36:49 2016 New Revision: 300301 URL: https://svnweb.freebsd.org/changeset/base/300301 Log: GCC: Add support for named initializers for anonymous structs/unions. This is a C11 feature that is starting to get used in places such as Mesa. This implementation takes a different approach to upstream and is therefore not covered by GPLv3. Obtained from: OpenBSD (CVS rev. 1.2) MFC after: 3 weeks Modified: head/contrib/gcc/c-typeck.c Modified: head/contrib/gcc/c-typeck.c ============================================================================== --- head/contrib/gcc/c-typeck.c Fri May 20 13:11:07 2016 (r300300) +++ head/contrib/gcc/c-typeck.c Fri May 20 14:36:49 2016 (r300301) @@ -6041,6 +6041,7 @@ set_init_index (tree first, tree last) void set_init_label (tree fieldname) { + tree anon = NULL_TREE; tree tail; if (set_designator (0)) @@ -6058,6 +6059,15 @@ set_init_label (tree fieldname) for (tail = TYPE_FIELDS (constructor_type); tail; tail = TREE_CHAIN (tail)) { + if (DECL_NAME (tail) == NULL_TREE + && (TREE_CODE (TREE_TYPE (tail)) == RECORD_TYPE + || TREE_CODE (TREE_TYPE (tail)) == UNION_TYPE)) + { + anon = lookup_field (tail, fieldname); + if (anon) + break; + } + if (DECL_NAME (tail) == fieldname) break; } From owner-svn-src-all@freebsd.org Fri May 20 14:54:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B561B42F4A; Fri, 20 May 2016 14:54:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 5BA8C1FCA; Fri, 20 May 2016 14:54:12 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 10341B977; Fri, 20 May 2016 10:54:11 -0400 (EDT) From: John Baldwin To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot Date: Fri, 20 May 2016 07:48:15 -0700 Message-ID: <1780135.VYYOsNudFi@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605200141.u4K1flpV094958@repo.freebsd.org> References: <201605200141.u4K1flpV094958@repo.freebsd.org> 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.2.7 (bigwig.baldwin.cx); Fri, 20 May 2016 10:54:11 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 14:54:12 -0000 On Friday, May 20, 2016 01:41:47 AM Allan Jude wrote: > Author: allanjude > Date: Fri May 20 01:41:47 2016 > New Revision: 300257 > URL: https://svnweb.freebsd.org/changeset/base/300257 > > Log: > Fixup the geliboot sector rounding code > > Replace all rounding with the round{up,down}2 macros > a missing set of braces caused the previous code to be incorrect > > replace alloca() with malloc() because alloca() can return an allocation > that is actually invalid, causing boot to fail No, you have to revert the malloc! malloc() can be anywhere. The alloca is _on purpose_ to get a bufer below 1MB so that it will work with all devices. Some BIOSes can only store data in the first 1MB. -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 20 15:00:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A79EFB42FDD; Fri, 20 May 2016 15:00:13 +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 752BA11D7; Fri, 20 May 2016 15:00:13 +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 u4KF0CfK037145; Fri, 20 May 2016 15:00:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KF0Cri037144; Fri, 20 May 2016 15:00:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605201500.u4KF0Cri037144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 20 May 2016 15:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300302 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:00:13 -0000 Author: ae Date: Fri May 20 15:00:12 2016 New Revision: 300302 URL: https://svnweb.freebsd.org/changeset/base/300302 Log: Fix the regression introduced in r300143. When we are creating new dynamic state use MATCH_FORWARD direction to correctly initialize protocol's state. Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri May 20 14:36:49 2016 (r300301) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri May 20 15:00:12 2016 (r300302) @@ -687,7 +687,7 @@ ipfw_install_state(struct ip_fw_chain *c ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg) { ipfw_dyn_rule *q; - int i, dir; + int i; DEB(print_dyn_rule(&args->f_id, cmd->o.opcode, "install_state", "");) @@ -695,7 +695,7 @@ ipfw_install_state(struct ip_fw_chain *c IPFW_BUCK_LOCK(i); - q = lookup_dyn_rule_locked(&args->f_id, i, &dir, NULL); + q = lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL); if (q != NULL) { /* should never occur */ DEB( if (last_log != time_uptime) { @@ -816,7 +816,7 @@ ipfw_install_state(struct ip_fw_chain *c return (1); /* Notify caller about failure */ } - dyn_update_proto_state(q, &args->f_id, NULL, dir); + dyn_update_proto_state(q, &args->f_id, NULL, MATCH_FORWARD); IPFW_BUCK_UNLOCK(i); return (0); } From owner-svn-src-all@freebsd.org Fri May 20 15:00:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D65FB43052; Fri, 20 May 2016 15:00:24 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id E6CDE1334; Fri, 20 May 2016 15:00:23 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 112FDD45F; Fri, 20 May 2016 15:00:23 +0000 (UTC) Subject: Re: svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot To: John Baldwin References: <201605200141.u4K1flpV094958@repo.freebsd.org> <1780135.VYYOsNudFi@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <573F2686.20509@freebsd.org> Date: Fri, 20 May 2016 11:00:22 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1780135.VYYOsNudFi@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:00:24 -0000 On 2016-05-20 10:48, John Baldwin wrote: > On Friday, May 20, 2016 01:41:47 AM Allan Jude wrote: >> Author: allanjude >> Date: Fri May 20 01:41:47 2016 >> New Revision: 300257 >> URL: https://svnweb.freebsd.org/changeset/base/300257 >> >> Log: >> Fixup the geliboot sector rounding code >> >> Replace all rounding with the round{up,down}2 macros >> a missing set of braces caused the previous code to be incorrect >> >> replace alloca() with malloc() because alloca() can return an allocation >> that is actually invalid, causing boot to fail > > No, you have to revert the malloc! malloc() can be anywhere. The alloca > is _on purpose_ to get a bufer below 1MB so that it will work with all > devices. Some BIOSes can only store data in the first 1MB. > to be clear, the alloca() was something I added, not something that was there before. And it was breaking, because ZFS was trying to allocate too large a block of memory, that wouldn't fit below 1MB. -- Allan Jude From owner-svn-src-all@freebsd.org Fri May 20 15:04:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1A7B432CA; Fri, 20 May 2016 15:04:49 +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 AC9641A33; Fri, 20 May 2016 15:04:49 +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 u4KF4mQF040107; Fri, 20 May 2016 15:04:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KF4m9n040101; Fri, 20 May 2016 15:04:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605201504.u4KF4m9n040101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 20 May 2016 15:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300303 - in head: . contrib/netbsd-tests/lib/libc/gen contrib/netbsd-tests/lib/libc/sys lib/libc/aarch64 lib/libc/aarch64/sys 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:04:50 -0000 Author: andrew Date: Fri May 20 15:04:48 2016 New Revision: 300303 URL: https://svnweb.freebsd.org/changeset/base/300303 Log: Remove brk and sbrk from arm64. They were defined in The Single UNIX Specification, Version 2, but marked as legacy, and have been removed from later specifications. After 12 years it is time to remove them from new architectures when the main use for sbrk is an invalid method to attempt to find how much memory has been allocated from malloc. There are a few places in the tree that still call sbrk, however they are not used on arm64. They will need to be fixed to cross build from arm64, but these will be fixed in a follow up commit. Old copies of binutils from ports called into sbrk, however this has been fixed around 6 weeks ago. It is advised to update binutils on arm64 before installing a world that includes this change. Reviewed by: brooks, emaste Obtained from: brooks Relnotes: yes Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D6464 Deleted: head/lib/libc/aarch64/sys/brk.S head/lib/libc/aarch64/sys/sbrk.S Modified: head/UPDATING head/contrib/netbsd-tests/lib/libc/gen/t_dir.c head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c head/lib/libc/aarch64/Symbol.map head/lib/libc/aarch64/sys/Makefile.inc head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri May 20 15:00:12 2016 (r300302) +++ head/UPDATING Fri May 20 15:04:48 2016 (r300303) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160520: + The brk and sbrk functions have been removed from libc on arm64. + Binutils from ports has been updated to not link to these + functions and should be updated to the latest version before + installing a new libc. + 20160517: The armv6 port now defaults to hard float ABI. Limited support for running both hardfloat and soft float on the same system Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Fri May 20 15:00:12 2016 (r300302) +++ head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Fri May 20 15:04:48 2016 (r300303) @@ -111,6 +111,7 @@ ATF_TC_BODY(seekdir_basic, tc) closedir(dp); } +#ifndef __aarch64__ /* There is no sbrk on AArch64 */ ATF_TC(telldir_leak); ATF_TC_HEAD(telldir_leak, tc) { @@ -154,12 +155,15 @@ ATF_TC_BODY(telldir_leak, tc) (void)printf("OK: used %td bytes\n", (char *)(sbrk(0))-memused); } } +#endif ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, seekdir_basic); +#ifndef __aarch64__ ATF_TP_ADD_TC(tp, telldir_leak); +#endif return atf_no_error(); } Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Fri May 20 15:00:12 2016 (r300302) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Fri May 20 15:04:48 2016 (r300303) @@ -176,7 +176,9 @@ ATF_TC_BODY(mlock_err, tc) unsigned long vmin = 0; size_t len = sizeof(vmin); #endif +#ifndef __aarch64__ void *invalid_ptr; +#endif int null_errno = ENOMEM; /* error expected for NULL */ #ifdef __FreeBSD__ @@ -212,6 +214,7 @@ ATF_TC_BODY(mlock_err, tc) errno = 0; ATF_REQUIRE_ERRNO(EINVAL, munlock((char *)-1, page) == -1); +#ifndef __aarch64__ /* There is no sbrk on AArch64 */ /* * Try to create a pointer to an unmapped page - first after current * brk will likely do. @@ -224,6 +227,7 @@ ATF_TC_BODY(mlock_err, tc) errno = 0; ATF_REQUIRE_ERRNO(ENOMEM, munlock(invalid_ptr, page) == -1); +#endif } #ifdef __FreeBSD__ Modified: head/lib/libc/aarch64/Symbol.map ============================================================================== --- head/lib/libc/aarch64/Symbol.map Fri May 20 15:00:12 2016 (r300302) +++ head/lib/libc/aarch64/Symbol.map Fri May 20 15:04:48 2016 (r300303) @@ -28,8 +28,6 @@ FBSD_1.0 { ntohl; ntohs; vfork; - brk; - sbrk; makecontext; }; Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Fri May 20 15:00:12 2016 (r300302) +++ head/lib/libc/aarch64/sys/Makefile.inc Fri May 20 15:04:48 2016 (r300303) @@ -5,10 +5,8 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c #MDASM= ptrace.S -MDASM= brk.S \ - cerror.S \ +MDASM= cerror.S \ pipe.S \ - sbrk.S \ shmat.S \ sigreturn.S \ syscall.S \ @@ -19,6 +17,7 @@ NOASM= break.o \ exit.o \ getlogin.o \ openbsd_poll.o \ + sbrk.o \ sstk.o \ vfork.o \ yield.o Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 20 15:00:12 2016 (r300302) +++ head/sys/sys/param.h Fri May 20 15:04:48 2016 (r300303) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100110 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100111 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri May 20 15:14:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6540B434A5; Fri, 20 May 2016 15:14:39 +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 725821F7B; Fri, 20 May 2016 15:14:39 +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 u4KFEcj8043050; Fri, 20 May 2016 15:14:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KFEcYD043049; Fri, 20 May 2016 15:14:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605201514.u4KFEcYD043049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 May 2016 15:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300304 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:14:39 -0000 Author: pfg Date: Fri May 20 15:14:38 2016 New Revision: 300304 URL: https://svnweb.freebsd.org/changeset/base/300304 Log: gas/config/tc-arm.c: Minor re-sorting to match upstream history. No functional change. MFC after: 2 weeks Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Fri May 20 15:04:48 2016 (r300303) +++ head/contrib/binutils/gas/config/tc-arm.c Fri May 20 15:14:38 2016 (r300304) @@ -3837,10 +3837,10 @@ s_arm_eabi_attribute (int ignored ATTRIB #endif /* OBJ_ELF */ static void s_arm_arch (int); -static void s_arm_arch_extension (int); static void s_arm_object_arch (int); static void s_arm_cpu (int); static void s_arm_fpu (int); +static void s_arm_arch_extension (int); #ifdef TE_PE @@ -3892,9 +3892,9 @@ const pseudo_typeS md_pseudo_table[] = { "syntax", s_syntax, 0 }, { "cpu", s_arm_cpu, 0 }, { "arch", s_arm_arch, 0 }, - { "arch_extension", s_arm_arch_extension, 0 }, { "object_arch", s_arm_object_arch, 0 }, { "fpu", s_arm_fpu, 0 }, + { "arch_extension", s_arm_arch_extension, 0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, From owner-svn-src-all@freebsd.org Fri May 20 15:32:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BBA1B43A8F; Fri, 20 May 2016 15:32:49 +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 6D0FF1B15; Fri, 20 May 2016 15:32:49 +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 u4KFWmWF049087; Fri, 20 May 2016 15:32:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KFWmMB049086; Fri, 20 May 2016 15:32:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605201532.u4KFWmMB049086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 May 2016 15:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300305 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:32:49 -0000 Author: kib Date: Fri May 20 15:32:48 2016 New Revision: 300305 URL: https://svnweb.freebsd.org/changeset/base/300305 Log: Use unsigned type for the loop index to make overflow checks effective. PR: 209661 Reported by: cturt Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Fri May 20 15:14:38 2016 (r300304) +++ head/sys/amd64/amd64/sys_machdep.c Fri May 20 15:32:48 2016 (r300305) @@ -333,11 +333,12 @@ amd64_set_ioperm(td, uap) struct thread *td; struct i386_ioperm_args *uap; { - int i, error; char *iomap; struct amd64tss *tssp; struct system_segment_descriptor *tss_sd; struct pcb *pcb; + u_int i; + int error; if ((error = priv_check(td, PRIV_IO)) != 0) return (error); From owner-svn-src-all@freebsd.org Fri May 20 15:34:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 009DEB43B9D; Fri, 20 May 2016 15:34:05 +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 C610F1DA8; Fri, 20 May 2016 15:34:04 +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 u4KFY4Ob049204; Fri, 20 May 2016 15:34:04 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KFY33S049203; Fri, 20 May 2016 15:34:03 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201605201534.u4KFY33S049203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 20 May 2016 15:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300306 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:34:05 -0000 Author: rwatson Date: Fri May 20 15:34:03 2016 New Revision: 300306 URL: https://svnweb.freebsd.org/changeset/base/300306 Log: Garbage collect unused prototype for clockintr(). MFC after: 3 days Modified: head/sys/mips/include/clock.h Modified: head/sys/mips/include/clock.h ============================================================================== --- head/sys/mips/include/clock.h Fri May 20 15:32:48 2016 (r300305) +++ head/sys/mips/include/clock.h Fri May 20 15:34:03 2016 (r300306) @@ -17,8 +17,6 @@ extern int cpu_clock; -extern uint32_t clockintr(uint32_t, struct trapframe *); - #define wall_cmos_clock 0 #define adjkerntz 0 From owner-svn-src-all@freebsd.org Fri May 20 15:41:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C4E9B43F6D; Fri, 20 May 2016 15:41:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D51F131C; Fri, 20 May 2016 15:41:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KFf5SR049587; Fri, 20 May 2016 15:41:05 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KFf59M049586; Fri, 20 May 2016 15:41:05 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201605201541.u4KFf59M049586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 20 May 2016 15:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300307 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:41:06 -0000 Author: kp Date: Fri May 20 15:41:05 2016 New Revision: 300307 URL: https://svnweb.freebsd.org/changeset/base/300307 Log: pf: Fix fragment timeout We were inconsistent about the use of time_second vs. time_uptime. Always use time_uptime so the value can be meaningfully compared. Submitted by: "Max" MFC after: 4 days Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri May 20 15:34:03 2016 (r300306) +++ head/sys/netpfil/pf/pf_norm.c Fri May 20 15:41:05 2016 (r300307) @@ -374,7 +374,7 @@ pf_fillup_fragment(struct pf_fragment_cm } *(struct pf_fragment_cmp *)frag = *key; - frag->fr_timeout = time_second; + frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; TAILQ_INIT(&frag->fr_queue); From owner-svn-src-all@freebsd.org Fri May 20 15:43:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A20B6B44111; Fri, 20 May 2016 15:43:52 +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 7265B1863; Fri, 20 May 2016 15:43:52 +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 u4KFhpPd052297; Fri, 20 May 2016 15:43:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KFhpBl052296; Fri, 20 May 2016 15:43:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605201543.u4KFhpBl052296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 20 May 2016 15:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300308 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:43:52 -0000 Author: andrew Date: Fri May 20 15:43:51 2016 New Revision: 300308 URL: https://svnweb.freebsd.org/changeset/base/300308 Log: Extract the correct bits from the GICD_TYPER register. The interrupt count is encoded in the bottom 5 bits. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3_reg.h Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Fri May 20 15:41:05 2016 (r300307) +++ head/sys/arm64/arm64/gic_v3_reg.h Fri May 20 15:43:51 2016 (r300308) @@ -67,7 +67,7 @@ #define GICD_TYPER (0x0004) #define GICD_TYPER_IDBITS(n) ((((n) >> 19) & 0x1F) + 1) -#define GICD_TYPER_I_NUM(n) ((((n) & 0xF1) + 1) * 32) +#define GICD_TYPER_I_NUM(n) ((((n) & 0x1F) + 1) * 32) #define GICD_ISENABLER(n) (0x0100 + (((n) >> 5) * 4)) #define GICD_I_PER_ISENABLERn (32) From owner-svn-src-all@freebsd.org Fri May 20 15:59:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45821B44518; Fri, 20 May 2016 15:59:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::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 1104010F3; Fri, 20 May 2016 15:59:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id t40so58745321ioi.0; Fri, 20 May 2016 08:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=8U/K1UFQFg3LYyvL4nx9loIlcwqbDR95MaMUOIRCqR4=; b=ADa/ry/+PWJpHQqCccOlLJwwRAVq2zxDHfi7iIrBsZu04KUUSXWdQm6rgpwTQsuVj4 h/q+kQOjjsWC63PGDSZqQfr+eaiiU3tXSjSEk8C4XO3CB/7U72oLdXu5AWV2eNZ3yaZz 72cyC2tpCJM/W8r3b1TlxEGJ3GO8n8Q0G4odqx+9aLBuwLu+vz8OQ+NWOuWEtLQ2Cb3x aNzc/+5Qn+ZBRWpJGNEOsch+T8Q3IARevHwZdcTo7IR4TG6P7/A18T1c+kG0imf8daur 3g/6aqZGxVDUqSLNlxDgyG736eVk+6NyQ5A9HOg4Ikgmwajh1rTgOw+hvuXOOLFIXAy9 k/LA== 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:date :message-id:subject:from:to:cc; bh=8U/K1UFQFg3LYyvL4nx9loIlcwqbDR95MaMUOIRCqR4=; b=HEyy0Pfhk1GRGCeMsE7ui9i12oAxqGUIUjDTHiDGwhYIxGfcCqk0zUPZjNUpF5iaJN cqbcg7IiQAGub8mUqIhhZb2jc0xj8OH87lSFkjHvN7CLmDqKo76cPlrwWwkK5gO4sWYB 2uytotZ1HpeGdqGdbNO56RVDCdoYpyHKgNQsZA+zi4K9iy3cYzKvI4ZvklsrpvLB6P/J gF/klZeMlw6X8+BNXd/g3qOqgq5xXVCiA7k58wM40uOzB+rNEACI+DddfC+7v9GdMKp4 MXWZUropjg0c3e4ZdIHcMkk97FGTjQL68hTa9JfGyYIS77uh/Rh5IYj5dF51+xmUjxHG 150A== X-Gm-Message-State: AOPr4FVCFM2M0/AlmMHt79l2ihAcg3taJybvaq8DTsQSxcICK5ctIPOMMw5zwTDb0lYiiFCzQbV7YTajpmNpcQ== MIME-Version: 1.0 X-Received: by 10.36.81.79 with SMTP id s76mr3373240ita.71.1463759963318; Fri, 20 May 2016 08:59:23 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Fri, 20 May 2016 08:59:23 -0700 (PDT) In-Reply-To: <573F2686.20509@freebsd.org> References: <201605200141.u4K1flpV094958@repo.freebsd.org> <1780135.VYYOsNudFi@ralph.baldwin.cx> <573F2686.20509@freebsd.org> Date: Fri, 20 May 2016 08:59:23 -0700 Message-ID: Subject: Re: svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot From: Adrian Chadd To: Allan Jude Cc: John Baldwin , "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 15:59:24 -0000 Right, but if you hand that malloc() pointer to any BIOS int calls, it's highly likely it won't work right. :) -a On 20 May 2016 at 08:00, Allan Jude wrote: > On 2016-05-20 10:48, John Baldwin wrote: >> On Friday, May 20, 2016 01:41:47 AM Allan Jude wrote: >>> Author: allanjude >>> Date: Fri May 20 01:41:47 2016 >>> New Revision: 300257 >>> URL: https://svnweb.freebsd.org/changeset/base/300257 >>> >>> Log: >>> Fixup the geliboot sector rounding code >>> >>> Replace all rounding with the round{up,down}2 macros >>> a missing set of braces caused the previous code to be incorrect >>> >>> replace alloca() with malloc() because alloca() can return an allocation >>> that is actually invalid, causing boot to fail >> >> No, you have to revert the malloc! malloc() can be anywhere. The alloca >> is _on purpose_ to get a bufer below 1MB so that it will work with all >> devices. Some BIOSes can only store data in the first 1MB. >> > > to be clear, the alloca() was something I added, not something that was > there before. And it was breaking, because ZFS was trying to allocate > too large a block of memory, that wouldn't fit below 1MB. > > -- > Allan Jude > From owner-svn-src-all@freebsd.org Fri May 20 16:19:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD9E1B449FA; Fri, 20 May 2016 16:19:59 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA2E1D1C; Fri, 20 May 2016 16:19:59 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KGJwoM061491; Fri, 20 May 2016 16:19:58 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KGJvNZ061471; Fri, 20 May 2016 16:19:57 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201605201619.u4KGJvNZ061471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 20 May 2016 16:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r300309 - in vendor/NetBSD/bmake/dist: . mk mk/sys X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 16:19:59 -0000 Author: sjg Date: Fri May 20 16:19:56 2016 New Revision: 300309 URL: https://svnweb.freebsd.org/changeset/base/300309 Log: Import bmake-20160512 Interesting changes (from ChangeLog): o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS this is useful for gcov builds. o propagate errors from filemon(4). o meta.c: apply realpath() before matching against metaIgnorePaths o allow makefile to set .MAKE.JOBS Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/arch.c vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/meta.h vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/auto.dep.mk vendor/NetBSD/bmake/dist/mk/autodep.mk vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/dpadd.mk vendor/NetBSD/bmake/dist/mk/final.mk vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/init.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/libnames.mk vendor/NetBSD/bmake/dist/mk/meta.autodep.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/nls.mk vendor/NetBSD/bmake/dist/mk/own.mk vendor/NetBSD/bmake/dist/mk/prog.mk vendor/NetBSD/bmake/dist/mk/subdir.mk vendor/NetBSD/bmake/dist/mk/sys.mk vendor/NetBSD/bmake/dist/mk/sys/AIX.mk vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk vendor/NetBSD/bmake/dist/mk/sys/Generic.mk vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk vendor/NetBSD/bmake/dist/mk/sys/Linux.mk vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk vendor/NetBSD/bmake/dist/mk/warnings.mk vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/str.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/ChangeLog Fri May 20 16:19:56 2016 (r300309) @@ -1,3 +1,26 @@ +2016-05-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160512 + Merge with NetBSD make, pick up + o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS + this is useful for gcov builds. + o propagate errors from filemon(4). + +2016-05-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160509 + Merge with NetBSD make, pick up + o remove use of non-standard types u_int etc. + o meta.c: apply realpath() before matching against metaIgnorePaths + +2016-04-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160404 + Merge with NetBSD make, pick up + o allow makefile to set .MAKE.JOBS + + * Makefile (PROG_NAME): use ${_MAKE_VERSION} + 2016-03-15 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160315 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/Makefile Fri May 20 16:19:56 2016 (r300309) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.58 2016/03/15 23:39:12 sjg Exp $ +# $Id: Makefile,v 1.63 2016/05/12 20:34:46 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160315 +_MAKE_VERSION= 20160512 PROG= bmake @@ -131,9 +131,9 @@ OPTIONS_DEFAULT_NO+= \ .include .if ${MK_PROG_VERSION} == "yes" -PROG_NAME= ${PROG}-${MAKE_VERSION} +PROG_NAME= ${PROG}-${_MAKE_VERSION} .if ${MK_PROG_LINK} == "yes" -SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG} +SYMLINKS+= ${PROG_NAME} ${BINDIR}/${PROG} .endif .endif Modified: vendor/NetBSD/bmake/dist/arch.c ============================================================================== --- vendor/NetBSD/bmake/dist/arch.c Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/arch.c Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"); #endif #endif /* not lint */ #endif @@ -832,7 +832,7 @@ ArchSVR4Entry(Arch *ar, char *name, size } if (DEBUG(ARCH)) { fprintf(debug_file, "Found svr4 archive name table with %lu entries\n", - (u_long)entry); + (unsigned long)entry); } return 0; } @@ -850,7 +850,7 @@ ArchSVR4Entry(Arch *ar, char *name, size if (entry >= ar->fnamesize) { if (DEBUG(ARCH)) { fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n", - name, (u_long)ar->fnamesize); + name, (unsigned long)ar->fnamesize); } return 2; } Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/bmake.1 Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ +.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 19, 2016 +.Dd May 10, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -913,6 +913,9 @@ Provides a list of path prefixes that sh because the contents are expected to change over time. The default list includes: .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp +.It Va .MAKE.META.IGNORE_PATTERNS +Provides a list of patterns to match against pathnames. +Ignore any that match. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: Modified: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Fri May 20 16:19:56 2016 (r300309) @@ -586,6 +586,10 @@ VVAARRIIAABBLLEE AASSSSIIGG The default list includes: `_/_d_e_v _/_e_t_c _/_p_r_o_c _/_t_m_p _/_v_a_r_/_r_u_n _/_v_a_r_/_t_m_p' + _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___P_A_T_T_E_R_N_S + Provides a list of patterns to match against pathnames. + Ignore any that match. + _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -1471,4 +1475,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 February 19, 2016 NetBSD 5.1 +NetBSD 5.1 May 10, 2016 NetBSD 5.1 Modified: vendor/NetBSD/bmake/dist/compat.c ============================================================================== --- vendor/NetBSD/bmake/dist/compat.c Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/compat.c Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -586,7 +586,8 @@ Compat_Make(void *gnp, void *pgnp) } #ifdef USE_META if (useMeta && !NoExecute(gn)) { - meta_job_finish(NULL); + if (meta_job_finish(NULL) != 0) + gn->made = ERROR; } #endif Modified: vendor/NetBSD/bmake/dist/job.c ============================================================================== --- vendor/NetBSD/bmake/dist/job.c Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/job.c Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1056,7 +1056,11 @@ JobFinish (Job *job, WAIT_T status) #ifdef USE_META if (useMeta) { - meta_job_finish(job); + int x; + + if ((x = meta_job_finish(job)) != 0 && status == 0) { + status = x; + } } #endif Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/main.c Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.242 2016/03/07 21:45:43 christos Exp $ */ +/* $NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.242 2016/03/07 21:45:43 christos Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.242 2016/03/07 21:45:43 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1152,14 +1152,6 @@ main(int argc, char **argv) } /* - * Be compatible if user did not specify -j and did not explicitly - * turned compatibility on - */ - if (!compatMake && !forceJobs) { - compatMake = TRUE; - } - - /* * Initialize archive, target and suffix modules in preparation for * parsing the makefile(s) */ @@ -1275,6 +1267,36 @@ main(int argc, char **argv) Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL); free(p1); + if (!forceJobs && !compatMake && + Var_Exists(".MAKE.JOBS", VAR_GLOBAL)) { + char *value; + int n; + + value = Var_Subst(NULL, "${.MAKE.JOBS}", VAR_GLOBAL, VARF_WANTRES); + n = strtol(value, NULL, 0); + if (n < 1) { + (void)fprintf(stderr, "%s: illegal value for .MAKE.JOBS -- must be positive integer!\n", + progname); + exit(1); + } + if (n != maxJobs) { + Var_Append(MAKEFLAGS, "-j", VAR_GLOBAL); + Var_Append(MAKEFLAGS, value, VAR_GLOBAL); + } + maxJobs = n; + maxJobTokens = maxJobs; + forceJobs = TRUE; + free(value); + } + + /* + * Be compatible if user did not specify -j and did not explicitly + * turned compatibility on + */ + if (!compatMake && !forceJobs) { + compatMake = TRUE; + } + if (!compatMake) Job_ServerStart(maxJobTokens, jp_0, jp_1); if (DEBUG(JOB)) Modified: vendor/NetBSD/bmake/dist/make.1 ============================================================================== --- vendor/NetBSD/bmake/dist/make.1 Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/make.1 Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ +.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 19, 2016 +.Dd May 10, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -913,6 +913,9 @@ Provides a list of path prefixes that sh because the contents are expected to change over time. The default list includes: .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp +.It Va .MAKE.META.IGNORE_PATTERNS +Provides a list of patterns to match against pathnames. +Ignore any that match. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/meta.c Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.54 2016/03/11 07:01:21 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.57 2016/05/12 20:28:34 sjg Exp $ */ /* * Implement 'meta' mode. @@ -66,6 +66,9 @@ static char *metaIgnorePathsStr; /* stri #ifndef MAKE_META_IGNORE_PATHS #define MAKE_META_IGNORE_PATHS ".MAKE.META.IGNORE_PATHS" #endif +#ifndef MAKE_META_IGNORE_PATTERNS +#define MAKE_META_IGNORE_PATTERNS ".MAKE.META.IGNORE_PATTERNS" +#endif Boolean useMeta = FALSE; static Boolean useFilemon = FALSE; @@ -73,6 +76,7 @@ static Boolean writeMeta = FALSE; static Boolean metaEnv = FALSE; /* don't save env unless asked */ static Boolean metaVerbose = FALSE; static Boolean metaIgnoreCMDs = FALSE; /* ignore CMDs in .meta files */ +static Boolean metaIgnorePatterns = FALSE; /* do we need to do pattern matches */ static Boolean metaCurdirOk = FALSE; /* write .meta in .CURDIR Ok? */ static Boolean metaSilent = FALSE; /* if we have a .meta be SILENT */ @@ -157,28 +161,33 @@ filemon_open(BuildMon *pbm) * Read the build monitor output file and write records to the target's * metadata file. */ -static void +static int filemon_read(FILE *mfp, int fd) { char buf[BUFSIZ]; int n; + int error; /* Check if we're not writing to a meta data file.*/ if (mfp == NULL) { if (fd >= 0) close(fd); /* not interested */ - return; + return 0; } /* rewind */ (void)lseek(fd, (off_t)0, SEEK_SET); + error = 0; fprintf(mfp, "\n-- filemon acquired metadata --\n"); while ((n = read(fd, buf, sizeof(buf))) > 0) { - fwrite(buf, 1, n, mfp); + if ((int)fwrite(buf, 1, n, mfp) < n) + error = EIO; } fflush(mfp); - close(fd); + if (close(fd) < 0) + error = errno; + return error; } #endif @@ -620,6 +629,15 @@ meta_mode_init(const char *make_mode) if (metaIgnorePathsStr) { str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr, NULL); } + + /* + * We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS} + */ + cp = NULL; + if (Var_Value(MAKE_META_IGNORE_PATTERNS, VAR_GLOBAL, &cp)) { + metaIgnorePatterns = TRUE; + free(cp); + } } /* @@ -744,27 +762,35 @@ meta_job_output(Job *job, char *cp, cons } } -void +int meta_cmd_finish(void *pbmp) { + int error = 0; #ifdef USE_FILEMON BuildMon *pbm = pbmp; + int x; if (!pbm) pbm = &Mybm; if (pbm->filemon_fd >= 0) { - close(pbm->filemon_fd); - filemon_read(pbm->mfp, pbm->mon_fd); + if (close(pbm->filemon_fd) < 0) + error = errno; + x = filemon_read(pbm->mfp, pbm->mon_fd); + if (error == 0 && x != 0) + error = x; pbm->filemon_fd = pbm->mon_fd = -1; } #endif + return error; } -void +int meta_job_finish(Job *job) { BuildMon *pbm; + int error = 0; + int x; if (job != NULL) { pbm = &job->bm; @@ -772,11 +798,14 @@ meta_job_finish(Job *job) pbm = &Mybm; } if (pbm->mfp != NULL) { - meta_cmd_finish(pbm); - fclose(pbm->mfp); + error = meta_cmd_finish(pbm); + x = fclose(pbm->mfp); + if (error == 0 && x != 0) + error = errno; pbm->mfp = NULL; pbm->meta_fname[0] = '\0'; } + return error; } void @@ -1209,14 +1238,35 @@ meta_oodate(GNode *gn, Boolean oodate) * be part of the dependencies because * they are _expected_ to change. */ - if (*p == '/' && - Lst_ForEach(metaIgnorePaths, prefix_match, p)) { + if (*p == '/') { + realpath(p, fname1); /* clean it up */ + if (Lst_ForEach(metaIgnorePaths, prefix_match, fname1)) { #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: ignoring: %s\n", - p); + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: ignoring path: %s\n", + p); #endif - break; + break; + } + } + + if (metaIgnorePatterns) { + char *pm; + + snprintf(fname1, sizeof(fname1), + "${%s:@m@${%s:L:M$m}@}", + MAKE_META_IGNORE_PATTERNS, p); + pm = Var_Subst(NULL, fname1, gn, VARF_WANTRES); + if (*pm) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: ignoring pattern: %s\n", + p); +#endif + free(pm); + break; + } + free(pm); } /* Modified: vendor/NetBSD/bmake/dist/meta.h ============================================================================== --- vendor/NetBSD/bmake/dist/meta.h Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/meta.h Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.h,v 1.4 2016/03/07 21:45:43 christos Exp $ */ +/* $NetBSD: meta.h,v 1.5 2016/05/12 20:28:34 sjg Exp $ */ /* * Things needed for 'meta' mode. @@ -48,8 +48,8 @@ void meta_job_start(struct Job *, GNode void meta_job_child(struct Job *); void meta_job_error(struct Job *, GNode *, int, int); void meta_job_output(struct Job *, char *, const char *); -void meta_cmd_finish(void *); -void meta_job_finish(struct Job *); +int meta_cmd_finish(void *); +int meta_job_finish(struct Job *); Boolean meta_oodate(GNode *, Boolean); void meta_compat_start(void); void meta_compat_child(void); Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Fri May 20 16:19:56 2016 (r300309) @@ -1,3 +1,57 @@ +2016-05-12 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160512 + + * dpadd.mk: always include local.dpadd.mk if it exists + remove some things that better belong in local.dpadd.mk + skip INCLUDES_* for staged libs unless SRC_* defined. + + * own.mk: add INCLUDEDIR + +2016-04-18 Simon J. Gerraty + + * dirdeps.mk: when doing -f dirdeps.mk if target suppies no + TARGET_MACHINE - :E will be empty or match part of path, use + ${MACHINE} + +2016-04-07 Simon J. Gerraty + + * meta.autodep.mk: issue a warning if UPDATE_DEPENDFILE=NO due to + NO_FILEMON_COOKIE + + * dirdeps.mk: move the logic that allows for + make -f dirdeps.mk some/dir.${TARGET_SPEC} + inside the check for !target(_DIRDEP_USE) + +2016-04-04 Simon J. Gerraty + + * Use <> when including local*.mk and others which may exist + elsewhere so that user can better control what they get. + + * meta.autodep.mk (NO_FILEMON_COOKIE): + create a cookie if we ever build dir with nofilemon + so that UPDATE_DEPENDFILE will be forced to NO until cleaned. + +2016-04-01 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160401 + + * meta2deps.py: fix old print statement when debugging. + + * gendirdeps.mk: META2DEPS_CMD append M2D_EXCLUDES with -X + patch from Bryan Drewery + +2016-03-22 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160317 (St. Pats) + + * warnings.mk: g++ does not like -Wimplicit + + * sys.mk sys/*.mk lib.mk prog.mk: use CXX_SUFFIXES to handle the + pelthora of common suffixes for C++ + + * lib.mk: use .So for shared objects + 2016-03-15 Simon J. Gerraty * install-mk (MK_VERSION): 20160315 Modified: vendor/NetBSD/bmake/dist/mk/auto.dep.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/auto.dep.mk Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/mk/auto.dep.mk Fri May 20 16:19:56 2016 (r300309) @@ -1,6 +1,6 @@ # # RCSid: -# $Id: auto.dep.mk,v 1.4 2016/02/18 21:16:39 sjg Exp $ +# $Id: auto.dep.mk,v 1.5 2016/04/05 15:58:37 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty # @@ -66,7 +66,7 @@ ${.MAKE.DEPENDFILE}: ${OBJS} ${POBJS} ${ .if empty(_SKIP_BUILD) _all_objs = ${OBJS} ${POBJS} ${SOBJS} .for d in ${_all_objs:M*o:T:O:u:%=%.d} -.dinclude "$d" +.dinclude <$d> .endfor .endif Modified: vendor/NetBSD/bmake/dist/mk/autodep.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/autodep.mk Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/mk/autodep.mk Fri May 20 16:19:56 2016 (r300309) @@ -1,6 +1,6 @@ # # RCSid: -# $Id: autodep.mk,v 1.34 2014/08/04 05:12:27 sjg Exp $ +# $Id: autodep.mk,v 1.36 2016/04/05 15:58:37 sjg Exp $ # # @(#) Copyright (c) 1999-2010, Simon J. Gerraty # @@ -25,7 +25,11 @@ __${.PARSEFILE}__: DEPENDFILE?= .depend .for d in ${DEPENDFILE:N.depend} # bmake only groks .depend -.-include "$d" +.if ${MAKE_VERSION} < 20160218 +.-include <$d> +.else +.dinclude <$d> +.endif .endfor # it does nothing if SRCS is not defined or is empty @@ -75,6 +79,9 @@ CXXFLAGS_MD=${CXXFLAGS:M-[IUD]*} ${CPPFL CC_MD?=${CC} CXX_MD?=${CXX} +# should have been set by sys.mk +CXX_SUFFIXES?= .cc .cpp .cxx .C + # so we can do an explicit make depend, but not otherwise .if make(depend) .SUFFIXES: .d @@ -100,7 +107,7 @@ CXX_MD?=${CXX} @echo updating dependencies for $< @${SHELL} -ec "${CC_MD} -M ${CPPFLAGS_MD} ${AINC} $< | sed '/:/s/^/$@ /' > $@" || { ${RM} -f $@; false; } -.cc.d .cpp.d .C.d .cxx.d: +${CXX_SUFFIXES:%=%.d}: @echo updating dependencies for $< @${SHELL} -ec "${CXX_MD} -M ${CXXFLAGS_MD} $< | sed '/:/s/^/$@ /' > $@" || { ${RM} -f $@; false; } .else @@ -120,7 +127,7 @@ CXX_MD?=${CXX} .s.d .S.d: ${CC_MD} ${CFLAGS_MD:S/D//} ${CPPFLAGS_MD} ${AINC} $< > $@ || { ${RM} -f $@; false; } -.cc.d .cpp.d .C.d .cxx.d: +${CXX_SUFFIXES:%=%.d}: ${CXX_MD} ${CFLAGS_MD:S/D//} ${CXXFLAGS_MD} $< > $@ || { ${RM} -f $@; false; } .endif Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $ +# $Id: dirdeps.mk,v 1.67 2016/04/18 21:50:47 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -121,6 +121,26 @@ _DIRDEP_USE_LEVEL?= 0 # and non-specific Makefile.depend* .if !target(_DIRDEP_USE) + +.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" +# This little trick let's us do +# +# mk -f dirdeps.mk some/dir.${TARGET_SPEC} +# +all: +${.TARGETS:Nall}: all +DIRDEPS := ${.TARGETS:M*[/.]*} +# so that -DNO_DIRDEPS works +DEP_RELDIR := ${DIRDEPS:[1]:R} +# this will become DEP_MACHINE below +TARGET_MACHINE := ${DIRDEPS:[1]:E:C/,.*//} +.if ${TARGET_MACHINE:N*/*} == "" +TARGET_MACHINE := ${MACHINE} +.endif +# disable DIRDEPS_CACHE as it does not like this trick +MK_DIRDEPS_CACHE = no +.endif + # make sure we get the behavior we expect .MAKE.SAVE_DOLLARS = no @@ -244,20 +264,6 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_tspec DEP_MACHINE := ${_DEP_TARGET_SPEC} .endif -.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" -# This little trick let's us do -# -# mk -f dirdeps.mk some/dir.${TARGET_SPEC} -# -all: -${.TARGETS:Nall}: all -DIRDEPS := ${.TARGETS:M*/*} -# so that -DNO_DIRDEPS works -DEP_RELDIR := ${DIRDEPS:R:[1]} -# disable DIRDEPS_CACHE as it does not like this trick -MK_DIRDEPS_CACHE = no -.endif - # reset each time through _build_all_dirs = @@ -284,7 +290,7 @@ _DEP_RELDIR := ${DEP_RELDIR} # pickup customizations # as below you can use !target(_DIRDEP_USE) to protect things # which should only be done once. -.-include "local.dirdeps.mk" +.-include .if !target(_DIRDEP_USE) # things we skip for host tools @@ -304,7 +310,13 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} -.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +.if defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +NO_DIRDEPS = +.elif defined(WITHOUT_DIRDEPS_BELOW) +NO_DIRDEPS_BELOW = +.endif + +.if defined(NO_DIRDEPS) # confine ourselves to the original dir and below. DIRDEPS_FILTER += M${_DEP_RELDIR}* .elif defined(NO_DIRDEPS_BELOW) @@ -370,7 +382,7 @@ MK_DIRDEPS_CACHE ?= no BUILD_DIRDEPS_CACHE ?= no BUILD_DIRDEPS ?= yes -.if !defined(NO_DIRDEPS) +.if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} == "yes" # this is where we will cache all our work DIRDEPS_CACHE?= ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} @@ -452,7 +464,7 @@ _this_dir := ${SRCTOP}/${DEP_RELDIR} # on rare occasions, there can be a need for extra help _dep_hack := ${_this_dir}/${.MAKE.DEPENDFILE_PREFIX}.inc -.-include "${_dep_hack}" +.-include <${_dep_hack}> .if ${DEP_RELDIR} != ${_DEP_RELDIR} || ${DEP_TARGET_SPEC} != ${TARGET_SPEC} # this should be all Modified: vendor/NetBSD/bmake/dist/mk/dpadd.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dpadd.mk Fri May 20 15:43:51 2016 (r300308) +++ vendor/NetBSD/bmake/dist/mk/dpadd.mk Fri May 20 16:19:56 2016 (r300309) @@ -1,4 +1,4 @@ -# $Id: dpadd.mk,v 1.19 2014/04/05 22:56:54 sjg Exp $ +# $Id: dpadd.mk,v 1.21 2016/05/18 20:54:55 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -21,71 +21,91 @@ __${.PARSEFILE}__: _OBJDIR?= ${.OBJDIR} _CURDIR?= ${.CURDIR} +.if ${_CURDIR} == ${SRCTOP} +RELDIR=. +RELTOP=. +.else +RELDIR?= ${_CURDIR:S,${SRCTOP}/,,} +.if ${RELDIR} == ${_CURDIR} +RELDIR?= ${_OBJDIR:S,${OBJTOP}/,,} +.endif +RELTOP?= ${RELDIR:C,[^/]+,..,g} +.endif +RELOBJTOP?= ${OBJTOP} +RELSRCTOP?= ${SRCTOP} + +# we get included just about everywhere so this is handy... +# C*DEBUG_XTRA are for defining on cmd line etc +# so do not use in makefiles. +.ifdef CFLAGS_DEBUG_XTRA +CFLAGS_LAST += ${CFLAGS_DEBUG_XTRA} +.endif +.ifdef CXXFLAGS_DEBUG_XTRA +CXXFLAGS_LAST += ${CXXFLAGS_DEBUG_XTRA} +.endif + +.-include + # DPLIBS helps us ensure we keep DPADD and LDADD in sync DPLIBS+= ${DPLIBS_LAST} -DPADD+= ${DPLIBS} +DPADD+= ${DPLIBS:N-*} .for __lib in ${DPLIBS:T:R} -LDADD+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} +.if "${_lib:M-*}" != "" +LDADD += ${__lib} +.else +LDADD += ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} +.endif .endfor # DPADD can contain things other than libs -__dpadd_libs = ${DPADD:M*/lib*} +__dpadd_libs := ${DPADD:M*/lib*} # some libs have dependencies... # DPLIBS_* allows bsd.libnames.mk to flag libs which must be included # in DPADD for a given library. -.for __lib in ${__dpadd_libs:@d@${DPLIBS_${d:T:R}}@} +# Gather all such dependencies into __ldadd_all_xtras +# dups will be dealt with later. +# Note: libfoo_pic uses DPLIBS_libfoo +__ldadd_all_xtras= +.for __lib in ${__dpadd_libs:@d@${DPLIBS_${d:T:R:S,_pic,,}}@} +__ldadd_all_xtras+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} .if "${DPADD:M${__lib}}" == "" DPADD+= ${__lib} -LDADD+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} .endif .endfor # Last of all... for libc and libgcc DPADD+= ${DPADD_LAST} +# de-dupuplicate __ldadd_all_xtras into __ldadd_xtras +# in reverse order so that libs end up listed after all that needed them. +__ldadd_xtras= +.for __lib in ${__ldadd_all_xtras:[-1..1]} +.if "${__ldadd_xtras:M${__lib}}" == "" || ${NEED_IMPLICIT_LDADD:tl:Uno} != "no" +__ldadd_xtras+= ${__lib} +.endif +.endfor + +.if !empty(__ldadd_xtras) +# now back to the original order +__ldadd_xtras:= ${__ldadd_xtras:[-1..1]} +LDADD+= ${__ldadd_xtras} +.endif + # Convert DPADD into -I and -L options and add them to CPPFLAGS and LDADD # For the -I's convert the path to a relative one. For separate objdirs # the DPADD paths will be to the obj tree so we need to subst anyway. -# If USE_PROFILE is yes, then check for profiled versions of libs -# and use them. - -USE_PROFILE?=no -.if defined(LIBDL) && exists(${LIBDL}) -.if defined(PROG) && (make(${PROG}_p) || ${USE_PROFILE} == yes) && \ - defined(LDFLAGS) && ${LDFLAGS:M-export-dynamic} -# building profiled version of a prog that needs dlopen to work -DPLIBS+= ${LIBDL} -.endif -.endif - -.if defined(LIBDMALLOC) && exists(${LIBDMALLOC}) -.if defined(USE_DMALLOC) && ${USE_DMALLOC} != no -.if !defined(NO_DMALLOC) -CPPFLAGS+= -DUSE_DMALLOC -.endif -DPLIBS+= ${LIBDMALLOC} -.endif -.endif +# update this +__dpadd_libs := ${DPADD:M*/lib*} # Order -L's to search ours first. # Avoids picking up old versions already installed. -__dpadd_libdirs := ${__dpadd_libs:R:H:S/^/-L/g:O:u:N-L} +__dpadd_libdirs := ${__dpadd_libs}:R:H:S/^/-L/g:O:u:N-L} LDADD += ${__dpadd_libdirs:M-L${OBJTOP}/*} -LDADD += ${__dpadd_libdirs:N-L${OBJTOP}/*} - -.if ${.CURDIR} == ${SRCTOP} -RELDIR=. -RELTOP=. -.else -RELDIR?= ${.CURDIR:S,${SRCTOP}/,,} -.if ${RELDIR} == ${.CURDIR} -RELDIR?= ${.OBJDIR:S,${OBJTOP}/,,} +LDADD += ${__dpadd_libdirs:N-L${OBJTOP}/*:N-L${HOST_LIBDIR:U/usr/lib}} +.if defined(HOST_LIBDIR) && ${HOST_LIBDIR} != "/usr/lib" +LDADD+= -L${HOST_LIBDIR} .endif -RELTOP?= ${RELDIR:C,[^/]+,..,g} -.endif -RELOBJTOP?= ${OBJTOP} -RELSRCTOP?= ${SRCTOP} .if !make(dpadd) .ifdef LIB @@ -109,7 +129,8 @@ __dpadd_libs += ${SRC_LIBS} DPMAGIC_LIBS += ${__dpadd_libs} \ ${__dpadd_libs:@d@${DPMAGIC_LIBS_${d:T:R}}@} -.for __lib in ${DPMAGIC_LIBS:O:u} +# we skip this for staged libs +.for __lib in ${DPMAGIC_LIBS:O:u:N${STAGE_OBJTOP:Unot}*/lib/*} # # if SRC_libfoo is not set, then we assume that the srcdir corresponding # to where we found the library is correct. @@ -127,6 +148,35 @@ INCLUDES_${__lib:T:R}?= -I${exists(${SRC .endfor +# even for staged libs we sometimes +# need to allow direct -I to avoid cicular dependencies +.for __lib in ${DPMAGIC_LIBS:O:u:T:R} +.if !empty(SRC_${__lib}) && empty(INCLUDES_${__lib}) +# must be a staged lib +.if exists(${SRC_${__lib}}/h) +INCLUDES_${__lib} = -I${SRC_${__lib}}/h +.else +INCLUDES_${__lib} = -I${SRC_${__lib}} +.endif +.endif +.endfor + +# when linking a shared lib, avoid non pic libs +SHLDADD+= ${LDADD:N-[lL]*} +.for __lib in ${__dpadd_libs:u} +.if defined(SHLIB_NAME) && ${LDADD:M-l${__lib:T:R:S,lib,,}} != "" +.if ${__lib:T:N*_pic.a:N*.so} == "" || exists(${__lib:R}.so) +SHLDADD+= -l${__lib:T:R:S,lib,,} +.elif exists(${__lib:R}_pic.a) +SHLDADD+= -l${__lib:T:R:S,lib,,}_pic +.else +.warning ${RELDIR}.${TARGET_SPEC} needs ${__lib:T:R}_pic.a +SHLDADD+= -l${__lib:T:R:S,lib,,} +.endif +SHLDADD+= -L${__lib:H} +.endif +.endfor + # Now for the bits we actually need __dpadd_incs= .for __lib in ${__dpadd_libs:u} @@ -134,20 +184,25 @@ __dpadd_incs= __ldadd=-l${__lib:T:R:S,lib,,} LDADD := ${LDADD:S,^${__ldadd}$,${__ldadd}_p,g} .endif +.endfor # -# Some libs generate headers, so we potentially need both -# the src dir and the obj dir. -# If ${INCLUDES_libfoo} contains a word ending in /h, we assume that either -# 1. it does not generate headers or -# 2. INCLUDES_libfoo will have been set correctly -# XXX it gets ugly avoiding duplicates... -# use :? to ensure .for does not prevent correct evaluation -# # We take care of duplicate suppression later. -__dpadd_incs += ${"${INCLUDES_${__lib:T:R}:M*/h}":? :-I${OBJ_${__lib:T:R}}} -__dpadd_incs += ${INCLUDES_${__lib:T:R}} -.endfor +# don't apply :T:R too early +__dpadd_incs += ${__dpadd_libs:u:@x@${INCLUDES_${x:T:R}}@} +__dpadd_incs += ${__dpadd_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_${x:T:R}}@} + +__dpadd_last_incs += ${__dpadd_libs:u:@x@${INCLUDES_LAST_${x:T:R}}@} +__dpadd_last_incs += ${__dpadd_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_LAST_${x:T:R}}@} + +.if defined(HOSTPROG) || ${MACHINE} == "host" +# we want any -I/usr/* last +__dpadd_last_incs := \ + ${__dpadd_last_incs:N-I/usr/*} \ + ${__dpadd_incs:M-I/usr/*} \ + ${__dpadd_last_incs:M-I/usr/*} +__dpadd_incs := ${__dpadd_incs:N-I/usr/*} +.endif # # eliminate any duplicates - but don't mess with the order @@ -164,13 +219,21 @@ __$t_incs+= $i .endfor .endfor +.for t in CFLAGS_LAST CXXFLAGS_LAST +# avoid duplicates +__$t_incs:=${$t:M-I*:u} +.for i in ${__dpadd_last_incs} +.if "${__$t_incs:M$i}" == "" +$t+= $i +__$t_incs+= $i +.endif +.endfor +.endfor + # This target is used to gather a list of # dir: ${DPADD} # entries .if make(*dpadd*) -# allow overrides -.-include "dpadd++.mk" - .if !target(dpadd) dpadd: .NOTMAIN .if defined(DPADD) && ${DPADD} != "" @@ -193,4 +256,17 @@ dpadd: .NOTMAIN .PATH: ${SRC_PATHADD} .endif +# after all that, if doing -n we don't care +.if ${.MAKEFLAGS:Ux:M-n} != "" +DPADD = *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 20 16:20:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7FC3B44A32; Fri, 20 May 2016 16:20:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 800C41D53; Fri, 20 May 2016 16:20:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KGK8Oo061564; Fri, 20 May 2016 16:20:08 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KGK8kT061563; Fri, 20 May 2016 16:20:08 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201605201620.u4KGK8kT061563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 20 May 2016 16:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r300310 - vendor/NetBSD/bmake/20160512 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 16:20:10 -0000 Author: sjg Date: Fri May 20 16:20:08 2016 New Revision: 300310 URL: https://svnweb.freebsd.org/changeset/base/300310 Log: tag bmake-20160512 Added: vendor/NetBSD/bmake/20160512/ - copied from r300309, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Fri May 20 16:34:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02B06B44E08; Fri, 20 May 2016 16:34:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 D7B7E1A75; Fri, 20 May 2016 16:34:17 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 73DA0B95E; Fri, 20 May 2016 12:34:16 -0400 (EDT) From: John Baldwin To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot Date: Fri, 20 May 2016 08:05:46 -0700 Message-ID: <5332200.R1uTvCkpBM@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <573F2686.20509@freebsd.org> References: <201605200141.u4K1flpV094958@repo.freebsd.org> <1780135.VYYOsNudFi@ralph.baldwin.cx> <573F2686.20509@freebsd.org> 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.2.7 (bigwig.baldwin.cx); Fri, 20 May 2016 12:34:16 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 16:34:18 -0000 On Friday, May 20, 2016 11:00:22 AM Allan Jude wrote: > On 2016-05-20 10:48, John Baldwin wrote: > > On Friday, May 20, 2016 01:41:47 AM Allan Jude wrote: > >> Author: allanjude > >> Date: Fri May 20 01:41:47 2016 > >> New Revision: 300257 > >> URL: https://svnweb.freebsd.org/changeset/base/300257 > >> > >> Log: > >> Fixup the geliboot sector rounding code > >> > >> Replace all rounding with the round{up,down}2 macros > >> a missing set of braces caused the previous code to be incorrect > >> > >> replace alloca() with malloc() because alloca() can return an allocation > >> that is actually invalid, causing boot to fail > > > > No, you have to revert the malloc! malloc() can be anywhere. The alloca > > is _on purpose_ to get a bufer below 1MB so that it will work with all > > devices. Some BIOSes can only store data in the first 1MB. > > > > to be clear, the alloca() was something I added, not something that was > there before. And it was breaking, because ZFS was trying to allocate > too large a block of memory, that wouldn't fit below 1MB. Sorry, I had that thought you were changing the "real" alloca() in bd_io() when reading the diff. -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 20 17:23:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0099EB43D9C for ; Fri, 20 May 2016 17:23:18 +0000 (UTC) (envelope-from ed@nuxi.nl) 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 B6E661B55 for ; Fri, 20 May 2016 17:23:17 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22b.google.com with SMTP id x189so115521081ywe.3 for ; Fri, 20 May 2016 10:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=RPP36haJgsp4/ULREdFO1BjFqy3de195Fvvqngg3Hkc=; b=n5ofSbhxiFmyGL8FCSIw+SY+hifhNWV0bMMTLxifLKONr4e0u9FM0DtmKsXB3JM9d1 2BOX/+jyKQJT7uU6dXGdlFbcAEBDByw1s2w4mMWwhjtOk6B6R3pZD2GzXoBgfk0M0qVS J6xUburBlqc//qJRv51YE93RRB9B/mwqsqEfU/a5EnsOfb6547IRxOIbG03Xx9M7yA5y apoVg71vFoyOUssCP7ueTWIgV55HLPcdspTgbCD9BtM06ckqGsgySfpm8D/2A48aqlr8 t2/52fp/t7hIp+aYHZ0CGKNgou+U9UIsI2Zwlot1tDaqxZZQhl/EMJjFbICd0zeKK4Dy Uphg== 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:date :message-id:subject:from:to:cc; bh=RPP36haJgsp4/ULREdFO1BjFqy3de195Fvvqngg3Hkc=; b=a0KC/MchbaWGMrKPKdlmHP/umeUPDlzq42mlQ85X0wib5Ab74ztiuIYB9DUhGhdNAJ N6u/o1rD8cvkwnsHd9jkOxc0Pw6fSMtvXkullDC7UX46/PfmWkEHM/DXFhfm5WDQtCyW /9a46ONdrmNNSy3XdH1inHkvporEen2PHlDoewM3J0dbMOYOPW0UjEw4zIfZYhHJijJx j5ph1oRSCR2flnsGEtFxSvQASxOhzXiUD0eWgG6J/+U/shJhZgB5zrEGpeqH71C2z6+2 9YcEo3FxaUTdR/8j/QFhotL+DeMrwiYwlLhvAAlQMo1A3EYUbvahqRS8ldxf3hoOBQAj Cg+g== X-Gm-Message-State: AOPr4FXBHNj5L5ZYxjgIeaBEXtl2EJtAii7Lj/rlg+1eIHr0x6CkKxLgPPnfskwoGb3XV3kkK9ulp2AOXAVCrw== MIME-Version: 1.0 X-Received: by 10.13.198.5 with SMTP id i5mr2881243ywd.263.1463764996846; Fri, 20 May 2016 10:23:16 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Fri, 20 May 2016 10:23:16 -0700 (PDT) In-Reply-To: <201605201436.u4KEanoi031012@repo.freebsd.org> References: <201605201436.u4KEanoi031012@repo.freebsd.org> Date: Fri, 20 May 2016 19:23:16 +0200 Message-ID: Subject: Re: svn commit: r300301 - head/contrib/gcc From: Ed Schouten To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:23:18 -0000 Hi Pedro, 2016-05-20 16:36 GMT+02:00 Pedro F. Giffuni : > + tree anon = NULL_TREE; This initialization shouldn't be needed, right? The value is always assigned before used. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Fri May 20 17:24:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5B22B43E90; Fri, 20 May 2016 17:24:37 +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 3962A1D3E; Fri, 20 May 2016 17:24:37 +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 u4KHOaO1083396; Fri, 20 May 2016 17:24:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHOZ7x083379; Fri, 20 May 2016 17:24:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605201724.u4KHOZ7x083379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 May 2016 17:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300311 - in head: contrib/elftoolchain/addr2line contrib/elftoolchain/brandelf contrib/elftoolchain/common contrib/elftoolchain/cxxfilt contrib/elftoolchain/elfcopy contrib/elftoolchai... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:24:37 -0000 Author: emaste Date: Fri May 20 17:24:34 2016 New Revision: 300311 URL: https://svnweb.freebsd.org/changeset/base/300311 Log: Update to ELF Tool Chain r3475 Improvements include: * Add support for reporting and handling a number of new constants in various tools, including: * CloudABI OSABI * DT_TLSDESC_* * i386, MIPS, SPARC and amd64 relocations * C++ demangler bug fixes * Man page updates * Improved input validation in several tools This update also reduces diffs against upstream as a number of fixes included in upstream were previously cherry-picked into FreeBSD. Sponsored by: The FreeBSD Foundation Added: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.3 - copied unchanged from r300228, vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.3 head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c - copied unchanged from r300228, vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c Modified: head/contrib/elftoolchain/addr2line/addr2line.c head/contrib/elftoolchain/brandelf/brandelf.c head/contrib/elftoolchain/common/_elftc.h head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/cxxfilt/cxxfilt.c head/contrib/elftoolchain/elfcopy/ascii.c head/contrib/elftoolchain/elfcopy/binary.c head/contrib/elftoolchain/elfcopy/elfcopy.1 head/contrib/elftoolchain/elfcopy/elfcopy.h head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfcopy/sections.c head/contrib/elftoolchain/elfcopy/segments.c head/contrib/elftoolchain/elfcopy/symbols.c head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c head/contrib/elftoolchain/libelf/_libelf_config.h head/contrib/elftoolchain/libelf/elf_data.c head/contrib/elftoolchain/libelf/libelf_ar.c head/contrib/elftoolchain/libelf/libelf_convert.m4 head/contrib/elftoolchain/libelftc/Makefile head/contrib/elftoolchain/libelftc/libelftc.h head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c head/contrib/elftoolchain/libelftc/make-toolchain-version head/contrib/elftoolchain/libpe/libpe_section.c head/contrib/elftoolchain/libpe/pe.h head/contrib/elftoolchain/nm/nm.c head/contrib/elftoolchain/readelf/readelf.c head/contrib/elftoolchain/size/size.c head/contrib/elftoolchain/strings/strings.c head/lib/libelftc/Makefile head/lib/libelftc/elftc_version.c Directory Properties: head/contrib/elftoolchain/ (props changed) head/contrib/elftoolchain/brandelf/ (props changed) head/contrib/elftoolchain/elfdump/ (props changed) Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/addr2line/addr2line.c Fri May 20 17:24:34 2016 (r300311) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3273 2015-12-11 21:38:57Z kaiwang27 $"); +ELFTC_VCSID("$Id: addr2line.c 3446 2016-05-03 01:31:17Z emaste $"); struct Func { char *name; @@ -284,7 +284,7 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die &de) == DW_DLV_OK) goto add_func; - /* Skip if no name assoicated with this DIE. */ + /* Skip if no name associated with this DIE. */ goto cont_search; add_func: Modified: head/contrib/elftoolchain/brandelf/brandelf.c ============================================================================== --- head/contrib/elftoolchain/brandelf/brandelf.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/brandelf/brandelf.c Fri May 20 17:24:34 2016 (r300311) @@ -44,7 +44,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: brandelf.c 3354 2016-01-18 21:50:15Z jkoshy $"); +ELFTC_VCSID("$Id: brandelf.c 3440 2016-04-07 14:51:47Z emaste $"); static int elftype(const char *); static const char *iselftype(int); @@ -62,6 +62,7 @@ static struct ELFtypes elftypes[] = { { "AIX", ELFOSABI_AIX }, { "ARM", ELFOSABI_ARM }, { "AROS", ELFOSABI_AROS }, + { "CloudABI", ELFOSABI_CLOUDABI }, { "FreeBSD", ELFOSABI_FREEBSD }, { "GNU", ELFOSABI_GNU }, { "HP/UX", ELFOSABI_HPUX}, Modified: head/contrib/elftoolchain/common/_elftc.h ============================================================================== --- head/contrib/elftoolchain/common/_elftc.h Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/common/_elftc.h Fri May 20 17:24:34 2016 (r300311) @@ -23,11 +23,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _elftc.h 3244 2015-08-31 19:53:08Z emaste $ + * $Id: _elftc.h 3446 2016-05-03 01:31:17Z emaste $ */ /** - ** Miscellanous definitions needed by multiple components. + ** Miscellaneous definitions needed by multiple components. **/ #ifndef _ELFTC_H Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri May 20 17:24:34 2016 (r300311) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3392 2016-02-05 19:51:22Z emaste $ + * $Id: elfdefinitions.h 3455 2016-05-09 13:47:29Z emaste $ */ /* @@ -184,6 +184,10 @@ _ELF_DEFINE_DT(DT_ADDRRNGLO, 0x6F "start of range using the d_ptr field") \ _ELF_DEFINE_DT(DT_GNU_HASH, 0x6FFFFEF5UL, \ "GNU style hash tables") \ +_ELF_DEFINE_DT(DT_TLSDESC_PLT, 0x6FFFFEF6UL, \ + "location of PLT entry for TLS descriptor resolver calls") \ +_ELF_DEFINE_DT(DT_TLSDESC_GOT, 0x6FFFFEF7UL, \ + "location of GOT entry used by TLS descriptor resolver PLT entry") \ _ELF_DEFINE_DT(DT_GNU_CONFLICT, 0x6FFFFEF8UL, \ "address of conflict section") \ _ELF_DEFINE_DT(DT_GNU_LIBLIST, 0x6FFFFEF9UL, \ @@ -269,7 +273,7 @@ _ELF_DEFINE_DT(DT_MIPS_DELTA_RELOC, 0x70 _ELF_DEFINE_DT(DT_MIPS_DELTA_RELOC_NO, 0x7000001CUL, \ "number of entries in DT_MIPS_DELTA_RELOC") \ _ELF_DEFINE_DT(DT_MIPS_DELTA_SYM, 0x7000001DUL, \ - "Delta symbols refered by Delta relocations") \ + "Delta symbols referred by Delta relocations") \ _ELF_DEFINE_DT(DT_MIPS_DELTA_SYM_NO, 0x7000001EUL, \ "number of entries in DT_MIPS_DELTA_SYM") \ _ELF_DEFINE_DT(DT_MIPS_DELTA_CLASSSYM, 0x70000020UL, \ @@ -540,6 +544,7 @@ _ELF_DEFINE_EABI(ELFOSABI_NSK, 14 _ELF_DEFINE_EABI(ELFOSABI_AROS, 15, "Amiga Research OS") \ _ELF_DEFINE_EABI(ELFOSABI_FENIXOS, 16, \ "The FenixOS highly scalable multi-core OS") \ +_ELF_DEFINE_EABI(ELFOSABI_CLOUDABI, 17, "Nuxi CloudABI") \ _ELF_DEFINE_EABI(ELFOSABI_ARM_AEABI, 64, \ "ARM specific symbol versioning extensions") \ _ELF_DEFINE_EABI(ELFOSABI_ARM, 97, "ARM ABI") \ @@ -1193,7 +1198,7 @@ _ELF_DEFINE_SHT(SHT_MIPS_ABIFLAGS, 0x7 "ABI flags") \ _ELF_DEFINE_SHT(SHT_SPARC_GOTDATA, 0x70000000UL, \ "SPARC-specific data") \ -_ELF_DEFINE_SHT(SHT_AMD64_UNWIND, 0x70000001UL, \ +_ELF_DEFINE_SHT(SHT_X86_64_UNWIND, 0x70000001UL, \ "unwind tables for the AMD64") \ _ELF_DEFINE_SHT(SHT_ORDERED, 0x7FFFFFFFUL, \ "sort entries in the section") \ @@ -1212,6 +1217,7 @@ enum { }; /* Aliases for section types. */ +#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND #define SHT_GNU_verdef SHT_SUNW_verdef #define SHT_GNU_verneed SHT_SUNW_verneed #define SHT_GNU_versym SHT_SUNW_versym @@ -1255,6 +1261,7 @@ _ELF_DEFINE_STT(STT_FILE, 4, _ELF_DEFINE_STT(STT_COMMON, 5, "uninitialized common block") \ _ELF_DEFINE_STT(STT_TLS, 6, "thread local storage") \ _ELF_DEFINE_STT(STT_LOOS, 10, "start of OS-specific types") \ +_ELF_DEFINE_STT(STT_GNU_IFUNC, 10, "indirect function") \ _ELF_DEFINE_STT(STT_HIOS, 12, "end of OS-specific types") \ _ELF_DEFINE_STT(STT_LOPROC, 13, \ "start of processor-specific types") \ @@ -1402,10 +1409,37 @@ _ELF_DEFINE_RELOC(R_386_RELATIVE, 8) \ _ELF_DEFINE_RELOC(R_386_GOTOFF, 9) \ _ELF_DEFINE_RELOC(R_386_GOTPC, 10) \ _ELF_DEFINE_RELOC(R_386_32PLT, 11) \ +_ELF_DEFINE_RELOC(R_386_TLS_TPOFF, 14) \ +_ELF_DEFINE_RELOC(R_386_TLS_IE, 15) \ +_ELF_DEFINE_RELOC(R_386_TLS_GOTIE, 16) \ +_ELF_DEFINE_RELOC(R_386_TLS_LE, 17) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD, 18) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM, 19) \ _ELF_DEFINE_RELOC(R_386_16, 20) \ _ELF_DEFINE_RELOC(R_386_PC16, 21) \ _ELF_DEFINE_RELOC(R_386_8, 22) \ -_ELF_DEFINE_RELOC(R_386_PC8, 23) +_ELF_DEFINE_RELOC(R_386_PC8, 23) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_32, 24) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_PUSH, 25) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_CALL, 26) \ +_ELF_DEFINE_RELOC(R_386_TLS_GD_POP, 27) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_32, 28) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_PUSH, 29) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_CALL, 30) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDM_POP, 31) \ +_ELF_DEFINE_RELOC(R_386_TLS_LDO_32, 32) \ +_ELF_DEFINE_RELOC(R_386_TLS_IE_32, 33) \ +_ELF_DEFINE_RELOC(R_386_TLS_LE_32, 34) \ +_ELF_DEFINE_RELOC(R_386_TLS_DTPMOD32, 35) \ +_ELF_DEFINE_RELOC(R_386_TLS_DTPOFF32, 36) \ +_ELF_DEFINE_RELOC(R_386_TLS_TPOFF32, 37) \ +_ELF_DEFINE_RELOC(R_386_SIZE32, 38) \ +_ELF_DEFINE_RELOC(R_386_TLS_GOTDESC, 39) \ +_ELF_DEFINE_RELOC(R_386_TLS_DESC_CALL, 40) \ +_ELF_DEFINE_RELOC(R_386_TLS_DESC, 41) \ +_ELF_DEFINE_RELOC(R_386_IRELATIVE, 42) \ +_ELF_DEFINE_RELOC(R_386_GOT32X, 43) + /* */ @@ -1795,11 +1829,18 @@ _ELF_DEFINE_RELOC(R_MIPS_GOT16, 9) \ _ELF_DEFINE_RELOC(R_MIPS_PC16, 10) \ _ELF_DEFINE_RELOC(R_MIPS_CALL16, 11) \ _ELF_DEFINE_RELOC(R_MIPS_GPREL32, 12) \ +_ELF_DEFINE_RELOC(R_MIPS_SHIFT5, 16) \ +_ELF_DEFINE_RELOC(R_MIPS_SHIFT6, 17) \ _ELF_DEFINE_RELOC(R_MIPS_64, 18) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTHI16, 21) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTLO16, 22) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_DISP, 19) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_PAGE, 20) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_OFST, 21) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_HI16, 22) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT_LO16, 23) \ +_ELF_DEFINE_RELOC(R_MIPS_SUB, 24) \ _ELF_DEFINE_RELOC(R_MIPS_CALLHI16, 30) \ _ELF_DEFINE_RELOC(R_MIPS_CALLLO16, 31) \ +_ELF_DEFINE_RELOC(R_MIPS_JALR, 37) \ _ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD32, 38) \ _ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL32, 39) \ _ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD64, 40) \ @@ -2095,6 +2136,7 @@ _ELF_DEFINE_RELOC(R_SPARC_PC_HM10, 38) \ _ELF_DEFINE_RELOC(R_SPARC_PC_LM22, 39) \ _ELF_DEFINE_RELOC(R_SPARC_WDISP16, 40) \ _ELF_DEFINE_RELOC(R_SPARC_WDISP19, 41) \ +_ELF_DEFINE_RELOC(R_SPARC_GLOB_JMP, 42) \ _ELF_DEFINE_RELOC(R_SPARC_7, 43) \ _ELF_DEFINE_RELOC(R_SPARC_5, 44) \ _ELF_DEFINE_RELOC(R_SPARC_6, 45) \ @@ -2108,6 +2150,30 @@ _ELF_DEFINE_RELOC(R_SPARC_L44, 52) \ _ELF_DEFINE_RELOC(R_SPARC_REGISTER, 53) \ _ELF_DEFINE_RELOC(R_SPARC_UA64, 54) \ _ELF_DEFINE_RELOC(R_SPARC_UA16, 55) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_HI22, 56) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_LO10, 57) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_ADD, 58) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_GD_CALL, 59) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_HI22, 60) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_LO10, 61) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_ADD, 62) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDM_CALL, 63) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDO_HIX22, 64) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDO_LOX10, 65) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LDO_ADD, 66) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_HI22, 67) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_LO10, 68) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_LD, 69) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_LDX, 70) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_IE_ADD, 71) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LE_HIX22, 72) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_LE_LOX10, 73) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPMOD32, 74) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPMOD64, 75) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPOFF32, 76) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_DTPOFF64, 77) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_TPOFF32, 78) \ +_ELF_DEFINE_RELOC(R_SPARC_TLS_TPOFF64, 79) \ _ELF_DEFINE_RELOC(R_SPARC_GOTDATA_HIX22, 80) \ _ELF_DEFINE_RELOC(R_SPARC_GOTDATA_LOX10, 81) \ _ELF_DEFINE_RELOC(R_SPARC_GOTDATA_OP_HIX22, 82) \ @@ -2153,7 +2219,10 @@ _ELF_DEFINE_RELOC(R_X86_64_SIZE64, 33) \ _ELF_DEFINE_RELOC(R_X86_64_GOTPC32_TLSDESC, 34) \ _ELF_DEFINE_RELOC(R_X86_64_TLSDESC_CALL, 35) \ _ELF_DEFINE_RELOC(R_X86_64_TLSDESC, 36) \ -_ELF_DEFINE_RELOC(R_X86_64_IRELATIVE, 37) +_ELF_DEFINE_RELOC(R_X86_64_IRELATIVE, 37) \ +_ELF_DEFINE_RELOC(R_X86_64_RELATIVE64, 38) \ +_ELF_DEFINE_RELOC(R_X86_64_GOTPCRELX, 41) \ +_ELF_DEFINE_RELOC(R_X86_64_REX_GOTPCRELX, 42) #define _ELF_DEFINE_RELOCATIONS() \ _ELF_DEFINE_386_RELOCATIONS() \ @@ -2424,7 +2493,7 @@ _ELF_DEFINE_ODK(ODK_HWOR, 8, _ELF_DEFINE_ODK(ODK_GP_GROUP, 9, \ "GP group to use for text/data sections") \ _ELF_DEFINE_ODK(ODK_IDENT, 10, "ID information") \ -_ELF_DEFINE_ODK(ODK_PAGESIZE, 11, "page size infomation") +_ELF_DEFINE_ODK(ODK_PAGESIZE, 11, "page size information") #undef _ELF_DEFINE_ODK #define _ELF_DEFINE_ODK(N, V, DESCR) N = V , Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c ============================================================================== --- head/contrib/elftoolchain/cxxfilt/cxxfilt.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/cxxfilt/cxxfilt.c Fri May 20 17:24:34 2016 (r300311) @@ -35,7 +35,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: cxxfilt.c 3356 2016-01-22 22:31:38Z jkoshy $"); +ELFTC_VCSID("$Id: cxxfilt.c 3454 2016-05-07 17:11:05Z kaiwang27 $"); #define STRBUFSZ 8192 @@ -112,35 +112,18 @@ find_format(const char *fstr) } static char * -demangle(char *name, int strict, size_t *pos) +demangle(char *name) { static char dem[STRBUFSZ]; - char nb[STRBUFSZ]; - size_t p, t; - if (stripus && *name == '_') { - strncpy(nb, name + 1, sizeof(nb) - 1); - t = 1; - } else { - strncpy(nb, name, sizeof(nb) - 1); - t = 0; - } - nb[sizeof(nb) - 1] = '\0'; + if (stripus && *name == '_') + name++; - p = strlen(nb); - if (p == 0) - return NULL; - - while (elftc_demangle(nb, dem, sizeof(dem), (unsigned) format) < 0) { - if (!strict && p > 1) { - nb[--p] = '\0'; - continue; - } else - return (NULL); - } + if (strlen(name) == 0) + return (NULL); - if (pos != NULL) - *pos = t ? p + 1 : p; + if (elftc_demangle(name, dem, sizeof(dem), (unsigned) format) < 0) + return (NULL); return (dem); } @@ -149,7 +132,7 @@ int main(int argc, char **argv) { char *dem, buf[STRBUFSZ]; - size_t i, p, s; + size_t p; int c, n, opt; while ((opt = getopt_long(argc, argv, "_nps:V", longopts, NULL)) != @@ -184,8 +167,8 @@ main(int argc, char **argv) if (*argv != NULL) { for (n = 0; n < argc; n++) { - if ((dem = demangle(argv[n], 1, NULL)) == NULL) - fprintf(stderr, "Failed: %s\n", argv[n]); + if ((dem = demangle(argv[n])) == NULL) + printf("%s\n", argv[n]); else printf("%s\n", dem); } @@ -193,23 +176,18 @@ main(int argc, char **argv) p = 0; for (;;) { c = fgetc(stdin); - if (c == EOF || !isprint(c) || strchr(" \t\n", c)) { + if (c == EOF || !(isalnum(c) || strchr(".$_", c))) { if (p > 0) { buf[p] = '\0'; - if ((dem = demangle(buf, 0, &s)) == - NULL) + if ((dem = demangle(buf)) == NULL) printf("%s", buf); - else { + else printf("%s", dem); - for (i = s; i < p; i++) - putchar(buf[i]); - } p = 0; } if (c == EOF) break; - if (isprint(c) || strchr(" \t\n", c)) - putchar(c); + putchar(c); } else { if ((size_t) p >= sizeof(buf) - 1) warnx("buffer overflowed"); Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/ascii.c Fri May 20 17:24:34 2016 (r300311) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: ascii.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: ascii.c 3446 2016-05-03 01:31:17Z emaste $"); static void append_data(struct section *s, const void *buf, size_t sz); static char hex_digit(uint8_t n); @@ -187,7 +187,7 @@ create_srec(struct elfcopy *ecp, int ifd if (elferr != 0) warnx("elf_nextscn failed: %s", elf_errmsg(elferr)); - /* Generate S{7,8,9} end of block recrod. */ + /* Generate S{7,8,9} end of block record. */ if (gelf_getehdr(e, &eh) == NULL) errx(EXIT_FAILURE, "gelf_getehdr() failed: %s", elf_errmsg(-1)); Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/binary.c Fri May 20 17:24:34 2016 (r300311) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: binary.c 3270 2015-12-11 18:48:56Z emaste $"); +ELFTC_VCSID("$Id: binary.c 3445 2016-04-20 19:08:30Z emaste $"); /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set Modified: head/contrib/elftoolchain/elfcopy/elfcopy.1 ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri May 20 17:24:34 2016 (r300311) @@ -21,9 +21,9 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3381 2016-01-30 19:39:47Z jkoshy $ +.\" $Id: elfcopy.1 3426 2016-03-05 13:32:28Z emaste $ .\" -.Dd January 29, 2016 +.Dd March 5, 2016 .Os .Dt ELFCOPY 1 .Sh NAME @@ -67,7 +67,10 @@ .Op Fl -change-section-vma Ar section Ns {+|-|=} Ns Ar val .Op Fl -extract-dwo .Op Fl -gap-fill Ns = Ns Ar val +.Op Fl -globalize-symbol Ns = Ns ar symbolname +.Op Fl -globalize-symbols Ns = Ns Ar filename .Op Fl -localize-hidden +.Op Fl -localize-symbols Ns = Ns Ar filename .Op Fl -no-adjust-warnings | Fl -no-change-warnings .Op Fl -only-keep-debug .Op Fl -pad-to Ns = Ns Ar address @@ -239,9 +242,21 @@ Copy only .dwo debug sections to the out Fill the gaps between sections with the byte value specified by the argument .Ar val . +.It Fl -globalize-symbol Ns = Ns Ar symbolname +Make the symbol named by argument +.Ar symbolname +global, so that it is visible outside of the file in which it is defined. +.It Fl -globalize-symbols Ns = Ns Ar filename +Make each symbol listed in the file specified by +.Ar filename +global. .It Fl -localize-hidden Make all hidden symbols local to the output file. This includes symbols with internal visiblity. +.It Fl -localize-symbols Ns = Ns Ar filename +Make each symbol listed in the file specified by +.Ar filename +local to the output file. .It Fl -no-adjust-warnings | Fl -no-change-warnings Do not issue a warning if the section specified by the options .Fl -change-section-address , Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.h Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/elfcopy.h Fri May 20 17:24:34 2016 (r300311) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfcopy.h 3310 2016-01-10 09:10:54Z kaiwang27 $ + * $Id: elfcopy.h 3446 2016-05-03 01:31:17Z emaste $ */ #include @@ -178,7 +178,7 @@ struct elfcopy { Elftc_Bfd_Target_Flavor otf; /* flavour of output object */ const char *otgt; /* output target name */ int oec; /* elfclass of output object */ - unsigned char oed; /* endianess of output object */ + unsigned char oed; /* endianness of output object */ int oem; /* EM_XXX of output object */ int abi; /* OSABI of output object */ Elf *ein; /* ELF descriptor of input object */ @@ -238,7 +238,7 @@ struct elfcopy { uint64_t *secndx; /* section index map. */ uint64_t *symndx; /* symbol index map. */ unsigned char *v_rel; /* symbols needed by relocation. */ - unsigned char *v_grp; /* symbols refered by section group. */ + unsigned char *v_grp; /* symbols referred by section group. */ unsigned char *v_secsym; /* sections with section symbol. */ STAILQ_HEAD(, segment) v_seg; /* list of segments. */ STAILQ_HEAD(, sec_action) v_sac;/* list of section operations. */ Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/main.c Fri May 20 17:24:34 2016 (r300311) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3399 2016-02-12 18:07:56Z emaste $"); +ELFTC_VCSID("$Id: main.c 3446 2016-05-03 01:31:17Z emaste $"); enum options { @@ -209,6 +209,7 @@ static struct { {"openbsd", ELFOSABI_OPENBSD}, {"openvms", ELFOSABI_OPENVMS}, {"nsk", ELFOSABI_NSK}, + {"cloudabi", ELFOSABI_CLOUDABI}, {"arm", ELFOSABI_ARM}, {"standalone", ELFOSABI_STANDALONE}, {NULL, 0} @@ -235,7 +236,7 @@ static void strip_main(struct elfcopy *e static void strip_usage(void); /* - * An ELF object usually has a sturcture described by the + * An ELF object usually has a structure described by the * diagram below. * _____________ * | | @@ -1446,7 +1447,7 @@ Usage: %s [options] infile [outfile]\n\ sections.\n\ --only-keep-debug Copy only debugging information.\n\ --output-target=FORMAT Use the specified format for the output.\n\ - --pad-to=ADDRESS Pad the output object upto the given address.\n\ + --pad-to=ADDRESS Pad the output object up to the given address.\n\ --prefix-alloc-sections=STRING\n\ Prefix the section names of all the allocated\n\ sections with STRING.\n\ Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/sections.c Fri May 20 17:24:34 2016 (r300311) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3346 2016-01-17 20:09:15Z kaiwang27 $"); +ELFTC_VCSID("$Id: sections.c 3443 2016-04-15 18:57:54Z kaiwang27 $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); Modified: head/contrib/elftoolchain/elfcopy/segments.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/segments.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/segments.c Fri May 20 17:24:34 2016 (r300311) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3397 2016-02-12 14:35:19Z emaste $"); +ELFTC_VCSID("$Id: segments.c 3449 2016-05-03 13:59:29Z emaste $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -468,8 +468,7 @@ setup_phdr(struct elfcopy *ecp) { struct segment *seg; GElf_Phdr iphdr; - size_t iphnum; - int i; + size_t iphnum, i; if (elf_getphnum(ecp->ein, &iphnum) == 0) errx(EXIT_FAILURE, "elf_getphnum failed: %s", @@ -485,7 +484,7 @@ setup_phdr(struct elfcopy *ecp) return; } - for (i = 0; (size_t)i < iphnum; i++) { + for (i = 0; i < iphnum; i++) { if (gelf_getphdr(ecp->ein, i, &iphdr) != &iphdr) errx(EXIT_FAILURE, "gelf_getphdr failed: %s", elf_errmsg(-1)); Modified: head/contrib/elftoolchain/elfcopy/symbols.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/symbols.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfcopy/symbols.c Fri May 20 17:24:34 2016 (r300311) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: symbols.c 3376 2016-01-26 18:41:39Z emaste $"); +ELFTC_VCSID("$Id: symbols.c 3446 2016-05-03 01:31:17Z emaste $"); /* Backwards compatibility for systems with older ELF definitions. */ #ifndef STB_GNU_UNIQUE @@ -168,7 +168,7 @@ is_needed_symbol(struct elfcopy *ecp, in if (BIT_ISSET(ecp->v_rel, i)) return (1); - /* Symbols refered by COMDAT sections are needed. */ + /* Symbols referred by COMDAT sections are needed. */ if (BIT_ISSET(ecp->v_grp, i)) return (1); @@ -258,7 +258,7 @@ is_remove_symbol(struct elfcopy *ecp, si } /* - * Mark symbols refered by relocation entries. + * Mark symbols referred by relocation entries. */ static void mark_reloc_symbols(struct elfcopy *ecp, size_t sc) @@ -1165,7 +1165,7 @@ lookup_symop_list(struct elfcopy *ecp, c if ((s->op & op) == 0) continue; if (name == NULL || !strcmp(name, s->name)) - return (s); + return (s); if ((ecp->flags & WILDCARD) == 0) continue; Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Fri May 20 16:20:08 2016 (r300310) +++ head/contrib/elftoolchain/elfdump/elfdump.c Fri May 20 17:24:34 2016 (r300311) @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3391 2016-02-05 19:43:01Z emaste $"); +ELFTC_VCSID("$Id: elfdump.c 3474 2016-05-17 20:44:53Z emaste $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -263,34 +263,99 @@ e_machines(unsigned int mach) return (machdesc); } -static const char *e_types[] = { - "ET_NONE", "ET_REL", "ET_EXEC", "ET_DYN", "ET_CORE" -}; +static const char * +elf_type_str(unsigned int type) +{ + static char s_type[32]; -static const char *ei_versions[] = { - "EV_NONE", "EV_CURRENT" -}; + switch (type) + { + case ET_NONE: return "ET_NONE"; + case ET_REL: return "ET_REL"; + case ET_EXEC: return "ET_EXEC"; + case ET_DYN: return "ET_DYN"; + case ET_CORE: return "ET_CORE"; + } + if (type >= ET_LOPROC) + snprintf(s_type, sizeof(s_type), "", type); + else if (type >= ET_LOOS && type <= ET_HIOS) + snprintf(s_type, sizeof(s_type), "", type); + else + snprintf(s_type, sizeof(s_type), "", ver); + return (s_ver); +} + +static const char * +elf_class_str(unsigned int class) +{ + static char s_class[32]; + + switch (class) { + case ELFCLASSNONE: return "ELFCLASSNONE"; + case ELFCLASS32: return "ELFCLASS32"; + case ELFCLASS64: return "ELFCLASS64"; + } + snprintf(s_class, sizeof(s_class), "", class); + return (s_class); +} + +static const char * +elf_data_str(unsigned int data) +{ + static char s_data[32]; + + switch (data) { + case ELFDATANONE: return "ELFDATANONE"; + case ELFDATA2LSB: return "ELFDATA2LSB"; + case ELFDATA2MSB: return "ELFDATA2MSB"; + } + snprintf(s_data, sizeof(s_data), "", data); + return (s_data); +} static const char *ei_abis[256] = { "ELFOSABI_NONE", "ELFOSABI_HPUX", "ELFOSABI_NETBSD", "ELFOSABI_LINUX", "ELFOSABI_HURD", "ELFOSABI_86OPEN", "ELFOSABI_SOLARIS", "ELFOSABI_AIX", "ELFOSABI_IRIX", "ELFOSABI_FREEBSD", "ELFOSABI_TRU64", "ELFOSABI_MODESTO", "ELFOSABI_OPENBSD", + [17] = "ELFOSABI_CLOUDABI", [255] = "ELFOSABI_STANDALONE" }; -static const char *p_types[] = { - "PT_NULL", "PT_LOAD", "PT_DYNAMIC", "PT_INTERP", "PT_NOTE", - "PT_SHLIB", "PT_PHDR", "PT_TLS" -}; +static const char * +elf_phdr_type_str(unsigned int type) +{ + static char s_type[32]; + + switch (type) { + case PT_NULL: return "PT_NULL"; + case PT_LOAD: return "PT_LOAD"; + case PT_DYNAMIC: return "PT_DYNAMIC"; + case PT_INTERP: return "PT_INTERP"; + case PT_NOTE: return "PT_NOTE"; + case PT_SHLIB: return "PT_SHLIB"; + case PT_PHDR: return "PT_PHDR"; + case PT_TLS: return "PT_TLS"; + case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME"; + case PT_GNU_STACK: return "PT_GNU_STACK"; + case PT_GNU_RELRO: return "PT_GNU_RELRO"; + } + snprintf(s_type, sizeof(s_type), "", type); + return (s_type); +} static const char *p_flags[] = { "", "PF_X", "PF_W", "PF_X|PF_W", "PF_R", "PF_X|PF_R", "PF_W|PF_R", @@ -407,7 +472,8 @@ sh_types(uint64_t mach, uint64_t sht) { DEFINE_SHF(LINK_ORDER) \ DEFINE_SHF(OS_NONCONFORMING) \ DEFINE_SHF(GROUP) \ - DEFINE_SHF(TLS) + DEFINE_SHF(TLS) \ + DEFINE_SHF(COMPRESSED) #undef DEFINE_SHF #define DEFINE_SHF(F) "SHF_" #F "|" @@ -518,387 +584,6 @@ static unsigned char st_others[] = { 'D', 'I', 'H', 'P' }; -static const char * -r_type(unsigned int mach, unsigned int type) -{ - switch(mach) { - case EM_NONE: return ""; - case EM_386: - case EM_IAMCU: - switch(type) { - case 0: return "R_386_NONE"; - case 1: return "R_386_32"; - case 2: return "R_386_PC32"; - case 3: return "R_386_GOT32"; - case 4: return "R_386_PLT32"; - case 5: return "R_386_COPY"; - case 6: return "R_386_GLOB_DAT"; - case 7: return "R_386_JUMP_SLOT"; - case 8: return "R_386_RELATIVE"; - case 9: return "R_386_GOTOFF"; - case 10: return "R_386_GOTPC"; - case 14: return "R_386_TLS_TPOFF"; - case 15: return "R_386_TLS_IE"; - case 16: return "R_386_TLS_GOTIE"; - case 17: return "R_386_TLS_LE"; - case 18: return "R_386_TLS_GD"; - case 19: return "R_386_TLS_LDM"; - case 24: return "R_386_TLS_GD_32"; - case 25: return "R_386_TLS_GD_PUSH"; - case 26: return "R_386_TLS_GD_CALL"; - case 27: return "R_386_TLS_GD_POP"; - case 28: return "R_386_TLS_LDM_32"; - case 29: return "R_386_TLS_LDM_PUSH"; - case 30: return "R_386_TLS_LDM_CALL"; - case 31: return "R_386_TLS_LDM_POP"; - case 32: return "R_386_TLS_LDO_32"; - case 33: return "R_386_TLS_IE_32"; - case 34: return "R_386_TLS_LE_32"; - case 35: return "R_386_TLS_DTPMOD32"; - case 36: return "R_386_TLS_DTPOFF32"; - case 37: return "R_386_TLS_TPOFF32"; - default: return ""; - } - case EM_ARM: - switch(type) { - case 0: return "R_ARM_NONE"; - case 1: return "R_ARM_PC24"; - case 2: return "R_ARM_ABS32"; - case 3: return "R_ARM_REL32"; - case 4: return "R_ARM_PC13"; - case 5: return "R_ARM_ABS16"; - case 6: return "R_ARM_ABS12"; - case 7: return "R_ARM_THM_ABS5"; - case 8: return "R_ARM_ABS8"; - case 9: return "R_ARM_SBREL32"; - case 10: return "R_ARM_THM_PC22"; - case 11: return "R_ARM_THM_PC8"; - case 12: return "R_ARM_AMP_VCALL9"; - case 13: return "R_ARM_SWI24"; - case 14: return "R_ARM_THM_SWI8"; - case 15: return "R_ARM_XPC25"; - case 16: return "R_ARM_THM_XPC22"; - case 20: return "R_ARM_COPY"; - case 21: return "R_ARM_GLOB_DAT"; - case 22: return "R_ARM_JUMP_SLOT"; - case 23: return "R_ARM_RELATIVE"; - case 24: return "R_ARM_GOTOFF"; - case 25: return "R_ARM_GOTPC"; - case 26: return "R_ARM_GOT32"; - case 27: return "R_ARM_PLT32"; - case 100: return "R_ARM_GNU_VTENTRY"; - case 101: return "R_ARM_GNU_VTINHERIT"; - case 250: return "R_ARM_RSBREL32"; - case 251: return "R_ARM_THM_RPC22"; - case 252: return "R_ARM_RREL32"; - case 253: return "R_ARM_RABS32"; - case 254: return "R_ARM_RPC24"; - case 255: return "R_ARM_RBASE"; - default: return ""; - } - case EM_IA_64: - switch(type) { - case 0: return "R_IA_64_NONE"; - case 33: return "R_IA_64_IMM14"; - case 34: return "R_IA_64_IMM22"; - case 35: return "R_IA_64_IMM64"; - case 36: return "R_IA_64_DIR32MSB"; - case 37: return "R_IA_64_DIR32LSB"; - case 38: return "R_IA_64_DIR64MSB"; - case 39: return "R_IA_64_DIR64LSB"; - case 42: return "R_IA_64_GPREL22"; - case 43: return "R_IA_64_GPREL64I"; - case 44: return "R_IA_64_GPREL32MSB"; - case 45: return "R_IA_64_GPREL32LSB"; - case 46: return "R_IA_64_GPREL64MSB"; - case 47: return "R_IA_64_GPREL64LSB"; - case 50: return "R_IA_64_LTOFF22"; - case 51: return "R_IA_64_LTOFF64I"; - case 58: return "R_IA_64_PLTOFF22"; - case 59: return "R_IA_64_PLTOFF64I"; - case 62: return "R_IA_64_PLTOFF64MSB"; - case 63: return "R_IA_64_PLTOFF64LSB"; - case 67: return "R_IA_64_FPTR64I"; - case 68: return "R_IA_64_FPTR32MSB"; - case 69: return "R_IA_64_FPTR32LSB"; - case 70: return "R_IA_64_FPTR64MSB"; - case 71: return "R_IA_64_FPTR64LSB"; - case 72: return "R_IA_64_PCREL60B"; - case 73: return "R_IA_64_PCREL21B"; - case 74: return "R_IA_64_PCREL21M"; - case 75: return "R_IA_64_PCREL21F"; - case 76: return "R_IA_64_PCREL32MSB"; - case 77: return "R_IA_64_PCREL32LSB"; - case 78: return "R_IA_64_PCREL64MSB"; - case 79: return "R_IA_64_PCREL64LSB"; - case 82: return "R_IA_64_LTOFF_FPTR22"; - case 83: return "R_IA_64_LTOFF_FPTR64I"; - case 84: return "R_IA_64_LTOFF_FPTR32MSB"; - case 85: return "R_IA_64_LTOFF_FPTR32LSB"; - case 86: return "R_IA_64_LTOFF_FPTR64MSB"; - case 87: return "R_IA_64_LTOFF_FPTR64LSB"; - case 92: return "R_IA_64_SEGREL32MSB"; - case 93: return "R_IA_64_SEGREL32LSB"; - case 94: return "R_IA_64_SEGREL64MSB"; - case 95: return "R_IA_64_SEGREL64LSB"; - case 100: return "R_IA_64_SECREL32MSB"; - case 101: return "R_IA_64_SECREL32LSB"; - case 102: return "R_IA_64_SECREL64MSB"; - case 103: return "R_IA_64_SECREL64LSB"; - case 108: return "R_IA_64_REL32MSB"; - case 109: return "R_IA_64_REL32LSB"; - case 110: return "R_IA_64_REL64MSB"; - case 111: return "R_IA_64_REL64LSB"; - case 116: return "R_IA_64_LTV32MSB"; - case 117: return "R_IA_64_LTV32LSB"; - case 118: return "R_IA_64_LTV64MSB"; - case 119: return "R_IA_64_LTV64LSB"; - case 121: return "R_IA_64_PCREL21BI"; - case 122: return "R_IA_64_PCREL22"; - case 123: return "R_IA_64_PCREL64I"; - case 128: return "R_IA_64_IPLTMSB"; - case 129: return "R_IA_64_IPLTLSB"; - case 133: return "R_IA_64_SUB"; - case 134: return "R_IA_64_LTOFF22X"; - case 135: return "R_IA_64_LDXMOV"; - case 145: return "R_IA_64_TPREL14"; - case 146: return "R_IA_64_TPREL22"; - case 147: return "R_IA_64_TPREL64I"; - case 150: return "R_IA_64_TPREL64MSB"; - case 151: return "R_IA_64_TPREL64LSB"; - case 154: return "R_IA_64_LTOFF_TPREL22"; - case 166: return "R_IA_64_DTPMOD64MSB"; - case 167: return "R_IA_64_DTPMOD64LSB"; - case 170: return "R_IA_64_LTOFF_DTPMOD22"; - case 177: return "R_IA_64_DTPREL14"; - case 178: return "R_IA_64_DTPREL22"; - case 179: return "R_IA_64_DTPREL64I"; - case 180: return "R_IA_64_DTPREL32MSB"; - case 181: return "R_IA_64_DTPREL32LSB"; - case 182: return "R_IA_64_DTPREL64MSB"; - case 183: return "R_IA_64_DTPREL64LSB"; - case 186: return "R_IA_64_LTOFF_DTPREL22"; - default: return ""; - } - case EM_MIPS: - switch(type) { - case 0: return "R_MIPS_NONE"; - case 1: return "R_MIPS_16"; - case 2: return "R_MIPS_32"; - case 3: return "R_MIPS_REL32"; - case 4: return "R_MIPS_26"; - case 5: return "R_MIPS_HI16"; - case 6: return "R_MIPS_LO16"; - case 7: return "R_MIPS_GPREL16"; - case 8: return "R_MIPS_LITERAL"; - case 9: return "R_MIPS_GOT16"; - case 10: return "R_MIPS_PC16"; - case 11: return "R_MIPS_CALL16"; - case 12: return "R_MIPS_GPREL32"; - case 21: return "R_MIPS_GOTHI16"; - case 22: return "R_MIPS_GOTLO16"; - case 30: return "R_MIPS_CALLHI16"; - case 31: return "R_MIPS_CALLLO16"; - default: return ""; - } - case EM_PPC: - switch(type) { - case 0: return "R_PPC_NONE"; - case 1: return "R_PPC_ADDR32"; - case 2: return "R_PPC_ADDR24"; - case 3: return "R_PPC_ADDR16"; - case 4: return "R_PPC_ADDR16_LO"; - case 5: return "R_PPC_ADDR16_HI"; - case 6: return "R_PPC_ADDR16_HA"; - case 7: return "R_PPC_ADDR14"; - case 8: return "R_PPC_ADDR14_BRTAKEN"; - case 9: return "R_PPC_ADDR14_BRNTAKEN"; - case 10: return "R_PPC_REL24"; - case 11: return "R_PPC_REL14"; - case 12: return "R_PPC_REL14_BRTAKEN"; - case 13: return "R_PPC_REL14_BRNTAKEN"; - case 14: return "R_PPC_GOT16"; - case 15: return "R_PPC_GOT16_LO"; - case 16: return "R_PPC_GOT16_HI"; - case 17: return "R_PPC_GOT16_HA"; - case 18: return "R_PPC_PLTREL24"; - case 19: return "R_PPC_COPY"; - case 20: return "R_PPC_GLOB_DAT"; - case 21: return "R_PPC_JMP_SLOT"; - case 22: return "R_PPC_RELATIVE"; - case 23: return "R_PPC_LOCAL24PC"; - case 24: return "R_PPC_UADDR32"; - case 25: return "R_PPC_UADDR16"; - case 26: return "R_PPC_REL32"; - case 27: return "R_PPC_PLT32"; - case 28: return "R_PPC_PLTREL32"; - case 29: return "R_PPC_PLT16_LO"; - case 30: return "R_PPC_PLT16_HI"; - case 31: return "R_PPC_PLT16_HA"; - case 32: return "R_PPC_SDAREL16"; - case 33: return "R_PPC_SECTOFF"; - case 34: return "R_PPC_SECTOFF_LO"; - case 35: return "R_PPC_SECTOFF_HI"; - case 36: return "R_PPC_SECTOFF_HA"; - case 67: return "R_PPC_TLS"; - case 68: return "R_PPC_DTPMOD32"; - case 69: return "R_PPC_TPREL16"; - case 70: return "R_PPC_TPREL16_LO"; - case 71: return "R_PPC_TPREL16_HI"; - case 72: return "R_PPC_TPREL16_HA"; - case 73: return "R_PPC_TPREL32"; - case 74: return "R_PPC_DTPREL16"; - case 75: return "R_PPC_DTPREL16_LO"; - case 76: return "R_PPC_DTPREL16_HI"; - case 77: return "R_PPC_DTPREL16_HA"; - case 78: return "R_PPC_DTPREL32"; - case 79: return "R_PPC_GOT_TLSGD16"; - case 80: return "R_PPC_GOT_TLSGD16_LO"; - case 81: return "R_PPC_GOT_TLSGD16_HI"; - case 82: return "R_PPC_GOT_TLSGD16_HA"; - case 83: return "R_PPC_GOT_TLSLD16"; - case 84: return "R_PPC_GOT_TLSLD16_LO"; - case 85: return "R_PPC_GOT_TLSLD16_HI"; - case 86: return "R_PPC_GOT_TLSLD16_HA"; - case 87: return "R_PPC_GOT_TPREL16"; - case 88: return "R_PPC_GOT_TPREL16_LO"; - case 89: return "R_PPC_GOT_TPREL16_HI"; - case 90: return "R_PPC_GOT_TPREL16_HA"; - case 101: return "R_PPC_EMB_NADDR32"; - case 102: return "R_PPC_EMB_NADDR16"; - case 103: return "R_PPC_EMB_NADDR16_LO"; - case 104: return "R_PPC_EMB_NADDR16_HI"; - case 105: return "R_PPC_EMB_NADDR16_HA"; - case 106: return "R_PPC_EMB_SDAI16"; - case 107: return "R_PPC_EMB_SDA2I16"; - case 108: return "R_PPC_EMB_SDA2REL"; - case 109: return "R_PPC_EMB_SDA21"; - case 110: return "R_PPC_EMB_MRKREF"; - case 111: return "R_PPC_EMB_RELSEC16"; - case 112: return "R_PPC_EMB_RELST_LO"; - case 113: return "R_PPC_EMB_RELST_HI"; - case 114: return "R_PPC_EMB_RELST_HA"; - case 115: return "R_PPC_EMB_BIT_FLD"; - case 116: return "R_PPC_EMB_RELSDA"; - default: return ""; - } - case EM_SPARC: - case EM_SPARCV9: - switch(type) { - case 0: return "R_SPARC_NONE"; - case 1: return "R_SPARC_8"; - case 2: return "R_SPARC_16"; - case 3: return "R_SPARC_32"; - case 4: return "R_SPARC_DISP8"; - case 5: return "R_SPARC_DISP16"; - case 6: return "R_SPARC_DISP32"; - case 7: return "R_SPARC_WDISP30"; - case 8: return "R_SPARC_WDISP22"; - case 9: return "R_SPARC_HI22"; - case 10: return "R_SPARC_22"; - case 11: return "R_SPARC_13"; - case 12: return "R_SPARC_LO10"; - case 13: return "R_SPARC_GOT10"; - case 14: return "R_SPARC_GOT13"; - case 15: return "R_SPARC_GOT22"; - case 16: return "R_SPARC_PC10"; - case 17: return "R_SPARC_PC22"; - case 18: return "R_SPARC_WPLT30"; - case 19: return "R_SPARC_COPY"; - case 20: return "R_SPARC_GLOB_DAT"; - case 21: return "R_SPARC_JMP_SLOT"; - case 22: return "R_SPARC_RELATIVE"; - case 23: return "R_SPARC_UA32"; - case 24: return "R_SPARC_PLT32"; - case 25: return "R_SPARC_HIPLT22"; - case 26: return "R_SPARC_LOPLT10"; - case 27: return "R_SPARC_PCPLT32"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 20 17:25:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC72B43F11; Fri, 20 May 2016 17:25:38 +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 5CDBB1ECE; Fri, 20 May 2016 17:25:38 +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 u4KHPbAe083540; Fri, 20 May 2016 17:25:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHPaXs083536; Fri, 20 May 2016 17:25:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605201725.u4KHPaXs083536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 May 2016 17:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300312 - in stable/10/sys/dev: ahci sound/pci/hda usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:25:38 -0000 Author: mav Date: Fri May 20 17:25:36 2016 New Revision: 300312 URL: https://svnweb.freebsd.org/changeset/base/300312 Log: MFC r298983: Add some device IDs from Intel Sunrise Point chipsets. Modified: stable/10/sys/dev/ahci/ahci_pci.c stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/hda/hdac.h stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci_pci.c Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/ahci/ahci_pci.c Fri May 20 17:25:36 2016 (r300312) @@ -176,6 +176,15 @@ static const struct { {0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9d038086, 0x00, "Intel Sunrise Point-LP", 0}, + {0x9d058086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, + {0x9d078086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, + {0xa1028086, 0x00, "Intel Sunrise Point", 0}, + {0xa1038086, 0x00, "Intel Sunrise Point", 0}, + {0xa1058086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa1068086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa1078086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa10f8086, 0x00, "Intel Sunrise Point (RAID)", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Fri May 20 17:25:36 2016 (r300312) @@ -93,6 +93,8 @@ static const struct { { HDA_INTEL_WELLS2, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_LPTLP2, "Intel Lynx Point-LP", 0, 0 }, + { HDA_INTEL_SRPTLP, "Intel Sunrise Point-LP", 0, 0 }, + { HDA_INTEL_SRPT, "Intel Sunrise Point", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Fri May 20 17:25:36 2016 (r300312) @@ -69,6 +69,8 @@ #define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) #define HDA_INTEL_LPTLP2 HDA_MODEL_CONSTRUCT(INTEL, 0x9c21) #define HDA_INTEL_BDW2 HDA_MODEL_CONSTRUCT(INTEL, 0x9ca0) +#define HDA_INTEL_SRPTLP HDA_MODEL_CONSTRUCT(INTEL, 0x9d70) +#define HDA_INTEL_SRPT HDA_MODEL_CONSTRUCT(INTEL, 0xa170) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Fri May 20 17:25:36 2016 (r300312) @@ -122,6 +122,8 @@ xhci_pci_match(device_t self) return ("Intel Wellsburg USB 3.0 controller"); case 0x9cb18086: return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller"); + case 0xa12f8086: + return ("Intel Sunrise Point USB 3.0 controller"); case 0xa01b177d: return ("Cavium ThunderX USB 3.0 controller"); From owner-svn-src-all@freebsd.org Fri May 20 17:34:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF5B8B44195 for ; Fri, 20 May 2016 17:34:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm16.bullet.mail.bf1.yahoo.com (nm16.bullet.mail.bf1.yahoo.com [98.139.212.175]) (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 88E6014AD for ; Fri, 20 May 2016 17:34:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463765672; bh=IFdVQLf22c9kr/1wU/QAgV0pMim6gZSIhWcb/AGGlbk=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=P4xd6OJsoz0EhocLnw48Rk0J8vE8UeADoQAFnAz8r8FcVuwLginDQ9NbMciFj8HYrfFczhrGyob+eOVD7yPHXfMI/FFphT/cNteTbvbR/wMM6yOcK57hp1lEqc6VnmoLYH0CiHtHL07Te414SWOaUHmRKscbPlt+XuHJHJU9MQywDmrT6vy8Asu+LIyqJSwP7ZrNvY8GZkbP4ikLZXu43dUcM+jY5qW7CMWLeXC3dB3WvIIv0CL+1kzMnyIQgrPYElAFWdCz7RU0yEeKbvMKyll8+bvKbn9HS5L02ScHz/ORgmVpTnrA7Fr1fNhCCz7zI3JYce7IwED9MkB7/UqTKg== Received: from [98.139.170.180] by nm16.bullet.mail.bf1.yahoo.com with NNFMP; 20 May 2016 17:34:32 -0000 Received: from [98.139.213.15] by tm23.bullet.mail.bf1.yahoo.com with NNFMP; 20 May 2016 17:34:32 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 20 May 2016 17:34:32 -0000 X-Yahoo-Newman-Id: 473870.80636.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 3WU8rb8VM1lY7hoTE8hwQP4idvlchkjaTnfkbedEQDzaeA1 _lamePthw2oGQbvY3zawhpqKsfulk9MKut_ooJSf9NAG2Y8iZgbZq.1kL5De keo3Y5qEQJO.NUTs7O9EgNl.PjAILLZvQaeYmMUdnZANK0d720TF.QWtTS7b zQXrwdS1meQczgmzZVJqum.2PXnEOzQTNd0c8WHuiG1Y0Zwv9L0Irvn5WN3J bDGLHMtOdHVLr7Kz_YEXoxMjD4k2UBHNn8oiAKvAe0B0YDLYblPcKYro15Sm ElNOHv3eA0MoRmDCC.P4VNd.bGPucXj3Xdynw7VNEEY2J0CORfRO4gb2Qt9B dPjTgZ6a_Rf4hA1q7BGdSQKKm_8utxWTtmcDrcoKENuzGy8wKIdEzZQDlqSO bEnu9GJb7YEYzWSFOEZBwEuWC6gYGv37EPLj0OPK905Gmi8DLY.yoPZ1Vufh KLxq.CyctBmI.pl27FBFfMNrWnCQXJsSx7stTRWv5ghRrPNV0e4xD0.QQdZc ikFhUNiYJ6AZwI0.5KGcVQIO6mszERvg- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300301 - head/contrib/gcc To: Ed Schouten References: <201605201436.u4KEanoi031012@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <573F4AA9.5070808@FreeBSD.org> Date: Fri, 20 May 2016 12:34:33 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:34:39 -0000 On 20/05/2016 12:23, Ed Schouten wrote: > Hi Pedro, > > 2016-05-20 16:36 GMT+02:00 Pedro F. Giffuni : >> + tree anon = NULL_TREE; > This initialization shouldn't be needed, right? The value is always > assigned before used. > Oh wait .. the patch is incomplete .. the code is a no-op. Pedro. From owner-svn-src-all@freebsd.org Fri May 20 17:35:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 268FBB441ED; Fri, 20 May 2016 17:35:42 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B17FE1774; Fri, 20 May 2016 17:35:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KHZeOj086677; Fri, 20 May 2016 17:35:40 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHZdLw086660; Fri, 20 May 2016 17:35:39 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201605201735.u4KHZdLw086660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 20 May 2016 17:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300313 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/mk/sys usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:35:42 -0000 Author: sjg Date: Fri May 20 17:35:39 2016 New Revision: 300313 URL: https://svnweb.freebsd.org/changeset/base/300313 Log: Merge bmake-20160512 Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/arch.c head/contrib/bmake/bmake.1 head/contrib/bmake/bmake.cat1 head/contrib/bmake/compat.c head/contrib/bmake/job.c head/contrib/bmake/main.c head/contrib/bmake/make.1 head/contrib/bmake/meta.c head/contrib/bmake/meta.h head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/auto.dep.mk head/contrib/bmake/mk/autodep.mk head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/dpadd.mk head/contrib/bmake/mk/final.mk head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/init.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/lib.mk head/contrib/bmake/mk/libnames.mk head/contrib/bmake/mk/meta.autodep.mk head/contrib/bmake/mk/meta.sys.mk head/contrib/bmake/mk/meta2deps.py head/contrib/bmake/mk/nls.mk head/contrib/bmake/mk/own.mk head/contrib/bmake/mk/prog.mk head/contrib/bmake/mk/subdir.mk head/contrib/bmake/mk/sys.mk head/contrib/bmake/mk/sys/AIX.mk head/contrib/bmake/mk/sys/Darwin.mk head/contrib/bmake/mk/sys/Generic.mk head/contrib/bmake/mk/sys/HP-UX.mk head/contrib/bmake/mk/sys/IRIX.mk head/contrib/bmake/mk/sys/Linux.mk head/contrib/bmake/mk/sys/NetBSD.mk head/contrib/bmake/mk/sys/OSF1.mk head/contrib/bmake/mk/sys/OpenBSD.mk head/contrib/bmake/mk/sys/SunOS.mk head/contrib/bmake/mk/sys/UnixWare.mk head/contrib/bmake/mk/warnings.mk head/contrib/bmake/parse.c head/contrib/bmake/str.c head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/ChangeLog Fri May 20 17:35:39 2016 (r300313) @@ -1,3 +1,26 @@ +2016-05-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160512 + Merge with NetBSD make, pick up + o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS + this is useful for gcov builds. + o propagate errors from filemon(4). + +2016-05-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160509 + Merge with NetBSD make, pick up + o remove use of non-standard types u_int etc. + o meta.c: apply realpath() before matching against metaIgnorePaths + +2016-04-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160404 + Merge with NetBSD make, pick up + o allow makefile to set .MAKE.JOBS + + * Makefile (PROG_NAME): use ${_MAKE_VERSION} + 2016-03-15 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160315 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/Makefile Fri May 20 17:35:39 2016 (r300313) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.58 2016/03/15 23:39:12 sjg Exp $ +# $Id: Makefile,v 1.63 2016/05/12 20:34:46 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160315 +_MAKE_VERSION= 20160512 PROG= bmake @@ -131,9 +131,9 @@ OPTIONS_DEFAULT_NO+= \ .include .if ${MK_PROG_VERSION} == "yes" -PROG_NAME= ${PROG}-${MAKE_VERSION} +PROG_NAME= ${PROG}-${_MAKE_VERSION} .if ${MK_PROG_LINK} == "yes" -SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG} +SYMLINKS+= ${PROG_NAME} ${BINDIR}/${PROG} .endif .endif Modified: head/contrib/bmake/arch.c ============================================================================== --- head/contrib/bmake/arch.c Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/arch.c Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"); #endif #endif /* not lint */ #endif @@ -832,7 +832,7 @@ ArchSVR4Entry(Arch *ar, char *name, size } if (DEBUG(ARCH)) { fprintf(debug_file, "Found svr4 archive name table with %lu entries\n", - (u_long)entry); + (unsigned long)entry); } return 0; } @@ -850,7 +850,7 @@ ArchSVR4Entry(Arch *ar, char *name, size if (entry >= ar->fnamesize) { if (DEBUG(ARCH)) { fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n", - name, (u_long)ar->fnamesize); + name, (unsigned long)ar->fnamesize); } return 2; } Modified: head/contrib/bmake/bmake.1 ============================================================================== --- head/contrib/bmake/bmake.1 Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/bmake.1 Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ +.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 19, 2016 +.Dd May 10, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -913,6 +913,9 @@ Provides a list of path prefixes that sh because the contents are expected to change over time. The default list includes: .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp +.It Va .MAKE.META.IGNORE_PATTERNS +Provides a list of patterns to match against pathnames. +Ignore any that match. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: Modified: head/contrib/bmake/bmake.cat1 ============================================================================== --- head/contrib/bmake/bmake.cat1 Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/bmake.cat1 Fri May 20 17:35:39 2016 (r300313) @@ -586,6 +586,10 @@ VVAARRIIAABBLLEE AASSSSIIGG The default list includes: `_/_d_e_v _/_e_t_c _/_p_r_o_c _/_t_m_p _/_v_a_r_/_r_u_n _/_v_a_r_/_t_m_p' + _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___P_A_T_T_E_R_N_S + Provides a list of patterns to match against pathnames. + Ignore any that match. + _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -1471,4 +1475,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 February 19, 2016 NetBSD 5.1 +NetBSD 5.1 May 10, 2016 NetBSD 5.1 Modified: head/contrib/bmake/compat.c ============================================================================== --- head/contrib/bmake/compat.c Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/compat.c Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -586,7 +586,8 @@ Compat_Make(void *gnp, void *pgnp) } #ifdef USE_META if (useMeta && !NoExecute(gn)) { - meta_job_finish(NULL); + if (meta_job_finish(NULL) != 0) + gn->made = ERROR; } #endif Modified: head/contrib/bmake/job.c ============================================================================== --- head/contrib/bmake/job.c Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/job.c Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1072,7 +1072,11 @@ JobFinish (Job *job, WAIT_T status) #ifdef USE_META if (useMeta) { - meta_job_finish(job); + int x; + + if ((x = meta_job_finish(job)) != 0 && status == 0) { + status = x; + } } #endif Modified: head/contrib/bmake/main.c ============================================================================== --- head/contrib/bmake/main.c Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/main.c Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.242 2016/03/07 21:45:43 christos Exp $ */ +/* $NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.242 2016/03/07 21:45:43 christos Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.242 2016/03/07 21:45:43 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1152,14 +1152,6 @@ main(int argc, char **argv) } /* - * Be compatible if user did not specify -j and did not explicitly - * turned compatibility on - */ - if (!compatMake && !forceJobs) { - compatMake = TRUE; - } - - /* * Initialize archive, target and suffix modules in preparation for * parsing the makefile(s) */ @@ -1275,6 +1267,36 @@ main(int argc, char **argv) Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL); free(p1); + if (!forceJobs && !compatMake && + Var_Exists(".MAKE.JOBS", VAR_GLOBAL)) { + char *value; + int n; + + value = Var_Subst(NULL, "${.MAKE.JOBS}", VAR_GLOBAL, VARF_WANTRES); + n = strtol(value, NULL, 0); + if (n < 1) { + (void)fprintf(stderr, "%s: illegal value for .MAKE.JOBS -- must be positive integer!\n", + progname); + exit(1); + } + if (n != maxJobs) { + Var_Append(MAKEFLAGS, "-j", VAR_GLOBAL); + Var_Append(MAKEFLAGS, value, VAR_GLOBAL); + } + maxJobs = n; + maxJobTokens = maxJobs; + forceJobs = TRUE; + free(value); + } + + /* + * Be compatible if user did not specify -j and did not explicitly + * turned compatibility on + */ + if (!compatMake && !forceJobs) { + compatMake = TRUE; + } + if (!compatMake) Job_ServerStart(maxJobTokens, jp_0, jp_1); if (DEBUG(JOB)) Modified: head/contrib/bmake/make.1 ============================================================================== --- head/contrib/bmake/make.1 Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/make.1 Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ +.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 19, 2016 +.Dd May 10, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -924,6 +924,9 @@ Provides a list of path prefixes that sh because the contents are expected to change over time. The default list includes: .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp +.It Va .MAKE.META.IGNORE_PATTERNS +Provides a list of patterns to match against pathnames. +Ignore any that match. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/meta.c Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.54 2016/03/11 07:01:21 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.57 2016/05/12 20:28:34 sjg Exp $ */ /* * Implement 'meta' mode. @@ -66,6 +66,9 @@ static char *metaIgnorePathsStr; /* stri #ifndef MAKE_META_IGNORE_PATHS #define MAKE_META_IGNORE_PATHS ".MAKE.META.IGNORE_PATHS" #endif +#ifndef MAKE_META_IGNORE_PATTERNS +#define MAKE_META_IGNORE_PATTERNS ".MAKE.META.IGNORE_PATTERNS" +#endif Boolean useMeta = FALSE; static Boolean useFilemon = FALSE; @@ -73,6 +76,7 @@ static Boolean writeMeta = FALSE; static Boolean metaEnv = FALSE; /* don't save env unless asked */ static Boolean metaVerbose = FALSE; static Boolean metaIgnoreCMDs = FALSE; /* ignore CMDs in .meta files */ +static Boolean metaIgnorePatterns = FALSE; /* do we need to do pattern matches */ static Boolean metaCurdirOk = FALSE; /* write .meta in .CURDIR Ok? */ static Boolean metaSilent = FALSE; /* if we have a .meta be SILENT */ @@ -157,28 +161,33 @@ filemon_open(BuildMon *pbm) * Read the build monitor output file and write records to the target's * metadata file. */ -static void +static int filemon_read(FILE *mfp, int fd) { char buf[BUFSIZ]; int n; + int error; /* Check if we're not writing to a meta data file.*/ if (mfp == NULL) { if (fd >= 0) close(fd); /* not interested */ - return; + return 0; } /* rewind */ (void)lseek(fd, (off_t)0, SEEK_SET); + error = 0; fprintf(mfp, "\n-- filemon acquired metadata --\n"); while ((n = read(fd, buf, sizeof(buf))) > 0) { - fwrite(buf, 1, n, mfp); + if ((int)fwrite(buf, 1, n, mfp) < n) + error = EIO; } fflush(mfp); - close(fd); + if (close(fd) < 0) + error = errno; + return error; } #endif @@ -620,6 +629,15 @@ meta_mode_init(const char *make_mode) if (metaIgnorePathsStr) { str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr, NULL); } + + /* + * We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS} + */ + cp = NULL; + if (Var_Value(MAKE_META_IGNORE_PATTERNS, VAR_GLOBAL, &cp)) { + metaIgnorePatterns = TRUE; + free(cp); + } } /* @@ -744,27 +762,35 @@ meta_job_output(Job *job, char *cp, cons } } -void +int meta_cmd_finish(void *pbmp) { + int error = 0; #ifdef USE_FILEMON BuildMon *pbm = pbmp; + int x; if (!pbm) pbm = &Mybm; if (pbm->filemon_fd >= 0) { - close(pbm->filemon_fd); - filemon_read(pbm->mfp, pbm->mon_fd); + if (close(pbm->filemon_fd) < 0) + error = errno; + x = filemon_read(pbm->mfp, pbm->mon_fd); + if (error == 0 && x != 0) + error = x; pbm->filemon_fd = pbm->mon_fd = -1; } #endif + return error; } -void +int meta_job_finish(Job *job) { BuildMon *pbm; + int error = 0; + int x; if (job != NULL) { pbm = &job->bm; @@ -772,11 +798,14 @@ meta_job_finish(Job *job) pbm = &Mybm; } if (pbm->mfp != NULL) { - meta_cmd_finish(pbm); - fclose(pbm->mfp); + error = meta_cmd_finish(pbm); + x = fclose(pbm->mfp); + if (error == 0 && x != 0) + error = errno; pbm->mfp = NULL; pbm->meta_fname[0] = '\0'; } + return error; } void @@ -1209,14 +1238,35 @@ meta_oodate(GNode *gn, Boolean oodate) * be part of the dependencies because * they are _expected_ to change. */ - if (*p == '/' && - Lst_ForEach(metaIgnorePaths, prefix_match, p)) { + if (*p == '/') { + realpath(p, fname1); /* clean it up */ + if (Lst_ForEach(metaIgnorePaths, prefix_match, fname1)) { #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: ignoring: %s\n", - p); + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: ignoring path: %s\n", + p); #endif - break; + break; + } + } + + if (metaIgnorePatterns) { + char *pm; + + snprintf(fname1, sizeof(fname1), + "${%s:@m@${%s:L:M$m}@}", + MAKE_META_IGNORE_PATTERNS, p); + pm = Var_Subst(NULL, fname1, gn, VARF_WANTRES); + if (*pm) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: ignoring pattern: %s\n", + p); +#endif + free(pm); + break; + } + free(pm); } /* Modified: head/contrib/bmake/meta.h ============================================================================== --- head/contrib/bmake/meta.h Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/meta.h Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.h,v 1.4 2016/03/07 21:45:43 christos Exp $ */ +/* $NetBSD: meta.h,v 1.5 2016/05/12 20:28:34 sjg Exp $ */ /* * Things needed for 'meta' mode. @@ -48,8 +48,8 @@ void meta_job_start(struct Job *, GNode void meta_job_child(struct Job *); void meta_job_error(struct Job *, GNode *, int, int); void meta_job_output(struct Job *, char *, const char *); -void meta_cmd_finish(void *); -void meta_job_finish(struct Job *); +int meta_cmd_finish(void *); +int meta_job_finish(struct Job *); Boolean meta_oodate(GNode *, Boolean); void meta_compat_start(void); void meta_compat_child(void); Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/mk/ChangeLog Fri May 20 17:35:39 2016 (r300313) @@ -1,3 +1,57 @@ +2016-05-12 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160512 + + * dpadd.mk: always include local.dpadd.mk if it exists + remove some things that better belong in local.dpadd.mk + skip INCLUDES_* for staged libs unless SRC_* defined. + + * own.mk: add INCLUDEDIR + +2016-04-18 Simon J. Gerraty + + * dirdeps.mk: when doing -f dirdeps.mk if target suppies no + TARGET_MACHINE - :E will be empty or match part of path, use + ${MACHINE} + +2016-04-07 Simon J. Gerraty + + * meta.autodep.mk: issue a warning if UPDATE_DEPENDFILE=NO due to + NO_FILEMON_COOKIE + + * dirdeps.mk: move the logic that allows for + make -f dirdeps.mk some/dir.${TARGET_SPEC} + inside the check for !target(_DIRDEP_USE) + +2016-04-04 Simon J. Gerraty + + * Use <> when including local*.mk and others which may exist + elsewhere so that user can better control what they get. + + * meta.autodep.mk (NO_FILEMON_COOKIE): + create a cookie if we ever build dir with nofilemon + so that UPDATE_DEPENDFILE will be forced to NO until cleaned. + +2016-04-01 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160401 + + * meta2deps.py: fix old print statement when debugging. + + * gendirdeps.mk: META2DEPS_CMD append M2D_EXCLUDES with -X + patch from Bryan Drewery + +2016-03-22 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160317 (St. Pats) + + * warnings.mk: g++ does not like -Wimplicit + + * sys.mk sys/*.mk lib.mk prog.mk: use CXX_SUFFIXES to handle the + pelthora of common suffixes for C++ + + * lib.mk: use .So for shared objects + 2016-03-15 Simon J. Gerraty * install-mk (MK_VERSION): 20160315 Modified: head/contrib/bmake/mk/auto.dep.mk ============================================================================== --- head/contrib/bmake/mk/auto.dep.mk Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/mk/auto.dep.mk Fri May 20 17:35:39 2016 (r300313) @@ -1,6 +1,6 @@ # # RCSid: -# $Id: auto.dep.mk,v 1.4 2016/02/18 21:16:39 sjg Exp $ +# $Id: auto.dep.mk,v 1.5 2016/04/05 15:58:37 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty # @@ -66,7 +66,7 @@ ${.MAKE.DEPENDFILE}: ${OBJS} ${POBJS} ${ .if empty(_SKIP_BUILD) _all_objs = ${OBJS} ${POBJS} ${SOBJS} .for d in ${_all_objs:M*o:T:O:u:%=%.d} -.dinclude "$d" +.dinclude <$d> .endfor .endif Modified: head/contrib/bmake/mk/autodep.mk ============================================================================== --- head/contrib/bmake/mk/autodep.mk Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/mk/autodep.mk Fri May 20 17:35:39 2016 (r300313) @@ -1,6 +1,6 @@ # # RCSid: -# $Id: autodep.mk,v 1.34 2014/08/04 05:12:27 sjg Exp $ +# $Id: autodep.mk,v 1.36 2016/04/05 15:58:37 sjg Exp $ # # @(#) Copyright (c) 1999-2010, Simon J. Gerraty # @@ -25,7 +25,11 @@ __${.PARSEFILE}__: DEPENDFILE?= .depend .for d in ${DEPENDFILE:N.depend} # bmake only groks .depend -.-include "$d" +.if ${MAKE_VERSION} < 20160218 +.-include <$d> +.else +.dinclude <$d> +.endif .endfor # it does nothing if SRCS is not defined or is empty @@ -75,6 +79,9 @@ CXXFLAGS_MD=${CXXFLAGS:M-[IUD]*} ${CPPFL CC_MD?=${CC} CXX_MD?=${CXX} +# should have been set by sys.mk +CXX_SUFFIXES?= .cc .cpp .cxx .C + # so we can do an explicit make depend, but not otherwise .if make(depend) .SUFFIXES: .d @@ -100,7 +107,7 @@ CXX_MD?=${CXX} @echo updating dependencies for $< @${SHELL} -ec "${CC_MD} -M ${CPPFLAGS_MD} ${AINC} $< | sed '/:/s/^/$@ /' > $@" || { ${RM} -f $@; false; } -.cc.d .cpp.d .C.d .cxx.d: +${CXX_SUFFIXES:%=%.d}: @echo updating dependencies for $< @${SHELL} -ec "${CXX_MD} -M ${CXXFLAGS_MD} $< | sed '/:/s/^/$@ /' > $@" || { ${RM} -f $@; false; } .else @@ -120,7 +127,7 @@ CXX_MD?=${CXX} .s.d .S.d: ${CC_MD} ${CFLAGS_MD:S/D//} ${CPPFLAGS_MD} ${AINC} $< > $@ || { ${RM} -f $@; false; } -.cc.d .cpp.d .C.d .cxx.d: +${CXX_SUFFIXES:%=%.d}: ${CXX_MD} ${CFLAGS_MD:S/D//} ${CXXFLAGS_MD} $< > $@ || { ${RM} -f $@; false; } .endif Modified: head/contrib/bmake/mk/dirdeps.mk ============================================================================== --- head/contrib/bmake/mk/dirdeps.mk Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/mk/dirdeps.mk Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $ +# $Id: dirdeps.mk,v 1.67 2016/04/18 21:50:47 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -121,6 +121,26 @@ _DIRDEP_USE_LEVEL?= 0 # and non-specific Makefile.depend* .if !target(_DIRDEP_USE) + +.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" +# This little trick let's us do +# +# mk -f dirdeps.mk some/dir.${TARGET_SPEC} +# +all: +${.TARGETS:Nall}: all +DIRDEPS := ${.TARGETS:M*[/.]*} +# so that -DNO_DIRDEPS works +DEP_RELDIR := ${DIRDEPS:[1]:R} +# this will become DEP_MACHINE below +TARGET_MACHINE := ${DIRDEPS:[1]:E:C/,.*//} +.if ${TARGET_MACHINE:N*/*} == "" +TARGET_MACHINE := ${MACHINE} +.endif +# disable DIRDEPS_CACHE as it does not like this trick +MK_DIRDEPS_CACHE = no +.endif + # make sure we get the behavior we expect .MAKE.SAVE_DOLLARS = no @@ -244,20 +264,6 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_tspec DEP_MACHINE := ${_DEP_TARGET_SPEC} .endif -.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" -# This little trick let's us do -# -# mk -f dirdeps.mk some/dir.${TARGET_SPEC} -# -all: -${.TARGETS:Nall}: all -DIRDEPS := ${.TARGETS:M*/*} -# so that -DNO_DIRDEPS works -DEP_RELDIR := ${DIRDEPS:R:[1]} -# disable DIRDEPS_CACHE as it does not like this trick -MK_DIRDEPS_CACHE = no -.endif - # reset each time through _build_all_dirs = @@ -284,7 +290,7 @@ _DEP_RELDIR := ${DEP_RELDIR} # pickup customizations # as below you can use !target(_DIRDEP_USE) to protect things # which should only be done once. -.-include "local.dirdeps.mk" +.-include .if !target(_DIRDEP_USE) # things we skip for host tools @@ -304,7 +310,13 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} -.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +.if defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +NO_DIRDEPS = +.elif defined(WITHOUT_DIRDEPS_BELOW) +NO_DIRDEPS_BELOW = +.endif + +.if defined(NO_DIRDEPS) # confine ourselves to the original dir and below. DIRDEPS_FILTER += M${_DEP_RELDIR}* .elif defined(NO_DIRDEPS_BELOW) @@ -370,7 +382,7 @@ MK_DIRDEPS_CACHE ?= no BUILD_DIRDEPS_CACHE ?= no BUILD_DIRDEPS ?= yes -.if !defined(NO_DIRDEPS) +.if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} == "yes" # this is where we will cache all our work DIRDEPS_CACHE?= ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} @@ -452,7 +464,7 @@ _this_dir := ${SRCTOP}/${DEP_RELDIR} # on rare occasions, there can be a need for extra help _dep_hack := ${_this_dir}/${.MAKE.DEPENDFILE_PREFIX}.inc -.-include "${_dep_hack}" +.-include <${_dep_hack}> .if ${DEP_RELDIR} != ${_DEP_RELDIR} || ${DEP_TARGET_SPEC} != ${TARGET_SPEC} # this should be all Modified: head/contrib/bmake/mk/dpadd.mk ============================================================================== --- head/contrib/bmake/mk/dpadd.mk Fri May 20 17:25:36 2016 (r300312) +++ head/contrib/bmake/mk/dpadd.mk Fri May 20 17:35:39 2016 (r300313) @@ -1,4 +1,4 @@ -# $Id: dpadd.mk,v 1.19 2014/04/05 22:56:54 sjg Exp $ +# $Id: dpadd.mk,v 1.21 2016/05/18 20:54:55 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -21,71 +21,91 @@ __${.PARSEFILE}__: _OBJDIR?= ${.OBJDIR} _CURDIR?= ${.CURDIR} +.if ${_CURDIR} == ${SRCTOP} +RELDIR=. +RELTOP=. +.else +RELDIR?= ${_CURDIR:S,${SRCTOP}/,,} +.if ${RELDIR} == ${_CURDIR} +RELDIR?= ${_OBJDIR:S,${OBJTOP}/,,} +.endif +RELTOP?= ${RELDIR:C,[^/]+,..,g} +.endif +RELOBJTOP?= ${OBJTOP} +RELSRCTOP?= ${SRCTOP} + +# we get included just about everywhere so this is handy... +# C*DEBUG_XTRA are for defining on cmd line etc +# so do not use in makefiles. +.ifdef CFLAGS_DEBUG_XTRA +CFLAGS_LAST += ${CFLAGS_DEBUG_XTRA} +.endif +.ifdef CXXFLAGS_DEBUG_XTRA +CXXFLAGS_LAST += ${CXXFLAGS_DEBUG_XTRA} +.endif + +.-include + # DPLIBS helps us ensure we keep DPADD and LDADD in sync DPLIBS+= ${DPLIBS_LAST} -DPADD+= ${DPLIBS} +DPADD+= ${DPLIBS:N-*} .for __lib in ${DPLIBS:T:R} -LDADD+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} +.if "${_lib:M-*}" != "" +LDADD += ${__lib} +.else +LDADD += ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} +.endif .endfor # DPADD can contain things other than libs -__dpadd_libs = ${DPADD:M*/lib*} +__dpadd_libs := ${DPADD:M*/lib*} # some libs have dependencies... # DPLIBS_* allows bsd.libnames.mk to flag libs which must be included # in DPADD for a given library. -.for __lib in ${__dpadd_libs:@d@${DPLIBS_${d:T:R}}@} +# Gather all such dependencies into __ldadd_all_xtras +# dups will be dealt with later. +# Note: libfoo_pic uses DPLIBS_libfoo +__ldadd_all_xtras= +.for __lib in ${__dpadd_libs:@d@${DPLIBS_${d:T:R:S,_pic,,}}@} +__ldadd_all_xtras+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} .if "${DPADD:M${__lib}}" == "" DPADD+= ${__lib} -LDADD+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}} .endif .endfor # Last of all... for libc and libgcc DPADD+= ${DPADD_LAST} +# de-dupuplicate __ldadd_all_xtras into __ldadd_xtras +# in reverse order so that libs end up listed after all that needed them. +__ldadd_xtras= +.for __lib in ${__ldadd_all_xtras:[-1..1]} +.if "${__ldadd_xtras:M${__lib}}" == "" || ${NEED_IMPLICIT_LDADD:tl:Uno} != "no" +__ldadd_xtras+= ${__lib} +.endif +.endfor + +.if !empty(__ldadd_xtras) +# now back to the original order +__ldadd_xtras:= ${__ldadd_xtras:[-1..1]} +LDADD+= ${__ldadd_xtras} +.endif + # Convert DPADD into -I and -L options and add them to CPPFLAGS and LDADD # For the -I's convert the path to a relative one. For separate objdirs # the DPADD paths will be to the obj tree so we need to subst anyway. -# If USE_PROFILE is yes, then check for profiled versions of libs -# and use them. - -USE_PROFILE?=no -.if defined(LIBDL) && exists(${LIBDL}) -.if defined(PROG) && (make(${PROG}_p) || ${USE_PROFILE} == yes) && \ - defined(LDFLAGS) && ${LDFLAGS:M-export-dynamic} -# building profiled version of a prog that needs dlopen to work -DPLIBS+= ${LIBDL} -.endif -.endif - -.if defined(LIBDMALLOC) && exists(${LIBDMALLOC}) -.if defined(USE_DMALLOC) && ${USE_DMALLOC} != no -.if !defined(NO_DMALLOC) -CPPFLAGS+= -DUSE_DMALLOC -.endif -DPLIBS+= ${LIBDMALLOC} -.endif -.endif +# update this +__dpadd_libs := ${DPADD:M*/lib*} # Order -L's to search ours first. # Avoids picking up old versions already installed. -__dpadd_libdirs := ${__dpadd_libs:R:H:S/^/-L/g:O:u:N-L} +__dpadd_libdirs := ${__dpadd_libs}:R:H:S/^/-L/g:O:u:N-L} LDADD += ${__dpadd_libdirs:M-L${OBJTOP}/*} -LDADD += ${__dpadd_libdirs:N-L${OBJTOP}/*} - -.if ${.CURDIR} == ${SRCTOP} -RELDIR=. -RELTOP=. -.else -RELDIR?= ${.CURDIR:S,${SRCTOP}/,,} -.if ${RELDIR} == ${.CURDIR} -RELDIR?= ${.OBJDIR:S,${OBJTOP}/,,} +LDADD += ${__dpadd_libdirs:N-L${OBJTOP}/*:N-L${HOST_LIBDIR:U/usr/lib}} +.if defined(HOST_LIBDIR) && ${HOST_LIBDIR} != "/usr/lib" +LDADD+= -L${HOST_LIBDIR} .endif -RELTOP?= ${RELDIR:C,[^/]+,..,g} -.endif -RELOBJTOP?= ${OBJTOP} -RELSRCTOP?= ${SRCTOP} .if !make(dpadd) .ifdef LIB @@ -109,7 +129,8 @@ __dpadd_libs += ${SRC_LIBS} DPMAGIC_LIBS += ${__dpadd_libs} \ ${__dpadd_libs:@d@${DPMAGIC_LIBS_${d:T:R}}@} -.for __lib in ${DPMAGIC_LIBS:O:u} +# we skip this for staged libs +.for __lib in ${DPMAGIC_LIBS:O:u:N${STAGE_OBJTOP:Unot}*/lib/*} # # if SRC_libfoo is not set, then we assume that the srcdir corresponding # to where we found the library is correct. @@ -127,6 +148,35 @@ INCLUDES_${__lib:T:R}?= -I${exists(${SRC .endfor +# even for staged libs we sometimes +# need to allow direct -I to avoid cicular dependencies +.for __lib in ${DPMAGIC_LIBS:O:u:T:R} +.if !empty(SRC_${__lib}) && empty(INCLUDES_${__lib}) +# must be a staged lib +.if exists(${SRC_${__lib}}/h) +INCLUDES_${__lib} = -I${SRC_${__lib}}/h +.else +INCLUDES_${__lib} = -I${SRC_${__lib}} +.endif +.endif +.endfor + +# when linking a shared lib, avoid non pic libs +SHLDADD+= ${LDADD:N-[lL]*} +.for __lib in ${__dpadd_libs:u} +.if defined(SHLIB_NAME) && ${LDADD:M-l${__lib:T:R:S,lib,,}} != "" +.if ${__lib:T:N*_pic.a:N*.so} == "" || exists(${__lib:R}.so) +SHLDADD+= -l${__lib:T:R:S,lib,,} +.elif exists(${__lib:R}_pic.a) +SHLDADD+= -l${__lib:T:R:S,lib,,}_pic +.else +.warning ${RELDIR}.${TARGET_SPEC} needs ${__lib:T:R}_pic.a +SHLDADD+= -l${__lib:T:R:S,lib,,} +.endif +SHLDADD+= -L${__lib:H} +.endif +.endfor + # Now for the bits we actually need __dpadd_incs= .for __lib in ${__dpadd_libs:u} @@ -134,20 +184,25 @@ __dpadd_incs= __ldadd=-l${__lib:T:R:S,lib,,} LDADD := ${LDADD:S,^${__ldadd}$,${__ldadd}_p,g} .endif +.endfor # -# Some libs generate headers, so we potentially need both -# the src dir and the obj dir. -# If ${INCLUDES_libfoo} contains a word ending in /h, we assume that either -# 1. it does not generate headers or -# 2. INCLUDES_libfoo will have been set correctly -# XXX it gets ugly avoiding duplicates... -# use :? to ensure .for does not prevent correct evaluation -# # We take care of duplicate suppression later. -__dpadd_incs += ${"${INCLUDES_${__lib:T:R}:M*/h}":? :-I${OBJ_${__lib:T:R}}} -__dpadd_incs += ${INCLUDES_${__lib:T:R}} -.endfor +# don't apply :T:R too early +__dpadd_incs += ${__dpadd_libs:u:@x@${INCLUDES_${x:T:R}}@} +__dpadd_incs += ${__dpadd_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_${x:T:R}}@} + +__dpadd_last_incs += ${__dpadd_libs:u:@x@${INCLUDES_LAST_${x:T:R}}@} +__dpadd_last_incs += ${__dpadd_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_LAST_${x:T:R}}@} + +.if defined(HOSTPROG) || ${MACHINE} == "host" +# we want any -I/usr/* last +__dpadd_last_incs := \ + ${__dpadd_last_incs:N-I/usr/*} \ + ${__dpadd_incs:M-I/usr/*} \ + ${__dpadd_last_incs:M-I/usr/*} +__dpadd_incs := ${__dpadd_incs:N-I/usr/*} +.endif # # eliminate any duplicates - but don't mess with the order @@ -164,13 +219,21 @@ __$t_incs+= $i .endfor .endfor +.for t in CFLAGS_LAST CXXFLAGS_LAST +# avoid duplicates +__$t_incs:=${$t:M-I*:u} +.for i in ${__dpadd_last_incs} +.if "${__$t_incs:M$i}" == "" +$t+= $i +__$t_incs+= $i +.endif +.endfor +.endfor + # This target is used to gather a list of # dir: ${DPADD} # entries .if make(*dpadd*) -# allow overrides -.-include "dpadd++.mk" - .if !target(dpadd) dpadd: .NOTMAIN .if defined(DPADD) && ${DPADD} != "" @@ -193,4 +256,17 @@ dpadd: .NOTMAIN .PATH: ${SRC_PATHADD} .endif +# after all that, if doing -n we don't care +.if ${.MAKEFLAGS:Ux:M-n} != "" +DPADD = *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 20 17:38:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB26B4427A; Fri, 20 May 2016 17:38:46 +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 1FF141971; Fri, 20 May 2016 17:38:46 +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 u4KHcjMQ086818; Fri, 20 May 2016 17:38:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHcjSQ086817; Fri, 20 May 2016 17:38:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605201738.u4KHcjSQ086817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 20 May 2016 17:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300314 - head/contrib/llvm/tools/clang/lib/Basic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:38:46 -0000 Author: dim Date: Fri May 20 17:38:45 2016 New Revision: 300314 URL: https://svnweb.freebsd.org/changeset/base/300314 Log: Pull in r270240 from upstream clang trunk (by me): Make __FreeBSD_cc_version predefined macro configurable at build time The `FreeBSDTargetInfo` class has always set the `__FreeBSD_cc_version` predefined macro to a rather static value, calculated from the major OS version. In the FreeBSD base system, we will start incrementing the value of this macro whenever we make any signifant change to clang, so we need a way to configure the macro's value at build time. Use `FREEBSD_CC_VERSION` for this, which we can define in the FreeBSD build system using either the `-D` command line option, or an include file. Stock builds will keep the earlier value. Differential Revision: http://reviews.llvm.org/D20037 Follow-up commits will start using the __FreeBSD_cc_version to determine whether a bootstrap compiler has to be built during buildworld. Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Fri May 20 17:35:39 2016 (r300313) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Fri May 20 17:38:45 2016 (r300314) @@ -296,6 +296,10 @@ public: } }; +#ifndef FREEBSD_CC_VERSION +#define FREEBSD_CC_VERSION 0U +#endif + // FreeBSD Target template class FreeBSDTargetInfo : public OSTargetInfo { @@ -306,10 +310,13 @@ protected: unsigned Release = Triple.getOSMajorVersion(); if (Release == 0U) - Release = 8; + Release = 8U; + unsigned CCVersion = FREEBSD_CC_VERSION; + if (CCVersion == 0U) + CCVersion = Release * 100000U + 1U; Builder.defineMacro("__FreeBSD__", Twine(Release)); - Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 100000U + 1U)); + Builder.defineMacro("__FreeBSD_cc_version", Twine(CCVersion)); Builder.defineMacro("__KPRINTF_ATTRIBUTE__"); DefineStd(Builder, "unix", Opts); Builder.defineMacro("__ELF__"); From owner-svn-src-all@freebsd.org Fri May 20 17:38:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F2FB4429F; Fri, 20 May 2016 17:38:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 562531A70; Fri, 20 May 2016 17:38:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KHcqDA086875; Fri, 20 May 2016 17:38:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHcqY6086873; Fri, 20 May 2016 17:38:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605201738.u4KHcqY6086873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 20 May 2016 17:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300315 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:38:53 -0000 Author: trasz Date: Fri May 20 17:38:51 2016 New Revision: 300315 URL: https://svnweb.freebsd.org/changeset/base/300315 Log: Call the ICL module's handoff method even when using ICL proxy. The upcoming iSER code uses this. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Fri May 20 17:38:45 2016 (r300314) +++ head/sys/dev/iscsi/icl_soft.c Fri May 20 17:38:51 2016 (r300315) @@ -1327,6 +1327,23 @@ icl_soft_conn_handoff(struct icl_conn *i ICL_CONN_LOCK_ASSERT_NOT(ic); +#ifdef ICL_KERNEL_PROXY + /* + * We're transitioning to Full Feature phase, and we don't + * really care. + */ + if (fd == 0) { + ICL_CONN_LOCK(ic); + if (ic->ic_socket == NULL) { + ICL_CONN_UNLOCK(ic); + ICL_WARN("proxy handoff without connect"); + return (EINVAL); + } + ICL_CONN_UNLOCK(ic); + return (0); + } +#endif + /* * Steal the socket from userland. */ Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri May 20 17:38:45 2016 (r300314) +++ head/sys/dev/iscsi/iscsi.c Fri May 20 17:38:51 2016 (r300315) @@ -1415,21 +1415,17 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ ISCSI_SESSION_UNLOCK(is); -#ifdef ICL_KERNEL_PROXY - if (handoff->idh_socket != 0) { -#endif - /* - * Handoff without using ICL proxy. - */ - error = icl_conn_handoff(ic, handoff->idh_socket); - if (error != 0) { - sx_sunlock(&sc->sc_lock); - iscsi_session_terminate(is); - return (error); - } -#ifdef ICL_KERNEL_PROXY + /* + * If we're going through the proxy, the idh_socket will be 0, + * and the ICL module can simply ignore this call. It can also + * use it to determine it's no longer in the Login phase. + */ + error = icl_conn_handoff(ic, handoff->idh_socket); + if (error != 0) { + sx_sunlock(&sc->sc_lock); + iscsi_session_terminate(is); + return (error); } -#endif sx_sunlock(&sc->sc_lock); From owner-svn-src-all@freebsd.org Fri May 20 17:41:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E618B44321; Fri, 20 May 2016 17:41:13 +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 4F8DF1D22; Fri, 20 May 2016 17:41:13 +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 u4KHfCZa087017; Fri, 20 May 2016 17:41:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHfCVF087016; Fri, 20 May 2016 17:41:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605201741.u4KHfCVF087016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 17:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300316 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:41:13 -0000 Author: jhb Date: Fri May 20 17:41:12 2016 New Revision: 300316 URL: https://svnweb.freebsd.org/changeset/base/300316 Log: Drop trailing asterisks. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 20 17:38:51 2016 (r300315) +++ head/ObsoleteFiles.inc Fri May 20 17:41:12 2016 (r300316) @@ -39,11 +39,11 @@ # done # 20160519: remove DTrace Toolkit from base -OLD_FILES+=usr/share/dtrace/toolkit/execsnoop* -OLD_FILES+=usr/share/dtrace/toolkit/hotkernel* -OLD_FILES+=usr/share/dtrace/toolkit/hotuser* -OLD_FILES+=usr/share/dtrace/toolkit/opensnoop* -OLD_FILES+=usr/share/dtrace/toolkit/procsystime* +OLD_FILES+=usr/share/dtrace/toolkit/execsnoop +OLD_FILES+=usr/share/dtrace/toolkit/hotkernel +OLD_FILES+=usr/share/dtrace/toolkit/hotuser +OLD_FILES+=usr/share/dtrace/toolkit/opensnoop +OLD_FILES+=usr/share/dtrace/toolkit/procsystime OLD_DIRS+=usr/share/dtrace/toolkit # 20160519: stale MLINK removed OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz From owner-svn-src-all@freebsd.org Fri May 20 17:52:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7466EB44720 for ; Fri, 20 May 2016 17:52:20 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm30-vm6.bullet.mail.gq1.yahoo.com (nm30-vm6.bullet.mail.gq1.yahoo.com [98.136.216.197]) (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 5034B1812 for ; Fri, 20 May 2016 17:52:20 +0000 (UTC) (envelope-from scott4long@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463766367; bh=iepk9OJGKDFD59oYxZG7lpwrS5VAE2CyPreeF5yxGbo=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=PP34c5cMFjuGh2purvFTn9XzGwjcyUU8gWnzzlVmirAe79kfEUWWdUGVFMrsQcV/Y5q4oArwX0OJVUOQct1om5igumJVCnz77Drp/l7ZPpV/UvM5FFWK4dc71/VD/iK+M3B21jSEuhRlVh3TkUGTi7fLF2y+0yiLjkFDdS935AjttGs6yqxs7wqVwMEapOu8cHa0jEkjYuL7SJOv1bWI/+lvhkiKYPlN7x7tluCLiayeSn39hYN6pQdz3YdT4T4qgM1gYeK8YXGctWv1O4MUelZ4EivXGLqVVA7db9huTflZ1Bl/liBOMnYyAnPS6nXPaq5lyKcqtEOH233wx7tcbw== Received: from [98.137.12.57] by nm30.bullet.mail.gq1.yahoo.com with NNFMP; 20 May 2016 17:46:07 -0000 Received: from [98.136.164.64] by tm2.bullet.mail.gq1.yahoo.com with NNFMP; 20 May 2016 17:46:07 -0000 Received: from [127.0.0.1] by smtp226.mail.gq1.yahoo.com with NNFMP; 20 May 2016 17:46:07 -0000 X-Yahoo-Newman-Id: 492191.52307.bm@smtp226.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: TupZuyYVM1mROoTnDSmUTQ6o7oVQq.z9eMxtOu5k_txKTpl U4JuOzYUr2niusCSQSBZ1ojaKG1i16zNJ.a..GF9D0FUgTfFMNXjF7F8SoON xNlXv9yMXmfaI.lNSW.kbM12zyIjvNsG.Cr6GNkvRz0AcjbgMY7Jm1rxcAQI gMP0MFaV60vl7Ndy1l3w8wMDP7pKO.AsgPNLl8d4W0VTJIJc4dDnV.DQdnYW d84RZmKX36NILFdq6t_o_u4cqk3A5aMZNMOZhpBX4mveg66oprgHs1K0I701 k7YUShKFTzJPRDDiOBMd1lWWQwWk0iZsCZBQixhFG88G3Oe8jK5xz5C0k_3t ITOA6X4DzgcELx6VXWiqZsiFDIxYxFCl0g3y83NZ6.Rnbmef3J.CiYiHK21E iDDoBNO0fJkLm3Y26miO4fReLOgUakZRmaXXLhtFYws1nIC8TQZgUn0H39W7 yUKxpm9E7BpFcDc37mKnarMSd56vG5WHzxBPzK77xCQ_Yq7VsVq.kLdssHV. iLRIV.GIZnsAZXAPK6fyW56IHifC2AptGyrIlvUE- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300219 - in head/sys: kern sys From: Scott Long In-Reply-To: <4596681286066293430@unknownmsgid> Date: Fri, 20 May 2016 11:46:04 -0600 Cc: Scott Long , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <20F58791-903E-48A1-A57C-D28ED10ABEBC@yahoo.com> References: <201605191714.u4JHEOnn037348@repo.freebsd.org> <4596681286066293430@unknownmsgid> To: Steven Hartland X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:52:20 -0000 Yeah, I was following existing style. Feel free to fix up if you like. Scott > On May 19, 2016, at 12:51 PM, Steven Hartland = wrote: >=20 > I thought it was considered better to use if (var =3D=3D NULL) instead = of > if (!var) for pointers as they aren't bools? >=20 >> On 19 May 2016, at 18:14, Scott Long wrote: >>=20 >> Author: scottl >> Date: Thu May 19 17:14:24 2016 >> New Revision: 300219 >> URL: https://svnweb.freebsd.org/changeset/base/300219 >>=20 >> Log: >> Adjust the creation of tq_name so it can be freed correctly >>=20 >> Reviewed by: jhb, allanjude >> Differential Revision: D6454 >>=20 >> Modified: >> head/sys/kern/subr_taskqueue.c >> head/sys/sys/taskqueue.h >>=20 >> Modified: head/sys/kern/subr_taskqueue.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/sys/kern/subr_taskqueue.c Thu May 19 17:02:33 2016 = (r300218) >> +++ head/sys/kern/subr_taskqueue.c Thu May 19 17:14:24 2016 = (r300219) >> @@ -128,16 +128,17 @@ _taskqueue_create(const char *name, int >> int mtxflags, const char *mtxname __unused) >> { >> struct taskqueue *queue; >> - char *tq_name =3D NULL; >> + char *tq_name; >>=20 >> - if (name !=3D NULL) >> - tq_name =3D strndup(name, 32, M_TASKQUEUE); >> - if (tq_name =3D=3D NULL) >> - tq_name =3D "taskqueue"; >> + tq_name =3D malloc(TASKQUEUE_NAMELEN, M_TASKQUEUE, mflags | = M_ZERO); >> + if (!tq_name) >> + return (NULL); >> + >> + snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : = "taskqueue"); >>=20 >> queue =3D malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | = M_ZERO); >> if (!queue) >> - return NULL; >> + return (NULL); >>=20 >> STAILQ_INIT(&queue->tq_queue); >> TAILQ_INIT(&queue->tq_active); >> @@ -153,7 +154,7 @@ _taskqueue_create(const char *name, int >> queue->tq_flags |=3D TQ_FLAGS_UNLOCKED_ENQUEUE; >> mtx_init(&queue->tq_mutex, tq_name, NULL, mtxflags); >>=20 >> - return queue; >> + return (queue); >> } >>=20 >> struct taskqueue * >>=20 >> Modified: head/sys/sys/taskqueue.h >> = =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/sys/sys/taskqueue.h Thu May 19 17:02:33 2016 (r300218) >> +++ head/sys/sys/taskqueue.h Thu May 19 17:14:24 2016 (r300219) >> @@ -56,6 +56,7 @@ enum taskqueue_callback_type { >> #define TASKQUEUE_CALLBACK_TYPE_MIN = TASKQUEUE_CALLBACK_TYPE_INIT >> #define TASKQUEUE_CALLBACK_TYPE_MAX = TASKQUEUE_CALLBACK_TYPE_SHUTDOWN >> #define TASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX = + 1 >> +#define TASKQUEUE_NAMELEN 32 >>=20 >> typedef void (*taskqueue_callback_fn)(void *context); >>=20 >>=20 >=20 From owner-svn-src-all@freebsd.org Fri May 20 17:57:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A10B4484A; Fri, 20 May 2016 17:57:49 +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 AABB61AFC; Fri, 20 May 2016 17:57:49 +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 u4KHvmqO093216; Fri, 20 May 2016 17:57:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHvlTK093203; Fri, 20 May 2016 17:57:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605201757.u4KHvlTK093203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 17:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300317 - in head: share/man/man9 sys/kern sys/sparc64/include sys/sys 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:57:50 -0000 Author: jhb Date: Fri May 20 17:57:47 2016 New Revision: 300317 URL: https://svnweb.freebsd.org/changeset/base/300317 Log: Add new bus methods for mapping resources. Add a pair of bus methods that can be used to "map" resources for direct CPU access using bus_space(9). bus_map_resource() creates a mapping and bus_unmap_resource() releases a previously created mapping. Mappings are described by 'struct resource_map' object. Pointers to these objects can be passed as the first argument to the bus_space wrapper API used for bus resources. Drivers that wish to map all of a resource using default settings (for example, using uncacheable memory attributes) do not need to change. However, drivers that wish to use non-default settings can now do so without jumping through hoops. First, an RF_UNMAPPED flag is added to request that a resource is not implicitly mapped with the default settings when it is activated. This permits other activation steps (such as enabling I/O or memory decoding in a device's PCI command register) to be taken without creating a mapping. Right now the AGP drivers don't set RF_ACTIVE to avoid using up a large amount of KVA to map the AGP aperture on 32-bit platforms. Once RF_UNMAPPED is supported on all platforms that support AGP this can be changed to using RF_UNMAPPED with RF_ACTIVE instead. Second, bus_map_resource accepts an optional structure that defines additional settings for a given mapping. For example, a driver can now request to map only a subset of a resource instead of the entire range. The AGP driver could also use this to only map the first page of the aperture (IIRC, it calls pmap_mapdev() directly to map the first page currently). I will also eventually change the PCI-PCI bridge driver to request mappings of the subset of the I/O window resource on its parent side to create mappings for child devices rather than passing child resources directly up to nexus to be mapped. This also permits bridges that do address translation to request suitable mappings from a resource on the "upper" side of the bus when mapping resources on the "lower" side of the bus. Another attribute that can be specified is an alternate memory attribute for memory-mapped resources. This can be used to request a Write-Combining mapping of a PCI BAR in an MI fashion. (Currently the drivers that do this call pmap_change_attr() directly for x86 only.) Note that this commit only adds the MI framework. Each platform needs to add support for handling RF_UNMAPPED and thew new bus_map/unmap_resource methods. Generally speaking, any drivers that are calling rman_set_bustag() and rman_set_bushandle() need to be updated. Discussed on: arch Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D5237 Added: head/share/man/man9/bus_map_resource.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/bus_activate_resource.9 head/share/man/man9/bus_alloc_resource.9 head/share/man/man9/rman.9 head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/kern/subr_rman.c head/sys/sparc64/include/vm.h head/sys/sys/bus.h head/sys/sys/rman.h head/sys/vm/vm.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri May 20 17:41:12 2016 (r300316) +++ head/share/man/man9/Makefile Fri May 20 17:57:47 2016 (r300317) @@ -44,6 +44,7 @@ MAN= accept_filter.9 \ bus_generic_shutdown.9 \ BUS_GET_CPUS.9 \ bus_get_resource.9 \ + bus_map_resource.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ BUS_READ_IVAR.9 \ @@ -504,6 +505,8 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dma_tag_destroy.9 MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9 MLINKS+=BUS_GET_CPUS.9 bus_get_cpus.9 +MLINKS+=bus_map_resource.9 bus_unmap_resource.9 \ + bus_map_resource.9 resource_init_map_request.9 MLINKS+=BUS_READ_IVAR.9 BUS_WRITE_IVAR.9 MLINKS+=BUS_SETUP_INTR.9 bus_setup_intr.9 \ BUS_SETUP_INTR.9 BUS_TEARDOWN_INTR.9 \ @@ -1381,6 +1384,7 @@ MLINKS+=rman.9 rman_activate_resource.9 rman.9 rman_get_device.9 \ rman.9 rman_get_end.9 \ rman.9 rman_get_flags.9 \ + rman.9 rman_get_mapping.9 \ rman.9 rman_get_rid.9 \ rman.9 rman_get_size.9 \ rman.9 rman_get_start.9 \ @@ -1396,6 +1400,7 @@ MLINKS+=rman.9 rman_activate_resource.9 rman.9 rman_reserve_resource_bound.9 \ rman.9 rman_set_bushandle.9 \ rman.9 rman_set_bustag.9 \ + rman.9 rman_set_mapping.9 \ rman.9 rman_set_rid.9 \ rman.9 rman_set_virtual.9 MLINKS+=rmlock.9 rm_assert.9 \ Modified: head/share/man/man9/bus_activate_resource.9 ============================================================================== --- head/share/man/man9/bus_activate_resource.9 Fri May 20 17:41:12 2016 (r300316) +++ head/share/man/man9/bus_activate_resource.9 Fri May 20 17:57:47 2016 (r300317) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2016 +.Dd May 20, 2016 .Dt BUS_ACTIVATE_RESOURCE 9 .Os .Sh NAME @@ -106,6 +106,14 @@ If the mapping is associated with a virt the virtual address can be retrieved via .Xr rman_get_virtual 9 . .Pp +This implicit mapping can be disabled by passing the +.Dv RF_UNMAPPED +flag to +.Xr bus_alloc_resource 9 . +A driver may use this if it wishes to allocate its own mappings of a resource +using +.Xr bus_map_resource 9 . +.Pp A wrapper API for .Xr bus_space 9 is also provided that accepts the associated resource as the first argument @@ -133,6 +141,7 @@ resource: Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO .Xr bus_alloc_resource 9 , +.Xr bus_map_resource 9 , .Xr bus_space 9 , .Xr device 9 , .Xr driver 9 Modified: head/share/man/man9/bus_alloc_resource.9 ============================================================================== --- head/share/man/man9/bus_alloc_resource.9 Fri May 20 17:41:12 2016 (r300316) +++ head/share/man/man9/bus_alloc_resource.9 Fri May 20 17:57:47 2016 (r300317) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2016 +.Dd May 20, 2016 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -166,6 +166,9 @@ For example, cannot share IRQs while .Xr cardbus 4 can. +.It Dv RF_UNMAPPED +do not establish implicit mapping when activated via +.Xr bus_activate_resource 9 . .El .El .Sh RETURN VALUES @@ -193,6 +196,7 @@ should be saved in the softc of the devi .Sh SEE ALSO .Xr bus_activate_resource 9 , .Xr bus_adjust_resource 9 , +.Xr bus_map_resource 9 , .Xr bus_release_resource 9 , .Xr device 9 , .Xr driver 9 Added: head/share/man/man9/bus_map_resource.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/bus_map_resource.9 Fri May 20 17:57:47 2016 (r300317) @@ -0,0 +1,167 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2016 John H. Baldwin +.\" 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$ +.\" +.Dd May 20, 2016 +.Dt BUS_MAP_RESOURCE 9 +.Os +.Sh NAME +.Nm bus_map_resource , bus_unmap_resource , resource_init_map_request +.Nd map or unmap an active resource +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Pp +.In machine/bus.h +.In sys/rman.h +.In machine/resource.h +.Ft int +.Fo bus_map_resource +.Fa "device_t dev" "int type" "struct resource *r" +.Fa "struct resource_map_request *args" "struct resource_map *map" +.Fc +.Ft int +.Fo bus_unmap_resource +.Fa "device_t dev" "int type" "struct resource *r" "struct resource_map *map" +.Fc +.Ft void +.Fn resource_init_map_request "struct resource_map_request *args" +.Sh DESCRIPTION +These functions create or destroy a mapping of a previously activated +resource. +Mappings permit CPU access to the resource via the +.Xr bus_space 9 +API. +.Pp +The arguments are as follows: +.Bl -tag -width indent +.It Fa dev +The device that owns the resource. +.It Fa type +The type of resource to map. +It is one of: +.Pp +.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact +.It Dv SYS_RES_IOPORT +for I/O ports +.It Dv SYS_RES_MEMORY +for I/O memory +.El +.It Fa r +A pointer to the +.Vt "struct resource" +returned by +.Xr bus_alloc_resource 9 . +.It Fa args +A set of optional properties to apply when creating a mapping. +This argument can be set to +.Dv NULL +to request a mapping of the entire resource with the default properties. +.It Fa map +The resource mapping to create or destroy. +.El +.Ss Resource Mappings +Resource mappings are described by a +.Vt "struct resource_map" +object. +This structure contains a +.Xr bus_space 9 +tag and handle in the +.Va r_bustag +and +.Va r_bushandle +members that can be used for CPU access to the mapping. +The structure also contains a +.Va r_vaddr +member which contains the virtual address of the mapping if one exists. +.Pp +The wrapper API for +.Vt "struct resource" +objects described in +.Xr bus_activate_resource 9 +can also be used with +.Vt "struct resource_map" . +For example, +a pointer to a mapping object can be passed as the first argument to +.Fn bus_read_4 . +This wrapper API is preferred over using the +.Va r_bustag +and +.Va r_bushandle +members directly. +.Ss Optional Mapping Properties +The +.Vt "struct resource_map_request" +object passed in +.Fa args +can be used to specify optional properties of a mapping. +The structure must be initialized by invoking +.Fn resource_init_map_request . +Properties are then specified by setting one or more of these members: +.Bl -tag -width indent +.It Va offset , length +These two members specify a region of the resource to map. +By default a mapping is created for the entire resource. +The +.Va offset +is relative to the start of the resource. +.It Va memattr +Specifies a memory attribute to use when mapping the resource. +By default memory mappings use the +.Dv VM_MEMATTR_UNCACHEABLE +attribute. +.El +.Sh EXAMPLES +This maps a PCI memory BAR with the write-combining memory attribute and +reads the first 32-bit word: +.Bd -literal + struct resource *r; + struct resource_map map; + struct resource_map_args args; + uint32_t val; + int rid; + + rid = PCIR_BAR(0); + r = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | + RF_UNMAPPED); + resource_init_map_request(&args); + args.memattr = VM_MEMATTR_WRITE_COMBINING; + bus_map_resource(dev, SYS_RES_MEMORY, r, &args, &map); + val = bus_read_4(&map, 0); +.Ed +.Pp +.Sh RETURN VALUES +Zero is returned on success, otherwise an error is returned. +.Sh SEE ALSO +.Xr bus_activate_resource 9 , +.Xr bus_alloc_resource 9 , +.Xr bus_space 9 , +.Xr device 9 , +.Xr driver 9 +.Sh AUTHORS +This manual page was written by +.An John Baldwin Aq Mt jhb@FreeBSD.org . Modified: head/share/man/man9/rman.9 ============================================================================== --- head/share/man/man9/rman.9 Fri May 20 17:41:12 2016 (r300316) +++ head/share/man/man9/rman.9 Fri May 20 17:57:47 2016 (r300317) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 19, 2016 +.Dd May 20, 2016 .Dt RMAN 9 .Os .Sh NAME @@ -49,6 +49,8 @@ .Nm rman_get_device , .Nm rman_get_size , .Nm rman_get_flags , +.Nm rman_set_mapping , +.Nm rman_get_mapping , .Nm rman_set_virtual , .Nm rman_get_virtual , .Nm rman_set_bustag , @@ -106,6 +108,10 @@ .Ft u_int .Fn rman_get_flags "struct resource *r" .Ft void +.Fn rman_set_mapping "struct resource *r" "struct resource_map *map" +.Ft void +.Fn rman_get_mapping "struct resource *r" "struct resource_map *map" +.Ft void .Fn rman_set_virtual "struct resource *r" "void *v" .Ft "void *" .Fn rman_get_virtual "struct resource *r" @@ -140,6 +146,7 @@ represented by a 16-bit flag register, a #define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */ #define RF_FIRSTSHARE 0x0020 /* first in sharing list */ #define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */ +#define RF_UNMAPPED 0x0100 /* don't map resource when activating */ .Ed .Pp Bits 15:10 of the flag register are used to represent the desired alignment @@ -424,6 +431,26 @@ The function can be used to retrieve the KVA once set. .Pp The +.Fn rman_set_mapping +function is used to associate a resource mapping with a resource +.Fa r . +The mapping must cover the entire resource. +Setting a mapping sets the associated +.Xr bus_space 9 +handle and tag for +.Fa r +as well as the kernel virtual address if the mapping contains one. +These individual values can be retrieved via +.Fn rman_get_bushandle , +.Fn rman_get_bustag , +and +.Fn rman_get_virtual . +.Pp +The +.Fn rman_get_mapping +function can be used to retrieve the associated resource mapping once set. +.Pp +The .Fn rman_set_rid function associates a resource identifier with a resource .Fa r . @@ -439,7 +466,9 @@ function returns a pointer to the device .Xr bus_activate_resource 9 , .Xr bus_adjust_resource 9 , .Xr bus_alloc_resource 9 , +.Xr bus_map_resource 9 , .Xr bus_release_resource 9 , +.Xr bus_space 9 , .Xr bus_set_resource 9 , .Xr mutex 9 .Sh AUTHORS Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Fri May 20 17:41:12 2016 (r300316) +++ head/sys/kern/bus_if.m Fri May 20 17:57:47 2016 (r300317) @@ -287,8 +287,9 @@ METHOD struct resource * alloc_resource * @brief Activate a resource * * Activate a resource previously allocated with - * BUS_ALLOC_RESOURCE(). This may for instance map a memory region - * into the kernel's virtual address space. + * BUS_ALLOC_RESOURCE(). This may enable decoding of this resource in a + * device for instance. It will also establish a mapping for the resource + * unless RF_UNMAPPED was set when allocating the resource. * * @param _dev the parent device of @p _child * @param _child the device which allocated the resource @@ -304,12 +305,58 @@ METHOD int activate_resource { struct resource *_r; }; + +/** + * @brief Map a resource + * + * Allocate a mapping for a range of an active resource. The mapping + * is described by a struct resource_map object. This may for instance + * map a memory region into the kernel's virtual address space. + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _type the type of resource + * @param _r the resource to map + * @param _args optional attributes of the mapping + * @param _map the mapping + */ +METHOD int map_resource { + device_t _dev; + device_t _child; + int _type; + struct resource *_r; + struct resource_map_request *_args; + struct resource_map *_map; +} DEFAULT bus_generic_map_resource; + + +/** + * @brief Unmap a resource + * + * Release a mapping previously allocated with + * BUS_MAP_RESOURCE(). This may for instance unmap a memory region + * from the kernel's virtual address space. + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _type the type of resource + * @param _r the resource + * @param _map the mapping to release + */ +METHOD int unmap_resource { + device_t _dev; + device_t _child; + int _type; + struct resource *_r; + struct resource_map *_map; +} DEFAULT bus_generic_unmap_resource; + + /** * @brief Deactivate a resource * * Deactivate a resource previously allocated with - * BUS_ALLOC_RESOURCE(). This may for instance unmap a memory region - * from the kernel's virtual address space. + * BUS_ALLOC_RESOURCE(). * * @param _dev the parent device of @p _child * @param _child the device which allocated the resource Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri May 20 17:41:12 2016 (r300316) +++ head/sys/kern/subr_bus.c Fri May 20 17:57:47 2016 (r300317) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include SYSCTL_NODE(_hw, OID_AUTO, bus, CTLFLAG_RW, NULL, NULL); SYSCTL_ROOT_NODE(OID_AUTO, dev, CTLFLAG_RW, NULL, NULL); @@ -3050,6 +3051,15 @@ device_set_unit(device_t dev, int unit) * Some useful method implementations to make life easier for bus drivers. */ +void +resource_init_map_request_impl(struct resource_map_request *args, size_t sz) +{ + + bzero(args, sz); + args->size = sz; + args->memattr = VM_MEMATTR_UNCACHEABLE; +} + /** * @brief Initialise a resource list. * @@ -4060,6 +4070,40 @@ bus_generic_deactivate_resource(device_t } /** + * @brief Helper function for implementing BUS_MAP_RESOURCE(). + * + * This simple implementation of BUS_MAP_RESOURCE() simply calls the + * BUS_MAP_RESOURCE() method of the parent of @p dev. + */ +int +bus_generic_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *args, + struct resource_map *map) +{ + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_MAP_RESOURCE(dev->parent, child, type, r, args, + map)); + return (EINVAL); +} + +/** + * @brief Helper function for implementing BUS_UNMAP_RESOURCE(). + * + * This simple implementation of BUS_UNMAP_RESOURCE() simply calls the + * BUS_UNMAP_RESOURCE() method of the parent of @p dev. + */ +int +bus_generic_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_UNMAP_RESOURCE(dev->parent, child, type, r, map)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_BIND_INTR(). * * This simple implementation of BUS_BIND_INTR() simply calls the @@ -4421,6 +4465,36 @@ bus_deactivate_resource(device_t dev, in } /** + * @brief Wrapper function for BUS_MAP_RESOURCE(). + * + * This function simply calls the BUS_MAP_RESOURCE() method of the + * parent of @p dev. + */ +int +bus_map_resource(device_t dev, int type, struct resource *r, + struct resource_map_request *args, struct resource_map *map) +{ + if (dev->parent == NULL) + return (EINVAL); + return (BUS_MAP_RESOURCE(dev->parent, dev, type, r, args, map)); +} + +/** + * @brief Wrapper function for BUS_UNMAP_RESOURCE(). + * + * This function simply calls the BUS_UNMAP_RESOURCE() method of the + * parent of @p dev. + */ +int +bus_unmap_resource(device_t dev, int type, struct resource *r, + struct resource_map *map) +{ + if (dev->parent == NULL) + return (EINVAL); + return (BUS_UNMAP_RESOURCE(dev->parent, dev, type, r, map)); +} + +/** * @brief Wrapper function for BUS_RELEASE_RESOURCE(). * * This function simply calls the BUS_RELEASE_RESOURCE() method of the Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Fri May 20 17:41:12 2016 (r300316) +++ head/sys/kern/subr_rman.c Fri May 20 17:57:47 2016 (r300317) @@ -897,6 +897,27 @@ rman_get_bushandle(struct resource *r) } void +rman_set_mapping(struct resource *r, struct resource_map *map) +{ + + KASSERT(rman_get_size(r) == map->r_size, + ("rman_set_mapping: size mismatch")); + rman_set_bustag(r, map->r_bustag); + rman_set_bushandle(r, map->r_bushandle); + rman_set_virtual(r, map->r_vaddr); +} + +void +rman_get_mapping(struct resource *r, struct resource_map *map) +{ + + map->r_bustag = rman_get_bustag(r); + map->r_bushandle = rman_get_bushandle(r); + map->r_size = rman_get_size(r); + map->r_vaddr = rman_get_virtual(r); +} + +void rman_set_rid(struct resource *r, int rid) { Modified: head/sys/sparc64/include/vm.h ============================================================================== --- head/sys/sparc64/include/vm.h Fri May 20 17:41:12 2016 (r300316) +++ head/sys/sparc64/include/vm.h Fri May 20 17:57:47 2016 (r300317) @@ -31,5 +31,6 @@ /* Memory attribute configuration is not (yet) implemented. */ #define VM_MEMATTR_DEFAULT 0 +#define VM_MEMATTR_UNCACHEABLE 0 #endif /* !_MACHINE_VM_H_ */ Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Fri May 20 17:41:12 2016 (r300316) +++ head/sys/sys/bus.h Fri May 20 17:57:47 2016 (r300317) @@ -294,6 +294,31 @@ struct driver { KOBJ_CLASS_FIELDS; }; +/** + * @brief A resource mapping. + */ +struct resource_map { + bus_space_tag_t r_bustag; + bus_space_handle_t r_bushandle; + bus_size_t r_size; + void *r_vaddr; +}; + +/** + * @brief Optional properties of a resource mapping request. + */ +struct resource_map_request { + size_t size; + rman_res_t offset; + rman_res_t length; + vm_memattr_t memattr; +}; + +void resource_init_map_request_impl(struct resource_map_request *_args, + size_t _sz); +#define resource_init_map_request(rmr) \ + resource_init_map_request_impl((rmr), sizeof(*(rmr))) + /* * Definitions for drivers which need to keep simple lists of resources * for their child devices. @@ -407,6 +432,10 @@ bus_space_tag_t int bus_generic_get_domain(device_t dev, device_t child, int *domain); struct resource_list * bus_generic_get_resource_list (device_t, device_t); +int bus_generic_map_resource(device_t dev, device_t child, int type, + struct resource *r, + struct resource_map_request *args, + struct resource_map *map); void bus_generic_new_pass(device_t dev); int bus_print_child_header(device_t dev, device_t child); int bus_print_child_domain(device_t dev, device_t child); @@ -440,6 +469,9 @@ int bus_generic_suspend(device_t dev); int bus_generic_suspend_child(device_t dev, device_t child); int bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); +int bus_generic_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, + struct resource_map *map); int bus_generic_write_ivar(device_t dev, device_t child, int which, uintptr_t value); int bus_null_rescan(device_t dev); @@ -469,6 +501,11 @@ int bus_activate_resource(device_t dev, struct resource *r); int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r); +int bus_map_resource(device_t dev, int type, struct resource *r, + struct resource_map_request *args, + struct resource_map *map); +int bus_unmap_resource(device_t dev, int type, struct resource *r, + struct resource_map *map); int bus_get_cpus(device_t dev, enum cpu_sets op, size_t setsize, struct _cpuset *cpuset); bus_dma_tag_t bus_get_dma_tag(device_t dev); Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Fri May 20 17:41:12 2016 (r300316) +++ head/sys/sys/rman.h Fri May 20 17:57:47 2016 (r300317) @@ -47,6 +47,7 @@ #define RF_FIRSTSHARE 0x0020 /* first in sharing list */ #define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */ #define RF_OPTIONAL 0x0080 /* for bus_alloc_resources() */ +#define RF_UNMAPPED 0x0100 /* don't map resource when activating */ #define RF_ALIGNMENT_SHIFT 10 /* alignment size bit starts bit 10 */ #define RF_ALIGNMENT_MASK (0x003F << RF_ALIGNMENT_SHIFT) @@ -105,6 +106,7 @@ struct resource { }; struct resource_i; +struct resource_map; TAILQ_HEAD(resource_head, resource_i); @@ -127,6 +129,7 @@ bus_space_tag_t rman_get_bustag(struct r rman_res_t rman_get_end(struct resource *); struct device *rman_get_device(struct resource *); u_int rman_get_flags(struct resource *); +void rman_get_mapping(struct resource *, struct resource_map *); int rman_get_rid(struct resource *); rman_res_t rman_get_size(struct resource *); rman_res_t rman_get_start(struct resource *); @@ -150,6 +153,7 @@ void rman_set_bushandle(struct resource void rman_set_bustag(struct resource *_r, bus_space_tag_t _t); void rman_set_device(struct resource *_r, struct device *_dev); void rman_set_end(struct resource *_r, rman_res_t _end); +void rman_set_mapping(struct resource *, struct resource_map *); void rman_set_rid(struct resource *_r, int _rid); void rman_set_start(struct resource *_r, rman_res_t _start); void rman_set_virtual(struct resource *_r, void *_v); Modified: head/sys/vm/vm.h ============================================================================== --- head/sys/vm/vm.h Fri May 20 17:41:12 2016 (r300316) +++ head/sys/vm/vm.h Fri May 20 17:57:47 2016 (r300317) @@ -109,8 +109,9 @@ typedef struct vm_object *vm_object_t; typedef int boolean_t; /* - * The exact set of memory attributes is machine dependent. However, every - * machine is required to define VM_MEMATTR_DEFAULT. + * The exact set of memory attributes is machine dependent. However, + * every machine is required to define VM_MEMATTR_DEFAULT and + * VM_MEMATTR_UNCACHEABLE. */ typedef char vm_memattr_t; /* memory attribute codes */ From owner-svn-src-all@freebsd.org Fri May 20 18:00:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B28CB448B2; Fri, 20 May 2016 18:00:12 +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 E6D721CFF; Fri, 20 May 2016 18:00:11 +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 u4KI0BHS093368; Fri, 20 May 2016 18:00:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KI0BOQ093367; Fri, 20 May 2016 18:00:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605201800.u4KI0BOQ093367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 18:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300318 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 18:00:12 -0000 Author: jhb Date: Fri May 20 18:00:10 2016 New Revision: 300318 URL: https://svnweb.freebsd.org/changeset/base/300318 Log: Implement support for RF_UNMAPPED and bus_map/unmap_resource on x86. Add implementations of bus_map/unmap_resource to the x86 nexus driver. Change bus_activate/deactivate_resource to honor RF_UNMAPPED and to use bus_map/unmap_resource to create/destroy the implicit mapping when RF_UNMAPPED is not set. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D5237 Modified: head/sys/x86/x86/nexus.c Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Fri May 20 17:57:47 2016 (r300317) +++ head/sys/x86/x86/nexus.c Fri May 20 18:00:10 2016 (r300318) @@ -114,6 +114,12 @@ static int nexus_activate_resource(devic struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_map_resource(device_t bus, device_t child, int type, + struct resource *r, + struct resource_map_request *argsp, + struct resource_map *map); +static int nexus_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map); static int nexus_release_resource(device_t, device_t, int, int, struct resource *); static int nexus_setup_intr(device_t, device_t, struct resource *, int flags, @@ -154,6 +160,8 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_map_resource, nexus_map_resource), + DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), #ifdef SMP @@ -432,11 +440,81 @@ static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + struct resource_map map; + int error; + + error = rman_activate_resource(r); + if (error != 0) + return (error); + + if (!(rman_get_flags(r) & RF_UNMAPPED) && + (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { + error = nexus_map_resource(bus, child, type, r, NULL, &map); + if (error) { + rman_deactivate_resource(r); + return (error); + } + + rman_set_mapping(r,&map); + } + return (0); +} + +static int +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + struct resource_map map; + int error; + + error = rman_deactivate_resource(r); + if (error) + return (error); + + if (!(rman_get_flags(r) & RF_UNMAPPED) && + (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { + rman_get_mapping(r, &map); + nexus_unmap_resource(bus, child, type, r, &map); + } + return (0); +} + +static int +nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t end, length, start; #ifdef PC98 - bus_space_handle_t bh; int error; #endif - void *vaddr; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + if (argsp != NULL) + bcopy(argsp, &args, imin(argsp->size, args.size)); + start = rman_get_start(r) + args.offset; + if (args.length == 0) + length = rman_get_size(r); + else + length = args.length; + end = start + length - 1; + if (start > rman_get_end(r) || start < rman_get_start(r)) + return (EINVAL); + if (end > rman_get_end(r) || end < start) + return (EINVAL); /* * If this is a memory resource, map it into the kernel. @@ -445,58 +523,64 @@ nexus_activate_resource(device_t bus, de case SYS_RES_IOPORT: #ifdef PC98 error = i386_bus_space_handle_alloc(X86_BUS_SPACE_IO, - rman_get_start(r), rman_get_size(r), &bh); + start, length, &map->r_bushandle); if (error) return (error); - rman_set_bushandle(r, bh); #else - rman_set_bushandle(r, rman_get_start(r)); + map->r_bushandle = start; #endif - rman_set_bustag(r, X86_BUS_SPACE_IO); + map->r_bustag = X86_BUS_SPACE_IO; + map->r_size = length; + map->r_vaddr = NULL; break; case SYS_RES_MEMORY: #ifdef PC98 error = i386_bus_space_handle_alloc(X86_BUS_SPACE_MEM, - rman_get_start(r), rman_get_size(r), &bh); + start, length, &map->r_bushandle); if (error) return (error); #endif - vaddr = pmap_mapdev(rman_get_start(r), rman_get_size(r)); - rman_set_virtual(r, vaddr); - rman_set_bustag(r, X86_BUS_SPACE_MEM); + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + map->r_bustag = X86_BUS_SPACE_MEM; + map->r_size = length; + + /* + * PC-98 stores the virtual address as a member of the + * structure in the handle. On plain x86, the handle is + * the virtual address. + */ #ifdef PC98 - /* PC-98: the type of bus_space_handle_t is the structure. */ - bh->bsh_base = (bus_addr_t) vaddr; - rman_set_bushandle(r, bh); + map->r_bushandle->bsh_base = (bus_addr_t)map->r_vaddr; #else - /* IBM-PC: the type of bus_space_handle_t is u_int */ - rman_set_bushandle(r, (bus_space_handle_t) vaddr); + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; #endif + break; } - return (rman_activate_resource(r)); + return (0); } static int -nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) { - + /* * If this is a memory resource, unmap it. */ - if (type == SYS_RES_MEMORY) { - pmap_unmapdev((vm_offset_t)rman_get_virtual(r), - rman_get_size(r)); - } + switch (type) { + case SYS_RES_MEMORY: + pmap_unmapdev((vm_offset_t)map->r_vaddr, map->r_size); + /* FALLTHROUGH */ + case SYS_RES_IOPORT: #ifdef PC98 - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - bus_space_handle_t bh; - - bh = rman_get_bushandle(r); - i386_bus_space_handle_free(rman_get_bustag(r), bh, bh->bsh_sz); - } + i386_bus_space_handle_free(map->r_bustag, map->r_bushandle, + map->r_bushandle->bsh_sz); #endif - return (rman_deactivate_resource(r)); + break; + default: + return (EINVAL); + } + return (0); } static int From owner-svn-src-all@freebsd.org Fri May 20 18:00:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F4D0B44900 for ; Fri, 20 May 2016 18:00:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm31-vm6.bullet.mail.bf1.yahoo.com (nm31-vm6.bullet.mail.bf1.yahoo.com [72.30.239.14]) (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 196C41E90 for ; Fri, 20 May 2016 18:00:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463765524; bh=GZ+FZUX5hL1FsXdgwrEkk6a0vhxBVUcU7ZKMfpr45aY=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=U67hnH6SjqX8iK/Es+maI8b9MHYv0vQJdxQG6peDIfEXnnAwbw6cJY9uLYOvlKnKQ7UwkLG2ir3TwKRLb/hqNasZ03OALRaldyYopFzVuYrHWja/g69TfgPQVrP1Z9ZiaNfptBP6h5yOI6oIjgZ7inHN8DiCsTvlvGSYxP1pud90LfLNdVDbzr+kr/DlFIQEfDgo9QkLLuylmxtF77DkGp54coBG41G/Fic+Kk8JJogt1u8u86A2I0YRUceQPq+qXd1417s4IK7iRVbOFR/vlHU5n2XNzQLC7wyQqHQY1WBT50LtnD/mtmo8PkAmaDsrJ4Dqa9tG5nqLowaePtB92Q== Received: from [66.196.81.173] by nm31.bullet.mail.bf1.yahoo.com with NNFMP; 20 May 2016 17:32:04 -0000 Received: from [98.139.213.14] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 20 May 2016 17:32:04 -0000 Received: from [127.0.0.1] by smtp114.mail.bf1.yahoo.com with NNFMP; 20 May 2016 17:32:04 -0000 X-Yahoo-Newman-Id: 642115.13317.bm@smtp114.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: R9vm7DQVM1kO9MIx7qA923zwk9ROrPB5n1Kl_P5C4CnRnXc zc4L4bSdARCqEmAFBmrcUysbgGSU7JWcpzGqQ.LZ06lP0ZCJzzT5EXc3zchU T1I80jVO7aelHS15LADGIMTc9hdyWNAy7g4vGMPVl7gaTcuP6tUfF33losra _iIHKRipEOjUbH203HGUdtk9T7hfQJu8a.vXNv00_dwhctmhBg_2tTyMwJ9O k8wXQ.4BGUE.3aFdMH4ysdmxsy422BxZr545nnTV9uF830kvzmOx7bUm0ghJ 0PmtlLdNg0eusc7ohnO2Z_3pCuen_5KhXJBQmzByVRORl2hlzIctwsHLaqOs EQROZUOIv3SkI4TRADwukPdOCN8H6mVV2P5njWXjLZ8qjKfK3NPs_aUFqaqX Wc56ZJwgan7LncEFqoYVEGEvfwtdvQa2JrEi20OOrGUiv4IZwZ40.JZHjO8Y 5jtXDjY5PNT7iX9vhzp.Z9Gje50jZ53VFmRR3UcgZyyns07dgIqco8NNSOt5 UFNQeqCRgkMDfWhDs8RejUVrf3uT3.PH1 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300301 - head/contrib/gcc To: Ed Schouten References: <201605201436.u4KEanoi031012@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <573F4A0B.8050803@FreeBSD.org> Date: Fri, 20 May 2016 12:31:55 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 18:00:50 -0000 On 20/05/2016 12:23, Ed Schouten wrote: > Hi Pedro, > > 2016-05-20 16:36 GMT+02:00 Pedro F. Giffuni : >> + tree anon = NULL_TREE; > This initialization shouldn't be needed, right? The value is always > assigned before used. > Yes, you are right. However do note that anon is used only within an if() so it is rather sane to have it initialized JIC we hit a bogus compiler. The code came directly from OpenBSD, which still uses that crappy compiler for everything, so I don't want to play experiments :). Pedro. From owner-svn-src-all@freebsd.org Fri May 20 18:01:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3892B44A16; Fri, 20 May 2016 18:01:54 +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 7567D11A6; Fri, 20 May 2016 18:01:54 +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 u4KI1rnV094093; Fri, 20 May 2016 18:01:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KI1r18094092; Fri, 20 May 2016 18:01:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605201801.u4KI1r18094092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 May 2016 18:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300319 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 18:01:54 -0000 Author: pfg Date: Fri May 20 18:01:53 2016 New Revision: 300319 URL: https://svnweb.freebsd.org/changeset/base/300319 Log: GCC: Add support for named initializers for anonymous structs/unions. Missing hunk from r300301. Reported by: Ed Schouten Obtained from: OpenBSD (CVS rev. 1.2) Modified: head/contrib/gcc/c-typeck.c Modified: head/contrib/gcc/c-typeck.c ============================================================================== --- head/contrib/gcc/c-typeck.c Fri May 20 18:00:10 2016 (r300318) +++ head/contrib/gcc/c-typeck.c Fri May 20 18:01:53 2016 (r300319) @@ -6074,13 +6074,24 @@ set_init_label (tree fieldname) if (tail == 0) error ("unknown field %qE specified in initializer", fieldname); - else + + while (tail) { constructor_fields = tail; designator_depth++; designator_erroneous = 0; if (constructor_range_stack) push_range_stack (NULL_TREE); + + if (anon) + { + if (set_designator (0)) + return; + tail = TREE_VALUE(anon); + anon = TREE_CHAIN(anon); + } + else + tail = NULL_TREE; } } From owner-svn-src-all@freebsd.org Fri May 20 18:54:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBD23B43B7D; Fri, 20 May 2016 18:54:43 +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 7BCFD1339; Fri, 20 May 2016 18:54:43 +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 u4KIsgBG011822; Fri, 20 May 2016 18:54:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KIsgq3011818; Fri, 20 May 2016 18:54:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605201854.u4KIsgq3011818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 May 2016 18:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300320 - in head/contrib/elftoolchain: elfdump libdwarf libelftc readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 18:54:43 -0000 Author: emaste Date: Fri May 20 18:54:42 2016 New Revision: 300320 URL: https://svnweb.freebsd.org/changeset/base/300320 Log: elftoolchain: backwards compatability for EM_IAMCU definition It is not provided by sys/elf_common.h on older stable/10. Modified: head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Fri May 20 18:01:53 2016 (r300319) +++ head/contrib/elftoolchain/elfdump/elfdump.c Fri May 20 18:54:42 2016 (r300320) @@ -52,6 +52,11 @@ ELFTC_VCSID("$Id: elfdump.c 3474 2016-05-17 20:44:53Z emaste $"); +/* Backwards compatability for older FreeBSD releases. */ +#ifndef EM_IAMCU +#define EM_IAMCU 6 +#endif + #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" #if ELFTC_CLASS == ELFCLASS32 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Fri May 20 18:01:53 2016 (r300319) +++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Fri May 20 18:54:42 2016 (r300320) @@ -28,6 +28,11 @@ ELFTC_VCSID("$Id: libdwarf_reloc.c 3198 2015-05-14 18:36:19Z emaste $"); +/* Backwards compatability for older FreeBSD releases. */ +#ifndef EM_IAMCU +#define EM_IAMCU 6 +#endif + Dwarf_Unsigned _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) { Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Fri May 20 18:01:53 2016 (r300319) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Fri May 20 18:54:42 2016 (r300320) @@ -31,6 +31,11 @@ #include #include +/* Backwards compatability for older FreeBSD releases. */ +#ifndef EM_IAMCU +#define EM_IAMCU 6 +#endif + const char * elftc_reloc_type_str(unsigned int mach, unsigned int type) { Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri May 20 18:01:53 2016 (r300319) +++ head/contrib/elftoolchain/readelf/readelf.c Fri May 20 18:54:42 2016 (r300320) @@ -50,6 +50,9 @@ ELFTC_VCSID("$Id: readelf.c 3469 2016-05-15 23:16:09Z emaste $"); /* Backwards compatability for older FreeBSD releases. */ +#ifndef EM_IAMCU +#define EM_IAMCU 6 +#endif #ifndef STB_GNU_UNIQUE #define STB_GNU_UNIQUE 10 #endif From owner-svn-src-all@freebsd.org Fri May 20 19:05:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD517B43F2C; Fri, 20 May 2016 19:05:34 +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 9CBEC1D56; Fri, 20 May 2016 19:05:34 +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 u4KJ5X17015393; Fri, 20 May 2016 19:05:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJ5XZl015392; Fri, 20 May 2016 19:05:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605201905.u4KJ5XZl015392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 May 2016 19:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300321 - stable/10/gnu/lib/libgcc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:05:34 -0000 Author: emaste Date: Fri May 20 19:05:33 2016 New Revision: 300321 URL: https://svnweb.freebsd.org/changeset/base/300321 Log: MFC r294935 (kan): Make .debug file for libgcc_s.so.1 more useful. The files compiled into libgcc_s.so.1 did not have -g on compiler command line, making generated .debug quite pointless. PR: 206381 Modified: stable/10/gnu/lib/libgcc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/lib/libgcc/Makefile ============================================================================== --- stable/10/gnu/lib/libgcc/Makefile Fri May 20 18:54:42 2016 (r300320) +++ stable/10/gnu/lib/libgcc/Makefile Fri May 20 19:05:33 2016 (r300321) @@ -186,7 +186,7 @@ COMMONHDRS= tm.h tconfig.h options.h unw HIDE = -fvisibility=hidden -DHIDE_EXPORTS CC_T = ${CC} -c ${CFLAGS} ${HIDE} -fPIC CC_P = ${CC} -c ${CFLAGS} ${HIDE} -p -fPIC -CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DSHARED +CC_S = ${CC} -c ${CFLAGS} ${SHARED_CFLAGS} ${PICFLAG} -DSHARED #----------------------------------------------------------------------- # From owner-svn-src-all@freebsd.org Fri May 20 19:10:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0BFAB4408C; Fri, 20 May 2016 19:10:30 +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 C21891FCD; Fri, 20 May 2016 19:10:30 +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 u4KJATAd015625; Fri, 20 May 2016 19:10:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJAT13015624; Fri, 20 May 2016 19:10:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605201910.u4KJAT13015624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 May 2016 19:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300322 - head/bin/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:10:31 -0000 Author: pfg Date: Fri May 20 19:10:29 2016 New Revision: 300322 URL: https://svnweb.freebsd.org/changeset/base/300322 Log: ed(1): Cleanups for the DES mode. - Use arc4random_uniform(3). - Prevent a segmentation fault when ed receives a signal while being in getpass(). [1] Obtained from: OpenBSD [1] (CVS Rev. 1.15) MFC after: 2 weeks Modified: head/bin/ed/cbc.c Modified: head/bin/ed/cbc.c ============================================================================== --- head/bin/ed/cbc.c Fri May 20 19:05:33 2016 (r300321) +++ head/bin/ed/cbc.c Fri May 20 19:10:29 2016 (r300322) @@ -99,7 +99,7 @@ init_des_cipher(void) /* initialize the padding vector */ for (i = 0; i < 8; i++) - pvec[i] = (char) (arc4random() % 256); + pvec[i] = (char)arc4random_uniform(256); #endif } @@ -164,7 +164,7 @@ get_keyword(void) /* * get the key */ - if (*(p = getpass("Enter key: "))) { + if ((p = getpass("Enter key: ")) != NULL && *p != '\0') { /* * copy it, nul-padded, into the key area From owner-svn-src-all@freebsd.org Fri May 20 19:14:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E233B441BB; Fri, 20 May 2016 19:14:17 +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 59A1F136C; Fri, 20 May 2016 19:14:17 +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 u4KJEGAM018407; Fri, 20 May 2016 19:14:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJEFB8018399; Fri, 20 May 2016 19:14:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605201914.u4KJEFB8018399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 May 2016 19:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300323 - in stable/10/lib/csu: amd64 arm i386-elf mips powerpc powerpc64 sparc64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:14:17 -0000 Author: emaste Date: Fri May 20 19:14:15 2016 New Revision: 300323 URL: https://svnweb.freebsd.org/changeset/base/300323 Log: MFC r292000: Remove historical GNUC test The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in csu. Modified: stable/10/lib/csu/amd64/crt1.c stable/10/lib/csu/arm/crt1.c stable/10/lib/csu/i386-elf/crt1_c.c stable/10/lib/csu/mips/crt1.c stable/10/lib/csu/powerpc/crt1.c stable/10/lib/csu/powerpc64/crt1.c stable/10/lib/csu/sparc64/crt1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/csu/amd64/crt1.c ============================================================================== --- stable/10/lib/csu/amd64/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/amd64/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -27,12 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/arm/crt1.c ============================================================================== --- stable/10/lib/csu/arm/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/arm/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/i386-elf/crt1_c.c ============================================================================== --- stable/10/lib/csu/i386-elf/crt1_c.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/i386-elf/crt1_c.c Fri May 20 19:14:15 2016 (r300323) @@ -29,12 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/mips/crt1.c ============================================================================== --- stable/10/lib/csu/mips/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/mips/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -36,10 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - #include #include "libc_private.h" #include "crtbrand.c" Modified: stable/10/lib/csu/powerpc/crt1.c ============================================================================== --- stable/10/lib/csu/powerpc/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/powerpc/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/powerpc64/crt1.c ============================================================================== --- stable/10/lib/csu/powerpc64/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/powerpc64/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/sparc64/crt1.c ============================================================================== --- stable/10/lib/csu/sparc64/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/sparc64/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -33,12 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" From owner-svn-src-all@freebsd.org Fri May 20 19:15:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B2E6B44248; Fri, 20 May 2016 19:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 329981655; Fri, 20 May 2016 19:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 2A6B61F35; Fri, 20 May 2016 19:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id DC9762087C; Fri, 20 May 2016 19:15:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id UI6asowdhath; Fri, 20 May 2016 19:15:06 +0000 (UTC) Subject: Re: svn commit: r300309 - in vendor/NetBSD/bmake/dist: . mk mk/sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E6BA620875 To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201605201619.u4KGJvNZ061471@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <575a775a-1b05-791b-ca0d-aed8795bc926@FreeBSD.org> Date: Fri, 20 May 2016 12:15:13 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605201619.u4KGJvNZ061471@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iGItFG68P0TLubVGPHupnkrKEtDJvq2Vm" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:15:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iGItFG68P0TLubVGPHupnkrKEtDJvq2Vm Content-Type: multipart/mixed; boundary="UcriTsjUxu4E0rsE4RUsKrPgdI7jMpPcG" From: Bryan Drewery To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Message-ID: <575a775a-1b05-791b-ca0d-aed8795bc926@FreeBSD.org> Subject: Re: svn commit: r300309 - in vendor/NetBSD/bmake/dist: . mk mk/sys References: <201605201619.u4KGJvNZ061471@repo.freebsd.org> In-Reply-To: <201605201619.u4KGJvNZ061471@repo.freebsd.org> --UcriTsjUxu4E0rsE4RUsKrPgdI7jMpPcG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/20/2016 9:19 AM, Simon J. Gerraty wrote: > Author: sjg > Date: Fri May 20 16:19:56 2016 > New Revision: 300309 > URL: https://svnweb.freebsd.org/changeset/base/300309 >=20 > Log: > Import bmake-20160512 > =20 > Interesting changes (from ChangeLog): > o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS > this is useful for gcov builds. > o propagate errors from filemon(4). > o meta.c: apply realpath() before matching against metaIgnorePaths Thanks! > o allow makefile to set .MAKE.JOBS Looks like .MAKE.JOBS didn't make it into the manpage. --=20 Regards, Bryan Drewery --UcriTsjUxu4E0rsE4RUsKrPgdI7jMpPcG-- --iGItFG68P0TLubVGPHupnkrKEtDJvq2Vm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXP2JBAAoJEDXXcbtuRpfPOXsH/1fYddICh/hxQvFg96CjNVkd 9iZOBtxSkbtoC/poc1AutU4tmr0uKDIG9Pfjyir/vNh3vY4hJsypGlWuo0P2ZT5U toFyxcesMHb40joWAgW1varqdjrUZN2qYQNCFqIpqSqw9vfDsfBKWa2kFme/URkR Sb06FK1PYzWZe9B35lOfBypVKJigd3W6+aOi41KlzSSKvHg41s0Beq17ilisuwC7 Ak2XGLjvNYl1khGmFffb1Ze4a2z3kR/hqlKKAbN5ggt/jLPu62VJQxD1A3CD4ojq KNOJWV+LYf+PQtKdWB0RbIFUZpgPIMFA2gb9okmqWoy/rqWP8/B6rJehhpyGODM= =skIf -----END PGP SIGNATURE----- --iGItFG68P0TLubVGPHupnkrKEtDJvq2Vm-- From owner-svn-src-all@freebsd.org Fri May 20 19:18:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28EA0B44307; Fri, 20 May 2016 19:18:34 +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 EAE3418E2; Fri, 20 May 2016 19:18:33 +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 u4KJIXH8018844; Fri, 20 May 2016 19:18:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJIXhX018843; Fri, 20 May 2016 19:18:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605201918.u4KJIXhX018843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 20 May 2016 19:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300324 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:18:34 -0000 Author: imp Date: Fri May 20 19:18:32 2016 New Revision: 300324 URL: https://svnweb.freebsd.org/changeset/base/300324 Log: Remove hf appending code from param.h for machine arch name. Submitted by: ian@ andyt@ Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Fri May 20 19:14:15 2016 (r300323) +++ head/sys/arm/include/param.h Fri May 20 19:18:32 2016 (r300324) @@ -59,12 +59,6 @@ #define _V6_SUFFIX "" #endif -#ifdef __ARM_PCS_VFP -#define _HF_SUFFIX "hf" -#else -#define _HF_SUFFIX "" -#endif - #ifdef __ARM_BIG_ENDIAN #define _EB_SUFFIX "eb" #else @@ -75,7 +69,7 @@ #define MACHINE "arm" #endif #ifndef MACHINE_ARCH -#define MACHINE_ARCH "arm" _V6_SUFFIX _HF_SUFFIX _EB_SUFFIX +#define MACHINE_ARCH "arm" _V6_SUFFIX _EB_SUFFIX #endif #if defined(SMP) || defined(KLD_MODULE) From owner-svn-src-all@freebsd.org Fri May 20 19:23:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89CE6B445B6; Fri, 20 May 2016 19:23:08 +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 5429B1EF5; Fri, 20 May 2016 19:23:08 +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 u4KJN7VM021641; Fri, 20 May 2016 19:23:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJN7l1021640; Fri, 20 May 2016 19:23:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605201923.u4KJN7l1021640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 20 May 2016 19:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300325 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:23:08 -0000 Author: bdrewery Date: Fri May 20 19:23:07 2016 New Revision: 300325 URL: https://svnweb.freebsd.org/changeset/base/300325 Log: Add a WITH_LIBSOFT Added: head/tools/build/options/WITH_LIBSOFT (contents, props changed) Added: head/tools/build/options/WITH_LIBSOFT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LIBSOFT Fri May 20 19:23:07 2016 (r300325) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +On armv6 only, set to enable soft float ABI compatibility libraries. +This option is for transitioning to the new hard float ABI. From owner-svn-src-all@freebsd.org Fri May 20 19:25:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDE86B44615; Fri, 20 May 2016 19:25:58 +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 9F24F10B0; Fri, 20 May 2016 19:25:58 +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 u4KJPvYa021792; Fri, 20 May 2016 19:25:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJPv8m021791; Fri, 20 May 2016 19:25:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605201925.u4KJPv8m021791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 20 May 2016 19:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300326 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:25:59 -0000 Author: bdrewery Date: Fri May 20 19:25:57 2016 New Revision: 300326 URL: https://svnweb.freebsd.org/changeset/base/300326 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri May 20 19:23:07 2016 (r300325) +++ head/share/man/man5/src.conf.5 Fri May 20 19:25:57 2016 (r300326) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd April 14, 2016 +.Dd May 20, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -171,7 +171,7 @@ Set to build and install binutils (as, l of the normal system build. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 2016-02-10 23:57:09Z emaste Set to not build binutils (as, ld, objcopy and objdump) @@ -189,7 +189,7 @@ Set build binutils (as, ld, objcopy and as part of the bootstrap process. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_BLUETOOTH .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. @@ -322,7 +322,7 @@ When set, it also enforces the following Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CLANG_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -337,7 +337,7 @@ mips/mipsel, mips/mips, mips/mips64el, m Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITH_CLANG_EXTRAS .\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. @@ -354,7 +354,7 @@ Set to build the ARCMigrate, Rewriter an Clang C/C++ compiler. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as @@ -374,7 +374,7 @@ and .Pa /usr/bin/cpp . .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -666,7 +666,7 @@ Set to not build games. Set to not build and install gcc and g++ as part of the normal build process. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITH_GCC .\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising Set to build and install gcc and g++. @@ -681,7 +681,7 @@ unless an alternative compiler is provid XCC. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITH_GCC_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp Set to build gcc and g++ as part of the bootstrap process. @@ -706,7 +706,7 @@ Set to build .Xr gdb 1 . .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GNU .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru Set to not build contributed GNU software as a part of the base system. @@ -727,7 +727,7 @@ Do not build the GNU C++ stack (g++, lib This is the default on platforms where clang is the system compiler. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITH_GNUCXX .\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven Build the GNU C++ stack (g++, libstdc++). @@ -950,6 +950,10 @@ When set, it also enforces the following .It .Va WITHOUT_LIBTHR .El +.It Va WITH_LIBSOFT +.\" from FreeBSD: head/tools/build/options/WITH_LIBSOFT 300325 2016-05-20 19:23:07Z bdrewery +On armv6 only, set to enable soft float ABI compatibility libraries. +This option is for transitioning to the new hard float ABI. .It Va WITHOUT_LIBTHR .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru Set to not build the @@ -961,7 +965,7 @@ library. Set to not build the LLDB debugger. .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_LLDB .\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste Set to build the LLDB debugger. @@ -973,7 +977,7 @@ amd64/amd64 and arm64/aarch64. Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_LLVM_LIBUNWIND .\" from FreeBSD: head/tools/build/options/WITH_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). From owner-svn-src-all@freebsd.org Fri May 20 19:30:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF3BB446E0; Fri, 20 May 2016 19:30:54 +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 1682213C2; Fri, 20 May 2016 19:30:54 +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 u4KJUrvD024333; Fri, 20 May 2016 19:30:53 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJUrNu024093; Fri, 20 May 2016 19:30:53 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201605201930.u4KJUrNu024093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 20 May 2016 19:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300327 - in head: lib/libmt usr.bin/mt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:30:54 -0000 Author: ken Date: Fri May 20 19:30:52 2016 New Revision: 300327 URL: https://svnweb.freebsd.org/changeset/base/300327 Log: Add the density code for LTO-7 to libmt and the mt(1) man page. The density code and bits per mm values were obtained from an actual drive density report. The number of tracks were obtained from an LTO-7 hardware announcement on IBM's web site. Sponsored by: Spectra Logic MFC after: 3 days Modified: head/lib/libmt/mtlib.c head/usr.bin/mt/mt.1 Modified: head/lib/libmt/mtlib.c ============================================================================== --- head/lib/libmt/mtlib.c Fri May 20 19:25:57 2016 (r300326) +++ head/lib/libmt/mtlib.c Fri May 20 19:30:52 2016 (r300327) @@ -643,6 +643,7 @@ static struct densities { { 0x55, 20670, 525018, "3592A5 (unencrypted)" }, { 0x58, 15142, 384607, "LTO-5" }, { 0x5A, 15142, 384607, "LTO-6" }, + { 0x5C, 19107, 485318, "LTO-7" }, { 0x71, 11800, 299720, "3592A1 (encrypted)" }, { 0x72, 11800, 299720, "3592A2 (encrypted)" }, { 0x73, 13452, 341681, "3592A3 (encrypted)" }, Modified: head/usr.bin/mt/mt.1 ============================================================================== --- head/usr.bin/mt/mt.1 Fri May 20 19:25:57 2016 (r300326) +++ head/usr.bin/mt/mt.1 Fri May 20 19:30:52 2016 (r300327) @@ -29,7 +29,7 @@ .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 3, 2014 +.Dd May 20, 2016 .Dt MT 1 .Os .Sh NAME @@ -517,6 +517,7 @@ Value Width Tracks Density 0x55 12.7 (0.5) 5120 20,670 (525,018) C 3592A5 (unencrypted) 0x58 12.7 (0.5) 1280 15,142 (384,607) C LTO-5 0x5A 12.7 (0.5) 2176 15,142 (384,607) C LTO-6 +0x5C 12.7 (0.5) 3584 19,107 (485,318) C LTO-7 0x71 12.7 (0.5) 512 11,800 (299,720) C 3592A1 (encrypted) 0x72 12.7 (0.5) 896 11,800 (299,720) C 3592A2 (encrypted) 0x73 12.7 (0.5) 1152 13,452 (341,681) C 3592A3 (encrypted) From owner-svn-src-all@freebsd.org Fri May 20 19:31:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0AF8B447DB for ; Fri, 20 May 2016 19:31:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x234.google.com (mail-yw0-x234.google.com [IPv6:2607:f8b0:4002:c05::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 A2F3616C7 for ; Fri, 20 May 2016 19:31:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x234.google.com with SMTP id x189so118776298ywe.3 for ; Fri, 20 May 2016 12:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=MBsXAluEfuGBn8n/sFlUkf4J4Dy4gvPefLefpS6DF8o=; b=zpL7UE7X8SWfeXTxYtqdDZKjDBK91mu3uieW/5fMq8+QO6IZlJWUMolkW+G2H8Tnwt nBOGHibydJNIHjwkcsqwXJsDj0TBJ1la2SE3wZtzzit9XlJw/k537eV+e6/hgqnIA3Qs CmkSl18Hwx30ptC6VRNenpd+bZpkHVPGn9dnpBIMKqIKPjdUWpU5HAHtvIdwA5r+OW0r WlcftE9HxnjrBDIC83lWeXfqt4d0DbYJIVYSH2Ixl5WSLXQQiHq+Vx2TI5PhgwjR7qH5 i1AJWvsgA/2L2Vw99JXjyjIahdQ+bhq+ahH7zkhXqPcOcJbTVsbEctK/llrXp7uelofo 6CcA== 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:date :message-id:subject:from:to:cc; bh=MBsXAluEfuGBn8n/sFlUkf4J4Dy4gvPefLefpS6DF8o=; b=kE4oHjqVaUvU909XlP257kBllvVsK/LF+MxUVtwfzS0iAkmAaLAoDmq/bYMev2udni NiC6v8swCUD7L+ZK9KvgoBGUmLjR8V+6ozIa1VBbSnurXwL5NyXjzYiqgI+1SZBUTFoE eU6k+tVspd76f+zlSfCokIdUrZTdcnKS7vuhAosHj0Mm8xa168UtO9k7pw8edtsK/iqY cGiYCMq79Mn/n1MiBH/yEpnT6IDOvZYEEB40K+Xz8Hxb1GsFKta/5StjZvuFl3xt4B0i LILh0v30B4xoa7oSO2DgiD06BGZUnG8CEOsqQqSiJlWSvMtQPWLLW4IOxsN1tQ60t1ft eVAg== X-Gm-Message-State: AOPr4FV5e5S3xU9b2GX2+O6zh+vLA00dD+ltWPqzNhekWDCWIK4mXjL7kuID8vQxFL+exGOJDFC6PDYTx3KnRw== MIME-Version: 1.0 X-Received: by 10.13.198.5 with SMTP id i5mr3226929ywd.263.1463772667738; Fri, 20 May 2016 12:31:07 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Fri, 20 May 2016 12:31:07 -0700 (PDT) In-Reply-To: <201605201910.u4KJAT13015624@repo.freebsd.org> References: <201605201910.u4KJAT13015624@repo.freebsd.org> Date: Fri, 20 May 2016 21:31:07 +0200 Message-ID: Subject: Re: svn commit: r300322 - head/bin/ed From: Ed Schouten To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:31:09 -0000 2016-05-20 21:10 GMT+02:00 Pedro F. Giffuni : > /* initialize the padding vector */ > for (i = 0; i < 8; i++) > - pvec[i] = (char) (arc4random() % 256); > + pvec[i] = (char)arc4random_uniform(256); This could be simplified to just calling arc4random_buf() on pvec, right? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Fri May 20 19:37:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B3B0B44A7C; Fri, 20 May 2016 19:37:48 +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 F18401DEF; Fri, 20 May 2016 19:37:47 +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 u4KJbl2N024878; Fri, 20 May 2016 19:37:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJbltb024877; Fri, 20 May 2016 19:37:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605201937.u4KJbltb024877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 20 May 2016 19:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300328 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:37:48 -0000 Author: imp Date: Fri May 20 19:37:46 2016 New Revision: 300328 URL: https://svnweb.freebsd.org/changeset/base/300328 Log: Cleanup to use %S. Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri May 20 19:30:52 2016 (r300327) +++ head/sys/boot/efi/loader/main.c Fri May 20 19:37:46 2016 (r300328) @@ -75,20 +75,6 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PRO static void efi_zfs_probe(void); #endif -/* - * Need this because EFI uses UTF-16 unicode string constants, but we - * use UTF-8. We can't use printf due to the possibility of \0 and we - * don't support support wide characters either. - */ -static void -print_str16(const CHAR16 *str) -{ - int i; - - for (i = 0; str[i]; i++) - printf("%c", (char)str[i]); -} - static void cp16to8(const CHAR16 *src, char *dst, size_t len) { @@ -96,6 +82,8 @@ cp16to8(const CHAR16 *src, char *dst, si for (i = 0; i < len && src[i]; i++) dst[i] = (char)src[i]; + if (i < len) + dst[i] = '\0'; } static int @@ -330,10 +318,8 @@ main(int argc, CHAR16 *argv[]) BS->HandleProtocol(IH, &imgid, (VOID**)&img); printf("Command line arguments:"); - for (i = 0; i < argc; i++) { - printf(" "); - print_str16(argv[i]); - } + for (i = 0; i < argc; i++) + printf(" %S", argv[i]); printf("\n"); printf("Image base: 0x%lx\n", (u_long)img->ImageBase); From owner-svn-src-all@freebsd.org Fri May 20 19:37:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1C2B44AA2; Fri, 20 May 2016 19:37:55 +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 A99F31EF8; Fri, 20 May 2016 19:37:55 +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 u4KJbsVF024924; Fri, 20 May 2016 19:37:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJbs66024923; Fri, 20 May 2016 19:37:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605201937.u4KJbs66024923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 20 May 2016 19:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300329 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:37:56 -0000 Author: imp Date: Fri May 20 19:37:54 2016 New Revision: 300329 URL: https://svnweb.freebsd.org/changeset/base/300329 Log: Implement efi-set and efi-unset Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri May 20 19:37:46 2016 (r300328) +++ head/sys/boot/efi/loader/main.c Fri May 20 19:37:54 2016 (r300329) @@ -75,8 +75,23 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PRO static void efi_zfs_probe(void); #endif +/* + * cpy8to16 copies a traditional C string into a CHAR16 string and + * 0 terminates it. len is the size of *dst in bytes. + */ static void -cp16to8(const CHAR16 *src, char *dst, size_t len) +cpy8to16(const char *src, CHAR16 *dst, size_t len) +{ + len <<= 1; /* Assume CHAR16 is 2 bytes */ + while (len > 0 && *src) { + *dst++ = *src++; + len--; + } + *dst++ = (CHAR16)0; +} + +static void +cpy16to8(const CHAR16 *src, char *dst, size_t len) { size_t i; @@ -256,14 +271,14 @@ main(int argc, CHAR16 *argv[]) if (i + 1 == argc) { setenv("comconsole_speed", "115200", 1); } else { - cp16to8(&argv[i + 1][0], var, + cpy16to8(&argv[i + 1][0], var, sizeof(var)); setenv("comconsole_speedspeed", var, 1); } i++; break; } else { - cp16to8(&argv[i][j + 1], var, + cpy16to8(&argv[i][j + 1], var, sizeof(var)); setenv("comconsole_speed", var, 1); break; @@ -909,6 +924,32 @@ COMMAND_SET(efiset, "efi-set", "set EFI static int command_efi_set(int argc, char *argv[]) { + char *uuid, *var, *val; + CHAR16 wvar[128]; + EFI_GUID guid; + uint32_t status; + EFI_STATUS err; + + if (argc != 4) { + printf("efi-set uuid var new-value\n"); + return (CMD_ERROR); + } + uuid = argv[1]; + var = argv[2]; + val = argv[3]; + uuid_from_string(uuid, (uuid_t *)&guid, &status); + if (status != uuid_s_ok) { + printf("Invalid uuid %s\n", uuid); + return (CMD_ERROR); + } + cpy8to16(var, wvar, sizeof(wvar)); + err = RS->SetVariable(wvar, &guid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS, + strlen(val) + 1, val); + if (EFI_ERROR(err)) { + printf("Failed to set variable: error %d\n", EFI_ERROR_CODE(err)); + return (CMD_ERROR); + } return (CMD_OK); } @@ -917,6 +958,29 @@ COMMAND_SET(efiunset, "efi-unset", "dele static int command_efi_unset(int argc, char *argv[]) { + char *uuid, *var; + CHAR16 wvar[128]; + EFI_GUID guid; + uint32_t status; + EFI_STATUS err; + + if (argc != 3) { + printf("efi-unset uuid var\n"); + return (CMD_ERROR); + } + uuid = argv[1]; + var = argv[2]; + uuid_from_string(uuid, (uuid_t *)&guid, &status); + if (status != uuid_s_ok) { + printf("Invalid uuid %s\n", uuid); + return (CMD_ERROR); + } + cpy8to16(var, wvar, sizeof(wvar)); + err = RS->SetVariable(wvar, &guid, 0, 0, NULL); + if (EFI_ERROR(err)) { + printf("Failed to unset variable: error %d\n", EFI_ERROR_CODE(err)); + return (CMD_ERROR); + } return (CMD_OK); } From owner-svn-src-all@freebsd.org Fri May 20 19:38:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84527B44AE0; Fri, 20 May 2016 19:38: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 12EC3102E; Fri, 20 May 2016 19:38:01 +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 u4KJc1Ol024972; Fri, 20 May 2016 19:38:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJc1XA024971; Fri, 20 May 2016 19:38:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605201938.u4KJc1XA024971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 20 May 2016 19:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300330 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:38:02 -0000 Author: imp Date: Fri May 20 19:38:01 2016 New Revision: 300330 URL: https://svnweb.freebsd.org/changeset/base/300330 Log: Large improvements to efi-show (though some weird problems linger). We now print only printable characters for the values and we print ascii strings as strings. Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri May 20 19:37:54 2016 (r300329) +++ head/sys/boot/efi/loader/main.c Fri May 20 19:38:01 2016 (r300330) @@ -632,57 +632,6 @@ command_mode(int argc, char *argv[]) return (CMD_OK); } - -/* deprecated */ -COMMAND_SET(nvram, "nvram", "get or set NVRAM variables", command_nvram); - -static int -command_nvram(int argc, char *argv[]) -{ - CHAR16 var[128]; - CHAR16 *data; - EFI_STATUS status; - EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; - UINTN varsz, datasz, i; - SIMPLE_TEXT_OUTPUT_INTERFACE *conout; - - conout = ST->ConOut; - - /* Initiate the search */ - status = RS->GetNextVariableName(&varsz, NULL, NULL); - - pager_open(); - for (; status != EFI_NOT_FOUND; ) { - status = RS->GetNextVariableName(&varsz, var, &varguid); - //if (EFI_ERROR(status)) - //break; - - conout->OutputString(conout, var); - printf("="); - datasz = 0; - status = RS->GetVariable(var, &varguid, NULL, &datasz, NULL); - /* XXX: check status */ - data = malloc(datasz); - status = RS->GetVariable(var, &varguid, NULL, &datasz, data); - if (EFI_ERROR(status)) - printf(""); - else { - for (i = 0; i < datasz; i++) { - if (isalnum(data[i]) || isspace(data[i])) - printf("%c", data[i]); - else - printf("\\x%02x", data[i]); - } - } - free(data); - if (pager_output("\n")) - break; - } - pager_close(); - - return (CMD_OK); -} - #ifdef EFI_ZFS_BOOT COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", command_lszfs); @@ -738,17 +687,18 @@ command_reloadbe(int argc, char *argv[]) } #endif -COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_printenv); +COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show); static int efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) { - UINTN datasz; + UINTN datasz, i; EFI_STATUS status; UINT32 attr; CHAR16 *data; char *str; uint32_t uuid_status; + int is_ascii; datasz = 0; status = RS->GetVariable(varnamearg, matchguid, &attr, @@ -765,8 +715,33 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU return (CMD_ERROR); } uuid_to_string((uuid_t *)matchguid, &str, &uuid_status); - printf("%s %S=%S", str, varnamearg, data); - free(str); + if (lflag) { + printf("%s 0x%x %S", str, attr, varnamearg); + } else { + printf("%s 0x%x %S=", str, attr, varnamearg); + is_ascii = 1; + free(str); + str = (char *)data; + for (i = 0; i < datasz - 1; i++) { + /* Quick hack to see if this ascii-ish string printable range plus tab, cr and lf */ + if ((str[i] < 32 || str[i] > 126) && str[i] != 9 && str[i] != 10 && str[i] != 13) { + is_ascii = 0; + break; + } + } + if (str[datasz - 1] != '\0') + is_ascii = 0; + if (is_ascii) + printf("%s", str); + else { + for (i = 0; i < datasz / 2; i++) { + if (isalnum(data[i]) || isspace(data[i])) + printf("%c", data[i]); + else + printf("\\x%02x", data[i]); + } + } + } free(data); if (pager_output("\n")) return (CMD_WARN); @@ -774,20 +749,20 @@ efi_print_var(CHAR16 *varnamearg, EFI_GU } static int -command_efi_printenv(int argc, char *argv[]) +command_efi_show(int argc, char *argv[]) { /* - * efi-printenv [-a] + * efi-show [-a] * print all the env - * efi-printenv -u UUID + * efi-show -u UUID * print all the env vars tagged with UUID - * efi-printenv -v var + * efi-show -v var * search all the env vars and print the ones matching var - * eif-printenv -u UUID -v var - * eif-printenv UUID var + * eif-show -u UUID -v var + * eif-show UUID var * print all the env vars that match UUID and var */ - /* XXX We assume EFI_GUID is the same as uuid_t */ + /* NB: We assume EFI_GUID is the same as uuid_t */ int aflag = 0, gflag = 0, lflag = 0, vflag = 0; int ch, rv; unsigned i; @@ -826,6 +801,7 @@ command_efi_printenv(int argc, char *arg for (i = 0; i < strlen(optarg); i++) varnamearg[i] = optarg[i]; varnamearg[i] = 0; + break; default: printf("Invalid argument %c\n", ch); return (CMD_ERROR); @@ -939,12 +915,12 @@ command_efi_set(int argc, char *argv[]) val = argv[3]; uuid_from_string(uuid, (uuid_t *)&guid, &status); if (status != uuid_s_ok) { - printf("Invalid uuid %s\n", uuid); + printf("Invalid uuid %s %d\n", uuid, status); return (CMD_ERROR); } cpy8to16(var, wvar, sizeof(wvar)); err = RS->SetVariable(wvar, &guid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS, strlen(val) + 1, val); if (EFI_ERROR(err)) { printf("Failed to set variable: error %d\n", EFI_ERROR_CODE(err)); From owner-svn-src-all@freebsd.org Fri May 20 19:46:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 006EDB44D8E; Fri, 20 May 2016 19:46:27 +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 A869E1761; Fri, 20 May 2016 19:46:26 +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 u4KJkPbA027887; Fri, 20 May 2016 19:46:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJkPKw027885; Fri, 20 May 2016 19:46:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605201946.u4KJkPKw027885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 19:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300331 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:46:27 -0000 Author: jhb Date: Fri May 20 19:46:25 2016 New Revision: 300331 URL: https://svnweb.freebsd.org/changeset/base/300331 Log: Consistently set status to -1 when completing an AIO request with an error. Sponsored by: Chelsio Communications Modified: head/sys/kern/sys_socket.c head/sys/kern/vfs_aio.c Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Fri May 20 19:38:01 2016 (r300330) +++ head/sys/kern/sys_socket.c Fri May 20 19:46:25 2016 (r300331) @@ -605,7 +605,6 @@ retry: cnt -= uio.uio_resid; td->td_ucred = td_savedcred; - /* XXX: Not sure if this is needed? */ if (cnt != 0 && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; @@ -633,7 +632,10 @@ retry: TAILQ_INSERT_HEAD(&sb->sb_aiojobq, job, list); } } else { - aio_complete(job, cnt, error); + if (error) + aio_complete(job, -1, error); + else + aio_complete(job, cnt, 0); SOCKBUF_LOCK(sb); } } Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Fri May 20 19:38:01 2016 (r300330) +++ head/sys/kern/vfs_aio.c Fri May 20 19:46:25 2016 (r300331) @@ -806,7 +806,10 @@ aio_process_rw(struct kaiocb *job) cnt -= auio.uio_resid; td->td_ucred = td_savedcred; - aio_complete(job, cnt, error); + if (error) + aio_complete(job, -1, error); + else + aio_complete(job, cnt, 0); } static void @@ -824,7 +827,10 @@ aio_process_sync(struct kaiocb *job) if (fp->f_vnode != NULL) error = aio_fsync_vnode(td, fp->f_vnode); td->td_ucred = td_savedcred; - aio_complete(job, 0, error); + if (error) + aio_complete(job, -1, error); + else + aio_complete(job, 0, 0); } static void @@ -839,7 +845,10 @@ aio_process_mlock(struct kaiocb *job) aio_switch_vmspace(job); error = vm_mlock(job->userproc, job->cred, __DEVOLATILE(void *, cb->aio_buf), cb->aio_nbytes); - aio_complete(job, 0, error); + if (error) + aio_complete(job, -1, error); + else + aio_complete(job, 0, 0); } static void @@ -2323,7 +2332,10 @@ aio_physwakeup(struct bio *bp) else job->inputcharge += nblks; - aio_complete(job, nbytes, error); + if (error) + aio_complete(job, -1, error); + else + aio_complete(job, nbytes, 0); g_destroy_bio(bp); } From owner-svn-src-all@freebsd.org Fri May 20 19:50:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D0A0B44E20; Fri, 20 May 2016 19:50:34 +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 EEC97197A; Fri, 20 May 2016 19:50:33 +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 u4KJoXmk028094; Fri, 20 May 2016 19:50:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJoWA5028092; Fri, 20 May 2016 19:50:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605201950.u4KJoWA5028092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 May 2016 19:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:50:34 -0000 Author: kib Date: Fri May 20 19:50:32 2016 New Revision: 300332 URL: https://svnweb.freebsd.org/changeset/base/300332 Log: Check for overflow and return EINVAL if detected. Backport this and r300305 to i386. PR: 209661 Reported and reviewed by: cturt Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/i386/i386/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Fri May 20 19:46:25 2016 (r300331) +++ head/sys/amd64/amd64/sys_machdep.c Fri May 20 19:50:32 2016 (r300332) @@ -344,7 +344,8 @@ amd64_set_ioperm(td, uap) return (error); if ((error = securelevel_gt(td->td_ucred, 0)) != 0) return (error); - if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) + if (uap->start > uap->start + uap->length || + uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) return (EINVAL); /* Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri May 20 19:46:25 2016 (r300331) +++ head/sys/i386/i386/sys_machdep.c Fri May 20 19:50:32 2016 (r300332) @@ -315,8 +315,9 @@ i386_set_ioperm(td, uap) struct thread *td; struct i386_ioperm_args *uap; { - int i, error; char *iomap; + u_int i; + int error; if ((error = priv_check(td, PRIV_IO)) != 0) return (error); @@ -334,7 +335,8 @@ i386_set_ioperm(td, uap) return (error); iomap = (char *)td->td_pcb->pcb_ext->ext_iomap; - if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) + if (uap->start > uap->start + uap->length || + uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) return (EINVAL); for (i = uap->start; i < uap->start + uap->length; i++) { From owner-svn-src-all@freebsd.org Fri May 20 19:53:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA6CB44002 for ; Fri, 20 May 2016 19:53:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm16.bullet.mail.bf1.yahoo.com (nm16.bullet.mail.bf1.yahoo.com [98.139.212.175]) (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 89CEC1E01 for ; Fri, 20 May 2016 19:53:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463774002; bh=f58/QHs3yfqDNqosNINtR7fBwhF+y8sEfYSuQ2Ydrrk=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=pLaLC+32R1ETO78vrWgTxHfMIZ73lr3WQr6u8OEG1jROuKwPmJ0c+f3IVI/Qaogwl/k7C4MI8iKqg8r273J4jbFZYxF/1PP6slhVuKO4RCGaE9ER8581DH9Rizp+BUID7Lj3W91AgIwfs+Ij4tAMvcLAMhL5oiUKpSf50NTPm0Xfn4OHKrKLa9h9tu3L+f4q38RRxU1daKTSU7R6EZoPiwF95q7BUIqzO6lNN2tNH+bpo3v+qTqS/xTokTOCOvQVfix97AEh2G8odqsnI7pC9VpgdeFRPOl2F0IgaORFgAOlW2GEmqfpH7rp/RMJGQr+WkWlsVxOn98D/5KB02apIw== Received: from [66.196.81.171] by nm16.bullet.mail.bf1.yahoo.com with NNFMP; 20 May 2016 19:53:22 -0000 Received: from [98.139.211.192] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 20 May 2016 19:53:22 -0000 Received: from [127.0.0.1] by smtp201.mail.bf1.yahoo.com with NNFMP; 20 May 2016 19:53:22 -0000 X-Yahoo-Newman-Id: 688695.78915.bm@smtp201.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: uUz01R8VM1knrzWhR6pXq1Y8VeV4MkA_fR91eSmUaoMYpo1 oB4JJkXa0VB3yspsgvM41Yc.0jqm..WQVM8MLqPLm2IhmQOSxFd5PDixPCAW IMUEE2wcZzdeL3DnuU82xZNNV0Td80oBxL6Ul90l4pLtrEgDhM_xkBuOnV0i fpa10JwR1gUFiS8wJiI_X__XOKZVcyDAl44sbny0C1SCnGyZgJsJ_6yL6QVg DKRm1kWg4IoMIL5L2LdrR2laAc_uZhVkZmOmEFAq2sbIBhUv_svUjUKPAUOA CVjBwNeZTcaYt5BC9Z9rNLSTu4494WnnFUTocuEvYDN50.gNT0Ucdbq5ic3O VWdwpWD6RPXsZP0MjbBYBoidvK32CRZbhTsPYPKCBvdjfcReyJ_y8Sg5RAL4 4n.R8YWzXfVVC3j_3NYydzetTPEtfaaVIRDOY49vfiPH.D5VbVOOsZQeF9Ls cRvcznpT8oD5ruO702GQauAf8bDUzafkywDKRKVpdQyNy1LPMjnhSlBILkE0 lkL6nrLitHM5zyDMPRro0j6_.JLsR4bk- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300322 - head/bin/ed To: Ed Schouten References: <201605201910.u4KJAT13015624@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <1555e0da-830b-d06b-080b-a8176a7db67d@FreeBSD.org> Date: Fri, 20 May 2016 14:53:32 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 19:53:24 -0000 On 05/20/16 14:31, Ed Schouten wrote: > 2016-05-20 21:10 GMT+02:00 Pedro F. Giffuni : >> /* initialize the padding vector */ >> for (i = 0; i < 8; i++) >> - pvec[i] = (char) (arc4random() % 256); >> + pvec[i] = (char)arc4random_uniform(256); > > This could be simplified to just calling arc4random_buf() on pvec, right? > Hmm ... Yes. FWIW, ed(1) needs a bunch of cleanups. OpenBSD removed the DES code altogether. Pedro. From owner-svn-src-all@freebsd.org Fri May 20 20:01:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97B80B440AC; Fri, 20 May 2016 20:01:11 +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 57C85106B; Fri, 20 May 2016 20:01:11 +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 u4KK1AOd031109; Fri, 20 May 2016 20:01:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KK1AKm031108; Fri, 20 May 2016 20:01:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605202001.u4KK1AKm031108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 May 2016 20:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300333 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 20:01:11 -0000 Author: pfg Date: Fri May 20 20:01:10 2016 New Revision: 300333 URL: https://svnweb.freebsd.org/changeset/base/300333 Log: gas: Implement the .inst assembler directive for arm. We normally use the binutils from ports but on other systems this is required for building gcc 4.9. Obtained from: OpenBSD (CVS rev. 1.5) MFC after: 3 weeks Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Fri May 20 19:50:32 2016 (r300332) +++ head/contrib/binutils/gas/config/tc-arm.c Fri May 20 20:01:10 2016 (r300333) @@ -2284,6 +2284,37 @@ s_unreq (int a ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +static void +s_inst(int unused ATTRIBUTE_UNUSED) +{ + expressionS exp; + + if (thumb_mode) { + as_bad(".inst not implemented for Thumb mode"); + ignore_rest_of_line(); + return; + } + + if (is_it_end_of_statement()) { + demand_empty_rest_of_line(); + return; + } + + do { + expression(&exp); + + if (exp.X_op != O_constant) + as_bad("constant expression required"); + else + emit_expr(&exp, 4); + + } while (*input_line_pointer++ == ','); + + /* Put terminator back into stream. */ + input_line_pointer--; + demand_empty_rest_of_line(); +} + /* Directives: Instruction set selection. */ #ifdef OBJ_ELF @@ -3895,6 +3926,7 @@ const pseudo_typeS md_pseudo_table[] = { "object_arch", s_arm_object_arch, 0 }, { "fpu", s_arm_fpu, 0 }, { "arch_extension", s_arm_arch_extension, 0 }, + { "inst", s_inst, 0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, From owner-svn-src-all@freebsd.org Fri May 20 20:27:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFE78B445F3; Fri, 20 May 2016 20:27: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 975E31D34; Fri, 20 May 2016 20:27: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 u4KKRUbP039941; Fri, 20 May 2016 20:27:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KKRUBk039938; Fri, 20 May 2016 20:27:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605202027.u4KKRUBk039938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 May 2016 20:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300334 - in head/contrib/elftoolchain: elfdump libelftc readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 20:27:32 -0000 Author: emaste Date: Fri May 20 20:27:30 2016 New Revision: 300334 URL: https://svnweb.freebsd.org/changeset/base/300334 Log: elftoolchain: backwards compatability for EM_RISCV definition It is not provided by sys/elf_common.h on older releases Reported by: Jenkins Modified: head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Fri May 20 20:01:10 2016 (r300333) +++ head/contrib/elftoolchain/elfdump/elfdump.c Fri May 20 20:27:30 2016 (r300334) @@ -56,6 +56,9 @@ ELFTC_VCSID("$Id: elfdump.c 3474 2016-05 #ifndef EM_IAMCU #define EM_IAMCU 6 #endif +#ifndef EM_RISCV +#define EM_RISCV 243 +#endif #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Fri May 20 20:01:10 2016 (r300333) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Fri May 20 20:27:30 2016 (r300334) @@ -35,6 +35,9 @@ #ifndef EM_IAMCU #define EM_IAMCU 6 #endif +#ifndef EM_RISCV +#define EM_RISCV 243 +#endif const char * elftc_reloc_type_str(unsigned int mach, unsigned int type) Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri May 20 20:01:10 2016 (r300333) +++ head/contrib/elftoolchain/readelf/readelf.c Fri May 20 20:27:30 2016 (r300334) @@ -53,6 +53,9 @@ ELFTC_VCSID("$Id: readelf.c 3469 2016-05 #ifndef EM_IAMCU #define EM_IAMCU 6 #endif +#ifndef EM_RISCV +#define EM_RISCV 243 +#endif #ifndef STB_GNU_UNIQUE #define STB_GNU_UNIQUE 10 #endif From owner-svn-src-all@freebsd.org Fri May 20 23:02:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D0BFB4395E; Fri, 20 May 2016 23:02:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 9F1C41710; Fri, 20 May 2016 23:02:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 7F041D49B0F; Sat, 21 May 2016 09:02:21 +1000 (AEST) Date: Sat, 21 May 2016 09:02:21 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 In-Reply-To: <201605201950.u4KJoWA5028092@repo.freebsd.org> Message-ID: <20160521081930.I1098@besplex.bde.org> References: <201605201950.u4KJoWA5028092@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.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=KLCK9ar9Cjh003kMN1MA:9 a=CANlSisP4UVpKUjV:21 a=3Ba7BzsO7dAWVtIk:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 23:02:39 -0000 On Fri, 20 May 2016, Konstantin Belousov wrote: > Log: > Check for overflow and return EINVAL if detected. Backport this and > r300305 to i386. > > PR: 209661 > Reported and reviewed by: cturt > Sponsored by: The FreeBSD Foundation > MFC after: 3 days > > Modified: > head/sys/amd64/amd64/sys_machdep.c > head/sys/i386/i386/sys_machdep.c > > Modified: head/sys/i386/i386/sys_machdep.c > ============================================================================== > --- head/sys/i386/i386/sys_machdep.c Fri May 20 19:46:25 2016 (r300331) > +++ head/sys/i386/i386/sys_machdep.c Fri May 20 19:50:32 2016 (r300332) > @@ -315,8 +315,9 @@ i386_set_ioperm(td, uap) > struct thread *td; > struct i386_ioperm_args *uap; > { > - int i, error; > char *iomap; > + u_int i; > + int error; > > if ((error = priv_check(td, PRIV_IO)) != 0) > return (error); > @@ -334,7 +335,8 @@ i386_set_ioperm(td, uap) > return (error); > iomap = (char *)td->td_pcb->pcb_ext->ext_iomap; > > - if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) > + if (uap->start > uap->start + uap->length || > + uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) > return (EINVAL); > > for (i = uap->start; i < uap->start + uap->length; i++) { I don't like using u_int for a small index. After the bounds checking fix, the range fits in a small signed integer. However, uap->start and uap->length already use bad type u_int, so it is natural to keep using that type. Except, i386_get/set_ioperm() is undocumented on amd64, so no one knows what its types are. amd64 documents sysarch(2) and that refers to i386_get_ioperm(2), i386_get_ldt(2) and i386_vm86(2), but these man pages are not installed. They are installed on i386. I think syscalls for them exist ecept for vm86. Man pages are also missing for newer sysarch() calls, and amd64 has more of these: {AMD64,I386}_{GET,SET}_XFPUSTATE, {AMD64,I386}_{GET,SET}_{FS,GS}BASE. apropos can't find anything related. It would be even more natural to do separate range checks for the start and length: start >= 0 && start <= IOPAGES * PAGE_SIZE * NBBY && length >= 0 && length <= IOPAGES * PAGE_SIZE * NBBY - start. It isn't clear whether to allow the silly null range of start = = IOPAGES * PAGE_SIZE * NBBY && length == 0. Initialization doesn't allow this. Other null ranges should be allowed. Didn't the old versions already have adequate bounds checking even without the fixes? The fixes just avoid depending on undefined^Wimplementation- defined behaviour, and return EINVAL instead of doing nothing for bad ranges: X if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) X return (EINVAL); X X for (i = uap->start; i < uap->start + uap->length; i++) { Suppose (uap->start > uap->start + uap->length). Then if i is unsigned, the intial i is after the end so nothing is done, and if i is signed then the same is true if uap->start < INT_MAX; otherwise assignment overflows to an implementation-defined value which is usually negative and comparision turns this into a value which is much larger than the end, so again nothing is done. Changing a type from signed to unsigned is neither necessary nor sufficient for getting this right. You have to know that the entire range fits in the type. The analysis for it fitting in the range [0, INT_MAX] is not much different for the analysis for it fitting in the range [0, UINT_MAX], but is often slightly simpler because it cannot depend on special properties of unsigned types. Bruce From owner-svn-src-all@freebsd.org Fri May 20 23:08:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB4A0B43A0C; Fri, 20 May 2016 23:08:23 +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 76669195F; Fri, 20 May 2016 23:08:23 +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 u4KN8M3Y088210; Fri, 20 May 2016 23:08:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KN8MKw088209; Fri, 20 May 2016 23:08:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605202308.u4KN8MKw088209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 23:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300336 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 23:08:23 -0000 Author: jhb Date: Fri May 20 23:08:22 2016 New Revision: 300336 URL: https://svnweb.freebsd.org/changeset/base/300336 Log: Move the KTR for the update of ddp_active_id on each completion under VERBOSE_TRACES. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Fri May 20 22:03:51 2016 (r300335) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Fri May 20 23:08:22 2016 (r300336) @@ -296,8 +296,10 @@ complete_ddp_buffer(struct toepcb *toep, toep->ddp_active_id = -1; } else toep->ddp_active_id ^= 1; +#ifdef VERBOSE_TRACES CTR2(KTR_CXGBE, "%s: ddp_active_id = %d", __func__, toep->ddp_active_id); +#endif } else { KASSERT(toep->ddp_active_count != 0 && toep->ddp_active_id != -1, From owner-svn-src-all@freebsd.org Fri May 20 23:28:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90F58B43DD4; Fri, 20 May 2016 23:28:44 +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 53942111A; Fri, 20 May 2016 23:28:44 +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 u4KNShQq094229; Fri, 20 May 2016 23:28:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KNShU9094225; Fri, 20 May 2016 23:28:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605202328.u4KNShU9094225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 20 May 2016 23:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300337 - in head: share/man/man9 sys/kern 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 23:28:44 -0000 Author: jhb Date: Fri May 20 23:28:43 2016 New Revision: 300337 URL: https://svnweb.freebsd.org/changeset/base/300337 Log: Add sglist functions for working with arrays of VM pages. sglist_count_vmpages() determines the number of segments required for a buffer described by an array of VM pages. sglist_append_vmpages() adds the segments described by such a buffer to an sglist. The latter function is largely pulled from sglist_append_bio(), and sglist_append_bio() now uses sglist_append_vmpages(). Reviewed by: kib Sponsored by: Chelsio Communications Modified: head/share/man/man9/Makefile head/share/man/man9/sglist.9 head/sys/kern/subr_sglist.c head/sys/sys/sglist.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri May 20 23:08:22 2016 (r300336) +++ head/share/man/man9/Makefile Fri May 20 23:28:43 2016 (r300337) @@ -1510,10 +1510,12 @@ MLINKS+=sglist.9 sglist_alloc.9 \ sglist.9 sglist_append_phys.9 \ sglist.9 sglist_append_uio.9 \ sglist.9 sglist_append_user.9 \ + sglist.9 sglist_append_vmpages.9 \ sglist.9 sglist_build.9 \ sglist.9 sglist_clone.9 \ sglist.9 sglist_consume_uio.9 \ sglist.9 sglist_count.9 \ + sglist.9 sglist_count_vmpages.9 \ sglist.9 sglist_free.9 \ sglist.9 sglist_hold.9 \ sglist.9 sglist_init.9 \ Modified: head/share/man/man9/sglist.9 ============================================================================== --- head/share/man/man9/sglist.9 Fri May 20 23:08:22 2016 (r300336) +++ head/share/man/man9/sglist.9 Fri May 20 23:28:43 2016 (r300337) @@ -38,10 +38,12 @@ .Nm sglist_append_phys , .Nm sglist_append_uio , .Nm sglist_append_user , +.Nm sglist_append_vmpages , .Nm sglist_build , .Nm sglist_clone , .Nm sglist_consume_uio , .Nm sglist_count , +.Nm sglist_count_vmpages , .Nm sglist_free , .Nm sglist_hold , .Nm sglist_init , @@ -68,6 +70,8 @@ .Fn sglist_append_uio "struct sglist *sg" "struct uio *uio" .Ft int .Fn sglist_append_user "struct sglist *sg" "void *buf" "size_t len" "struct thread *td" +.Ft int +.Fn sglist_append_vmpages "struct sglist *sg" "vm_page_t *m" "size_t pgoff" "size_t len" .Ft struct sglist * .Fn sglist_build "void *buf" "size_t len" "int mflags" .Ft struct sglist * @@ -76,6 +80,8 @@ .Fn sglist_consume_uio "struct sglist *sg" "struct uio *uio" "size_t resid" .Ft int .Fn sglist_count "void *buf" "size_t len" +.Ft int +.Fn sglist_count_vmpages "vm_page_t *m" "size_t pgoff" "size_t len" .Ft void .Fn sglist_free "struct sglist *sg" .Ft struct sglist * @@ -137,6 +143,18 @@ and is bytes long. .Pp The +.Nm sglist_count_vmpages +function returns the number of scatter/gather list elements needed to describe +the physical address ranges of a buffer backed by an array of virtual memory +pages +.Fa m . +The buffer starts at an offset of +.Fa pgoff +bytes relative to the first page and is +.Fa len +bytes long. +.Pp +The .Nm sglist_build function allocates a new scatter/gather list object that describes the physical address ranges mapped by a single kernel virtual address range. @@ -262,6 +280,17 @@ the user buffer are wired for the lifeti .Fa sg . .Pp The +.Nm sglist_append_vmpages +function appends the physical address ranges of a buffer backed by an array +of virtual memory pages +.Fa m . +The buffer starts at an offset of +.Fa pgoff +bytes relative to the first page and is +.Fa len +bytes long. +.Pp +The .Nm sglist_consume_uio function is a variation of .Nm sglist_append_uio . @@ -421,7 +450,9 @@ functions return zero on success or an e .Pp The .Nm sglist_count -function returns a count of scatter/gather list elements. +and +.Nm sglist_count_vmpages +functions return a count of scatter/gather list elements. .Pp The .Nm sglist_length Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Fri May 20 23:08:22 2016 (r300336) +++ head/sys/kern/subr_sglist.c Fri May 20 23:28:43 2016 (r300337) @@ -192,6 +192,31 @@ sglist_count(void *buf, size_t len) } /* + * Determine the number of scatter/gather list elements needed to + * describe a buffer backed by an array of VM pages. + */ +int +sglist_count_vmpages(vm_page_t *m, size_t pgoff, size_t len) +{ + vm_paddr_t lastaddr, paddr; + int i, nsegs; + + if (len == 0) + return (0); + + len += pgoff; + nsegs = 1; + lastaddr = VM_PAGE_TO_PHYS(m[0]); + for (i = 1; len > PAGE_SIZE; len -= PAGE_SIZE, i++) { + paddr = VM_PAGE_TO_PHYS(m[i]); + if (lastaddr + PAGE_SIZE != paddr) + nsegs++; + lastaddr = paddr; + } + return (nsegs); +} + +/* * Allocate a scatter/gather list along with 'nsegs' segments. The * 'mflags' parameters are the same as passed to malloc(9). The caller * should use sglist_free() to free this list. @@ -252,33 +277,14 @@ sglist_append(struct sglist *sg, void *b int sglist_append_bio(struct sglist *sg, struct bio *bp) { - struct sgsave save; - vm_paddr_t paddr; - size_t len, tlen; - int error, i, ma_offs; + int error; - if ((bp->bio_flags & BIO_UNMAPPED) == 0) { + if ((bp->bio_flags & BIO_UNMAPPED) == 0) error = sglist_append(sg, bp->bio_data, bp->bio_bcount); - return (error); - } - - if (sg->sg_maxseg == 0) - return (EINVAL); - - SGLIST_SAVE(sg, save); - tlen = bp->bio_bcount; - ma_offs = bp->bio_ma_offset; - for (i = 0; tlen > 0; i++, tlen -= len) { - len = min(PAGE_SIZE - ma_offs, tlen); - paddr = VM_PAGE_TO_PHYS(bp->bio_ma[i]) + ma_offs; - error = sglist_append_phys(sg, paddr, len); - if (error) { - SGLIST_RESTORE(sg, save); - return (error); - } - ma_offs = 0; - } - return (0); + else + error = sglist_append_vmpages(sg, bp->bio_ma, + bp->bio_ma_offset, bp->bio_bcount); + return (error); } /* @@ -341,6 +347,51 @@ sglist_append_mbuf(struct sglist *sg, st } /* + * Append the segments that describe a buffer spanning an array of VM + * pages. The buffer begins at an offset of 'pgoff' in the first + * page. + */ +int +sglist_append_vmpages(struct sglist *sg, vm_page_t *m, size_t pgoff, + size_t len) +{ + struct sgsave save; + struct sglist_seg *ss; + vm_paddr_t paddr; + size_t seglen; + int error, i; + + if (sg->sg_maxseg == 0) + return (EINVAL); + if (len == 0) + return (0); + + SGLIST_SAVE(sg, save); + i = 0; + if (sg->sg_nseg == 0) { + seglen = min(PAGE_SIZE - pgoff, len); + sg->sg_segs[0].ss_paddr = VM_PAGE_TO_PHYS(m[0]) + pgoff; + sg->sg_segs[0].ss_len = seglen; + sg->sg_nseg = 1; + pgoff = 0; + len -= seglen; + i++; + } + ss = &sg->sg_segs[sg->sg_nseg - 1]; + for (; len > 0; i++, len -= seglen) { + seglen = min(PAGE_SIZE - pgoff, len); + paddr = VM_PAGE_TO_PHYS(m[i]) + pgoff; + error = _sglist_append_range(sg, &ss, paddr, seglen); + if (error) { + SGLIST_RESTORE(sg, save); + return (error); + } + pgoff = 0; + } + return (0); +} + +/* * Append the segments that describe a single user address range to a * scatter/gather list. If there are insufficient segments, then this * fails with EFBIG. Modified: head/sys/sys/sglist.h ============================================================================== --- head/sys/sys/sglist.h Fri May 20 23:08:22 2016 (r300336) +++ head/sys/sys/sglist.h Fri May 20 23:28:43 2016 (r300337) @@ -91,10 +91,13 @@ int sglist_append_phys(struct sglist *sg int sglist_append_uio(struct sglist *sg, struct uio *uio); int sglist_append_user(struct sglist *sg, void *buf, size_t len, struct thread *td); +int sglist_append_vmpages(struct sglist *sg, vm_page_t *m, size_t pgoff, + size_t len); struct sglist *sglist_build(void *buf, size_t len, int mflags); struct sglist *sglist_clone(struct sglist *sg, int mflags); int sglist_consume_uio(struct sglist *sg, struct uio *uio, size_t resid); int sglist_count(void *buf, size_t len); +int sglist_count_vmpages(vm_page_t *m, size_t pgoff, size_t len); void sglist_free(struct sglist *sg); int sglist_join(struct sglist *first, struct sglist *second); size_t sglist_length(struct sglist *sg); From owner-svn-src-all@freebsd.org Sat May 21 00:45:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C374AB44CB9; Sat, 21 May 2016 00:45:43 +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 9421E1259; Sat, 21 May 2016 00:45:43 +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 u4L0jgn4018120; Sat, 21 May 2016 00:45:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L0jgJC018119; Sat, 21 May 2016 00:45:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605210045.u4L0jgJC018119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 21 May 2016 00:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300340 - head/bin/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 00:45:43 -0000 Author: pfg Date: Sat May 21 00:45:42 2016 New Revision: 300340 URL: https://svnweb.freebsd.org/changeset/base/300340 Log: ed(1): simplify by using arc4random_buf(). Suggested by: ed Modified: head/bin/ed/cbc.c Modified: head/bin/ed/cbc.c ============================================================================== --- head/bin/ed/cbc.c Sat May 21 00:43:10 2016 (r300339) +++ head/bin/ed/cbc.c Sat May 21 00:45:42 2016 (r300340) @@ -90,16 +90,13 @@ void init_des_cipher(void) { #ifdef DES - int i; - des_ct = des_n = 0; /* initialize the initialization vector */ MEMZERO(ivec, 8); /* initialize the padding vector */ - for (i = 0; i < 8; i++) - pvec[i] = (char)arc4random_uniform(256); + arc4random_buf(pvec, sizeof(pvec)); #endif } From owner-svn-src-all@freebsd.org Sat May 21 01:04:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36BA8B430E6; Sat, 21 May 2016 01:04:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (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 F3E341C1F; Sat, 21 May 2016 01:04:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f180.google.com with SMTP id t40so70188454ioi.0; Fri, 20 May 2016 18:04:43 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=NQYqncRcd+vuXZbm03D3fR67BqjvCM+o7ZcS7XpiNko=; b=Mn0UyGuS6OUx1xNC9cKyoD4i1Q0krFYAYmqSrAxzokKJz2OeAsdmISLLg+dIA4HSB9 znqEy7FEXapQDo4cEplmnjZnsQ6Ob9TNPkIYOdtuc8ebGhUhVqPPDI+Rt4y6CB5y86Py gvtdMPMGGPvq46oMbUI7RhDMYQcC139q9TV39YGHKUXLdE3mjvLdsSW4Faz8dpDSCEVg 2cxdQ9GwVX21V+tvEVjnbLNE4X9qaPdEY/M/kIAqoivOkLsL4X9w+b79H0UVs1/uT9dZ 5giziUsCE2H/sIbTF3ykG62u4LoNjkU+41bWJqm2fvmtPwRy8L5A9CM1XyQckEZATFpf IywQ== X-Gm-Message-State: AOPr4FUyli0qCxYhnkz9LAk1DU7PQYVEetJmM37+wLwxG9cbs+VmnO0txRZt4PKbCAz6Gw== X-Received: by 10.107.9.97 with SMTP id j94mr3681485ioi.50.1463788925649; Fri, 20 May 2016 17:02:05 -0700 (PDT) Received: from mail-ig0-f176.google.com (mail-ig0-f176.google.com. [209.85.213.176]) by smtp.gmail.com with ESMTPSA id u66sm179977itc.21.2016.05.20.17.02.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 17:02:05 -0700 (PDT) Received: by mail-ig0-f176.google.com with SMTP id c3so397453igl.0; Fri, 20 May 2016 17:02:05 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.4.101 with SMTP id j5mr5234652igj.8.1463788924935; Fri, 20 May 2016 17:02:04 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Fri, 20 May 2016 17:02:04 -0700 (PDT) In-Reply-To: <20160521081930.I1098@besplex.bde.org> References: <201605201950.u4KJoWA5028092@repo.freebsd.org> <20160521081930.I1098@besplex.bde.org> Date: Fri, 20 May 2016 17:02:04 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 From: Conrad Meyer To: Bruce Evans Cc: Konstantin Belousov , 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:04:44 -0000 On Fri, May 20, 2016 at 4:02 PM, Bruce Evans wrote: > On Fri, 20 May 2016, Konstantin Belousov wrote: > >> --- head/sys/i386/i386/sys_machdep.c Fri May 20 19:46:25 2016 >> (r300331) >> +++ head/sys/i386/i386/sys_machdep.c Fri May 20 19:50:32 2016 >> (r300332) >> @@ -315,8 +315,9 @@ i386_set_ioperm(td, uap) >> struct thread *td; >> struct i386_ioperm_args *uap; >> { >> - int i, error; >> char *iomap; >> + u_int i; >> + int error; >> >> if ((error = priv_check(td, PRIV_IO)) != 0) >> return (error); >> @@ -334,7 +335,8 @@ i386_set_ioperm(td, uap) >> return (error); >> iomap = (char *)td->td_pcb->pcb_ext->ext_iomap; >> >> - if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >> + if (uap->start > uap->start + uap->length || >> + uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >> return (EINVAL); >> >> for (i = uap->start; i < uap->start + uap->length; i++) { > > > I don't like using u_int for a small index. Why not? Indices are by definition non-negative so the fit seems natural. > After the bounds checking > fix, the range fits in a small signed integer. However, uap->start > and uap->length already use bad type u_int, so it is natural to keep > using that type. What's bad about it? Thanks, Conrad From owner-svn-src-all@freebsd.org Sat May 21 01:11:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E967B431F3; Sat, 21 May 2016 01:11:01 +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 478721F70; Sat, 21 May 2016 01:11:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id D5346781EA3; Sat, 21 May 2016 11:10:52 +1000 (AEST) Date: Sat, 21 May 2016 11:10:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 In-Reply-To: Message-ID: <20160521103528.I1539@besplex.bde.org> References: <201605201950.u4KJoWA5028092@repo.freebsd.org> <20160521081930.I1098@besplex.bde.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.1 cv=TuMb/2jh c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=kXGavNC6CeC0bVARSMoA:9 a=E-ZPcJ4orlREQ8DK:21 a=cXrSxzgqgWSFdZ3D:21 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:11:01 -0000 On Fri, 20 May 2016, Conrad Meyer wrote: > On Fri, May 20, 2016 at 4:02 PM, Bruce Evans wrote: >> On Fri, 20 May 2016, Konstantin Belousov wrote: >> >>> --- head/sys/i386/i386/sys_machdep.c Fri May 20 19:46:25 2016 >>> (r300331) >>> +++ head/sys/i386/i386/sys_machdep.c Fri May 20 19:50:32 2016 >>> (r300332) >>> @@ -315,8 +315,9 @@ i386_set_ioperm(td, uap) >>> struct thread *td; >>> struct i386_ioperm_args *uap; >>> { >>> - int i, error; >>> char *iomap; >>> + u_int i; >>> + int error; >>> >>> if ((error = priv_check(td, PRIV_IO)) != 0) >>> return (error); >>> @@ -334,7 +335,8 @@ i386_set_ioperm(td, uap) >>> return (error); >>> iomap = (char *)td->td_pcb->pcb_ext->ext_iomap; >>> >>> - if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >>> + if (uap->start > uap->start + uap->length || >>> + uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >>> return (EINVAL); >>> >>> for (i = uap->start; i < uap->start + uap->length; i++) { >> >> I don't like using u_int for a small index. > > Why not? Indices are by definition non-negative so the fit seems natural. Signed integers are easier to understand provided calculations with them don't overflow. Unsigned integers are not easier to understand if calculations with them do overflow. That was the case here. Only indices relative to the base of an array are by definition non-negative. For an array a[], it is valid to do p = &a[i] and then use p[j] with negative j to get back before the i'th index. This is sometimes useful. i + j must be >= 0, but is hard write correctly and understand if either i or j is unsigned. (It can be arranged that the addition wraps correctly, but this is basically re-implementing signed arithmetic.) >> After the bounds checking >> fix, the range fits in a small signed integer. However, uap->start >> and uap->length already use bad type u_int, so it is natural to keep >> using that type. > > What's bad about it? Unsigned in the API gives unsigned poisoning when the API is used. The API would have needed unsigneds to cover the i386 i/o range of 64K using 16-bit ints, but since we never supported 16-bit ints and POSI now requires 32-bit ints, we shouldn't have the complications from that. Bruce From owner-svn-src-all@freebsd.org Sat May 21 01:31:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D48CBB437CE; Sat, 21 May 2016 01:31:42 +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 A5D471894; Sat, 21 May 2016 01:31:42 +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 u4L1Vf3q032819; Sat, 21 May 2016 01:31:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1Vfxr032817; Sat, 21 May 2016 01:31:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210131.u4L1Vfxr032817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300341 - head/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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:31:42 -0000 Author: bdrewery Date: Sat May 21 01:31:41 2016 New Revision: 300341 URL: https://svnweb.freebsd.org/changeset/base/300341 Log: FTS: Remove stale reference to nfs4 fs which was removed in r192578. MFC after: 2 weeks Modified: head/lib/libc/gen/fts-compat.c head/lib/libc/gen/fts.c Modified: head/lib/libc/gen/fts-compat.c ============================================================================== --- head/lib/libc/gen/fts-compat.c Sat May 21 00:45:42 2016 (r300340) +++ head/lib/libc/gen/fts-compat.c Sat May 21 01:31:41 2016 (r300341) @@ -114,7 +114,6 @@ static const char *ufslike_filesystems[] "ufs", "zfs", "nfs", - "nfs4", "ext2fs", 0 }; Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Sat May 21 00:45:42 2016 (r300340) +++ head/lib/libc/gen/fts.c Sat May 21 01:31:41 2016 (r300341) @@ -104,7 +104,6 @@ static const char *ufslike_filesystems[] "ufs", "zfs", "nfs", - "nfs4", "ext2fs", 0 }; From owner-svn-src-all@freebsd.org Sat May 21 01:31:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3B7B4380C; Sat, 21 May 2016 01:31:46 +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 3D40818B8; Sat, 21 May 2016 01:31:45 +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 u4L1VjQd032866; Sat, 21 May 2016 01:31:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1VjHv032865; Sat, 21 May 2016 01:31:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210131.u4L1VjHv032865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300342 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:31:46 -0000 Author: bdrewery Date: Sat May 21 01:31:44 2016 New Revision: 300342 URL: https://svnweb.freebsd.org/changeset/base/300342 Log: WITH_DIRDEPS_BUILD: Fix forcing user to run bootstrap-tools. This is a follow-up to r299289. If the user did not run bootstrap-tools for this directory then just build the tool as normal. It assumes that TARGET == MACHINE, but that was already the case before r299289. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Sat May 21 01:31:41 2016 (r300341) +++ head/share/mk/local.meta.sys.mk Sat May 21 01:31:44 2016 (r300342) @@ -232,7 +232,12 @@ TOOLSDIR?= ${HOST_OBJTOP}/tools .elif defined(STAGE_HOST_OBJTOP) TOOLSDIR?= ${STAGE_HOST_OBJTOP} .endif +# Only define if it exists in case user didn't run bootstrap-tools. Otherwise +# the tool will be built during the build. Building it assumes it is +# TARGET==MACHINE. +.if exists(${HOST_OBJTOP}/tools${.CURDIR}) BTOOLSPATH= ${HOST_OBJTOP}/tools${.CURDIR} +.endif # Don't use the bootstrap tools logic on itself. .if ${.TARGETS:Mbootstrap-tools} == "" && \ From owner-svn-src-all@freebsd.org Sat May 21 01:31:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B61B43842; Sat, 21 May 2016 01:31:53 +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 9B3E71A3D; Sat, 21 May 2016 01:31:52 +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 u4L1Vp43032960; Sat, 21 May 2016 01:31:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1VpRB032959; Sat, 21 May 2016 01:31:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210131.u4L1VpRB032959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300344 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:31:53 -0000 Author: bdrewery Date: Sat May 21 01:31:51 2016 New Revision: 300344 URL: https://svnweb.freebsd.org/changeset/base/300344 Log: WITH_META_MODE: Use META_MODE rather than .MAKE.MODE for buildkernel. This is mostly a style change so that other code does not duplicate it. The problem is when META_MODE needs to be disabled but it has been overridden by .MAKE.MODE. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 21 01:31:48 2016 (r300343) +++ head/Makefile.inc1 Sat May 21 01:31:51 2016 (r300344) @@ -533,7 +533,7 @@ KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS .if ${MK_META_MODE} == "yes" # meta mode normally is disallowed when building from curdir==objdir, but we # want to allow it for the kernel build. -KMAKE+= .MAKE.MODE="${.MAKE.MODE} curdirOk=yes" +KMAKEENV+= META_MODE="${.MAKE.MODE} curdirOk=yes" .endif # From owner-svn-src-all@freebsd.org Sat May 21 01:31:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94FFDB43830; Sat, 21 May 2016 01:31:50 +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 F3E0B197B; Sat, 21 May 2016 01:31:49 +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 u4L1VmOg032915; Sat, 21 May 2016 01:31:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1VmjQ032913; Sat, 21 May 2016 01:31:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210131.u4L1VmjQ032913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300343 - in head: share/mk 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:31:50 -0000 Author: bdrewery Date: Sat May 21 01:31:48 2016 New Revision: 300343 URL: https://svnweb.freebsd.org/changeset/base/300343 Log: WITH_META_MODE: Fix suffix transformation rules with guessed dependencies. This is the same problem as r290629. With META_MODE we do not generate .depend files, so there is no proper dependency to lookup. Guessed dependencies must be used. If this proves to be a problem then we will have to generate and use .depend files even with META_MODE. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat May 21 01:31:44 2016 (r300342) +++ head/share/mk/bsd.dep.mk Sat May 21 01:31:48 2016 (r300343) @@ -216,6 +216,12 @@ afterdepend: beforedepend (!defined(_meta_filemon) && !exists(${.OBJDIR}/${DEPENDFILE}.${__obj})) ${__obj}: ${OBJS_DEPEND_GUESS} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} +.elif defined(_meta_filemon) +# For meta mode we still need to know which file to depend on to avoid +# ambiguous suffix transformation rules from .PATH. Meta mode does not +# use .depend files. We really only need source files, not headers. +${__obj}: ${OBJS_DEPEND_GUESS:N*.h} +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}:N*.h} .endif .endfor Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sat May 21 01:31:44 2016 (r300342) +++ head/sys/conf/kern.post.mk Sat May 21 01:31:48 2016 (r300343) @@ -247,6 +247,14 @@ beforebuild: kernel-depend ${__obj}: ${OBJS_DEPEND_GUESS} .endif ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} +.elif defined(_meta_filemon) +# For meta mode we still need to know which file to depend on to avoid +# ambiguous suffix transformation rules from .PATH. Meta mode does not +# use .depend files. We really only need source files, not headers. +.if ${SYSTEM_OBJS:M${__obj}} +${__obj}: ${OBJS_DEPEND_GUESS:N*.h} +.endif +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}:N*.h} .endif .endfor From owner-svn-src-all@freebsd.org Sat May 21 01:32:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 157B3B4388E; Sat, 21 May 2016 01:32:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 729F11CE3; Sat, 21 May 2016 01:31:58 +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 u4L1Vw1X033053; Sat, 21 May 2016 01:31:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1VwUB033052; Sat, 21 May 2016 01:31:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210131.u4L1VwUB033052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300346 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:00 -0000 Author: bdrewery Date: Sat May 21 01:31:57 2016 New Revision: 300346 URL: https://svnweb.freebsd.org/changeset/base/300346 Log: WITH_META_MODE: Disable cookie handling for include installation. Using a cookie with meta mode causes it to *not rerun* (as normal make does) unless the command changes or filemon-detected files change. After all of the work done here it turns out that skipping installation is dangerous since the install commands use /*.h. The actual build command is not changing but the files installed are changing by the mere act of adding a new header into the source tree. Thus we cannot safely use meta mode logic here. It must always rerun and install the headers. The install -C flag at least prevents churning timestamps when installing a header that was already present. Sponsored by: EMC / Isilon Storage Division Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat May 21 01:31:54 2016 (r300345) +++ head/include/Makefile Sat May 21 01:31:57 2016 (r300346) @@ -130,7 +130,7 @@ _MARCHS= ${MACHINE_CPUARCH} _MARCHS+= x86 .endif -META_TARGETS+= compat copies symlinks +META_TARGETS+= compat stage_includes: ${SHARED} # Take care of stale directory-level symlinks. @@ -144,7 +144,7 @@ compat: -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ -p ${DESTDIR}${INCLUDEDIR} > /dev/null -copies: +copies: .PHONY .META .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \ ${_MARCHS} if [ -d ${DESTDIR}${INCLUDEDIR}/$i ]; then \ @@ -230,7 +230,7 @@ copies: ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \ ${DESTDIR}${INCLUDEDIR}/teken -symlinks: +symlinks: .PHONY .META @${ECHO} "Setting up symlinks to kernel source tree..." .for i in ${LDIRS} cd ${.CURDIR}/../sys/$i; \ From owner-svn-src-all@freebsd.org Sat May 21 01:32:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D28FB438A0; Sat, 21 May 2016 01:32:02 +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 469B21D8D; Sat, 21 May 2016 01:32:02 +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 u4L1W1RH033104; Sat, 21 May 2016 01:32:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1W1eJ033103; Sat, 21 May 2016 01:32:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1W1eJ033103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300347 - head/gnu/usr.bin/cc/cc_tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:02 -0000 Author: bdrewery Date: Sat May 21 01:32:01 2016 New Revision: 300347 URL: https://svnweb.freebsd.org/changeset/base/300347 Log: WITH_META_MODE: Avoid rebuilds of cc_tools during target build. This is the same as r299289 and r297997. Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/usr.bin/cc/cc_tools/Makefile Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Sat May 21 01:31:57 2016 (r300346) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Sat May 21 01:32:01 2016 (r300347) @@ -279,7 +279,7 @@ gengtype: gengtype.o gengtype-yacc+%DIKE ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} gtype-desc.h: gengtype - ./gengtype + ${BTOOLSPATH:U.}/gengtype touch ${.TARGET} gtype-desc.c: gtype-desc.h @@ -309,7 +309,7 @@ gencondmd: gencondmd.o # Generated .md files. # insn-conditions.md: gencondmd - ./gencondmd > ${.TARGET} + ${BTOOLSPATH:U.}/gencondmd > ${.TARGET} GENSRCS+= insn-conditions.md # @@ -318,35 +318,35 @@ GENSRCS+= insn-conditions.md .for F in constants insn-$F.h: gen$F ${MD_FILE} - ./gen$F ${MD_FILE} > ${.TARGET} + ${BTOOLSPATH:U.}/gen$F ${MD_FILE} > ${.TARGET} GENSRCS+= insn-$F.h .endfor .for F in attr codes config flags insn-$F.h: gen$F ${MD_FILE} insn-conditions.md - ./gen$F ${MD_FILE} insn-conditions.md > ${.TARGET} + ${BTOOLSPATH:U.}/gen$F ${MD_FILE} insn-conditions.md > ${.TARGET} GENSRCS+= insn-$F.h .endfor # Header files with irregular names. genrtl.h: gengenrtl - ./gengenrtl -h > ${.TARGET} + ${BTOOLSPATH:U.}/gengenrtl -h > ${.TARGET} GENSRCS+= genrtl.h tm-preds.h: genpreds - ./genpreds -h ${MD_FILE} > ${.TARGET} + ${BTOOLSPATH:U.}/genpreds -h ${MD_FILE} > ${.TARGET} GENSRCS+= tm-preds.h tm-constrs.h: genpreds - ./genpreds -c ${MD_FILE} > ${.TARGET} + ${BTOOLSPATH:U.}/genpreds -c ${MD_FILE} > ${.TARGET} GENSRCS+= tm-constrs.h tree-check.h: gencheck - ./gencheck > ${.TARGET} + ${BTOOLSPATH:U.}/gencheck > ${.TARGET} GENSRCS+= tree-check.h insn-modes.h: genmodes - ./genmodes -h > ${.TARGET} + ${BTOOLSPATH:U.}/genmodes -h > ${.TARGET} GENSRCS+= insn-modes.h # @@ -354,31 +354,31 @@ GENSRCS+= insn-modes.h # .for F in attrtab automata emit extract opinit output peep preds recog insn-$F.c: gen$F ${MD_FILE} insn-conditions.md - ./gen$F ${MD_FILE} insn-conditions.md > ${.TARGET} + ${BTOOLSPATH:U.}/gen$F ${MD_FILE} insn-conditions.md > ${.TARGET} GENONLY+= insn-$F.c .endfor .for F in conditions insn-$F.c: gen$F ${MD_FILE} - ./gen$F ${MD_FILE} > ${.TARGET} + ${BTOOLSPATH:U.}/gen$F ${MD_FILE} > ${.TARGET} GENSRCS+= insn-$F.c .endfor # Source files with irregular names. insn-modes.c: genmodes - ./genmodes > ${.TARGET} + ${BTOOLSPATH:U.}/genmodes > ${.TARGET} GENONLY+= insn-modes.c min-insn-modes.c: genmodes - ./genmodes -m > ${.TARGET} + ${BTOOLSPATH:U.}/genmodes -m > ${.TARGET} GENSRCS+= min-insn-modes.c genrtl.c: gengenrtl - ./gengenrtl > ${.TARGET} + ${BTOOLSPATH:U.}/gengenrtl > ${.TARGET} GENONLY+= genrtl.c gencondmd.c: genconditions ${MD_FILE} - ./genconditions ${MD_FILE} > ${.TARGET} + ${BTOOLSPATH:U.}/genconditions ${MD_FILE} > ${.TARGET} GENSRCS+= gencondmd.c #----------------------------------------------------------------------- @@ -389,6 +389,7 @@ GNTOOLS+= genattr genattrtab genautomata genextract genflags gengenrtl gengtype genmodes genopinit \ genoutput genpeep genpreds genrecog +${GNTOOLS:C,$,.o,} ${GNTOOLS}: ${BUILD_TOOLS_META} all: ${GNTOOLS} ${GENSRCS} ${GENONLY} beforedepend: ${GENONLY} @@ -404,11 +405,11 @@ LIBIBERTY_SRCS= choose-temp.c concat.c c LIBIBERTY_OBJS= ${LIBIBERTY_SRCS:R:S/$/.o/g} .for _src in ${LIBIBERTY_SRCS} -${_src:R:S/$/.o/}: ${_src} +${_src:R:S/$/.o/}: ${_src} ${BUILD_TOOLS_META} ${CC} -c -I ${.CURDIR}/../libiberty ${CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor -${LIBIBERTY}: ${LIBIBERTY_OBJS} +${LIBIBERTY}: ${LIBIBERTY_OBJS} ${BUILD_TOOLS_META} @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `lorder ${LIBIBERTY_OBJS} | tsort -q` ${RANLIB} ${.TARGET} @@ -432,6 +433,7 @@ SRCS= errors.c genattr.c genattrtab.c \ SRCS+= ${GENSRCS} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} GENOBJS+= ${GENSRCS:N*.h:R:S/$/.o/g} +${OBJS} ${GENOBJS}: ${BUILD_TOOLS_META} CLEANFILES+= ${GENSRCS} ${GENONLY} ${GENOBJS} ${GNTOOLS} #----------------------------------------------------------------------- From owner-svn-src-all@freebsd.org Sat May 21 01:31:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E684B4386F; Sat, 21 May 2016 01:31:56 +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 D35091BC6; Sat, 21 May 2016 01:31:55 +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 u4L1VsRW033006; Sat, 21 May 2016 01:31:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1Vscm033005; Sat, 21 May 2016 01:31:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210131.u4L1Vscm033005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300345 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:31:56 -0000 Author: bdrewery Date: Sat May 21 01:31:54 2016 New Revision: 300345 URL: https://svnweb.freebsd.org/changeset/base/300345 Log: WITH_META_MODE: Disable for 'make install' from top-level. See r298220 for more explanation. We don't want to prevent installing if a cookie exists for the install target. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.sys.env.mk Modified: head/share/mk/src.sys.env.mk ============================================================================== --- head/share/mk/src.sys.env.mk Sat May 21 01:31:51 2016 (r300344) +++ head/share/mk/src.sys.env.mk Sat May 21 01:31:54 2016 (r300345) @@ -18,6 +18,13 @@ SRC_ENV_CONF?= /etc/src-env.conf _src_env_conf_included_: .NOTMAIN .endif +# Top-level installs should not use meta mode as it may prevent installing +# based on cookies. +.if make(*install*) && ${.MAKE.LEVEL} == 0 +META_MODE= normal +MK_META_MODE= no +.endif + # If we were found via .../share/mk we need to replace that # with ${.PARSEDIR:tA} so that we can be found by # sub-makes launched from objdir. From owner-svn-src-all@freebsd.org Sat May 21 01:32:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E092B43924; Sat, 21 May 2016 01:32:09 +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 A0AFE1F1F; Sat, 21 May 2016 01:32:08 +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 u4L1W7ga033197; Sat, 21 May 2016 01:32:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1W75d033196; Sat, 21 May 2016 01:32:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1W75d033196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300349 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:09 -0000 Author: bdrewery Date: Sat May 21 01:32:07 2016 New Revision: 300349 URL: https://svnweb.freebsd.org/changeset/base/300349 Log: Enable and utilize WITHOUT_CROSS_COMPILER logic for external CC. This is a NOP. Reviewed by: brooks, bapt Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6354 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 21 01:32:04 2016 (r300348) +++ head/Makefile.inc1 Sat May 21 01:32:07 2016 (r300349) @@ -91,6 +91,12 @@ X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${ X${BINUTIL}?= ${${BINUTIL}} .endif .endfor +# If a full path to an external cross compiler is given, don't build +# a cross compiler. +.if ${XCC:N${CCACHE_BIN}:M/*} +MK_CROSS_COMPILER= no +.endif + .include # don't depend on src.opts.mk doing it .include "share/mk/src.opts.mk" @@ -454,7 +460,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif # External compiler needs sysroot and target flags. -.if ${XCC:N${CCACHE_BIN}:M/*} || ${MK_CROSS_COMPILER} == "no" +.if ${MK_CROSS_COMPILER} == "no" .if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif @@ -478,7 +484,7 @@ XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} .else -.endif # ${XCC:M/*} || ${MK_CROSS_COMPILER} == "no" +.endif # ${MK_CROSS_COMPILER} == "no" .if !empty(BFLAGS) XCFLAGS+= ${BFLAGS} @@ -1714,9 +1720,7 @@ _elftctools= lib/libelftc \ usr.bin/elfcopy .endif -# If an full path to an external cross compiler is given, don't build -# a cross compiler. -.if ${XCC:N${CCACHE_BIN}:M/*} == "" && ${MK_CROSS_COMPILER} != "no" +.if ${MK_CROSS_COMPILER} != "no" .if ${MK_CLANG_BOOTSTRAP} != "no" _clang= usr.bin/clang _clang_libs= lib/clang From owner-svn-src-all@freebsd.org Sat May 21 01:32:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC2AFB43982; Sat, 21 May 2016 01:32:18 +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 150F8210C; Sat, 21 May 2016 01:32:17 +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 u4L1WGkA033335; Sat, 21 May 2016 01:32:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1WGta033334; Sat, 21 May 2016 01:32:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1WGta033334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300352 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:18 -0000 Author: bdrewery Date: Sat May 21 01:32:16 2016 New Revision: 300352 URL: https://svnweb.freebsd.org/changeset/base/300352 Log: Enable external compiler logic if both bootstrap compilers are disabled. Reviewed by: brooks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6358 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 21 01:32:13 2016 (r300351) +++ head/Makefile.inc1 Sat May 21 01:32:16 2016 (r300352) @@ -460,7 +460,8 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif # External compiler needs sysroot and target flags. -.if ${MK_CROSS_COMPILER} == "no" +.if ${MK_CROSS_COMPILER} == "no" || \ + (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") .if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif From owner-svn-src-all@freebsd.org Sat May 21 01:32:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8AABB4399F; Sat, 21 May 2016 01:32:22 +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 ACB4821D6; Sat, 21 May 2016 01:32:21 +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 u4L1WKuH033383; Sat, 21 May 2016 01:32:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1WK9u033382; Sat, 21 May 2016 01:32:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1WK9u033382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300353 - head/lib/clang/include/clang/Basic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:22 -0000 Author: bdrewery Date: Sat May 21 01:32:20 2016 New Revision: 300353 URL: https://svnweb.freebsd.org/changeset/base/300353 Log: Add FREEBSD_CC_VERSION which will be used to define __FreeBSD_cc_version. The WITH_SYSTEM_COMPILER build option will rely on this value to determine what __FreeBSD_cc_version the source tree will produce. This value will be compared against the /usr/bin/cc value to determine if a new compiler is needed. Start with 1100002 which is 1 more than than the value we've had since 3.8.0 to ensure that all changes since then are present. Reviewed by: dim Sponsored by: EMC / Isilon Storage Division Modified: head/lib/clang/include/clang/Basic/Version.inc Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Sat May 21 01:32:16 2016 (r300352) +++ head/lib/clang/include/clang/Basic/Version.inc Sat May 21 01:32:20 2016 (r300353) @@ -8,3 +8,5 @@ #define CLANG_VENDOR "FreeBSD " #define SVN_REVISION "262564" + +#define FREEBSD_CC_VERSION 1100002U From owner-svn-src-all@freebsd.org Sat May 21 01:32:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7859B4394B; Sat, 21 May 2016 01:32:12 +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 B53281FD8; Sat, 21 May 2016 01:32:11 +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 u4L1WAeX033243; Sat, 21 May 2016 01:32:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1WAZb033242; Sat, 21 May 2016 01:32:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1WAZb033242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300350 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:12 -0000 Author: bdrewery Date: Sat May 21 01:32:10 2016 New Revision: 300350 URL: https://svnweb.freebsd.org/changeset/base/300350 Log: Auto determine X_COMPILER_TYPE/X_COMPILER_VERSION if XCC is set. Reviewed by: brooks, bapt Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6355 Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sat May 21 01:32:07 2016 (r300349) +++ head/share/mk/bsd.compiler.mk Sat May 21 01:32:10 2016 (r300350) @@ -19,6 +19,8 @@ # # - c++11 : supports full (or nearly full) C++11 programming environment. # +# These variables with an X_ prefix will also be provided if XCC is set. +# # This file may be included multiple times, but only has effect the first time. # @@ -97,12 +99,14 @@ ccache-print-options: .PHONY .endif # exists(${CCACHE_BIN}) .endif # ${MK_CCACHE_BUILD} == "yes" +.for cc X_ in CC $${_empty_var_} XCC X_ +.if ${cc} == "CC" || !empty(XCC) # Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. # The value is only used/exported for the same environment that impacts # CC and COMPILER_* settings here. -_exported_vars= COMPILER_TYPE COMPILER_VERSION -_cc_hash= ${CC}${MACHINE}${PATH} -_cc_hash:= ${_cc_hash:hash} +_exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION +${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} +${X_}_cc_hash:= ${${X_}_cc_hash:hash} # Only import if none of the vars are set somehow else. _can_export= yes .for var in ${_exported_vars} @@ -112,54 +116,65 @@ _can_export= no .endfor .if ${_can_export} == yes .for var in ${_exported_vars} -.if defined(${var}.${_cc_hash}) -${var}= ${${var}.${_cc_hash}} +.if defined(${var}.${${X_}_cc_hash}) +${var}= ${${var}.${${X_}_cc_hash}} .endif .endfor .endif +.if ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC}) .if ${MACHINE} == "common" # common is a pseudo machine for architecture independent # generated files - thus there is no compiler. -COMPILER_TYPE= none -COMPILER_VERSION= 0 -.elif !defined(COMPILER_TYPE) || !defined(COMPILER_VERSION) -_v!= ${CC} --version || echo 0.0.0 - -.if !defined(COMPILER_TYPE) -. if ${CC:T:M*gcc*} -COMPILER_TYPE:= gcc -. elif ${CC:T:M*clang*} -COMPILER_TYPE:= clang +${X_}COMPILER_TYPE= none +${X_}COMPILER_VERSION= 0 +.elif !defined(${X_}COMPILER_TYPE) || !defined(${X_}COMPILER_VERSION) +_v!= ${${cc}} --version || echo 0.0.0 + +.if !defined(${X_}COMPILER_TYPE) +. if ${${cc}:T:M*gcc*} +${X_}COMPILER_TYPE:= gcc +. elif ${${cc}:T:M*clang*} +${X_}COMPILER_TYPE:= clang . elif ${_v:Mgcc} -COMPILER_TYPE:= gcc +${X_}COMPILER_TYPE:= gcc . elif ${_v:M\(GCC\)} -COMPILER_TYPE:= gcc +${X_}COMPILER_TYPE:= gcc . elif ${_v:Mclang} -COMPILER_TYPE:= clang +${X_}COMPILER_TYPE:= clang . else -.error Unable to determine compiler type for ${CC}. Consider setting COMPILER_TYPE. +.error Unable to determine compiler type for ${cc}=${${cc}}. Consider setting ${X_}COMPILER_TYPE. . endif .endif -.if !defined(COMPILER_VERSION) -COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +.if !defined(${X_}COMPILER_VERSION) +${X_}COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif .undef _v .endif +.if ${${X_}COMPILER_TYPE} == "clang" || \ + (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) +${X_}COMPILER_FEATURES= c++11 +.else +${X_}COMPILER_FEATURES= +.endif + +.else +# Use CC's values +X_COMPILER_TYPE= ${COMPILER_TYPE} +X_COMPILER_VERSION= ${COMPILER_VERSION} +X_COMPILER_FEATURES= ${COMPILER_FEATURES} +.endif # ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC}) + # Export the values so sub-makes don't have to look them up again, using the # hash key computed above. .for var in ${_exported_vars} -${var}.${_cc_hash}:= ${${var}} -.export-env ${var}.${_cc_hash} -.undef ${var}.${_cc_hash} +${var}.${${X_}_cc_hash}:= ${${var}} +.export-env ${var}.${${X_}_cc_hash} +.undef ${var}.${${X_}_cc_hash} .endfor -.if ${COMPILER_TYPE} == "clang" || \ - (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800) -COMPILER_FEATURES= c++11 -.else -COMPILER_FEATURES= -.endif +.endif # ${cc} == "CC" || !empty(XCC) +.endfor # .for cc in CC XCC .endif # !target(____) From owner-svn-src-all@freebsd.org Sat May 21 01:32:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FFFCB43969; Sat, 21 May 2016 01:32:15 +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 3E65F2082; Sat, 21 May 2016 01:32:14 +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 u4L1WDHL033290; Sat, 21 May 2016 01:32:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1WDII033289; Sat, 21 May 2016 01:32:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1WDII033289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300351 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:16 -0000 Author: bdrewery Date: Sat May 21 01:32:13 2016 New Revision: 300351 URL: https://svnweb.freebsd.org/changeset/base/300351 Log: Fetch the __FreeBSD_cc_version as COMPILER_FREEBSD_VERSION. Reviewed by: brooks, bapt, dim Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6356 Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sat May 21 01:32:10 2016 (r300350) +++ head/share/mk/bsd.compiler.mk Sat May 21 01:32:13 2016 (r300351) @@ -14,6 +14,8 @@ # against 30300 for gcc likely isn't what you wanted (since versions of gcc # prior to 4.2 likely have no prayer of working). # +# COMPILER_FREEBSD_VERSION is the compiler's __FreeBSD_cc_version value. +# # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # @@ -104,7 +106,8 @@ ccache-print-options: .PHONY # Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. # The value is only used/exported for the same environment that impacts # CC and COMPILER_* settings here. -_exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION +_exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \ + ${X_}COMPILER_FREEBSD_VERSION ${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} ${X_}_cc_hash:= ${${X_}_cc_hash:hash} # Only import if none of the vars are set somehow else. @@ -128,6 +131,7 @@ ${var}= ${${var}.${${X_}_cc_hash}} # generated files - thus there is no compiler. ${X_}COMPILER_TYPE= none ${X_}COMPILER_VERSION= 0 +${X_}COMPILER_FREEBSD_VERSION= 0 .elif !defined(${X_}COMPILER_TYPE) || !defined(${X_}COMPILER_VERSION) _v!= ${${cc}} --version || echo 0.0.0 @@ -151,6 +155,15 @@ ${X_}COMPILER_VERSION!=echo "${_v:M[1-9] .endif .undef _v .endif +.if !defined(${X_}COMPILER_FREEBSD_VERSION) +${X_}COMPILER_FREEBSD_VERSION!= { echo "__FreeBSD_cc_version" | ${${cc}} -E - 2>/dev/null || echo __FreeBSD_cc_version; } | tail -n 1 +# If we get a literal "__FreeBSD_cc_version" back then the compiler +# is a non-FreeBSD build that doesn't support it or some other error +# occurred. +.if ${${X_}COMPILER_FREEBSD_VERSION} == "__FreeBSD_cc_version" +${X_}COMPILER_FREEBSD_VERSION= unknown +.endif +.endif .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) @@ -163,6 +176,7 @@ ${X_}COMPILER_FEATURES= # Use CC's values X_COMPILER_TYPE= ${COMPILER_TYPE} X_COMPILER_VERSION= ${COMPILER_VERSION} +X_COMPILER_FREEBSD_VERSION= ${COMPILER_FREEBSD_VERSION} X_COMPILER_FEATURES= ${COMPILER_FEATURES} .endif # ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC}) From owner-svn-src-all@freebsd.org Sat May 21 01:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC353B439CF; Sat, 21 May 2016 01:32:25 +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 72EB822C4; Sat, 21 May 2016 01:32:25 +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 u4L1WORv033431; Sat, 21 May 2016 01:32:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1WOXM033427; Sat, 21 May 2016 01:32:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1WOXM033427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300354 - in head: . share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:26 -0000 Author: bdrewery Date: Sat May 21 01:32:23 2016 New Revision: 300354 URL: https://svnweb.freebsd.org/changeset/base/300354 Log: Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set. This will still build the compiler for the target but will not build the bootstrap cross-compiler in the cross-tools phase. Other toolchain bootstrapping, such as elftoolchan and binutils, currently still occurs. This will utilize the default CC (cc, /usr/bin/cc) as an external compiler. This is planned to be on-by-default eventually. This will utilize the __FreeBSD_cc_version compiler macro defined in the source tree and compare it to CC's version. If they match then the cross-compiler is skipped. If [X]CC is an external compiler (absolute path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped. If the expected bootstrap compiler type no longer matches the found CC compiler type (clang vs gcc), then the logic is skipped. As an extra safety check the version number is also compared from the compiler to the tree version. Clang: The macro FREEBSD_CC_VERSION is defined in: lib/clang/include/clang/Basic/Version.inc For clang -target will be used if TARGET_ARCH != MACHINE_ARCH. This is from the current external toolchain logic. There is currently an assumption that the host compiler can build the TARGET_ARCH. This will usually be the case since we don't conditionalize target arch support in clang, but it will break when introducing new architectures. This problem is mitigated by incrementing the version when adding new architectures. GCC: The macro FBSD_CC_VER is defined in: gnu/usr.bin/cc/cc_tools/freebsd-native.h For GCC there is no simple -target support when TARGET_ARCH != MACHINE_ARCH. In this case the opportunistic skip is not done. If we add proper support for this case in external toolchain logic then it will be fine to enable. This relies on the macros being incremented whenever any change occurs to these compilers that warrant rebuilding files. It also should never repeat earlier values. Reviewed by: brooks, bapt, imp Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6357 Added: head/tools/build/options/WITHOUT_SYSTEM_COMPILER (contents, props changed) head/tools/build/options/WITH_SYSTEM_COMPILER (contents, props changed) Modified: head/Makefile.inc1 head/share/mk/src.opts.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 21 01:32:20 2016 (r300353) +++ head/Makefile.inc1 Sat May 21 01:32:23 2016 (r300354) @@ -48,6 +48,7 @@ .error "Both TARGET and TARGET_ARCH must be defined." .endif +SRCDIR?= ${.CURDIR} LOCALBASE?= /usr/local # Cross toolchain changes must be in effect before bsd.compiler.mk @@ -97,8 +98,59 @@ X${BINUTIL}?= ${${BINUTIL}} MK_CROSS_COMPILER= no .endif -.include # don't depend on src.opts.mk doing it -.include "share/mk/src.opts.mk" +# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. +.include +.include "share/mk/src.opts.mk" + +# Check if there is a local compiler that can satisfy as an external compiler. +.if ${MK_SYSTEM_COMPILER} == "yes" && ${MK_CROSS_COMPILER} == "yes" && \ + (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ + !make(showconfig) +# Which compiler is expected to be used? +.if ${MK_CLANG_BOOTSTRAP} == "yes" +_expected_compiler_type= clang +.elif ${MK_GCC_BOOTSTRAP} == "yes" +_expected_compiler_type= gcc +.endif +# If the expected vs CC is different then we can't skip. +# GCC cannot be used for cross-arch yet. For clang we pass -target later if +# TARGET_ARCH!=MACHINE_ARCH. +.if ${_expected_compiler_type} == ${COMPILER_TYPE} && \ + (${COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) +# It needs to be the same revision as we would build for the bootstrap. +.if !defined(CROSS_COMPILER_FREEBSD_VERSION) +.if ${_expected_compiler_type} == "clang" +CROSS_COMPILER_FREEBSD_VERSION!= \ + awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ + ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown +CROSS_COMPILER_VERSION!= \ + awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ + ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown +.elif ${_expected_compiler_type} == "gcc" +CROSS_COMPILER_FREEBSD_VERSION!= \ + awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \ + ${SRCDIR}/gnu/usr.bin/cc/cc_tools/freebsd-native.h || echo unknown +CROSS_COMPILER_VERSION!= \ + awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3}' \ + ${SRCDIR}/contrib/gcc/BASE-VER || echo unknown +.endif +.export CROSS_COMPILER_FREEBSD_VERSION CROSS_COMPILER_VERSION +.endif # !defined(CROSS_COMPILER_FREEBSD_VERSION) +.if ${COMPILER_VERSION} == ${CROSS_COMPILER_VERSION} && \ + ${COMPILER_FREEBSD_VERSION} == ${CROSS_COMPILER_FREEBSD_VERSION} +# Everything matches, disable the bootstrap compiler. +MK_CLANG_BOOTSTRAP= no +MK_GCC_BOOTSTRAP= no +CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ + COMPILER_TYPE=${COMPILER_TYPE} \ + COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} +.if make(buildworld) +.info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler. +.endif +.endif # ${COMPILER_VERSION} == ${CROSS_COMPILER_VERSION} +.endif # ${_expected_compiler_type} == ${COMPILER_TYPE} +.endif # ${XCC:N${CCACHE_BIN}:M/*} + # We must do lib/ and libexec/ before bin/ in case of a mid-install error to # keep the users system reasonably usable. For static->dynamic root upgrades, @@ -108,7 +160,6 @@ MK_CROSS_COMPILER= no # This ordering is not a guarantee though. The only guarantee of a working # system here would require fine-grained ordering of all components based # on their dependencies. -SRCDIR?= ${.CURDIR} .if !empty(SUBDIR_OVERRIDE) SUBDIR= ${SUBDIR_OVERRIDE} .else Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat May 21 01:32:20 2016 (r300353) +++ head/share/mk/src.opts.mk Sat May 21 01:32:23 2016 (r300354) @@ -187,7 +187,9 @@ __DEFAULT_NO_OPTIONS = \ OPENLDAP \ SHARED_TOOLCHAIN \ SORT_THREADS \ - SVN + SVN \ + SYSTEM_COMPILER \ + # # Default behaviour of some options depends on the architecture. Unfortunately Added: head/tools/build/options/WITHOUT_SYSTEM_COMPILER ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SYSTEM_COMPILER Sat May 21 01:32:23 2016 (r300354) @@ -0,0 +1,12 @@ +.\" $FreeBSD$ +Set to not opportunistically skip building a cross-compiler during the +bootstrap phase of the build. +Normally, if the currently installed compiler matches the planned bootstrap +compiler type and revision, then it will not be built. +This does not prevent a compiler from being built for installation though, +only for building one for the build itself. +The +.Va WITHOUT_CLANG +and +.Va WITHOUT_GCC +options control those. Added: head/tools/build/options/WITH_SYSTEM_COMPILER ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SYSTEM_COMPILER Sat May 21 01:32:23 2016 (r300354) @@ -0,0 +1,12 @@ +.\" $FreeBSD$ +Set to opportunistically skip building a cross-compiler during the +bootstrap phase of the build. +If the currently installed compiler matches the planned bootstrap compiler +type and revision, then it will not be built. +This does not prevent a compiler from being built for installation though, +only for building one for the build itself. +The +.Va WITHOUT_CLANG +and +.Va WITHOUT_GCC +options control those. From owner-svn-src-all@freebsd.org Sat May 21 01:32:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8348CB43902; Sat, 21 May 2016 01:32:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 522191E5C; Sat, 21 May 2016 01:32:05 +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 u4L1W4HB033152; Sat, 21 May 2016 01:32:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1W43X033151; Sat, 21 May 2016 01:32:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210132.u4L1W43X033151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300348 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:32:05 -0000 Author: bdrewery Date: Sat May 21 01:32:04 2016 New Revision: 300348 URL: https://svnweb.freebsd.org/changeset/base/300348 Log: Move external toolchain support earlier. This is to consolidate external toolchain and WITHOUT_CROSS_COMPILER support. Reviewed by: brooks, bapt Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6353 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 21 01:32:01 2016 (r300347) +++ head/Makefile.inc1 Sat May 21 01:32:04 2016 (r300348) @@ -56,6 +56,41 @@ LOCALBASE?= /usr/local .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}" .endif +.if defined(CROSS_TOOLCHAIN_PREFIX) +CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} +CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} +.endif +# If we do not have a bootstrap binutils (because the in-tree one does not +# support the target architecture), provide a default cross-binutils prefix. +# This allows aarch64 builds, for example, to automatically use the +# aarch64-binutils port or package. +.if !make(showconfig) +.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ + !defined(CROSS_BINUTILS_PREFIX) +CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ +.if !exists(${CROSS_BINUTILS_PREFIX}) +.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. +.endif +.endif +.endif + +XCOMPILERS= CC CXX CPP +.for COMPILER in ${XCOMPILERS} +.if defined(CROSS_COMPILER_PREFIX) +X${COMPILER}?= ${CROSS_COMPILER_PREFIX}${${COMPILER}} +.else +X${COMPILER}?= ${${COMPILER}} +.endif +.endfor +XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS +.for BINUTIL in ${XBINUTILS} +.if defined(CROSS_BINUTILS_PREFIX) && \ + exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) +X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} +.else +X${BINUTIL}?= ${${BINUTIL}} +.endif +.endfor .include # don't depend on src.opts.mk doing it .include "share/mk/src.opts.mk" @@ -404,42 +439,6 @@ HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MT HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT .endif -.if defined(CROSS_TOOLCHAIN_PREFIX) -CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} -CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} -.endif - -# If we do not have a bootstrap binutils (because the in-tree one does not -# support the target architecture), provide a default cross-binutils prefix. -# This allows aarch64 builds, for example, to automatically use the -# aarch64-binutils port or package. -.if !make(showconfig) -.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ - !defined(CROSS_BINUTILS_PREFIX) -CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ -.if !exists(${CROSS_BINUTILS_PREFIX}) -.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. -.endif -.endif -.endif - -XCOMPILERS= CC CXX CPP -.for COMPILER in ${XCOMPILERS} -.if defined(CROSS_COMPILER_PREFIX) -X${COMPILER}?= ${CROSS_COMPILER_PREFIX}${${COMPILER}} -.else -X${COMPILER}?= ${${COMPILER}} -.endif -.endfor -XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS -.for BINUTIL in ${XBINUTILS} -.if defined(CROSS_BINUTILS_PREFIX) && \ - exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) -X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} -.else -X${BINUTIL}?= ${${BINUTIL}} -.endif -.endfor CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ CPP="${XCPP} ${XCFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ From owner-svn-src-all@freebsd.org Sat May 21 01:35:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D85AB43CD7; Sat, 21 May 2016 01:35:49 +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 0FDC72EAE; Sat, 21 May 2016 01:35:48 +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 u4L1Zmws033598; Sat, 21 May 2016 01:35:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L1ZmnL033597; Sat, 21 May 2016 01:35:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605210135.u4L1ZmnL033597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 21 May 2016 01:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300355 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 01:35:49 -0000 Author: bdrewery Date: Sat May 21 01:35:48 2016 New Revision: 300355 URL: https://svnweb.freebsd.org/changeset/base/300355 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat May 21 01:32:23 2016 (r300354) +++ head/share/man/man5/src.conf.5 Sat May 21 01:35:48 2016 (r300355) @@ -1403,6 +1403,19 @@ This must be set in the environment, mak .Pa /etc/src-env.conf , not .Pa /etc/src.conf . +.It Va WITH_SYSTEM_COMPILER +.\" from FreeBSD: head/tools/build/options/WITH_SYSTEM_COMPILER 300354 2016-05-21 01:32:23Z bdrewery +Set to opportunistically skip building a cross-compiler during the +bootstrap phase of the build. +If the currently installed compiler matches the planned bootstrap compiler +type and revision, then it will not be built. +This does not prevent a compiler from being built for installation though, +only for building one for the build itself. +The +.Va WITHOUT_CLANG +and +.Va WITHOUT_GCC +options control those. .It Va WITHOUT_TALK .\" from FreeBSD: head/tools/build/options/WITHOUT_TALK 277676 2015-01-25 04:37:44Z ngie Set to not build or install From owner-svn-src-all@freebsd.org Sat May 21 02:14:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A54FB437B8; Sat, 21 May 2016 02:14:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5206811B2; Sat, 21 May 2016 02:14:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4L2EBiQ046036; Sat, 21 May 2016 02:14:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L2EBml046033; Sat, 21 May 2016 02:14:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605210214.u4L2EBml046033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 21 May 2016 02:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300356 - in head: etc/defaults usr.sbin/periodic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 02:14:12 -0000 Author: asomers Date: Sat May 21 02:14:11 2016 New Revision: 300356 URL: https://svnweb.freebsd.org/changeset/base/300356 Log: Better document security_show_{success,info,badconfig} in /etc/periodic.conf periodic(8) already handles the security_show_{success,info,badconfig} variables correctly. However, those variables aren't explicitly set in /etc/defaults/periodic.conf or anywhere else, which suggests to the user that they shouldn't be used. etc/defaults/periodic.conf Explicitly set defaults for security_show_{success,info,badconfig} usr.sbin/periodic/periodic.sh Update usage string usr.sbin/periodic/periodic.8 Minor man page updates One thing I'm _not_ doing is recommending setting security_output to /var/log/security.log or adding that file to /etc/newsyslog.conf, because periodic(8) would create it with default permissions, usually 644, and that's probably a bad idea. Reviewed by: brd MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6477 Modified: head/etc/defaults/periodic.conf head/usr.sbin/periodic/periodic.8 head/usr.sbin/periodic/periodic.sh Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Sat May 21 01:35:48 2016 (r300355) +++ head/etc/defaults/periodic.conf Sat May 21 02:14:11 2016 (r300356) @@ -222,6 +222,10 @@ monthly_local="/etc/monthly.local" # L # Security options +security_show_success="YES" # scripts returning 0 +security_show_info="YES" # scripts returning 1 +security_show_badconfig="NO" # scripts returning 2 + # These options are used by the security periodic(8) scripts spawned in # daily and weekly 450.status-security. security_status_logdir="/var/log" # Directory for logs Modified: head/usr.sbin/periodic/periodic.8 ============================================================================== --- head/usr.sbin/periodic/periodic.8 Sat May 21 01:35:48 2016 (r300355) +++ head/usr.sbin/periodic/periodic.8 Sat May 21 02:14:11 2016 (r300356) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2007 +.Dd May 20, 2016 .Dt PERIODIC 8 .Os .Sh NAME @@ -166,8 +166,9 @@ table the top level directory containing .Pa daily , .Pa weekly , +.Pa monthly , and -.Pa monthly +.Pa security subdirectories which contain standard system periodic executables .It Pa /etc/defaults/periodic.conf the @@ -175,9 +176,9 @@ the system registry contains variables that control the behaviour of .Nm and the standard -.Pa daily , weekly , +.Pa daily , weekly , monthly , and -.Pa monthly +.Pa security scripts .It Pa /etc/periodic.conf this file contains local overrides for the default Modified: head/usr.sbin/periodic/periodic.sh ============================================================================== --- head/usr.sbin/periodic/periodic.sh Sat May 21 01:35:48 2016 (r300355) +++ head/usr.sbin/periodic/periodic.sh Sat May 21 02:14:11 2016 (r300356) @@ -4,13 +4,13 @@ # # Run nightly periodic scripts # -# usage: periodic { daily | weekly | monthly } - run standard periodic scripts +# usage: periodic { daily | weekly | monthly | security } - run standard scripts # periodic /absolute/path/to/directory - run periodic scripts in dir # usage () { echo "usage: $0 " 1>&2 - echo "or $0 { daily | weekly | monthly }" 1>&2 + echo "or $0 { daily | weekly | monthly | security }" 1>&2 exit 1 } From owner-svn-src-all@freebsd.org Sat May 21 03:05:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95B26B442C9; Sat, 21 May 2016 03:05:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) (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 624E91E1C; Sat, 21 May 2016 03:05:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f50.google.com with SMTP id b65so62349044oia.1; Fri, 20 May 2016 20:05:47 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=WaJLafaHwQwRASJEPOF5hiwJNesEUrwXem6OJVL5kGA=; b=BmOllatO4bSjj2blTywqvYapYVwOCFtAYevh8PM1J73KCkg3zqkYZjlRG6g1s1dwOr +Ql9fq67HUOybA0MtF0YBzmnNZNHjE/A6Rq9StKzjB4Cld/9kEiLU7VR12EHeYCKf0Pj Wi/znIOe42x0nefpnJZVCec5QgrWFrKZxea/G/FyI50qp//Wg7bNmHqvGjjvmIHUT2Hn UEffLV7+trg4sRYE8QOHZWGlFSUiihoNXnQ9kd0434SNuLWuvsfAyHFpZVFEce9i01v9 YfdX4lj6VFwuU+lX6LaHS2Z7EVaFMke6GapoPHnmPLcdlq1lri/KcfDmTS+IZv/2rFol TQ1w== X-Gm-Message-State: AOPr4FX/m++xW2PZ5wcd8qdh7UdsKRKr/pzCOVyrc7lKcsKXA5udg7iFusb4bcQPbvkezw== X-Received: by 10.202.221.214 with SMTP id u205mr3729167oig.94.1463795682225; Fri, 20 May 2016 18:54:42 -0700 (PDT) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com. [209.85.214.52]) by smtp.gmail.com with ESMTPSA id t21sm6327962otd.20.2016.05.20.18.54.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 18:54:42 -0700 (PDT) Received: by mail-it0-f52.google.com with SMTP id z123so2068313itg.0; Fri, 20 May 2016 18:54:41 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.36.131.67 with SMTP id d64mr4148923ite.34.1463795681407; Fri, 20 May 2016 18:54:41 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Fri, 20 May 2016 18:54:41 -0700 (PDT) In-Reply-To: <20160521103528.I1539@besplex.bde.org> References: <201605201950.u4KJoWA5028092@repo.freebsd.org> <20160521081930.I1098@besplex.bde.org> <20160521103528.I1539@besplex.bde.org> Date: Fri, 20 May 2016 18:54:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 From: Conrad Meyer To: Bruce Evans Cc: Konstantin Belousov , 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 03:05:47 -0000 On Fri, May 20, 2016 at 6:10 PM, Bruce Evans wrote: > On Fri, 20 May 2016, Conrad Meyer wrote: > >> On Fri, May 20, 2016 at 4:02 PM, Bruce Evans wrote: >>> >>> On Fri, 20 May 2016, Konstantin Belousov wrote: >>> >>>> --- head/sys/i386/i386/sys_machdep.c Fri May 20 19:46:25 2016 >>>> (r300331) >>>> +++ head/sys/i386/i386/sys_machdep.c Fri May 20 19:50:32 2016 >>>> (r300332) >>>> @@ -315,8 +315,9 @@ i386_set_ioperm(td, uap) >>>> struct thread *td; >>>> struct i386_ioperm_args *uap; >>>> { >>>> - int i, error; >>>> char *iomap; >>>> + u_int i; >>>> + int error; >>>> >>>> if ((error = priv_check(td, PRIV_IO)) != 0) >>>> return (error); >>>> @@ -334,7 +335,8 @@ i386_set_ioperm(td, uap) >>>> return (error); >>>> iomap = (char *)td->td_pcb->pcb_ext->ext_iomap; >>>> >>>> - if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >>>> + if (uap->start > uap->start + uap->length || >>>> + uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >>>> return (EINVAL); >>>> >>>> for (i = uap->start; i < uap->start + uap->length; i++) { >>> >>> >>> I don't like using u_int for a small index. >> >> >> Why not? Indices are by definition non-negative so the fit seems natural. > > > Signed integers are easier to understand provided calculations with them > don't overflow. How? The rest of the argument seems to be, using u_int is bad because more unsigned is always bad. But I haven't seen a good reason to believe that is so. > Unsigned integers are not easier to understand if > calculations with them do overflow. That was the case here. > > Only indices relative to the base of an array are by definition > non-negative. For an array a[], it is valid to do p = &a[i] and then > use p[j] with negative j to get back before the i'th index. This is > sometimes useful. i + j must be >= 0, but is hard write correctly and > understand if either i or j is unsigned. (It can be arranged that the > addition wraps correctly, but this is basically re-implementing signed > arithmetic.) This has devolved from an array and index, to pointer arithmetic. The fact that C lets you do pointer arithmetic with array syntax doesn't help. The "real" indices are always non-negative. Best, Conrad From owner-svn-src-all@freebsd.org Sat May 21 04:13:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46FDAB4432C; Sat, 21 May 2016 04:13:50 +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 C48C31E87; Sat, 21 May 2016 04:13:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id F252E78175F; Sat, 21 May 2016 14:13:46 +1000 (AEST) Date: Sat, 21 May 2016 14:13:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 In-Reply-To: Message-ID: <20160521123908.V1914@besplex.bde.org> References: <201605201950.u4KJoWA5028092@repo.freebsd.org> <20160521081930.I1098@besplex.bde.org> <20160521103528.I1539@besplex.bde.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.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=FTh5clMInHnvHWAiyd4A:9 a=gQ_H6biWQVUu4wsx:21 a=wLGhfzaGJq1eDdCj:21 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 04:13:50 -0000 On Fri, 20 May 2016, Conrad Meyer wrote: > On Fri, May 20, 2016 at 6:10 PM, Bruce Evans wrote: >> On Fri, 20 May 2016, Conrad Meyer wrote: >> >>> On Fri, May 20, 2016 at 4:02 PM, Bruce Evans wrote: >>>> >>>> On Fri, 20 May 2016, Konstantin Belousov wrote: >>>> >>>>> --- head/sys/i386/i386/sys_machdep.c Fri May 20 19:46:25 2016 >>>>> (r300331) >>>>> +++ head/sys/i386/i386/sys_machdep.c Fri May 20 19:50:32 2016 >>>>> (r300332) >>>>> @@ -315,8 +315,9 @@ i386_set_ioperm(td, uap) >>>>> struct thread *td; >>>>> struct i386_ioperm_args *uap; >>>>> { >>>>> - int i, error; >>>>> char *iomap; >>>>> + u_int i; >>>>> + int error; >>>>> >>>>> if ((error = priv_check(td, PRIV_IO)) != 0) >>>>> return (error); >>>>> @@ -334,7 +335,8 @@ i386_set_ioperm(td, uap) >>>>> return (error); >>>>> iomap = (char *)td->td_pcb->pcb_ext->ext_iomap; >>>>> >>>>> - if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >>>>> + if (uap->start > uap->start + uap->length || >>>>> + uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY) >>>>> return (EINVAL); >>>>> >>>>> for (i = uap->start; i < uap->start + uap->length; i++) { >>>> >>>> >>>> I don't like using u_int for a small index. >>> >>> >>> Why not? Indices are by definition non-negative so the fit seems natural. >> >> Signed integers are easier to understand provided calculations with them >> don't overflow. > > How? For the same reasons as in applying mathematics. Applying mathematics was harder before negative numbers were invented. Negative numbers are actually not easy to understand at the technical level (the usual representation of them is equivalence classes of pairs of non-negative numbers), but their properties are easy to understand and work with once you are familiar with them and don't think about their implementation details too much. Ordinary (real) numbers (including negative ones) also have good ordering properties for all operations. Computer arithmetic can't represent all ordinary numbers, but gets closest by representing ordinary integers as C signed integers perfectly when no overflow occurs. By using C unsigned integers unnecessarily, you throw out invention of negative numbers and might have to work with the unfamiliar and badly behaved ordering on them. C programmers have some experience with this ordering, but apparently not enough to usually avoid bugs. > The rest of the argument seems to be, using u_int is bad because more > unsigned is always bad. But I haven't seen a good reason to believe > that is so. Not always bad. Sometimes you must use C unsigned integers to get a full representation without wasting many bits, or actually want the ordering of unsigned integers. The main case is representing other C things like pointers. Differences of pointers are still hard to handle. Bruce From owner-svn-src-all@freebsd.org Sat May 21 08:01:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C543B40C8B; Sat, 21 May 2016 08:01:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27A531F39; Sat, 21 May 2016 08:01:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4L81Ftc048511; Sat, 21 May 2016 08:01:15 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L81FW7048508; Sat, 21 May 2016 08:01:15 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605210801.u4L81FW7048508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 21 May 2016 08:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300359 - in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 08:01:16 -0000 Author: dchagin Date: Sat May 21 08:01:14 2016 New Revision: 300359 URL: https://svnweb.freebsd.org/changeset/base/300359 Log: Correct an argument param of linux_sched_* system calls as a struct l_sched_param does not defined due to it's nature. MFC after: 1 week Modified: head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/syscalls.master head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Sat May 21 02:31:38 2016 (r300358) +++ head/sys/amd64/linux/syscalls.master Sat May 21 08:01:14 2016 (r300359) @@ -283,12 +283,12 @@ 141 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ int prio); } 142 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 143 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 144 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 145 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 146 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max( \ Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sat May 21 02:31:38 2016 (r300358) +++ head/sys/amd64/linux32/syscalls.master Sat May 21 08:01:14 2016 (r300359) @@ -268,12 +268,12 @@ 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } 154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 158 AUE_NULL NOPROTO { int sched_yield(void); } Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sat May 21 02:31:38 2016 (r300358) +++ head/sys/i386/linux/syscalls.master Sat May 21 08:01:14 2016 (r300359) @@ -270,12 +270,12 @@ 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } 154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 158 AUE_NULL NOPROTO { int sched_yield(void); } From owner-svn-src-all@freebsd.org Sat May 21 08:03:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52E3CB40DEE; Sat, 21 May 2016 08:03:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F4A51289; Sat, 21 May 2016 08:03:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4L83F3w051409; Sat, 21 May 2016 08:03:15 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L83DQk051394; Sat, 21 May 2016 08:03:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605210803.u4L83DQk051394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 21 May 2016 08:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300360 - in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 08:03:16 -0000 Author: dchagin Date: Sat May 21 08:03:13 2016 New Revision: 300360 URL: https://svnweb.freebsd.org/changeset/base/300360 Log: Regen after r300359 (struct l_sched_param removal). MFC after: 1 week Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_syscall.h head/sys/amd64/linux/linux_syscalls.c head/sys/amd64/linux/linux_sysent.c head/sys/amd64/linux/linux_systrace_args.c head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux/linux_proto.h Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -524,16 +524,16 @@ struct linux_getpriority_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: head/sys/amd64/linux/linux_syscall.h ============================================================================== --- head/sys/amd64/linux/linux_syscall.h Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux/linux_syscall.h Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #define LINUX_SYS_read 0 Modified: head/sys/amd64/linux/linux_syscalls.c ============================================================================== --- head/sys/amd64/linux/linux_syscalls.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux/linux_syscalls.c Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ const char *linux_syscallnames[] = { Modified: head/sys/amd64/linux/linux_sysent.c ============================================================================== --- head/sys/amd64/linux/linux_sysent.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux/linux_sysent.c Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #include Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux/linux_systrace_args.c Sat May 21 08:03:13 2016 (r300360) @@ -1178,7 +1178,7 @@ systrace_args(int sysnum, void *params, case 142: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1186,7 +1186,7 @@ systrace_args(int sysnum, void *params, case 143: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1195,7 +1195,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -4209,7 +4209,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4222,7 +4222,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4238,7 +4238,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux32/linux32_proto.h Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #ifndef _LINUX32_SYSPROTO_H_ @@ -480,16 +480,16 @@ struct linux_sysctl_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux32/linux32_syscall.h Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #define LINUX32_SYS_linux_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux32/linux32_syscalls.c Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ const char *linux32_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux32/linux32_sysent.c Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #include "opt_compat.h" Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sat May 21 08:03:13 2016 (r300360) @@ -1047,7 +1047,7 @@ systrace_args(int sysnum, void *params, case 154: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1055,7 +1055,7 @@ systrace_args(int sysnum, void *params, case 155: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1064,7 +1064,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -3938,7 +3938,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -3951,7 +3951,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -3967,7 +3967,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sat May 21 08:01:14 2016 (r300359) +++ head/sys/i386/linux/linux_proto.h Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -478,16 +478,16 @@ struct linux_sysctl_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sat May 21 08:01:14 2016 (r300359) +++ head/sys/i386/linux/linux_syscall.h Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/i386/linux/linux_syscalls.c Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ const char *linux_syscallnames[] = { Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/i386/linux/linux_sysent.c Sat May 21 08:03:13 2016 (r300360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin */ #include Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Sat May 21 08:01:14 2016 (r300359) +++ head/sys/i386/linux/linux_systrace_args.c Sat May 21 08:03:13 2016 (r300360) @@ -1085,7 +1085,7 @@ systrace_args(int sysnum, void *params, case 154: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1093,7 +1093,7 @@ systrace_args(int sysnum, void *params, case 155: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1102,7 +1102,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -4072,7 +4072,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4085,7 +4085,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4101,7 +4101,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; From owner-svn-src-all@freebsd.org Sat May 21 09:03:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B37B441C5; Sat, 21 May 2016 09:03:47 +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 414C51CF9; Sat, 21 May 2016 09:03:47 +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 u4L93ki5070144; Sat, 21 May 2016 09:03:46 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L93jgN070137; Sat, 21 May 2016 09:03:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605210903.u4L93jgN070137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 21 May 2016 09:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300361 - in stable/10/contrib/libarchive: cpio libarchive libarchive/test X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 09:03:47 -0000 Author: mm Date: Sat May 21 09:03:45 2016 New Revision: 300361 URL: https://svnweb.freebsd.org/changeset/base/300361 Log: Backport security fix for absolute path traversal vulnerability in bsdcpio. This is a direct commit to stable/10. Security: CVE-2015-2304 Modified: stable/10/contrib/libarchive/cpio/bsdcpio.1 stable/10/contrib/libarchive/cpio/cpio.c stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_write_disk.3 stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c Modified: stable/10/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- stable/10/contrib/libarchive/cpio/bsdcpio.1 Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/cpio/bsdcpio.1 Sat May 21 09:03:45 2016 (r300361) @@ -156,7 +156,8 @@ See above for description. .It Fl Fl insecure (i and p mode only) Disable security checks during extraction or copying. -This allows extraction via symbolic links and path names containing +This allows extraction via symbolic links, absolute paths, +and path names containing .Sq .. in the name. .It Fl J , Fl Fl xz Modified: stable/10/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.c Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/cpio/cpio.c Sat May 21 09:03:45 2016 (r300361) @@ -179,6 +179,7 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; @@ -264,6 +265,7 @@ main(int argc, char *argv[]) case OPTION_INSECURE: cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case 'L': /* GNU cpio */ cpio->option_follow_links = 1; @@ -300,6 +302,7 @@ main(int argc, char *argv[]) "Cannot use both -p and -%c", cpio->mode); cpio->mode = opt; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case OPTION_PRESERVE_OWNER: cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER; Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/archive.h Sat May 21 09:03:45 2016 (r300361) @@ -562,6 +562,8 @@ __LA_DECL int archive_read_set_options(s /* Default: Do not use HFS+ compression if it was not compressed. */ /* This has no effect except on Mac OS v10.6 or later. */ #define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000) +/* Default: Do not reject entries with absolute paths */ +#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000) __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *, int flags); Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk.3 ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk.3 Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk.3 Sat May 21 09:03:45 2016 (r300361) @@ -177,6 +177,9 @@ The default is to not refuse such paths. Note that paths ending in .Pa .. always cause an error, regardless of this flag. +.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS +Refuse to extract an absolute path. +The default is to not refuse such paths. .It Cm ARCHIVE_EXTRACT_SPARSE Scan data for blocks of NUL bytes and try to recreate them with holes. This results in sparse files, independent of whether the archive format Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Sat May 21 09:03:45 2016 (r300361) @@ -2504,8 +2504,9 @@ cleanup_pathname_win(struct archive_writ /* * Canonicalize the pathname. In particular, this strips duplicate * '/' characters, '.' elements, and trailing '/'. It also raises an - * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is - * set) any '..' in the path. + * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is + * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS + * is set) if the path is absolute. */ static int cleanup_pathname(struct archive_write_disk *a) @@ -2524,8 +2525,15 @@ cleanup_pathname(struct archive_write_di cleanup_pathname_win(a); #endif /* Skip leading '/'. */ - if (*src == '/') + if (*src == '/') { + if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Path is absolute"); + return (ARCHIVE_FAILED); + } + separator = *src++; + } /* Scan the pathname one element at a time. */ for (;;) { Modified: stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c Sat May 21 09:03:45 2016 (r300361) @@ -178,6 +178,29 @@ DEFINE_TEST(test_write_disk_secure) assert(S_ISDIR(st.st_mode)); archive_entry_free(ae); + /* + * Without security checks, we should be able to + * extract an absolute path. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + archive_entry_set_mode(ae, S_IFREG | 0777); + assert(0 == archive_write_header(a, ae)); + assert(0 == archive_write_finish_entry(a)); + assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp")); + + /* But with security checks enabled, this should fail. */ + assert(archive_entry_clear(ae) != NULL); + archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS); + failure("Extracting an absolute path should fail here."); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + archive_entry_free(ae); + assert(0 == archive_write_finish_entry(a)); + assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); /* Test the entries on disk. */ From owner-svn-src-all@freebsd.org Sat May 21 09:24:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D75AB44651; Sat, 21 May 2016 09:24:03 +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 2EC1F1519; Sat, 21 May 2016 09:24:03 +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 u4L9O2jl076234; Sat, 21 May 2016 09:24:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L9O25Z076233; Sat, 21 May 2016 09:24:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605210924.u4L9O25Z076233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 21 May 2016 09:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300362 - stable/9/contrib/libarchive/libarchive X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 09:24:03 -0000 Author: mm Date: Sat May 21 09:24:02 2016 New Revision: 300362 URL: https://svnweb.freebsd.org/changeset/base/300362 Log: Backport security fix for integer signedness error in libarchive. This is a direct commit to stable/9. Upstream git commit: 22531545514043e04633e1c015c7540b9de9dbe4 Security: CVE-2013-0211 Modified: stable/9/contrib/libarchive/libarchive/archive_write_disk.c Modified: stable/9/contrib/libarchive/libarchive/archive_write_disk.c ============================================================================== --- stable/9/contrib/libarchive/libarchive/archive_write_disk.c Sat May 21 09:03:45 2016 (r300361) +++ stable/9/contrib/libarchive/libarchive/archive_write_disk.c Sat May 21 09:24:02 2016 (r300362) @@ -1649,8 +1649,9 @@ cleanup_pathname_win(struct archive_writ /* * Canonicalize the pathname. In particular, this strips duplicate * '/' characters, '.' elements, and trailing '/'. It also raises an - * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is - * set) any '..' in the path. + * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is + * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS + * is set) if the path is absolute. */ static int cleanup_pathname(struct archive_write_disk *a) @@ -1670,8 +1671,15 @@ cleanup_pathname(struct archive_write_di return (ARCHIVE_FAILED); #endif /* Skip leading '/'. */ - if (*src == '/') + if (*src == '/') { + if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Path is absolute"); + return (ARCHIVE_FAILED); + } + separator = *src++; + } /* Scan the pathname one element at a time. */ for (;;) { From owner-svn-src-all@freebsd.org Sat May 21 09:27:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC01FB44729; Sat, 21 May 2016 09:27:31 +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 8871618C0; Sat, 21 May 2016 09:27:31 +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 u4L9RUcr076568; Sat, 21 May 2016 09:27:30 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L9RUNu076562; Sat, 21 May 2016 09:27:30 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605210927.u4L9RUNu076562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 21 May 2016 09:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r300363 - in stable/9/contrib/libarchive: cpio libarchive libarchive/test X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 09:27:31 -0000 Author: mm Date: Sat May 21 09:27:30 2016 New Revision: 300363 URL: https://svnweb.freebsd.org/changeset/base/300363 Log: Backport security fix for absolute path traversal vulnerability in bsdcpio. This is a direct commit to stable/9. Vendor git commits: 59357157706d47c365b2227739e17daba3607526 199d5c79b547cebe3d7d33e5acd10ae03008c4a2 Security: CVE-2015-2304 Modified: stable/9/contrib/libarchive/cpio/bsdcpio.1 stable/9/contrib/libarchive/cpio/cpio.c stable/9/contrib/libarchive/libarchive/archive.h stable/9/contrib/libarchive/libarchive/archive_write.c stable/9/contrib/libarchive/libarchive/archive_write_disk.3 stable/9/contrib/libarchive/libarchive/test/test_write_disk_secure.c Modified: stable/9/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- stable/9/contrib/libarchive/cpio/bsdcpio.1 Sat May 21 09:24:02 2016 (r300362) +++ stable/9/contrib/libarchive/cpio/bsdcpio.1 Sat May 21 09:27:30 2016 (r300363) @@ -159,7 +159,8 @@ See above for description. .It Fl -insecure (i and p mode only) Disable security checks during extraction or copying. -This allows extraction via symbolic links and path names containing +This allows extraction via symbolic links, absolute paths, +and path names containing .Sq .. in the name. .It Fl J Modified: stable/9/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/9/contrib/libarchive/cpio/cpio.c Sat May 21 09:24:02 2016 (r300362) +++ stable/9/contrib/libarchive/cpio/cpio.c Sat May 21 09:27:30 2016 (r300363) @@ -162,6 +162,7 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; @@ -231,6 +232,7 @@ main(int argc, char *argv[]) case OPTION_INSECURE: cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case 'L': /* GNU cpio */ cpio->option_follow_links = 1; @@ -265,6 +267,7 @@ main(int argc, char *argv[]) "Cannot use both -p and -%c", cpio->mode); cpio->mode = opt; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case OPTION_PRESERVE_OWNER: cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER; Modified: stable/9/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/9/contrib/libarchive/libarchive/archive.h Sat May 21 09:24:02 2016 (r300362) +++ stable/9/contrib/libarchive/libarchive/archive.h Sat May 21 09:27:30 2016 (r300363) @@ -477,6 +477,8 @@ __LA_DECL int archive_read_set_options( #define ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER (0x0800) /* Detect blocks of 0 and write holes instead. */ #define ARCHIVE_EXTRACT_SPARSE (0x1000) +/* Default: Do not reject entries with absolute paths */ +#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000) __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *, int flags); Modified: stable/9/contrib/libarchive/libarchive/archive_write.c ============================================================================== --- stable/9/contrib/libarchive/libarchive/archive_write.c Sat May 21 09:24:02 2016 (r300362) +++ stable/9/contrib/libarchive/libarchive/archive_write.c Sat May 21 09:27:30 2016 (r300363) @@ -459,8 +459,12 @@ static ssize_t _archive_write_data(struct archive *_a, const void *buff, size_t s) { struct archive_write *a = (struct archive_write *)_a; + const size_t max_write = INT_MAX; __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_DATA, "archive_write_data"); + /* In particular, this catches attempts to pass negative values. */ + if (s > max_write) + s = max_write; archive_clear_error(&a->archive); return ((a->format_write_data)(a, buff, s)); } Modified: stable/9/contrib/libarchive/libarchive/archive_write_disk.3 ============================================================================== --- stable/9/contrib/libarchive/libarchive/archive_write_disk.3 Sat May 21 09:24:02 2016 (r300362) +++ stable/9/contrib/libarchive/libarchive/archive_write_disk.3 Sat May 21 09:27:30 2016 (r300363) @@ -169,6 +169,9 @@ The default is to not refuse such paths. Note that paths ending in .Pa .. always cause an error, regardless of this flag. +.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS +Refuse to extract an absolute path. +The default is to not refuse such paths. .It Cm ARCHIVE_EXTRACT_SPARSE Scan data for blocks of NUL bytes and try to recreate them with holes. This results in sparse files, independent of whether the archive format Modified: stable/9/contrib/libarchive/libarchive/test/test_write_disk_secure.c ============================================================================== --- stable/9/contrib/libarchive/libarchive/test/test_write_disk_secure.c Sat May 21 09:24:02 2016 (r300362) +++ stable/9/contrib/libarchive/libarchive/test/test_write_disk_secure.c Sat May 21 09:27:30 2016 (r300363) @@ -178,6 +178,29 @@ DEFINE_TEST(test_write_disk_secure) assert(S_ISDIR(st.st_mode)); archive_entry_free(ae); + /* + * Without security checks, we should be able to + * extract an absolute path. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + archive_entry_set_mode(ae, S_IFREG | 0777); + assert(0 == archive_write_header(a, ae)); + assert(0 == archive_write_finish_entry(a)); + assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp")); + + /* But with security checks enabled, this should fail. */ + assert(archive_entry_clear(ae) != NULL); + archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS); + failure("Extracting an absolute path should fail here."); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + archive_entry_free(ae); + assert(0 == archive_write_finish_entry(a)); + assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + assert(0 == archive_write_finish(a)); /* Test the entries on disk. */ From owner-svn-src-all@freebsd.org Sat May 21 09:49:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 581E1B44E06; Sat, 21 May 2016 09:49:36 +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 0EBBA172A; Sat, 21 May 2016 09:49:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4L9nZNG082752; Sat, 21 May 2016 09:49:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L9nZmF082751; Sat, 21 May 2016 09:49:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605210949.u4L9nZmF082751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 May 2016 09:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300364 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 09:49:36 -0000 Author: kib Date: Sat May 21 09:49:35 2016 New Revision: 300364 URL: https://svnweb.freebsd.org/changeset/base/300364 Log: Improve handling of rdev->si_mountpt on mount and unmount of FFS volumes. Treat the field as a semaphore protecting availability of the device for mounting. Do no access devvp->v_rdev without the vnode lock owned. Protect change of the devvp->v_bufobj bo_ops vector with the vnode lock. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat May 21 09:27:30 2016 (r300363) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat May 21 09:49:35 2016 (r300364) @@ -764,25 +764,31 @@ ffs_mountfs(devvp, mp, td) cred = td ? td->td_ucred : NOCRED; ronly = (mp->mnt_flag & MNT_RDONLY) != 0; + KASSERT(devvp->v_type == VCHR, ("reclaimed devvp")); dev = devvp->v_rdev; - dev_ref(dev); + if (atomic_cmpset_acq_ptr((uintptr_t *)&dev->si_mountpt, 0, + (uintptr_t)mp) == 0) { + VOP_UNLOCK(devvp, 0); + return (EBUSY); + } DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "ffs", ronly ? 0 : 1); g_topology_unlock(); PICKUP_GIANT(); + if (error != 0) { + atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); + VOP_UNLOCK(devvp, 0); + return (error); + } + dev_ref(dev); + devvp->v_bufobj.bo_ops = &ffs_ops; VOP_UNLOCK(devvp, 0); - if (error) - goto out; - if (devvp->v_rdev->si_iosize_max != 0) - mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; + if (dev->si_iosize_max != 0) + mp->mnt_iosize_max = dev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) mp->mnt_iosize_max = MAXPHYS; - devvp->v_bufobj.bo_ops = &ffs_ops; - if (devvp->v_type == VCHR) - devvp->v_rdev->si_mountpt = mp; - fs = NULL; sblockloc = 0; /* @@ -1083,8 +1089,6 @@ ffs_mountfs(devvp, mp, td) out: if (bp) brelse(bp); - if (devvp->v_type == VCHR && devvp->v_rdev != NULL) - devvp->v_rdev->si_mountpt = NULL; if (cp != NULL) { DROP_GIANT(); g_topology_lock(); @@ -1102,6 +1106,7 @@ out: free(ump, M_UFSMNT); mp->mnt_data = NULL; } + atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); dev_rel(dev); return (error); } @@ -1287,8 +1292,7 @@ ffs_unmount(mp, mntflags) g_vfs_close(ump->um_cp); g_topology_unlock(); PICKUP_GIANT(); - if (ump->um_devvp->v_type == VCHR && ump->um_devvp->v_rdev != NULL) - ump->um_devvp->v_rdev->si_mountpt = NULL; + atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); vrele(ump->um_devvp); dev_rel(ump->um_dev); mtx_destroy(UFS_MTX(ump)); From owner-svn-src-all@freebsd.org Sat May 21 09:55:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27E3AB44F9B; Sat, 21 May 2016 09:55:34 +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 EE3191B1D; Sat, 21 May 2016 09:55:33 +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 u4L9tXtw085620; Sat, 21 May 2016 09:55:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L9tXX3085619; Sat, 21 May 2016 09:55:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605210955.u4L9tXX3085619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 May 2016 09:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300365 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 09:55:34 -0000 Author: kib Date: Sat May 21 09:55:32 2016 New Revision: 300365 URL: https://svnweb.freebsd.org/changeset/base/300365 Log: Remove zero assignments in the cdev allocator. cdp memory is requested with M_ZERO. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/devfs/devfs_devs.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Sat May 21 09:49:35 2016 (r300364) +++ head/sys/fs/devfs/devfs_devs.c Sat May 21 09:55:32 2016 (r300365) @@ -127,16 +127,11 @@ devfs_alloc(int flags) return (NULL); cdp->cdp_dirents = &cdp->cdp_dirent0; - cdp->cdp_dirent0 = NULL; - cdp->cdp_maxdirent = 0; - cdp->cdp_inode = 0; cdev = &cdp->cdp_c; - LIST_INIT(&cdev->si_children); vfs_timestamp(&ts); cdev->si_atime = cdev->si_mtime = cdev->si_ctime = ts; - cdev->si_cred = NULL; return (cdev); } From owner-svn-src-all@freebsd.org Sat May 21 10:13:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF9AB44500; Sat, 21 May 2016 10:13:26 +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 799391472; Sat, 21 May 2016 10:13:26 +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 u4LADPPC091775; Sat, 21 May 2016 10:13:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LADPA3091774; Sat, 21 May 2016 10:13:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605211013.u4LADPA3091774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 May 2016 10:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300366 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 10:13:26 -0000 Author: kib Date: Sat May 21 10:13:25 2016 New Revision: 300366 URL: https://svnweb.freebsd.org/changeset/base/300366 Log: Stop dropping and reacquiring Giant around geom calls in UFS. Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat May 21 09:55:32 2016 (r300365) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat May 21 10:13:25 2016 (r300366) @@ -239,14 +239,12 @@ ffs_mount(struct mount *mp) if ((error = ffs_flushfiles(mp, WRITECLOSE, td)) != 0 || (error = ffs_sbupdate(ump, MNT_WAIT, 0)) != 0) return (error); - DROP_GIANT(); g_topology_lock(); /* * Return to normal read-only mode. */ error = g_access(ump->um_cp, 0, -1, 0); g_topology_unlock(); - PICKUP_GIANT(); ump->um_fsckpid = 0; } if (fs->fs_ronly == 0 && @@ -294,14 +292,12 @@ ffs_mount(struct mount *mp) } if (MOUNTEDSOFTDEP(mp)) softdep_unmount(mp); - DROP_GIANT(); g_topology_lock(); /* * Drop our write and exclusive access. */ g_access(ump->um_cp, 0, -1, -1); g_topology_unlock(); - PICKUP_GIANT(); fs->fs_ronly = 1; MNT_ILOCK(mp); mp->mnt_flag |= MNT_RDONLY; @@ -359,14 +355,12 @@ ffs_mount(struct mount *mp) return (EPERM); } } - DROP_GIANT(); g_topology_lock(); /* * Request exclusive write access. */ error = g_access(ump->um_cp, 0, 1, 1); g_topology_unlock(); - PICKUP_GIANT(); if (error) return (error); if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0) @@ -433,14 +427,12 @@ ffs_mount(struct mount *mp) } KASSERT(MOUNTEDSOFTDEP(mp) == 0, ("soft updates enabled on read-only file system")); - DROP_GIANT(); g_topology_lock(); /* * Request write access. */ error = g_access(ump->um_cp, 0, 1, 0); g_topology_unlock(); - PICKUP_GIANT(); if (error) { vfs_mount_error(mp, "Checker activation failed on %s", @@ -523,14 +515,12 @@ ffs_mount(struct mount *mp) ("soft updates enabled on read-only file system")); ump = VFSTOUFS(mp); fs = ump->um_fs; - DROP_GIANT(); g_topology_lock(); /* * Request write access. */ error = g_access(ump->um_cp, 0, 1, 0); g_topology_unlock(); - PICKUP_GIANT(); if (error) { printf("WARNING: %s: Checker activation " "failed\n", fs->fs_fsmnt); @@ -771,11 +761,9 @@ ffs_mountfs(devvp, mp, td) VOP_UNLOCK(devvp, 0); return (EBUSY); } - DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "ffs", ronly ? 0 : 1); g_topology_unlock(); - PICKUP_GIANT(); if (error != 0) { atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); VOP_UNLOCK(devvp, 0); @@ -1090,11 +1078,9 @@ out: if (bp) brelse(bp); if (cp != NULL) { - DROP_GIANT(); g_topology_lock(); g_vfs_close(cp); g_topology_unlock(); - PICKUP_GIANT(); } if (ump) { mtx_destroy(UFS_MTX(ump)); @@ -1280,7 +1266,6 @@ ffs_unmount(mp, mntflags) taskqueue_drain_all(ump->um_trim_tq); taskqueue_free(ump->um_trim_tq); } - DROP_GIANT(); g_topology_lock(); if (ump->um_fsckpid > 0) { /* @@ -1291,7 +1276,6 @@ ffs_unmount(mp, mntflags) } g_vfs_close(ump->um_cp); g_topology_unlock(); - PICKUP_GIANT(); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); vrele(ump->um_devvp); dev_rel(ump->um_dev); From owner-svn-src-all@freebsd.org Sat May 21 10:33:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62B16B448EB; Sat, 21 May 2016 10:33:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29C751F3C; Sat, 21 May 2016 10:33:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2EE581FE024; Sat, 21 May 2016 12:33:32 +0200 (CEST) Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys To: Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <5629da57-1b67-9225-ede3-7e5e18c69b82@selasky.org> Date: Sat, 21 May 2016 12:36:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605180435.u4I4ZwYh025096@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 10:33:35 -0000 On 05/18/16 06:35, Scott Long wrote: > Author: scottl > Date: Wed May 18 04:35:58 2016 > New Revision: 300113 > URL: https://svnweb.freebsd.org/changeset/base/300113 > > Log: > Import the 'iflib' API library for network drivers. From the author: > > "iflib is a library to eliminate the need for frequently duplicated device > independent logic propagated (poorly) across many network drivers." > > Participation is purely optional. The IFLIB kernel config option is > provided for drivers that want to transition between legacy and iflib > modes of operation. ixl and ixgbe driver conversions will be committed > shortly. We hope to see participation from the Broadcom and maybe > Chelsio drivers in the near future. > > Submitted by: mmacy@nextbsd.org > Reviewed by: gallatin > Differential Revision: D5211 > > Added: > head/sys/net/ifdi_if.m (contents, props changed) > head/sys/net/iflib.c (contents, props changed) > head/sys/net/iflib.h (contents, props changed) > head/sys/net/mp_ring.c (contents, props changed) > head/sys/net/mp_ring.h (contents, props changed) > Modified: > head/sys/conf/files > head/sys/conf/options > head/sys/kern/device_if.m > head/sys/kern/kern_mbuf.c > head/sys/kern/subr_taskqueue.c > head/sys/net/if.c > head/sys/net/if_var.h > head/sys/sys/_task.h > head/sys/sys/mbuf.h > head/sys/sys/taskqueue.h > Hi, Possibly the taskqueue related changes should have been broken out into a separate commit, hence they are not related to "iflib". --HPS From owner-svn-src-all@freebsd.org Sat May 21 10:59:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7F4AB44BEF; Sat, 21 May 2016 10:59:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 896791951; Sat, 21 May 2016 10:59:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LAxag0004129; Sat, 21 May 2016 10:59:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LAxaEN004127; Sat, 21 May 2016 10:59:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605211059.u4LAxaEN004127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 21 May 2016 10:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300368 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 10:59:37 -0000 Author: trasz Date: Sat May 21 10:59:36 2016 New Revision: 300368 URL: https://svnweb.freebsd.org/changeset/base/300368 Log: Pass maxtags value to the ICL module. iSER needs it. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Sat May 21 10:53:45 2016 (r300367) +++ head/sys/dev/iscsi/icl.h Sat May 21 10:59:36 2016 (r300368) @@ -110,6 +110,7 @@ struct icl_conn { bool ic_send_running; bool ic_receive_running; size_t ic_max_data_segment_length; + size_t ic_maxtags; bool ic_disconnecting; bool ic_iser; const char *ic_name; Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sat May 21 10:53:45 2016 (r300367) +++ head/sys/dev/iscsi/iscsi.c Sat May 21 10:59:36 2016 (r300368) @@ -1403,6 +1403,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ ic->ic_data_crc32c = true; else ic->ic_data_crc32c = false; + ic->ic_maxtags = maxtags; is->is_cmdsn = 0; is->is_expcmdsn = 0; @@ -1442,7 +1443,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ } else { ISCSI_SESSION_LOCK(is); - is->is_devq = cam_simq_alloc(maxtags); + is->is_devq = cam_simq_alloc(ic->ic_maxtags); if (is->is_devq == NULL) { ISCSI_SESSION_WARN(is, "failed to allocate simq"); iscsi_session_terminate(is); @@ -1451,7 +1452,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ is->is_sim = cam_sim_alloc(iscsi_action, iscsi_poll, "iscsi", is, is->is_id /* unit */, &is->is_lock, - 1, maxtags, is->is_devq); + 1, ic->ic_maxtags, is->is_devq); if (is->is_sim == NULL) { ISCSI_SESSION_UNLOCK(is); ISCSI_SESSION_WARN(is, "failed to allocate SIM"); From owner-svn-src-all@freebsd.org Sat May 21 11:10:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C403B44DC3; Sat, 21 May 2016 11:10:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45CDE1DC8; Sat, 21 May 2016 11:10:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LBAngc007430; Sat, 21 May 2016 11:10:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LBAne2007426; Sat, 21 May 2016 11:10:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605211110.u4LBAne2007426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 21 May 2016 11:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300369 - in head/sys/dev: cxgbe/cxgbei iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 11:10:50 -0000 Author: trasz Date: Sat May 21 11:10:48 2016 New Revision: 300369 URL: https://svnweb.freebsd.org/changeset/base/300369 Log: Provide a way for ICL modules to declare they support PIM_UNMAPPED. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Sat May 21 10:59:36 2016 (r300368) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Sat May 21 11:10:48 2016 (r300369) @@ -429,6 +429,7 @@ icl_cxgbei_new_conn(const char *name, st ic->ic_max_data_segment_length = CXGBEI_MAX_DSL; ic->ic_name = name; ic->ic_offload = "cxgbei"; + ic->ic_unmapped = false; CTR2(KTR_CXGBE, "%s: icc %p", __func__, icc); Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Sat May 21 10:59:36 2016 (r300368) +++ head/sys/dev/iscsi/icl.h Sat May 21 11:10:48 2016 (r300369) @@ -113,6 +113,7 @@ struct icl_conn { size_t ic_maxtags; bool ic_disconnecting; bool ic_iser; + bool ic_unmapped; const char *ic_name; const char *ic_offload; Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Sat May 21 10:59:36 2016 (r300368) +++ head/sys/dev/iscsi/icl_soft.c Sat May 21 11:10:48 2016 (r300369) @@ -1190,6 +1190,7 @@ icl_soft_new_conn(const char *name, stru ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; ic->ic_name = name; ic->ic_offload = "None"; + ic->ic_unmapped = false; return (ic); } Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sat May 21 10:59:36 2016 (r300368) +++ head/sys/dev/iscsi/iscsi.c Sat May 21 11:10:48 2016 (r300369) @@ -2266,6 +2266,14 @@ iscsi_action(struct cam_sim *sim, union cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; cpi->hba_misc = PIM_EXTLUNS; + /* + * XXX: It shouldn't ever be NULL; this could be turned + * into a KASSERT eventually. + */ + if (is->is_conn == NULL) + ISCSI_WARN("NULL conn"); + else if (is->is_conn->ic_unmapped) + cpi->hba_misc |= PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = 0; /* From owner-svn-src-all@freebsd.org Sat May 21 11:26:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C564DB4426F; Sat, 21 May 2016 11:26:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92EFF150F; Sat, 21 May 2016 11:26:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LBQ3ht013168; Sat, 21 May 2016 11:26:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LBQ3bb013167; Sat, 21 May 2016 11:26:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605211126.u4LBQ3bb013167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 21 May 2016 11:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300370 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 11:26:04 -0000 Author: trasz Date: Sat May 21 11:26:03 2016 New Revision: 300370 URL: https://svnweb.freebsd.org/changeset/base/300370 Log: Properly reset session state when using proxy and fail_on_disconnection=1. Without it the reconnection would fail due to mismatched sequence numbers. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sat May 21 11:10:48 2016 (r300369) +++ head/sys/dev/iscsi/iscsi.c Sat May 21 11:26:03 2016 (r300370) @@ -1552,6 +1552,10 @@ iscsi_ioctl_daemon_connect(struct iscsi_ } ISCSI_SESSION_LOCK(is); + is->is_statsn = 0; + is->is_cmdsn = 0; + is->is_expcmdsn = 0; + is->is_maxcmdsn = 0; is->is_waiting_for_iscsid = false; is->is_login_phase = true; is->is_timeout = 0; From owner-svn-src-all@freebsd.org Sat May 21 11:40:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE1ADB4464D; Sat, 21 May 2016 11:40:42 +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 A2FF81EE5; Sat, 21 May 2016 11:40:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LBefaW016273; Sat, 21 May 2016 11:40:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LBefAI016272; Sat, 21 May 2016 11:40:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605211140.u4LBefAI016272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 May 2016 11:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300371 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 11:40:43 -0000 Author: kib Date: Sat May 21 11:40:41 2016 New Revision: 300371 URL: https://svnweb.freebsd.org/changeset/base/300371 Log: Same as for UFS, remove drop/reacquire of Giant, and use si_mountpt as the mount semaphore. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Sat May 21 11:26:03 2016 (r300370) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Sat May 21 11:40:41 2016 (r300371) @@ -292,11 +292,9 @@ msdosfs_mount(struct mount *mp) } /* Downgrade the device from rw to ro. */ - DROP_GIANT(); g_topology_lock(); error = g_access(pmp->pm_cp, 0, -1, 0); g_topology_unlock(); - PICKUP_GIANT(); if (error) { (void)markvoldirty(pmp, 1); return (error); @@ -328,11 +326,9 @@ msdosfs_mount(struct mount *mp) return (error); } VOP_UNLOCK(devvp, 0); - DROP_GIANT(); g_topology_lock(); error = g_access(pmp->pm_cp, 0, 1, 0); g_topology_unlock(); - PICKUP_GIANT(); if (error) return (error); @@ -401,8 +397,6 @@ msdosfs_mount(struct mount *mp) return error; } - if (devvp->v_type == VCHR && devvp->v_rdev != NULL) - devvp->v_rdev->si_mountpt = mp; vfs_mountedfrom(mp, from); #ifdef MSDOSFS_DEBUG printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap); @@ -431,15 +425,21 @@ mountmsdosfs(struct vnode *devvp, struct ronly = (mp->mnt_flag & MNT_RDONLY) != 0; dev = devvp->v_rdev; - dev_ref(dev); - DROP_GIANT(); + if (atomic_cmpset_acq_ptr((uintptr_t *)&dev->si_mountpt, 0, + (uintptr_t)mp) == 0) { + VOP_UNLOCK(devvp, 0); + return (EBUSY); + } g_topology_lock(); error = g_vfs_open(devvp, &cp, "msdosfs", ronly ? 0 : 1); g_topology_unlock(); - PICKUP_GIANT(); + if (error != 0) { + atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); + VOP_UNLOCK(devvp, 0); + return (error); + } + dev_ref(dev); VOP_UNLOCK(devvp, 0); - if (error) - goto error_exit; bo = &devvp->v_bufobj; @@ -770,11 +770,9 @@ error_exit: if (bp) brelse(bp); if (cp != NULL) { - DROP_GIANT(); g_topology_lock(); g_vfs_close(cp); g_topology_unlock(); - PICKUP_GIANT(); } if (pmp) { lockdestroy(&pmp->pm_fatlock); @@ -783,6 +781,7 @@ error_exit: free(pmp, M_MSDOSFSMNT); mp->mnt_data = NULL; } + atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); dev_rel(dev); return (error); } @@ -846,13 +845,10 @@ msdosfs_unmount(struct mount *mp, int mn BO_UNLOCK(bo); } #endif - DROP_GIANT(); - if (pmp->pm_devvp->v_type == VCHR && pmp->pm_devvp->v_rdev != NULL) - pmp->pm_devvp->v_rdev->si_mountpt = NULL; g_topology_lock(); g_vfs_close(pmp->pm_cp); g_topology_unlock(); - PICKUP_GIANT(); + atomic_store_rel_ptr((uintptr_t *)&pmp->pm_dev->si_mountpt, 0); vrele(pmp->pm_devvp); dev_rel(pmp->pm_dev); free(pmp->pm_inusemap, M_MSDOSFSFAT); From owner-svn-src-all@freebsd.org Sat May 21 14:51:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D530B446D1; Sat, 21 May 2016 14:51:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 088431D25; Sat, 21 May 2016 14:51:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LEpona074809; Sat, 21 May 2016 14:51:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LEpopu074806; Sat, 21 May 2016 14:51:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605211451.u4LEpopu074806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 21 May 2016 14:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300372 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 14:51:51 -0000 Author: avg Date: Sat May 21 14:51:49 2016 New Revision: 300372 URL: https://svnweb.freebsd.org/changeset/base/300372 Log: fix loss of taskqueue wakeups (introduced in r300113) Submitted by: kmacy Tested by: dchagin Modified: head/sys/kern/subr_taskqueue.c head/sys/sys/_task.h head/sys/sys/taskqueue.h Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Sat May 21 11:40:41 2016 (r300371) +++ head/sys/kern/subr_taskqueue.c Sat May 21 14:51:49 2016 (r300372) @@ -68,7 +68,6 @@ struct taskqueue { TAILQ_HEAD(, taskqueue_busy) tq_active; struct mtx tq_mutex; struct thread **tq_threads; - struct thread *tq_curthread; int tq_tcount; int tq_spin; int tq_flags; @@ -222,7 +221,7 @@ taskqueue_enqueue_locked(struct taskqueu * Count multiple enqueues. */ if (task->ta_pending) { - if (task->ta_pending < UCHAR_MAX) + if (task->ta_pending < USHRT_MAX) task->ta_pending++; TQ_UNLOCK(queue); return (0); @@ -465,8 +464,7 @@ taskqueue_run_locked(struct taskqueue *q TQ_LOCK(queue); tb.tb_running = NULL; - if ((task->ta_flags & TASK_SKIP_WAKEUP) == 0) - wakeup(task); + wakeup(task); TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); tb_first = TAILQ_FIRST(&queue->tq_active); @@ -481,9 +479,7 @@ taskqueue_run(struct taskqueue *queue) { TQ_LOCK(queue); - queue->tq_curthread = curthread; taskqueue_run_locked(queue); - queue->tq_curthread = NULL; TQ_UNLOCK(queue); } @@ -716,7 +712,6 @@ taskqueue_thread_loop(void *arg) tq = *tqp; taskqueue_run_callback(tq, TASKQUEUE_CALLBACK_TYPE_INIT); TQ_LOCK(tq); - tq->tq_curthread = curthread; while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { /* XXX ? */ taskqueue_run_locked(tq); @@ -730,7 +725,6 @@ taskqueue_thread_loop(void *arg) TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); } taskqueue_run_locked(tq); - tq->tq_curthread = NULL; /* * This thread is on its way out, so just drop the lock temporarily * in order to call the shutdown callback. This allows the callback @@ -754,8 +748,7 @@ taskqueue_thread_enqueue(void *context) tqp = context; tq = *tqp; - if (tq->tq_curthread != curthread) - wakeup_one(tq); + wakeup_one(tq); } TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, NULL, Modified: head/sys/sys/_task.h ============================================================================== --- head/sys/sys/_task.h Sat May 21 11:40:41 2016 (r300371) +++ head/sys/sys/_task.h Sat May 21 14:51:49 2016 (r300372) @@ -45,8 +45,7 @@ typedef void task_fn_t(void *context, in struct task { STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ - uint8_t ta_pending; /* (q) count times queued */ - uint8_t ta_flags; /* (q) flags */ + uint16_t ta_pending; /* (q) count times queued */ u_short ta_priority; /* (c) Priority */ task_fn_t *ta_func; /* (c) task handler */ void *ta_context; /* (c) argument for handler */ Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Sat May 21 11:40:41 2016 (r300371) +++ head/sys/sys/taskqueue.h Sat May 21 14:51:49 2016 (r300372) @@ -98,7 +98,6 @@ void taskqueue_set_callback(struct taskq #define TASK_INITIALIZER(priority, func, context) \ { .ta_pending = 0, \ - .ta_flags = 0, \ .ta_priority = (priority), \ .ta_func = (func), \ .ta_context = (context) } @@ -114,7 +113,6 @@ void taskqueue_thread_enqueue(void *cont */ #define TASK_INIT(task, priority, func, context) do { \ (task)->ta_pending = 0; \ - (task)->ta_flags = 0; \ (task)->ta_priority = (priority); \ (task)->ta_func = (func); \ (task)->ta_context = (context); \ @@ -224,7 +222,6 @@ int taskqgroup_adjust(struct taskqgroup #define GTASK_INIT(task, priority, func, context) do { \ (task)->ta_pending = 0; \ - (task)->ta_flags = TASK_SKIP_WAKEUP; \ (task)->ta_priority = (priority); \ (task)->ta_func = (func); \ (task)->ta_context = (context); \ From owner-svn-src-all@freebsd.org Sat May 21 15:15:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA00B44A94; Sat, 21 May 2016 15:15:13 +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 04BB91777; Sat, 21 May 2016 15:15:12 +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 u4LFFCix082907; Sat, 21 May 2016 15:15:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LFFCMK082904; Sat, 21 May 2016 15:15:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605211515.u4LFFCMK082904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 May 2016 15:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300373 - in stable/10/sys: conf dev/ntb/if_ntb dev/ntb/ntb_hw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 15:15:13 -0000 Author: mav Date: Sat May 21 15:15:11 2016 New Revision: 300373 URL: https://svnweb.freebsd.org/changeset/base/300373 Log: MFC 103 ntb(4) patches by cem@ up to r295487. Modified: stable/10/sys/conf/files.i386 stable/10/sys/dev/ntb/if_ntb/if_ntb.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Sat May 21 14:51:49 2016 (r300372) +++ stable/10/sys/conf/files.i386 Sat May 21 15:15:11 2016 (r300373) @@ -274,6 +274,8 @@ dev/lindev/lindev.c optional lindev dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci +dev/ntb/if_ntb/if_ntb.c optional if_ntb +dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Sat May 21 14:51:49 2016 (r300372) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Sat May 21 15:15:11 2016 (r300373) @@ -1,5 +1,6 @@ /*- * Copyright (C) 2013 Intel Corporation + * Copyright (C) 2015 EMC Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,8 +31,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -39,19 +42,26 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include + #include #include #include #include #include #include + #include #include + #include #include #include +#include +#include + #include "../ntb_hw/ntb_hw.h" /* @@ -65,72 +75,113 @@ __FBSDID("$FreeBSD$"); * be picked up and redistributed in Linux with a dual GPL/BSD license. */ -/* TODO: These functions should really be part of the kernel */ -#define test_bit(pos, bitmap_addr) (*(bitmap_addr) & 1UL << (pos)) -#define set_bit(pos, bitmap_addr) *(bitmap_addr) |= 1UL << (pos) -#define clear_bit(pos, bitmap_addr) *(bitmap_addr) &= ~(1UL << (pos)) +#define QP_SETSIZE 64 +BITSET_DEFINE(_qpset, QP_SETSIZE); +#define test_bit(pos, addr) BIT_ISSET(QP_SETSIZE, (pos), (addr)) +#define set_bit(pos, addr) BIT_SET(QP_SETSIZE, (pos), (addr)) +#define clear_bit(pos, addr) BIT_CLR(QP_SETSIZE, (pos), (addr)) +#define ffs_bit(addr) BIT_FFS(QP_SETSIZE, (addr)) #define KTR_NTB KTR_SPARE3 -#define NTB_TRANSPORT_VERSION 3 +#define NTB_TRANSPORT_VERSION 4 #define NTB_RX_MAX_PKTS 64 #define NTB_RXQ_SIZE 300 -static unsigned int transport_mtu = 0x4000 + ETHER_HDR_LEN + ETHER_CRC_LEN; -static unsigned int max_num_clients = 1; +enum ntb_link_event { + NTB_LINK_DOWN = 0, + NTB_LINK_UP, +}; + +static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); + +static unsigned g_if_ntb_debug_level; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN, + &g_if_ntb_debug_level, 0, "if_ntb log level -- higher is more verbose"); +#define ntb_printf(lvl, ...) do { \ + if ((lvl) <= g_if_ntb_debug_level) { \ + if_printf(nt->ifp, __VA_ARGS__); \ + } \ +} while (0) + +static unsigned transport_mtu = IP_MAXPACKET + ETHER_HDR_LEN + ETHER_CRC_LEN; + +static uint64_t max_mw_size; +SYSCTL_UQUAD(_hw_if_ntb, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, &max_mw_size, 0, + "If enabled (non-zero), limit the size of large memory windows. " + "Both sides of the NTB MUST set the same value here."); + +static unsigned max_num_clients; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, + &max_num_clients, 0, "Maximum number of NTB transport clients. " + "0 (default) - use all available NTB memory windows; " + "positive integer N - Limit to N memory windows."); + +static unsigned enable_xeon_watchdog; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, enable_xeon_watchdog, CTLFLAG_RDTUN, + &enable_xeon_watchdog, 0, "If non-zero, write a register every second to " + "keep a watchdog from tearing down the NTB link"); STAILQ_HEAD(ntb_queue_list, ntb_queue_entry); +typedef uint32_t ntb_q_idx_t; + struct ntb_queue_entry { /* ntb_queue list reference */ STAILQ_ENTRY(ntb_queue_entry) entry; - /* info on data to be transfered */ + /* info on data to be transferred */ void *cb_data; void *buf; - uint64_t len; - uint64_t flags; + uint32_t len; + uint32_t flags; + + struct ntb_transport_qp *qp; + struct ntb_payload_header *x_hdr; + ntb_q_idx_t index; }; struct ntb_rx_info { - unsigned int entry; + ntb_q_idx_t entry; }; struct ntb_transport_qp { - struct ntb_netdev *transport; + struct ntb_transport_ctx *transport; struct ntb_softc *ntb; void *cb_data; bool client_ready; - bool qp_link; + volatile bool link_is_up; uint8_t qp_num; /* Only 64 QPs are allowed. 0-63 */ struct ntb_rx_info *rx_info; struct ntb_rx_info *remote_rx_info; - void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); struct ntb_queue_list tx_free_q; struct mtx ntb_tx_free_q_lock; - void *tx_mw; - uint64_t tx_index; - uint64_t tx_max_entry; + caddr_t tx_mw; + bus_addr_t tx_mw_phys; + ntb_q_idx_t tx_index; + ntb_q_idx_t tx_max_entry; uint64_t tx_max_frame; - void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); + struct ntb_queue_list rx_post_q; struct ntb_queue_list rx_pend_q; - struct ntb_queue_list rx_free_q; - struct mtx ntb_rx_pend_q_lock; - struct mtx ntb_rx_free_q_lock; + /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ + struct mtx ntb_rx_q_lock; struct task rx_completion_task; - void *rx_buff; - uint64_t rx_index; - uint64_t rx_max_entry; + struct task rxc_db_work; + caddr_t rx_buff; + ntb_q_idx_t rx_index; + ntb_q_idx_t rx_max_entry; uint64_t rx_max_frame; - void (*event_handler) (void *data, int status); + void (*event_handler)(void *data, enum ntb_link_event status); struct callout link_work; struct callout queue_full; struct callout rx_full; @@ -147,40 +198,55 @@ struct ntb_transport_qp { uint64_t tx_bytes; uint64_t tx_pkts; uint64_t tx_ring_full; + uint64_t tx_err_no_buf; }; struct ntb_queue_handlers { - void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); - void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); - void (*event_handler) (void *data, int status); + void (*event_handler)(void *data, enum ntb_link_event status); }; - struct ntb_transport_mw { - size_t size; - void *virt_addr; - vm_paddr_t dma_addr; + vm_paddr_t phys_addr; + size_t phys_size; + size_t xlat_align; + size_t xlat_align_size; + bus_addr_t addr_limit; + /* Tx buff is off vbase / phys_addr */ + caddr_t vbase; + size_t xlat_size; + size_t buff_size; + /* Rx buff is off virt_addr / dma_addr */ + caddr_t virt_addr; + bus_addr_t dma_addr; }; -struct ntb_netdev { +struct ntb_transport_ctx { struct ntb_softc *ntb; struct ifnet *ifp; - struct ntb_transport_mw mw[NTB_NUM_MW]; - struct ntb_transport_qp *qps; - uint64_t max_qps; - uint64_t qp_bitmap; - bool transport_link; + struct ntb_transport_mw mw_vec[NTB_MAX_NUM_MW]; + struct ntb_transport_qp *qp_vec; + struct _qpset qp_bitmap; + struct _qpset qp_bitmap_free; + unsigned mw_count; + unsigned qp_count; + volatile bool link_is_up; struct callout link_work; - struct ntb_transport_qp *qp; + struct callout link_watchdog; + struct task link_cleanup; uint64_t bufsize; u_char eaddr[ETHER_ADDR_LEN]; struct mtx tx_lock; struct mtx rx_lock; + + /* The hardcoded single queuepair in ntb_setup_interface() */ + struct ntb_transport_qp *qp; }; -static struct ntb_netdev net_softc; +static struct ntb_transport_ctx net_softc; enum { IF_NTB_DESC_DONE_FLAG = 1 << 0, @@ -188,21 +254,42 @@ enum { }; struct ntb_payload_header { - uint64_t ver; - uint64_t len; - uint64_t flags; + ntb_q_idx_t ver; + uint32_t len; + uint32_t flags; }; enum { + /* + * The order of this enum is part of the if_ntb remote protocol. Do + * not reorder without bumping protocol version (and it's probably best + * to keep the protocol in lock-step with the Linux NTB driver. + */ IF_NTB_VERSION = 0, - IF_NTB_MW0_SZ, - IF_NTB_MW1_SZ, - IF_NTB_NUM_QPS, IF_NTB_QP_LINKS, + IF_NTB_NUM_QPS, + IF_NTB_NUM_MWS, + /* + * N.B.: transport_link_work assumes MW1 enums = MW0 + 2. + */ + IF_NTB_MW0_SZ_HIGH, + IF_NTB_MW0_SZ_LOW, + IF_NTB_MW1_SZ_HIGH, + IF_NTB_MW1_SZ_LOW, IF_NTB_MAX_SPAD, + + /* + * Some NTB-using hardware have a watchdog to work around NTB hangs; if + * a register or doorbell isn't written every few seconds, the link is + * torn down. Write an otherwise unused register every few seconds to + * work around this watchdog. + */ + IF_NTB_WATCHDOG_SPAD = 15 }; +CTASSERT(IF_NTB_WATCHDOG_SPAD < XEON_SPAD_COUNT && + IF_NTB_WATCHDOG_SPAD < ATOM_SPAD_COUNT); -#define QP_TO_MW(qp) ((qp) % NTB_NUM_MW) +#define QP_TO_MW(nt, qp) ((qp) % nt->mw_count) #define NTB_QP_DEF_NUM_ENTRIES 100 #define NTB_LINK_DOWN_TIMEOUT 10 @@ -216,37 +303,41 @@ static void ntb_net_tx_handler(struct nt void *data, int len); static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); -static void ntb_net_event_handler(void *data, int status); -static int ntb_transport_init(struct ntb_softc *ntb); -static void ntb_transport_free(void *transport); -static void ntb_transport_init_queue(struct ntb_netdev *nt, +static void ntb_net_event_handler(void *data, enum ntb_link_event status); +static int ntb_transport_probe(struct ntb_softc *ntb); +static void ntb_transport_free(struct ntb_transport_ctx *); +static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num); static void ntb_transport_free_queue(struct ntb_transport_qp *qp); -static struct ntb_transport_qp * ntb_transport_create_queue(void *data, +static struct ntb_transport_qp *ntb_transport_create_queue(void *data, struct ntb_softc *pdev, const struct ntb_queue_handlers *handlers); static void ntb_transport_link_up(struct ntb_transport_qp *qp); static int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, unsigned int len); static int ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry); -static void ntb_tx_copy_task(struct ntb_transport_qp *qp, +static void ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, void *offset); static void ntb_qp_full(void *arg); -static void ntb_transport_rxc_db(void *data, int db_num); -static void ntb_rx_pendq_full(void *arg); -static void ntb_transport_rx(struct ntb_transport_qp *qp); +static void ntb_transport_rxc_db(void *arg, int pending); static int ntb_process_rxc(struct ntb_transport_qp *qp); -static void ntb_rx_copy_task(struct ntb_transport_qp *qp, +static void ntb_memcpy_rx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, void *offset); -static void ntb_rx_completion_task(void *arg, int pending); -static void ntb_transport_event_callback(void *data, enum ntb_hw_event event); +static inline void ntb_rx_copy_callback(struct ntb_transport_qp *qp, + void *data); +static void ntb_complete_rxc(void *arg, int pending); +static void ntb_transport_doorbell_callback(void *data, uint32_t vector); +static void ntb_transport_event_callback(void *data); static void ntb_transport_link_work(void *arg); -static int ntb_set_mw(struct ntb_netdev *nt, int num_mw, unsigned int size); -static void ntb_transport_setup_qp_mw(struct ntb_netdev *nt, +static int ntb_set_mw(struct ntb_transport_ctx *, int num_mw, size_t size); +static void ntb_free_mw(struct ntb_transport_ctx *nt, int num_mw); +static int ntb_transport_setup_qp_mw(struct ntb_transport_ctx *nt, unsigned int qp_num); static void ntb_qp_link_work(void *arg); -static void ntb_transport_link_cleanup(struct ntb_netdev *nt); +static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt); +static void ntb_transport_link_cleanup_work(void *, int); static void ntb_qp_link_down(struct ntb_transport_qp *qp); +static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp); static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp); static void ntb_transport_link_down(struct ntb_transport_qp *qp); static void ntb_send_link_down(struct ntb_transport_qp *qp); @@ -254,11 +345,27 @@ static void ntb_list_add(struct mtx *loc struct ntb_queue_list *list); static struct ntb_queue_entry *ntb_list_rm(struct mtx *lock, struct ntb_queue_list *list); +static struct ntb_queue_entry *ntb_list_mv(struct mtx *lock, + struct ntb_queue_list *from, struct ntb_queue_list *to); static void create_random_local_eui48(u_char *eaddr); static unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); +static void xeon_link_watchdog_hb(void *); + +static const struct ntb_ctx_ops ntb_transport_ops = { + .link_event = ntb_transport_event_callback, + .db_event = ntb_transport_doorbell_callback, +}; MALLOC_DEFINE(M_NTB_IF, "if_ntb", "ntb network driver"); +static inline void +iowrite32(uint32_t val, void *addr) +{ + + bus_space_write_4(X86_BUS_SPACE_MEM, 0/* HACK */, (uintptr_t)addr, + val); +} + /* Module setup and teardown */ static int ntb_handle_module_events(struct module *m, int what, void *arg) @@ -289,11 +396,12 @@ DECLARE_MODULE(if_ntb, if_ntb_mod, SI_SU MODULE_DEPEND(if_ntb, ntb_hw, 1, 1, 1); static int -ntb_setup_interface() +ntb_setup_interface(void) { struct ifnet *ifp; struct ntb_queue_handlers handlers = { ntb_net_rx_handler, ntb_net_tx_handler, ntb_net_event_handler }; + int rc; net_softc.ntb = devclass_get_softc(devclass_find("ntb_hw"), 0); if (net_softc.ntb == NULL) { @@ -301,17 +409,23 @@ ntb_setup_interface() return (ENXIO); } - ntb_transport_init(net_softc.ntb); - ifp = net_softc.ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - printf("ntb: cannot allocate ifnet structure\n"); + ntb_transport_free(&net_softc); + printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } + if_initname(ifp, "ntb", 0); + + rc = ntb_transport_probe(net_softc.ntb); + if (rc != 0) { + printf("ntb: Cannot init transport: %d\n", rc); + if_free(net_softc.ifp); + return (rc); + } net_softc.qp = ntb_transport_create_queue(ifp, net_softc.ntb, &handlers); - if_initname(ifp, "ntb", 0); ifp->if_init = ntb_net_init; ifp->if_softc = &net_softc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; @@ -324,6 +438,8 @@ ntb_setup_interface() ether_ifattach(ifp, net_softc.eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; + ifp->if_mtu = ntb_transport_max_size(net_softc.qp) - ETHER_HDR_LEN - + ETHER_CRC_LEN; ntb_transport_link_up(net_softc.qp); net_softc.bufsize = ntb_transport_max_size(net_softc.qp) + @@ -332,20 +448,20 @@ ntb_setup_interface() } static int -ntb_teardown_interface() +ntb_teardown_interface(void) { - if (net_softc.qp != NULL) + if (net_softc.qp != NULL) { ntb_transport_link_down(net_softc.qp); + ntb_transport_free_queue(net_softc.qp); + ntb_transport_free(&net_softc); + } + if (net_softc.ifp != NULL) { ether_ifdetach(net_softc.ifp); if_free(net_softc.ifp); - } - - if (net_softc.qp != NULL) { - ntb_transport_free_queue(net_softc.qp); - ntb_transport_free(&net_softc); + net_softc.ifp = NULL; } return (0); @@ -356,7 +472,7 @@ ntb_teardown_interface() static void ntb_net_init(void *arg) { - struct ntb_netdev *ntb_softc = arg; + struct ntb_transport_ctx *ntb_softc = arg; struct ifnet *ifp = ntb_softc->ifp; ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -368,7 +484,7 @@ ntb_net_init(void *arg) static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { - struct ntb_netdev *nt = ifp->if_softc; + struct ntb_transport_ctx *nt = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int error = 0; @@ -397,7 +513,7 @@ static void ntb_start(struct ifnet *ifp) { struct mbuf *m_head; - struct ntb_netdev *nt = ifp->if_softc; + struct ntb_transport_ctx *nt = ifp->if_softc; int rc; mtx_lock(&nt->tx_lock); @@ -447,125 +563,199 @@ ntb_net_rx_handler(struct ntb_transport_ } static void -ntb_net_event_handler(void *data, int status) +ntb_net_event_handler(void *data, enum ntb_link_event status) { + struct ifnet *ifp; + + ifp = data; + (void)ifp; + + /* XXX The Linux driver munges with the carrier status here. */ + switch (status) { + case NTB_LINK_DOWN: + break; + case NTB_LINK_UP: + break; + default: + panic("Bogus ntb_link_event %u\n", status); + } } /* Transport Init and teardown */ +static void +xeon_link_watchdog_hb(void *arg) +{ + struct ntb_transport_ctx *nt; + + nt = arg; + ntb_spad_write(nt->ntb, IF_NTB_WATCHDOG_SPAD, 0); + callout_reset(&nt->link_watchdog, 1 * hz, xeon_link_watchdog_hb, nt); +} + static int -ntb_transport_init(struct ntb_softc *ntb) +ntb_transport_probe(struct ntb_softc *ntb) { - struct ntb_netdev *nt = &net_softc; - int rc, i; + struct ntb_transport_ctx *nt = &net_softc; + struct ntb_transport_mw *mw; + uint64_t qp_bitmap; + int rc; + unsigned i; + + nt->mw_count = ntb_mw_count(ntb); + for (i = 0; i < nt->mw_count; i++) { + mw = &nt->mw_vec[i]; + + rc = ntb_mw_get_range(ntb, i, &mw->phys_addr, &mw->vbase, + &mw->phys_size, &mw->xlat_align, &mw->xlat_align_size, + &mw->addr_limit); + if (rc != 0) + goto err; + + mw->buff_size = 0; + mw->xlat_size = 0; + mw->virt_addr = NULL; + mw->dma_addr = 0; + } + + qp_bitmap = ntb_db_valid_mask(ntb); + nt->qp_count = flsll(qp_bitmap); + KASSERT(nt->qp_count != 0, ("bogus db bitmap")); + nt->qp_count -= 1; + + if (max_num_clients != 0 && max_num_clients < nt->qp_count) + nt->qp_count = max_num_clients; + else if (nt->mw_count < nt->qp_count) + nt->qp_count = nt->mw_count; + KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); - nt->max_qps = max_num_clients; - ntb_register_transport(ntb, nt); mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); - nt->qps = malloc(nt->max_qps * sizeof(struct ntb_transport_qp), - M_NTB_IF, M_WAITOK|M_ZERO); - - nt->qp_bitmap = ((uint64_t) 1 << nt->max_qps) - 1; + nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_IF, + M_WAITOK | M_ZERO); - for (i = 0; i < nt->max_qps; i++) + for (i = 0; i < nt->qp_count; i++) { + set_bit(i, &nt->qp_bitmap); + set_bit(i, &nt->qp_bitmap_free); ntb_transport_init_queue(nt, i); + } callout_init(&nt->link_work, 0); + callout_init(&nt->link_watchdog, 0); + TASK_INIT(&nt->link_cleanup, 0, ntb_transport_link_cleanup_work, nt); - rc = ntb_register_event_callback(ntb, - ntb_transport_event_callback); + rc = ntb_set_ctx(ntb, nt, &ntb_transport_ops); if (rc != 0) goto err; - if (ntb_query_link_status(ntb)) { - if (bootverbose) - device_printf(ntb_get_device(ntb), "link up\n"); - callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); - } - + nt->link_is_up = false; + ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); + ntb_link_event(ntb); + + callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); + if (enable_xeon_watchdog != 0) + callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); return (0); err: - free(nt->qps, M_NTB_IF); - ntb_unregister_transport(ntb); + free(nt->qp_vec, M_NTB_IF); + nt->qp_vec = NULL; return (rc); } static void -ntb_transport_free(void *transport) +ntb_transport_free(struct ntb_transport_ctx *nt) { - struct ntb_netdev *nt = transport; struct ntb_softc *ntb = nt->ntb; - int i; - - nt->transport_link = NTB_LINK_DOWN; + struct _qpset qp_bitmap_alloc; + uint8_t i; + ntb_transport_link_cleanup(nt); + taskqueue_drain(taskqueue_swi, &nt->link_cleanup); callout_drain(&nt->link_work); + callout_drain(&nt->link_watchdog); - /* verify that all the qps are freed */ - for (i = 0; i < nt->max_qps; i++) - if (!test_bit(i, &nt->qp_bitmap)) - ntb_transport_free_queue(&nt->qps[i]); + BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); + BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); + /* Verify that all the QPs are freed */ + for (i = 0; i < nt->qp_count; i++) + if (test_bit(i, &qp_bitmap_alloc)) + ntb_transport_free_queue(&nt->qp_vec[i]); - ntb_unregister_event_callback(ntb); + ntb_link_disable(ntb); + ntb_clear_ctx(ntb); - for (i = 0; i < NTB_NUM_MW; i++) - if (nt->mw[i].virt_addr != NULL) - contigfree(nt->mw[i].virt_addr, nt->mw[i].size, - M_NTB_IF); + for (i = 0; i < nt->mw_count; i++) + ntb_free_mw(nt, i); - free(nt->qps, M_NTB_IF); - ntb_unregister_transport(ntb); + free(nt->qp_vec, M_NTB_IF); } static void -ntb_transport_init_queue(struct ntb_netdev *nt, unsigned int qp_num) +ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num) { + struct ntb_transport_mw *mw; struct ntb_transport_qp *qp; - unsigned int num_qps_mw, tx_size; - uint8_t mw_num = QP_TO_MW(qp_num); + vm_paddr_t mw_base; + uint64_t mw_size, qp_offset; + size_t tx_size; + unsigned num_qps_mw, mw_num, mw_count; + + mw_count = nt->mw_count; + mw_num = QP_TO_MW(nt, qp_num); + mw = &nt->mw_vec[mw_num]; - qp = &nt->qps[qp_num]; + qp = &nt->qp_vec[qp_num]; qp->qp_num = qp_num; qp->transport = nt; qp->ntb = nt->ntb; - qp->qp_link = NTB_LINK_DOWN; - qp->client_ready = NTB_LINK_DOWN; + qp->client_ready = false; qp->event_handler = NULL; + ntb_qp_link_down_reset(qp); - if (nt->max_qps % NTB_NUM_MW && mw_num < nt->max_qps % NTB_NUM_MW) - num_qps_mw = nt->max_qps / NTB_NUM_MW + 1; + if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) + num_qps_mw = nt->qp_count / mw_count + 1; else - num_qps_mw = nt->max_qps / NTB_NUM_MW; + num_qps_mw = nt->qp_count / mw_count; + + mw_base = mw->phys_addr; + mw_size = mw->phys_size; + + tx_size = mw_size / num_qps_mw; + qp_offset = tx_size * (qp_num / mw_count); + + qp->tx_mw = mw->vbase + qp_offset; + KASSERT(qp->tx_mw != NULL, ("uh oh?")); + + /* XXX Assumes that a vm_paddr_t is equivalent to bus_addr_t */ + qp->tx_mw_phys = mw_base + qp_offset; + KASSERT(qp->tx_mw_phys != 0, ("uh oh?")); - tx_size = (unsigned int) ntb_get_mw_size(qp->ntb, mw_num) / num_qps_mw; - qp->rx_info = (struct ntb_rx_info *) - ((char *)ntb_get_mw_vbase(qp->ntb, mw_num) + - (qp_num / NTB_NUM_MW * tx_size)); tx_size -= sizeof(struct ntb_rx_info); + qp->rx_info = (void *)(qp->tx_mw + tx_size); - qp->tx_mw = qp->rx_info + sizeof(struct ntb_rx_info); - qp->tx_max_frame = min(transport_mtu + sizeof(struct ntb_payload_header), - tx_size); + /* Due to house-keeping, there must be at least 2 buffs */ + qp->tx_max_frame = qmin(tx_size / 2, + transport_mtu + sizeof(struct ntb_payload_header)); qp->tx_max_entry = tx_size / qp->tx_max_frame; - qp->tx_index = 0; callout_init(&qp->link_work, 0); callout_init(&qp->queue_full, CALLOUT_MPSAFE); callout_init(&qp->rx_full, CALLOUT_MPSAFE); - mtx_init(&qp->ntb_rx_pend_q_lock, "ntb rx pend q", NULL, MTX_SPIN); - mtx_init(&qp->ntb_rx_free_q_lock, "ntb rx free q", NULL, MTX_SPIN); + mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); - TASK_INIT(&qp->rx_completion_task, 0, ntb_rx_completion_task, qp); + TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); + TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); + STAILQ_INIT(&qp->rx_post_q); STAILQ_INIT(&qp->rx_pend_q); - STAILQ_INIT(&qp->rx_free_q); STAILQ_INIT(&qp->tx_free_q); + + callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); } static void @@ -578,18 +768,25 @@ ntb_transport_free_queue(struct ntb_tran callout_drain(&qp->link_work); - ntb_unregister_db_callback(qp->ntb, qp->qp_num); + ntb_db_set_mask(qp->ntb, 1ull << qp->qp_num); + taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); + taskqueue_drain(taskqueue_swi, &qp->rx_completion_task); + + qp->cb_data = NULL; + qp->rx_handler = NULL; + qp->tx_handler = NULL; + qp->event_handler = NULL; - while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) + while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_pend_q))) free(entry, M_NTB_IF); - while ((entry = ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q))) + while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_post_q))) free(entry, M_NTB_IF); while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) free(entry, M_NTB_IF); - set_bit(qp->qp_num, &qp->transport->qp_bitmap); + set_bit(qp->qp_num, &qp->transport->qp_bitmap_free); } /** @@ -607,64 +804,48 @@ ntb_transport_free_queue(struct ntb_tran * RETURNS: pointer to newly created ntb_queue, NULL on error. */ static struct ntb_transport_qp * -ntb_transport_create_queue(void *data, struct ntb_softc *pdev, +ntb_transport_create_queue(void *data, struct ntb_softc *ntb, const struct ntb_queue_handlers *handlers) { struct ntb_queue_entry *entry; struct ntb_transport_qp *qp; - struct ntb_netdev *nt; + struct ntb_transport_ctx *nt; unsigned int free_queue; - int rc, i; + int i; - nt = ntb_find_transport(pdev); - if (nt == NULL) - goto err; + nt = ntb_get_ctx(ntb, NULL); + KASSERT(nt != NULL, ("bogus")); - free_queue = ffs(nt->qp_bitmap); + free_queue = ffs_bit(&nt->qp_bitmap); if (free_queue == 0) - goto err; + return (NULL); /* decrement free_queue to make it zero based */ free_queue--; - clear_bit(free_queue, &nt->qp_bitmap); - - qp = &nt->qps[free_queue]; + qp = &nt->qp_vec[free_queue]; + clear_bit(qp->qp_num, &nt->qp_bitmap_free); qp->cb_data = data; qp->rx_handler = handlers->rx_handler; qp->tx_handler = handlers->tx_handler; qp->event_handler = handlers->event_handler; for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, - M_WAITOK|M_ZERO); + entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); entry->cb_data = nt->ifp; entry->buf = NULL; entry->len = transport_mtu; - ntb_list_add(&qp->ntb_rx_pend_q_lock, entry, &qp->rx_pend_q); + ntb_list_add(&qp->ntb_rx_q_lock, entry, &qp->rx_pend_q); } for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, - M_WAITOK|M_ZERO); + entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); } - rc = ntb_register_db_callback(qp->ntb, free_queue, qp, - ntb_transport_rxc_db); - if (rc != 0) - goto err1; - + ntb_db_clear(ntb, 1ull << qp->qp_num); + ntb_db_clear_mask(ntb, 1ull << qp->qp_num); return (qp); - -err1: - while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) - free(entry, M_NTB_IF); - while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) - free(entry, M_NTB_IF); - set_bit(free_queue, &nt->qp_bitmap); -err: - return (NULL); } /** @@ -676,15 +857,17 @@ err: static void ntb_transport_link_up(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt; if (qp == NULL) return; - qp->client_ready = NTB_LINK_UP; - if (bootverbose) - device_printf(ntb_get_device(qp->ntb), "qp client ready\n"); + qp->client_ready = true; + + nt = qp->transport; + ntb_printf(2, "qp client ready\n"); - if (qp->transport->transport_link == NTB_LINK_UP) + if (qp->transport->link_is_up) callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); } @@ -700,7 +883,7 @@ ntb_transport_link_up(struct ntb_transpo * @len: length of the data buffer * * Enqueue a new transmit buffer onto the transport queue from which a NTB - * payload will be transmitted. This assumes that a lock is behing held to + * payload will be transmitted. This assumes that a lock is being held to * serialize access to the qp. * * RETURNS: An appropriate ERRNO error value on error, or zero for success. @@ -712,7 +895,7 @@ ntb_transport_tx_enqueue(struct ntb_tran struct ntb_queue_entry *entry; int rc; - if (qp == NULL || qp->qp_link != NTB_LINK_UP || len == 0) { + if (qp == NULL || !qp->link_is_up || len == 0) { CTR0(KTR_NTB, "TX: link not up"); return (EINVAL); } @@ -720,7 +903,8 @@ ntb_transport_tx_enqueue(struct ntb_tran entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); if (entry == NULL) { CTR0(KTR_NTB, "TX: could not get entry from tx_free_q"); - return (ENOMEM); + qp->tx_err_no_buf++; + return (EBUSY); } CTR1(KTR_NTB, "TX: got entry %p from tx_free_q", entry); @@ -744,9 +928,9 @@ ntb_process_tx(struct ntb_transport_qp * { void *offset; - offset = (char *)qp->tx_mw + qp->tx_max_frame * qp->tx_index; + offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; CTR3(KTR_NTB, - "TX: process_tx: tx_pkts=%u, tx_index=%u, remote entry=%u", + "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); if (qp->tx_index == qp->remote_rx_info->entry) { CTR0(KTR_NTB, "TX: ring full"); @@ -757,8 +941,11 @@ ntb_process_tx(struct ntb_transport_qp * if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { if (qp->tx_handler != NULL) qp->tx_handler(qp, qp->cb_data, entry->buf, - EIO); + EIO); + else + m_freem(entry->buf); + entry->buf = NULL; ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); CTR1(KTR_NTB, "TX: frame too big. returning entry %p to tx_free_q", @@ -766,7 +953,7 @@ ntb_process_tx(struct ntb_transport_qp * return (0); } CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); - ntb_tx_copy_task(qp, entry, offset); + ntb_memcpy_tx(qp, entry, offset); qp->tx_index++; qp->tx_index %= qp->tx_max_entry; @@ -777,26 +964,37 @@ ntb_process_tx(struct ntb_transport_qp * } static void -ntb_tx_copy_task(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, +ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, void *offset) { struct ntb_payload_header *hdr; + /* This piece is from Linux' ntb_async_tx() */ + hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - + sizeof(struct ntb_payload_header)); + entry->x_hdr = hdr; + iowrite32(entry->len, &hdr->len); + iowrite32(qp->tx_pkts, &hdr->ver); + + /* This piece is ntb_memcpy_tx() */ CTR2(KTR_NTB, "TX: copying %d bytes to offset %p", entry->len, offset); - if (entry->buf != NULL) + if (entry->buf != NULL) { m_copydata((struct mbuf *)entry->buf, 0, entry->len, offset); - hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - - sizeof(struct ntb_payload_header)); - hdr->len = entry->len; /* TODO: replace with bus_space_write */ - hdr->ver = qp->tx_pkts; /* TODO: replace with bus_space_write */ - wmb(); - /* TODO: replace with bus_space_write */ - hdr->flags = entry->flags | IF_NTB_DESC_DONE_FLAG; + /* + * Ensure that the data is fully copied before setting the + * flags + */ + wmb(); + } - ntb_ring_sdb(qp->ntb, qp->qp_num); + /* The rest is ntb_tx_copy_callback() */ + iowrite32(entry->flags | IF_NTB_DESC_DONE_FLAG, &hdr->flags); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 21 15:38:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3A23B44F1A; Sat, 21 May 2016 15:38:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85F7E1F71; Sat, 21 May 2016 15:38:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LFcelS089197; Sat, 21 May 2016 15:38:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LFceJ8089194; Sat, 21 May 2016 15:38:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605211538.u4LFceJ8089194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 21 May 2016 15:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300374 - in head/contrib/elftoolchain: brandelf elfcopy readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 15:38:41 -0000 Author: emaste Date: Sat May 21 15:38:40 2016 New Revision: 300374 URL: https://svnweb.freebsd.org/changeset/base/300374 Log: elftoolchain: backwards compatability for ELFOSABI_CLOUDABI definition It is not provided by sys/elf_common.h on older releases or -current before March 2015. Reported by: Jenkins Modified: head/contrib/elftoolchain/brandelf/brandelf.c head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/brandelf/brandelf.c ============================================================================== --- head/contrib/elftoolchain/brandelf/brandelf.c Sat May 21 15:15:11 2016 (r300373) +++ head/contrib/elftoolchain/brandelf/brandelf.c Sat May 21 15:38:40 2016 (r300374) @@ -46,6 +46,11 @@ ELFTC_VCSID("$Id: brandelf.c 3440 2016-04-07 14:51:47Z emaste $"); +/* Backwards compatability for older FreeBSD releases. */ +#ifndef ELFOSABI_CLOUDABI +#define ELFOSABI_CLOUDABI 17 +#endif + static int elftype(const char *); static const char *iselftype(int); static void printelftypes(void); Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Sat May 21 15:15:11 2016 (r300373) +++ head/contrib/elftoolchain/elfcopy/main.c Sat May 21 15:38:40 2016 (r300374) @@ -41,6 +41,11 @@ ELFTC_VCSID("$Id: main.c 3446 2016-05-03 01:31:17Z emaste $"); +/* Backwards compatability for older FreeBSD releases. */ +#ifndef ELFOSABI_CLOUDABI +#define ELFOSABI_CLOUDABI 17 +#endif + enum options { ECP_ADD_GNU_DEBUGLINK, Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Sat May 21 15:15:11 2016 (r300373) +++ head/contrib/elftoolchain/readelf/readelf.c Sat May 21 15:38:40 2016 (r300374) @@ -50,6 +50,9 @@ ELFTC_VCSID("$Id: readelf.c 3469 2016-05-15 23:16:09Z emaste $"); /* Backwards compatability for older FreeBSD releases. */ +#ifndef ELFOSABI_CLOUDABI +#define ELFOSABI_CLOUDABI 17 +#endif #ifndef EM_IAMCU #define EM_IAMCU 6 #endif From owner-svn-src-all@freebsd.org Sat May 21 16:52:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 093A2B45A4E; Sat, 21 May 2016 16:52:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3B311E0A; Sat, 21 May 2016 16:52:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LGqcFP013157; Sat, 21 May 2016 16:52:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LGqcnw013156; Sat, 21 May 2016 16:52:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605211652.u4LGqcnw013156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 21 May 2016 16:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300375 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 16:52:40 -0000 Author: ian Date: Sat May 21 16:52:38 2016 New Revision: 300375 URL: https://svnweb.freebsd.org/changeset/base/300375 Log: Adjust _ALIGNBYTES to the proper value for arm and armv6 arches. Modern compilers can emit arm instructions that require 8-byte alignment. The alignment-sensitive instructions were added in armv5, which has to be supported by our combined v4/v5 kernels, so the value is set uncoditionally for all arm architecture versions. Also adjust the comment to explain in more detail why the macros have the form and values they do. Per advice from bde@, maintain the unsignedness of the value of _ALIGNBYTES (but do so using his second choice of allowing sizeof() to supply the unsignedness, rather than just hardcoding '8U', which in my mind would require an even more verbose comment to explain why it's right). Also explain in the comment that the resulting type of _ALIGN() is equivelent to uinptr_t on arm (32-bit unsigned int), but it's purposely spelled as "unsigned" to avoid problems with including other header files. Even including machine/_types.h to allow use of __uintptr_t causes compilation failures because of this header being included (indirectly) in asm code. The discussion that led to this change (albeit at a glacial pace) is at https://lists.freebsd.org/pipermail/svn-src-head/2014-November/064593.html Modified: head/sys/arm/include/_align.h Modified: head/sys/arm/include/_align.h ============================================================================== --- head/sys/arm/include/_align.h Sat May 21 15:38:40 2016 (r300374) +++ head/sys/arm/include/_align.h Sat May 21 16:52:38 2016 (r300375) @@ -42,11 +42,11 @@ #define _ARM_INCLUDE__ALIGN_H_ /* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. + * Round p (pointer or byte index) up to the hardware-required alignment which + * is sufficient for any data type, pointer or numeric. The resulting type + * is equivelent to arm's uintptr_t (but is purposely spelled "unsigned" here). */ -#define _ALIGNBYTES (sizeof(int) - 1) +#define _ALIGNBYTES (sizeof(long long) - 1) #define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #endif /* !_ARM_INCLUDE__ALIGN_H_ */ From owner-svn-src-all@freebsd.org Sat May 21 17:02:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7768DB45D7D; Sat, 21 May 2016 17:02:02 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:c:538::195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 452FF130B; Sat, 21 May 2016 17:02:02 +0000 (UTC) (envelope-from joerg@bec.de) Received: from britannica.bec.de (p20030057E21176042D1EC8DE0DC53AE2.dip0.t-ipconnect.de [IPv6:2003:57:e211:7604:2d1e:c8de:dc5:3ae2]) (Authenticated sender: joerg@bec.de) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id E8986A80C8; Sat, 21 May 2016 19:01:58 +0200 (CEST) Date: Sat, 21 May 2016 19:01:56 +0200 From: Joerg Sonnenberger To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300375 - head/sys/arm/include Message-ID: <20160521170156.GA28128@britannica.bec.de> References: <201605211652.u4LGqcnw013156@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605211652.u4LGqcnw013156@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 17:02:02 -0000 On Sat, May 21, 2016 at 04:52:38PM +0000, Ian Lepore wrote: > Author: ian > Date: Sat May 21 16:52:38 2016 > New Revision: 300375 > URL: https://svnweb.freebsd.org/changeset/base/300375 > > Log: > Adjust _ALIGNBYTES to the proper value for arm and armv6 arches. Modern > compilers can emit arm instructions that require 8-byte alignment. The > alignment-sensitive instructions were added in armv5, which has to be > supported by our combined v4/v5 kernels, so the value is set uncoditionally > for all arm architecture versions. Doesn't this change effectively break the ABI of CMSG? Joerg From owner-svn-src-all@freebsd.org Sat May 21 17:09:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D98B45E27; Sat, 21 May 2016 17:09:46 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (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 3143C172F; Sat, 21 May 2016 17:09:46 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-it0-x233.google.com with SMTP id z189so8641573itg.0; Sat, 21 May 2016 10:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=hHc8eKKcLxN5pM+tLg2eOT/TvJ0/qIp6pZPgg4VRlzQ=; b=gONYLqIOH56IsijVsihnyOHUlKpnADF8Csey7Mt2XUtE4d3UkQuchALmsqhXuszjuR JKJdpuakQl2UAERGONtu61bg/TehIskjCxiOQLh4jY4liu3+j5ukC8ZiMpkaNUWoCEjq YZzJHaUeA1Vlz8k5sQ5KkXz80W0POvP21JdhzB/UoYJDpErEqWaOQ96mGDUsD2GlcmIY /IfpcHTLDoQatkwhNSWruwcTG2Su//Xc8v3gCB4r2ykyU+RsQo7A2Ew9nIT+XPkfiL/U 0SOS9VkBSrAnuUTwfqUpRQ5NzOtYmeNPrjjYr2Lw+oisn08nGsnATEiM/ThxjyUQ3Fxq W77A== 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:date :message-id:subject:from:to:cc; bh=hHc8eKKcLxN5pM+tLg2eOT/TvJ0/qIp6pZPgg4VRlzQ=; b=E4gzoMwEhv3hLYjIPe3oFVa/d2bz732U/MgrCC+c5aZchH3FBF047GfmhS8wzP/mBE s3YJ0BPt1P6b634LyHZ2M/1cKc7rUwnshF05WrdejHRWxIJHi9Y0gnYkEFAp8hjGXAFo Kr36+WD+cAakbyMGZLItgwrEndgmfHxZvRfvLhuG43pLBaCo2xkn2RvBp1KlK35RIxU/ J+NDzoIGZgvoffsAIuX9j3JG5OxalHLvXvtbgB7RNMx98ASjNUWfsQBUR76s7D+VmMKd itHNNYtbRXnSNpj6ZThwf136gzThtfLuj+sla4A/FyPSz0lEdOgEzdnGdRkU/cSKS7JB nsqw== X-Gm-Message-State: AOPr4FXKhXlMRw8FPpoD6Z1WsRJD5xgKXaMCJ/rH6QdOkSeXZcLfz7b8ZlpmPxE5kVHdZlNF9kRXPWFujmfLlQ== MIME-Version: 1.0 X-Received: by 10.36.44.200 with SMTP id i191mr6632603iti.99.1463850585081; Sat, 21 May 2016 10:09:45 -0700 (PDT) Sender: kmacybsd@gmail.com Received: by 10.107.140.8 with HTTP; Sat, 21 May 2016 10:09:45 -0700 (PDT) In-Reply-To: <5629da57-1b67-9225-ede3-7e5e18c69b82@selasky.org> References: <201605180435.u4I4ZwYh025096@repo.freebsd.org> <5629da57-1b67-9225-ede3-7e5e18c69b82@selasky.org> Date: Sat, 21 May 2016 10:09:45 -0700 X-Google-Sender-Auth: wPkHNQNIjt2dZGH2jMFMFr2GoQk Message-ID: Subject: Re: svn commit: r300113 - in head/sys: conf kern net sys From: "K. Macy" To: Hans Petter Selasky Cc: Scott Long , "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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 17:09:46 -0000 On Sat, May 21, 2016 at 3:36 AM, Hans Petter Selasky wrote: > On 05/18/16 06:35, Scott Long wrote: >> >> Author: scottl >> Date: Wed May 18 04:35:58 2016 >> New Revision: 300113 >> URL: https://svnweb.freebsd.org/changeset/base/300113 >> >> Log: >> Import the 'iflib' API library for network drivers. From the author: >> >> "iflib is a library to eliminate the need for frequently duplicated >> device >> independent logic propagated (poorly) across many network drivers." >> >> Participation is purely optional. The IFLIB kernel config option is >> provided for drivers that want to transition between legacy and iflib >> modes of operation. ixl and ixgbe driver conversions will be committed >> shortly. We hope to see participation from the Broadcom and maybe >> Chelsio drivers in the near future. >> >> Submitted by: mmacy@nextbsd.org >> Reviewed by: gallatin >> Differential Revision: D5211 >> >> Added: >> head/sys/net/ifdi_if.m (contents, props changed) >> head/sys/net/iflib.c (contents, props changed) >> head/sys/net/iflib.h (contents, props changed) >> head/sys/net/mp_ring.c (contents, props changed) >> head/sys/net/mp_ring.h (contents, props changed) >> Modified: >> head/sys/conf/files >> head/sys/conf/options >> head/sys/kern/device_if.m >> head/sys/kern/kern_mbuf.c >> head/sys/kern/subr_taskqueue.c >> head/sys/net/if.c >> head/sys/net/if_var.h >> head/sys/sys/_task.h >> head/sys/sys/mbuf.h >> head/sys/sys/taskqueue.h >> > > Hi, > > Possibly the taskqueue related changes should have been broken out into a > separate commit, hence they are not related to "iflib". > > --HPS Yes. -M From owner-svn-src-all@freebsd.org Sat May 21 17:18:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCE86B43019 for ; Sat, 21 May 2016 17:18:06 +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 9DB521DA1 for ; Sat, 21 May 2016 17:18:06 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0d690d4d-1f78-11e6-a09e-4d61a6885157 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sat, 21 May 2016 17:18:35 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4LHI3QL061174; Sat, 21 May 2016 11:18:03 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463851083.1180.381.camel@freebsd.org> Subject: Re: svn commit: r300375 - head/sys/arm/include From: Ian Lepore To: Joerg Sonnenberger Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "freebsd-arm@FreeBSD.org" Date: Sat, 21 May 2016 11:18:03 -0600 In-Reply-To: <20160521170156.GA28128@britannica.bec.de> References: <201605211652.u4LGqcnw013156@repo.freebsd.org> <20160521170156.GA28128@britannica.bec.de> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 17:18:06 -0000 freebsd-arm@ added to cc list. On Sat, 2016-05-21 at 19:01 +0200, Joerg Sonnenberger wrote: > On Sat, May 21, 2016 at 04:52:38PM +0000, Ian Lepore wrote: > > Author: ian > > Date: Sat May 21 16:52:38 2016 > > New Revision: 300375 > > URL: https://svnweb.freebsd.org/changeset/base/300375 > > > > Log: > > Adjust _ALIGNBYTES to the proper value for arm and armv6 arches. Modern > > compilers can emit arm instructions that require 8-byte alignment. The > > alignment-sensitive instructions were added in armv5, which has to be > > supported by our combined v4/v5 kernels, so the value is set uncoditionally > > for all arm architecture versions. > > Doesn't this change effectively break the ABI of CMSG? > > Joerg > Yep, it sure enough potentially does so. Although I didn't find any actual breakage in testing base-system stuff, it potentially could cause problems for some ports. But ports and packages and everybody's armv6 kernel and world already need recompiling because of the recent soft/hardfloat change, so if this problem was ever going to get corrected, now is the time to do it (especially before freebsd 11 is released, and before arm moves to being a tier-1 platform with the strong ABI guarantees that come with that). I think this week before the code freeze is going to be a bit of rough sailing in the arm waters. It really is our last chance to make a few disruptive changes; if we don't get them done soon, we live with our mistakes forever after. -- Ian From owner-svn-src-all@freebsd.org Sat May 21 17:38:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29692B4337C; Sat, 21 May 2016 17:38: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 EFF0C14C6; Sat, 21 May 2016 17:38: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 u4LHciic025149; Sat, 21 May 2016 17:38:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LHciji025148; Sat, 21 May 2016 17:38:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605211738.u4LHciji025148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 21 May 2016 17:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300376 - head/sys/compat/ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 17:38:45 -0000 Author: pfg Date: Sat May 21 17:38:43 2016 New Revision: 300376 URL: https://svnweb.freebsd.org/changeset/base/300376 Log: ndis(4): Better mimic the behavior of rand() on Windows. In ndis(4) we expose a rand() function that was constantly reseeding with a time depending function every time it was called. This essentially broke the reasoning behind seeding, and rendered srand() a no-op. Keep it simple, just use random() and srandom() as it's meant to work. It would have been tempting to just go for arc4random() but we want to mimic Microsoft, and we don't need crypto-grade randomness here. PR: 209616 MFC after: 2 weeks Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 16:52:38 2016 (r300375) +++ head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 17:38:43 2016 (r300376) @@ -3188,17 +3188,14 @@ atol(str) static int rand(void) { - struct timeval tv; - microtime(&tv); - srandom(tv.tv_usec); - return ((int)random()); + return (random()); } static void -srand(seed) - unsigned int seed; +srand(unsigned int seed) { + srandom(seed); } From owner-svn-src-all@freebsd.org Sat May 21 17:52:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9166B4398E; Sat, 21 May 2016 17:52: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 AB48F1077; Sat, 21 May 2016 17:52:45 +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 u4LHqiZZ031458; Sat, 21 May 2016 17:52:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LHqiHQ031457; Sat, 21 May 2016 17:52:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605211752.u4LHqiHQ031457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 21 May 2016 17:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300377 - head/sys/compat/ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 17:52:45 -0000 Author: pfg Date: Sat May 21 17:52:44 2016 New Revision: 300377 URL: https://svnweb.freebsd.org/changeset/base/300377 Log: ndis(4): Avoid overflow. This is a long standing problem: our random() function returns an unsigned integer but the rand provided by ndis(4) returns an int. Scale it down. MFC after: 2 weeks Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 17:38:43 2016 (r300376) +++ head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 17:52:44 2016 (r300377) @@ -3189,7 +3189,7 @@ static int rand(void) { - return (random()); + return (random() / 2 + 1); } static void From owner-svn-src-all@freebsd.org Sat May 21 19:12:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6785FB44915; Sat, 21 May 2016 19:12:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (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 2820611B7; Sat, 21 May 2016 19:12:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f180.google.com with SMTP id 190so170920399iow.1; Sat, 21 May 2016 12:12:32 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=HO1F7Wzh6QDlNM85QJ6HIFekm7hIRPy6G3vqMXr+qcQ=; b=LX6t/QTQLzWgEboPenGrKPhWO4t8WbCuMWyHoI3XsbiC23ITUQbjPcPwqMmLOp0hsv J1Zv15O4NGyA3VxquqYfnOx+4428rB481UGroUhM+4xiM02nO7bSuGb16UDNIqISjQz9 eJdVivuqdKHY40/eV5WCYehwNKN5gazIbAC0uoJU9owupHXwtMcd+SiBY6z2XNAuzmtf eaFyzECjzdNaXI/VSnMVQSfA0xnikQlK1IqwqhCnO5DVkGX+vPk/kvkVcXNA+72i11O9 hN1ns3/vHmaMjRD2+Hn0JuXPJMr7p2u0JiNY2bMoQYMQ3Q2reP1gWWdXQDF7K43GsXwP b5hA== X-Gm-Message-State: ALyK8tJCVh71ddqR1ax2N9sXWLEJP4wutx0tdNFk58pPvv7ruxeGaifMTwUtRO9GL2/uPA== X-Received: by 10.107.19.11 with SMTP id b11mr1530169ioj.57.1463857557481; Sat, 21 May 2016 12:05:57 -0700 (PDT) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id b67sm7731818iob.33.2016.05.21.12.05.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 May 2016 12:05:57 -0700 (PDT) Received: by mail-it0-f46.google.com with SMTP id l63so10406815ita.1; Sat, 21 May 2016 12:05:57 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.36.81.209 with SMTP id s200mr7635838ita.34.1463857556974; Sat, 21 May 2016 12:05:56 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Sat, 21 May 2016 12:05:56 -0700 (PDT) In-Reply-To: <201605211752.u4LHqiHQ031457@repo.freebsd.org> References: <201605211752.u4LHqiHQ031457@repo.freebsd.org> Date: Sat, 21 May 2016 12:05:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300377 - head/sys/compat/ndis From: Conrad Meyer To: "Pedro F. Giffuni" 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 19:12:33 -0000 On Sat, May 21, 2016 at 10:52 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat May 21 17:52:44 2016 > New Revision: 300377 > URL: https://svnweb.freebsd.org/changeset/base/300377 > > Log: > ndis(4): Avoid overflow. > > This is a long standing problem: our random() function returns an > unsigned integer but the rand provided by ndis(4) returns an int. > Scale it down. > > MFC after: 2 weeks > > Modified: > head/sys/compat/ndis/subr_ntoskrnl.c > > Modified: head/sys/compat/ndis/subr_ntoskrnl.c > ============================================================================== > --- head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 17:38:43 2016 (r300376) > +++ head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 17:52:44 2016 (r300377) > @@ -3189,7 +3189,7 @@ static int > rand(void) > { > > - return (random()); > + return (random() / 2 + 1); > } > > static void > Won't this still return a negative integer in many cases? random(9) returns u_long, whereas this rand() routine returns 'int'. Even on architectures where long is the same size as ordinary integers, the range of possible results of the 'random() / 2 + 1' expression, before implicit cast to signed, is [1, 2^31] (inclusive). 2^31 is not representable by typical signed 32-bit integers, so this will wrap to INT_MIN. Also, I'm not sure why zero is excluded from the range. On architectures where long is larger than ordinary integers, this expression has no hope of fitting in the non-negative range of a signed integer. Why not instead: return ((u_int)random() / 2); Best, Conrad From owner-svn-src-all@freebsd.org Sat May 21 19:54:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F606B452C0; Sat, 21 May 2016 19:54:11 +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 52034178D; Sat, 21 May 2016 19:54:11 +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 u4LJsADO067666; Sat, 21 May 2016 19:54:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LJsA5j067665; Sat, 21 May 2016 19:54:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605211954.u4LJsA5j067665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 21 May 2016 19:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300378 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 19:54:11 -0000 Author: pfg Date: Sat May 21 19:54:10 2016 New Revision: 300378 URL: https://svnweb.freebsd.org/changeset/base/300378 Log: libc/regex: fix two buffer underruns. Fix some rather complex regex issues found on OpenBSD as part of some ongoing work to fix a sed(1) bug. Curiously the OpenBSD tests don't trigger segfaults on FreeBSD but the bugs were confirmed by running a port of FreeBSD's regex under OpenBSD's malloc. Huge thanks to Ingo for confirming the behavior. Taken from: Ingo Schwarze (through openbsd-tech 2016-05-15) MFC after: 1 week Modified: head/lib/libc/regex/engine.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Sat May 21 17:52:44 2016 (r300377) +++ head/lib/libc/regex/engine.c Sat May 21 19:54:10 2016 (r300378) @@ -606,9 +606,9 @@ backref(struct match *m, return(NULL); break; case OBOL: - if ( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) ) + if ((sp == m->beginp && !(m->eflags®_NOTBOL)) || + (sp > m->offp && sp < m->endp && + *(sp-1) == '\n' && (m->g->cflags®_NEWLINE))) { /* yes */ } else return(NULL); @@ -622,12 +622,9 @@ backref(struct match *m, return(NULL); break; case OBOW: - if (( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp > m->beginp && - !ISWORD(*(sp-1))) ) && - (sp < m->endp && ISWORD(*sp)) ) + if (sp < m->endp && ISWORD(*sp) && + ((sp == m->beginp && !(m->eflags®_NOTBOL)) || + (sp > m->offp && !ISWORD(*(sp-1))))) { /* yes */ } else return(NULL); From owner-svn-src-all@freebsd.org Sat May 21 20:40:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29403B45C99 for ; Sat, 21 May 2016 20:40:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm18-vm0.bullet.mail.bf1.yahoo.com (nm18-vm0.bullet.mail.bf1.yahoo.com [98.139.213.138]) (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 D22BB1C6D for ; Sat, 21 May 2016 20:40:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463863205; bh=brRxa9SzH+4GCNiO7tNzyJdUgBX+DwAsfT0B5TO6Oho=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=hWAUI/RGwHT3MdQZ9zsVk+mDtQH2odpFniFdBzEHS4Xua2S/m7c1S4gKblR8w4e9T7Kg85acLiKuPlrv+dkkNi6TZsT8cgRtlOWOmveXTalrK4L2a8x/kIeaVlJBKZ6aV+KpaGL73e/z0h2WM7DGBrDObpNa1gnnCrsIz8YKMZgNSdQ62ch6WmXh+nPnjwd1DE4Dd86yaeExpSrOLCVkqTHMjXXwhZdickge3rT8Pf8AOMEw73vHBq1m8n3hu7mtJyFmhMEBZrl38a+N6wJjrxLF7kUdgNX/jcfuVE+a/DcmWhBCuJthzaNJ9+nOdjvVh6OaGD5JmY1SSiNnC6rrPg== Received: from [98.139.215.140] by nm18.bullet.mail.bf1.yahoo.com with NNFMP; 21 May 2016 20:40:05 -0000 Received: from [98.139.213.15] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 21 May 2016 20:40:05 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 21 May 2016 20:40:05 -0000 X-Yahoo-Newman-Id: 900308.53108.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: kEYCJZkVM1lYYfyUthZL1o.GrFpVGj30AMjrJ7FMQIzOQrP 7pfTSEKsNyF5CqKbvGBeOa1D5v09YxufVpr3Gizj6lsOnj1Tgz7JFuPWvGAW wjrkhtEbq3QSM0gq4c6SE03W5_oamLU9OL9zZWf2cv9Jl4OoI_3HTp15E9H2 nEmtIXbbhfXyY0nB5tOnE0Vb2PsKJSYkxdH5oUg.5WxvLlNT8ptN_qg3UOSP NIEYxEyytnTZpLZZyOiunNOzSjtIb.nRQF4PpyXBa3B66IiUHwTRvcA2_yfa FD3d41eDsSRDnQzYLFmLYdX8glln6ZtbC7AYKMY5N8mud1EL.bySNHWVoKPx dvqNJ8NTcyB3W0BLZW8Qdv5j53BcB5whN3YoYxM6tGXkLr2uNcssxf0fsYws UuWrCbKVnt15jbwldBZWnhz5TJ3cIoymY4orQIpPpM.aD9OSR6LaeLQYZmmt grBNs9SHER9zyxRlaIGFA48YSBwuv6Wt8rQbRDu0OeUyKPNEmNHVInvysHqF WvMLAXeVqAArE2gxQBUwWEzxYpabczxcm X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300377 - head/sys/compat/ndis To: cem@FreeBSD.org References: <201605211752.u4LHqiHQ031457@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: Date: Sat, 21 May 2016 15:40:00 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 20:40:15 -0000 On 05/21/16 14:05, Conrad Meyer wrote: > On Sat, May 21, 2016 at 10:52 AM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Sat May 21 17:52:44 2016 >> New Revision: 300377 >> URL: https://svnweb.freebsd.org/changeset/base/300377 >> >> Log: >> ndis(4): Avoid overflow. >> >> This is a long standing problem: our random() function returns an >> unsigned integer but the rand provided by ndis(4) returns an int. >> Scale it down. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/compat/ndis/subr_ntoskrnl.c >> >> Modified: head/sys/compat/ndis/subr_ntoskrnl.c >> ============================================================================== >> --- head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 17:38:43 2016 (r300376) >> +++ head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 17:52:44 2016 (r300377) >> @@ -3189,7 +3189,7 @@ static int >> rand(void) >> { >> >> - return (random()); >> + return (random() / 2 + 1); >> } >> >> static void >> > > > Won't this still return a negative integer in many cases? > > random(9) returns u_long, whereas this rand() routine returns 'int'. > > Even on architectures where long is the same size as ordinary > integers, the range of possible results of the 'random() / 2 + 1' > expression, before implicit cast to signed, is [1, 2^31] (inclusive). According to: sys/libkern/random.c The result is uniform on [0, 2^31 - 1]. > 2^31 is not representable by typical signed 32-bit integers, so this > will wrap to INT_MIN. Also, I'm not sure why zero is excluded from > the range. > It is not a good reason but the zero is sometimes inconvenient: if the value is going to be used as a multiplier in some calculation it will basically kill the random component. > On architectures where long is larger than ordinary integers, this > expression has no hope of fitting in the non-negative range of a > signed integer. > > Why not instead: > > return ((u_int)random() / 2); > TBH, I have seen the same conversion formula over and over and I just repeated it, so I am glad you are asking the question. Hopefully some else has a better answer? ;). Pedro. Pedro. > Best, > Conrad > From owner-svn-src-all@freebsd.org Sat May 21 20:50:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22608B45EF4; Sat, 21 May 2016 20:50:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E31EA119F; Sat, 21 May 2016 20:50:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LKoQYm082955; Sat, 21 May 2016 20:50:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LKoQPG082954; Sat, 21 May 2016 20:50:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605212050.u4LKoQPG082954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 21 May 2016 20:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300379 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 20:50:27 -0000 Author: rmacklem Date: Sat May 21 20:50:25 2016 New Revision: 300379 URL: https://svnweb.freebsd.org/changeset/base/300379 Log: MFC: r299226 Don't increment srvrpccnt[] for the NFSv4.1 operations. When support for NFSv4.1 was added to the NFS server, it broke the server rpc count stats, since newnfsstats.srvrpccnt[] doesn't have entries for the new NFSv4.1 operations. Without this patch, the code was incrementing bogus entries in newnfsstats for the new NFSv4.1 operations. This patch is an interim fix. The nfsstats structure needs to be updated and that will come in a future commit. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat May 21 19:54:10 2016 (r300378) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat May 21 20:50:25 2016 (r300379) @@ -771,7 +771,12 @@ nfsrvd_compound(struct nfsrv_descript *n } if (nfsv4_opflag[op].savereply) nd->nd_flag |= ND_SAVEREPLY; - NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]); + /* + * For now, newnfsstats.srvrpccnt[] doesn't have entries + * for the NFSv4.1 operations. + */ + if (nd->nd_procnum < NFSV4OP_NOPS) + NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]); switch (op) { case NFSV4OP_PUTFH: error = nfsrv_mtofh(nd, &fh); From owner-svn-src-all@freebsd.org Sat May 21 22:02:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91375B44C3C; Sat, 21 May 2016 22:02:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) (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 656521FCD; Sat, 21 May 2016 22:02:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ig0-f179.google.com with SMTP id fh2so7935141igd.1; Sat, 21 May 2016 15:02:12 -0700 (PDT) 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 :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=d34pICmjj+pJXNgefPcHZ6LJ7QW64lec4T3A/La27qQ=; b=LZHAkIDBrL4ysUBp7OZesdg9uQf9xPsW2ruSJJMJslMcJQf0ENLmp9VdSVGtmS7RWR y7hV41NM9GSrDDraePnsvYCRZ0DAf+GEcZR4KxSP/0PpPSqFBayQcbM+Z6p48igsyy3y MC/6IqSYNawCbx6YD3qc7O/D2uo/ME2XCIE5BpZmqF8CApwCoqw9F9VX9cnkZ+rppBEa nE+uxYwgkukYBO+lzBDOl0dX4Z06h/HpydrktnaQDTfl1SVQVFlq5BBPB0F1sjiAqxcz OLKKuFUzIuF/9+7dva0GqOd35u/P7dPFjWiRDpLsDpSCfwGIv7T7gHqSYbQ9RN9o+jnl ob9A== X-Gm-Message-State: AOPr4FVJUbEOnNcDk14C7V2jWTdBqxFn5LnfkYZAxaQWefCSyGuS0bT0KHuy8P7P34peeg== X-Received: by 10.50.8.2 with SMTP id n2mr7712341iga.39.1463867718138; Sat, 21 May 2016 14:55:18 -0700 (PDT) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com. [209.85.223.173]) by smtp.gmail.com with ESMTPSA id 11sm7827250ioe.25.2016.05.21.14.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 May 2016 14:55:18 -0700 (PDT) Received: by mail-io0-f173.google.com with SMTP id p64so80673884ioi.2; Sat, 21 May 2016 14:55:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.38.79 with SMTP id m76mr8777230iom.7.1463867717430; Sat, 21 May 2016 14:55:17 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Sat, 21 May 2016 14:55:17 -0700 (PDT) In-Reply-To: References: <201605211752.u4LHqiHQ031457@repo.freebsd.org> Date: Sat, 21 May 2016 14:55:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300377 - head/sys/compat/ndis From: Conrad Meyer To: Pedro Giffuni Cc: src-committers@freebsd.org, 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 22:02:12 -0000 On Sat, May 21, 2016 at 1:40 PM, Pedro Giffuni wrote: > > > On 05/21/16 14:05, Conrad Meyer wrote: >> Won't this still return a negative integer in many cases? >> >> random(9) returns u_long, whereas this rand() routine returns 'int'. >> >> Even on architectures where long is the same size as ordinary >> integers, the range of possible results of the 'random() / 2 + 1' >> expression, before implicit cast to signed, is [1, 2^31] (inclusive). > > > According to: > sys/libkern/random.c > > The result is uniform on [0, 2^31 - 1]. Ah, I missed that. Sorry! In that case, I'm not sure why this is needed =E2=80=94 the result fits in a non-negative 2's complement signed integer. >> 2^31 is not representable by typical signed 32-bit integers, so this >> will wrap to INT_MIN. Also, I'm not sure why zero is excluded from >> the range. >> > > It is not a good reason but the zero is sometimes inconvenient: if > the value is going to be used as a multiplier in some calculation > it will basically kill the random component. Sure, but anyone using a random number as a multiplier must consider the range of the random function. They should handle rand() =3D=3D 0 (perhaps by this '/ 2 + 1' construct). I don't think that is the responsibility of a rand() function. Best, Conrad From owner-svn-src-all@freebsd.org Sat May 21 22:08:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBD89B44E6E; Sat, 21 May 2016 22:08:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (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 A14641210; Sat, 21 May 2016 22:08:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f171.google.com with SMTP id 190so172154616iow.1; Sat, 21 May 2016 15:08:46 -0700 (PDT) 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 :date:message-id:subject:from:to:cc; bh=bxJTQI3uJKgCL8oJL9w0yRiqHn0Sfc0pIJV/gqPuHn4=; b=mkUYhTDoluMOnIAect81owEZwbNbginppcEY1uvyJDxhcEjF64wAQtLCWQZGFSQzYi xAirU79bhSJCztTtrks0NTu7O+ly0RewH+na466Lkq+aWFvlpgqF+FjFm5L5Ohc01OqR TWLFOYv3hXhpwJ3lqwrRCh197xxTDmUa1bvN97fLCcaAN7R6QYoe3ocD2PP+jznozbm5 +OC6571allPzxCkt08oy9eJ4B0H6O7Zt+3r81VOnUtzX/tpHxxQsxyrgtMbwpxBOJew2 0tYDAe5RDyu6UrIQKWZ938KotpI7gvsQZM6dEoSPfEYWcQr8vVhJLtAM7ccqohY4faQb iTIg== X-Gm-Message-State: ALyK8tLwq2F8jV8SLUWXqXUaiKqvMUui0Qv5CwQOGq9SywY2s3OwcHFOf9g3515FM1pGVQ== X-Received: by 10.107.134.143 with SMTP id q15mr2488670ioi.25.1463868045214; Sat, 21 May 2016 15:00:45 -0700 (PDT) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id j70sm4045279ioi.19.2016.05.21.15.00.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 May 2016 15:00:45 -0700 (PDT) Received: by mail-it0-f49.google.com with SMTP id z123so10010616itg.0; Sat, 21 May 2016 15:00:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.36.131.67 with SMTP id d64mr6704506ite.34.1463868044548; Sat, 21 May 2016 15:00:44 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Sat, 21 May 2016 15:00:44 -0700 (PDT) In-Reply-To: <20160521123908.V1914@besplex.bde.org> References: <201605201950.u4KJoWA5028092@repo.freebsd.org> <20160521081930.I1098@besplex.bde.org> <20160521103528.I1539@besplex.bde.org> <20160521123908.V1914@besplex.bde.org> Date: Sat, 21 May 2016 15:00:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 From: Conrad Meyer To: Bruce Evans Cc: Konstantin Belousov , 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 22:08:47 -0000 On Fri, May 20, 2016 at 9:13 PM, Bruce Evans wrote: > On Fri, 20 May 2016, Conrad Meyer wrote: > >> On Fri, May 20, 2016 at 6:10 PM, Bruce Evans wrote: >>> >>> >>> Signed integers are easier to understand provided calculations with them >>> don't overflow. >> >> >> How? > > > For the same reasons as in applying mathematics. Applying mathematics > was harder before negative numbers were invented. Negative numbers > are actually not easy to understand at the technical level (the usual > representation of them is equivalence classes of pairs of non-negative > numbers), but their properties are easy to understand and work with > once you are familiar with them and don't think about their > implementation details too much. > > Ordinary (real) numbers (including negative ones) also have good ordering > properties for all operations. > > Computer arithmetic can't represent all ordinary numbers, but gets closest > by representing ordinary integers as C signed integers perfectly when no > overflow occurs. > > By using C unsigned integers unnecessarily, you throw out invention of > negative numbers and might have to work with the unfamiliar and badly > behaved ordering on them. C programmers have some experience with this > ordering, but apparently not enough to usually avoid bugs. > >> The rest of the argument seems to be, using u_int is bad because more >> unsigned is always bad. But I haven't seen a good reason to believe >> that is so. > > > Not always bad. Sometimes you must use C unsigned integers to get a full > representation without wasting many bits, or actually want the ordering > of unsigned integers. The main case is representing other C things like > pointers. Differences of pointers are still hard to handle. > > Bruce Thanks for explaining. Can you explain a little bit about the badly behaved ordering of unsigned integers? I am not familiar with that. Best, Conrad From owner-svn-src-all@freebsd.org Sat May 21 22:40:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE9AEB45287 for ; Sat, 21 May 2016 22:40:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm8-vm0.bullet.mail.bf1.yahoo.com (nm8-vm0.bullet.mail.bf1.yahoo.com [98.139.213.95]) (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 4FEF81D99 for ; Sat, 21 May 2016 22:40:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1463870404; bh=5p5BWpprTF4sEinNBCFuO3gC83StiUtZPS0CLc0zsMU=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=PNEfgdgdbmskfyVgmuBpaJZhk4M0d6NiG3KmuuzESt3bGE+oONIYU/ezoA33wM1XIYJV+gU2nSVz/fvMtSMZXLeu7TYXdC91GDML4XbNYD4hFVc/cDi/L+aGbnDYB6voGscrGUdW8kg+XGk9DdSch0LcCmxyRvqwWM/uAnIpYHlwsWR4r8HYpaKh0/f0ffz+N8w6K22eDyo8T0PsWptqZVsNAY8HPl46/kKmHc+MF8FG/gQIF82K4/df8c/HxEtLGK7s2OyIS6U4znfdEPpO6e2CWD5mc43KrPPKVXwIZeA8Yne97yJU9qB//683L7+dFY5iRZOZm2ct9NZxWUpGJw== Received: from [98.139.215.140] by nm8.bullet.mail.bf1.yahoo.com with NNFMP; 21 May 2016 22:40:04 -0000 Received: from [98.139.211.202] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 21 May 2016 22:40:04 -0000 Received: from [127.0.0.1] by smtp211.mail.bf1.yahoo.com with NNFMP; 21 May 2016 22:40:04 -0000 X-Yahoo-Newman-Id: 167905.46780.bm@smtp211.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Zn.kJx0VM1npAMSKZcmBMfUXtpujI7krXMvnEwYseUtz0h5 KJTeCro79RfYFRAO9WnObPrPspumKRTQ6oPuaMfI8INrYzZbbTW91S9rwAhg AqlDCxOxuXB9jGvHzCJAwyx5d7FzIHx5MW_GLOT6S.71GHDTT65iLQo8sfLj sJ3DcMzXl_aDv3.R6Im5FivMPGcNUhrSy.CHADZvW40KWIMmF6_Z8Xzk__Rr pKLZuWn2hXMEsR1qqu5A8jUbXR8Q8dG_Zq3F0I7uunPSgC98N90qDBRT9Nl7 bG_PlzNbC5V1VY6G2RNjfHNTjcKF4N06y8WmKDUmcLCklBKPM9hBUya6fJte IR1u_P29DZR.9.6sWt6tGpVusC6VLdvJw6WTmHnm.K04ySUppm595j1XIWEO 11t.zCNSN3hBODkVXuyVBp53JW2ZiNjiAsGtidmc4mHGDsBnuSFlwaDwAaC3 EZJEiUsn84Dqmva5NExqB2DdZm.EdNTKWXnNfh_tEM4.cC2PAVd1t3oNXA2e 0vtowynyWj0QLxsVBB_LPK1dzA.HWZf9V X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300377 - head/sys/compat/ndis To: cem@FreeBSD.org References: <201605211752.u4LHqiHQ031457@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <262938a6-50bd-b6f4-24c9-895b837a368e@FreeBSD.org> Date: Sat, 21 May 2016 17:40:16 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 22:40:12 -0000 On 05/21/16 16:55, Conrad Meyer wrote: > On Sat, May 21, 2016 at 1:40 PM, Pedro Giffuni wrote: >> >> >> On 05/21/16 14:05, Conrad Meyer wrote: >>> Won't this still return a negative integer in many cases? >>> >>> random(9) returns u_long, whereas this rand() routine returns 'int'. >>> >>> Even on architectures where long is the same size as ordinary >>> integers, the range of possible results of the 'random() / 2 + 1' >>> expression, before implicit cast to signed, is [1, 2^31] (inclusive). >> >> >> According to: >> sys/libkern/random.c >> >> The result is uniform on [0, 2^31 - 1]. > > Ah, I missed that. Sorry! In that case, I'm not sure why this is > needed — the result fits in a non-negative 2's complement signed > integer. > Actually, I had missed it too. And I also had no idea we were working around the zero singularity. I will revert the change and will do an adjustment for the case where we use 0 as a seed (which in MS should be equivalent to 1). Pedro. From owner-svn-src-all@freebsd.org Sat May 21 23:18:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 414BEB45A25; Sat, 21 May 2016 23:18:24 +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 121E61EE2; Sat, 21 May 2016 23:18:24 +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 u4LNINaH028626; Sat, 21 May 2016 23:18:23 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LNINpB028625; Sat, 21 May 2016 23:18:23 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201605212318.u4LNINpB028625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 21 May 2016 23:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300382 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 23:18:24 -0000 Author: alc Date: Sat May 21 23:18:23 2016 New Revision: 300382 URL: https://svnweb.freebsd.org/changeset/base/300382 Log: When descending a shadow chain of objects, it makes no sense to update the current offset (spelled: "fs.pindex") until it is known whether a backing object exists. In fact, if not for the fact that the backing object offset is zero when there is no backing object, this update would produce a broken offset. Reviewed by: kib Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sat May 21 23:14:27 2016 (r300381) +++ head/sys/vm/vm_fault.c Sat May 21 23:18:23 2016 (r300382) @@ -705,7 +705,6 @@ vnode_locked: * Move on to the next object. Lock the next object before * unlocking the current one. */ - fs.pindex += OFF_TO_IDX(fs.object->backing_object_offset); next_object = fs.object->backing_object; if (next_object == NULL) { /* @@ -743,6 +742,8 @@ vnode_locked: vm_object_pip_add(next_object, 1); if (fs.object != fs.first_object) vm_object_pip_wakeup(fs.object); + fs.pindex += + OFF_TO_IDX(fs.object->backing_object_offset); VM_OBJECT_WUNLOCK(fs.object); fs.object = next_object; } From owner-svn-src-all@freebsd.org Sat May 21 23:21:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94E22B45B58; Sat, 21 May 2016 23:21:43 +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 613331215; Sat, 21 May 2016 23:21:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LNLgRp029433; Sat, 21 May 2016 23:21:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LNLgDI029432; Sat, 21 May 2016 23:21:42 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605212321.u4LNLgDI029432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 21 May 2016 23:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300383 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 23:21:43 -0000 Author: avos Date: Sat May 21 23:21:42 2016 New Revision: 300383 URL: https://svnweb.freebsd.org/changeset/base/300383 Log: net80211: send RTM_IEEE80211_SCAN event when scan was cancelled. wpa_supplicant(8) expects to see 'scan complete' event after every scan command; in case, when event is not sent it will hang for indefinite time. PR: 209198 Modified: head/sys/net80211/ieee80211_scan_sw.c Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Sat May 21 23:18:23 2016 (r300382) +++ head/sys/net80211/ieee80211_scan_sw.c Sat May 21 23:21:42 2016 (r300383) @@ -865,10 +865,10 @@ scan_done(struct ieee80211_scan_state *s */ if (scandone) { vap->iv_sta_ps(vap, 0); - if (ss->ss_next >= ss->ss_last) { - ieee80211_notify_scan_done(vap); + if (ss->ss_next >= ss->ss_last) ic->ic_flags_ext &= ~IEEE80211_FEXT_BGSCAN; - } + + ieee80211_notify_scan_done(vap); } ss_priv->ss_iflags &= ~(ISCAN_CANCEL|ISCAN_ABORT); ss_priv->ss_scanend = 0;